diff --git a/libvmaf/tools/cli_parse.c b/libvmaf/tools/cli_parse.c index 3a3f88e5a..73a569100 100644 --- a/libvmaf/tools/cli_parse.c +++ b/libvmaf/tools/cli_parse.c @@ -320,6 +320,12 @@ static void aom_ctc_v5_0(CLISettings *settings, const char *app) aom_ctc_v4_0(settings, app); } +static void aom_ctc_v6_0(CLISettings *settings, const char *app) +{ + aom_ctc_v5_0(settings, app); + settings->common_bitdepth = true; +} + static void parse_aom_ctc(CLISettings *settings, const char *const optarg, const char *const app) { @@ -351,6 +357,11 @@ static void parse_aom_ctc(CLISettings *settings, const char *const optarg, return; } + if (!strcmp(optarg, "v6.0")) { + aom_ctc_v6_0(settings, app); + return; + } + usage(app, "bad aom_ctc version \"%s\"", optarg); } diff --git a/libvmaf/tools/cli_parse.h b/libvmaf/tools/cli_parse.h index f589dc1e2..94b3f0590 100644 --- a/libvmaf/tools/cli_parse.h +++ b/libvmaf/tools/cli_parse.h @@ -48,6 +48,7 @@ typedef struct { unsigned thread_cnt; bool no_prediction; bool quiet; + bool common_bitdepth; unsigned cpumask; unsigned gpumask; } CLISettings; diff --git a/libvmaf/tools/vmaf.c b/libvmaf/tools/vmaf.c index b0361f71a..8029eb39c 100644 --- a/libvmaf/tools/vmaf.c +++ b/libvmaf/tools/vmaf.c @@ -27,7 +27,7 @@ static enum VmafPixelFormat pix_fmt_map(int pf) } } -static int validate_videos(video_input *vid1, video_input *vid2) +static int validate_videos(video_input *vid1, video_input *vid2, bool common_bitdepth) { int err_cnt = 0; @@ -52,6 +52,12 @@ static int validate_videos(video_input *vid1, video_input *vid2) err_cnt++; } + if (!common_bitdepth && info1.depth != info2.depth) { + fprintf(stderr, "bitdepths do not match: %d, %d\n", + info1.depth, info2.depth); + err_cnt++; + } + if (info1.depth < 8 || info1.depth > 16) { fprintf(stderr, "unsupported bitdepth: %d\n", info1.depth); err_cnt++; @@ -208,7 +214,7 @@ int main(int argc, char *argv[]) return -1; } - err = validate_videos(&vid_ref, &vid_dist); + err = validate_videos(&vid_ref, &vid_dist, c.common_bitdepth); if (err) { fprintf(stderr, "videos are incompatible, %d %s.\n", err, err == 1 ? "problem" : "problems");