ReactOS  0.4.14-dev-606-g14ebc0b
layer2.c File Reference
#include "mpg123lib_intern.h"
#include "l2tables.h"
#include "getbits.h"
Include dependency graph for layer2.c:

Go to the source code of this file.

Functions

void init_layer12 (void)
 
void init_layer12_stuff (mpg123_handle *fr, real *(*init_table)(mpg123_handle *fr, real *table, int m))
 
realinit_layer12_table (mpg123_handle *fr, real *table, int m)
 
static void II_step_one (unsigned int *bit_alloc, int *scale, mpg123_handle *fr)
 
static void II_step_two (unsigned int *bit_alloc, real fraction[2][4][SBLIMIT], int *scale, mpg123_handle *fr, int x1)
 
static void II_select_table (mpg123_handle *fr)
 
int do_layer2 (mpg123_handle *fr)
 

Variables

static int grp_3tab [32 *3] = { 0, }
 
static int grp_5tab [128 *3] = { 0, }
 
static int grp_9tab [1024 *3] = { 0, }
 
static const double mulmul [27]
 

Function Documentation

◆ do_layer2()

int do_layer2 ( mpg123_handle fr)

Definition at line 329 of file layer2.c.

330 {
331  int clip=0;
332  int i,j;
333  int stereo = fr->stereo;
334  /* pick_table clears unused subbands */
335  /* replacement for real fraction[2][4][SBLIMIT], needs alignment. */
336  real (*fraction)[4][SBLIMIT] = fr->layer2.fraction;
337  unsigned int bit_alloc[64];
338  int scale[192];
339  int single = fr->single;
340 
341  II_select_table(fr);
342  fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit;
343 
344  if(fr->jsbound > fr->II_sblimit)
345  {
346  fprintf(stderr, "Truncating stereo boundary to sideband limit.\n");
347  fr->jsbound=fr->II_sblimit;
348  }
349 
350  /* TODO: What happens with mono mixing, actually? */
351  if(stereo == 1 || single == SINGLE_MIX) /* also, mix not really handled */
353 
354  II_step_one(bit_alloc, scale, fr);
355 
356  for(i=0;i<SCALE_BLOCK;i++)
357  {
358  II_step_two(bit_alloc,fraction,scale,fr,i>>2);
359  for(j=0;j<3;j++)
360  {
361  if(single != SINGLE_STEREO)
362  clip += (fr->synth_mono)(fraction[single][j], fr);
363  else
364  clip += (fr->synth_stereo)(fraction[0][j], fraction[1][j], fr);
365  }
366  }
367 
368  return clip;
369 }
#define SCALE_BLOCK
#define SINGLE_STEREO
Definition: frame.h:187
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define SBLIMIT
_Tp _STLP_CALL real(const complex< _Tp > &__z)
Definition: _complex.h:727
float single
Definition: msinkaut.idl:29
static void II_step_two(unsigned int *bit_alloc, real fraction[2][4][SBLIMIT], int *scale, mpg123_handle *fr, int x1)
Definition: layer2.c:194
struct mpg123_handle_struct::@3325 layer2
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define SINGLE_LEFT
Definition: frame.h:188
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
func_synth_mono synth_mono
Definition: frame.h:181
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define MPG_MD_JOINT_STEREO
static void II_step_one(unsigned int *bit_alloc, int *scale, mpg123_handle *fr)
Definition: layer2.c:117
static void II_select_table(mpg123_handle *fr)
Definition: layer2.c:296
func_synth_stereo synth_stereo
Definition: frame.h:180
FILE * stderr
#define SINGLE_MIX
Definition: frame.h:190

◆ II_select_table()

static void II_select_table ( mpg123_handle fr)
static

Definition at line 296 of file layer2.c.

