Huffman, A-SPX, and SFB-offset tables shared by the native AC-4
encoder core. Pure data, no dependencies; the OBJS entries sit
under CONFIG_AC4_ENCODER, still undefined, so this patch is a
build no-op until the wrapper patch registers the codec.

Re-cut (r3): prepend the standard LGPL header block (Copyright (c)
2026 Michael Rowlinson) to all 6 table files (X2); table bytes
otherwise identical to r2.

Re-cut (r5): complete the M3 AC4_ rename for the 34 AJOC/DE/DRC
huffman table symbols (definitions + registry uses + header decls;
string-literal book names kept); table bytes identical to r4. Fixes
the A+C duplicate-symbol link collision (the decoder huffman_tab.o
defines the same 34 globals).

Re-cut (r6): rename to ac4_*_tab.* (M10: *_tables.* match
libavcodec CLEANFILES + .gitignore and would be deleted by
make clean; the decoder already uses *_tab). Table bytes identical
to r5.

Signed-off-by: Michael Rowlinson <[email protected]>
---
 libavcodec/Makefile          |    2 +
 libavcodec/ac4_aspx_tab.c    |  361 +++++++++++
 libavcodec/ac4_aspx_tab.h    |   95 +++
 libavcodec/ac4_huffman_tab.c | 1153 ++++++++++++++++++++++++++++++++++
 libavcodec/ac4_huffman_tab.h |  186 ++++++
 libavcodec/ac4_sfb_offsets.c |  166 +++++
 libavcodec/ac4_sfb_offsets.h |   34 +
 7 files changed, 1997 insertions(+)
 create mode 100644 libavcodec/ac4_aspx_tab.c
 create mode 100644 libavcodec/ac4_aspx_tab.h
 create mode 100644 libavcodec/ac4_huffman_tab.c
 create mode 100644 libavcodec/ac4_huffman_tab.h
 create mode 100644 libavcodec/ac4_sfb_offsets.c
 create mode 100644 libavcodec/ac4_sfb_offsets.h

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 54c74ee..6b35695 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -219,6 +219,8 @@ OBJS-$(CONFIG_AC3_FIXED_DECODER)       += ac3dec_fixed.o 
ac3dec_data.o ac3.o \
 OBJS-$(CONFIG_AC3_ENCODER)             += ac3enc_float.o ac3enc.o ac3tab.o \
                                           ac3.o kbdwin.o
 OBJS-$(CONFIG_AC3_FIXED_ENCODER)       += ac3enc_fixed.o ac3enc.o ac3tab.o 
ac3.o kbdwin.o
+OBJS-$(CONFIG_AC4_ENCODER)             += ac4_huffman_tab.o \
+                                          ac4_aspx_tab.o ac4_sfb_offsets.o
 OBJS-$(CONFIG_AC3_MF_ENCODER)          += mfenc.o mf_utils.o
 # AC-4 decoder: wrapper + vendored streaming core (in-tree port).
 # No extra libs/flags.
