/*
* Copyright (c) 2010 Ixonos Plc.
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - Initial contribution
*
* Contributors:
* Ixonos Plc
*
* Description:
*
*/
/**************************************************************************
mp3tables.cpp - Tables for layer III.
Author(s): Juha Ojanpera
Modified: Ali Ahmaniemi
Copyright (c) 1999-2004 by Nokia Research Center, Speech and Audio Systems.
*************************************************************************/
#ifndef MP3TABLES_H
#define MP3TABLES_H
/*-- Project Headers. --*/
#include "mpaud.h"
/*
Purpose: Grouping of the scalefactors of long and short blocks.
Explanation: - */
const SFBITS_DATA sfbtable = {{0, 6, 11, 16, 21}, {0, 6, 12} };
/*
Purpose: Number of bits used for the scalefactors.
Explanation: - */
const int16 slen[2][16] = {
{0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4},
{0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}};
/*
Purpose: Number of scalefactor bands for MPEG-2 LSF and MPEG-2.5
bit streams.
Explanation: - */
const uint8 nr_of_sfb_block[6][3][4] = {
{{ 6, 5, 5, 5}, { 9, 9, 9, 9}, { 6, 9, 9, 9}},
{{ 6, 5, 7, 3}, { 9, 9, 12, 6}, { 6, 9, 12, 6}},
{{11, 10, 0, 0}, {18, 18, 0, 0}, {15, 18, 0, 0}},
{{ 7, 7, 7, 0}, {12, 12, 12, 0}, { 6, 15, 12, 0}},
{{ 6, 6, 6, 3}, {12, 9, 9, 6}, { 6, 12, 9, 6}},
{{ 8, 8, 5, 0}, {15, 12, 9, 0}, { 6, 18, 9, 0}}};
/*
Purpose: Length of each Huffman table.
Explanation: - */
const int16 huf_tree_len[] =
{0, 4, 9, 9, 0, 16, 16, 36, 36, 36, 64, 64, 64, 256, 0, 256, 256, 256, 256, 256,
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 16};
/*
Purpose: Number of extra bits for each Huffman table.
Explanation: - */
const int16 linbits[] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 8, 10, 13, 4, 5,
6, 7, 8, 9, 11, 13, 0, 0};
/*
The following tables contain all the necessary information needed for
Huffman decoding of MPEG-1/MPEG-2 Layer III compliant stream.
Tables 'huff_symbolsxx' contain the x and y values and the length of the
corresponding Huffman codewords. The first 5 bits hold the length of the
Huffman codeword. Next 4 bits hold y-value and the remaining bits hold the
x-value. The length is actually the difference between the current and the
previous length.
Tables 'huff_cwordsxx' hold the Huffman codewords. Note these values are
sorted according to their length.
For more information see function 'decode_codeword()'.
*/
/* Table 1 */
const int16 huff_symbols1[] = {1, 513, 33, 544};
const int16 huff_cwords1[] = {1, 1, 1, 0};
/* Table 2 */
const int16 huff_symbols2[] = {1, 34, 512, 544, 578, 1024, 1056, 65, 1088};
const int16 huff_cwords2[] = {1, 2, 3, 1, 1, 3, 2, 1, 0};
/* Table 3 */
const int16 huff_symbols3[] = {2, 32, 544, 513, 578, 1024, 1056, 65, 1088};
const int16 huff_cwords3[] = {3, 2, 1, 1, 1, 3, 2, 1, 0};
/* Table 5 */
const int16 huff_symbols5[] = {1, 34, 512, 544, 67, 576, 1024, 1056, 1568, 97,
608, 1088, 1536, 1600, 1121, 1632};
const int16 huff_cwords5[] = {1, 2, 3, 1, 6, 4, 7, 5, 1, 5, 4, 7, 6, 1, 1, 0};
/* Table 6 */
const int16 huff_symbols6[] = {546, 1, 32, 512, 577, 1024, 1056, 65, 608, 1088,
1568, 1121, 1536, 1600, 97, 1632};
const int16 huff_cwords6[] = {2, 7, 3, 6, 3, 5, 4, 5, 2, 4, 3, 1, 3, 2, 1, 0};
/* Table 7 */
const int16 huff_symbols7[] =
{1, 34, 512, 545, 1057, 65,576, 1024, 609, 640, 1088, 1536, 1568, 2048, 2080,
97, 128, 672, 1120, 1152, 1600, 2112, 2560, 2592, 161, 1184, 1632, 1664, 1696,
2144, 2176, 2624, 2209, 2656, 2688, 2720};
const int16 huff_cwords7[] =
{1, 2, 3, 3, 4, 10, 7, 11, 10, 5, 13, 12, 11, 7, 6, 19, 16, 3, 17, 8, 18, 9, 6,
4, 10, 4, 15, 11, 2, 14, 3, 5, 1, 3, 2, 0};
/* Table 8 */
const int16 huff_symbols8[] =
{2, 544, 33, 512, 577, 1056, 66, 1024, 1088, 2081, 97, 128, 608, 640, 672, 1120,
1152, 1536, 1568, 1600, 2048, 2112, 2592, 161, 1184, 1632, 1664, 2144, 2560,
2624, 2656, 1697, 2176, 2208, 2689, 2720};
const int16 huff_cwords8[] =
{3, 1, 4, 5, 2, 3, 6, 7, 5, 5, 18, 12, 16, 9, 3, 14, 7, 19, 17, 15, 13, 8, 4, 5,
3, 13, 10, 11, 12, 4, 1, 4, 5, 1, 1, 0};
/* Table 9 */
const int16 huff_symbols9[] =
{3, 32, 512, 544, 577, 1024, 1056, 65, 608, 1088, 1568, 97, 640, 1120, 1536,
1600, 2080, 1153, 1632, 1664, 2048, 2112, 2144, 2592, 129, 672, 1184, 1696,
2176, 2560, 2624, 2656, 161, 2208, 2688, 2720};
const int16 huff_cwords9[] =
{7, 5, 6, 4, 5, 7, 6, 9, 5, 8, 6, 14, 6, 8, 15, 9, 7, 8, 10, 5, 11, 9, 6, 4, 15,
7, 5, 1, 4, 14, 6, 2, 7, 1, 6, 0};
/* Table 10 */
const int16 huff_symbols10[] =
{1, 34, 512, 545, 66, 576, 1024, 1056, 609, 1088, 1536, 1568, 97, 640, 704, 736,
1120, 1600, 2048, 2080, 3072, 3104, 3616, 129, 160, 192, 672, 1152, 1216, 1248,
1632, 1728, 2112, 2560, 2592, 3136, 3584, 3648, 225, 1184, 1664, 1696, 1760,
2144, 2176, 2208, 2240, 2272, 2624, 2656, 2752, 3168, 3200, 3232, 3680, 3712,
2689, 2720, 2784, 3264, 3296, 3744, 3776, 3808};
const int16 huff_cwords10[] =
{1, 2, 3, 3, 10, 8, 11, 9, 12, 15, 14, 13, 23, 18, 12, 7, 21, 22, 20, 19, 14,
13, 8, 35, 30, 12, 21, 32, 19, 6, 34, 18, 33, 31, 22, 10, 9, 7, 17, 40, 46, 23,
7, 47, 27, 22, 9, 3, 41, 26, 5, 11, 16, 6, 8, 4, 21, 20, 3, 5, 1, 4, 2, 0};
/* Table 11 */
const int16 huff_symbols11[] =
{2, 33, 512, 544, 577, 65, 1024, 1056, 609, 1088, 1568, 97, 704, 1120, 1536,
1600, 3104, 3136, 3616, 129, 192, 640, 672, 736, 1152, 1216, 1248, 1664, 1728,
2048, 2080, 2112, 2560, 2592, 3072, 3168, 3584, 3648, 161, 224, 1184, 1632,
1760, 2144, 2176, 2240, 2624, 3200, 3680, 1697, 2208, 2272, 2656, 2688, 2752,
3232, 3264, 3296, 3712, 3744, 3776, 3808, 2721, 2784};
const int16 huff_cwords11[] =
{3, 4, 5, 3, 4, 10, 11, 7, 10, 13, 11, 24, 11, 18, 25, 19, 12, 9, 4, 34, 21, 32,
17, 10, 30, 20, 5, 27, 12, 35, 33, 31, 28, 26, 14, 13, 11, 6, 33, 15, 31, 59,
5, 58, 30, 7, 32, 14, 6, 18, 16, 5, 19, 17, 8, 9, 4, 1, 6, 3, 2, 0, 15, 14};
/* Table 12 */
const int16 huff_symbols12[] =
{35, 512, 544, 1, 576, 1056, 65, 608, 1024, 1088, 1568, 1121, 1536, 1600, 1632,
2080, 97, 640, 672, 1152, 1216, 1664, 2048, 2112, 2144, 2592, 3104, 3136, 129,
704, 736, 1184, 1248, 1696, 1728, 1760, 2176, 2208, 2240, 2560, 2624, 2656,
2688, 2752, 3072, 3168, 3200, 3616, 3648, 161, 192, 224, 2272, 2720, 2784,
3232, 3264, 3584, 3680, 3712, 3744, 3776, 3297, 3808};
const int16 huff_cwords12[] =
{6, 7, 5, 9, 6, 7, 16, 9, 17, 11, 10, 14, 17, 15, 12, 13, 33, 23, 16, 21, 10,
18, 32, 22, 19, 17, 12, 11, 41, 26, 11, 30, 7, 28, 14, 5, 18, 16, 9, 40, 31,
29, 17, 4, 27, 15, 10, 12, 8, 39, 38, 26, 5, 13, 2, 7, 4, 27, 12, 6, 3, 1, 1,
0};
/* Table 13 */
const int16 huff_symbols13[] =
{1, 514, 33, 544, 66, 576, 1024, 1056, 97, 608, 1088, 1536, 1568, 2080, 129,
640, 672, 1120, 1600, 2048, 2592, 4128, 161, 192, 256, 704, 736, 768, 800,
1152, 1184, 1280, 1632, 1664, 2112, 2144, 2560, 2624, 3072, 3104, 3616, 4096,
4160, 4640, 225, 288, 832, 864, 1216, 1248, 1312, 1344, 1696, 1728, 1760, 1792,
2176, 2208, 2304, 2656, 2688, 2720, 3136, 3168, 3584, 3648, 4192, 4224, 4608,
4672, 4704, 5120, 5152, 5184, 5664, 5696, 321, 352, 896, 1376, 1408, 1824,
1856, 1888, 1920, 2240, 2272, 2336, 2368, 2752, 2784, 2816, 2848, 2912, 3200,
3232, 3264, 3296, 3328, 3680, 3712, 3744, 4256, 4288, 4736, 4768, 4800, 5216,
5248, 5632, 5728, 6144, 6176, 6208, 6688, 385, 416, 928, 960, 992, 1440, 1952,
2400, 2432, 2880, 3360, 3392, 3424, 3776, 3808, 3840, 3872, 4320, 4352, 4384,
4416, 4864, 5280, 5312, 5376, 5760, 5792, 5824, 5856, 6240, 6272, 6336, 6656,
6720, 7200, 7232, 7680, 7712, 449, 480, 1472, 1504, 1984, 2016, 2464, 2496,
2944, 2976, 3456, 3488, 3904, 3936, 3968, 4448, 4480, 4832, 4896, 4928, 5344,
5408, 5472, 5888, 5920, 5952, 6304, 6368, 6752, 6784, 6816, 7168, 7264, 7296,
7328, 7744, 2529, 3008, 3040, 3520, 3552, 4000, 4512, 4960, 4992, 5024, 5440,
5504, 5984, 6400, 6432, 6848, 6880, 6912, 6944, 6976, 7392, 7424, 7776, 7808,
7840, 7904, 4545, 4576, 5088, 5536, 6016, 6048, 6080, 6464, 6496, 6528, 7008,
7072, 7360, 7488, 7520, 7552, 7872, 7936, 7968, 4033, 4064, 5056, 5568, 6112,
6560, 6592, 6624, 7040, 7104, 7136, 7616, 7648, 8000, 8032, 8160, 5601, 7456,
7584, 8097, 8065, 8128};
const int16 huff_cwords13[] =
{1, 3, 5, 4, 14, 12, 15, 13, 21, 19, 23, 22, 20, 16, 34, 31, 26, 36, 37, 35, 27,
20, 51, 46, 42, 44, 33, 31, 24, 59, 49, 29, 61, 56, 60, 57, 58, 50, 47, 45, 34,
43, 30, 25, 71, 52, 32, 24, 77, 65, 40, 30, 79, 73, 64, 43, 97, 75, 54, 96, 76,
70, 78, 74, 72, 56, 44, 55, 53, 41, 37, 35, 33, 31, 25, 23, 68, 52, 31, 40, 27,
76, 56, 37, 26, 114, 91, 73, 55, 93, 84, 77, 58, 29, 115, 94, 90, 79, 69, 95,
92, 85, 78, 72, 44, 59, 54, 57, 42, 53, 38, 34, 32, 28, 21, 67, 44, 35, 22, 14,
33, 31, 41, 48, 79, 83, 71, 50, 91, 90, 86, 73, 87, 78, 61, 46, 66, 82, 72, 47,
70, 60, 51, 36, 39, 49, 30, 45, 34, 23, 20, 16, 15, 43, 19, 42, 16, 25, 14, 53,
23, 74, 49, 59, 38, 77, 65, 51, 54, 37, 81, 76, 57, 80, 58, 21, 55, 26, 34, 75,
52, 64, 56, 50, 48, 39, 36, 35, 17, 24, 41, 17, 36, 15, 44, 30, 54, 37, 18, 55,
22, 23, 48, 40, 49, 45, 31, 19, 12, 21, 16, 27, 25, 20, 11, 20, 16, 11, 26, 27,
14, 9, 52, 28, 18, 15, 7, 53, 13, 10, 6, 29, 17, 12, 43, 42, 39, 38, 7, 17, 9,
5, 10, 6, 3, 4, 2, 16, 8, 1, 22, 23, 1, 1, 1, 0};
/* Table 15 */
const int16 huff_symbols15[] =
{3, 544, 33, 512, 65, 576, 1024, 1056, 1088, 609, 1120, 1536, 1568, 1600, 2080,
97, 128, 640, 672, 1152, 1184, 1632, 1664, 2048, 2112, 2144, 2592, 2624, 3104,
161, 704, 736, 768, 1216, 1248, 1280, 1696, 1728, 2176, 2208, 2560, 2656, 2688,
2720, 3136, 3168, 3200, 3616, 3648, 4128, 4160, 4640, 193, 224, 256, 800, 832,
1312, 1344, 1760, 1792, 1824, 2240, 2272, 2304, 2336, 2752, 2784, 2816, 2848,
3072, 3232, 3264, 3296, 3328, 3584, 3680, 3712, 3744, 3776, 4096, 4192, 4224,
4256, 4288, 4608, 4672, 4704, 4736, 4768, 5152, 5184, 5216, 5664, 5696, 5728,
6208, 289, 320, 864, 896, 928, 1376, 1408, 1856, 1888, 1920, 2368, 2400, 2432,
2880, 2912, 3360, 3392, 3424, 3808, 3840, 3872, 3904, 3936, 4320, 4352, 4384,
4416, 4800, 4832, 4864, 5120, 5248, 5280, 5312, 5344, 5376, 5632, 5760, 5792,
5824, 5856, 6176, 6240, 6272, 6304, 6688, 6720, 6752, 6784, 353, 384, 416, 960,
992, 1440, 1472, 1504, 1952, 1984, 2016, 2464, 2496, 2528, 2944, 2976, 3008,
3456, 3488, 3968, 4000, 4032, 4448, 4480, 4896, 4928, 4960, 4992, 5408, 5440,
5472, 5504, 5888, 5920, 5952, 5984, 6144, 6336, 6368, 6400, 6432, 6464, 6496,
6656, 6816, 6848, 6880, 6912, 7200, 7232, 7264, 7296, 7328, 7360, 7392, 7712,
7744, 7776, 7808, 7840, 7872, 449, 3040, 3520, 3552, 4064, 4512, 4544, 4576,
5024, 5056, 5088, 5536, 5600, 6016, 6048, 6080, 6528, 6560, 6944, 6976, 7008,
7040, 7072, 7168, 7424, 7456, 7488, 7520, 7616, 7680, 7904, 7936, 7968, 8000,
8032, 481, 5568, 6112, 6592, 6624, 7104, 7136, 7552, 7584, 7648, 8064, 8096,
8128, 8160};
const int16 huff_cwords15[] =
{7, 5, 12, 13, 18, 16, 19, 17, 15, 27, 24, 29, 28, 25, 22, 53, 47, 46, 36, 41,
34, 43, 39, 52, 42, 40, 37, 35, 32, 76, 61, 51, 42, 59, 48, 40, 63, 55, 67, 57,
77, 66, 58, 52, 60, 56, 50, 53, 49, 43, 41, 34, 124, 108, 89, 70, 52, 64, 50,
93, 76, 59, 95, 79, 72, 57, 91, 74, 62, 48, 125, 92, 78, 65, 55, 109, 94, 88,
75, 66, 90, 77, 73, 63, 56, 71, 67, 60, 58, 49, 53, 51, 47, 42, 40, 37, 30,
123, 108, 83, 65, 41, 78, 62, 93, 72, 54, 89, 69, 49, 79, 63, 87, 71, 51, 122,
91, 73, 56, 42, 92, 77, 66, 47, 88, 76, 67, 109, 90, 82, 58, 57, 48, 86, 70,
64, 52, 43, 68, 55, 50, 46, 44, 39, 38, 34, 119, 107, 81, 59, 36, 80, 56, 33,
75, 50, 29, 66, 46, 27, 90, 62, 40, 73, 51, 64, 44, 21, 67, 48, 106, 71, 54,
38, 72, 57, 41, 23, 70, 55, 42, 25, 118, 74, 65, 49, 39, 24, 16, 91, 63, 52,
45, 31, 60, 58, 53, 47, 43, 32, 22, 37, 34, 30, 28, 20, 17, 122, 38, 70, 30,
25, 53, 36, 20, 39, 23, 15, 27, 9, 29, 18, 11, 22, 13, 52, 28, 19, 14, 8, 123,
37, 24, 17, 12, 2, 71, 26, 21, 16, 10, 6, 63, 62, 11, 14, 7, 9, 3, 15, 10, 1,
8, 6, 2, 0};
/* Table 16 */
const int16 huff_symbols16[] =
{1, 514, 33, 544, 66, 576, 1024, 1056, 609, 1088, 1568, 97, 640, 992, 1120,
1536, 1600, 2080, 2592, 7712, 7744, 8160, 129, 160, 480, 672, 704, 736, 1152,
1184, 1504, 1632, 1664, 2048, 2112, 2144, 2528, 2560, 2624, 2656, 3104, 3136,
3616, 7680, 7776, 7808, 193, 224, 768, 800, 832, 1216, 1248, 1312, 1696, 1728,
1760, 2016, 2176, 2208, 2688, 3040, 3072, 3168, 3552, 3584, 3648, 3680, 4064,
4096, 4128, 4160, 4576, 4640, 4672, 5184, 5600, 7840, 7872, 7904, 257, 288,
320, 864, 928, 1280, 1344, 1376, 1408, 1792, 1824, 2240, 2272, 2304, 2720,
2752, 2816, 3200, 3232, 3264, 3296, 3712, 3744, 3776, 4192, 4224, 4256, 4608,
4704, 4736, 5088, 5120, 5152, 5216, 5664, 5696, 5728, 6112, 6624, 7136, 7232,
7648, 7936, 7968, 8000, 8032, 8064, 8096, 8128, 353, 384, 416, 896, 960, 1440,
1472, 1856, 1888, 1920, 2336, 2368, 2400, 2784, 2848, 2880, 3328, 3360, 3392,
3424, 3808, 3840, 4288, 4320, 4768, 4800, 5248, 5280, 5312, 5344, 5632, 5760,
5792, 6144, 6176, 6208, 6240, 6272, 6688, 6720, 6752, 7264, 449, 1952, 1984,
2432, 2464, 2496, 2912, 2944, 2976, 3456, 3488, 3872, 3904, 3936, 3968, 4352,
4384, 4416, 4448, 4832, 4864, 4896, 4928, 4992, 5056, 5376, 5824, 6048, 6304,
6336, 6368, 6400, 6784, 6816, 7168, 7200, 7360, 3009, 3520, 4480, 4512, 4544,
4960, 5024, 5408, 5440, 5472, 5568, 5856, 5888, 5920, 5952, 5984, 6016, 6080,
6464, 6496, 6528, 6560, 6656, 6848, 6880, 6912, 7296, 7328, 7392, 7424, 7616,
4001, 4032, 5504, 5536, 6432, 6976, 7008, 7040, 7104, 7456, 7520, 7584, 6593,
6944, 7488, 7073, 7552};
const int16 huff_cwords16[] =
{1, 3, 5, 4, 14, 12, 15, 13, 20, 23, 21, 44, 35, 9, 38, 45, 39, 36, 30, 10, 7,
3, 74, 63, 17, 62, 53, 47, 67, 58, 16, 69, 64, 75, 68, 65, 9, 66, 59, 56, 54,
52, 48, 12, 11, 10, 110, 93, 83, 75, 68, 103, 90, 72, 114, 99, 87, 26, 115,
101, 102, 16, 111, 100, 10, 98, 91, 88, 8, 85, 84, 81, 7, 76, 73, 67, 4, 17,
11, 9, 172, 149, 138, 119, 107, 161, 127, 117, 110, 158, 140, 179, 164, 155,
185, 173, 142, 184, 178, 160, 133, 165, 157, 148, 159, 156, 143, 154, 141, 131,
11, 139, 129, 125, 120, 118, 115, 6, 4, 2, 102, 0, 13, 12, 10, 7, 5, 3, 1, 242,
225, 195, 201, 207, 209, 206, 252, 212, 199, 264, 246, 226, 265, 253, 232, 257,
244, 228, 217, 261, 248, 260, 249, 256, 245, 247, 233, 229, 219, 243, 227, 223,
202, 224, 222, 218, 216, 211, 210, 208, 187, 376, 387, 365, 395, 382, 362, 400,
388, 378, 385, 366, 407, 397, 372, 380, 427, 401, 392, 383, 426, 406, 394, 384,
359, 352, 393, 396, 223, 389, 386, 381, 364, 370, 379, 377, 369, 358, 445, 715,
727, 713, 708, 735, 710, 743, 737, 720, 439, 746, 742, 736, 721, 712, 706, 436,
443, 707, 440, 437, 747, 734, 723, 714, 726, 722, 711, 709, 434, 889, 884, 885,
882, 888, 883, 877, 876, 865, 866, 871, 870, 1728, 1735, 1734, 3459, 3458};
/* Table 24 */
const int16 huff_symbols24[] =
{4, 32, 512, 544, 8160, 577, 1056, 65, 608, 1024, 1088, 1568, 97, 640, 1120,
1152, 1504, 1536, 1600, 1632, 2016, 2080, 2112, 2528, 2592, 3040, 3552, 7712,
7744, 7776, 7808, 7840, 7872, 7904, 7936, 7968, 8000, 129, 672, 704, 992, 1184,
1216, 1664, 1696, 1728, 2048, 2144, 2176, 2208, 2240, 2624, 2656, 2688, 2720,
3104, 3136, 3168, 3200, 3616, 3648, 3680, 4064, 4576, 5088, 5600, 6112, 6624,
7136, 7648, 7680, 8032, 8064, 8096, 8128, 161, 192, 480, 736, 768, 800, 1248,
1280, 1312, 1344, 1760, 1792, 1824, 1856, 2272, 2304, 2336, 2560, 2752, 2784,
2816, 2848, 3072, 3232, 3264, 3296, 3328, 3712, 3744, 3776, 3808, 4128, 4160,
4192, 4224, 4256, 4288, 4320, 4352, 4640, 4672, 4704, 4736, 4768, 4800, 5152,
5184, 5216, 5248, 5696, 5728, 5760, 225, 256, 832, 864, 896, 928, 960, 1376,
1408, 1440, 1888, 1920, 1952, 1984, 2368, 2400, 2432, 2464, 2880, 2912, 2944,
2976, 3008, 3360, 3392, 3424, 3456, 3488, 3584, 3840, 3872, 3904, 3936, 3968,
4096, 4384, 4416, 4448, 4480, 4608, 4832, 4864, 4896, 4928, 4960, 5280, 5312,
5344, 5376, 5408, 5440, 5664, 5792, 5824, 5856, 5888, 5920, 5952, 6176, 6208,
6240, 6272, 6304, 6336, 6368, 6400, 6432, 6688, 6720, 6752, 6784, 6816, 6848,
6880, 7200, 7232, 7264, 7296, 7328, 7360, 289, 320, 352, 384, 416, 1472, 2496,
3520, 4000, 4032, 4512, 4544, 4992, 5024, 5056, 5120, 5472, 5504, 5536, 5568,
5632, 5984, 6016, 6048, 6080, 6144, 6464, 6496, 6528, 6560, 6592, 6656, 6912,
6944, 6976, 7008, 7040, 7072, 7104, 7392, 7424, 7456, 7488, 7520, 7552, 7584,
7616, 449, 7168};
const int16 huff_cwords24[] =
{15, 13, 14, 12, 3, 21, 22, 46, 38, 47, 41, 39, 80, 71, 74, 68, 18, 81, 75, 70,
16, 72, 69, 14, 66, 12, 10, 20, 19, 17, 15, 13, 11, 9, 7, 6, 4, 146, 130, 122,
42, 128, 120, 134, 125, 116, 147, 135, 127, 118, 112, 129, 126, 119, 114, 123,
121, 117, 113, 115, 111, 109, 17, 16, 11, 10, 6, 4, 2, 0, 43, 7, 5, 3, 1, 262,
248, 88, 216, 209, 198, 221, 207, 194, 182, 220, 204, 190, 178, 210, 200, 188,
263, 214, 202, 192, 180, 249, 215, 206, 195, 185, 211, 203, 196, 187, 212, 208,
205, 201, 193, 186, 177, 169, 199, 197, 191, 189, 181, 174, 184, 183, 179, 175,
171, 168, 164, 434, 426, 327, 345, 319, 297, 279, 340, 315, 295, 325, 311, 293,
271, 352, 323, 306, 285, 341, 317, 301, 281, 262, 347, 330, 308, 291, 272, 435,
353, 332, 313, 298, 283, 427, 320, 303, 286, 268, 335, 333, 321, 305, 289, 275,
344, 331, 314, 304, 290, 277, 346, 318, 309, 299, 287, 276, 263, 322, 316, 312,
307, 302, 292, 284, 269, 261, 300, 296, 294, 288, 282, 273, 266, 280, 278, 274,
267, 264, 259, 669, 653, 649, 621, 517, 541, 540, 520, 531, 381, 514, 377, 521,
379, 371, 668, 530, 383, 373, 366, 652, 513, 375, 368, 362, 648, 512, 376, 370,
364, 359, 620, 515, 380, 374, 369, 365, 361, 357, 382, 378, 372, 367, 363, 360,
358, 356, 1032, 1033};
/* Table 32 */
const int16 huff_symbols32[] =
{1, 35, 64, 128, 256, 97, 192, 288, 320, 384, 161, 224, 352, 416, 448, 480};
const int16 huff_cwords32[] = {1, 5, 4, 6, 7, 5, 4, 3, 6, 7, 5, 4, 0, 2, 3, 1};
/*
Purpose: Pre-emphasis table.
Explanation: - */
const uint8 pretab[22] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0};
/*
Purpose: Scalefactor band boundaries.
Explanation: - */
const SFBAND_DATA sfBandIndex[9] = {{
/* MPEG-2 LSF */
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{0,4,8,12,18,24,32,42,56,74,100,132,174,192}}, /* 22050 Hz */
{
{0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,330,394,464,540,576},
{0,4,8,12,18,26,36,48,62,80,104,136,180,192}}, /* 24000 Hz */
{
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{0,4,8,12,18,26,36,48,62,80,104,134,174,192}}, /* 16000 Hz */
{
/* MPEG-1 */
{0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576},
{0,4,8,12,16,22,30,40,52,66,84,106,136,192}}, /* 44100 Hz */
{
{0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576},
{0,4,8,12,16,22,28,38,50,64,80,100,126,192}}, /* 48000 Hz */
{
{0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
{0,4,8,12,16,22,30,42,58,78,104,138,180,192}}, /* 32000 Hz */
{
/* MPEG-2.5 */
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{0,4,8,12,18,26,36,48,62,80,104,134,174,192}}, /* 11025 Hz */
{
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{0,4,8,12,18,26,36,48,62,80,104,134,174,192}}, /* 12000 Hz */
{
{0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576},
{0,8,16,24,36,52,72,96,124,160,162,164,166,192}}}; /* 8000 Hz */
/* Frame length of each sampling frequency. */
const int32 framelength[6] = {26, 24, 36, 52, 48, 72};
const int32 s_freq[3][4] = { {22050, 24000, 16000, 0}, {44100L, 48000L, 32000, 0},
{11025, 12000, 8000, 0}};
const int16 bitrate[2][15] = {
/* Bit rates for MPEG-2 LSF. */
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160},
/* Bit rates for MPEG-1. */
{ 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320}
};
#endif