comparison decoders/mpglib/layer1.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
109 *f0++ = 0.0; 109 *f0++ = 0.0;
110 } 110 }
111 } 111 }
112 } 112 }
113 113
114 int do_layer1(struct frame *fr,unsigned char *pcm_sample,int *pcm_point) 114 int do_layer1(struct frame *fr,unsigned char *pcm_sample,int *pcm_point,struct mpstr *mp)
115 { 115 {
116 int clip=0; 116 int clip=0;
117 int i,stereo = fr->stereo; 117 int i,stereo = fr->stereo;
118 unsigned int balloc[2*SBLIMIT]; 118 unsigned int balloc[2*SBLIMIT];
119 unsigned int scale_index[2][SBLIMIT]; 119 unsigned int scale_index[2][SBLIMIT];
130 for (i=0;i<SCALE_BLOCK;i++) 130 for (i=0;i<SCALE_BLOCK;i++)
131 { 131 {
132 I_step_two(fraction,balloc,scale_index,fr); 132 I_step_two(fraction,balloc,scale_index,fr);
133 133
134 if(single >= 0) { 134 if(single >= 0) {
135 clip += synth_1to1_mono( (real*)fraction[single],pcm_sample,pcm_point); 135 clip += synth_1to1_mono( (real*)fraction[single],pcm_sample,pcm_point,mp);
136 } 136 }
137 else { 137 else {
138 int p1 = *pcm_point; 138 int p1 = *pcm_point;
139 clip += synth_1to1( (real*)fraction[0],0,pcm_sample,&p1); 139 clip += synth_1to1( (real*)fraction[0],0,pcm_sample,&p1,mp);
140 clip += synth_1to1( (real*)fraction[1],1,pcm_sample,pcm_point); 140 clip += synth_1to1( (real*)fraction[1],1,pcm_sample,pcm_point,mp);
141 } 141 }
142 } 142 }
143 143
144 return clip; 144 return clip;
145 } 145 }