297 {
298  const int translate[3][2][16] =
299  {
300  {
301  { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 },
302  { 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 }
303  },
304  {
305  { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 },
306  { 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 }
307  },
308  {
309  { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 },
310  { 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 }
311  }
312  };
313 
314  int table,sblim;
315  const struct al_table *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3 , alloc_4 };
316  const int sblims[5] = { 27 , 30 , 8, 12 , 30 };
317 
318  if(fr->sampling_frequency >= 3) /* Or equivalent: (fr->lsf == 1) */
319  table = 4;
320  else
322 
323  sblim = sblims[table];
324  fr->alloc = tables[table];
325  fr->II_sblimit = sblim;
326 }
static const struct al_table alloc_1[]
Definition: l2tables.h:56
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const struct al_table * alloc
Definition: frame.h:177
static const struct al_table alloc_4[]
Definition: l2tables.h:127
int sampling_frequency
Definition: frame.h:204
Definition: frame.h:32
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:2586
static const struct al_table alloc_0[]
Definition: l2tables.h:16
static const struct al_table alloc_3[]
Definition: l2tables.h:111
static const struct al_table alloc_2[]
Definition: l2tables.h:99
struct nls_table * tables
Definition: nls_base.c:22

Referenced by do_layer2().

◆ II_step_one()

static void II_step_one ( unsigned int bit_alloc,
int scale,
mpg123_handle fr 
)
static

Definition at line 117 of file layer2.c.

118 {
119  int stereo = fr->stereo-1;
120  int sblimit = fr->II_sblimit;
121  int jsbound = fr->jsbound;
122  int sblimit2 = fr->II_sblimit<<stereo;
123  const struct al_table *alloc1 = fr->alloc;
124  int i;
125  unsigned int scfsi_buf[64];
126  unsigned int *scfsi,*bita;
127  int sc,step;
128 
129  bita = bit_alloc;
130  if(stereo)
131  {
132  for(i=jsbound;i;i--,alloc1+=(1<<step))
133  {
134  step=alloc1->bits;
135  *bita++ = (char) getbits(fr, step);
136  *bita++ = (char) getbits(fr, step);
137  }
138  for(i=sblimit-jsbound;i;i--,alloc1+=(1<<step))
139  {
140  step=alloc1->bits;
141  bita[0] = (char) getbits(fr, step);
142  bita[1] = bita[0];
143  bita+=2;
144  }
145  bita = bit_alloc;
146  scfsi=scfsi_buf;
147 
148  for(i=sblimit2;i;i--)
149  if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2);
150  }
151  else /* mono */
152  {
153  for(i=sblimit;i;i--,alloc1+=(1<<step))
154  {
155  step=alloc1->bits;
156  *bita++ = (char) getbits(fr, step);
157  }
158  bita = bit_alloc;
159  scfsi=scfsi_buf;
160  for(i=sblimit;i;i--)
161  if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2);
162  }
163 
164  bita = bit_alloc;
165  scfsi=scfsi_buf;
166  for(i=sblimit2;i;i--)
167  if(*bita++)
168  switch(*scfsi++)
169  {
170  case 0:
171  *scale++ = getbits_fast(fr, 6);
172  *scale++ = getbits_fast(fr, 6);
173  *scale++ = getbits_fast(fr, 6);
174  break;
175  case 1 :
176  *scale++ = sc = getbits_fast(fr, 6);
177  *scale++ = sc;
178  *scale++ = getbits_fast(fr, 6);
179  break;
180  case 2:
181  *scale++ = sc = getbits_fast(fr, 6);
182  *scale++ = sc;
183  *scale++ = sc;
184  break;
185  default: /* case 3 */
186  *scale++ = getbits_fast(fr, 6);
187  *scale++ = sc = getbits_fast(fr, 6);
188  *scale++ = sc;
189  break;
190  }
191 }
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
const struct al_table * alloc
Definition: frame.h:177
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char
Definition: typeof.h:29
Definition: frame.h:32
#define getbits_fast(fr, nob)
Definition: getbits.h:92
#define getbits
Definition: intsym.h:195

Referenced by do_layer2().

◆ II_step_two()

