Rev 1905 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1905 | Rev 3960 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | layer2.c: the layer 2 decoder, root of mpg123 |
2 | layer2.c: the layer 2 decoder, root of mpg123 |
Line 3... | Line 3... | ||
3 | 3 | ||
4 | copyright 1994-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 |
4 | copyright 1994-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 |
5 | see COPYING and AUTHORS files in distribution or http://mpg123.org |
5 | see COPYING and AUTHORS files in distribution or http://mpg123.org |
Line 6... | Line 6... | ||
6 | initially written by Michael Hipp |
6 | initially written by Michael Hipp |
7 | 7 | ||
Line 112... | Line 112... | ||
112 | 112 | ||
Line 113... | Line 113... | ||
113 | /* The rest is the actual decoding of layer II data. */ |
113 | /* The rest is the actual decoding of layer II data. */ |
Line 114... | Line 114... | ||
114 | 114 | ||
115 | #ifndef NO_LAYER2 |
115 | #ifndef NO_LAYER2 |
116 | 116 | ||
117 | void II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr) |
117 | static void II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr) |
118 | { |
118 | { |
119 | int stereo = fr->stereo-1; |
119 | int stereo = fr->stereo-1; |
Line 189... | Line 189... | ||
189 | break; |
189 | break; |
190 | } |
190 | } |
191 | } |
191 | } |
Line 192... | Line 192... | ||
192 | 192 | ||
193 | 193 | ||
194 | void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,mpg123_handle *fr,int x1) |
194 | static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,mpg123_handle *fr,int x1) |
195 | { |
195 | { |
196 | int i,j,k,ba; |
196 | int i,j,k,ba; |
197 | int stereo = fr->stereo; |
197 | int stereo = fr->stereo; |
Line 329... | Line 329... | ||
329 | int do_layer2(mpg123_handle *fr) |
329 | int do_layer2(mpg123_handle *fr) |
330 | { |
330 | { |
331 | int clip=0; |
331 | int clip=0; |
332 | int i,j; |
332 | int i,j; |
333 | int stereo = fr->stereo; |
333 | int stereo = fr->stereo; |
- | 334 | /* pick_table clears unused subbands */ |
|
334 | ALIGNED(16) real fraction[2][4][SBLIMIT]; /* pick_table clears unused subbands */ |
335 | /* replacement for real fraction[2][4][SBLIMIT], needs alignment. */ |
- | 336 | real (*fraction)[4][SBLIMIT] = fr->layer2.fraction; |
|
335 | unsigned int bit_alloc[64]; |
337 | unsigned int bit_alloc[64]; |
336 | int scale[192]; |
338 | int scale[192]; |
337 | int single = fr->single; |
339 | int single = fr->single; |
Line 338... | Line 340... | ||
338 | 340 | ||
339 | II_select_table(fr); |
341 | II_select_table(fr); |
Line 340... | Line 342... | ||
340 | fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit; |
342 | fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit; |
341 | 343 | ||
342 | if(fr->jsbound > fr->II_sblimit) |
344 | if(fr->jsbound > fr->II_sblimit) |
343 | { |
345 | { |
344 | // fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); |
346 | fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); |
Line 345... | Line 347... | ||
345 | fr->jsbound=fr->II_sblimit; |
347 | fr->jsbound=fr->II_sblimit; |
346 | } |
348 | } |