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 /tools | |
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 'tools')
-rw-r--r-- | tools/dav1d_cli_parse.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/dav1d_cli_parse.c b/tools/dav1d_cli_parse.c index 7b24aa4..a264b4f 100644 --- a/tools/dav1d_cli_parse.c +++ b/tools/dav1d_cli_parse.c @@ -57,6 +57,7 @@ enum { ARG_OPPOINT, ARG_ALL_LAYERS, ARG_SIZE_LIMIT, + ARG_STRICT_STD_COMPLIANCE, ARG_CPU_MASK, ARG_NEG_STRIDE, }; @@ -80,6 +81,7 @@ static const struct option long_opts[] = { { "oppoint", 1, NULL, ARG_OPPOINT }, { "alllayers", 1, NULL, ARG_ALL_LAYERS }, { "sizelimit", 1, NULL, ARG_SIZE_LIMIT }, + { "strict", 1, NULL, ARG_STRICT_STD_COMPLIANCE }, { "cpumask", 1, NULL, ARG_CPU_MASK }, { "negstride", 0, NULL, ARG_NEG_STRIDE }, { NULL, 0, NULL, 0 }, @@ -131,6 +133,8 @@ static void usage(const char *const app, const char *const reason, ...) { " --oppoint $num: select an operating point of a scalable AV1 bitstream (0 - 31)\n" " --alllayers $num: output all spatial layers of a scalable AV1 bitstream (default: 1)\n" " --sizelimit $num: stop decoding if the frame size exceeds the specified limit\n" + " --strict $num: whether to abort decoding on standard compliance violations\n" + " that don't affect bitstream decoding (default: 1)\n" " --verify $md5: verify decoded md5. implies --muxer md5, no output\n" " --cpumask $mask: restrict permitted CPU instruction sets (0" ALLOWED_CPU_MASKS "; default: -1)\n" " --negstride: use negative picture strides\n" @@ -257,6 +261,7 @@ void parse(const int argc, char *const *const argv, memset(cli_settings, 0, sizeof(*cli_settings)); dav1d_default_settings(lib_settings); + lib_settings->strict_std_compliance = 1; // override library default int grain_specified = 0; while ((o = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) { @@ -335,6 +340,10 @@ void parse(const int argc, char *const *const argv, lib_settings->frame_size_limit = (unsigned) res; break; } + case ARG_STRICT_STD_COMPLIANCE: + lib_settings->strict_std_compliance = + parse_unsigned(optarg, ARG_STRICT_STD_COMPLIANCE, argv[0]); + break; case 'v': fprintf(stderr, "%s\n", dav1d_version()); exit(0); |