diff options
author | Jeremy James <jeremy.james@gmail.com> | 2015-09-28 16:28:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-05 13:08:20 +0200 |
commit | 6f1ccca4ae3b93b6a2a820a7a0e72081ab35767c (patch) | |
tree | 724e86b85f8eda35d7f5005da4bb35baff0c3a9c /libavcodec/dnxhddata.c | |
parent | 66db504f038afa02aaecb94a81f549e431211a47 (diff) | |
download | ffmpeg-6f1ccca4ae3b93b6a2a820a7a0e72081ab35767c.tar.gz |
dnxhd: add better support for CIDs 1270 to 1274
These are DNxHR profiles with the following properties:
- Variable size in a profile (property added in a previous commit),
requiring variable-sized macroblock table;
- Variable bitdepth, up to 12 bits.
- Better validation of buffer sizes and positions
Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dnxhddata.c')
-rw-r--r-- | libavcodec/dnxhddata.c | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index e2838de346..241ce23a1c 100644 --- a/libavcodec/dnxhddata.c +++ b/libavcodec/dnxhddata.c @@ -49,7 +49,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = { 90, 90, 85, 79, 73, 73, 73, 73, }; -/* Used in CID 1237, 1253, 1259 */ +/* Used in CID 1237, 1253, 1259, 1273, 1274 */ static const uint8_t dnxhd_1237_luma_weight[] = { 0, 32, 33, 34, 34, 36, 37, 36, 36, 37, 38, 38, 38, 39, 41, 44, @@ -61,7 +61,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = { 97, 100, 104, 102, 98, 98, 99, 99, }; -/* Used in CID 1237, 1253, 1259 */ +/* Used in CID 1237, 1253, 1259, 1273, 1274 */ static const uint8_t dnxhd_1237_chroma_weight[] = { 0, 32, 36, 39, 39, 38, 39, 41, 45, 51, 57, 58, 53, 48, 47, 51, @@ -73,6 +73,7 @@ static const uint8_t dnxhd_1237_chroma_weight[] = { 97, 100, 104, 102, 98, 98, 99, 99, }; +/* Used in CID 1238, 1272 */ static const uint8_t dnxhd_1238_luma_weight[] = { 0, 32, 32, 33, 34, 33, 33, 33, 33, 33, 33, 33, 33, 35, 37, 37, @@ -84,6 +85,7 @@ static const uint8_t dnxhd_1238_luma_weight[] = { 51, 53, 55, 57, 58, 59, 57, 57, }; +/* Used in CID 1238, 1272 */ static const uint8_t dnxhd_1238_chroma_weight[] = { 0, 32, 35, 35, 35, 34, 34, 35, 39, 43, 45, 45, 41, 39, 40, 41, @@ -95,6 +97,7 @@ static const uint8_t dnxhd_1238_chroma_weight[] = { 82, 77, 80, 86, 84, 82, 82, 82, }; +/* Used in CID 1241, 1271 */ static const uint8_t dnxhd_1241_luma_weight[] = { 0, 32, 33, 34, 34, 35, 36, 37, 36, 37, 38, 38, 38, 39, 39, 40, @@ -106,6 +109,7 @@ static const uint8_t dnxhd_1241_luma_weight[] = { 48, 46, 47, 48, 48, 49, 49, 49, }; +/* Used in CID 1241, 1271 */ static const uint8_t dnxhd_1241_chroma_weight[] = { 0, 32, 36, 38, 37, 37, 40, 41, 40, 40, 42, 42, 41, 41, 41, 41, @@ -261,17 +265,17 @@ static const uint8_t dnxhd_1235_dc_bits[14] = { 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7, }; -/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */ +/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260, 1272, 1273, 1274 */ static const uint8_t dnxhd_1237_dc_codes[12] = { 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63, }; -/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */ +/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260, 1272, 1273, 1274 */ static const uint8_t dnxhd_1237_dc_bits[12] = { 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint16_t dnxhd_1237_ac_codes[257] = { 0, 1, 4, 5, 12, 26, 27, 56, 57, 58, 59, 120, 121, 244, 245, 246, @@ -308,7 +312,7 @@ static const uint16_t dnxhd_1237_ac_codes[257] = { 65535, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint8_t dnxhd_1237_ac_bits[257] = { 2, 2, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, @@ -329,7 +333,7 @@ static const uint8_t dnxhd_1237_ac_bits[257] = { 16, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint8_t dnxhd_1237_ac_level[257] = { 3, 3, 5, 0, 7, 9, 5, 11, 13, 15, 7, 17, 19, 21, 23, 25, 9, 11, 27, 29, 31, 33, 13, 35, 37, 39, 41, 43, 15, 45, 47, 49, @@ -350,7 +354,7 @@ static const uint8_t dnxhd_1237_ac_level[257] = { 129, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint8_t dnxhd_1237_ac_flags[257] = { 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, @@ -450,6 +454,7 @@ static const uint8_t dnxhd_1238_ac_level[257] = { 129, }; /* 0 is EOB */ +/* Used in CID 1238, 1243, 1272 */ static const uint8_t dnxhd_1238_ac_flags[257] = { 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, @@ -528,7 +533,7 @@ static const uint8_t dnxhd_1235_ac_bits[257] = { 16, }; -/* Used in CID 1235, 1241, 1256 */ +/* Used in CID 1235, 1241, 1256, 1270, 1271 */ static const uint8_t dnxhd_1235_ac_level[257] = { 3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9, 25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 13, 15, 45, 47, 49, @@ -549,7 +554,7 @@ static const uint8_t dnxhd_1235_ac_level[257] = { 129, }; -/* Used in CID 1235, 1241, 1256 */ +/* Used in CID 1235, 1241, 1256, 1270, 1271 */ static const uint8_t dnxhd_1235_ac_flags[257] = { 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, @@ -858,7 +863,7 @@ static const uint8_t dnxhd_1252_ac_flags[257] = { 3, }; -/* Used in CID 1235, 1238, 1241, 1256 */ +/* Used in CID 1235, 1238, 1241, 1243, 1256, 1270, 1271, 1272 */ static const uint16_t dnxhd_1235_run_codes[62] = { 0, 4, 10, 11, 24, 25, 26, 27, 56, 57, 58, 59, 120, 242, 486, 487, @@ -870,7 +875,7 @@ static const uint16_t dnxhd_1235_run_codes[62] = { 1018, 1019, 1020, 1021, 1022, 1023, }; -/* Used in CID 1235, 1238, 1241, 1243, 1256 */ +/* Used in CID 1235, 1238, 1241, 1243, 1256, 1270, 1271, 1272 */ static const uint8_t dnxhd_1235_run_bits[62] = { 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, @@ -878,7 +883,7 @@ static const uint8_t dnxhd_1235_run_bits[62] = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, }; -/* Used in CID 1235, 1241, 1256 */ +/* Used in CID 1235, 1241, 1256, 1270, 1271 */ static const uint8_t dnxhd_1235_run[62] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -886,7 +891,7 @@ static const uint8_t dnxhd_1235_run[62] = { 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint16_t dnxhd_1237_run_codes[62] = { 0, 4, 10, 11, 24, 25, 26, 54, 55, 56, 57, 58, 118, 119, 240, 482, @@ -898,7 +903,7 @@ static const uint16_t dnxhd_1237_run_codes[62] = { 1018, 1019, 1020, 1021, 1022, 1023, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint8_t dnxhd_1237_run_bits[62] = { 1, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, @@ -906,7 +911,7 @@ static const uint8_t dnxhd_1237_run_bits[62] = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, }; -/* Used in CID 1237, 1242, 1253, 1259, 1260 */ +/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */ static const uint8_t dnxhd_1237_run[62] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25, @@ -914,6 +919,7 @@ static const uint8_t dnxhd_1237_run[62] = { 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, }; +/* Used in CID 1238, 1243, 1272 */ static const uint8_t dnxhd_1238_run[62] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -1074,13 +1080,37 @@ const CIDEntry ff_dnxhd_cid_table[] = { dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run, { 80, 90, 100, 110 } }, { 1270, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, - DNXHD_444, 6, 10, 4, + DNXHD_444, 6, DNXHD_VARIABLE, 4, dnxhd_1235_luma_weight, dnxhd_1235_luma_weight, dnxhd_1235_dc_codes, dnxhd_1235_dc_bits, dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level, dnxhd_1235_ac_flags, dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run, { 0 } }, + { 1271, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, + 0, 6, DNXHD_VARIABLE, 4, + dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight, + dnxhd_1235_dc_codes, dnxhd_1235_dc_bits, + dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level, + dnxhd_1235_ac_flags, + dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run, + { 0 } }, + { 1272, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, + 0, 4, 8, 4, + dnxhd_1238_luma_weight, dnxhd_1238_chroma_weight, + dnxhd_1237_dc_codes, dnxhd_1237_dc_bits, + dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level, + dnxhd_1238_ac_flags, + dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1238_run, + { 0 } }, + { 1273, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, + 0, 4, 8, 3, + dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight, + dnxhd_1237_dc_codes, dnxhd_1237_dc_bits, + dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level, + dnxhd_1237_ac_flags, + dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run, + { 0 } }, { 1274, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, 4, 8, 3, dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight, |