static void II_step_two ( unsigned int bit_alloc,
real  fraction[2][4][SBLIMIT],
int scale,
mpg123_handle fr,
int  x1 
)
static

Definition at line 194 of file layer2.c.

195 {
196  int i,j,k,ba;
197  int stereo = fr->stereo;
198  int sblimit = fr->II_sblimit;
199  int jsbound = fr->jsbound;
200  const struct al_table *alloc2,*alloc1 = fr->alloc;
201  unsigned int *bita=bit_alloc;
202  int d1,step;
203 
204  for(i=0;i<jsbound;i++,alloc1+=(1<<step))
205  {
206  step = alloc1->bits;
207  for(j=0;j<stereo;j++)
208  {
209  if( (ba=*bita++) )
210  {
211  k=(alloc2 = alloc1+ba)->bits;
212  if( (d1=alloc2->d) < 0)
213  {
214  real cm=fr->muls[k][scale[x1]];
215  fraction[j][0][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
216  fraction[j][1][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
217  fraction[j][2][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
218  }
219  else
220  {
221  const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
222  unsigned int idx,*tab,m=scale[x1];
223  idx = (unsigned int) getbits(fr, k);
224  tab = (unsigned int *) (table[d1] + idx + idx + idx);
225  fraction[j][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
226  fraction[j][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
227  fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]);
228  }
229  scale+=3;
230  }
231  else
232  fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0);
233  }
234  }
235 
236  for(i=jsbound;i<sblimit;i++,alloc1+=(1<<step))
237  {
238  step = alloc1->bits;
239  bita++; /* channel 1 and channel 2 bitalloc are the same */
240  if( (ba=*bita++) )
241  {
242  k=(alloc2 = alloc1+ba)->bits;
243  if( (d1=alloc2->d) < 0)
244  {
245  real cm;
246  cm=fr->muls[k][scale[x1+3]];
247  fraction[0][0][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
248  fraction[0][1][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
249  fraction[0][2][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
250  fraction[1][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm);
251  fraction[1][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm);
252  fraction[1][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm);
253  cm=fr->muls[k][scale[x1]];
254  fraction[0][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm);
255  fraction[0][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm);
256  fraction[0][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm);
257  }
258  else
259  {
260  const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
261  unsigned int idx,*tab,m1,m2;
262  m1 = scale[x1]; m2 = scale[x1+3];
263  idx = (unsigned int) getbits(fr, k);
264  tab = (unsigned int *) (table[d1] + idx + idx + idx);
265  fraction[0][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]);
266  fraction[0][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]);
267  fraction[0][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m2]);
268  }
269  scale+=6;
270  }
271  else
272  {
273  fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] =
274  fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = DOUBLE_TO_REAL(0.0);
275  }
276 /*
277  Historic comment...
278  should we use individual scalefac for channel 2 or
279  is the current way the right one , where we just copy channel 1 to
280  channel 2 ??
281  The current 'strange' thing is, that we throw away the scalefac
282  values for the second channel ...!!
283  -> changed .. now we use the scalefac values of channel one !!
284 */
285  }
286 
287  if(sblimit > (fr->down_sample_sblimit) )
288  sblimit = fr->down_sample_sblimit;
289 
290  for(i=sblimit;i<SBLIMIT;i++)
291  for (j=0;j<stereo;j++)
292  fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0);
293 }
#define DOUBLE_TO_REAL(x)
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define SBLIMIT
_Tp _STLP_CALL real(const complex< _Tp > &__z)
Definition: _complex.h:727
static int grp_3tab[32 *3]
Definition: layer2.c:21
const struct al_table * alloc
Definition: frame.h:177
#define REAL_SCALE_LAYER12(x)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
const GLfloat * m
Definition: glext.h:10848
int down_sample_sblimit
Definition: frame.h:193
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int idx
Definition: utils.c:41
Definition: frame.h:32
static int grp_5tab[128 *3]
Definition: layer2.c:22
real muls[27][64]
Definition: frame.h:144
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static int grp_9tab[1024 *3]
Definition: layer2.c:23
short d
Definition: frame.h:35
#define REAL_MUL_SCALE_LAYER12(x, y)
#define DOUBLE_TO_REAL_15(x)
int k
Definition: mpi.c:3369
#define getbits
Definition: intsym.h:195
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by do_layer2().

