Skip to content

Commit

Permalink
Merge pull request Netflix#992 from Netflix/feature/cambi_update_res_…
Browse files Browse the repository at this point in the history
…limits

CAMBI: remove the upper bound resolution and update the lower bound
  • Loading branch information
joelsole authored Mar 16, 2022
2 parents 711bdbf + ee77b4a commit 6eb7168
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libvmaf/src/feature/cambi.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
/* EOTF to use for the visibility threshold calculations. One of ['bt1886', 'pq']. Default: 'bt1886'. */
#define DEFAULT_CAMBI_EOTF ("bt1886")

#define CAMBI_MIN_WIDTH (320)
#define CAMBI_MAX_WIDTH (4096)
#define CAMBI_MIN_WIDTH_HEIGHT (320)
#define CAMBI_4K_WIDTH (3840)
#define CAMBI_4K_HEIGHT (2160)

Expand Down Expand Up @@ -324,10 +323,10 @@ static int init(VmafFeatureExtractor *fex, enum VmafPixelFormat pix_fmt,
s->src_height = h;
}

if (s->enc_width < CAMBI_MIN_WIDTH || s->enc_width > CAMBI_MAX_WIDTH) {
if (s->enc_width < CAMBI_MIN_WIDTH_HEIGHT && s->enc_height < CAMBI_MIN_WIDTH_HEIGHT) {
return -EINVAL;
}
if (s->src_width < CAMBI_MIN_WIDTH || s->src_width > CAMBI_MAX_WIDTH) {
if (s->src_width < CAMBI_MIN_WIDTH_HEIGHT && s->src_height < CAMBI_MIN_WIDTH_HEIGHT) {
return -EINVAL;
}
if (s->src_width > s->enc_width && s->src_height < s->enc_height) {
Expand Down

0 comments on commit 6eb7168

Please sign in to comment.