diff --git a/libavcodec/ac4_aspx_tab.c b/libavcodec/ac4_aspx_tab.c
new file mode 100644
index 0000000..b5b47d4
--- /dev/null
+++ b/libavcodec/ac4_aspx_tab.c
@@ -0,0 +1,361 @@
+/*
+ * ASPX codebook tables
+ * Copyright (c) 2026 Michael Rowlinson
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* See ac4_aspx_tab.h. Generated by tools/aspx_gen.py. */
+#include "ac4_aspx_tab.h"
+#include <stddef.h>
+
+const uint8_t AC4_ASPX_HCB_ENV_LEVEL_15_F0_LEN[71] = {
+    7, 9, 9, 9, 9, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6,
+    6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 5,
+    5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 6, 6, 6, 7, 8,
+    9, 10, 11, 12, 14, 14, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18,
+    18, 18, 17, 17, 17, 17, 16,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_LEVEL_15_F0_CW[71] = {
+    0x0003e, 0x0007e, 0x0007f, 0x000be, 0x000bf, 0x0003e, 0x0005e, 0x00016,
+    0x00017, 0x0001e, 0x0002e, 0x0005e, 0x00012, 0x0000a, 0x0000c, 0x0000e,
+    0x00013, 0x00016, 0x0001a, 0x0001b, 0x00022, 0x00023, 0x00004, 0x00008,
+    0x0000c, 0x0000e, 0x00012, 0x00014, 0x00015, 0x0001a, 0x00000, 0x00016,
+    0x00018, 0x0001e, 0x0001c, 0x00019, 0x0001d, 0x0001f, 0x00001, 0x0001b,
+    0x00013, 0x00010, 0x0000a, 0x0002e, 0x0001e, 0x0000d, 0x0003f, 0x000be,
+    0x0017e, 0x002fe, 0x005fe, 0x00bfe, 0x02ffe, 0x02ffc, 0x0bffc, 0x0bff6,
+    0x17ffa, 0x17ffb, 0x2fff8, 0x2fff9, 0x2fffa, 0x2fffb, 0x2fffc, 0x2fffd,
+    0x2fffe, 0x2ffff, 0x17fe8, 0x17fe9, 0x17fea, 0x17feb, 0x0bff7,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_LEVEL_15_DF_LEN[141] = {
+    21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+    21, 21, 17, 18, 19, 19, 21, 19, 19, 19, 21, 20, 20, 20, 16, 17,
+    19, 19, 18, 18, 17, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13,
+    13, 13, 13, 13, 12, 12, 12, 12, 12, 11, 10, 10, 9, 8, 8, 7,
+    6, 6, 5, 4, 3, 2, 2, 3, 4, 6, 7, 7, 8, 9, 10, 11,
+    11, 12, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17,
+    17, 18, 17, 17, 16, 17, 18, 19, 20, 21, 19, 19, 18, 16, 19, 21,
+    16, 20, 20, 21, 21, 20, 20, 19, 20, 19, 17, 21, 21, 21, 21, 21,
+    21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_LEVEL_15_DF_CW[141] = {
+    0x0feff2, 0x0feff3, 0x0feff4, 0x0feff5, 0x0feff6, 0x0feff7, 0x0feff8, 
0x0feff9,
+    0x0feffa, 0x0feffb, 0x0feffc, 0x0feffd, 0x0feffe, 0x0fefff, 0x0ff5e4, 
0x0ff5e5,
+    0x0ff5e6, 0x0ff5e7, 0x00fef4, 0x01fefe, 0x03fdea, 0x03ffde, 0x0ff7b6, 
0x03fdec,
+    0x03fdee, 0x03fd78, 0x0ff5ee, 0x07f798, 0x07faf6, 0x07f799, 0x007ffa, 
0x00fef6,
+    0x03fdef, 0x03ffdf, 0x01fdee, 0x01ffee, 0x00ff7e, 0x003d7e, 0x003fba, 
0x003fbe,
+    0x003ffe, 0x001ebe, 0x001fdc, 0x001fee, 0x001ff6, 0x000f5c, 0x000f5d, 
0x000f7e,
+    0x000f7f, 0x000ff4, 0x000ff6, 0x000ffe, 0x0007bc, 0x0007bd, 0x0007f6, 
0x0007fc,
+    0x0007fe, 0x0003fa, 0x0001ea, 0x0001fc, 0x0000f6, 0x000076, 0x00007e, 
0x00003c,
+    0x00001c, 0x00003e, 0x00001e, 0x00000e, 0x000006, 0x000002, 0x000000, 
0x000002,
+    0x000006, 0x00003f, 0x00003e, 0x00003a, 0x000077, 0x0000f4, 0x0001ee, 
0x0003fc,
+    0x0003d6, 0x0007be, 0x000ffa, 0x000f5e, 0x001ff7, 0x001fea, 0x003ffc, 
0x003fd6,
+    0x003fbb, 0x007fbe, 0x007fae, 0x007f7e, 0x00fff6, 0x00fffe, 0x00fef5, 
0x00fef2,
+    0x00f5fe, 0x01fffe, 0x00ff78, 0x00fefe, 0x007afe, 0x00ff79, 0x01fef4, 
0x03fd7a,
+    0x07f79a, 0x0ff5ef, 0x03fdfe, 0x03fffe, 0x01fdef, 0x007ffe, 0x03fdff, 
0x0ff5f2,
+    0x007f78, 0x07f79b, 0x07f79e, 0x0ff5f3, 0x0ff5f4, 0x07f79f, 0x07faf8, 
0x03ffff,
+    0x07f7f8, 0x03fbce, 0x00f5ff, 0x0ff5f5, 0x0ff5f6, 0x0ff5f7, 0x0ff5f8, 
0x0ff5f9,
+    0x0ff5fa, 0x0ff5fb, 0x0ff5fc, 0x0ff5fd, 0x0ff5fe, 0x0ff5ff, 0x0ff7ac, 
0x0ff7ad,
+    0x0ff7ae, 0x0ff7af, 0x0ff7b4, 0x0ff7b5, 0x0ff7b7,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_LEVEL_15_DT_LEN[141] = {
+    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18,
+    17, 19, 17, 16, 17, 17, 17, 16, 15, 16, 15, 15, 14, 14, 14, 13,
+    12, 10, 8, 6, 4, 2, 1, 3, 5, 7, 10, 11, 12, 14, 14, 15,
+    15, 16, 16, 17, 16, 17, 17, 18, 16, 17, 18, 18, 19, 18, 19, 19,
+    17, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 19, 19, 19,
+    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_LEVEL_15_DT_CW[141] = {
+    0x7ffa0, 0x7ffa1, 0x7ffa2, 0x7ffa3, 0x7ffa4, 0x7ffa5, 0x7ffa6, 0x7ffa7,
+    0x7ffa8, 0x7ffa9, 0x7ffaa, 0x7ffab, 0x7ffac, 0x7ffad, 0x7ffae, 0x7ffaf,
+    0x7ffb0, 0x7ffb1, 0x7ffb2, 0x7ffb3, 0x7ffb4, 0x7ffb5, 0x7ffb6, 0x7ffb7,
+    0x7ffb8, 0x7ffb9, 0x7ffba, 0x7ffbb, 0x7ffbc, 0x7ffbd, 0x7ffbe, 0x7ffbf,
+    0x7ffc0, 0x7ffc1, 0x7ffc2, 0x7ffc3, 0x7ffc4, 0x7ffc5, 0x7ffc6, 0x7ffc7,
+    0x7ffcc, 0x7ffcd, 0x7ffce, 0x3ff16, 0x3ff17, 0x3ff1e, 0x3ff1f, 0x3ff3c,
+    0x1fefa, 0x7ffcf, 0x1ffb6, 0x0ff7c, 0x1ff8e, 0x1ffbe, 0x1fefb, 0x0ffc4,
+    0x07fba, 0x0ffc6, 0x07fbb, 0x07fee, 0x03fdc, 0x03ff0, 0x03ff2, 0x01ffa,
+    0x00ffe, 0x003fc, 0x000fe, 0x0003e, 0x0000e, 0x00002, 0x00000, 0x00006,
+    0x0001e, 0x0007e, 0x003fe, 0x007fa, 0x00ff6, 0x03ffc, 0x03fde, 0x07fe6,
+    0x07fec, 0x0ffda, 0x0ffde, 0x1fefe, 0x0ffce, 0x1fff2, 0x1ffbf, 0x3ff3d,
+    0x0ff7e, 0x1feff, 0x3ff3e, 0x3ff3f, 0x7ffd2, 0x3ffe8, 0x7ffd3, 0x7ffd4,
+    0x1ff8a, 0x3ff6e, 0x3ff6f, 0x7ffd5, 0x7ffd6, 0x7ffd7, 0x7ffd8, 0x7ffd9,
+    0x7ffda, 0x7ffdb, 0x7ffde, 0x7ffdf, 0x3ffee, 0x7ffe0, 0x7ffe1, 0x7ffe2,
+    0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffe6, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea,
+    0x7ffeb, 0x7ffec, 0x7ffed, 0x7ffee, 0x7ffef, 0x7fff0, 0x7fff1, 0x7fff2,
+    0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6, 0x7fff7, 0x7fff8, 0x7fff9, 0x7fffa,
+    0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe, 0x7ffff,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_LEVEL_30_F0_LEN[36] = {
+    11, 13, 11, 11, 10, 10, 9, 8, 8, 7, 7, 7, 6, 6, 5, 5,
+    4, 4, 4, 4, 3, 3, 3, 3, 4, 5, 6, 7, 9, 12, 14, 16,
+    17, 16, 17, 16,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_LEVEL_30_F0_CW[36] = {
+    0x007fe, 0x01ffe, 0x001de, 0x001df, 0x000ee, 0x003fe, 0x001fe, 0x0003a,
+    0x000fe, 0x0001c, 0x0001e, 0x0007e, 0x0002e, 0x0003e, 0x00006, 0x00016,
+    0x00002, 0x0000a, 0x0000c, 0x0000e, 0x00002, 0x00003, 0x00004, 0x00000,
+    0x0000d, 0x0001e, 0x0002f, 0x0001f, 0x00076, 0x00ffe, 0x03ffe, 0x0fffc,
+    0x1fffe, 0x0fffe, 0x1ffff, 0x0fffd,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_LEVEL_30_DF_LEN[71] = {
+    23, 23, 23, 23, 22, 22, 22, 22, 20, 19, 19, 20, 19, 18, 17, 16,
+    16, 15, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 11, 10, 9, 8,
+    5, 4, 2, 1, 3, 6, 8, 9, 11, 12, 14, 14, 15, 16, 17, 17,
+    17, 18, 18, 19, 21, 19, 17, 20, 19, 20, 20, 20, 19, 19, 19, 22,
+    22, 22, 22, 22, 22, 22, 22,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_LEVEL_30_DF_CW[71] = {
+    0x7ffbfc, 0x7ffbfd, 0x7ffbfe, 0x7ffbff, 0x3f7f6c, 0x3f7f6d, 0x3f7f6e, 
0x3f7f6f,
+    0x0fdfee, 0x07effe, 0x07efec, 0x0fff7e, 0x07ffbe, 0x03f7fe, 0x01fbfe, 
0x00fdfc,
+    0x00fff6, 0x007ffa, 0x003f7e, 0x003ffc, 0x003ffe, 0x001fba, 0x001fbe, 
0x001ffa,
+    0x001ffb, 0x000fdc, 0x000ffc, 0x000ffe, 0x0007fc, 0x0003f6, 0x0001fe, 
0x0000fe,
+    0x00001e, 0x00000e, 0x000002, 0x000000, 0x000006, 0x00003e, 0x0000fc, 
0x0001fa,
+    0x0007fd, 0x000fde, 0x003fff, 0x003f76, 0x007eee, 0x00fdde, 0x01ffee, 
0x01fbfc,
+    0x01fbfa, 0x03ffde, 0x03f77e, 0x07efee, 0x1ffefe, 0x07eefe, 0x01fbbe, 
0x0fdfea,
+    0x07eff6, 0x0fdfda, 0x0fdfde, 0x0fdfef, 0x07eff4, 0x07efff, 0x07eeff, 
0x3f7fae,
+    0x3f7f7c, 0x3f7f7d, 0x3f7f7e, 0x3f7f7f, 0x3f7fac, 0x3f7fad, 0x3f7faf,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_LEVEL_30_DT_LEN[71] = {
+    20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 20, 20, 18, 16, 16,
+    15, 16, 15, 14, 14, 14, 13, 13, 13, 12, 12, 11, 11, 10, 10, 8,
+    6, 4, 2, 1, 3, 5, 8, 9, 11, 11, 12, 13, 13, 14, 14, 14,
+    15, 15, 16, 17, 18, 19, 18, 18, 18, 18, 20, 19, 20, 20, 20, 20,
+    20, 20, 20, 20, 20, 20, 19,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_LEVEL_30_DT_CW[71] = {
+    0xff7d6, 0xff7d7, 0xff7d8, 0xff7d9, 0xff7da, 0xff7db, 0xff7dc, 0xff7dd,
+    0xff7de, 0x7fbfe, 0x7ed7a, 0xff7df, 0xff7f2, 0x3fdf4, 0x0ff7c, 0x0fdae,
+    0x07ede, 0x0ff7e, 0x07ed2, 0x03f68, 0x03f6e, 0x03ffa, 0x01fb6, 0x01ffe,
+    0x01fff, 0x00fde, 0x00ff6, 0x007ec, 0x007fa, 0x003fc, 0x003fe, 0x000fc,
+    0x0003e, 0x0000e, 0x00002, 0x00000, 0x00006, 0x0001e, 0x000fe, 0x001fa,
+    0x007fe, 0x007ee, 0x00fdf, 0x01ffc, 0x01fee, 0x03ffb, 0x03fde, 0x03f6a,
+    0x07ed6, 0x07ed3, 0x0fdbe, 0x1fb7e, 0x3f6bc, 0x7fbf8, 0x3f6be, 0x3f6bf,
+    0x3f6fe, 0x3f6ff, 0xff7f3, 0x7fbea, 0xff7f4, 0xff7f5, 0xff7f6, 0xff7f7,
+    0xff7f8, 0xff7f9, 0xff7fa, 0xff7fb, 0xff7fe, 0xff7ff, 0x7ed7b,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_BALANCE_15_F0_LEN[25] = {
+    13, 16, 15, 15, 13, 12, 11, 9, 8, 7, 5, 3, 1, 2, 4, 7,
+    8, 9, 10, 10, 11, 12, 13, 15, 16,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_BALANCE_15_F0_CW[25] = {
+    0x1ffe, 0xffea, 0x7ff6, 0x7ff7, 0x1fff, 0x0ffc, 0x07de, 0x01f6,
+    0x00fa, 0x007c, 0x001e, 0x0006, 0x0000, 0x0002, 0x000e, 0x007e,
+    0x00fe, 0x01fe, 0x03fe, 0x03ee, 0x07df, 0x0ffd, 0x1ffc, 0x7ff4,
+    0xffeb,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_BALANCE_15_DF_LEN[49] = {
+    19, 19, 19, 19, 19, 18, 18, 17, 16, 16, 16, 15, 13, 13, 12, 12,
+    12, 11, 10, 9, 8, 7, 5, 3, 1, 2, 4, 7, 8, 10, 10, 11,
+    12, 12, 13, 13, 14, 15, 16, 18, 18, 17, 18, 18, 18, 19, 19, 18,
+    19,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_BALANCE_15_DF_CW[49] = {
+    0x7def6, 0x7def7, 0x7defa, 0x7defb, 0x7dffe, 0x3ef7c, 0x3ef7e, 0x1f7b2,
+    0x0fbd8, 0x0fbda, 0x0fbfe, 0x07dfe, 0x01f6e, 0x01f7a, 0x00f9e, 0x00fb6,
+    0x00fbc, 0x007da, 0x003ec, 0x001f2, 0x000fa, 0x0007e, 0x0001e, 0x00006,
+    0x00000, 0x00002, 0x0000e, 0x0007f, 0x000f8, 0x003ee, 0x003e6, 0x007ce,
+    0x00fbe, 0x00f9f, 0x01f7e, 0x01f6f, 0x03efe, 0x07dee, 0x0fbdb, 0x3ef78,
+    0x3ef7f, 0x1f7b3, 0x3effc, 0x3effd, 0x3ef79, 0x7dffc, 0x7dffd, 0x3ef7a,
+    0x7dfff,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_BALANCE_15_DT_LEN[49] = {
+    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 12, 12,
+    11, 12, 11, 9, 8, 7, 4, 2, 1, 3, 5, 7, 9, 9, 10, 11,
+    11, 12, 12, 12, 12, 13, 15, 14, 15, 14, 15, 15, 15, 14, 14, 15,
+    15,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_BALANCE_15_DT_CW[49] = {
+    0x7dce, 0x7dcf, 0x7ddc, 0x7ddd, 0x7dde, 0x7ddf, 0x7dec, 0x7ded,
+    0x7dee, 0x7def, 0x7df8, 0x3ebe, 0x1f5e, 0x1f7a, 0x0fb8, 0x0fba,
+    0x07cc, 0x0fbe, 0x07d6, 0x01f2, 0x00f8, 0x007e, 0x000e, 0x0002,
+    0x0000, 0x0006, 0x001e, 0x007f, 0x01f6, 0x01f4, 0x03ea, 0x07cd,
+    0x07ce, 0x0f9e, 0x0fae, 0x0fbc, 0x0f9f, 0x1f76, 0x7df9, 0x3ebf,
+    0x7dfa, 0x3ee4, 0x7dfb, 0x7dfc, 0x7dfd, 0x3ee5, 0x3ee6, 0x7dfe,
+    0x7dff,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_BALANCE_30_F0_LEN[13] = {
+    12, 11, 9, 7, 4, 3, 1, 2, 5, 6, 8, 10, 12,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_BALANCE_30_F0_CW[13] = {
+    0xffe, 0x7fe, 0x1fe, 0x07e, 0x00e, 0x006, 0x000, 0x002,
+    0x01e, 0x03e, 0x0fe, 0x3fe, 0xfff,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_BALANCE_30_DF_LEN[25] = {
+    17, 17, 17, 15, 14, 12, 9, 9, 8, 7, 5, 2, 1, 3, 4, 7,
+    8, 9, 10, 11, 14, 15, 16, 16, 17,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_BALANCE_30_DF_CW[25] = {
+    0x1fffc, 0x1fffd, 0x1fffe, 0x07ffa, 0x03ffc, 0x00ffe, 0x001fc, 0x001fe,
+    0x000fa, 0x0007e, 0x0001e, 0x00002, 0x00000, 0x00006, 0x0000e, 0x0007c,
+    0x000fb, 0x001fd, 0x003fe, 0x007fe, 0x03ffe, 0x07ffb, 0x0fffc, 0x0fffd,
+    0x1ffff,
+};
+
+const uint8_t AC4_ASPX_HCB_ENV_BALANCE_30_DT_LEN[25] = {
+    15, 15, 15, 14, 13, 13, 10, 8, 8, 7, 4, 2, 1, 3, 5, 7,
+    9, 9, 9, 12, 14, 13, 14, 15, 14,
+};
+
+const uint32_t AC4_ASPX_HCB_ENV_BALANCE_30_DT_CW[25] = {
+    0x7ff2, 0x7ff3, 0x7ff6, 0x3ff6, 0x1ffe, 0x1fff, 0x03fe, 0x00fa,
+    0x00fe, 0x007e, 0x000e, 0x0002, 0x0000, 0x0006, 0x001e, 0x007c,
+    0x01fe, 0x01f6, 0x01f7, 0x0ffc, 0x3ffa, 0x1ffa, 0x3ff7, 0x7ff7,
+    0x3ff8,
+};
+
+const uint8_t AC4_ASPX_HCB_NOISE_LEVEL_F0_LEN[30] = {
+    12, 12, 9, 7, 6, 6, 5, 1, 2, 3, 5, 7, 8, 8, 9, 10,
+    11, 12, 12, 12, 13, 13, 14, 12, 14, 14, 11, 16, 16, 15,
+};
+
+const uint32_t AC4_ASPX_HCB_NOISE_LEVEL_F0_CW[30] = {
+    0x0efe, 0x0eff, 0x01fe, 0x0076, 0x003a, 0x003e, 0x001e, 0x0000,
+    0x0002, 0x0006, 0x001c, 0x007e, 0x00fe, 0x00ee, 0x01ff, 0x03bc,
+    0x077c, 0x0efa, 0x0ef4, 0x0ef6, 0x1df6, 0x1dee, 0x3bee, 0x0ef5,
+    0x3bde, 0x3bef, 0x077e, 0xef7e, 0xef7f, 0x77be,
+};
+
+const uint8_t AC4_ASPX_HCB_NOISE_LEVEL_DF_LEN[59] = {
+    17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 14, 16, 16, 15, 15,
+    16, 15, 14, 14, 14, 14, 13, 11, 10, 9, 8, 7, 3, 1, 2, 4,
+    5, 7, 8, 9, 10, 12, 13, 13, 14, 16, 17, 17, 17, 17, 17, 17,
+    16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+};
+
+const uint32_t AC4_ASPX_HCB_NOISE_LEVEL_DF_CW[59] = {
+    0x1f19e, 0x1f19f, 0x1f1dc, 0x1f1dd, 0x1f1de, 0x1f1df, 0x1f1e8, 0x1f1e9,
+    0x1f1ea, 0x1f1eb, 0x01f1a, 0x03e7e, 0x0f9fe, 0x0f8f6, 0x07c76, 0x07c66,
+    0x0f8f7, 0x07c7c, 0x03e3c, 0x03e36, 0x03e37, 0x03e3a, 0x01f3e, 0x007ce,
+    0x003e6, 0x001f0, 0x000fa, 0x0007e, 0x00006, 0x00000, 0x00002, 0x0000e,
+    0x0001e, 0x0007f, 0x000fb, 0x001f2, 0x003e2, 0x00f9e, 0x01f1c, 0x01f18,
+    0x03e32, 0x0f8fa, 0x1f3fe, 0x1f1f6, 0x1f1f7, 0x1f1f8, 0x1f1f9, 0x1f1fa,
+    0x0f8ce, 0x1f1fb, 0x1f1fc, 0x1f1fd, 0x1f1fe, 0x1f1ff, 0x1f3f8, 0x1f3f9,
+    0x1f3fa, 0x1f3fb, 0x1f3ff,
+};
+
+const uint8_t AC4_ASPX_HCB_NOISE_LEVEL_DT_LEN[59] = {
+    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+    16, 16, 16, 16, 16, 14, 16, 13, 11, 8, 6, 4, 3, 1, 2, 5,
+    7, 10, 10, 12, 13, 13, 14, 15, 14, 15, 15, 16, 16, 16, 16, 16,
+    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+};
+
+const uint32_t AC4_ASPX_HCB_NOISE_LEVEL_DT_CW[59] = {
+    0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77,
+    0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
+    0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe6, 0x3fd6, 0xffe7, 0x1ffe,
+    0x07fe, 0x00fe, 0x003e, 0x000e, 0x0006, 0x0000, 0x0002, 0x001e,
+    0x007e, 0x03fe, 0x03fc, 0x0ff6, 0x1fe8, 0x1fea, 0x3fd2, 0x7fae,
+    0x3fd3, 0x7ff2, 0x7faf, 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec,
+    0xffed, 0xffee, 0xffef, 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc,
+    0xfffd, 0xfffe, 0xffff,
+};
+
+const uint8_t AC4_ASPX_HCB_NOISE_BALANCE_F0_LEN[13] = {
+    10, 10, 9, 7, 5, 3, 2, 1, 4, 6, 9, 10, 10,
+};
+
+const uint32_t AC4_ASPX_HCB_NOISE_BALANCE_F0_CW[13] = {
+    0x3fa, 0x3fe, 0x1fc, 0x07e, 0x01e, 0x006, 0x002, 0x000,
+    0x00e, 0x03e, 0x1fe, 0x3ff, 0x3fb,
+};
+
+const uint8_t AC4_ASPX_HCB_NOISE_BALANCE_DF_LEN[25] = {
+    13, 13, 13, 13, 13, 12, 13, 10, 9, 7, 4, 2, 1, 3, 5, 6,
+    9, 11, 13, 13, 12, 12, 12, 12, 12,
+};
+
+const uint32_t AC4_ASPX_HCB_NOISE_BALANCE_DF_CW[25] = {
+    0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x1fdc, 0x0fea, 0x1fdd, 0x03f8,
+    0x01fe, 0x007e, 0x000e, 0x0002, 0x0000, 0x0006, 0x001e, 0x003e,
+    0x01ff, 0x07f4, 0x1fde, 0x1fdf, 0x0fe4, 0x0fe5, 0x0fe6, 0x0fe7,
+    0x0feb,
+};
+
+const uint8_t AC4_ASPX_HCB_NOISE_BALANCE_DT_LEN[25] = {
+    11, 11, 11, 11, 11, 11, 11, 10, 10, 6, 4, 3, 1, 2, 5, 8,
+    9, 11, 10, 11, 11, 11, 11, 11, 11,
+};
+
+const uint32_t AC4_ASPX_HCB_NOISE_BALANCE_DT_CW[25] = {
+    0x7e6, 0x7e7, 0x7e8, 0x7e9, 0x7ea, 0x7eb, 0x7ec, 0x3fe,
+    0x3ff, 0x03e, 0x00e, 0x006, 0x000, 0x002, 0x01e, 0x0fe,
+    0x1f8, 0x7ed, 0x3f2, 0x7ee, 0x7ef, 0x7f8, 0x7f9, 0x7fa,
+    0x7fb,
+};
+
+const ac4_aspx_book_t ac4_aspx_books[18] = {
+    {"AC4_ASPX_HCB_ENV_LEVEL_15_F0", AC4_ASPX_HCB_ENV_LEVEL_15_F0_LEN, 
AC4_ASPX_HCB_ENV_LEVEL_15_F0_CW, 71, 0, 18},
+    {"AC4_ASPX_HCB_ENV_LEVEL_15_DF", AC4_ASPX_HCB_ENV_LEVEL_15_DF_LEN, 
AC4_ASPX_HCB_ENV_LEVEL_15_DF_CW, 141, 70, 21},
+    {"AC4_ASPX_HCB_ENV_LEVEL_15_DT", AC4_ASPX_HCB_ENV_LEVEL_15_DT_LEN, 
AC4_ASPX_HCB_ENV_LEVEL_15_DT_CW, 141, 70, 19},
+    {"AC4_ASPX_HCB_ENV_LEVEL_30_F0", AC4_ASPX_HCB_ENV_LEVEL_30_F0_LEN, 
AC4_ASPX_HCB_ENV_LEVEL_30_F0_CW, 36, 0, 17},
+    {"AC4_ASPX_HCB_ENV_LEVEL_30_DF", AC4_ASPX_HCB_ENV_LEVEL_30_DF_LEN, 
AC4_ASPX_HCB_ENV_LEVEL_30_DF_CW, 71, 35, 23},
+    {"AC4_ASPX_HCB_ENV_LEVEL_30_DT", AC4_ASPX_HCB_ENV_LEVEL_30_DT_LEN, 
AC4_ASPX_HCB_ENV_LEVEL_30_DT_CW, 71, 35, 20},
+    {"AC4_ASPX_HCB_ENV_BALANCE_15_F0", AC4_ASPX_HCB_ENV_BALANCE_15_F0_LEN, 
AC4_ASPX_HCB_ENV_BALANCE_15_F0_CW, 25, 0, 16},
+    {"AC4_ASPX_HCB_ENV_BALANCE_15_DF", AC4_ASPX_HCB_ENV_BALANCE_15_DF_LEN, 
AC4_ASPX_HCB_ENV_BALANCE_15_DF_CW, 49, 24, 19},
+    {"AC4_ASPX_HCB_ENV_BALANCE_15_DT", AC4_ASPX_HCB_ENV_BALANCE_15_DT_LEN, 
AC4_ASPX_HCB_ENV_BALANCE_15_DT_CW, 49, 24, 15},
+    {"AC4_ASPX_HCB_ENV_BALANCE_30_F0", AC4_ASPX_HCB_ENV_BALANCE_30_F0_LEN, 
AC4_ASPX_HCB_ENV_BALANCE_30_F0_CW, 13, 0, 12},
+    {"AC4_ASPX_HCB_ENV_BALANCE_30_DF", AC4_ASPX_HCB_ENV_BALANCE_30_DF_LEN, 
AC4_ASPX_HCB_ENV_BALANCE_30_DF_CW, 25, 12, 17},
+    {"AC4_ASPX_HCB_ENV_BALANCE_30_DT", AC4_ASPX_HCB_ENV_BALANCE_30_DT_LEN, 
AC4_ASPX_HCB_ENV_BALANCE_30_DT_CW, 25, 12, 15},
+    {"AC4_ASPX_HCB_NOISE_LEVEL_F0", AC4_ASPX_HCB_NOISE_LEVEL_F0_LEN, 
AC4_ASPX_HCB_NOISE_LEVEL_F0_CW, 30, 0, 16},
+    {"AC4_ASPX_HCB_NOISE_LEVEL_DF", AC4_ASPX_HCB_NOISE_LEVEL_DF_LEN, 
AC4_ASPX_HCB_NOISE_LEVEL_DF_CW, 59, 29, 17},
+    {"AC4_ASPX_HCB_NOISE_LEVEL_DT", AC4_ASPX_HCB_NOISE_LEVEL_DT_LEN, 
AC4_ASPX_HCB_NOISE_LEVEL_DT_CW, 59, 29, 16},
+    {"AC4_ASPX_HCB_NOISE_BALANCE_F0", AC4_ASPX_HCB_NOISE_BALANCE_F0_LEN, 
AC4_ASPX_HCB_NOISE_BALANCE_F0_CW, 13, 0, 10},
+    {"AC4_ASPX_HCB_NOISE_BALANCE_DF", AC4_ASPX_HCB_NOISE_BALANCE_DF_LEN, 
AC4_ASPX_HCB_NOISE_BALANCE_DF_CW, 25, 12, 13},
+    {"AC4_ASPX_HCB_NOISE_BALANCE_DT", AC4_ASPX_HCB_NOISE_BALANCE_DT_LEN, 
AC4_ASPX_HCB_NOISE_BALANCE_DT_CW, 25, 12, 11},
+};
+
+int ac4_aspx_decode(const ac4_aspx_book_t *b,
+               int (*getbit)(void *ctx), void *ctx) {
+    uint32_t acc = 0;
+    for (int L = 1; L <= b->maxlen; L++) {
+        int bit = getbit(ctx);
+        if (bit < 0)
+            return -1;
+        acc = (acc << 1) | (uint32_t)(bit & 1);
+        for (int i = 0; i < b->entries; i++) {
+            if (b->len[i] == L && b->cw[i] == acc)
+                return i;
+        }
+    }
+    return -1;
+}
diff --git a/libavcodec/ac4_aspx_tab.h b/libavcodec/ac4_aspx_tab.h
new file mode 100644
index 0000000..12fee5f
--- /dev/null
+++ b/libavcodec/ac4_aspx_tab.h
@@ -0,0 +1,95 @@
+/*
+ * ASPX codebook tables
+ * Copyright (c) 2026 Michael Rowlinson
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* ASPX (A-SPX) codebook tables, spec-next transcription (wave9).
+ * Authorized: ANSWER-spec-part2-2 (ZIP-TRANSCRIBE, 18 books).
+ * Sources (public ETSI deliverables, fetched 2026-10-02):
+ *   P1 V1.4.1 ts_10319001v010401p0.zip sha 8c827f84...e3ea4
+ *   URLs + full shas: tmp/wave05/WEB-e0.md. Generator:
+ *   tools/aspx_gen.py (e0 gate family: prefix-free + Kraft).
+ * Layout below is own; numeric values transcribed by the
+ * generator; zero ETSI prose or code copied. DO NOT HAND-EDIT:
+ * regenerate with tools/aspx_gen.py.
+ * Order: fam ENV_LEVEL_15/ENV_LEVEL_30/ENV_BALANCE_15/
+ * ENV_BALANCE_30/NOISE_LEVEL/NOISE_BALANCE x F0/DF/DT.
+ * Codeword convention: low LEN bits, MSB first on the wire.
+ */
+#ifndef AC4_ASPX_TAB_H
+#define AC4_ASPX_TAB_H
+
+#include <stdint.h>
+
+typedef struct {
+    const char *name;
+    const uint8_t *len;
+    const uint32_t *cw;
+    int entries;
+    int off;
+    int maxlen;
+} ac4_aspx_book_t;
+
+extern const uint8_t AC4_ASPX_HCB_ENV_LEVEL_15_F0_LEN[71];
+extern const uint32_t AC4_ASPX_HCB_ENV_LEVEL_15_F0_CW[71];
+extern const uint8_t AC4_ASPX_HCB_ENV_LEVEL_15_DF_LEN[141];
+extern const uint32_t AC4_ASPX_HCB_ENV_LEVEL_15_DF_CW[141];
+extern const uint8_t AC4_ASPX_HCB_ENV_LEVEL_15_DT_LEN[141];
+extern const uint32_t AC4_ASPX_HCB_ENV_LEVEL_15_DT_CW[141];
+extern const uint8_t AC4_ASPX_HCB_ENV_LEVEL_30_F0_LEN[36];
+extern const uint32_t AC4_ASPX_HCB_ENV_LEVEL_30_F0_CW[36];
+extern const uint8_t AC4_ASPX_HCB_ENV_LEVEL_30_DF_LEN[71];
+extern const uint32_t AC4_ASPX_HCB_ENV_LEVEL_30_DF_CW[71];
+extern const uint8_t AC4_ASPX_HCB_ENV_LEVEL_30_DT_LEN[71];
+extern const uint32_t AC4_ASPX_HCB_ENV_LEVEL_30_DT_CW[71];
+extern const uint8_t AC4_ASPX_HCB_ENV_BALANCE_15_F0_LEN[25];
+extern const uint32_t AC4_ASPX_HCB_ENV_BALANCE_15_F0_CW[25];
+extern const uint8_t AC4_ASPX_HCB_ENV_BALANCE_15_DF_LEN[49];
+extern const uint32_t AC4_ASPX_HCB_ENV_BALANCE_15_DF_CW[49];
+extern const uint8_t AC4_ASPX_HCB_ENV_BALANCE_15_DT_LEN[49];
+extern const uint32_t AC4_ASPX_HCB_ENV_BALANCE_15_DT_CW[49];
+extern const uint8_t AC4_ASPX_HCB_ENV_BALANCE_30_F0_LEN[13];
+extern const uint32_t AC4_ASPX_HCB_ENV_BALANCE_30_F0_CW[13];
+extern const uint8_t AC4_ASPX_HCB_ENV_BALANCE_30_DF_LEN[25];
+extern const uint32_t AC4_ASPX_HCB_ENV_BALANCE_30_DF_CW[25];
+extern const uint8_t AC4_ASPX_HCB_ENV_BALANCE_30_DT_LEN[25];
+extern const uint32_t AC4_ASPX_HCB_ENV_BALANCE_30_DT_CW[25];
+extern const uint8_t AC4_ASPX_HCB_NOISE_LEVEL_F0_LEN[30];
+extern const uint32_t AC4_ASPX_HCB_NOISE_LEVEL_F0_CW[30];
+extern const uint8_t AC4_ASPX_HCB_NOISE_LEVEL_DF_LEN[59];
+extern const uint32_t AC4_ASPX_HCB_NOISE_LEVEL_DF_CW[59];
+extern const uint8_t AC4_ASPX_HCB_NOISE_LEVEL_DT_LEN[59];
+extern const uint32_t AC4_ASPX_HCB_NOISE_LEVEL_DT_CW[59];
+extern const uint8_t AC4_ASPX_HCB_NOISE_BALANCE_F0_LEN[13];
+extern const uint32_t AC4_ASPX_HCB_NOISE_BALANCE_F0_CW[13];
+extern const uint8_t AC4_ASPX_HCB_NOISE_BALANCE_DF_LEN[25];
+extern const uint32_t AC4_ASPX_HCB_NOISE_BALANCE_DF_CW[25];
+extern const uint8_t AC4_ASPX_HCB_NOISE_BALANCE_DT_LEN[25];
+extern const uint32_t AC4_ASPX_HCB_NOISE_BALANCE_DT_CW[25];
+
+extern const ac4_aspx_book_t ac4_aspx_books[18];
+#define AC4_ASPX_NBOOKS 18
+static inline int ac4_aspx_book(int fam, int ht) {
+    return (fam) * 3 + (ht);
+}
+/* Returns entry index or -1. getbit yields next wire bit. */
+int ac4_aspx_decode(const ac4_aspx_book_t *b,
+                int (*getbit)(void *ctx), void *ctx);
+
+#endif
diff --git a/libavcodec/ac4_huffman_tab.c b/libavcodec/ac4_huffman_tab.c
new file mode 100644
index 0000000..837ba34
--- /dev/null
+++ b/libavcodec/ac4_huffman_tab.c
@@ -0,0 +1,1153 @@
+/*
+ * Huffman codebook tables
+ * Copyright (c) 2026 Michael Rowlinson
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* See ac4_huffman_tab.h. Generated by tools/huffman_gen.py. */
+#include "ac4_huffman_tab.h"
+#include <stddef.h>
+
+const uint8_t AC4_ASF_HCB_1_LEN[81] = {
+    9, 9, 12, 10, 7, 10, 12, 10, 11, 10, 7, 10, 7, 5, 7, 9,
+    7, 10, 11, 8, 9, 9, 7, 9, 11, 10, 12, 9, 7, 10, 7, 5,
+    7, 9, 7, 10, 7, 5, 7, 5, 1, 5, 7, 5, 7, 10, 7, 8,
+    7, 5, 7, 10, 7, 9, 12, 10, 11, 9, 7, 10, 9, 8, 12, 10,
+    7, 9, 7, 5, 7, 9, 7, 10, 12, 10, 12, 10, 7, 10, 12, 9,
+    9,
+};
+
+const uint32_t AC4_ASF_HCB_1_CW[81] = {
+    0x00b, 0x00c, 0x000, 0x004, 0x008, 0x005, 0x001, 0x006,
+    0x004, 0x007, 0x009, 0x008, 0x00a, 0x008, 0x00b, 0x00d,
+    0x00c, 0x009, 0x005, 0x00d, 0x00e, 0x00f, 0x00d, 0x010,
+    0x006, 0x00a, 0x002, 0x011, 0x00e, 0x00b, 0x00f, 0x009,
+    0x010, 0x012, 0x011, 0x00c, 0x012, 0x00a, 0x013, 0x00b,
+    0x001, 0x00c, 0x014, 0x00d, 0x015, 0x00d, 0x016, 0x00e,
+    0x017, 0x00e, 0x018, 0x00e, 0x019, 0x013, 0x003, 0x00f,
+    0x007, 0x014, 0x01a, 0x010, 0x015, 0x00f, 0x004, 0x011,
+    0x01b, 0x016, 0x01c, 0x00f, 0x01d, 0x017, 0x01e, 0x012,
+    0x005, 0x013, 0x006, 0x014, 0x01f, 0x015, 0x007, 0x018,
+    0x019,
+};
+
+const uint8_t AC4_ASF_HCB_2_LEN[81] = {
+    8, 7, 9, 8, 6, 8, 9, 8, 9, 8, 6, 7, 6, 5, 6, 7,
+    6, 8, 9, 7, 7, 7, 6, 7, 9, 8, 9, 8, 6, 8, 6, 5,
+    6, 7, 6, 8, 6, 5, 6, 5, 3, 5, 6, 5, 6, 8, 6, 7,
+    6, 5, 6, 8, 6, 8, 9, 8, 9, 8, 6, 7, 7, 7, 9, 8,
+    6, 7, 6, 4, 6, 8, 6, 8, 9, 8, 9, 8, 6, 8, 9, 7,
+    8,
+};
+
+const uint32_t AC4_ASF_HCB_2_CW[81] = {
+    0x006, 0x00e, 0x000, 0x007, 0x00e, 0x008, 0x001, 0x009,
+    0x002, 0x00a, 0x00f, 0x00f, 0x010, 0x013, 0x011, 0x010,
+    0x012, 0x00b, 0x003, 0x011, 0x012, 0x013, 0x013, 0x014,
+    0x004, 0x00c, 0x005, 0x00d, 0x014, 0x00e, 0x015, 0x014,
+    0x016, 0x015, 0x017, 0x00f, 0x018, 0x015, 0x019, 0x016,
+    0x007, 0x017, 0x01a, 0x018, 0x01b, 0x010, 0x01c, 0x016,
+    0x01d, 0x019, 0x01e, 0x011, 0x01f, 0x012, 0x006, 0x013,
+    0x007, 0x014, 0x020, 0x017, 0x018, 0x019, 0x008, 0x015,
+    0x021, 0x01a, 0x022, 0x00d, 0x023, 0x016, 0x024, 0x017,
+    0x009, 0x018, 0x00a, 0x019, 0x025, 0x01a, 0x00b, 0x01b,
+    0x01b,
+};
+
+const uint8_t AC4_ASF_HCB_3_LEN[81] = {
+    1, 4, 9, 4, 5, 9, 10, 10, 12, 4, 6, 10, 5, 6, 9, 10,
+    9, 11, 10, 11, 14, 10, 10, 12, 12, 11, 13, 4, 6, 11, 6, 7,
+    10, 11, 10, 12, 5, 7, 11, 6, 6, 10, 10, 9, 11, 9, 10, 13,
+    9, 9, 12, 11, 11, 12, 9, 10, 15, 10, 11, 15, 14, 13, 15, 9,
+    10, 14, 9, 10, 13, 13, 12, 14, 11, 12, 15, 11, 11, 14, 13, 12,
+    14,
+};
+
+const uint32_t AC4_ASF_HCB_3_CW[81] = {
+    0x0001, 0x0004, 0x000d, 0x0005, 0x0005, 0x000e, 0x000a, 0x000b,
+    0x0005, 0x0006, 0x0004, 0x000c, 0x0006, 0x0005, 0x000f, 0x000d,
+    0x0010, 0x0007, 0x000e, 0x0008, 0x0002, 0x000f, 0x0010, 0x0006,
+    0x0007, 0x0009, 0x0004, 0x0007, 0x0006, 0x000a, 0x0007, 0x0006,
+    0x0011, 0x000b, 0x0012, 0x0008, 0x0007, 0x0007, 0x000c, 0x0008,
+    0x0009, 0x0013, 0x0014, 0x0011, 0x000d, 0x0012, 0x0015, 0x0005,
+    0x0013, 0x0014, 0x0009, 0x000e, 0x000f, 0x000a, 0x0015, 0x0016,
+    0x0000, 0x0017, 0x0010, 0x0001, 0x0003, 0x0006, 0x0002, 0x0016,
+    0x0018, 0x0004, 0x0017, 0x0019, 0x0007, 0x0008, 0x000b, 0x0005,
+    0x0011, 0x000c, 0x0003, 0x0012, 0x0013, 0x0006, 0x0009, 0x000d,
+    0x0007,
+};
+
+const uint8_t AC4_ASF_HCB_4_LEN[81] = {
+    4, 4, 9, 5, 4, 8, 9, 8, 11, 4, 5, 8, 5, 4, 8, 8,
+    8, 10, 9, 9, 11, 8, 8, 10, 11, 10, 12, 4, 5, 8, 5, 4,
+    8, 9, 8, 10, 4, 4, 8, 4, 4, 7, 8, 7, 9, 8, 8, 11,
+    8, 7, 10, 10, 9, 10, 9, 8, 11, 8, 8, 11, 11, 10, 12, 8,
+    8, 11, 8, 7, 10, 10, 9, 11, 11, 10, 12, 10, 9, 11, 12, 10,
+    11,
+};
+
+const uint32_t AC4_ASF_HCB_4_CW[81] = {
+    0x005, 0x006, 0x00a, 0x005, 0x007, 0x00a, 0x00b, 0x00b,
+    0x002, 0x008, 0x006, 0x00c, 0x007, 0x009, 0x00d, 0x00e,
+    0x00f, 0x007, 0x00c, 0x00d, 0x003, 0x010, 0x011, 0x008,
+    0x004, 0x009, 0x000, 0x00a, 0x008, 0x012, 0x009, 0x00b,
+    0x013, 0x00e, 0x014, 0x00a, 0x00c, 0x00d, 0x015, 0x00e,
+    0x00f, 0x010, 0x016, 0x011, 0x00f, 0x017, 0x018, 0x005,
+    0x019, 0x012, 0x00b, 0x00c, 0x010, 0x00d, 0x011, 0x01a,
+    0x006, 0x01b, 0x01c, 0x007, 0x008, 0x00e, 0x001, 0x01d,
+    0x01e, 0x009, 0x01f, 0x013, 0x00f, 0x010, 0x012, 0x00a,
+    0x00b, 0x011, 0x002, 0x012, 0x013, 0x00c, 0x003, 0x013,
+    0x00d,
+};
+
+const uint8_t AC4_ASF_HCB_5_LEN[81] = {
+    14, 13, 12, 12, 11, 11, 12, 13, 14, 13, 12, 10, 9, 9, 9, 10,
+    11, 13, 13, 10, 9, 8, 7, 7, 9, 10, 12, 12, 9, 8, 5, 4,
+    5, 7, 9, 12, 12, 9, 7, 4, 1, 4, 7, 9, 12, 11, 9, 7,
+    5, 4, 5, 8, 9, 12, 12, 10, 9, 7, 7, 8, 9, 10, 12, 13,
+    11, 10, 9, 9, 10, 10, 12, 13, 14, 12, 12, 12, 11, 11, 12, 13,
+    14,
+};
+
+const uint32_t AC4_ASF_HCB_5_CW[81] = {
+    0x0000, 0x0002, 0x0005, 0x0006, 0x000b, 0x000c, 0x0007, 0x0003,
+    0x0001, 0x0004, 0x0008, 0x0009, 0x0009, 0x000a, 0x000b, 0x000a,
+    0x000d, 0x0005, 0x0006, 0x000b, 0x000c, 0x000c, 0x0008, 0x0009,
+    0x000d, 0x000c, 0x0009, 0x000a, 0x000e, 0x000d, 0x0004, 0x0004,
+    0x0005, 0x000a, 0x000f, 0x000b, 0x000c, 0x0010, 0x000b, 0x0005,
+    0x0001, 0x0006, 0x000c, 0x0011, 0x000d, 0x000e, 0x0012, 0x000d,
+    0x0006, 0x0007, 0x0007, 0x000e, 0x0013, 0x000e, 0x000f, 0x000d,
+    0x0014, 0x000e, 0x000f, 0x000f, 0x0015, 0x000e, 0x0010, 0x0007,
+    0x000f, 0x000f, 0x0016, 0x0017, 0x0010, 0x0011, 0x0011, 0x0008,
+    0x0002, 0x0012, 0x0013, 0x0014, 0x0010, 0x0011, 0x0015, 0x0009,
+    0x0003,
+};
+
+const uint8_t AC4_ASF_HCB_6_LEN[81] = {
+    12, 11, 10, 10, 10, 10, 10, 11, 12, 11, 9, 8, 8, 8, 8, 8,
+    9, 11, 10, 8, 6, 6, 6, 5, 6, 8, 10, 10, 8, 6, 4, 4,
+    4, 5, 8, 10, 10, 8, 6, 4, 4, 4, 6, 8, 10, 10, 8, 5,
+    4, 4, 4, 6, 8, 10, 10, 8, 6, 5, 6, 5, 6, 8, 11, 11,
+    9, 8, 8, 8, 8, 8, 9, 11, 12, 11, 10, 10, 11, 10, 10, 11,
+    12,
+};
+
+const uint32_t AC4_ASF_HCB_6_CW[81] = {
+    0x000, 0x002, 0x006, 0x007, 0x008, 0x009, 0x00a, 0x003,
+    0x001, 0x004, 0x00c, 0x008, 0x009, 0x00a, 0x00b, 0x00c,
+    0x00d, 0x005, 0x00b, 0x00d, 0x007, 0x008, 0x009, 0x009,
+    0x00a, 0x00e, 0x00c, 0x00d, 0x00f, 0x00b, 0x007, 0x008,
+    0x009, 0x00a, 0x010, 0x00e, 0x00f, 0x011, 0x00c, 0x00a,
+    0x00b, 0x00c, 0x00d, 0x012, 0x010, 0x011, 0x013, 0x00b,
+    0x00d, 0x00e, 0x00f, 0x00e, 0x014, 0x012, 0x013, 0x015,
+    0x00f, 0x00c, 0x010, 0x00d, 0x011, 0x016, 0x006, 0x007,
+    0x00e, 0x017, 0x018, 0x019, 0x01a, 0x01b, 0x00f, 0x008,
+    0x002, 0x009, 0x014, 0x015, 0x00a, 0x016, 0x017, 0x00b,
+    0x003,
+};
+
+const uint8_t AC4_ASF_HCB_7_LEN[64] = {
+    1, 3, 6, 8, 9, 9, 10, 11, 3, 4, 6, 7, 8, 8, 9, 10,
+    6, 5, 7, 8, 8, 9, 10, 11, 8, 7, 8, 8, 9, 9, 10, 11,
+    9, 8, 8, 9, 10, 10, 10, 11, 9, 8, 9, 9, 10, 10, 11, 12,
+    10, 9, 10, 10, 10, 11, 12, 12, 12, 10, 11, 11, 12, 12, 12, 12,
+};
+
+const uint32_t AC4_ASF_HCB_7_CW[64] = {
+    0x001, 0x002, 0x007, 0x00b, 0x00a, 0x00b, 0x006, 0x004,
+    0x003, 0x003, 0x008, 0x00b, 0x00c, 0x00d, 0x00c, 0x007,
+    0x009, 0x005, 0x00c, 0x00e, 0x00f, 0x00d, 0x008, 0x005,
+    0x010, 0x00d, 0x011, 0x012, 0x00e, 0x00f, 0x009, 0x006,
+    0x010, 0x013, 0x014, 0x011, 0x00a, 0x00b, 0x00c, 0x007,
+    0x012, 0x015, 0x013, 0x014, 0x00d, 0x00e, 0x008, 0x000,
+    0x00f, 0x015, 0x010, 0x011, 0x012, 0x009, 0x001, 0x002,
+    0x003, 0x013, 0x00a, 0x00b, 0x004, 0x005, 0x006, 0x007,
+};
+
+const uint8_t AC4_ASF_HCB_8_LEN[64] = {
+    4, 4, 5, 6, 7, 8, 9, 10, 4, 3, 4, 5, 6, 7, 8, 9,
+    5, 4, 4, 5, 6, 7, 8, 9, 6, 5, 5, 5, 6, 7, 8, 9,
+    7, 6, 6, 6, 7, 7, 9, 10, 8, 7, 7, 7, 7, 8, 9, 10,
+    9, 8, 8, 8, 8, 9, 9, 10, 11, 9, 9, 9, 10, 10, 10, 11,
+};
+
+const uint32_t AC4_ASF_HCB_8_CW[64] = {
+    0x008, 0x009, 0x009, 0x00a, 0x009, 0x008, 0x004, 0x001,
+    0x00a, 0x007, 0x00b, 0x00a, 0x00b, 0x00a, 0x009, 0x005,
+    0x00b, 0x00c, 0x00d, 0x00c, 0x00c, 0x00b, 0x00a, 0x006,
+    0x00d, 0x00d, 0x00e, 0x00f, 0x00e, 0x00c, 0x00b, 0x007,
+    0x00d, 0x00f, 0x010, 0x011, 0x00e, 0x00f, 0x008, 0x002,
+    0x00c, 0x010, 0x011, 0x012, 0x013, 0x00d, 0x009, 0x003,
+    0x00a, 0x00e, 0x00f, 0x010, 0x011, 0x00b, 0x00c, 0x004,
+    0x000, 0x00d, 0x00e, 0x00f, 0x005, 0x006, 0x007, 0x001,
+};
+
+const uint8_t AC4_ASF_HCB_9_LEN[169] = {
+    1, 3, 6, 8, 9, 10, 10, 11, 11, 12, 12, 12, 13, 3, 4, 6,
+    7, 8, 9, 9, 10, 10, 11, 11, 11, 12, 6, 6, 7, 8, 9, 9,
+    10, 10, 10, 11, 11, 12, 12, 8, 7, 8, 9, 9, 10, 10, 11, 11,
+    11, 12, 12, 12, 9, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12,
+    13, 10, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 10, 9,
+    10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 11, 10, 10, 11, 11,
+    12, 12, 12, 12, 12, 13, 13, 13, 11, 10, 10, 11, 11, 11, 12, 12,
+    12, 13, 13, 13, 14, 12, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13,
+    14, 14, 12, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 12,
+    11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 13, 12, 12, 12,
+    13, 13, 13, 13, 14, 14, 14, 14, 14,
+};
+
+const uint32_t AC4_ASF_HCB_9_CW[169] = {
+    0x0001, 0x0002, 0x0008, 0x0014, 0x001b, 0x0020, 0x0021, 0x001e,
+    0x001f, 0x0011, 0x0012, 0x0013, 0x0006, 0x0003, 0x0003, 0x0009,
+    0x000d, 0x0015, 0x001c, 0x001d, 0x0022, 0x0023, 0x0020, 0x0021,
+    0x0022, 0x0014, 0x000a, 0x000b, 0x000e, 0x0016, 0x001e, 0x001f,
+    0x0024, 0x0025, 0x0026, 0x0023, 0x0024, 0x0015, 0x0016, 0x0017,
+    0x000f, 0x0018, 0x0020, 0x0021, 0x0027, 0x0028, 0x0025, 0x0026,
+    0x0027, 0x0017, 0x0018, 0x0019, 0x0022, 0x0019, 0x0023, 0x0024,
+    0x0029, 0x002a, 0x0028, 0x0029, 0x002a, 0x001a, 0x001b, 0x001c,
+    0x0007, 0x002b, 0x0025, 0x0026, 0x002c, 0x002d, 0x002e, 0x002b,
+    0x002c, 0x002d, 0x001d, 0x001e, 0x001f, 0x0008, 0x002f, 0x0027,
+    0x0030, 0x0031, 0x002e, 0x002f, 0x0030, 0x0020, 0x0021, 0x0022,
+    0x0023, 0x0009, 0x000a, 0x0031, 0x0032, 0x0033, 0x0032, 0x0033,
+    0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x000b, 0x000c, 0x000d,
+    0x0034, 0x0034, 0x0035, 0x0035, 0x0036, 0x0037, 0x0029, 0x002a,
+    0x002b, 0x000e, 0x000f, 0x0010, 0x0000, 0x002c, 0x0038, 0x0039,
+    0x003a, 0x003b, 0x002d, 0x002e, 0x002f, 0x0011, 0x0012, 0x0013,
+    0x0001, 0x0002, 0x0030, 0x003c, 0x003d, 0x0031, 0x0032, 0x0033,
+    0x0034, 0x0014, 0x0015, 0x0016, 0x0017, 0x0003, 0x0004, 0x0035,
+    0x003e, 0x003f, 0x0036, 0x0037, 0x0038, 0x0018, 0x0019, 0x001a,
+    0x001b, 0x001c, 0x0005, 0x0006, 0x001d, 0x0039, 0x003a, 0x003b,
+    0x001e, 0x001f, 0x0020, 0x0021, 0x0007, 0x0008, 0x0009, 0x000a,
+    0x000b,
+};
+
+const uint8_t AC4_ASF_HCB_10_LEN[169] = {
+    6, 5, 6, 6, 7, 8, 9, 10, 10, 11, 11, 12, 12, 5, 4, 4,
+    5, 6, 7, 7, 8, 9, 10, 10, 10, 11, 6, 4, 4, 5, 6, 6,
+    7, 8, 9, 9, 10, 10, 11, 6, 5, 5, 5, 6, 7, 7, 8, 8,
+    9, 10, 10, 11, 7, 6, 6, 6, 6, 7, 7, 8, 9, 9, 10, 10,
+    11, 8, 7, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 9, 7,
+    7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 12, 10, 8, 8, 8, 8,
+    8, 9, 9, 9, 10, 10, 11, 12, 10, 8, 8, 8, 8, 9, 9, 9,
+    10, 10, 10, 11, 12, 11, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11,
+    11, 13, 11, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 13, 12,
+    10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 11, 11, 11,
+    11, 11, 11, 11, 12, 12, 13, 12, 13,
+};
+
+const uint32_t AC4_ASF_HCB_10_CW[169] = {
+    0x0014, 0x0011, 0x0015, 0x0016, 0x0017, 0x001a, 0x001d, 0x0011,
+    0x0012, 0x0007, 0x0008, 0x0002, 0x0003, 0x0012, 0x000c, 0x000d,
+    0x0013, 0x0017, 0x0018, 0x0019, 0x001b, 0x001e, 0x0013, 0x0014,
+    0x0015, 0x0009, 0x0018, 0x000e, 0x000f, 0x0014, 0x0019, 0x001a,
+    0x001a, 0x001c, 0x001f, 0x0020, 0x0016, 0x0017, 0x000a, 0x001b,
+    0x0015, 0x0016, 0x0017, 0x001c, 0x001b, 0x001c, 0x001d, 0x001e,
+    0x0021, 0x0018, 0x0019, 0x000b, 0x001d, 0x001d, 0x001e, 0x001f,
+    0x0020, 0x001e, 0x001f, 0x001f, 0x0022, 0x0023, 0x001a, 0x001b,
+    0x000c, 0x0020, 0x0020, 0x0021, 0x0021, 0x0022, 0x0023, 0x0021,
+    0x0022, 0x0024, 0x0025, 0x001c, 0x001d, 0x000d, 0x0026, 0x0024,
+    0x0025, 0x0026, 0x0027, 0x0023, 0x0024, 0x0027, 0x0028, 0x001e,
+    0x001f, 0x0020, 0x0004, 0x0021, 0x0025, 0x0026, 0x0027, 0x0028,
+    0x0029, 0x0029, 0x002a, 0x002b, 0x0022, 0x0023, 0x000e, 0x0005,
+    0x0024, 0x002a, 0x002b, 0x002c, 0x002d, 0x002c, 0x002d, 0x002e,
+    0x0025, 0x0026, 0x0027, 0x000f, 0x0006, 0x0010, 0x002f, 0x0030,
+    0x0031, 0x0032, 0x0033, 0x0028, 0x0029, 0x002a, 0x002b, 0x0011,
+    0x0012, 0x0000, 0x0013, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030,
+    0x0031, 0x0032, 0x0014, 0x0015, 0x0016, 0x0017, 0x0001, 0x0007,
+    0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0018,
+    0x0019, 0x001a, 0x0008, 0x0009, 0x000a, 0x001b, 0x001c, 0x001d,
+    0x001e, 0x001f, 0x0020, 0x0021, 0x000b, 0x000c, 0x0002, 0x000d,
+    0x0003,
+};
+
+const uint8_t AC4_ASF_HCB_11_LEN[289] = {
+    3, 4, 6, 7, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12,
+    10, 4, 4, 5, 6, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11,
+    11, 9, 6, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10,
+    10, 11, 8, 7, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10,
+    10, 10, 11, 8, 8, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10,
+    10, 10, 10, 11, 8, 9, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10,
+    10, 10, 10, 11, 11, 8, 9, 8, 8, 8, 8, 8, 9, 9, 9, 10,
+    10, 10, 10, 10, 11, 11, 8, 10, 9, 8, 8, 8, 9, 9, 9, 9,
+    10, 10, 10, 11, 11, 11, 11, 9, 10, 9, 9, 9, 9, 9, 9, 9,
+    10, 10, 10, 10, 11, 11, 11, 11, 9, 11, 9, 9, 9, 9, 9, 10,
+    10, 10, 10, 10, 10, 11, 11, 11, 12, 9, 11, 9, 9, 9, 9, 10,
+    10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 9, 11, 10, 9, 9, 9,
+    10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 9, 12, 10, 10, 10,
+    10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 9, 11, 10, 10,
+    10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 9, 12, 11,
+    10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 9, 12,
+    11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 9,
+    10, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,
+    5,
+};
+
+const uint32_t AC4_ASF_HCB_11_CW[289] = {
+    0x007, 0x00b, 0x01f, 0x02f, 0x03d, 0x036, 0x037, 0x026,
+    0x027, 0x00d, 0x00e, 0x00f, 0x000, 0x001, 0x002, 0x003,
+    0x028, 0x00c, 0x00d, 0x013, 0x020, 0x030, 0x03e, 0x03f,
+    0x038, 0x039, 0x03a, 0x03b, 0x029, 0x02a, 0x02b, 0x010,
+    0x011, 0x03c, 0x021, 0x014, 0x022, 0x023, 0x031, 0x032,
+    0x040, 0x041, 0x03d, 0x03e, 0x03f, 0x040, 0x02c, 0x02d,
+    0x02e, 0x012, 0x042, 0x033, 0x024, 0x025, 0x034, 0x035,
+    0x036, 0x043, 0x044, 0x041, 0x042, 0x043, 0x044, 0x02f,
+    0x030, 0x031, 0x013, 0x045, 0x046, 0x037, 0x038, 0x039,
+    0x03a, 0x047, 0x048, 0x045, 0x046, 0x047, 0x048, 0x032,
+    0x033, 0x034, 0x035, 0x014, 0x049, 0x049, 0x03b, 0x03c,
+    0x03d, 0x04a, 0x04b, 0x04c, 0x04a, 0x04b, 0x04c, 0x036,
+    0x037, 0x038, 0x039, 0x015, 0x016, 0x04d, 0x04d, 0x04e,
+    0x04f, 0x050, 0x051, 0x052, 0x04e, 0x04f, 0x050, 0x03a,
+    0x03b, 0x03c, 0x03d, 0x03e, 0x017, 0x018, 0x053, 0x03f,
+    0x051, 0x054, 0x055, 0x056, 0x052, 0x053, 0x054, 0x055,
+    0x040, 0x041, 0x042, 0x019, 0x01a, 0x01b, 0x01c, 0x056,
+    0x043, 0x057, 0x058, 0x059, 0x05a, 0x05b, 0x05c, 0x05d,
+    0x044, 0x045, 0x046, 0x047, 0x01d, 0x01e, 0x01f, 0x020,
+    0x05e, 0x021, 0x05f, 0x060, 0x061, 0x062, 0x063, 0x048,
+    0x049, 0x04a, 0x04b, 0x04c, 0x04d, 0x022, 0x023, 0x024,
+    0x004, 0x064, 0x025, 0x065, 0x066, 0x067, 0x068, 0x04e,
+    0x04f, 0x050, 0x051, 0x052, 0x053, 0x026, 0x027, 0x028,
+    0x029, 0x005, 0x069, 0x02a, 0x054, 0x06a, 0x06b, 0x06c,
+    0x055, 0x056, 0x057, 0x058, 0x059, 0x02b, 0x02c, 0x02d,
+    0x02e, 0x02f, 0x006, 0x06d, 0x007, 0x05a, 0x05b, 0x05c,
+    0x05d, 0x05e, 0x05f, 0x060, 0x030, 0x031, 0x032, 0x033,
+    0x034, 0x035, 0x008, 0x009, 0x06e, 0x036, 0x061, 0x062,
+    0x063, 0x064, 0x065, 0x066, 0x067, 0x037, 0x038, 0x039,
+    0x03a, 0x03b, 0x00a, 0x00b, 0x00c, 0x06f, 0x00d, 0x03c,
+    0x068, 0x069, 0x06a, 0x03d, 0x03e, 0x03f, 0x040, 0x041,
+    0x042, 0x043, 0x00e, 0x00f, 0x010, 0x011, 0x070, 0x012,
+    0x044, 0x045, 0x046, 0x047, 0x048, 0x049, 0x04a, 0x04b,
+    0x013, 0x014, 0x015, 0x016, 0x017, 0x018, 0x019, 0x071,
+    0x06b, 0x057, 0x058, 0x059, 0x05a, 0x05b, 0x05c, 0x05d,
+    0x072, 0x073, 0x074, 0x075, 0x076, 0x077, 0x078, 0x079,
+    0x015,
+};
+
+const uint8_t AC4_ASF_HCB_SCALEFAC_LEN[121] = {
+    17, 14, 14, 14, 14, 14, 14, 15, 14, 14, 14, 14, 14, 14, 14, 14,
+    13, 13, 14, 14, 14, 14, 14, 13, 14, 13, 13, 14, 14, 13, 14, 13,
+    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11,
+    11, 11, 10, 9, 9, 8, 8, 6, 6, 4, 4, 3, 1, 4, 4, 5,
+    6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 11, 12, 12,
+    12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14,
+    14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+    14, 14, 14, 14, 14, 16, 14, 14, 17,
+};
+
+const uint32_t AC4_ASF_HCB_SCALEFAC_CW[121] = {
+    0x00000, 0x00001, 0x00002, 0x00003, 0x00004, 0x00005, 0x00006, 0x00001,
+    0x00007, 0x00008, 0x00009, 0x0000a, 0x0000b, 0x0000c, 0x0000d, 0x0000e,
+    0x00019, 0x0001a, 0x0000f, 0x00010, 0x00011, 0x00012, 0x00013, 0x0001b,
+    0x00014, 0x0001c, 0x0001d, 0x00015, 0x00016, 0x0001e, 0x00017, 0x0001f,
+    0x00020, 0x00021, 0x00022, 0x00023, 0x00024, 0x00025, 0x00026, 0x00027,
+    0x00028, 0x00029, 0x0002a, 0x0001b, 0x0001c, 0x0001d, 0x0001e, 0x00012,
+    0x00013, 0x00014, 0x0000d, 0x00008, 0x00009, 0x00006, 0x00007, 0x00003,
+    0x00004, 0x00002, 0x00003, 0x00003, 0x00001, 0x00004, 0x00005, 0x00003,
+    0x00005, 0x00005, 0x00008, 0x00009, 0x0000a, 0x0000b, 0x0000e, 0x0000f,
+    0x00015, 0x00016, 0x00017, 0x00018, 0x0001f, 0x00019, 0x00020, 0x00021,
+    0x00022, 0x00023, 0x0002b, 0x0002c, 0x0002d, 0x0002e, 0x0002f, 0x00030,
+    0x00031, 0x00032, 0x00033, 0x00034, 0x00018, 0x00019, 0x0001a, 0x0001b,
+    0x0001c, 0x00035, 0x0001d, 0x0001e, 0x0001f, 0x00020, 0x00021, 0x00022,
+    0x00023, 0x00024, 0x00025, 0x00026, 0x00027, 0x00028, 0x00029, 0x0002a,
+    0x0002b, 0x0002c, 0x0002d, 0x0002e, 0x0002f, 0x00001, 0x00030, 0x00031,
+    0x00001,
+};
+
+const uint8_t AC4_ASF_HCB_SNF_LEN[22] = {
+    4, 7, 8, 8, 7, 6, 6, 6, 6, 5, 5, 4, 4, 3, 3, 3,
+    3, 4, 4, 6, 7, 6,
+};
+
+const uint32_t AC4_ASF_HCB_SNF_CW[22] = {
+    0x03, 0x01, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04,
+    0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x06,
+    0x07, 0x06, 0x07, 0x06, 0x03, 0x07,
+};
+
+const uint8_t AC4_ACPL_HCB_ALPHA_COARSE_F0_LEN[17] = {
+    10, 10, 9, 8, 6, 6, 5, 2, 1, 3, 5, 7, 7, 8, 9, 10,
+    10,
+};
+
+const uint32_t AC4_ACPL_HCB_ALPHA_COARSE_F0_CW[17] = {
+    0x3be, 0x3fe, 0x1fe, 0x0fe, 0x03e, 0x03a, 0x01e, 0x002,
+    0x000, 0x006, 0x01c, 0x07e, 0x076, 0x0ee, 0x1de, 0x3ff,
+    0x3bf,
+};
+
+const uint8_t AC4_ACPL_HCB_ALPHA_COARSE_DF_LEN[33] = {
+    15, 18, 17, 17, 16, 15, 15, 13, 12, 11, 10, 9, 8, 7, 4, 3,
+    1, 2, 5, 7, 8, 9, 10, 11, 12, 13, 15, 16, 16, 17, 16, 18,
+    15,
+};
+
+const uint32_t AC4_ACPL_HCB_ALPHA_COARSE_DF_CW[33] = {
+    0x07c76, 0x3e3fe, 0x1f1f6, 0x1f1f7, 0x0f8ea, 0x07c74, 0x07c7c, 0x01f1c,
+    0x00f9e, 0x007ce, 0x003e2, 0x001f0, 0x000fa, 0x0007e, 0x0000e, 0x00006,
+    0x00000, 0x00002, 0x0001e, 0x0007f, 0x000fb, 0x001f2, 0x003e6, 0x007c6,
+    0x00f9f, 0x01f1e, 0x07c7e, 0x0f8fe, 0x0f8fa, 0x1f1fe, 0x0f8eb, 0x3e3ff,
+    0x07c77,
+};
+
+const uint8_t AC4_ACPL_HCB_ALPHA_COARSE_DT_LEN[33] = {
+    14, 16, 15, 16, 15, 15, 14, 13, 12, 12, 10, 9, 8, 7, 5, 3,
+    1, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 15, 16,
+    14,
+};
+
+const uint32_t AC4_ACPL_HCB_ALPHA_COARSE_DT_CW[33] = {
+    0x3efc, 0xfbfa, 0x7ddc, 0xfbfe, 0x7dde, 0x7dfc, 0x3ef6, 0x1f76,
+    0x0fba, 0x0fbe, 0x03ec, 0x01f2, 0x00f8, 0x007e, 0x001e, 0x0006,
+    0x0000, 0x0002, 0x000e, 0x007f, 0x00fa, 0x01f3, 0x03ed, 0x07dc,
+    0x0fbc, 0x1f7a, 0x3ef7, 0x7dfe, 0x7ddf, 0xfbff, 0x7ddd, 0xfbfb,
+    0x3efd,
+};
+
+const uint8_t AC4_ACPL_HCB_ALPHA_FINE_F0_LEN[33] = {
+    10, 12, 11, 11, 10, 10, 9, 8, 7, 7, 8, 7, 6, 6, 4, 3,
+    1, 3, 4, 6, 6, 7, 8, 8, 9, 9, 10, 10, 10, 10, 11, 12,
+    10,
+};
+
+const uint32_t AC4_ACPL_HCB_ALPHA_FINE_F0_CW[33] = {
+    0x2ce, 0xb5e, 0x4fe, 0x5ae, 0x27e, 0x2de, 0x16a, 0x0b2,
+    0x04a, 0x04b, 0x0b6, 0x04e, 0x024, 0x02e, 0x00a, 0x006,
+    0x000, 0x007, 0x008, 0x02f, 0x026, 0x058, 0x0b4, 0x09e,
+    0x16e, 0x166, 0x2df, 0x2cf, 0x27c, 0x27d, 0x4ff, 0xb5f,
+    0x2d6,
+};
+
+const uint8_t AC4_ACPL_HCB_ALPHA_FINE_DF_LEN[65] = {
+    13, 17, 17, 17, 16, 17, 17, 17, 17, 16, 16, 16, 15, 15, 14, 13,
+    13, 12, 12, 11, 11, 11, 10, 10, 10, 9, 8, 7, 7, 5, 4, 3,
+    1, 3, 4, 5, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12,
+    13, 13, 14, 15, 15, 16, 16, 17, 16, 16, 17, 16, 16, 17, 17, 17,
+    13,
+};
+
+const uint32_t AC4_ACPL_HCB_ALPHA_FINE_DF_CW[65] = {
+    0x011de, 0x11ffe, 0x13dea, 0x13df6, 0x08eea, 0x13df7, 0x13dee, 0x13deb,
+    0x13dec, 0x08eee, 0x08ffe, 0x09efe, 0x047fe, 0x04f7c, 0x023fe, 0x011fe,
+    0x013fe, 0x008f6, 0x009ee, 0x00476, 0x0047a, 0x004f6, 0x0023a, 0x0027a,
+    0x0027e, 0x0013e, 0x0009a, 0x0004c, 0x0004e, 0x00012, 0x0000a, 0x00006,
+    0x00000, 0x00007, 0x0000b, 0x00010, 0x00022, 0x00046, 0x0009b, 0x0013c,
+    0x0011c, 0x0023e, 0x0023c, 0x004fe, 0x0047e, 0x009fe, 0x008fe, 0x008f7,
+    0x013ff, 0x011df, 0x027bc, 0x04f7e, 0x04776, 0x09efa, 0x09ef4, 0x13dfe,
+    0x08eeb, 0x08ee8, 0x13dff, 0x08ee9, 0x08eef, 0x11fff, 0x13ded, 0x13def,
+    0x011dc,
+};
+
+const uint8_t AC4_ACPL_HCB_ALPHA_FINE_DT_LEN[65] = {
+    16, 18, 18, 18, 17, 17, 17, 18, 17, 17, 17, 16, 16, 16, 15, 15,
+    14, 14, 13, 13, 13, 12, 11, 11, 10, 10, 9, 9, 7, 6, 5, 3,
+    1, 2, 5, 6, 7, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14,
+    14, 15, 15, 16, 16, 16, 17, 17, 17, 17, 17, 18, 17, 18, 18, 18,
+    16,
+};
+
+const uint32_t AC4_ACPL_HCB_ALPHA_FINE_DT_CW[65] = {
+    0x0eeee, 0x3b3ee, 0x3b3f6, 0x3b3fc, 0x1d9bc, 0x1d9bd, 0x1d9b2, 0x3b3fe,
+    0x1d9be, 0x1d9f6, 0x1d9fc, 0x0ecda, 0x0ecfa, 0x0eeef, 0x0766e, 0x07776,
+    0x03b3a, 0x03bba, 0x01d9a, 0x01ddc, 0x01dde, 0x00eec, 0x00764, 0x00772,
+    0x003b0, 0x003b8, 0x001da, 0x001de, 0x00072, 0x00038, 0x0001e, 0x00006,
+    0x00000, 0x00002, 0x0001f, 0x0003a, 0x00073, 0x001df, 0x001db, 0x003ba,
+    0x003b1, 0x00773, 0x00765, 0x00eed, 0x00ecc, 0x01d9e, 0x01d9c, 0x03bbe,
+    0x03b3b, 0x0777e, 0x0767c, 0x0eefe, 0x0ecfc, 0x0ecd8, 0x1d9fd, 0x1d9fa,
+    0x1d9bf, 0x1d9b6, 0x1d9b3, 0x3b3fd, 0x1d9b7, 0x3b3ff, 0x3b3ef, 0x3b3f7,
+    0x0eeff,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA_COARSE_F0_LEN[5] = {
+    1, 2, 3, 4, 4,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA_COARSE_F0_CW[5] = {
+    0x0, 0x2, 0x6, 0xe, 0xf,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA_COARSE_DF_LEN[9] = {
+    8, 6, 4, 3, 1, 2, 5, 7, 8,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA_COARSE_DF_CW[9] = {
+    0xfe, 0x3e, 0x0e, 0x06, 0x00, 0x02, 0x1e, 0x7e,
+    0xff,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA_COARSE_DT_LEN[9] = {
+    8, 7, 5, 3, 1, 2, 4, 6, 8,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA_COARSE_DT_CW[9] = {
+    0xfe, 0x7e, 0x1e, 0x06, 0x00, 0x02, 0x0e, 0x3e,
+    0xff,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA_FINE_F0_LEN[9] = {
+    1, 2, 3, 4, 5, 6, 7, 8, 8,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA_FINE_F0_CW[9] = {
+    0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e, 0xfe,
+    0xff,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA_FINE_DF_LEN[17] = {
+    13, 12, 10, 9, 8, 7, 5, 3, 1, 2, 4, 7, 8, 9, 9, 11,
+    13,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA_FINE_DF_CW[17] = {
+    0x1f1e, 0x0f8e, 0x03e2, 0x01f2, 0x00fa, 0x007e, 0x001e, 0x0006,
+    0x0000, 0x0002, 0x000e, 0x007f, 0x00fb, 0x01f3, 0x01f0, 0x07c6,
+    0x1f1f,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA_FINE_DT_LEN[17] = {
+    15, 14, 12, 10, 8, 7, 5, 3, 1, 2, 4, 7, 7, 9, 11, 13,
+    15,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA_FINE_DT_CW[17] = {
+    0x7dfe, 0x3efe, 0x0fbe, 0x03ee, 0x00fa, 0x007e, 0x001e, 0x0006,
+    0x0000, 0x0002, 0x000e, 0x007f, 0x007c, 0x01f6, 0x07de, 0x1f7e,
+    0x7dff,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA3_COARSE_F0_LEN[9] = {
+    5, 3, 3, 2, 2, 3, 4, 6, 6,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA3_COARSE_F0_CW[9] = {
+    0x01, 0x06, 0x07, 0x01, 0x02, 0x01, 0x01, 0x01,
+    0x00,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA3_COARSE_DF_LEN[17] = {
+    13, 12, 12, 11, 9, 6, 4, 2, 1, 3, 5, 7, 9, 11, 12, 13,
+    9,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA3_COARSE_DF_CW[17] = {
+    0x0a93, 0x0548, 0x054b, 0x02a7, 0x00ab, 0x0014, 0x0004, 0x0000,
+    0x0001, 0x0003, 0x000b, 0x002b, 0x00aa, 0x02a6, 0x054a, 0x0a92,
+    0x00a8,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA3_COARSE_DT_LEN[17] = {
+    15, 15, 14, 12, 10, 7, 5, 3, 1, 2, 4, 6, 8, 11, 14, 14,
+    9,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA3_COARSE_DT_CW[17] = {
+    0x0adc, 0x0add, 0x056c, 0x015a, 0x0057, 0x000b, 0x0003, 0x0001,
+    0x0001, 0x0001, 0x0000, 0x0004, 0x0014, 0x00ac, 0x056f, 0x056d,
+    0x002a,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA3_FINE_F0_LEN[17] = {
+    7, 5, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6, 7, 7,
+    7,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA3_FINE_F0_CW[17] = {
+    0x0d, 0x02, 0x00, 0x0c, 0x0e, 0x01, 0x03, 0x05,
+    0x04, 0x02, 0x0d, 0x1f, 0x3d, 0x07, 0x78, 0x0c,
+    0x79,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA3_FINE_DF_LEN[33] = {
+    14, 15, 14, 13, 13, 12, 11, 11, 9, 8, 7, 6, 5, 4, 3, 2,
+    2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 14, 14,
+    15,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA3_FINE_DF_CW[33] = {
+    0x19e9, 0x33f7, 0x19f3, 0x0cf5, 0x0cfc, 0x067d, 0x033c, 0x07ff,
+    0x00ce, 0x0066, 0x0032, 0x0018, 0x000d, 0x0007, 0x0002, 0x0000,
+    0x0002, 0x0006, 0x000e, 0x001e, 0x003e, 0x007e, 0x00fe, 0x01fe,
+    0x03fe, 0x07fe, 0x067f, 0x067b, 0x0cf8, 0x19fa, 0x19f2, 0x19e8,
+    0x33f6,
+};
+
+const uint8_t AC4_ACPL_HCB_BETA3_FINE_DT_LEN[33] = {
+    16, 16, 16, 16, 16, 16, 15, 14, 12, 11, 10, 9, 8, 7, 5, 3,
+    1, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 16, 16,
+    16,
+};
+
+const uint32_t AC4_ACPL_HCB_BETA3_FINE_DT_CW[33] = {
+    0x501e, 0x501d, 0x501c, 0x501b, 0x510e, 0x510d, 0x2809, 0x1442,
+    0x0500, 0x0281, 0x0141, 0x00a1, 0x0052, 0x002a, 0x000b, 0x0003,
+    0x0001, 0x0000, 0x0004, 0x002b, 0x0053, 0x00a3, 0x0145, 0x0289,
+    0x0511, 0x0a20, 0x1405, 0x280c, 0x2808, 0x510f, 0x510c, 0x501f,
+    0x501a,
+};
+
+const uint8_t AC4_ACPL_HCB_GAMMA_COARSE_F0_LEN[21] = {
+    13, 13, 13, 13, 11, 9, 7, 6, 5, 3, 2, 3, 3, 4, 3, 3,
+    8, 11, 12, 13, 13,
+};
+
+const uint32_t AC4_ACPL_HCB_GAMMA_COARSE_F0_CW[21] = {
+    0x0af4, 0x0af8, 0x0af9, 0x0afb, 0x02bc, 0x00ae, 0x002a, 0x0014,
+    0x000b, 0x0001, 0x0003, 0x0005, 0x0000, 0x0004, 0x0004, 0x0003,
+    0x0056, 0x02bf, 0x057b, 0x0af5, 0x0afa,
+};
+
+const uint8_t AC4_ACPL_HCB_GAMMA_COARSE_DF_LEN[41] = {
+    16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 14, 13, 13, 11, 10,
+    8, 7, 4, 2, 1, 3, 5, 7, 8, 10, 11, 13, 13, 14, 15, 16,
+    16, 16, 16, 16, 16, 16, 16, 16, 8,
+};
+
+const uint32_t AC4_ACPL_HCB_GAMMA_COARSE_DF_CW[41] = {
+    0x53e1, 0x53e0, 0x53db, 0x53da, 0x53d9, 0x53e2, 0x53e4, 0x53ea,
+    0x53eb, 0x29ea, 0x29f4, 0x14f4, 0x0a78, 0x0a7f, 0x0299, 0x014d,
+    0x0051, 0x002a, 0x0004, 0x0000, 0x0001, 0x0003, 0x000b, 0x002b,
+    0x0052, 0x014e, 0x0298, 0x0a7e, 0x0a79, 0x14f7, 0x29f6, 0x53ef,
+    0x53ee, 0x53e7, 0x53e6, 0x53e3, 0x53e5, 0x53d8, 0x53d7, 0x53d6,
+    0x0050,
+};
+
+const uint8_t AC4_ACPL_HCB_GAMMA_COARSE_DT_LEN[41] = {
+    17, 17, 17, 17, 16, 17, 16, 16, 16, 15, 14, 13, 12, 12, 10, 9,
+    8, 7, 5, 3, 1, 2, 4, 7, 8, 10, 11, 12, 13, 13, 14, 15,
+    16, 16, 16, 17, 17, 17, 17, 17, 9,
+};
+
+const uint32_t AC4_ACPL_HCB_GAMMA_COARSE_DT_CW[41] = {
+    0x0a7f3, 0x0a7f1, 0x0a7f9, 0x0a7f8, 0x050e1, 0x0a7fe, 0x050e8, 0x050eb,
+    0x053fe, 0x029fd, 0x0143b, 0x00a1b, 0x0050c, 0x0053e, 0x00142, 0x000a0,
+    0x00052, 0x0002b, 0x0000b, 0x00003, 0x00001, 0x00000, 0x00004, 0x0002a,
+    0x00051, 0x0014e, 0x0029e, 0x0050f, 0x00a7e, 0x00a1a, 0x01439, 0x02871,
+    0x050ea, 0x050e9, 0x050e0, 0x0a7ff, 0x0a7fb, 0x0a7fa, 0x0a7f2, 0x0a7f0,
+    0x000a6,
+};
+
+const uint8_t AC4_ACPL_HCB_GAMMA_FINE_F0_LEN[41] = {
+    12, 13, 13, 12, 12, 12, 12, 11, 9, 10, 9, 8, 8, 7, 7, 6,
+    5, 5, 4, 4, 3, 3, 4, 4, 5, 5, 5, 5, 4, 3, 4, 7,
+    8, 9, 10, 11, 11, 12, 12, 12, 12,
+};
+
+const uint32_t AC4_ACPL_HCB_GAMMA_FINE_F0_CW[41] = {
+    0x04b6, 0x1c6d, 0x1c6c, 0x049b, 0x04b5, 0x04b7, 0x0e35, 0x024e,
+    0x01c7, 0x038c, 0x0097, 0x0048, 0x00e2, 0x0070, 0x0073, 0x0013,
+    0x0008, 0x0017, 0x0005, 0x000c, 0x0004, 0x0001, 0x000d, 0x000a,
+    0x001f, 0x001e, 0x0016, 0x001d, 0x0006, 0x0000, 0x0007, 0x0072,
+    0x004a, 0x0092, 0x012c, 0x024f, 0x024c, 0x0e34, 0x04b4, 0x049a,
+    0x0e37,
+};
+
+const uint8_t AC4_ACPL_HCB_GAMMA_FINE_DF_LEN[81] = {
+    17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+    17, 17, 16, 16, 16, 15, 15, 15, 14, 14, 13, 13, 13, 12, 11, 11,
+    10, 9, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7, 9, 9,
+    10, 11, 11, 12, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17,
+    17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+    17,
+};
+
+const uint32_t AC4_ACPL_HCB_GAMMA_FINE_DF_CW[81] = {
+    0x13e1f, 0x13e35, 0x13e1e, 0x13e1d, 0x13e1c, 0x13e1b, 0x13e1a, 0x13e19,
+    0x13e34, 0x13e33, 0x13e18, 0x13ec2, 0x13ec1, 0x13ece, 0x13edf, 0x13e17,
+    0x13ede, 0x13edd, 0x09d52, 0x09f18, 0x09f1b, 0x04eaa, 0x04ea8, 0x04fb1,
+    0x02753, 0x02757, 0x013a8, 0x013e0, 0x013ee, 0x009d6, 0x004e9, 0x004fa,
+    0x0027b, 0x0013c, 0x0009c, 0x0004d, 0x00021, 0x00012, 0x0000b, 0x00007,
+    0x00000, 0x00006, 0x0000a, 0x00011, 0x00020, 0x0004c, 0x0013f, 0x0013b,
+    0x0027a, 0x004f9, 0x004e8, 0x009d7, 0x013ef, 0x013e2, 0x027da, 0x027c7,
+    0x02752, 0x04fb6, 0x04eac, 0x04eab, 0x09f65, 0x09d5a, 0x09d53, 0x13ecd,
+    0x13edc, 0x13ecc, 0x13ecf, 0x13ec9, 0x13e32, 0x13ec3, 0x13e16, 0x13ec0,
+    0x13ec8, 0x13e15, 0x13e14, 0x13e13, 0x13e12, 0x13e11, 0x13e10, 0x13ab7,
+    0x13ab6,
+};
+
+const uint8_t AC4_ACPL_HCB_GAMMA_FINE_DT_LEN[81] = {
+    18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17,
+    17, 17, 17, 17, 16, 16, 16, 15, 15, 15, 14, 14, 13, 13, 12, 12,
+    11, 10, 9, 8, 7, 6, 5, 2, 1, 3, 5, 6, 7, 8, 10, 10,
+    11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 17, 17, 17, 17,
+    17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+    18,
+};
+
+const uint32_t AC4_ACPL_HCB_GAMMA_FINE_DT_CW[81] = {
+    0x31e44, 0x31d1d, 0x31e42, 0x31e16, 0x31e41, 0x31e47, 0x31d1c, 0x31e43,
+    0x31e73, 0x31e72, 0x31e15, 0x31e70, 0x31e75, 0x31e7f, 0x31e7e, 0x18e88,
+    0x18d8b, 0x18e8f, 0x18f0e, 0x18f3e, 0x0c746, 0x0c796, 0x0c79e, 0x06361,
+    0x063c9, 0x063d8, 0x031d0, 0x031e6, 0x018d9, 0x018f1, 0x00c6d, 0x00c7a,
+    0x0063b, 0x0031c, 0x0018c, 0x000c1, 0x00062, 0x00033, 0x0001b, 0x00002,
+    0x00000, 0x00007, 0x0001a, 0x00032, 0x00061, 0x000c0, 0x0031f, 0x0031a,
+    0x00637, 0x00c75, 0x018f7, 0x018e9, 0x031ed, 0x031e0, 0x063d9, 0x063ca,
+    0x06363, 0x06360, 0x0c786, 0x0c745, 0x18f3b, 0x18f2e, 0x18e89, 0x18d88,
+    0x18d8a, 0x18d89, 0x31e5f, 0x31e74, 0x31e40, 0x31e71, 0x31e46, 0x31e5e,
+    0x31e1f, 0x31e45, 0x31e1e, 0x31e14, 0x31e17, 0x31e13, 0x31e12, 0x31e11,
+    0x31e10,
+};
+
+const uint8_t AC4_AJOC_HCB_DRY_COARSE_F0_LEN[51] = {
+    17, 17, 18, 17, 17, 16, 16, 15, 14, 15, 14, 13, 13, 12, 12, 11,
+    11, 11, 10, 10, 9, 8, 7, 5, 3, 1, 3, 4, 5, 5, 4, 7,
+    9, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 17, 16, 16,
+    16, 18, 16,
+};
+
+const uint32_t AC4_AJOC_HCB_DRY_COARSE_F0_CW[51] = {
+    0x15b63, 0x15a3b, 0x2b474, 0x15a3c, 0x15a3d, 0x0adbc, 0x0ad1f, 0x056df,
+    0x02b6d, 0x05688, 0x02b45, 0x015b5, 0x0151a, 0x00ad3, 0x00ad0, 0x0056f,
+    0x0056c, 0x00541, 0x002b5, 0x002a2, 0x00159, 0x000a9, 0x00055, 0x00017,
+    0x00006, 0x00000, 0x00004, 0x0000e, 0x00014, 0x00016, 0x0000f, 0x00057,
+    0x00158, 0x002a1, 0x00540, 0x00547, 0x0056e, 0x00a8c, 0x00ad2, 0x0151b,
+    0x015b4, 0x02b46, 0x02b6e, 0x05689, 0x0ad1c, 0x15b62, 0x0adbd, 0x0adb0,
+    0x0adb2, 0x2b475, 0x0adb3,
+};
+
+const uint8_t AC4_AJOC_HCB_DRY_COARSE_DF_LEN[51] = {
+    1, 2, 5, 6, 7, 7, 9, 10, 11, 12, 12, 13, 13, 14, 14, 15,
+    15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 19, 18, 19, 18, 18, 17,
+    17, 16, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 10, 10, 8, 8,
+    6, 5, 3,
+};
+
+const uint32_t AC4_AJOC_HCB_DRY_COARSE_DF_CW[51] = {
+    0x00000, 0x00003, 0x00014, 0x0002d, 0x00059, 0x0005c, 0x00174, 0x002c7,
+    0x0058b, 0x00b14, 0x00ba8, 0x0162a, 0x01752, 0x02c56, 0x02ea7, 0x058ce,
+    0x05d4d, 0x0b15d, 0x0b19f, 0x162bc, 0x1756b, 0x2c573, 0x2c571, 0x2c570,
+    0x58ae4, 0x58ae5, 0x5d5a9, 0x2ead5, 0x5d5a8, 0x2c57a, 0x2c57b, 0x1633c,
+    0x1633d, 0x0bab4, 0x0b15f, 0x05d5b, 0x05d4c, 0x02eac, 0x02c66, 0x01757,
+    0x01632, 0x00baa, 0x00b18, 0x0058d, 0x002eb, 0x002c4, 0x000bb, 0x000b0,
+    0x0002f, 0x00015, 0x00004,
+};
+
+const uint8_t AC4_AJOC_HCB_DRY_COARSE_DT_LEN[101] = {
+    27, 27, 27, 21, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 21,
+    21, 21, 27, 21, 27, 20, 20, 21, 20, 17, 19, 18, 17, 17, 16, 17,
+    16, 15, 15, 15, 14, 14, 14, 13, 12, 12, 11, 10, 10, 8, 7, 6,
+    5, 3, 1, 2, 5, 7, 7, 8, 9, 10, 11, 12, 12, 13, 13, 14,
+    14, 15, 15, 16, 16, 17, 17, 16, 18, 18, 18, 18, 7, 21, 20, 21,
+    27, 27, 27, 27, 20, 21, 27, 27, 27, 27, 22, 27, 27, 27, 27, 28,
+    28, 28, 28, 27, 27,
+};
+
+const uint32_t AC4_AJOC_HCB_DRY_COARSE_DT_CW[101] = {
+    0x52447a6, 0x52447a7, 0x52447a4, 0x014911f, 0x52447a5, 0x52447ba, 
0x52447bb, 0x52447b8,
+    0x52447b9, 0x52447be, 0x52447bf, 0x52447bc, 0x52447bd, 0x52447b2, 
0x52447b3, 0x014913c,
+    0x014913d, 0x014913a, 0x52447b0, 0x014913b, 0x52447b1, 0x00a489f, 
0x00a4881, 0x0149100,
+    0x00a4883, 0x0014917, 0x0052446, 0x0029011, 0x0014912, 0x0014819, 
0x000a4f6, 0x0014809,
+    0x000a48a, 0x000527a, 0x0005241, 0x0005207, 0x0002923, 0x0002921, 
0x0002900, 0x0001487,
+    0x0000a4e, 0x0000a41, 0x0000525, 0x0000299, 0x0000291, 0x00000a7, 
0x000005c, 0x000002f,
+    0x0000015, 0x0000004, 0x0000000, 0x0000003, 0x0000016, 0x0000050, 
0x000005d, 0x00000a5,
+    0x000014d, 0x0000298, 0x0000526, 0x0000a42, 0x0000a49, 0x0001486, 
0x000149f, 0x0002902,
+    0x000293c, 0x0005203, 0x0005240, 0x000a405, 0x000a40d, 0x0014818, 
0x0014916, 0x000a4f7,
+    0x0029010, 0x0029222, 0x0029226, 0x0029221, 0x0000051, 0x0149101, 
0x00a4882, 0x0149138,
+    0x52447b6, 0x52447b7, 0x52447b4, 0x52447b5, 0x00a488e, 0x0149139, 
0x52447aa, 0x52447ab,
+    0x52447a8, 0x52447a9, 0x029223c, 0x52447ae, 0x52447af, 0x52447ac, 
0x52447ad, 0xa488f42,
+    0xa488f43, 0xa488f40, 0xa488f41, 0x52447a2, 0x52447a3,
+};
+
+const uint8_t AC4_AJOC_HCB_DRY_FINE_F0_LEN[101] = {
+    18, 21, 21, 18, 19, 21, 19, 18, 19, 19, 19, 19, 17, 18, 17, 16,
+    16, 17, 17, 16, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 13,
+    13, 13, 12, 12, 12, 11, 11, 11, 11, 10, 9, 9, 8, 7, 7, 6,
+    5, 3, 1, 3, 5, 5, 6, 6, 6, 7, 6, 6, 6, 8, 9, 10,
+    10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 15, 14,
+    15, 16, 15, 17, 16, 17, 17, 16, 17, 19, 19, 19, 18, 19, 19, 18,
+    18, 19, 21, 19, 17,
+};
+
+const uint32_t AC4_AJOC_HCB_DRY_FINE_F0_CW[101] = {
+    0x03505b, 0x1a82d6, 0x1a82d7, 0x0228dc, 0x04512e, 0x1a82d4, 0x04512f, 
0x0228dd,
+    0x04512c, 0x04512d, 0x04519a, 0x04519b, 0x0115dd, 0x0228da, 0x012d88, 
0x00d417,
+    0x008a32, 0x01146f, 0x0115dc, 0x008aec, 0x006a0a, 0x0045b2, 0x0045b3, 
0x004513,
+    0x0025b0, 0x0022d8, 0x0022b8, 0x002288, 0x001a83, 0x0012d9, 0x00116d, 
0x001147,
+    0x00116a, 0x001145, 0x000968, 0x0008a9, 0x0008b4, 0x0006a1, 0x0004b7, 
0x000456,
+    0x000450, 0x00022c, 0x0001a9, 0x00012c, 0x0000d5, 0x00006b, 0x00004a, 
0x000030,
+    0x000013, 0x000007, 0x000000, 0x000005, 0x000010, 0x000019, 0x000023, 
0x000031,
+    0x000034, 0x000044, 0x000037, 0x000036, 0x000024, 0x000097, 0x000117, 
0x000229,
+    0x000351, 0x000455, 0x0004b5, 0x0008a8, 0x000969, 0x0008b7, 0x000d40, 
0x00115e,
+    0x00116b, 0x00115f, 0x0012da, 0x0012db, 0x0022b9, 0x0022ba, 0x004518, 
0x003504,
+    0x00451a, 0x008aed, 0x004b63, 0x012d89, 0x008a24, 0x01144a, 0x0115de, 
0x0096c5,
+    0x0115df, 0x045198, 0x045199, 0x04519e, 0x0228db, 0x04519f, 0x04519c, 
0x0228d8,
+    0x0228d9, 0x04519d, 0x1a82d5, 0x06a0b4, 0x01a82c,
+};
+
+const uint8_t AC4_AJOC_HCB_DRY_FINE_DF_LEN[101] = {
+    1, 3, 4, 5, 6, 7, 8, 8, 8, 9, 9, 10, 11, 11, 12, 12,
+    13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17,
+    17, 18, 17, 18, 18, 18, 18, 20, 19, 19, 19, 20, 20, 20, 19, 19,
+    21, 21, 19, 20, 21, 21, 20, 20, 21, 19, 19, 21, 19, 18, 19, 19,
+    18, 18, 18, 17, 18, 17, 17, 17, 16, 16, 16, 16, 15, 15, 15, 14,
+    14, 14, 14, 14, 13, 13, 12, 12, 12, 11, 11, 10, 10, 9, 9, 8,
+    7, 6, 6, 4, 3,
+};
+
+const uint32_t AC4_AJOC_HCB_DRY_FINE_DF_CW[101] = {
+    0x000000, 0x000004, 0x00000d, 0x00001f, 0x00003c, 0x000064, 0x0000c6, 
0x0000cb,
+    0x0000cf, 0x00018b, 0x000188, 0x000338, 0x000629, 0x000673, 0x000ca1, 
0x000ca7,
+    0x0018a0, 0x001948, 0x0019ca, 0x0019df, 0x003281, 0x003299, 0x003393, 
0x0033bd,
+    0x006524, 0x006720, 0x006778, 0x00c50c, 0x00ce46, 0x00ca4e, 0x00ce4b, 
0x019c8b,
+    0x019499, 0x031439, 0x019c8e, 0x032931, 0x03143a, 0x032934, 0x03392a, 
0x0c50e0,
+    0x065261, 0x062871, 0x067253, 0x0c50e1, 0x0ce454, 0x0ce455, 0x062868, 
0x06722b,
+    0x19de7c, 0x19de7d, 0x06779e, 0x0cef3f, 0x18a1a6, 0x18a1a7, 0x0ca4d6, 
0x0ca4d7,
+    0x18a1a4, 0x067250, 0x067251, 0x18a1a5, 0x06526a, 0x03392b, 0x067252, 
0x065260,
+    0x033bce, 0x033914, 0x031435, 0x019de6, 0x03143b, 0x01949b, 0x019c8f, 
0x018a1b,
+    0x00cef2, 0x00ca4f, 0x00ce44, 0x00c50f, 0x006724, 0x006721, 0x006525, 
0x003396,
+    0x003397, 0x003298, 0x003280, 0x003142, 0x00194d, 0x001941, 0x000cee, 
0x000ca5,
+    0x000c51, 0x000676, 0x000651, 0x00033a, 0x000315, 0x000195, 0x000189, 
0x0000c7,
+    0x000066, 0x00003d, 0x000030, 0x00000e, 0x000005,
+};
+
+const uint8_t AC4_AJOC_HCB_DRY_FINE_DT_LEN[201] = {
+    28, 29, 29, 29, 29, 29, 21, 29, 29, 29, 29, 29, 28, 28, 28, 28,
+    28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 21, 28,
+    21, 21, 28, 28, 28, 28, 21, 28, 28, 28, 20, 21, 21, 20, 21, 21,
+    20, 20, 17, 18, 20, 19, 18, 18, 17, 18, 18, 17, 17, 17, 17, 17,
+    17, 17, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 13,
+    13, 13, 12, 12, 12, 12, 11, 11, 10, 10, 9, 9, 9, 8, 8, 7,
+    6, 6, 4, 3, 1, 3, 4, 6, 6, 7, 8, 8, 8, 9, 9, 10,
+    10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14,
+    15, 15, 15, 15, 15, 16, 16, 17, 16, 17, 17, 18, 18, 17, 17, 18,
+    18, 18, 18, 18, 19, 19, 17, 7, 19, 28, 21, 20, 19, 28, 21, 28,
+    28, 28, 28, 28, 28, 28, 28, 21, 28, 20, 21, 28, 28, 28, 28, 28,
+    28, 28, 28, 28, 22, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+    29, 29, 29, 29, 29, 29, 29, 28, 28,
+};
+
+const uint32_t AC4_AJOC_HCB_DRY_FINE_DT_CW[201] = {
+    0x0cbfcc4d, 0x197f9898, 0x197f9899, 0x197f9892, 0x197f9893, 0x197f9890, 
0x00197f99, 0x197f9891,
+    0x197f9896, 0x197f9897, 0x197f9894, 0x197f9895, 0x0cbfcc5a, 0x0cbfcc5b, 
0x0cbfcc58, 0x0cbfcc59,
+    0x0cbfcc5e, 0x0cbfcc5f, 0x0cbfcc5c, 0x0cbfcc5d, 0x0cbfcc52, 0x0cbfcc53, 
0x0cbfcc50, 0x0cbfcc51,
+    0x0cbfcc56, 0x0cbfcc57, 0x0cbfcc54, 0x0cbfcc55, 0x0cbfcc6a, 0x0cbfcc6b, 
0x00197ff4, 0x0cbfcc68,
+    0x00197ff5, 0x00197f9e, 0x0cbfcc69, 0x0cbfcc6e, 0x0cbfcc6f, 0x0cbfcc6c, 
0x00197f9f, 0x0cbfcc6d,
+    0x0cbfcc62, 0x0cbfcc63, 0x000cbffb, 0x00197f9c, 0x00197f9d, 0x000fe85c, 
0x00197ff2, 0x00197ff3,
+    0x000fe85d, 0x000cbffe, 0x0001fd46, 0x0003fa8a, 0x000cbfff, 0x000654c6, 
0x0003fa10, 0x00032ff0,
+    0x0001fd47, 0x00032ff1, 0x00032a62, 0x000195a1, 0x000197fe, 0x000197f2, 
0x0001fd44, 0x0001953e,
+    0x0001953f, 0x00019532, 0x0000cad1, 0x0000feaa, 0x0000ca9e, 0x000079a8, 
0x00007f43, 0x000079a9,
+    0x0000654d, 0x00006569, 0x0000654e, 0x00003fa9, 0x00003fa2, 0x000032f8, 
0x000032a5, 0x00001e6b,
+    0x00001e68, 0x0000195b, 0x00000feb, 0x00000f37, 0x00000cab, 0x00000caa, 
0x000007f1, 0x0000065e,
+    0x000003fb, 0x000003cc, 0x000001e7, 0x000001e4, 0x00000194, 0x000000fc, 
0x000000c8, 0x00000067,
+    0x0000003d, 0x00000031, 0x0000000d, 0x00000005, 0x00000000, 0x00000004, 
0x0000000e, 0x00000030,
+    0x0000003e, 0x00000078, 0x000000c9, 0x000000fd, 0x000000ff, 0x00000196, 
0x000001e5, 0x0000032e,
+    0x000003f9, 0x00000657, 0x000007f0, 0x00000ca8, 0x00000cac, 0x00000f36, 
0x00000fe9, 0x0000197d,
+    0x0000197e, 0x00001e69, 0x000032a4, 0x000032b5, 0x000032f9, 0x00003fa3, 
0x00003cd5, 0x00003fab,
+    0x000065fd, 0x00007f40, 0x00007f41, 0x00007f50, 0x00007f54, 0x0000cbfd, 
0x0000cbf8, 0x00019530,
+    0x0000cbfe, 0x000195a0, 0x000197f3, 0x00032ff2, 0x00032a67, 0x0001fd09, 
0x0001fd0a, 0x00032a66,
+    0x0003fa11, 0x0003fa8b, 0x0003fa16, 0x0003faae, 0x000654c7, 0x0007f42f, 
0x0001fd56, 0x00000066,
+    0x0007f55e, 0x0cbfcc60, 0x00197ff0, 0x000cbffc, 0x0007f55f, 0x0cbfcc61, 
0x00197ff1, 0x0cbfcc66,
+    0x0cbfcc67, 0x0cbfcc64, 0x0cbfcc65, 0x0cbfcc7a, 0x0cbfcc7b, 0x0cbfcc78, 
0x0cbfcc79, 0x00197f9a,
+    0x0cbfcc7e, 0x000cbffd, 0x00197f9b, 0x0cbfcc7f, 0x0cbfcc7c, 0x0cbfcc7d, 
0x0cbfcc72, 0x0cbfcc73,
+    0x0cbfcc70, 0x0cbfcc71, 0x0cbfcc76, 0x0cbfcc77, 0x0032ff30, 0x0cbfcc74, 
0x0cbfcc75, 0x197f988a,
+    0x197f988b, 0x197f9888, 0x197f9889, 0x197f988e, 0x197f988f, 0x197f988c, 
0x197f988d, 0x197f9882,
+    0x197f9883, 0x197f9880, 0x197f9881, 0x197f9886, 0x197f9887, 0x197f9884, 
0x197f9885, 0x0cbfcc4e,
+    0x0cbfcc4f,
+};
+
+const uint8_t AC4_AJOC_HCB_WET_COARSE_F0_LEN[21] = {
+    10, 14, 14, 12, 11, 11, 7, 5, 3, 3, 1, 3, 4, 6, 8, 11,
+    12, 13, 13, 13, 11,
+};
+
+const uint32_t AC4_AJOC_HCB_WET_COARSE_F0_CW[21] = {
+    0x0355, 0x356a, 0x356b, 0x0d5f, 0x06ae, 0x06a8, 0x006b, 0x001b,
+    0x0007, 0x0005, 0x0000, 0x0004, 0x000c, 0x0034, 0x00d4, 0x06a9,
+    0x0d5b, 0x1abc, 0x1ab4, 0x1abd, 0x06ac,
+};
+
+const uint8_t AC4_AJOC_HCB_WET_COARSE_DF_LEN[21] = {
+    1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 12, 12, 12, 11, 10, 7,
+    7, 6, 5, 4, 3,
+};
+
+const uint32_t AC4_AJOC_HCB_WET_COARSE_DF_CW[21] = {
+    0x000, 0x005, 0x00d, 0x01e, 0x039, 0x07d, 0x0f8, 0x3e4,
+    0x7cc, 0xf9d, 0xf9f, 0xf9c, 0xf9e, 0x7cd, 0x3e5, 0x07f,
+    0x07e, 0x038, 0x01d, 0x00c, 0x004,
+};
+
+const uint8_t AC4_AJOC_HCB_WET_COARSE_DT_LEN[41] = {
+    17, 21, 22, 22, 21, 17, 18, 16, 16, 15, 11, 13, 12, 12, 12, 11,
+    9, 7, 4, 3, 1, 2, 5, 7, 9, 11, 12, 12, 12, 12, 11, 7,
+    16, 17, 17, 17, 21, 21, 21, 21, 21,
+};
+
+const uint32_t AC4_AJOC_HCB_WET_COARSE_DT_CW[41] = {
+    0x014b7f, 0x14b7e9, 0x296fd0, 0x296fd1, 0x14b7ee, 0x014b74, 0x0296fc, 
0x00a5bb,
+    0x00a5be, 0x0052de, 0x00052b, 0x0014b6, 0x000a5e, 0x000a5d, 0x000a55, 
0x000529,
+    0x000148, 0x000051, 0x00000b, 0x000004, 0x000000, 0x000003, 0x000015, 
0x000050,
+    0x000149, 0x000528, 0x000a54, 0x000a5a, 0x000a5c, 0x000a5f, 0x00052c, 
0x000053,
+    0x00a5b8, 0x014b75, 0x014b72, 0x014b73, 0x14b7ef, 0x14b7ec, 0x14b7ed, 
0x14b7ea,
+    0x14b7eb,
+};
+
+const uint8_t AC4_AJOC_HCB_WET_FINE_F0_LEN[41] = {
+    11, 19, 16, 17, 17, 15, 18, 14, 14, 13, 13, 12, 10, 9, 8, 7,
+    6, 5, 4, 3, 1, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15,
+    15, 15, 16, 17, 15, 19, 16, 16, 12,
+};
+
+const uint32_t AC4_AJOC_HCB_WET_FINE_F0_CW[41] = {
+    0x0045e, 0x454c6, 0x08a99, 0x1157c, 0x1157d, 0x0455e, 0x22a62, 0x022a7,
+    0x022ae, 0x0117d, 0x0117c, 0x008a8, 0x0022b, 0x00114, 0x00080, 0x00041,
+    0x00021, 0x00012, 0x0000d, 0x00007, 0x00000, 0x00005, 0x0000c, 0x00013,
+    0x00023, 0x00044, 0x00081, 0x00116, 0x0022e, 0x008aa, 0x01156, 0x04549,
+    0x04548, 0x0454a, 0x08abf, 0x11530, 0x0454b, 0x454c7, 0x08a9a, 0x08a9b,
+    0x008bf,
+};
+
+const uint8_t AC4_AJOC_HCB_WET_FINE_DF_LEN[41] = {
+    1, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12,
+    13, 13, 14, 14, 13, 13, 14, 14, 13, 13, 12, 11, 10, 10, 9, 8,
+    8, 8, 7, 7, 6, 6, 5, 4, 3,
+};
+
+const uint32_t AC4_AJOC_HCB_WET_FINE_DF_CW[41] = {
+    0x0000, 0x0008, 0x000b, 0x0015, 0x0024, 0x0035, 0x004d, 0x006d,
+    0x009d, 0x00dd, 0x013c, 0x01bc, 0x027b, 0x04f4, 0x04f5, 0x09f5,
+    0x13e8, 0x1bdd, 0x37b8, 0x37b9, 0x1bde, 0x1bd9, 0x37b1, 0x37b0,
+    0x1bdf, 0x13e9, 0x0ded, 0x04fb, 0x037a, 0x027c, 0x013f, 0x00df,
+    0x00dc, 0x009c, 0x006c, 0x004c, 0x0034, 0x0025, 0x0014, 0x000c,
+    0x0007,
+};
+
+const uint8_t AC4_AJOC_HCB_WET_FINE_DT_LEN[81] = {
+    26, 20, 26, 26, 26, 26, 26, 26, 26, 25, 19, 25, 25, 19, 19, 20,
+    20, 19, 18, 18, 12, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12,
+    10, 9, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 7, 7, 8, 9,
+    11, 12, 13, 13, 14, 14, 14, 15, 14, 14, 14, 14, 12, 7, 18, 19,
+    19, 25, 20, 20, 20, 25, 20, 21, 25, 25, 25, 26, 26, 26, 26, 25,
+    25,
+};
+
+const uint32_t AC4_AJOC_HCB_WET_FINE_DT_CW[81] = {
+    0x30968e2, 0x00c25b6, 0x30968e3, 0x30968e0, 0x30968e1, 0x30968e6, 
0x30968e7, 0x30968e4,
+    0x30968e5, 0x184b47a, 0x00612de, 0x184b47b, 0x184b478, 0x00612df, 
0x00612dc, 0x00c25b7,
+    0x00c25b4, 0x00612dd, 0x003096a, 0x003096b, 0x0000c58, 0x000316a, 
0x000316c, 0x000309e,
+    0x000316d, 0x000316f, 0x0003099, 0x000309b, 0x0003094, 0x00018b4, 
0x0001844, 0x0000c24,
+    0x0000317, 0x000018a, 0x00000c3, 0x0000063, 0x0000032, 0x000001f, 
0x000000e, 0x0000004,
+    0x0000000, 0x0000005, 0x000000d, 0x000001e, 0x0000060, 0x0000066, 
0x00000c4, 0x0000185,
+    0x0000610, 0x0000c23, 0x0001845, 0x000184e, 0x0003095, 0x0003097, 
0x0003098, 0x000612c,
+    0x000309f, 0x000309a, 0x000316e, 0x000316b, 0x0000c59, 0x0000067, 
0x003096c, 0x00612d0,
+    0x00612d2, 0x184b479, 0x00c25b5, 0x00c25a2, 0x00c25a6, 0x184b47e, 
0x00c25a7, 0x0184b46,
+    0x184b47f, 0x184b47c, 0x184b47d, 0x30968ea, 0x30968eb, 0x30968e8, 
0x30968e9, 0x184b476,
+    0x184b477,
+};
+
+const uint8_t AC4_DE_HCB_ABS_0_LEN[32] = {
+    3, 3, 4, 4, 5, 5, 5, 5, 4, 4, 3, 7, 7, 7, 8, 7,
+    7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 8,
+};
+
+const uint32_t AC4_DE_HCB_ABS_0_CW[32] = {
+    0x06, 0x03, 0x09, 0x01, 0x1f, 0x1d, 0x15, 0x17,
+    0x00, 0x03, 0x02, 0x79, 0x15, 0x10, 0x29, 0x78,
+    0x5a, 0x20, 0x3d, 0x39, 0x22, 0x21, 0x28, 0x2c,
+    0x29, 0x38, 0x23, 0x0b, 0x09, 0x5b, 0x11, 0x28,
+};
+
+const uint8_t AC4_DE_HCB_DIFF_0_LEN[63] = {
+    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+    14, 14, 13, 13, 13, 10, 10, 9, 8, 8, 7, 6, 5, 4, 3, 1,
+    3, 5, 5, 6, 7, 7, 7, 8, 8, 8, 10, 10, 10, 11, 11, 11,
+    11, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13,
+};
+
+const uint32_t AC4_DE_HCB_DIFF_0_CW[63] = {
+    0x02b0, 0x02b1, 0x02b4, 0x02b5, 0x02b7, 0x02b6, 0x02ba, 0x02bb,
+    0x02bc, 0x079d, 0x148d, 0x14b1, 0x079e, 0x079f, 0x148f, 0x14b6,
+    0x14b4, 0x14b5, 0x014c, 0x0159, 0x03cc, 0x002a, 0x014a, 0x003d,
+    0x000b, 0x0057, 0x0028, 0x0003, 0x0002, 0x0004, 0x0003, 0x0001,
+    0x0001, 0x000b, 0x0000, 0x0006, 0x002a, 0x000e, 0x0004, 0x0053,
+    0x001f, 0x0056, 0x0149, 0x0078, 0x0028, 0x0297, 0x0290, 0x00f2,
+    0x0052, 0x0522, 0x00a7, 0x0a59, 0x03cd, 0x015c, 0x14b7, 0x14b0,
+    0x148e, 0x148c, 0x079c, 0x02bf, 0x02bd, 0x02be, 0x014d,
+};
+
+const uint8_t AC4_DE_HCB_ABS_1_LEN[61] = {
+    9, 12, 12, 12, 12, 12, 12, 11, 10, 11, 11, 10, 10, 10, 10, 10,
+    10, 10, 9, 9, 9, 9, 8, 8, 8, 7, 6, 6, 6, 5, 1, 4,
+    5, 5, 5, 5, 5, 5, 6, 6, 5, 6, 7, 6, 7, 8, 8, 9,
+    9, 9, 9, 10, 10, 10, 11, 10, 11, 11, 12, 12, 10,
+};
+
+const uint32_t AC4_DE_HCB_ABS_1_CW[61] = {
+    0x15c, 0xaea, 0xaeb, 0xc56, 0xc78, 0xc79, 0xe51, 0x427,
+    0x210, 0x62a, 0x63d, 0x212, 0x21d, 0x31d, 0x2bb, 0x314,
+    0x390, 0x395, 0x10b, 0x15f, 0x18b, 0x1cb, 0x086, 0x0ab,
+    0x0c6, 0x054, 0x020, 0x024, 0x038, 0x01e, 0x000, 0x00d,
+    0x01f, 0x017, 0x016, 0x014, 0x013, 0x011, 0x03b, 0x03a,
+    0x019, 0x025, 0x073, 0x030, 0x056, 0x0c4, 0x0aa, 0x1c9,
+    0x15e, 0x10f, 0x10a, 0x391, 0x31c, 0x21c, 0x729, 0x211,
+    0x574, 0x426, 0xe50, 0xc57, 0x31f,
+};
+
+const uint8_t AC4_DE_HCB_DIFF_1_LEN[121] = {
+    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+    13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 12, 12, 12, 11, 12,
+    12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10, 10, 9,
+    9, 9, 8, 8, 7, 7, 7, 6, 6, 5, 4, 3, 1, 4, 5, 5,
+    6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 11,
+    11, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13,
+    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+    13, 13, 13, 13, 13, 13, 13, 13, 13,
+};
+
+const uint32_t AC4_DE_HCB_DIFF_1_CW[121] = {
+    0x1cf0, 0x1cbd, 0x1cbc, 0x1ccc, 0x1cb8, 0x1ccb, 0x1ccf, 0x1cc6,
+    0x1cca, 0x1cc9, 0x1cc8, 0x1cce, 0x1cc5, 0x1cd8, 0x1cc4, 0x1cdf,
+    0x1cd1, 0x1cd5, 0x1ce2, 0x1ce3, 0x0c21, 0x1cfc, 0x1cf1, 0x1cf2,
+    0x1cf6, 0x1cf4, 0x1cf7, 0x0c20, 0x0c24, 0x0c25, 0x0729, 0x0d1e,
+    0x0d1f, 0x0d59, 0x0d5b, 0x0d5f, 0x0e6d, 0x0e77, 0x061b, 0x0613,
+    0x06a8, 0x06ae, 0x0730, 0x030a, 0x030c, 0x0355, 0x0396, 0x016c,
+    0x01a2, 0x01bb, 0x00d0, 0x00dc, 0x005a, 0x0069, 0x006f, 0x0031,
+    0x0038, 0x0019, 0x000a, 0x0004, 0x0000, 0x000f, 0x001d, 0x0017,
+    0x0036, 0x002c, 0x006b, 0x0060, 0x00e4, 0x00d4, 0x00b7, 0x01ba,
+    0x0187, 0x016d, 0x0395, 0x030b, 0x073e, 0x0728, 0x06a9, 0x068d,
+    0x068e, 0x0e7f, 0x0611, 0x0d5e, 0x0d5a, 0x0d58, 0x0d19, 0x0d18,
+    0x0c34, 0x0c35, 0x0e74, 0x1cfd, 0x1cf3, 0x1cf5, 0x1cec, 0x1ced,
+    0x1cea, 0x1ce7, 0x1ce5, 0x1ce6, 0x1ce4, 0x1cdd, 0x1ce1, 0x1ce0,
+    0x1cd4, 0x1cde, 0x1cd7, 0x1cdc, 0x1cd2, 0x1cd6, 0x1ccd, 0x1cd3,
+    0x1cd9, 0x1cbf, 0x1cbe, 0x1cd0, 0x1cbb, 0x1cba, 0x1cb9, 0x1cc7,
+    0x1ceb,
+};
+
+const uint8_t AC4_DRC_HCB_LEN[255] = {
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 10, 10,
+    8, 9, 9, 9, 9, 9, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2,
+    3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+};
+
+const uint32_t AC4_DRC_HCB_CW[255] = {
+    0xe12, 0xe11, 0xe10, 0xe0f, 0xe0e, 0xe0d, 0xe0c, 0xe0b,
+    0xe0a, 0xe09, 0xe08, 0xe07, 0xe06, 0xe05, 0xe04, 0xe03,
+    0xe02, 0xe01, 0xe00, 0x53f, 0x53e, 0x53d, 0x53c, 0x53b,
+    0x53a, 0x539, 0x538, 0x537, 0x536, 0x535, 0x534, 0x533,
+    0x532, 0x531, 0x530, 0x52f, 0x52e, 0x52d, 0x52c, 0x52b,
+    0x52a, 0x529, 0x528, 0x527, 0x526, 0x525, 0x524, 0x523,
+    0x522, 0x521, 0x520, 0x51f, 0x51e, 0x51d, 0x51c, 0x51b,
+    0x51a, 0x519, 0x518, 0x517, 0x516, 0x515, 0x514, 0x513,
+    0x512, 0x511, 0x510, 0x50f, 0x50e, 0x50d, 0x50c, 0x50b,
+    0x50a, 0x509, 0x508, 0x507, 0x506, 0x505, 0x504, 0x503,
+    0x502, 0x501, 0x500, 0x4ff, 0x4fe, 0x4fd, 0x4fc, 0x4fb,
+    0x4fa, 0x4f9, 0x4f8, 0x4f7, 0x4f6, 0x4f5, 0x4f4, 0x4f3,
+    0x4f2, 0x4f1, 0x4f0, 0x4ef, 0x4ee, 0x4ed, 0x4ec, 0x4eb,
+    0x4ea, 0x4e9, 0x4e8, 0xe13, 0x0ba, 0x0bb, 0x05c, 0x385,
+    0x016, 0x1c3, 0x02f, 0x054, 0x055, 0x056, 0x022, 0x023,
+    0x00d, 0x009, 0x00b, 0x039, 0x01d, 0x00f, 0x003, 0x002,
+    0x006, 0x003, 0x000, 0x00b, 0x008, 0x015, 0x007, 0x071,
+    0x014, 0x012, 0x013, 0x00c, 0x00a, 0x010, 0x008, 0x4e7,
+    0x4e6, 0x4e5, 0x4e4, 0x4e3, 0x4e2, 0x4e1, 0x4e0, 0x4df,
+    0x4de, 0x4dd, 0x4dc, 0x4db, 0x4da, 0x4d9, 0x4d8, 0x4d7,
+    0x4d6, 0x4d5, 0x4d4, 0x4d3, 0x4d2, 0x4d1, 0x4d0, 0x4cf,
+    0x4ce, 0x4cd, 0x4cc, 0x4cb, 0x4ca, 0x4c9, 0x4c8, 0x4c7,
+    0x4c6, 0x4c5, 0x4c4, 0x4c3, 0x4c2, 0x4c1, 0x4c0, 0x4bf,
+    0x4be, 0x4bd, 0x4bc, 0x4bb, 0x4ba, 0x4b9, 0x4b8, 0x4b7,
+    0x4b6, 0x4b5, 0x4b4, 0x4b3, 0x4b2, 0x4b1, 0x4b0, 0x4af,
+    0x4ae, 0x4ad, 0x4ac, 0x4ab, 0x4aa, 0x4a9, 0x4a8, 0x4a7,
+    0x4a6, 0x4a5, 0x4a4, 0x4a3, 0x4a2, 0x4a1, 0x4a0, 0x49f,
+    0x49e, 0x49d, 0x49c, 0x49b, 0x49a, 0x499, 0x498, 0x497,
+    0x496, 0x495, 0x494, 0x493, 0x492, 0x491, 0x490, 0x48f,
+    0x48e, 0x48d, 0x48c, 0x48b, 0x48a, 0x489, 0x488, 0x487,
+    0x486, 0x485, 0x484, 0x483, 0x482, 0x481, 0x480, 0x2bf,
+    0x2be, 0x2bd, 0x2bc, 0x2bb, 0x2ba, 0x2b9, 0x2b8,
+};
+
+const ac4_huffman_book_t ac4_huffman_books[54] = {
+    {"AC4_ASF_HCB_1", AC4_ASF_HCB_1_LEN, AC4_ASF_HCB_1_CW, 81, 4, 0, 3, 9, 27, 
1, 12},
+    {"AC4_ASF_HCB_2", AC4_ASF_HCB_2_LEN, AC4_ASF_HCB_2_CW, 81, 4, 0, 3, 9, 27, 
1, 9},
+    {"AC4_ASF_HCB_3", AC4_ASF_HCB_3_LEN, AC4_ASF_HCB_3_CW, 81, 4, 1, 3, 9, 27, 
0, 15},
+    {"AC4_ASF_HCB_4", AC4_ASF_HCB_4_LEN, AC4_ASF_HCB_4_CW, 81, 4, 1, 3, 9, 27, 
0, 12},
+    {"AC4_ASF_HCB_5", AC4_ASF_HCB_5_LEN, AC4_ASF_HCB_5_CW, 81, 2, 0, 9, 0, 0, 
4, 14},
+    {"AC4_ASF_HCB_6", AC4_ASF_HCB_6_LEN, AC4_ASF_HCB_6_CW, 81, 2, 0, 9, 0, 0, 
4, 12},
+    {"AC4_ASF_HCB_7", AC4_ASF_HCB_7_LEN, AC4_ASF_HCB_7_CW, 64, 2, 1, 8, 0, 0, 
0, 12},
+    {"AC4_ASF_HCB_8", AC4_ASF_HCB_8_LEN, AC4_ASF_HCB_8_CW, 64, 2, 1, 8, 0, 0, 
0, 11},
+    {"AC4_ASF_HCB_9", AC4_ASF_HCB_9_LEN, AC4_ASF_HCB_9_CW, 169, 2, 1, 13, 0, 
0, 0, 14},
+    {"AC4_ASF_HCB_10", AC4_ASF_HCB_10_LEN, AC4_ASF_HCB_10_CW, 169, 2, 1, 13, 
0, 0, 0, 13},
+    {"AC4_ASF_HCB_11", AC4_ASF_HCB_11_LEN, AC4_ASF_HCB_11_CW, 289, 2, 1, 17, 
0, 0, 0, 12},
+    {"AC4_ASF_HCB_SCALEFAC", AC4_ASF_HCB_SCALEFAC_LEN, 
AC4_ASF_HCB_SCALEFAC_CW, 121, 0, 0, 0, 0, 0, 60, 17},
+    {"AC4_ASF_HCB_SNF", AC4_ASF_HCB_SNF_LEN, AC4_ASF_HCB_SNF_CW, 22, 0, 0, 0, 
0, 0, 17, 8},
+    {"AC4_ACPL_HCB_ALPHA_COARSE_F0", AC4_ACPL_HCB_ALPHA_COARSE_F0_LEN, 
AC4_ACPL_HCB_ALPHA_COARSE_F0_CW, 17, 0, 0, 0, 0, 0, 0, 10},
+    {"AC4_ACPL_HCB_ALPHA_COARSE_DF", AC4_ACPL_HCB_ALPHA_COARSE_DF_LEN, 
AC4_ACPL_HCB_ALPHA_COARSE_DF_CW, 33, 0, 0, 0, 0, 0, 16, 18},
+    {"AC4_ACPL_HCB_ALPHA_COARSE_DT", AC4_ACPL_HCB_ALPHA_COARSE_DT_LEN, 
AC4_ACPL_HCB_ALPHA_COARSE_DT_CW, 33, 0, 0, 0, 0, 0, 16, 16},
+    {"AC4_ACPL_HCB_ALPHA_FINE_F0", AC4_ACPL_HCB_ALPHA_FINE_F0_LEN, 
AC4_ACPL_HCB_ALPHA_FINE_F0_CW, 33, 0, 0, 0, 0, 0, 0, 12},
+    {"AC4_ACPL_HCB_ALPHA_FINE_DF", AC4_ACPL_HCB_ALPHA_FINE_DF_LEN, 
AC4_ACPL_HCB_ALPHA_FINE_DF_CW, 65, 0, 0, 0, 0, 0, 32, 17},
+    {"AC4_ACPL_HCB_ALPHA_FINE_DT", AC4_ACPL_HCB_ALPHA_FINE_DT_LEN, 
AC4_ACPL_HCB_ALPHA_FINE_DT_CW, 65, 0, 0, 0, 0, 0, 32, 18},
+    {"AC4_ACPL_HCB_BETA_COARSE_F0", AC4_ACPL_HCB_BETA_COARSE_F0_LEN, 
AC4_ACPL_HCB_BETA_COARSE_F0_CW, 5, 0, 0, 0, 0, 0, 0, 4},
+    {"AC4_ACPL_HCB_BETA_COARSE_DF", AC4_ACPL_HCB_BETA_COARSE_DF_LEN, 
AC4_ACPL_HCB_BETA_COARSE_DF_CW, 9, 0, 0, 0, 0, 0, 4, 8},
+    {"AC4_ACPL_HCB_BETA_COARSE_DT", AC4_ACPL_HCB_BETA_COARSE_DT_LEN, 
AC4_ACPL_HCB_BETA_COARSE_DT_CW, 9, 0, 0, 0, 0, 0, 4, 8},
+    {"AC4_ACPL_HCB_BETA_FINE_F0", AC4_ACPL_HCB_BETA_FINE_F0_LEN, 
AC4_ACPL_HCB_BETA_FINE_F0_CW, 9, 0, 0, 0, 0, 0, 0, 8},
+    {"AC4_ACPL_HCB_BETA_FINE_DF", AC4_ACPL_HCB_BETA_FINE_DF_LEN, 
AC4_ACPL_HCB_BETA_FINE_DF_CW, 17, 0, 0, 0, 0, 0, 8, 13},
+    {"AC4_ACPL_HCB_BETA_FINE_DT", AC4_ACPL_HCB_BETA_FINE_DT_LEN, 
AC4_ACPL_HCB_BETA_FINE_DT_CW, 17, 0, 0, 0, 0, 0, 8, 15},
+    {"AC4_ACPL_HCB_BETA3_COARSE_F0", AC4_ACPL_HCB_BETA3_COARSE_F0_LEN, 
AC4_ACPL_HCB_BETA3_COARSE_F0_CW, 9, 0, 0, 0, 0, 0, 0, 6},
+    {"AC4_ACPL_HCB_BETA3_COARSE_DF", AC4_ACPL_HCB_BETA3_COARSE_DF_LEN, 
AC4_ACPL_HCB_BETA3_COARSE_DF_CW, 17, 0, 0, 0, 0, 0, 8, 13},
+    {"AC4_ACPL_HCB_BETA3_COARSE_DT", AC4_ACPL_HCB_BETA3_COARSE_DT_LEN, 
AC4_ACPL_HCB_BETA3_COARSE_DT_CW, 17, 0, 0, 0, 0, 0, 8, 15},
+    {"AC4_ACPL_HCB_BETA3_FINE_F0", AC4_ACPL_HCB_BETA3_FINE_F0_LEN, 
AC4_ACPL_HCB_BETA3_FINE_F0_CW, 17, 0, 0, 0, 0, 0, 0, 7},
+    {"AC4_ACPL_HCB_BETA3_FINE_DF", AC4_ACPL_HCB_BETA3_FINE_DF_LEN, 
AC4_ACPL_HCB_BETA3_FINE_DF_CW, 33, 0, 0, 0, 0, 0, 16, 15},
+    {"AC4_ACPL_HCB_BETA3_FINE_DT", AC4_ACPL_HCB_BETA3_FINE_DT_LEN, 
AC4_ACPL_HCB_BETA3_FINE_DT_CW, 33, 0, 0, 0, 0, 0, 16, 16},
+    {"AC4_ACPL_HCB_GAMMA_COARSE_F0", AC4_ACPL_HCB_GAMMA_COARSE_F0_LEN, 
AC4_ACPL_HCB_GAMMA_COARSE_F0_CW, 21, 0, 0, 0, 0, 0, 10, 13},
+    {"AC4_ACPL_HCB_GAMMA_COARSE_DF", AC4_ACPL_HCB_GAMMA_COARSE_DF_LEN, 
AC4_ACPL_HCB_GAMMA_COARSE_DF_CW, 41, 0, 0, 0, 0, 0, 20, 16},
+    {"AC4_ACPL_HCB_GAMMA_COARSE_DT", AC4_ACPL_HCB_GAMMA_COARSE_DT_LEN, 
AC4_ACPL_HCB_GAMMA_COARSE_DT_CW, 41, 0, 0, 0, 0, 0, 20, 17},
+    {"AC4_ACPL_HCB_GAMMA_FINE_F0", AC4_ACPL_HCB_GAMMA_FINE_F0_LEN, 
AC4_ACPL_HCB_GAMMA_FINE_F0_CW, 41, 0, 0, 0, 0, 0, 20, 13},
+    {"AC4_ACPL_HCB_GAMMA_FINE_DF", AC4_ACPL_HCB_GAMMA_FINE_DF_LEN, 
AC4_ACPL_HCB_GAMMA_FINE_DF_CW, 81, 0, 0, 0, 0, 0, 40, 17},
+    {"AC4_ACPL_HCB_GAMMA_FINE_DT", AC4_ACPL_HCB_GAMMA_FINE_DT_LEN, 
AC4_ACPL_HCB_GAMMA_FINE_DT_CW, 81, 0, 0, 0, 0, 0, 40, 18},
+    {"AJOC_HCB_DRY_COARSE_F0", AC4_AJOC_HCB_DRY_COARSE_F0_LEN, 
AC4_AJOC_HCB_DRY_COARSE_F0_CW, 51, 0, 0, 0, 0, 0, 0, 18},
+    {"AJOC_HCB_DRY_COARSE_DF", AC4_AJOC_HCB_DRY_COARSE_DF_LEN, 
AC4_AJOC_HCB_DRY_COARSE_DF_CW, 51, 0, 0, 0, 0, 0, 0, 19},
+    {"AJOC_HCB_DRY_COARSE_DT", AC4_AJOC_HCB_DRY_COARSE_DT_LEN, 
AC4_AJOC_HCB_DRY_COARSE_DT_CW, 101, 0, 0, 0, 0, 0, 50, 28},
+    {"AJOC_HCB_DRY_FINE_F0", AC4_AJOC_HCB_DRY_FINE_F0_LEN, 
AC4_AJOC_HCB_DRY_FINE_F0_CW, 101, 0, 0, 0, 0, 0, 0, 21},
+    {"AJOC_HCB_DRY_FINE_DF", AC4_AJOC_HCB_DRY_FINE_DF_LEN, 
AC4_AJOC_HCB_DRY_FINE_DF_CW, 101, 0, 0, 0, 0, 0, 0, 21},
+    {"AJOC_HCB_DRY_FINE_DT", AC4_AJOC_HCB_DRY_FINE_DT_LEN, 
AC4_AJOC_HCB_DRY_FINE_DT_CW, 201, 0, 0, 0, 0, 0, 100, 29},
+    {"AJOC_HCB_WET_COARSE_F0", AC4_AJOC_HCB_WET_COARSE_F0_LEN, 
AC4_AJOC_HCB_WET_COARSE_F0_CW, 21, 0, 0, 0, 0, 0, 0, 14},
+    {"AJOC_HCB_WET_COARSE_DF", AC4_AJOC_HCB_WET_COARSE_DF_LEN, 
AC4_AJOC_HCB_WET_COARSE_DF_CW, 21, 0, 0, 0, 0, 0, 0, 12},
+    {"AJOC_HCB_WET_COARSE_DT", AC4_AJOC_HCB_WET_COARSE_DT_LEN, 
AC4_AJOC_HCB_WET_COARSE_DT_CW, 41, 0, 0, 0, 0, 0, 20, 22},
+    {"AJOC_HCB_WET_FINE_F0", AC4_AJOC_HCB_WET_FINE_F0_LEN, 
AC4_AJOC_HCB_WET_FINE_F0_CW, 41, 0, 0, 0, 0, 0, 0, 19},
+    {"AJOC_HCB_WET_FINE_DF", AC4_AJOC_HCB_WET_FINE_DF_LEN, 
AC4_AJOC_HCB_WET_FINE_DF_CW, 41, 0, 0, 0, 0, 0, 0, 14},
+    {"AJOC_HCB_WET_FINE_DT", AC4_AJOC_HCB_WET_FINE_DT_LEN, 
AC4_AJOC_HCB_WET_FINE_DT_CW, 81, 0, 0, 0, 0, 0, 40, 26},
+    {"DE_HCB_ABS_0", AC4_DE_HCB_ABS_0_LEN, AC4_DE_HCB_ABS_0_CW, 32, 1, 1, 0, 
0, 0, 0, 8},
+    {"DE_HCB_DIFF_0", AC4_DE_HCB_DIFF_0_LEN, AC4_DE_HCB_DIFF_0_CW, 63, 1, 0, 
0, 0, 0, 31, 14},
+    {"DE_HCB_ABS_1", AC4_DE_HCB_ABS_1_LEN, AC4_DE_HCB_ABS_1_CW, 61, 1, 1, 0, 
0, 0, 30, 12},
+    {"DE_HCB_DIFF_1", AC4_DE_HCB_DIFF_1_LEN, AC4_DE_HCB_DIFF_1_CW, 121, 1, 0, 
0, 0, 0, 60, 13},
+    {"DRC_HCB", AC4_DRC_HCB_LEN, AC4_DRC_HCB_CW, 255, 1, 0, 0, 0, 0, 127, 12},
+};
+
+int ac4_hcb_decode(const ac4_huffman_book_t *b,
+               int (*getbit)(void *ctx), void *ctx) {
+    uint32_t acc = 0;
+    for (int L = 1; L <= b->maxlen; L++) {
+        int bit = getbit(ctx);
+        if (bit < 0)
+            return -1;
+        acc = (acc << 1) | (uint32_t)(bit & 1);
+        for (int i = 0; i < b->entries; i++) {
+            if (b->len[i] == L && b->cw[i] == acc)
+                return i;
+        }
+    }
+    return -1;
+}
diff --git a/libavcodec/ac4_huffman_tab.h b/libavcodec/ac4_huffman_tab.h
new file mode 100644
index 0000000..cd33ec0
--- /dev/null
+++ b/libavcodec/ac4_huffman_tab.h
@@ -0,0 +1,186 @@
+/*
+ * Huffman codebook tables
+ * Copyright (c) 2026 Michael Rowlinson
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* Huffman codebook tables, E0 transcription (JOBS#32).
+ * Sources (public ETSI deliverables, fetched 2026-10-02):
+ *   P1 V1.4.1 ts_10319001v010401p0.zip sha 8c827f84...e3ea4
+ *   P2 V1.3.1 ts_10319002v010301p0.zip sha 44105a06...eef9c6
+ *   URLs + full shas: tmp/wave05/WEB-e0.md. Generator:
+ *   tools/huffman_gen.py (gates on prefix-free + survey pins).
+ * Layout below is own; numeric values transcribed by the
+ * generator; zero ETSI prose or code copied. DO NOT HAND-EDIT:
+ * regenerate with tools/huffman_gen.py.
+ * Order: 0-10 ASF 1-11, 11 SCALEFAC, 12 SNF, 13-36 ACPL
+ * (dtype ALPHA/BETA/BETA3/GAMMA x COARSE/FINE x F0/DF/DT),
+ * 37-48 AJOC (DRY/WET x COARSE/FINE x F0/DF/DT),
+ * 49-52 DE (ABS_0/DIFF_0/ABS_1/DIFF_1), 53 DRC.
+ * Codeword convention: low LEN bits, MSB first on the wire.
+ */
+#ifndef AC4_HUFFMAN_TAB_H
+#define AC4_HUFFMAN_TAB_H
+
+#include <stdint.h>
+
+typedef struct {
+    const char *name;
+    const uint8_t *len;
+    const uint32_t *cw;
+    int entries;
+    int dim;
+    int is_unsigned;
+    int mod, mod2, mod3;
+    int off;
+    int maxlen;
+} ac4_huffman_book_t;
+
+extern const uint8_t AC4_ASF_HCB_1_LEN[81];
+extern const uint32_t AC4_ASF_HCB_1_CW[81];
+extern const uint8_t AC4_ASF_HCB_2_LEN[81];
+extern const uint32_t AC4_ASF_HCB_2_CW[81];
+extern const uint8_t AC4_ASF_HCB_3_LEN[81];
+extern const uint32_t AC4_ASF_HCB_3_CW[81];
+extern const uint8_t AC4_ASF_HCB_4_LEN[81];
+extern const uint32_t AC4_ASF_HCB_4_CW[81];
+extern const uint8_t AC4_ASF_HCB_5_LEN[81];
+extern const uint32_t AC4_ASF_HCB_5_CW[81];
+extern const uint8_t AC4_ASF_HCB_6_LEN[81];
+extern const uint32_t AC4_ASF_HCB_6_CW[81];
+extern const uint8_t AC4_ASF_HCB_7_LEN[64];
+extern const uint32_t AC4_ASF_HCB_7_CW[64];
+extern const uint8_t AC4_ASF_HCB_8_LEN[64];
+extern const uint32_t AC4_ASF_HCB_8_CW[64];
+extern const uint8_t AC4_ASF_HCB_9_LEN[169];
+extern const uint32_t AC4_ASF_HCB_9_CW[169];
+extern const uint8_t AC4_ASF_HCB_10_LEN[169];
+extern const uint32_t AC4_ASF_HCB_10_CW[169];
+extern const uint8_t AC4_ASF_HCB_11_LEN[289];
+extern const uint32_t AC4_ASF_HCB_11_CW[289];
+extern const uint8_t AC4_ASF_HCB_SCALEFAC_LEN[121];
+extern const uint32_t AC4_ASF_HCB_SCALEFAC_CW[121];
+extern const uint8_t AC4_ASF_HCB_SNF_LEN[22];
+extern const uint32_t AC4_ASF_HCB_SNF_CW[22];
+extern const uint8_t AC4_ACPL_HCB_ALPHA_COARSE_F0_LEN[17];
+extern const uint32_t AC4_ACPL_HCB_ALPHA_COARSE_F0_CW[17];
+extern const uint8_t AC4_ACPL_HCB_ALPHA_COARSE_DF_LEN[33];
+extern const uint32_t AC4_ACPL_HCB_ALPHA_COARSE_DF_CW[33];
+extern const uint8_t AC4_ACPL_HCB_ALPHA_COARSE_DT_LEN[33];
+extern const uint32_t AC4_ACPL_HCB_ALPHA_COARSE_DT_CW[33];
+extern const uint8_t AC4_ACPL_HCB_ALPHA_FINE_F0_LEN[33];
+extern const uint32_t AC4_ACPL_HCB_ALPHA_FINE_F0_CW[33];
+extern const uint8_t AC4_ACPL_HCB_ALPHA_FINE_DF_LEN[65];
+extern const uint32_t AC4_ACPL_HCB_ALPHA_FINE_DF_CW[65];
+extern const uint8_t AC4_ACPL_HCB_ALPHA_FINE_DT_LEN[65];
+extern const uint32_t AC4_ACPL_HCB_ALPHA_FINE_DT_CW[65];
+extern const uint8_t AC4_ACPL_HCB_BETA_COARSE_F0_LEN[5];
+extern const uint32_t AC4_ACPL_HCB_BETA_COARSE_F0_CW[5];
+extern const uint8_t AC4_ACPL_HCB_BETA_COARSE_DF_LEN[9];
+extern const uint32_t AC4_ACPL_HCB_BETA_COARSE_DF_CW[9];
+extern const uint8_t AC4_ACPL_HCB_BETA_COARSE_DT_LEN[9];
+extern const uint32_t AC4_ACPL_HCB_BETA_COARSE_DT_CW[9];
+extern const uint8_t AC4_ACPL_HCB_BETA_FINE_F0_LEN[9];
+extern const uint32_t AC4_ACPL_HCB_BETA_FINE_F0_CW[9];
+extern const uint8_t AC4_ACPL_HCB_BETA_FINE_DF_LEN[17];
+extern const uint32_t AC4_ACPL_HCB_BETA_FINE_DF_CW[17];
+extern const uint8_t AC4_ACPL_HCB_BETA_FINE_DT_LEN[17];
+extern const uint32_t AC4_ACPL_HCB_BETA_FINE_DT_CW[17];
+extern const uint8_t AC4_ACPL_HCB_BETA3_COARSE_F0_LEN[9];
+extern const uint32_t AC4_ACPL_HCB_BETA3_COARSE_F0_CW[9];
+extern const uint8_t AC4_ACPL_HCB_BETA3_COARSE_DF_LEN[17];
+extern const uint32_t AC4_ACPL_HCB_BETA3_COARSE_DF_CW[17];
+extern const uint8_t AC4_ACPL_HCB_BETA3_COARSE_DT_LEN[17];
+extern const uint32_t AC4_ACPL_HCB_BETA3_COARSE_DT_CW[17];
+extern const uint8_t AC4_ACPL_HCB_BETA3_FINE_F0_LEN[17];
+extern const uint32_t AC4_ACPL_HCB_BETA3_FINE_F0_CW[17];
+extern const uint8_t AC4_ACPL_HCB_BETA3_FINE_DF_LEN[33];
+extern const uint32_t AC4_ACPL_HCB_BETA3_FINE_DF_CW[33];
+extern const uint8_t AC4_ACPL_HCB_BETA3_FINE_DT_LEN[33];
+extern const uint32_t AC4_ACPL_HCB_BETA3_FINE_DT_CW[33];
+extern const uint8_t AC4_ACPL_HCB_GAMMA_COARSE_F0_LEN[21];
+extern const uint32_t AC4_ACPL_HCB_GAMMA_COARSE_F0_CW[21];
+extern const uint8_t AC4_ACPL_HCB_GAMMA_COARSE_DF_LEN[41];
+extern const uint32_t AC4_ACPL_HCB_GAMMA_COARSE_DF_CW[41];
+extern const uint8_t AC4_ACPL_HCB_GAMMA_COARSE_DT_LEN[41];
+extern const uint32_t AC4_ACPL_HCB_GAMMA_COARSE_DT_CW[41];
+extern const uint8_t AC4_ACPL_HCB_GAMMA_FINE_F0_LEN[41];
+extern const uint32_t AC4_ACPL_HCB_GAMMA_FINE_F0_CW[41];
+extern const uint8_t AC4_ACPL_HCB_GAMMA_FINE_DF_LEN[81];
+extern const uint32_t AC4_ACPL_HCB_GAMMA_FINE_DF_CW[81];
+extern const uint8_t AC4_ACPL_HCB_GAMMA_FINE_DT_LEN[81];
+extern const uint32_t AC4_ACPL_HCB_GAMMA_FINE_DT_CW[81];
+extern const uint8_t AC4_AJOC_HCB_DRY_COARSE_F0_LEN[51];
+extern const uint32_t AC4_AJOC_HCB_DRY_COARSE_F0_CW[51];
+extern const uint8_t AC4_AJOC_HCB_DRY_COARSE_DF_LEN[51];
+extern const uint32_t AC4_AJOC_HCB_DRY_COARSE_DF_CW[51];
+extern const uint8_t AC4_AJOC_HCB_DRY_COARSE_DT_LEN[101];
+extern const uint32_t AC4_AJOC_HCB_DRY_COARSE_DT_CW[101];
+extern const uint8_t AC4_AJOC_HCB_DRY_FINE_F0_LEN[101];
+extern const uint32_t AC4_AJOC_HCB_DRY_FINE_F0_CW[101];
+extern const uint8_t AC4_AJOC_HCB_DRY_FINE_DF_LEN[101];
+extern const uint32_t AC4_AJOC_HCB_DRY_FINE_DF_CW[101];
+extern const uint8_t AC4_AJOC_HCB_DRY_FINE_DT_LEN[201];
+extern const uint32_t AC4_AJOC_HCB_DRY_FINE_DT_CW[201];
+extern const uint8_t AC4_AJOC_HCB_WET_COARSE_F0_LEN[21];
+extern const uint32_t AC4_AJOC_HCB_WET_COARSE_F0_CW[21];
+extern const uint8_t AC4_AJOC_HCB_WET_COARSE_DF_LEN[21];
+extern const uint32_t AC4_AJOC_HCB_WET_COARSE_DF_CW[21];
+extern const uint8_t AC4_AJOC_HCB_WET_COARSE_DT_LEN[41];
+extern const uint32_t AC4_AJOC_HCB_WET_COARSE_DT_CW[41];
+extern const uint8_t AC4_AJOC_HCB_WET_FINE_F0_LEN[41];
+extern const uint32_t AC4_AJOC_HCB_WET_FINE_F0_CW[41];
+extern const uint8_t AC4_AJOC_HCB_WET_FINE_DF_LEN[41];
+extern const uint32_t AC4_AJOC_HCB_WET_FINE_DF_CW[41];
+extern const uint8_t AC4_AJOC_HCB_WET_FINE_DT_LEN[81];
+extern const uint32_t AC4_AJOC_HCB_WET_FINE_DT_CW[81];
+extern const uint8_t AC4_DE_HCB_ABS_0_LEN[32];
+extern const uint32_t AC4_DE_HCB_ABS_0_CW[32];
+extern const uint8_t AC4_DE_HCB_DIFF_0_LEN[63];
+extern const uint32_t AC4_DE_HCB_DIFF_0_CW[63];
+extern const uint8_t AC4_DE_HCB_ABS_1_LEN[61];
+extern const uint32_t AC4_DE_HCB_ABS_1_CW[61];
+extern const uint8_t AC4_DE_HCB_DIFF_1_LEN[121];
+extern const uint32_t AC4_DE_HCB_DIFF_1_CW[121];
+extern const uint8_t AC4_DRC_HCB_LEN[255];
+extern const uint32_t AC4_DRC_HCB_CW[255];
+
+extern const ac4_huffman_book_t ac4_huffman_books[54];
+#define HUFFMAN_NBOOKS 54
+#define HUFFMAN_ASF_BASE 0
+#define HUFFMAN_SCALE_FAC 11
+#define HUFFMAN_SNF 12
+#define HUFFMAN_ACPL_BASE 13
+#define HUFFMAN_AJOC_BASE 37
+#define HUFFMAN_DE_BASE 49
+#define HUFFMAN_DRC 53
+static inline int huffman_asf(int n) { return (n) - 1; }
+static inline int huffman_acpl(int dt, int qm, int ht) {
+    return 13 + ((dt) * 2 + (qm)) * 3 + (ht);
+}
+static inline int huffman_ajoc(int dt, int qm, int ht) {
+    return 37 + ((dt) * 2 + (qm)) * 3 + (ht);
+}
+static inline int huffman_de(int absdif, int m) {
+    return 49 + (m) * 2 + (absdif);
+}
+/* Returns entry index or -1. getbit yields next wire bit. */
+int ac4_hcb_decode(const ac4_huffman_book_t *b,
+               int (*getbit)(void *ctx), void *ctx);
+
+#endif
diff --git a/libavcodec/ac4_sfb_offsets.c b/libavcodec/ac4_sfb_offsets.c
new file mode 100644
index 0000000..2f905cb
--- /dev/null
+++ b/libavcodec/ac4_sfb_offsets.c
@@ -0,0 +1,166 @@
+/*
+ * 48 kHz scale-factor-band offset ladders
+ * Copyright (c) 2026 Michael Rowlinson
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* ac4_sfb_offsets.c -- GENERATED by tools/ac4_sfb_gen.py; DO NOT HAND-EDIT. */
+#include "ac4_sfb_offsets.h"
+
+#include <stddef.h>
+
+static const int off_96[13] = {
+    0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80,
+    96,
+};
+
+static const int off_120[15] = {
+    0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80,
+    96, 112, 120,
+};
+
+static const int off_128[15] = {
+    0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80,
+    96, 112, 128,
+};
+
+static const int off_192[19] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64,
+    76, 92, 108, 128, 148, 172, 192,
+};
+
+static const int off_240[21] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64,
+    76, 92, 108, 128, 148, 172, 196, 224, 240,
+};
+
+static const int off_256[21] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64,
+    76, 92, 108, 128, 148, 172, 196, 224, 256,
+};
+
+static const int off_384[34] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+    48, 52, 56, 60, 68, 76, 84, 92, 100, 112, 124, 136,
+    148, 164, 184, 208, 236, 268, 300, 332, 364, 384,
+};
+
+static const int off_480[37] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+    48, 52, 56, 60, 68, 76, 84, 92, 100, 112, 124, 136,
+    148, 164, 184, 208, 236, 268, 300, 332, 364, 396, 428, 460,
+    480,
+};
+
+static const int off_512[37] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+    48, 52, 56, 60, 68, 76, 84, 92, 100, 112, 124, 136,
+    148, 164, 184, 208, 236, 268, 300, 332, 364, 396, 428, 460,
+    512,
+};
+
+static const int off_768[44] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48,
+    56, 64, 72, 80, 88, 96, 108, 120, 132, 144, 160, 176,
+    196, 216, 240, 264, 292, 320, 352, 384, 416, 448, 480, 512,
+    544, 576, 608, 640, 672, 704, 736, 768,
+};
+
+static const int off_960[50] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48,
+    56, 64, 72, 80, 88, 96, 108, 120, 132, 144, 160, 176,
+    196, 216, 240, 264, 292, 320, 352, 384, 416, 448, 480, 512,
+    544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896,
+    928, 960,
+};
+
+static const int off_1024[50] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48,
+    56, 64, 72, 80, 88, 96, 108, 120, 132, 144, 160, 176,
+    196, 216, 240, 264, 292, 320, 352, 384, 416, 448, 480, 512,
+    544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896,
+    928, 1024,
+};
+
+static const int off_1536[56] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+    52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 136, 148,
+    160, 172, 188, 204, 220, 240, 260, 284, 308, 336, 364, 396,
+    432, 468, 508, 552, 600, 652, 704, 768, 832, 896, 960, 1024,
+    1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536,
+};
+
+static const int off_1920[62] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+    52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 136, 148,
+    160, 172, 188, 204, 220, 240, 260, 284, 308, 336, 364, 396,
+    432, 468, 508, 552, 600, 652, 704, 768, 832, 896, 960, 1024,
+    1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536, 1600, 1664, 1728, 1792,
+    1856, 1920,
+};
+
+static const int off_2048[64] = {
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+    52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 136, 148,
+    160, 172, 188, 204, 220, 240, 260, 284, 308, 336, 364, 396,
+    432, 468, 508, 552, 600, 652, 704, 768, 832, 896, 960, 1024,
+    1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536, 1600, 1664, 1728, 1792,
+    1856, 1920, 1984, 2048,
+};
+
+int ac4_sfb_nbands48(int length) {
+    switch (length) {
+    case 96: return 12;
+    case 120: return 14;
+    case 128: return 14;
+    case 192: return 18;
+    case 240: return 20;
+    case 256: return 20;
+    case 384: return 33;
+    case 480: return 36;
+    case 512: return 36;
+    case 768: return 43;
+    case 960: return 49;
+    case 1024: return 49;
+    case 1536: return 55;
+    case 1920: return 61;
+    case 2048: return 63;
+    default: return 0;
+    }
+}
+
+const int *ac4_sfb_offsets48(int length) {
+    switch (length) {
+    case 96: return off_96;
+    case 120: return off_120;
+    case 128: return off_128;
+    case 192: return off_192;
+    case 240: return off_240;
+    case 256: return off_256;
+    case 384: return off_384;
+    case 480: return off_480;
+    case 512: return off_512;
+    case 768: return off_768;
+    case 960: return off_960;
+    case 1024: return off_1024;
+    case 1536: return off_1536;
+    case 1920: return off_1920;
+    case 2048: return off_2048;
+    default: return NULL;
+    }
+}
diff --git a/libavcodec/ac4_sfb_offsets.h b/libavcodec/ac4_sfb_offsets.h
new file mode 100644
index 0000000..4eb179d
--- /dev/null
+++ b/libavcodec/ac4_sfb_offsets.h
@@ -0,0 +1,34 @@
+/*
+ * 48 kHz scale-factor-band offset ladders
+ * Copyright (c) 2026 Michael Rowlinson
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* ac4_sfb_offsets.h -- 48k scale-factor-band offset ladders.
+ * GENERATED by tools/ac4_sfb_gen.py; DO NOT HAND-EDIT.
+ * Values: m5 TSV (ANSWER-e1-1) + own B.7 transcription; B.1 prefix.
+ * Layout own; zero ETSI prose copied. */
+#ifndef AC4_SFB_OFFSETS_H
+#define AC4_SFB_OFFSETS_H
+
+/* 48k band count (Table B.1) + offsets (Annex B column prefix).
+ * off[nbands] == length. Returns 0/NULL on unknown length. */
+int ac4_sfb_nbands48(int length);
+const int *ac4_sfb_offsets48(int length);
+
+#endif
-- 
2.56.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to