]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cfhddata.c
lavfi/paletteuse: fix to support transparency
[ffmpeg] / libavcodec / cfhddata.c
index 9330d3464550c5e193e0396b1c644804662b565d..5df68d4b3c8f13e3b19c450f0bb30ec7926c4f2d 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "stdint.h"
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+
 #include "cfhd.h"
 
 /* some special codewords, not sure what they all mean */
 #define TABLE_9_BAND_END3 0x38F0B3Eh
 #define TABLE_9_BAND_END_LEN3 26
 
+#define NB_VLC_TABLE_9   (71 + 3)
+#define NB_VLC_TABLE_18 (263 + 1)
+
+static const uint32_t table_9_vlc_bits[NB_VLC_TABLE_9] = {
+            0,       0x2,       0xc,      0x1a,
+         0x1d,      0x1e,      0x39,      0x3e,
+         0x37,      0x7e,      0x6c,      0xe2,
+         0xfe,      0xdb,      0xe0,     0x1c3,
+        0x1c6,     0x1ff,     0x1fe,     0x1b5,
+        0x369,     0x385,     0x71d,     0x6d0,
+        0x708,     0x71f,     0xe3d,     0xe39,
+        0xe13,     0xe12,    0x1c71,    0x1b45,
+       0x1b47,    0x3689,    0x38f2,    0x38e1,
+       0x38e0,    0x38f1,    0x3688,    0x6d1b,
+       0x71e0,    0x6d19,    0x71e7,    0xe3cd,
+       0xda35,    0xda30,    0xe3c3,   0x1b469,
+      0x1b462,   0x1c798,   0x1b463,   0x1c799,
+      0x38f08,   0x38f09,   0x38f0a,   0x6d1a0,
+      0x6d1a3,   0x6d1a1,   0xda345,   0xda344,
+      0xe3c2d,   0xe3c2f,   0xe3c2e,  0x38f0b2,
+     0x71e160,  0x71e162,  0x71e166,  0x71e161,
+     0xe3c2ce,  0xe3c2c6,  0xe3c2c7, 0x1C7859E,
+    0x38F0B3F, 0x38F0B3E,
+};
+
 static const uint8_t table_9_vlc_len[NB_VLC_TABLE_9] = {
      1,    2,    4,    5,    5,    5,    6,    6,
      6,    7,    7,    8,    8,    8,    8,    9,
@@ -42,19 +70,6 @@ static const uint8_t table_9_vlc_len[NB_VLC_TABLE_9] = {
     26,   26,
 };
 
-static const uint32_t table_9_vlc_bits[NB_VLC_TABLE_9] = {
-            0,       0x2,       0xc,      0x1a,      0x1d,      0x1e,      0x39,      0x3e,
-         0x37,      0x7e,      0x6c,      0xe2,      0xfe,      0xdb,      0xe0,     0x1c3,
-        0x1c6,     0x1ff,     0x1fe,     0x1b5,     0x369,     0x385,     0x71d,     0x6d0,
-        0x708,     0x71f,     0xe3d,     0xe39,     0xe13,     0xe12,    0x1c71,    0x1b45,
-       0x1b47,    0x3689,    0x38f2,    0x38e1,    0x38e0,    0x38f1,    0x3688,    0x6d1b,
-       0x71e0,    0x6d19,    0x71e7,    0xe3cd,    0xda35,    0xda30,    0xe3c3,   0x1b469,
-      0x1b462,   0x1c798,   0x1b463,   0x1c799,   0x38f08,   0x38f09,   0x38f0a,   0x6d1a0,
-      0x6d1a3,   0x6d1a1,   0xda345,   0xda344,   0xe3c2d,   0xe3c2f,   0xe3c2e,  0x38f0b2,
-     0x71e160,  0x71e162,  0x71e166,  0x71e161,  0xe3c2ce,  0xe3c2c6,  0xe3c2c7, 0x1C7859E,
-    0x38F0B3F, 0x38F0B3E,
-};
-
 static const uint16_t table_9_vlc_run[NB_VLC_TABLE_9] = {
     1,    1,    1,    1,   12,    1,   32,  160,
     1,    1,    1,  320,    1,    1,   80,  120,
@@ -82,39 +97,72 @@ static const uint8_t table_9_vlc_level[NB_VLC_TABLE_9] = {
 };
 
 static const uint32_t table_18_vlc_bits[NB_VLC_TABLE_18] = {
-            0,       0x2,       0x7,      0x19,      0x30,      0x36,      0x6f,      0x63,
-         0x69,      0x6b,      0xd1,      0xd4,      0xdc,     0x189,     0x18a,     0x1a0,
-        0x1ab,     0x377,     0x310,     0x316,     0x343,     0x354,     0x375,     0x623,
-        0x684,     0x685,     0x6ab,     0x6ec,     0xddb,     0xc5c,     0xc5e,     0xc44,
-        0xd55,     0xdd1,     0xdd3,    0x1bb5,    0x188b,    0x18bb,    0x18bf,    0x1aa8,
-       0x1ba0,    0x1ba5,    0x1ba4,    0x3115,    0x3175,    0x317d,    0x3553,    0x3768,
-       0x6e87,    0x6ed3,    0x62e8,    0x62f8,    0x6228,    0x6aa4,    0x6e85,    0xc453,
-       0xc5d3,    0xc5f3,    0xdda4,    0xdd08,    0xdd0c,   0x1bb4b,   0x1bb4a,   0x18ba5,
-      0x18be5,   0x1aa95,   0x1aa97,   0x188a4,   0x1ba13,   0x31748,   0x317c8,   0x35528,
-      0x3552c,   0x37424,   0x37434,   0x37436,   0x62294,   0x62e92,   0x62f92,   0x6aa52,
-      0x6aa5a,   0x6e86a,   0x6e86e,   0x6e84a,   0xc452a,   0xc5d27,   0xc5f26,   0xd54a6,
-      0xd54b6,   0xdd096,   0xdd0d6,   0xdd0de,  0x188a56,  0x18ba4d,  0x18be4e,  0x18be4f,
-     0x1aa96e,  0x1ba12e,  0x1ba12f,  0x1ba1af,  0x1ba1bf,  0x37435d,  0x37437d,  0x317498,
-     0x35529c,  0x35529d,  0x3552de,  0x3552df,  0x62e933,  0x62295d,  0x6aa53d,  0x6aa53f,
-     0x6aa53e,  0x6e86b9,  0x6e86f8,  0xd54a79,  0xc5d265,  0xc452b8,  0xdd0d71,  0xd54a78,
-     0xdd0d70,  0xdd0df2,  0xdd0df3, 0x188a5f6, 0x188a5f5, 0x188a5f4, 0x188a5f3, 0x188a5f2,
-    0x188a5f1, 0x188a5f0, 0x188a5ef, 0x188a5ee, 0x188a5ed, 0x188a5aa, 0x188a5e3, 0x188a5df,
-    0x188a589, 0x188a5dd, 0x188a578, 0x188a5e0, 0x188a588, 0x188a5d6, 0x188a5db, 0x188a5e1,
-    0x188a587, 0x188a59a, 0x188a5c4, 0x188a5ec, 0x188a586, 0x188a573, 0x188a59c, 0x188a5c8,
-    0x188a5fb, 0x188a5a1, 0x188a5eb, 0x188a5a8, 0x188a584, 0x188a5d2, 0x188a599, 0x188a598,
-    0x188a583, 0x18ba4c9, 0x188a5d0, 0x188a594, 0x188a582, 0x188a5cb, 0x188a5d8, 0x188a5e7,
-    0x188a581, 0x188a5ea, 0x188a5a9, 0x188a5a6, 0x188a580, 0x188a5a0, 0x188a59d, 0x188a5c3,
-    0x188a57f, 0x188a5c0, 0x188a5de, 0x188a5d4, 0x188a57e, 0x188a5c2, 0x188a592, 0x188a5cd,
-    0x188a57d, 0x188a5a3, 0x188a5e8, 0x188a5a2, 0x188a57c, 0x188a58e, 0x188a5b3, 0x188a5b2,
-    0x188a5b1, 0x188a5b0, 0x188a5af, 0x188a5ae, 0x188a5ad, 0x188a5ac, 0x188a5ab, 0x188a5da,
-    0x188a5e4, 0x188a5e5, 0x188a5d9, 0x188a5b5, 0x188a5bc, 0x188a5bd, 0x188a5e9, 0x188a5cc,
-    0x188a585, 0x188a5d3, 0x188a5e2, 0x188a595, 0x188a596, 0x188a5b8, 0x188a590, 0x188a5c9,
-    0x188a5a4, 0x188a5e6, 0x188a5a5, 0x188a5ce, 0x188a5bf, 0x188a572, 0x188a59b, 0x188a5be,
-    0x188a5c7, 0x188a5ca, 0x188a5d5, 0x188a57b, 0x188a58d, 0x188a58c, 0x188a58b, 0x188a58a,
-    0x18ba4c8, 0x188a5c5, 0x188a5fa, 0x188a5bb, 0x188a5c1, 0x188a5cf, 0x188a5b9, 0x188a5b6,
-    0x188a597, 0x188a5fe, 0x188a5d7, 0x188a5ba, 0x188a591, 0x188a5c6, 0x188a5dc, 0x188a57a,
-    0x188a59f, 0x188a5f9, 0x188a5b4, 0x188a5a7, 0x188a58f, 0x188a5fd, 0x188a5b7, 0x188a593,
-    0x188a59e, 0x188a5f8, 0x188a5ff, 0x188a5fc, 0x188a579, 0x188a5f7, 0x3114ba2, 0x3114ba3,
+            0,       0x2,       0x7,      0x19,
+         0x30,      0x36,      0x6f,      0x63,
+         0x69,      0x6b,      0xd1,      0xd4,
+         0xdc,     0x189,     0x18a,     0x1a0,
+        0x1ab,     0x377,     0x310,     0x316,
+        0x343,     0x354,     0x375,     0x623,
+        0x684,     0x685,     0x6ab,     0x6ec,
+        0xddb,     0xc5c,     0xc5e,     0xc44,
+        0xd55,     0xdd1,     0xdd3,    0x1bb5,
+       0x188b,    0x18bb,    0x18bf,    0x1aa8,
+       0x1ba0,    0x1ba5,    0x1ba4,    0x3115,
+       0x3175,    0x317d,    0x3553,    0x3768,
+       0x6e87,    0x6ed3,    0x62e8,    0x62f8,
+       0x6228,    0x6aa4,    0x6e85,    0xc453,
+       0xc5d3,    0xc5f3,    0xdda4,    0xdd08,
+       0xdd0c,   0x1bb4b,   0x1bb4a,   0x18ba5,
+      0x18be5,   0x1aa95,   0x1aa97,   0x188a4,
+      0x1ba13,   0x31748,   0x317c8,   0x35528,
+      0x3552c,   0x37424,   0x37434,   0x37436,
+      0x62294,   0x62e92,   0x62f92,   0x6aa52,
+      0x6aa5a,   0x6e86a,   0x6e86e,   0x6e84a,
+      0xc452a,   0xc5d27,   0xc5f26,   0xd54a6,
+      0xd54b6,   0xdd096,   0xdd0d6,   0xdd0de,
+     0x188a56,  0x18ba4d,  0x18be4e,  0x18be4f,
+     0x1aa96e,  0x1ba12e,  0x1ba12f,  0x1ba1af,
+     0x1ba1bf,  0x37435d,  0x37437d,  0x317498,
+     0x35529c,  0x35529d,  0x3552de,  0x3552df,
+     0x62e933,  0x62295d,  0x6aa53d,  0x6aa53f,
+     0x6aa53e,  0x6e86b9,  0x6e86f8,  0xd54a79,
+     0xc5d265,  0xc452b8,  0xdd0d71,  0xd54a78,
+     0xdd0d70,  0xdd0df2,  0xdd0df3, 0x188a5f6,
+    0x188a5f5, 0x188a5f4, 0x188a5f3, 0x188a5f2,
+    0x188a5f1, 0x188a5f0, 0x188a5ef, 0x188a5ee,
+    0x188a5ed, 0x188a5aa, 0x188a5e3, 0x188a5df,
+    0x188a589, 0x188a5dd, 0x188a578, 0x188a5e0,
+    0x188a588, 0x188a5d6, 0x188a5db, 0x188a5e1,
+    0x188a587, 0x188a59a, 0x188a5c4, 0x188a5ec,
+    0x188a586, 0x188a573, 0x188a59c, 0x188a5c8,
+    0x188a5fb, 0x188a5a1, 0x188a5eb, 0x188a5a8,
+    0x188a584, 0x188a5d2, 0x188a599, 0x188a598,
+    0x188a583, 0x18ba4c9, 0x188a5d0, 0x188a594,
+    0x188a582, 0x188a5cb, 0x188a5d8, 0x188a5e7,
+    0x188a581, 0x188a5ea, 0x188a5a9, 0x188a5a6,
+    0x188a580, 0x188a5a0, 0x188a59d, 0x188a5c3,
+    0x188a57f, 0x188a5c0, 0x188a5de, 0x188a5d4,
+    0x188a57e, 0x188a5c2, 0x188a592, 0x188a5cd,
+    0x188a57d, 0x188a5a3, 0x188a5e8, 0x188a5a2,
+    0x188a57c, 0x188a58e, 0x188a5b3, 0x188a5b2,
+    0x188a5b1, 0x188a5b0, 0x188a5af, 0x188a5ae,
+    0x188a5ad, 0x188a5ac, 0x188a5ab, 0x188a5da,
+    0x188a5e4, 0x188a5e5, 0x188a5d9, 0x188a5b5,
+    0x188a5bc, 0x188a5bd, 0x188a5e9, 0x188a5cc,
+    0x188a585, 0x188a5d3, 0x188a5e2, 0x188a595,
+    0x188a596, 0x188a5b8, 0x188a590, 0x188a5c9,
+    0x188a5a4, 0x188a5e6, 0x188a5a5, 0x188a5ce,
+    0x188a5bf, 0x188a572, 0x188a59b, 0x188a5be,
+    0x188a5c7, 0x188a5ca, 0x188a5d5, 0x188a57b,
+    0x188a58d, 0x188a58c, 0x188a58b, 0x188a58a,
+    0x18ba4c8, 0x188a5c5, 0x188a5fa, 0x188a5bb,
+    0x188a5c1, 0x188a5cf, 0x188a5b9, 0x188a5b6,
+    0x188a597, 0x188a5fe, 0x188a5d7, 0x188a5ba,
+    0x188a591, 0x188a5c6, 0x188a5dc, 0x188a57a,
+    0x188a59f, 0x188a5f9, 0x188a5b4, 0x188a5a7,
+    0x188a58f, 0x188a5fd, 0x188a5b7, 0x188a593,
+    0x188a59e, 0x188a5f8, 0x188a5ff, 0x188a5fc,
+    0x188a579, 0x188a5f7, 0x3114ba2, 0x3114ba3,
 };
 
 static const uint8_t table_18_vlc_len[NB_VLC_TABLE_18] = {
@@ -154,39 +202,39 @@ static const uint8_t table_18_vlc_len[NB_VLC_TABLE_18] = {
 };
 
 static const uint16_t table_18_vlc_run[NB_VLC_TABLE_18] = {
-    1,    1,    1,    1,    1,    1,    1,    1,
-   12,    1,   20,    1,    1,    1,   32,    1,
-    1,    1,    1,    1,   60,    1,    1,    1,
-    1,  100,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,  180,    1,
-    1,  320,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    2,
+     1,    1,    1,    1,    1,    1,    1,    1,
+    12,    1,   20,    1,    1,    1,   32,    1,
+     1,    1,    1,    1,   60,    1,    1,    1,
+     1,  100,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,  180,    1,
+     1,  320,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    1,
+     1,    1,    1,    1,    1,    1,    1,    2,
 };
 
 static const uint8_t table_18_vlc_level[NB_VLC_TABLE_18] = {