/* automatically generated by rust-bindgen 0.72.1 */
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::bare_urls)]
pub const VMAF_API_VERSION_MAJOR: u32 = 3;
pub const VMAF_API_VERSION_MINOR: u32 = 2;
pub const VMAF_API_VERSION_PATCH: u32 = 0;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafFeatureDictionary {
_unused: [u8; 0],
}
unsafe extern "C" {
pub fn vmaf_feature_dictionary_set(
dict: *mut *mut VmafFeatureDictionary,
key: *const ::std::os::raw::c_char,
val: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_feature_dictionary_free(
dict: *mut *mut VmafFeatureDictionary,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModel {
_unused: [u8; 0],
}
pub const VmafModelFlags_VMAF_MODEL_FLAGS_DEFAULT: VmafModelFlags = 0;
pub const VmafModelFlags_VMAF_MODEL_FLAG_DISABLE_CLIP: VmafModelFlags = 1;
pub const VmafModelFlags_VMAF_MODEL_FLAG_ENABLE_TRANSFORM: VmafModelFlags = 2;
pub const VmafModelFlags_VMAF_MODEL_FLAG_DISABLE_TRANSFORM: VmafModelFlags = 4;
pub type VmafModelFlags = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModelConfig {
pub name: *const ::std::os::raw::c_char,
pub flags: u64,
}
unsafe extern "C" {
pub fn vmaf_model_load(
model: *mut *mut VmafModel,
cfg: *mut VmafModelConfig,
version: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_model_load_from_path(
model: *mut *mut VmafModel,
cfg: *mut VmafModelConfig,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_model_feature_overload(
model: *mut VmafModel,
feature_name: *const ::std::os::raw::c_char,
opts_dict: *mut VmafFeatureDictionary,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_model_destroy(model: *mut VmafModel);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModelCollection {
_unused: [u8; 0],
}
pub const VmafModelCollectionScoreType_VMAF_MODEL_COLLECTION_SCORE_UNKNOWN:
VmafModelCollectionScoreType = 0;
pub const VmafModelCollectionScoreType_VMAF_MODEL_COLLECTION_SCORE_BOOTSTRAP:
VmafModelCollectionScoreType = 1;
pub type VmafModelCollectionScoreType = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModelCollectionScore {
pub type_: VmafModelCollectionScoreType,
pub bootstrap: VmafModelCollectionScore__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModelCollectionScore__bindgen_ty_1 {
pub bagging_score: f64,
pub stddev: f64,
pub ci: VmafModelCollectionScore__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModelCollectionScore__bindgen_ty_1__bindgen_ty_1 {
pub p95: VmafModelCollectionScore__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafModelCollectionScore__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
pub lo: f64,
pub hi: f64,
}
unsafe extern "C" {
pub fn vmaf_model_collection_load(
model: *mut *mut VmafModel,
model_collection: *mut *mut VmafModelCollection,
cfg: *mut VmafModelConfig,
version: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_model_collection_load_from_path(
model: *mut *mut VmafModel,
model_collection: *mut *mut VmafModelCollection,
cfg: *mut VmafModelConfig,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_model_collection_feature_overload(
model: *mut VmafModel,
model_collection: *mut *mut VmafModelCollection,
feature_name: *const ::std::os::raw::c_char,
opts_dict: *mut VmafFeatureDictionary,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_model_collection_destroy(model_collection: *mut VmafModelCollection);
}
pub const VmafPixelFormat_VMAF_PIX_FMT_UNKNOWN: VmafPixelFormat = 0;
pub const VmafPixelFormat_VMAF_PIX_FMT_YUV420P: VmafPixelFormat = 1;
pub const VmafPixelFormat_VMAF_PIX_FMT_YUV422P: VmafPixelFormat = 2;
pub const VmafPixelFormat_VMAF_PIX_FMT_YUV444P: VmafPixelFormat = 3;
pub const VmafPixelFormat_VMAF_PIX_FMT_YUV400P: VmafPixelFormat = 4;
pub type VmafPixelFormat = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafRef {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafPicture {
pub pix_fmt: VmafPixelFormat,
pub bpc: ::std::os::raw::c_uint,
pub w: [::std::os::raw::c_uint; 3usize],
pub h: [::std::os::raw::c_uint; 3usize],
pub stride: [isize; 3usize],
pub data: [*mut ::std::os::raw::c_void; 3usize],
pub ref_: *mut VmafRef,
pub priv_: *mut ::std::os::raw::c_void,
}
unsafe extern "C" {
pub fn vmaf_picture_alloc(
pic: *mut VmafPicture,
pix_fmt: VmafPixelFormat,
bpc: ::std::os::raw::c_uint,
w: ::std::os::raw::c_uint,
h: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn vmaf_picture_unref(pic: *mut VmafPicture) -> ::std::os::raw::c_int;
}
pub const VmafLogLevel_VMAF_LOG_LEVEL_NONE: VmafLogLevel = 0;
pub const VmafLogLevel_VMAF_LOG_LEVEL_ERROR: VmafLogLevel = 1;
pub const VmafLogLevel_VMAF_LOG_LEVEL_WARNING: VmafLogLevel = 2;
pub const VmafLogLevel_VMAF_LOG_LEVEL_INFO: VmafLogLevel = 3;
pub const VmafLogLevel_VMAF_LOG_LEVEL_DEBUG: VmafLogLevel = 4;
pub type VmafLogLevel = ::std::os::raw::c_uint;
pub const VmafOutputFormat_VMAF_OUTPUT_FORMAT_NONE: VmafOutputFormat = 0;
pub const VmafOutputFormat_VMAF_OUTPUT_FORMAT_XML: VmafOutputFormat = 1;
pub const VmafOutputFormat_VMAF_OUTPUT_FORMAT_JSON: VmafOutputFormat = 2;
pub const VmafOutputFormat_VMAF_OUTPUT_FORMAT_CSV: VmafOutputFormat = 3;
pub const VmafOutputFormat_VMAF_OUTPUT_FORMAT_SUB: VmafOutputFormat = 4;
pub type VmafOutputFormat = ::std::os::raw::c_uint;
pub const VmafPoolingMethod_VMAF_POOL_METHOD_UNKNOWN: VmafPoolingMethod = 0;
pub const VmafPoolingMethod_VMAF_POOL_METHOD_MIN: VmafPoolingMethod = 1;
pub const VmafPoolingMethod_VMAF_POOL_METHOD_MAX: VmafPoolingMethod = 2;
pub const VmafPoolingMethod_VMAF_POOL_METHOD_MEAN: VmafPoolingMethod = 3;
pub const VmafPoolingMethod_VMAF_POOL_METHOD_HARMONIC_MEAN: VmafPoolingMethod = 4;
pub const VmafPoolingMethod_VMAF_POOL_METHOD_NB: VmafPoolingMethod = 5;
pub type VmafPoolingMethod = ::std::os::raw::c_uint;
#[doc = " @struct VmafConfiguration\n @brief Configuration needed to initialize a `VmafContext`\n\n @param log_level How verbose the logger is.\n\n @param n_threads How many threads can be used to run\n feature extractors concurrently.\n\n @param n_subsample Compute scores only every N frames.\n Note that setting an even value for N can lead to\n inaccurate results. For more detail, see\n https://github.com/Netflix/vmaf/issues/1214\n\n @param cpumask Restrict permitted CPU instruction sets.\n if cpumask & 1: disable SSE2 / disable NEON (on arm64)\n if cpumask & 2: disable SSE3/SSSE3\n if cpumask & 4: disable SSE4.1\n if cpumask & 8: disable AVX2\n if cpumask & 16: disable AVX512\n if cpumask & 32: disable AVX512ICL\n\n @param gpumask Restrict permitted GPU operations.\n if gpumask: disable CUDA"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafConfiguration {
pub log_level: VmafLogLevel,
pub n_threads: ::std::os::raw::c_uint,
pub n_subsample: ::std::os::raw::c_uint,
pub cpumask: u64,
pub gpumask: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafContext {
_unused: [u8; 0],
}
unsafe extern "C" {
#[doc = " Allocate and open a VMAF instance.\n\n @param vmaf The VMAF instance to open.\n To be used in further libvmaf api calls.\n $vmaf will be set to the allocated context.\n Context should be cleaned up with `vmaf_close()` when finished.\n\n @param cfg Configuration parameters.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_init(vmaf: *mut *mut VmafContext, cfg: VmafConfiguration) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Register feature extractors required by a specific `VmafModel`.\n This may be called multiple times using different models.\n In this case, the registered feature extractors will form a set, and any\n features required by multiple models will only be extracted once.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param model Opaque model context.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_use_features_from_model(
vmaf: *mut VmafContext,
model: *mut VmafModel,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Register feature extractors required by a specific `VmafModelCollection`\n Like `vmaf_use_features_from_model()`, this function may be called\n multiple times using different model collections.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param model_collection Opaque model collection context.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_use_features_from_model_collection(
vmaf: *mut VmafContext,
model_collection: *mut VmafModelCollection,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Register specific feature extractor.\n Useful when a specific/additional feature is required, usually one which\n is not already provided by a model via `vmaf_use_features_from_model()`.\n This may be called multiple times. `VmafContext` will take ownership of the\n `VmafFeatureDictionary` (`opts_dict`). Use `vmaf_feature_dictionary_free()`\n only in the case of failure.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param feature_name Name of feature.\n\n @param opts_dict Feature extractor options set via\n `vmaf_feature_dictionary_set()`. If no special options\n are required this parameter can be set to NULL.\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_use_feature(
vmaf: *mut VmafContext,
feature_name: *const ::std::os::raw::c_char,
opts_dict: *mut VmafFeatureDictionary,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Import an external feature score.\n Useful when pre-computed feature scores are available.\n Also useful in the case where there is no libvmaf feature extractor\n implementation for a required feature.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param feature_name Name of feature.\n\n @param value Score.\n\n @param index Picture index.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_import_feature_score(
vmaf: *mut VmafContext,
feature_name: *const ::std::os::raw::c_char,
value: f64,
index: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Read a pair of pictures and queue them for eventual feature extraction.\n This should be called after feature extractors are registered via\n `vmaf_use_features_from_model()` and/or `vmaf_use_feature()`.\n `VmafContext` will take ownership of both `VmafPicture`s (`ref` and `dist`)\n and `vmaf_picture_unref()`.\n\n When you're done reading pictures call this function again with both `ref`\n and `dist` set to NULL to flush all feature extractors.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param ref Reference picture.\n\n @param dist Distorted picture.\n\n @param index Picture index.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_read_pictures(
vmaf: *mut VmafContext,
ref_: *mut VmafPicture,
dist: *mut VmafPicture,
index: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Predict VMAF score at specific index.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param model Opaque model context.\n\n @param index Picture index.\n\n @param score Predicted score.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_score_at_index(
vmaf: *mut VmafContext,
model: *mut VmafModel,
score: *mut f64,
index: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Predict VMAF score at specific index, using a model collection.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param model_collection Opaque model collection context.\n\n @param index Picture index.\n\n @param score Predicted score.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_score_at_index_model_collection(
vmaf: *mut VmafContext,
model_collection: *mut VmafModelCollection,
score: *mut VmafModelCollectionScore,
index: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Fetch feature score at specific index.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param feature_name Name of the feature to fetch.\n\n @param index Picture index.\n\n @param score Score.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_feature_score_at_index(
vmaf: *mut VmafContext,
feature_name: *const ::std::os::raw::c_char,
score: *mut f64,
index: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Pooled VMAF score for a specific interval.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param model Opaque model context.\n\n @param pool_method Temporal pooling method to use.\n\n @param score Pooled score.\n\n @param index_low Low picture index of pooling interval.\n\n @param index_high High picture index of pooling interval.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_score_pooled(
vmaf: *mut VmafContext,
model: *mut VmafModel,
pool_method: VmafPoolingMethod,
score: *mut f64,
index_low: ::std::os::raw::c_uint,
index_high: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Pooled VMAF score for a specific interval, using a model collection.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param model_collection Opaque model collection context.\n\n @param pool_method Temporal pooling method to use.\n\n @param score Pooled score.\n\n @param index_low Low picture index of pooling interval.\n\n @param index_high High picture index of pooling interval.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_score_pooled_model_collection(
vmaf: *mut VmafContext,
model_collection: *mut VmafModelCollection,
pool_method: VmafPoolingMethod,
score: *mut VmafModelCollectionScore,
index_low: ::std::os::raw::c_uint,
index_high: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Pooled feature score for a specific interval.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param feature_name Name of the feature to fetch.\n\n @param pool_method Temporal pooling method to use.\n\n @param score Pooled score.\n\n @param index_low Low picture index of pooling interval.\n\n @param index_high High picture index of pooling interval.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_feature_score_pooled(
vmaf: *mut VmafContext,
feature_name: *const ::std::os::raw::c_char,
pool_method: VmafPoolingMethod,
score: *mut f64,
index_low: ::std::os::raw::c_uint,
index_high: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
#[doc = " Picture Pool Configuration"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafPictureConfiguration {
pub pic_params: VmafPictureConfiguration__bindgen_ty_1,
pub pic_cnt: ::std::os::raw::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmafPictureConfiguration__bindgen_ty_1 {
pub w: ::std::os::raw::c_uint,
pub h: ::std::os::raw::c_uint,
pub bpc: ::std::os::raw::c_uint,
pub pix_fmt: VmafPixelFormat,
}
unsafe extern "C" {
#[doc = " Preallocate pictures for use with multi-threaded feature extraction.\n Pictures are allocated once and automatically returned to the pool when\n fully unref'd, avoiding repeated allocation/deallocation overhead.\n\n @param vmaf VMAF context allocated with `vmaf_init()`.\n\n @param cfg Picture configuration including dimensions and pool size.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_preallocate_pictures(
vmaf: *mut VmafContext,
cfg: VmafPictureConfiguration,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Fetch a preallocated picture from the picture pool.\n The picture must be returned to the pool via vmaf_picture_unref() when done.\n Pictures automatically return to the pool when their reference count reaches zero.\n\n @param vmaf VMAF context initialized with `vmaf_preallocate_pictures()`.\n\n @param pic Output picture from the pool.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_fetch_preallocated_picture(
vmaf: *mut VmafContext,
pic: *mut VmafPicture,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Close a VMAF instance and free all associated memory.\n\n @param vmaf The VMAF instance to close.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_close(vmaf: *mut VmafContext) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Write VMAF stats to an output file.\n\n @param vmaf The VMAF context allocated with `vmaf_init()`.\n\n @param output_path Output file path.\n\n @param fmt Output file format.\n See `enum VmafOutputFormat` for options.\n\n\n @return 0 on success, or < 0 (a negative errno code) on error."]
pub fn vmaf_write_output(
vmaf: *mut VmafContext,
output_path: *const ::std::os::raw::c_char,
fmt: VmafOutputFormat,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get libvmaf version."]
pub fn vmaf_version() -> *const ::std::os::raw::c_char;
}