Skip to content

Commit

Permalink
add --aom_ctc v6.0, enabling convert_bitdepth
Browse files Browse the repository at this point in the history
  • Loading branch information
nilfm99 authored and kylophone committed Nov 20, 2023
1 parent 2ac1f28 commit 9ae6f90
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
11 changes: 11 additions & 0 deletions libvmaf/tools/cli_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions libvmaf/tools/cli_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ typedef struct {
unsigned thread_cnt;
bool no_prediction;
bool quiet;
bool common_bitdepth;
unsigned cpumask;
unsigned gpumask;
} CLISettings;
Expand Down
10 changes: 8 additions & 2 deletions libvmaf/tools/vmaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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++;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 9ae6f90

Please sign in to comment.