History

Merge commit '2a9c6fae927964b5dd0b5d3d9292f5621bd21664'

* commit '2a9c6fae927964b5dd0b5d3d9292f5621bd21664': dca: Move all tables into dcadata.h Conflicts: libavcodec/dcadec.c

Michael Niedermayer committed 11 years ago

Commit d2223ec2 parents 6c44dd6 2a9c6fa2 files · +89 −89Browse files

Unified · Split

2 files
  1. libavcodec/dcadata.h +89 −0
  2. libavcodec/dcadec.c +0 −89
libavcodec/dcadata.h+89−0
@@ -7663,4 +7663,93 @@ static const float dca_default_coeffs[10][6][2] = { · 7662 unmodified lines
76637663 * where Ch(n) represents the subband samples in the (n)th audio channel.
76647664 */
76657665
7666+static const int8_t dca_lfe_index[] = {
7667+ 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3
7668+};
7669+
7670+static const int8_t dca_channel_reorder_lfe[][9] = {
7671+ { 0, -1, -1, -1, -1, -1, -1, -1, -1 },
7672+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7673+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7674+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7675+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7676+ { 2, 0, 1, -1, -1, -1, -1, -1, -1 },
7677+ { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
7678+ { 2, 0, 1, 4, -1, -1, -1, -1, -1 },
7679+ { 0, 1, 3, 4, -1, -1, -1, -1, -1 },
7680+ { 2, 0, 1, 4, 5, -1, -1, -1, -1 },
7681+ { 3, 4, 0, 1, 5, 6, -1, -1, -1 },
7682+ { 2, 0, 1, 4, 5, 6, -1, -1, -1 },
7683+ { 0, 6, 4, 5, 2, 3, -1, -1, -1 },
7684+ { 4, 2, 5, 0, 1, 6, 7, -1, -1 },
7685+ { 5, 6, 0, 1, 7, 3, 8, 4, -1 },
7686+ { 4, 2, 5, 0, 1, 6, 8, 7, -1 },
7687+};
7688+
7689+static const int8_t dca_channel_reorder_lfe_xch[][9] = {
7690+ { 0, 2, -1, -1, -1, -1, -1, -1, -1 },
7691+ { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
7692+ { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
7693+ { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
7694+ { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
7695+ { 2, 0, 1, 4, -1, -1, -1, -1, -1 },
7696+ { 0, 1, 3, 4, -1, -1, -1, -1, -1 },
7697+ { 2, 0, 1, 4, 5, -1, -1, -1, -1 },
7698+ { 0, 1, 4, 5, 3, -1, -1, -1, -1 },
7699+ { 2, 0, 1, 5, 6, 4, -1, -1, -1 },
7700+ { 3, 4, 0, 1, 6, 7, 5, -1, -1 },
7701+ { 2, 0, 1, 4, 5, 6, 7, -1, -1 },
7702+ { 0, 6, 4, 5, 2, 3, 7, -1, -1 },
7703+ { 4, 2, 5, 0, 1, 7, 8, 6, -1 },
7704+ { 5, 6, 0, 1, 8, 3, 9, 4, 7 },
7705+ { 4, 2, 5, 0, 1, 6, 9, 8, 7 },
7706+};
7707+
7708+static const int8_t dca_channel_reorder_nolfe[][9] = {
7709+ { 0, -1, -1, -1, -1, -1, -1, -1, -1 },
7710+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7711+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7712+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7713+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7714+ { 2, 0, 1, -1, -1, -1, -1, -1, -1 },
7715+ { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
7716+ { 2, 0, 1, 3, -1, -1, -1, -1, -1 },
7717+ { 0, 1, 2, 3, -1, -1, -1, -1, -1 },
7718+ { 2, 0, 1, 3, 4, -1, -1, -1, -1 },
7719+ { 2, 3, 0, 1, 4, 5, -1, -1, -1 },
7720+ { 2, 0, 1, 3, 4, 5, -1, -1, -1 },
7721+ { 0, 5, 3, 4, 1, 2, -1, -1, -1 },
7722+ { 3, 2, 4, 0, 1, 5, 6, -1, -1 },
7723+ { 4, 5, 0, 1, 6, 2, 7, 3, -1 },
7724+ { 3, 2, 4, 0, 1, 5, 7, 6, -1 },
7725+};
7726+
7727+static const int8_t dca_channel_reorder_nolfe_xch[][9] = {
7728+ { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
7729+ { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
7730+ { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
7731+ { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
7732+ { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
7733+ { 2, 0, 1, 3, -1, -1, -1, -1, -1 },
7734+ { 0, 1, 2, 3, -1, -1, -1, -1, -1 },
7735+ { 2, 0, 1, 3, 4, -1, -1, -1, -1 },
7736+ { 0, 1, 3, 4, 2, -1, -1, -1, -1 },
7737+ { 2, 0, 1, 4, 5, 3, -1, -1, -1 },
7738+ { 2, 3, 0, 1, 5, 6, 4, -1, -1 },
7739+ { 2, 0, 1, 3, 4, 5, 6, -1, -1 },
7740+ { 0, 5, 3, 4, 1, 2, 6, -1, -1 },
7741+ { 3, 2, 4, 0, 1, 6, 7, 5, -1 },
7742+ { 4, 5, 0, 1, 7, 2, 8, 3, 6 },
7743+ { 3, 2, 4, 0, 1, 5, 8, 7, 6 },
7744+};
7745+
7746+static const uint16_t dca_vlc_offs[] = {
7747+ 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364,
7748+ 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508,
7749+ 5572, 5604, 5668, 5796, 5860, 5892, 6412, 6668, 6796, 7308, 7564,
7750+ 7820, 8076, 8620, 9132, 9388, 9910, 10166, 10680, 11196, 11726, 12240,
7751+ 12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264,
7752+ 18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622,
7753+};
7754+
76667755 #endif /* AVCODEC_DCADATA_H */
libavcodec/dcadec.c+0−89
@@ -187,86 +187,6 @@ static const uint64_t dca_core_channel_layout[] = { · 186 unmodified lines
187187 AV_CH_SIDE_LEFT | AV_CH_BACK_CENTER | AV_CH_SIDE_RIGHT, ///< 8, CL + C + CR + L + R + SL + S + SR
188188 };
189189
190−static const int8_t dca_lfe_index[] = {
191− 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3
192−};
193−
194−static const int8_t dca_channel_reorder_lfe[][9] = {
195− { 0, -1, -1, -1, -1, -1, -1, -1, -1 },
196− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
197− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
198− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
199− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
200− { 2, 0, 1, -1, -1, -1, -1, -1, -1 },
201− { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
202− { 2, 0, 1, 4, -1, -1, -1, -1, -1 },
203− { 0, 1, 3, 4, -1, -1, -1, -1, -1 },
204− { 2, 0, 1, 4, 5, -1, -1, -1, -1 },
205− { 3, 4, 0, 1, 5, 6, -1, -1, -1 },
206− { 2, 0, 1, 4, 5, 6, -1, -1, -1 },
207− { 0, 6, 4, 5, 2, 3, -1, -1, -1 },
208− { 4, 2, 5, 0, 1, 6, 7, -1, -1 },
209− { 5, 6, 0, 1, 7, 3, 8, 4, -1 },
210− { 4, 2, 5, 0, 1, 6, 8, 7, -1 },
211−};
212−
213−static const int8_t dca_channel_reorder_lfe_xch[][9] = {
214− { 0, 2, -1, -1, -1, -1, -1, -1, -1 },
215− { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
216− { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
217− { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
218− { 0, 1, 3, -1, -1, -1, -1, -1, -1 },
219− { 2, 0, 1, 4, -1, -1, -1, -1, -1 },
220− { 0, 1, 3, 4, -1, -1, -1, -1, -1 },
221− { 2, 0, 1, 4, 5, -1, -1, -1, -1 },
222− { 0, 1, 4, 5, 3, -1, -1, -1, -1 },
223− { 2, 0, 1, 5, 6, 4, -1, -1, -1 },
224− { 3, 4, 0, 1, 6, 7, 5, -1, -1 },
225− { 2, 0, 1, 4, 5, 6, 7, -1, -1 },
226− { 0, 6, 4, 5, 2, 3, 7, -1, -1 },
227− { 4, 2, 5, 0, 1, 7, 8, 6, -1 },
228− { 5, 6, 0, 1, 8, 3, 9, 4, 7 },
229− { 4, 2, 5, 0, 1, 6, 9, 8, 7 },
230−};
231−
232−static const int8_t dca_channel_reorder_nolfe[][9] = {
233− { 0, -1, -1, -1, -1, -1, -1, -1, -1 },
234− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
235− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
236− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
237− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
238− { 2, 0, 1, -1, -1, -1, -1, -1, -1 },
239− { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
240− { 2, 0, 1, 3, -1, -1, -1, -1, -1 },
241− { 0, 1, 2, 3, -1, -1, -1, -1, -1 },
242− { 2, 0, 1, 3, 4, -1, -1, -1, -1 },
243− { 2, 3, 0, 1, 4, 5, -1, -1, -1 },
244− { 2, 0, 1, 3, 4, 5, -1, -1, -1 },
245− { 0, 5, 3, 4, 1, 2, -1, -1, -1 },
246− { 3, 2, 4, 0, 1, 5, 6, -1, -1 },
247− { 4, 5, 0, 1, 6, 2, 7, 3, -1 },
248− { 3, 2, 4, 0, 1, 5, 7, 6, -1 },
249−};
250−
251−static const int8_t dca_channel_reorder_nolfe_xch[][9] = {
252− { 0, 1, -1, -1, -1, -1, -1, -1, -1 },
253− { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
254− { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
255− { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
256− { 0, 1, 2, -1, -1, -1, -1, -1, -1 },
257− { 2, 0, 1, 3, -1, -1, -1, -1, -1 },
258− { 0, 1, 2, 3, -1, -1, -1, -1, -1 },
259− { 2, 0, 1, 3, 4, -1, -1, -1, -1 },
260− { 0, 1, 3, 4, 2, -1, -1, -1, -1 },
261− { 2, 0, 1, 4, 5, 3, -1, -1, -1 },
262− { 2, 3, 0, 1, 5, 6, 4, -1, -1 },
263− { 2, 0, 1, 3, 4, 5, 6, -1, -1 },
264− { 0, 5, 3, 4, 1, 2, 6, -1, -1 },
265− { 3, 2, 4, 0, 1, 6, 7, 5, -1 },
266− { 4, 5, 0, 1, 7, 2, 8, 3, 6 },
267− { 3, 2, 4, 0, 1, 5, 8, 7, 6 },
268−};
269−
270190 #define DCA_DOLBY 101 /* FIXME */
271191
272192 #define DCA_CHANNEL_BITS 6
@@ -300,15 +220,6 @@ static av_always_inline int get_bitalloc(GetBitContext *gb, BitAlloc *ba, · 27 unmodified lines
300220
301221 static float dca_dmix_code(unsigned code);
302222
303−static const uint16_t dca_vlc_offs[] = {
304− 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364,
305− 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508,
306− 5572, 5604, 5668, 5796, 5860, 5892, 6412, 6668, 6796, 7308, 7564,
307− 7820, 8076, 8620, 9132, 9388, 9910, 10166, 10680, 11196, 11726, 12240,
308− 12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264,
309− 18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622,
310−};
311−
312223 static av_cold void dca_init_vlcs(void)
313224 {
314225 static int vlcs_initialized = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t