comparison mp3lib/decod386.c @ 8543:60fe896e437c

decode_i586.c version uses %ebp for its own use, so: - we need to compile this with -fomit-frame-pointer or we cannot access the function parameters - we need to save & restore %ebp, or we'll destroy the caller's stack ptr
author arpi
date Tue, 24 Dec 2002 00:05:43 +0000
parents 131497b1f6ad
children 1320f1b3229d
comparison
equal deleted inserted replaced
8542:222c0a39c977 8543:60fe896e437c
162 { 162 {
163 static real buffs[2][2][0x110]; 163 static real buffs[2][2][0x110];
164 static const int step = 2; 164 static const int step = 2;
165 static int bo = 1; 165 static int bo = 1;
166 short *samples = (short *) (out + *pnt); 166 short *samples = (short *) (out + *pnt);
167
168 real *b0,(*buf)[0x110]; 167 real *b0,(*buf)[0x110];
169 int clip = 0; 168 int clip = 0;
170 int bo1; 169 int bo1;
170
171 *pnt += 128;
172
171 /* optimized for x86 */ 173 /* optimized for x86 */
172 #if defined(CAN_COMPILE_X86_ASM) 174 #if defined(CAN_COMPILE_X86_ASM)
173 if ( synth_func ) 175 if ( synth_func )
174 { 176 {
175 int ret; 177 // printf("Calling %p, bandPtr=%p channel=%d samples=%p\n",synth_func,bandPtr,channel,samples);
176 ret=(*synth_func)( bandPtr,channel,samples); 178 // FIXME: synth_func() may destroy EBP, don't rely on stack contents!!!
177 *pnt+=128; 179 return (*synth_func)( bandPtr,channel,samples);
178 return ret;
179 } 180 }
180 #endif 181 #endif
181 if(!channel) { /* channel=0 */ 182 if(!channel) { /* channel=0 */
182 bo--; 183 bo--;
183 bo &= 0xf; 184 bo &= 0xf;
262 sum -= window[-0x0] * b0[0xF]; 263 sum -= window[-0x0] * b0[0xF];
263 264
264 WRITE_SAMPLE(samples,sum,clip); 265 WRITE_SAMPLE(samples,sum,clip);
265 } 266 }
266 } 267 }
267 *pnt += 128;
268 268
269 return clip; 269 return clip;
270 270
271 } 271 }
272 272