From patchwork Fri Nov 20 07:33:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23906 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 757A944AB03 for ; Fri, 20 Nov 2020 09:54:33 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 75D0668BDC9; Fri, 20 Nov 2020 09:35:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D54C68BCED for ; Fri, 20 Nov 2020 09:35:00 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id k4so8529656edl.0 for ; Thu, 19 Nov 2020 23:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=OuxYqJ/QBmqOWcNwpkg2vXDoqXk/nBiqfzEMbI36hq4=; b=bG0PpU2vLMGf9VCkLS5YRKPLH9PTgwNVk3QhKfXTBaSfY7cdCl2GrZNiolK813zu21 fai6GQACnERu+7d3SG5rwUe0rMtqNIH+OOidSUkb9z1xB/9R5KJH8axpJQxSv4qS9b8/ uPPEvlAv2IpeY0ZkQPZoffYEl0c0tkdCecZyei3eQsXtweW1MBiXAcOQYs4n1GKxK2M0 8XVjam6WC8rf2EwRUR6kCULtoY1flY6GpwHDtBoTeKAXTpS7xyKp3vjWD16jYFugPNn9 BOKrNfRO0t7iThKcUKlA5GnO/In9cpojB5T8c2ZArL845XkZ1jgmP/XKQfXCoKSJOUg6 4t6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=OuxYqJ/QBmqOWcNwpkg2vXDoqXk/nBiqfzEMbI36hq4=; b=VMZFYigVPm1vEUL3MRxn7WRJ4mO6JASufBijO6vQVXTJ2mAM+8J34piH6441s5PUEz wCnUc9BJW+FG4dyI2XjaxAJrYlHqMwikD+ES5nFz/E8J+sTHNM5rsA2MAb1mZNGJLUY+ bIXIQ5bYDlen6f5lH+eS1Z3Mai2NYvUPefkdtaxsmLYCSJnhppl+Chv2vO/OQseF82wL +30ZwEgyynpzzvx9SC6PdGpJZupcDAGXMS6MsXt+V0NjANqntrkeKq42RohjJS6XntnK dDqPv8C4mG63VcVXyyPd/I70SYZVC3KOoE0rOp1sVZvYwuwFqFKLw9+wQLt8+FoAEV8U ieYw== X-Gm-Message-State: AOAM5303me14CKRog6oxAPyxvrAxU39RvbJv9xOwBl8U//VpPoQDFs2I FvAuCxV0iQR+W9z+Gs5w/XxNY48elMRiiQ== X-Google-Smtp-Source: ABdhPJwQfoQWx48k7r1bQ+WRB2yzj1UJsaD5u7q0prixy3/KD5/thcq95rX7Tc0K/87VaFjl3krwxQ== X-Received: by 2002:aa7:d2c4:: with SMTP id k4mr15646495edr.367.1605857699866; Thu, 19 Nov 2020 23:34:59 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:59 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:20 +0100 Message-Id: <20201120073327.820745-56-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> References: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 155/162] avcodec/mpegaudiodec: Combine tables used to initialize VLCs X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Up until now, there were several indiviual tables which were accessed via pointers to them; by combining the tables, one can avoid said pointers, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudiodec_template.c | 15 +-- libavcodec/mpegaudiodectab.h | 144 +++++++---------------------- 2 files changed, 44 insertions(+), 115 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index edd69684da..b03f7cfc33 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -257,6 +257,7 @@ static inline int l3_unscale(int value, int exponent) static av_cold void decode_init_static(void) { + const uint8_t *huff_sym = mpa_huffsymbols, *huff_lens = mpa_hufflens; int i, j, k; int offset; @@ -287,12 +288,12 @@ static av_cold void decode_init_static(void) /* huffman decode tables */ offset = 0; for (int i = 0; i < 15;) { - const HuffTable *h = &mpa_huff_tables[i]; uint16_t tmp_symbols[256]; - int nb_codes = h->nb_codes; + int nb_codes_minus_one = mpa_huff_sizes_minus_one[i]; + int j; - for (int j = 0; j < nb_codes; j++) { - uint8_t high = h->symbols[j] & 0xF0, low = h->symbols[j] & 0xF; + for (j = 0; j <= nb_codes_minus_one; j++) { + uint8_t high = huff_sym[j] & 0xF0, low = huff_sym[j] & 0xF; tmp_symbols[j] = high << 1 | ((high && low) << 4) | low; } @@ -300,10 +301,12 @@ static av_cold void decode_init_static(void) /* XXX: fail test */ huff_vlc[++i].table = huff_vlc_tables + offset; huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - ff_init_vlc_from_lengths(&huff_vlc[i], 7, nb_codes, - h->bits, 1, tmp_symbols, 2, 2, + ff_init_vlc_from_lengths(&huff_vlc[i], 7, j, + huff_lens, 1, tmp_symbols, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); offset += huff_vlc[i].table_size; + huff_lens += j; + huff_sym += j; } av_assert0(offset == FF_ARRAY_ELEMS(huff_vlc_tables)); diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodectab.h index 8d2b8af150..f895ad8eaa 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodectab.h @@ -35,13 +35,6 @@ /*******************************************************/ /* layer 3 tables */ -/* layer 3 huffman tables */ -typedef struct HuffTable { - int nb_codes; - const uint8_t *bits; - const uint8_t *symbols; -} HuffTable; - /* layer3 scale factor size */ static const uint8_t slen_table[2][16] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, @@ -59,63 +52,42 @@ static const uint8_t lsf_nsf_table[6][3][4] = { }; /* mpegaudio layer 3 huffman tables */ -static const uint8_t mpa_huffbits_1[4] = { +static const uint8_t mpa_hufflens[] = { + /* Huffman table 1 - 4 entries */ 3, 3, 2, 1, -}; - -static const uint8_t mpa_huffbits_2[9] = { + /* Huffman table 2 - 9 entries */ 6, 6, 5, 5, 5, 3, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_3[9] = { + /* Huffman table 3 - 9 entries */ 6, 6, 5, 5, 5, 3, 2, 2, 2, -}; - -static const uint8_t mpa_huffbits_5[16] = { + /* Huffman table 5 - 16 entries */ 8, 8, 7, 6, 7, 7, 7, 7, 6, 6, 6, 6, 3, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_6[16] = { + /* Huffman table 6 - 16 entries */ 7, 7, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 3, 2, 3, 3, -}; - -static const uint8_t mpa_huffbits_7[36] = { + /* Huffman table 7 - 36 entries */ 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 9, 9, 8, 9, 9, 8, 8, 7, 7, 7, 8, 8, 8, 8, 7, 7, 7, 7, 6, 5, 6, 6, 4, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_8[36] = { + /* Huffman table 8 - 36 entries */ 11, 11, 10, 9, 10, 10, 9, 9, 9, 8, 8, 9, 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 4, 4, 2, 3, 3, 2, -}; - -static const uint8_t mpa_huffbits_9[36] = { + /* Huffman table 9 - 36 entries */ 9, 9, 8, 8, 9, 9, 8, 8, 8, 8, 7, 7, 7, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, -}; - -static const uint8_t mpa_huffbits_10[64] = { + /* Huffman table 10 - 64 entries */ 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 11, 11, 10, 9, 9, 10, 10, 9, 9, 10, 10, 9, 10, 10, 8, 8, 9, 9, 10, 10, 9, 9, 10, 10, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 4, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_11[64] = { + /* Huffman table 11 - 64 entries */ 10, 10, 10, 10, 10, 10, 10, 11, 11, 10, 10, 9, 9, 9, 10, 10, 10, 10, 8, 8, 9, 9, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 7, 8, 8, 7, 7, 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 7, 7, 6, 5, 4, 5, 5, 3, 3, 3, 2, -}; - -static const uint8_t mpa_huffbits_12[64] = { + /* Huffman table 12 - 64 entries */ 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, 9, 9, 7, 7, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 8, 8, 7, 7, 7, 6, 6, 6, 6, 7, 7, 6, 5, 5, 5, 4, 4, 5, 5, 4, 3, 3, 3, -}; - -static const uint8_t mpa_huffbits_13[256] = { + /* Huffman table 13 - 256 entries */ 19, 19, 18, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 15, 15, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 15, 16, 16, 14, 14, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 14, 13, 14, @@ -130,9 +102,7 @@ static const uint8_t mpa_huffbits_13[256] = { 10, 10, 10, 10, 10, 10, 10, 10, 8, 9, 9, 9, 9, 9, 9, 10, 10, 9, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 8, 7, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 4, 4, 3, 1, -}; - -static const uint8_t mpa_huffbits_15[256] = { + /* Huffman table 15 - 256 entries */ 13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 11, 11, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 11, @@ -147,9 +117,7 @@ static const uint8_t mpa_huffbits_15[256] = { 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 9, 8, 7, 8, 8, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 6, 6, 5, 5, 5, 5, 5, 3, 4, 4, 3, -}; - -static const uint8_t mpa_huffbits_16[256] = { + /* Huffman table 16 - 256 entries */ 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 10, 10, 10, 10, 10, 8, 10, 10, 9, 9, 9, 9, 10, 16, 17, 17, 15, 15, 16, 16, 14, 15, 15, 14, 14, 15, 15, 14, 14, 15, 15, 15, 15, 14, 15, 15, 14, 13, 8, 9, 9, 8, 8, 13, @@ -164,9 +132,7 @@ static const uint8_t mpa_huffbits_16[256] = { 10, 9, 9, 10, 10, 10, 10, 10, 10, 9, 9, 9, 10, 10, 9, 10, 10, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 9, 9, 8, 8, 7, 7, 8, 8, 7, 6, 6, 6, 6, 4, 4, 3, 1, -}; - -static const uint8_t mpa_huffbits_24[256] = { + /* Huffman table 24 - 256 entries */ 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 7, 7, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -183,74 +149,53 @@ static const uint8_t mpa_huffbits_24[256] = { 6, 5, 5, 6, 6, 4, 4, 4, 4, }; -static const uint8_t mpa_huffsyms_1[4] = { +static const uint8_t mpa_huffsymbols[] = { + /* Huffman table 1 - 4 entries */ 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_2[9] = { + /* Huffman table 2 - 9 entries */ 0x22, 0x02, 0x12, 0x21, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_3[9] = { + /* Huffman table 3 - 9 entries */ 0x22, 0x02, 0x12, 0x21, 0x20, 0x10, 0x11, 0x01, 0x00, -}; - -static const uint8_t mpa_huffsyms_5[16] = { + /* Huffman table 5 - 16 entries */ 0x33, 0x23, 0x32, 0x31, 0x13, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_6[16] = { + /* Huffman table 6 - 16 entries */ 0x33, 0x03, 0x23, 0x32, 0x30, 0x13, 0x31, 0x22, 0x02, 0x12, 0x21, 0x20, 0x01, 0x11, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_7[36] = { + /* Huffman table 7 - 36 entries */ 0x55, 0x45, 0x54, 0x53, 0x35, 0x44, 0x25, 0x52, 0x15, 0x51, 0x05, 0x34, 0x50, 0x43, 0x33, 0x24, 0x42, 0x14, 0x41, 0x40, 0x04, 0x23, 0x32, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_8[36] = { + /* Huffman table 8 - 36 entries */ 0x55, 0x54, 0x45, 0x53, 0x35, 0x44, 0x25, 0x52, 0x05, 0x15, 0x51, 0x34, 0x43, 0x50, 0x33, 0x24, 0x42, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x02, 0x20, 0x12, 0x21, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_9[36] = { + /* Huffman table 9 - 36 entries */ 0x55, 0x45, 0x35, 0x53, 0x54, 0x05, 0x44, 0x25, 0x52, 0x15, 0x51, 0x34, 0x43, 0x50, 0x04, 0x24, 0x42, 0x33, 0x40, 0x14, 0x41, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x02, 0x12, 0x21, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_10[64] = { + /* Huffman table 10 - 64 entries */ 0x77, 0x67, 0x76, 0x57, 0x75, 0x66, 0x47, 0x74, 0x56, 0x65, 0x37, 0x73, 0x46, 0x55, 0x54, 0x63, 0x27, 0x72, 0x64, 0x07, 0x70, 0x62, 0x45, 0x35, 0x06, 0x53, 0x44, 0x17, 0x71, 0x36, 0x26, 0x25, 0x52, 0x15, 0x51, 0x34, 0x43, 0x16, 0x61, 0x60, 0x05, 0x50, 0x24, 0x42, 0x33, 0x04, 0x14, 0x41, 0x40, 0x23, 0x32, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_11[64] = { + /* Huffman table 11 - 64 entries */ 0x77, 0x67, 0x76, 0x75, 0x66, 0x47, 0x74, 0x57, 0x55, 0x56, 0x65, 0x37, 0x73, 0x46, 0x45, 0x54, 0x35, 0x53, 0x27, 0x72, 0x64, 0x07, 0x71, 0x17, 0x70, 0x36, 0x63, 0x60, 0x44, 0x25, 0x52, 0x05, 0x15, 0x62, 0x26, 0x06, 0x16, 0x61, 0x51, 0x34, 0x50, 0x43, 0x33, 0x24, 0x42, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x21, 0x12, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_12[64] = { + /* Huffman table 12 - 64 entries */ 0x77, 0x67, 0x76, 0x57, 0x75, 0x66, 0x47, 0x74, 0x65, 0x56, 0x37, 0x73, 0x55, 0x27, 0x72, 0x46, 0x64, 0x17, 0x71, 0x07, 0x70, 0x36, 0x63, 0x45, 0x54, 0x44, 0x06, 0x05, 0x26, 0x62, 0x61, 0x16, 0x60, 0x35, 0x53, 0x25, 0x52, 0x15, 0x51, 0x34, 0x43, 0x50, 0x04, 0x24, 0x42, 0x14, 0x33, 0x41, 0x23, 0x32, 0x40, 0x03, 0x30, 0x13, 0x31, 0x22, 0x12, 0x21, 0x02, 0x20, 0x00, 0x11, 0x01, 0x10, -}; - -static const uint8_t mpa_huffsyms_13[256] = { + /* Huffman table 13 - 256 entries */ 0xFE, 0xFC, 0xFD, 0xED, 0xFF, 0xEF, 0xDF, 0xEE, 0xCF, 0xDE, 0xBF, 0xFB, 0xCE, 0xDC, 0xAF, 0xE9, 0xEC, 0xDD, 0xFA, 0xCD, 0xBE, 0xEB, 0x9F, 0xF9, 0xEA, 0xBD, 0xDB, 0x8F, 0xF8, 0xCC, 0xAE, 0x9E, 0x8E, 0x7F, 0x7E, 0xF7, @@ -273,9 +218,7 @@ static const uint8_t mpa_huffsyms_13[256] = { 0x05, 0x15, 0x51, 0x34, 0x43, 0x50, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_15[256] = { + /* Huffman table 15 - 256 entries */ 0xFF, 0xEF, 0xFE, 0xDF, 0xEE, 0xFD, 0xCF, 0xFC, 0xDE, 0xED, 0xBF, 0xFB, 0xCE, 0xEC, 0xDD, 0xAF, 0xFA, 0xBE, 0xEB, 0xCD, 0xDC, 0x9F, 0xF9, 0xEA, 0xBD, 0xDB, 0x8F, 0xF8, 0xCC, 0x9E, 0xE9, 0x7F, 0xF7, 0xAD, 0xDA, 0xBC, @@ -298,9 +241,7 @@ static const uint8_t mpa_huffsyms_15[256] = { 0x15, 0x51, 0x05, 0x50, 0x34, 0x43, 0x24, 0x42, 0x33, 0x41, 0x14, 0x04, 0x23, 0x32, 0x40, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_16[256] = { + /* Huffman table 16 - 256 entries */ 0xEF, 0xFE, 0xDF, 0xFD, 0xCF, 0xFC, 0xBF, 0xFB, 0xAF, 0xFA, 0x9F, 0xF9, 0xF8, 0x8F, 0x7F, 0xF7, 0x6F, 0xF6, 0xFF, 0x5F, 0xF5, 0x4F, 0xF4, 0xF3, 0xF0, 0x3F, 0xCE, 0xEC, 0xDD, 0xDE, 0xE9, 0xEA, 0xD9, 0xEE, 0xED, 0xEB, @@ -323,9 +264,7 @@ static const uint8_t mpa_huffsyms_16[256] = { 0x51, 0x15, 0x05, 0x34, 0x43, 0x50, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_24[256] = { + /* Huffman table 24 - 256 entries */ 0xEF, 0xFE, 0xDF, 0xFD, 0xCF, 0xFC, 0xBF, 0xFB, 0xFA, 0xAF, 0x9F, 0xF9, 0xF8, 0x8F, 0x7F, 0xF7, 0x6F, 0xF6, 0x5F, 0xF5, 0x4F, 0xF4, 0x3F, 0xF3, 0x2F, 0xF2, 0xF1, 0x1F, 0xF0, 0x0F, 0xEE, 0xDE, 0xED, 0xCE, 0xEC, 0xDD, @@ -350,22 +289,9 @@ static const uint8_t mpa_huffsyms_24[256] = { 0x11, 0x01, 0x10, 0x00, }; -static const HuffTable mpa_huff_tables[] = { - { 4, mpa_huffbits_1, mpa_huffsyms_1 }, - { 9, mpa_huffbits_2, mpa_huffsyms_2 }, - { 9, mpa_huffbits_3, mpa_huffsyms_3 }, - { 16, mpa_huffbits_5, mpa_huffsyms_5 }, - { 16, mpa_huffbits_6, mpa_huffsyms_6 }, - { 36, mpa_huffbits_7, mpa_huffsyms_7 }, - { 36, mpa_huffbits_8, mpa_huffsyms_8 }, - { 36, mpa_huffbits_9, mpa_huffsyms_9 }, - { 64, mpa_huffbits_10, mpa_huffsyms_10 }, - { 64, mpa_huffbits_11, mpa_huffsyms_11 }, - { 64, mpa_huffbits_12, mpa_huffsyms_12 }, - { 256, mpa_huffbits_13, mpa_huffsyms_13 }, - { 256, mpa_huffbits_15, mpa_huffsyms_15 }, - { 256, mpa_huffbits_16, mpa_huffsyms_16 }, - { 256, mpa_huffbits_24, mpa_huffsyms_24 }, +static const uint8_t mpa_huff_sizes_minus_one[] = +{ + 3, 8, 8, 15, 15, 35, 35, 35, 63, 63, 63, 255, 255, 255, 255 }; static const uint8_t mpa_huff_data[32][2] = {