comparison mp3lib/decod386.c @ 1941:2668fc1b8839

Fix for mp3 decoding on alpha/64bit platforms wupposed by Bob McElrath.
author atmos4
date Sun, 23 Sep 2001 01:44:37 +0000
parents 2052e18abd9d
children 853be3ebe862
comparison
equal deleted inserted replaced
1940:420c8c66c7ba 1941:2668fc1b8839
54 #define MANTISSA_OFFSET 0 54 #define MANTISSA_OFFSET 0
55 #endif 55 #endif
56 56
57 /* sizeof(int) == 4 */ 57 /* sizeof(int) == 4 */
58 #define WRITE_SAMPLE(samples,sum,clip) { \ 58 #define WRITE_SAMPLE(samples,sum,clip) { \
59 double dtemp; long v; \ 59 double dtemp; int v; \
60 dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\ 60 dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
61 v = (((int *)&dtemp)[MANTISSA_OFFSET] - 0x80000000); \ 61 v = (((int *)&dtemp)[MANTISSA_OFFSET] - 0x80000000); \
62 if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \ 62 if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
63 else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \ 63 else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \
64 else { *(samples) = v; } \ 64 else { *(samples) = v; } \
148 #endif 148 #endif
149 149
150 synth_func_t synth_func; 150 synth_func_t synth_func;
151 151
152 #ifdef HAVE_MMX 152 #ifdef HAVE_MMX
153 int synth_1to1_MMX( real *bandPtr,int channel,short * samples) 153 int synth_1to1_MMX( real *bandPtr ,int channel,short * samples)
154 { 154 {
155 static short buffs[2][2][0x110]; 155 real *mybandPtr __attribute__((aligned(16))) = bandPtr;
156 static int bo = 1; 156 short *mysamples __attribute__((aligned(16))) = samples;
157 synth_1to1_MMX_s(bandPtr, channel, samples, (short *) buffs, &bo); 157 static short buffs[2][2][0x110] __attribute__((aligned(16)));
158 static int bo __attribute__((aligned(16))) = 1;
159 synth_1to1_MMX_s(mybandPtr, channel, mysamples, (short *) buffs, &bo);
158 return 0; 160 return 0;
159 } 161 }
160 #endif 162 #endif
161 static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) 163 static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
162 { 164 {