diff options
author | Wan-Teh Chang <wtc@google.com> | 2020-08-08 04:27:03 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2022-01-06 21:36:44 +0300 |
commit | f9bddfff7bd93b875a86d4401bc699337706b8cf (patch) | |
tree | bf783a01683e8250ec851eb21cffb921fc386797 /src/obu.c | |
parent | 633c63ed51b54a14c0fc547255b97f0e657e054d (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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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", |