Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/obu.c
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2020-08-08 04:27:03 +0300
committerRonald S. Bultje <rsbultje@gmail.com>2022-01-06 21:36:44 +0300
commitf9bddfff7bd93b875a86d4401bc699337706b8cf (patch)
treebf783a01683e8250ec851eb21cffb921fc386797 /src/obu.c
parent633c63ed51b54a14c0fc547255b97f0e657e054d (diff)
DAV1D_MC_IDENTITY requires DAV1D_PIXEL_LAYOUT_I444
Section 6.4.2 (Color config semantics) of the AV1 spec says: If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of bitstream conformance that subsampling_x is equal to 0 and subsampling_y is equal to 0. Add Dav1dSettings.strict_std_compliance flag which, when set, allows aborting decoding when such standard-compliance violations fail, even though they don't affect decoding. In CLI, this flag can be accessed using -strict.
Diffstat (limited to 'src/obu.c')
-rw-r--r--src/obu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/obu.c b/src/obu.c
index 5edcfbf..343bb46 100644
--- a/src/obu.c
+++ b/src/obu.c
@@ -263,6 +263,11 @@ static int parse_seq_hdr(Dav1dContext *const c, GetBits *const gb,
hdr->chr = hdr->ss_hor == 1 && hdr->ss_ver == 1 ?
dav1d_get_bits(gb, 2) : DAV1D_CHR_UNKNOWN;
}
+ if (c->strict_std_compliance &&
+ hdr->mtrx == DAV1D_MC_IDENTITY && hdr->layout != DAV1D_PIXEL_LAYOUT_I444)
+ {
+ goto error;
+ }
hdr->separate_uv_delta_q = !hdr->monochrome && dav1d_get_bits(gb, 1);
#if DEBUG_SEQ_HDR
printf("SEQHDR: post-colorinfo: off=%u\n",