◆ init_layer12()

void init_layer12 ( void  )

Definition at line 39 of file layer2.c.

40 {
41  const int base[3][9] =
42  {
43  { 1 , 0, 2 , } ,
44  { 17, 18, 0 , 19, 20 , } ,
45  { 21, 1, 22, 23, 0, 24, 25, 2, 26 }
46  };
47  int i,j,k,l,len;
48  const int tablen[3] = { 3 , 5 , 9 };
49  int *itable;
50  int *tables[3] = { grp_3tab , grp_5tab , grp_9tab };
51 
52  for(i=0;i<3;i++)
53  {
54  itable = tables[i];
55  len = tablen[i];
56  for(j=0;j<len;j++)
57  for(k=0;k<len;k++)
58  for(l=0;l<len;l++)
59  {
60  *itable++ = base[i][l];
61  *itable++ = base[i][k];
62  *itable++ = base[i][j];
63  }
64  }
65 }
static int grp_3tab[32 *3]
Definition: layer2.c:21
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int grp_5tab[128 *3]
Definition: layer2.c:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
r l[0]
Definition: byte_order.h:167
static int grp_9tab[1024 *3]
Definition: layer2.c:23
GLenum GLsizei len
Definition: glext.h:6722
struct nls_table * tables
Definition: nls_base.c:22
int k
Definition: mpi.c:3369

◆ init_layer12_stuff()

void init_layer12_stuff ( mpg123_handle fr,
real *(*)(mpg123_handle *fr, real *table, int m init_table 
)

Definition at line 67 of file layer2.c.

68 {
69  int k;
70  real *table;
71  for(k=0;k<27;k++)
72  {
73  table = init_table(fr, fr->muls[k], k);
74  *table++ = 0.0;
75  }
76 }
_Tp _STLP_CALL real(const complex< _Tp > &__z)
Definition: _complex.h:727
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
real muls[27][64]
Definition: frame.h:144
int k
Definition: mpi.c:3369

◆ init_layer12_table()

real* init_layer12_table ( mpg123_handle fr,
real table,
int  m 
)

Definition at line 78 of file layer2.c.

79 {
80 #if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
81  int i;
82  for(i=0;i<63;i++)
83  *table++ = layer12_table[m][i];
84 #else
85  int i,j;
86  for(j=3,i=0;i<63;i++,j--)
87  *table++ = DOUBLE_TO_REAL_SCALE_LAYER12(mulmul[m] * pow(2.0,(double) j / 3.0));
88 #endif
89 
90  return table;
91 }
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
float pow(float __x, int __y)
Definition: _cmath.h:458
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static const double mulmul[27]
Definition: layer2.c:28
#define DOUBLE_TO_REAL_SCALE_LAYER12(x)
static const real layer12_table[27][64]

Variable Documentation

◆ grp_3tab

int grp_3tab[32 *3] = { 0, }
static

Definition at line 21 of file layer2.c.

Referenced by II_step_two(), and init_layer12().

◆ grp_5tab

int grp_5tab[128 *3] = { 0, }
static

Definition at line 22 of file layer2.c.

Referenced by II_step_two(), and init_layer12().

◆ grp_9tab

int grp_9tab[1024 *3] = { 0, }
static

Definition at line 23 of file layer2.c.

Referenced by II_step_two(), and init_layer12().

◆ mulmul

const double mulmul[27]
static
Initial value:
=
{
0.0 , -2.0/3.0 , 2.0/3.0 ,
2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 ,
2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 ,
2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 ,
-4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 ,
-8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0
}

Definition at line 28 of file layer2.c.

Referenced by init_layer12_table().