Skip to content

Commit 9ae6f90

Browse files
nilfm99kylophone
authored andcommitted
add --aom_ctc v6.0, enabling convert_bitdepth
1 parent 2ac1f28 commit 9ae6f90

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

libvmaf/tools/cli_parse.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ static void aom_ctc_v5_0(CLISettings *settings, const char *app)
320320
aom_ctc_v4_0(settings, app);
321321
}
322322

323+
static void aom_ctc_v6_0(CLISettings *settings, const char *app)
324+
{
325+
aom_ctc_v5_0(settings, app);
326+
settings->common_bitdepth = true;
327+
}
328+
323329
static void parse_aom_ctc(CLISettings *settings, const char *const optarg,
324330
const char *const app)
325331
{
@@ -351,6 +357,11 @@ static void parse_aom_ctc(CLISettings *settings, const char *const optarg,
351357
return;
352358
}
353359

360+
if (!strcmp(optarg, "v6.0")) {
361+
aom_ctc_v6_0(settings, app);
362+
return;
363+
}
364+
354365
usage(app, "bad aom_ctc version \"%s\"", optarg);
355366
}
356367

libvmaf/tools/cli_parse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ typedef struct {
4848
unsigned thread_cnt;
4949
bool no_prediction;
5050
bool quiet;
51+
bool common_bitdepth;
5152
unsigned cpumask;
5253
unsigned gpumask;
5354
} CLISettings;

libvmaf/tools/vmaf.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static enum VmafPixelFormat pix_fmt_map(int pf)
2727
}
2828
}
2929

30-
static int validate_videos(video_input *vid1, video_input *vid2)
30+
static int validate_videos(video_input *vid1, video_input *vid2, bool common_bitdepth)
3131
{
3232
int err_cnt = 0;
3333

@@ -52,6 +52,12 @@ static int validate_videos(video_input *vid1, video_input *vid2)
5252
err_cnt++;
5353
}
5454

55+
if (!common_bitdepth && info1.depth != info2.depth) {
56+
fprintf(stderr, "bitdepths do not match: %d, %d\n",
57+
info1.depth, info2.depth);
58+
err_cnt++;
59+
}
60+
5561
if (info1.depth < 8 || info1.depth > 16) {
5662
fprintf(stderr, "unsupported bitdepth: %d\n", info1.depth);
5763
err_cnt++;
@@ -208,7 +214,7 @@ int main(int argc, char *argv[])
208214
return -1;
209215
}
210216

211-
err = validate_videos(&vid_ref, &vid_dist);
217+
err = validate_videos(&vid_ref, &vid_dist, c.common_bitdepth);
212218
if (err) {
213219
fprintf(stderr, "videos are incompatible, %d %s.\n",
214220
err, err == 1 ? "problem" : "problems");

0 commit comments

Comments
 (0)