diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libatrac/atrac3data.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libatrac/atrac3data.h')
-rw-r--r-- | lib/rbcodec/codecs/libatrac/atrac3data.h | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libatrac/atrac3data.h b/lib/rbcodec/codecs/libatrac/atrac3data.h new file mode 100644 index 0000000000..30abb37572 --- /dev/null +++ b/lib/rbcodec/codecs/libatrac/atrac3data.h | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * Atrac 3 compatible decoder data | ||
3 | * Copyright (c) 2006-2007 Maxim Poliakovski | ||
4 | * Copyright (c) 2006-2007 Benjamin Larsson | ||
5 | * | ||
6 | * This file is part of FFmpeg. | ||
7 | * | ||
8 | * FFmpeg is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public | ||
10 | * License as published by the Free Software Foundation; either | ||
11 | * version 2.1 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * FFmpeg is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * Lesser General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with FFmpeg; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | /** | ||
24 | * @file libavcodec/atrac3data.h | ||
25 | * Atrac 3 AKA RealAudio 8 compatible decoder data | ||
26 | */ | ||
27 | |||
28 | #ifndef AVCODEC_ATRAC3DATA_H | ||
29 | #define AVCODEC_ATRAC3DATA_H | ||
30 | |||
31 | #include <inttypes.h> | ||
32 | |||
33 | /* VLC tables */ | ||
34 | |||
35 | static const uint8_t huffcode1[9] ICONST_ATTR_LARGE_IRAM = { | ||
36 | 0x0,0x4,0x5,0xC,0xD,0x1C,0x1D,0x1E,0x1F, | ||
37 | }; | ||
38 | |||
39 | static const uint8_t huffbits1[9] ICONST_ATTR_LARGE_IRAM = { | ||
40 | 1,3,3,4,4,5,5,5,5, | ||
41 | }; | ||
42 | |||
43 | static const uint8_t huffcode2[5] ICONST_ATTR_LARGE_IRAM = { | ||
44 | 0x0,0x4,0x5,0x6,0x7, | ||
45 | }; | ||
46 | |||
47 | static const uint8_t huffbits2[5] ICONST_ATTR_LARGE_IRAM = { | ||
48 | 1,3,3,3,3, | ||
49 | }; | ||
50 | |||
51 | static const uint8_t huffcode3[7] ICONST_ATTR_LARGE_IRAM = { | ||
52 | 0x0,0x4,0x5,0xC,0xD,0xE,0xF, | ||
53 | }; | ||
54 | |||
55 | static const uint8_t huffbits3[7] ICONST_ATTR_LARGE_IRAM = { | ||
56 | 1,3,3,4,4,4,4, | ||
57 | }; | ||
58 | |||
59 | static const uint8_t huffcode4[9] ICONST_ATTR_LARGE_IRAM = { | ||
60 | 0x0,0x4,0x5,0xC,0xD,0x1C,0x1D,0x1E,0x1F, | ||
61 | }; | ||
62 | |||
63 | static const uint8_t huffbits4[9] ICONST_ATTR_LARGE_IRAM = { | ||
64 | 1,3,3,4,4,5,5,5,5, | ||
65 | }; | ||
66 | |||
67 | static const uint8_t huffcode5[15] ICONST_ATTR_LARGE_IRAM = { | ||
68 | 0x0,0x2,0x3,0x8,0x9,0xA,0xB,0x1C,0x1D,0x3C,0x3D,0x3E,0x3F,0xC,0xD, | ||
69 | }; | ||
70 | |||
71 | static const uint8_t huffbits5[15] ICONST_ATTR_LARGE_IRAM = { | ||
72 | 2,3,3,4,4,4,4,5,5,6,6,6,6,4,4 | ||
73 | }; | ||
74 | |||
75 | static const uint8_t huffcode6[31] ICONST_ATTR_LARGE_IRAM = { | ||
76 | 0x0,0x2,0x3,0x4,0x5,0x6,0x7,0x14,0x15,0x16,0x17,0x18,0x19,0x34,0x35, | ||
77 | 0x36,0x37,0x38,0x39,0x3A,0x3B,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,0x8,0x9, | ||
78 | }; | ||
79 | |||
80 | static const uint8_t huffbits6[31] ICONST_ATTR_LARGE_IRAM = { | ||
81 | 3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,4,4 | ||
82 | }; | ||
83 | |||
84 | static const uint8_t huffcode7[63] ICONST_ATTR_LARGE_IRAM = { | ||
85 | 0x0,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,0x10,0x11,0x24,0x25,0x26,0x27,0x28, | ||
86 | 0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x68,0x69,0x6A,0x6B,0x6C, | ||
87 | 0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2, | ||
88 | 0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,0x2,0x3, | ||
89 | }; | ||
90 | |||
91 | static const uint8_t huffbits7[63] ICONST_ATTR_LARGE_IRAM = { | ||
92 | 3,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7, | ||
93 | 7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,4,4 | ||
94 | }; | ||
95 | |||
96 | static const uint8_t huff_tab_sizes[7] ICONST_ATTR_LARGE_IRAM = { | ||
97 | 9, 5, 7, 9, 15, 31, 63, | ||
98 | }; | ||
99 | |||
100 | static const uint8_t* const huff_codes[7] ICONST_ATTR_LARGE_IRAM = { | ||
101 | huffcode1,huffcode2,huffcode3,huffcode4,huffcode5,huffcode6,huffcode7, | ||
102 | }; | ||
103 | |||
104 | static const uint8_t* const huff_bits[7] ICONST_ATTR_LARGE_IRAM = { | ||
105 | huffbits1,huffbits2,huffbits3,huffbits4,huffbits5,huffbits6,huffbits7, | ||
106 | }; | ||
107 | |||
108 | static const uint16_t atrac3_vlc_offs[] ICONST_ATTR_LARGE_IRAM = { | ||
109 | 0,512,1024,1536,2048,2560,3072,3584,4096 | ||
110 | }; | ||
111 | |||
112 | /* selector tables */ | ||
113 | |||
114 | static const uint8_t CLCLengthTab[8] ICONST_ATTR_LARGE_IRAM = { | ||
115 | 0, 4, 3, 3, 4, 4, 5, 6}; | ||
116 | static const int8_t seTab_0[4] ICONST_ATTR_LARGE_IRAM = { | ||
117 | 0, 1, -2, -1}; | ||
118 | static const int8_t decTable1[18] ICONST_ATTR_LARGE_IRAM = { | ||
119 | 0,0, 0,1, 0,-1, 1,0, -1,0, 1,1, 1,-1, -1,1, -1,-1}; | ||
120 | |||
121 | |||
122 | /* tables for the scalefactor decoding */ | ||
123 | /* not needed anymore | ||
124 | static const float iMaxQuant[8] = { | ||
125 | 0.0, 1.0/1.5, 1.0/2.5, 1.0/3.5, 1.0/4.5, 1.0/7.5, 1.0/15.5, 1.0/31.5 | ||
126 | }; | ||
127 | */ | ||
128 | static const uint16_t subbandTab[33] ICONST_ATTR_LARGE_IRAM = { | ||
129 | 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, | ||
130 | 256, 288, 320, 352, 384, 416, 448, 480, 512, 576, 640, 704, 768, 896, 1024 | ||
131 | }; | ||
132 | |||
133 | /* transform data */ | ||
134 | /* not needed anymore | ||
135 | static const float qmf_48tap_half[24] = { | ||
136 | -0.00001461907, -0.00009205479, -0.000056157569, 0.00030117269, | ||
137 | 0.0002422519,-0.00085293897, -0.0005205574, 0.0020340169, | ||
138 | 0.00078333891, -0.0042153862, -0.00075614988, 0.0078402944, | ||
139 | -0.000061169922, -0.01344162, 0.0024626821, 0.021736089, | ||
140 | -0.007801671, -0.034090221, 0.01880949, 0.054326009, | ||
141 | -0.043596379, -0.099384367, 0.13207909, 0.46424159 | ||
142 | }; | ||
143 | */ | ||
144 | /* joint stereo related tables */ | ||
145 | /* not needed anymore | ||
146 | static const float matrixCoeffs[8] = {0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0}; | ||
147 | */ | ||
148 | #endif /* AVCODEC_ATRAC3DATA_H */ | ||