blob: b539cf8b76e7d1e4e05ad7a15242a9c8058f5260 [file] [log] [blame]
sdeng29c62152019-12-09 12:44:18 -08001/*
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 Zern43e17b62022-03-17 11:33:11 -070015#include <libvmaf/libvmaf.h>
Sai Dengb2a3ecb2020-09-02 15:19:39 -070016#include <stdbool.h>
sdeng29c62152019-12-09 12:44:18 -080017
James Zern43e17b62022-03-17 11:33:11 -070018#include "aom_scale/yv12config.h"
Sai Deng8e56b122020-08-31 11:54:45 -070019
Sai Dengb53a4d72021-03-17 15:15:10 -070020void aom_init_vmaf_context(VmafContext **vmaf_context, VmafModel *vmaf_model,
21 bool cal_vmaf_neg);
22void aom_close_vmaf_context(VmafContext *vmaf_context);
Sai Deng5b2df812020-09-01 14:24:49 -070023
Sai Dengb53a4d72021-03-17 15:15:10 -070024void aom_init_vmaf_model(VmafModel **vmaf_model, const char *model_path);
25void aom_close_vmaf_model(VmafModel *vmaf_model);
Sai Deng5b2df812020-09-01 14:24:49 -070026
Sai Dengb53a4d72021-03-17 15:15:10 -070027void aom_calc_vmaf(VmafModel *vmaf_model, const YV12_BUFFER_CONFIG *source,
sdenge79f6412020-02-24 14:09:33 -080028 const YV12_BUFFER_CONFIG *distorted, int bit_depth,
Sai Dengb53a4d72021-03-17 15:15:10 -070029 bool cal_vmaf_neg, double *vmaf);
sdeng29c62152019-12-09 12:44:18 -080030
Sai Dengb53a4d72021-03-17 15:15:10 -070031void 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
36double aom_calc_vmaf_at_index(VmafContext *vmaf_context, VmafModel *vmaf_model,
37 int frame_index);
38
39void aom_flush_vmaf_context(VmafContext *vmaf_context);
Sai Deng8e56b122020-08-31 11:54:45 -070040
sdeng29c62152019-12-09 12:44:18 -080041#endif // AOM_AOM_DSP_VMAF_H_