sdeng | 29c6215 | 2019-12-09 12:44:18 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved |
| 3 | * |
| 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | */ |
| 11 | |
| 12 | #ifndef AOM_AOM_DSP_VMAF_H_ |
| 13 | #define AOM_AOM_DSP_VMAF_H_ |
| 14 | |
James Zern | 43e17b6 | 2022-03-17 11:33:11 -0700 | [diff] [blame] | 15 | #include <libvmaf/libvmaf.h> |
Sai Deng | b2a3ecb | 2020-09-02 15:19:39 -0700 | [diff] [blame] | 16 | #include <stdbool.h> |
sdeng | 29c6215 | 2019-12-09 12:44:18 -0800 | [diff] [blame] | 17 | |
James Zern | 43e17b6 | 2022-03-17 11:33:11 -0700 | [diff] [blame] | 18 | #include "aom_scale/yv12config.h" |
Sai Deng | 8e56b12 | 2020-08-31 11:54:45 -0700 | [diff] [blame] | 19 | |
Sai Deng | b53a4d7 | 2021-03-17 15:15:10 -0700 | [diff] [blame] | 20 | void aom_init_vmaf_context(VmafContext **vmaf_context, VmafModel *vmaf_model, |
| 21 | bool cal_vmaf_neg); |
| 22 | void aom_close_vmaf_context(VmafContext *vmaf_context); |
Sai Deng | 5b2df81 | 2020-09-01 14:24:49 -0700 | [diff] [blame] | 23 | |
Sai Deng | b53a4d7 | 2021-03-17 15:15:10 -0700 | [diff] [blame] | 24 | void aom_init_vmaf_model(VmafModel **vmaf_model, const char *model_path); |
| 25 | void aom_close_vmaf_model(VmafModel *vmaf_model); |
Sai Deng | 5b2df81 | 2020-09-01 14:24:49 -0700 | [diff] [blame] | 26 | |
Sai Deng | b53a4d7 | 2021-03-17 15:15:10 -0700 | [diff] [blame] | 27 | void aom_calc_vmaf(VmafModel *vmaf_model, const YV12_BUFFER_CONFIG *source, |
sdeng | e79f641 | 2020-02-24 14:09:33 -0800 | [diff] [blame] | 28 | const YV12_BUFFER_CONFIG *distorted, int bit_depth, |
Sai Deng | b53a4d7 | 2021-03-17 15:15:10 -0700 | [diff] [blame] | 29 | bool cal_vmaf_neg, double *vmaf); |
sdeng | 29c6215 | 2019-12-09 12:44:18 -0800 | [diff] [blame] | 30 | |
Sai Deng | b53a4d7 | 2021-03-17 15:15:10 -0700 | [diff] [blame] | 31 | void aom_read_vmaf_image(VmafContext *vmaf_context, |
| 32 | const YV12_BUFFER_CONFIG *source, |
| 33 | const YV12_BUFFER_CONFIG *distorted, int bit_depth, |
| 34 | int frame_index); |
| 35 | |
| 36 | double aom_calc_vmaf_at_index(VmafContext *vmaf_context, VmafModel *vmaf_model, |
| 37 | int frame_index); |
| 38 | |
| 39 | void aom_flush_vmaf_context(VmafContext *vmaf_context); |
Sai Deng | 8e56b12 | 2020-08-31 11:54:45 -0700 | [diff] [blame] | 40 | |
sdeng | 29c6215 | 2019-12-09 12:44:18 -0800 | [diff] [blame] | 41 | #endif // AOM_AOM_DSP_VMAF_H_ |