[FFmpeg-devel] [PATCH 6/7] dnxhddata: deduplicate table

Christophe Gisquet christophe.gisquet at gmail.com
Sun Sep 27 10:09:07 CEST 2015


CID 1256 chroma table is the same as luma table for CID 1235 and 1256,
which is consistent with the content being (normally) RGB.

CID 1244 weight tables are identica to CID 1244, but as this was not
tested against a real sample, it was not added.
---
 libavcodec/dnxhddata.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index cc304e4..2fbc162 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -25,7 +25,7 @@
 
 /* The quantization tables below are in zigzag order! */
 
-/* Used in CID 1235, 1256 */
+/* Used in CID 1235, 1256 luma/chroma*/
 static const uint8_t dnxhd_1235_luma_weight[] = {
      0, 32, 32, 32, 33, 32, 32, 32,
     32, 31, 32, 33, 33, 33, 33, 35,
@@ -228,17 +228,7 @@ static const uint8_t dnxhd_1252_chroma_weight[] = {
     114, 128, 125, 129, 134, 125, 116, 116,
 };
 
-static const uint8_t dnxhd_1256_chroma_weight[] = {
-     0, 32, 32, 32, 32, 32, 32, 32,
-    32, 32, 32, 32, 32, 32, 32, 32,
-    32, 32, 32, 32, 32, 32, 37, 32,
-    32, 32, 32, 32, 33, 32, 32, 32,
-    32, 32, 33, 34, 37, 36, 32, 32,
-    32, 33, 34, 37, 36, 34, 35, 36,
-    39, 44, 40, 40, 39, 39, 44, 43,
-    43, 51, 56, 50, 49, 60, 61, 70,
-};
-
+/* Also used in CID 1244, but not yet implemented */
 static const uint8_t dnxhd_1260_luma_weight[] = {
      0, 32, 33, 34, 36, 37, 37, 36,
     34, 33, 34, 35, 37, 38, 40, 41,
@@ -1041,7 +1031,7 @@ const CIDEntry ff_dnxhd_cid_table[] = {
       { 36, 36, 45, 75, 90 },
       { { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
     { 1256, 1920, 1080, 0, 1835008, 1835008, 6, 10, 4,
-      dnxhd_1235_luma_weight, dnxhd_1256_chroma_weight,
+      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,
-- 
2.5.2



More information about the ffmpeg-devel mailing list