|
| 1 | +From 2611a9a0e3d96ba7d63549c6b57a821046ddd6bd Mon Sep 17 00:00:00 2001 |
| 2 | +From: Christopher Degawa <ccom@randomderp.com> |
| 3 | +Date: Mon, 6 Dec 2021 22:48:22 -0600 |
| 4 | +Subject: [PATCH] libvmaf: add aom_ctc option |
| 5 | + |
| 6 | +Signed-off-by: Christopher Degawa <ccom@randomderp.com> |
| 7 | +--- |
| 8 | + libavfilter/vf_libvmaf.c | 11 +++++++++++ |
| 9 | + 1 file changed, 11 insertions(+) |
| 10 | + |
| 11 | +diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c |
| 12 | +index 2586f37d99..ad52bd2a51 100644 |
| 13 | +--- a/libavfilter/vf_libvmaf.c |
| 14 | ++++ b/libavfilter/vf_libvmaf.c |
| 15 | +@@ -58,6 +58,7 @@ typedef struct LIBVMAFContext { |
| 16 | + unsigned model_cnt; |
| 17 | + unsigned frame_cnt; |
| 18 | + unsigned bpc; |
| 19 | ++ int aom_ctc; |
| 20 | + } LIBVMAFContext; |
| 21 | + |
| 22 | + #define OFFSET(x) offsetof(LIBVMAFContext, x) |
| 23 | +@@ -78,6 +79,7 @@ static const AVOption libvmaf_options[] = { |
| 24 | + {"enable_conf_interval", "model='enable_conf_interval=true'.", OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, |
| 25 | + {"model", "Set the model to be used for computing vmaf.", OFFSET(model_cfg), AV_OPT_TYPE_STRING, {.str="version=vmaf_v0.6.1"}, 0, 1, FLAGS}, |
| 26 | + {"feature", "Set the feature to be used for computing vmaf.", OFFSET(feature_cfg), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, |
| 27 | ++ {"aom_ctc", "Set the options for aom_ctc v1.0", OFFSET(aom_ctc), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS}, |
| 28 | + { NULL } |
| 29 | + }; |
| 30 | + |
| 31 | +@@ -526,6 +528,15 @@ static av_cold int init(AVFilterContext *ctx) |
| 32 | + if (err) |
| 33 | + return err; |
| 34 | + |
| 35 | ++ if (s->aom_ctc) { |
| 36 | ++ av_free(s->model_cfg); |
| 37 | ++ av_free(s->feature_cfg); |
| 38 | ++ s->model_cfg = av_strdup( |
| 39 | ++ "version=vmaf_v0.6.1:name=vmaf|version=vmaf_v0.6.1neg:name=vmaf_neg"); |
| 40 | ++ s->feature_cfg = av_strdup( |
| 41 | ++ "name=psnr:reduced_hbd_peak=true:enable_apsnr=true:min_sse=0.5|" |
| 42 | ++ "name=float_ssim:enable_db=true:clip_db=true"); |
| 43 | ++ } |
| 44 | + err = parse_models(ctx); |
| 45 | + if (err) |
| 46 | + return err; |
| 47 | +-- |
| 48 | +2.39.2 |
| 49 | + |
0 commit comments