comparison decoders/mpglib/layer2.c @ 279:52b9f37998db

Removed global state variable; should be thread safe now.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 14 Mar 2002 16:38:59 +0000
parents 9b6e82f7c853
children ad4c8f34136a
comparison
equal deleted inserted replaced
278:dfe4a46f88f7 279:52b9f37998db
245 245
246 fr->alloc = tables[table]; 246 fr->alloc = tables[table];
247 fr->II_sblimit = sblim; 247 fr->II_sblimit = sblim;
248 } 248 }
249 249
250 int do_layer2(struct frame *fr,unsigned char *pcm_sample,int *pcm_point) 250 int do_layer2(struct frame *fr,unsigned char *pcm_sample,int *pcm_point,struct mpstr *mp)
251 { 251 {
252 int clip=0; 252 int clip=0;
253 int i,j; 253 int i,j;
254 int stereo = fr->stereo; 254 int stereo = fr->stereo;
255 real fraction[2][4][SBLIMIT]; /* pick_table clears unused subbands */ 255 real fraction[2][4][SBLIMIT]; /* pick_table clears unused subbands */
269 for (i=0;i<SCALE_BLOCK;i++) 269 for (i=0;i<SCALE_BLOCK;i++)
270 { 270 {
271 II_step_two(bit_alloc,fraction,scale,fr,i>>2); 271 II_step_two(bit_alloc,fraction,scale,fr,i>>2);
272 for (j=0;j<3;j++) { 272 for (j=0;j<3;j++) {
273 if(single >= 0) { 273 if(single >= 0) {
274 clip += synth_1to1_mono(fraction[0][j],pcm_sample,pcm_point); 274 clip += synth_1to1_mono(fraction[0][j],pcm_sample,pcm_point,mp);
275 } 275 }
276 else { 276 else {
277 int p1 = *pcm_point; 277 int p1 = *pcm_point;
278 clip += synth_1to1(fraction[0][j],0,pcm_sample,&p1); 278 clip += synth_1to1(fraction[0][j],0,pcm_sample,&p1,mp);
279 clip += synth_1to1(fraction[1][j],1,pcm_sample,pcm_point); 279 clip += synth_1to1(fraction[1][j],1,pcm_sample,pcm_point,mp);
280 } 280 }
281 281
282 } 282 }
283 } 283 }
284 284