|
libvmaf
|
#include <stdint.h>#include <stdio.h>#include "libvmaf/model.h"#include "libvmaf/picture.h"#include "libvmaf/feature.h"

Go to the source code of this file.
Data Structures | |
| struct | VmafConfiguration |
| Configuration needed to initialize a VmafContext. More... | |
| struct | VmafPictureConfiguration |
Typedefs | |
| typedef struct VmafContext | VmafContext |
Functions | |
| int | vmaf_init (VmafContext **vmaf, VmafConfiguration cfg) |
| int | vmaf_use_features_from_model (VmafContext *vmaf, VmafModel *model) |
| int | vmaf_use_features_from_model_collection (VmafContext *vmaf, VmafModelCollection *model_collection) |
| int | vmaf_use_feature (VmafContext *vmaf, const char *feature_name, VmafFeatureDictionary *opts_dict) |
| int | vmaf_import_feature_score (VmafContext *vmaf, const char *feature_name, double value, unsigned index) |
| int | vmaf_read_pictures (VmafContext *vmaf, VmafPicture *ref, VmafPicture *dist, unsigned index) |
| int | vmaf_score_at_index (VmafContext *vmaf, VmafModel *model, double *score, unsigned index) |
| int | vmaf_score_at_index_model_collection (VmafContext *vmaf, VmafModelCollection *model_collection, VmafModelCollectionScore *score, unsigned index) |
| int | vmaf_feature_score_at_index (VmafContext *vmaf, const char *feature_name, double *score, unsigned index) |
| int | vmaf_score_pooled (VmafContext *vmaf, VmafModel *model, enum VmafPoolingMethod pool_method, double *score, unsigned index_low, unsigned index_high) |
| int | vmaf_score_pooled_model_collection (VmafContext *vmaf, VmafModelCollection *model_collection, enum VmafPoolingMethod pool_method, VmafModelCollectionScore *score, unsigned index_low, unsigned index_high) |
| int | vmaf_feature_score_pooled (VmafContext *vmaf, const char *feature_name, enum VmafPoolingMethod pool_method, double *score, unsigned index_low, unsigned index_high) |
| int | vmaf_preallocate_pictures (VmafContext *vmaf, VmafPictureConfiguration cfg) |
| int | vmaf_fetch_preallocated_picture (VmafContext *vmaf, VmafPicture *pic) |
| int | vmaf_close (VmafContext *vmaf) |
| int | vmaf_write_output (VmafContext *vmaf, const char *output_path, enum VmafOutputFormat fmt) |
| const char * | vmaf_version (void) |
| typedef struct VmafContext VmafContext |
| enum VmafLogLevel |
Copyright 2016-2020 Netflix, Inc.
Licensed under the BSD+Patent License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSDplusPatent
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| Enumerator | |
|---|---|
| VMAF_LOG_LEVEL_NONE | |
| VMAF_LOG_LEVEL_ERROR | |
| VMAF_LOG_LEVEL_WARNING | |
| VMAF_LOG_LEVEL_INFO | |
| VMAF_LOG_LEVEL_DEBUG | |
| enum VmafOutputFormat |
| enum VmafPoolingMethod |
| int vmaf_close | ( | VmafContext * | vmaf | ) |
Close a VMAF instance and free all associated memory.
| vmaf | The VMAF instance to close. |
| int vmaf_feature_score_at_index | ( | VmafContext * | vmaf, |
| const char * | feature_name, | ||
| double * | score, | ||
| unsigned | index ) |
Fetch feature score at specific index.
| vmaf | The VMAF context allocated with vmaf_init(). |
| feature_name | Name of the feature to fetch. |
| index | Picture index. |
| score | Score. |
| int vmaf_feature_score_pooled | ( | VmafContext * | vmaf, |
| const char * | feature_name, | ||
| enum VmafPoolingMethod | pool_method, | ||
| double * | score, | ||
| unsigned | index_low, | ||
| unsigned | index_high ) |
Pooled feature score for a specific interval.
| vmaf | The VMAF context allocated with vmaf_init(). |
| feature_name | Name of the feature to fetch. |
| pool_method | Temporal pooling method to use. |
| score | Pooled score. |
| index_low | Low picture index of pooling interval. |
| index_high | High picture index of pooling interval. |
| int vmaf_fetch_preallocated_picture | ( | VmafContext * | vmaf, |
| VmafPicture * | pic ) |
Fetch a preallocated picture from the picture pool. The picture must be returned to the pool via vmaf_picture_unref() when done. Pictures automatically return to the pool when their reference count reaches zero.
| vmaf | VMAF context initialized with vmaf_preallocate_pictures(). |
| pic | Output picture from the pool. |
| int vmaf_import_feature_score | ( | VmafContext * | vmaf, |
| const char * | feature_name, | ||
| double | value, | ||
| unsigned | index ) |
Import an external feature score. Useful when pre-computed feature scores are available. Also useful in the case where there is no libvmaf feature extractor implementation for a required feature.
| vmaf | The VMAF context allocated with vmaf_init(). |
| feature_name | Name of feature. |
| value | Score. |
| index | Picture index. |
| int vmaf_init | ( | VmafContext ** | vmaf, |
| VmafConfiguration | cfg ) |
Allocate and open a VMAF instance.
| vmaf | The VMAF instance to open. To be used in further libvmaf api calls. $vmaf will be set to the allocated context. Context should be cleaned up with vmaf_close() when finished. |
| cfg | Configuration parameters. |
| int vmaf_preallocate_pictures | ( | VmafContext * | vmaf, |
| VmafPictureConfiguration | cfg ) |
Preallocate pictures for use with multi-threaded feature extraction. Pictures are allocated once and automatically returned to the pool when fully unref'd, avoiding repeated allocation/deallocation overhead.
| vmaf | VMAF context allocated with vmaf_init(). |
| cfg | Picture configuration including dimensions and pool size. |
| int vmaf_read_pictures | ( | VmafContext * | vmaf, |
| VmafPicture * | ref, | ||
| VmafPicture * | dist, | ||
| unsigned | index ) |
Read a pair of pictures and queue them for eventual feature extraction. This should be called after feature extractors are registered via vmaf_use_features_from_model() and/or vmaf_use_feature(). VmafContext will take ownership of both VmafPictures (ref and dist) and vmaf_picture_unref().
When you're done reading pictures call this function again with both ref and dist set to NULL to flush all feature extractors.
| vmaf | The VMAF context allocated with vmaf_init(). |
| ref | Reference picture. |
| dist | Distorted picture. |
| index | Picture index. |
| int vmaf_score_at_index | ( | VmafContext * | vmaf, |
| VmafModel * | model, | ||
| double * | score, | ||
| unsigned | index ) |
Predict VMAF score at specific index.
| vmaf | The VMAF context allocated with vmaf_init(). |
| model | Opaque model context. |
| index | Picture index. |
| score | Predicted score. |
| int vmaf_score_at_index_model_collection | ( | VmafContext * | vmaf, |
| VmafModelCollection * | model_collection, | ||
| VmafModelCollectionScore * | score, | ||
| unsigned | index ) |
Predict VMAF score at specific index, using a model collection.
| vmaf | The VMAF context allocated with vmaf_init(). |
| model_collection | Opaque model collection context. |
| index | Picture index. |
| score | Predicted score. |
| int vmaf_score_pooled | ( | VmafContext * | vmaf, |
| VmafModel * | model, | ||
| enum VmafPoolingMethod | pool_method, | ||
| double * | score, | ||
| unsigned | index_low, | ||
| unsigned | index_high ) |
Pooled VMAF score for a specific interval.
| vmaf | The VMAF context allocated with vmaf_init(). |
| model | Opaque model context. |
| pool_method | Temporal pooling method to use. |
| score | Pooled score. |
| index_low | Low picture index of pooling interval. |
| index_high | High picture index of pooling interval. |
| int vmaf_score_pooled_model_collection | ( | VmafContext * | vmaf, |
| VmafModelCollection * | model_collection, | ||
| enum VmafPoolingMethod | pool_method, | ||
| VmafModelCollectionScore * | score, | ||
| unsigned | index_low, | ||
| unsigned | index_high ) |
Pooled VMAF score for a specific interval, using a model collection.
| vmaf | The VMAF context allocated with vmaf_init(). |
| model_collection | Opaque model collection context. |
| pool_method | Temporal pooling method to use. |
| score | Pooled score. |
| index_low | Low picture index of pooling interval. |
| index_high | High picture index of pooling interval. |
| int vmaf_use_feature | ( | VmafContext * | vmaf, |
| const char * | feature_name, | ||
| VmafFeatureDictionary * | opts_dict ) |
Register specific feature extractor. Useful when a specific/additional feature is required, usually one which is not already provided by a model via vmaf_use_features_from_model(). This may be called multiple times. VmafContext will take ownership of the VmafFeatureDictionary (opts_dict). Use vmaf_feature_dictionary_free() only in the case of failure.
| vmaf | The VMAF context allocated with vmaf_init(). |
| feature_name | Name of feature. |
| opts_dict | Feature extractor options set via vmaf_feature_dictionary_set(). If no special options are required this parameter can be set to NULL. |
| int vmaf_use_features_from_model | ( | VmafContext * | vmaf, |
| VmafModel * | model ) |
Register feature extractors required by a specific VmafModel. This may be called multiple times using different models. In this case, the registered feature extractors will form a set, and any features required by multiple models will only be extracted once.
| vmaf | The VMAF context allocated with vmaf_init(). |
| model | Opaque model context. |
| int vmaf_use_features_from_model_collection | ( | VmafContext * | vmaf, |
| VmafModelCollection * | model_collection ) |
Register feature extractors required by a specific VmafModelCollection Like vmaf_use_features_from_model(), this function may be called multiple times using different model collections.
| vmaf | The VMAF context allocated with vmaf_init(). |
| model_collection | Opaque model collection context. |
| const char * vmaf_version | ( | void | ) |
Get libvmaf version.
| int vmaf_write_output | ( | VmafContext * | vmaf, |
| const char * | output_path, | ||
| enum VmafOutputFormat | fmt ) |
Write VMAF stats to an output file.
| vmaf | The VMAF context allocated with vmaf_init(). |
| output_path | Output file path. |
| fmt | Output file format. See enum VmafOutputFormat for options. |