annotate mp3lib/decod386.c @ 1090:fd0d77973d08

bugfix
author szabii
date Sun, 10 Jun 2001 23:40:20 +0000
parents 9bc104531aec
children 03b7e2955a20
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * Mpeg Layer-1,2,3 audio decoder
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 * ------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 * copyright (c) 1995,1996,1997 by Michael Hipp, All rights reserved.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 * See also 'README'
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 * slighlty optimized for machines without autoincrement/decrement.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 * The performance is highly compiler dependend. Maybe
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * the decode.c version for 'normal' processor may be faster
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * even for Intel processors.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 /* new WRITE_SAMPLE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 /* sizeof(int) == 4 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 #define WRITE_SAMPLE(samples,sum,clip) { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 double dtemp; long v; \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 v = ((*(int *)&dtemp) - 0x80000000); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 else { *(samples) = v; } \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #define WRITE_SAMPLE(samples,sum,clip) { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 double dtemp; int v; \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 v = ((*(int *)&dtemp) - 0x80000000); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 else { *(samples) = v; } \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 static int synth_1to1_mono(real *bandPtr,unsigned char *samples,int *pnt)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 short samples_tmp[64];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 short *tmp1 = samples_tmp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 int i,ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 int pnt1 = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 ret = synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 samples += *pnt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 for(i=0;i<32;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 *( (short *) samples) = *tmp1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 samples += 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 tmp1 += 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 *pnt += 64;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 static int synth_1to1_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 int i,ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 ret = synth_1to1(bandPtr,0,samples,pnt);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 samples = samples + *pnt - 128;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 for(i=0;i<32;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 ((short *)samples)[1] = ((short *)samples)[0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 samples+=4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74
732
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
75 #ifdef USE_FAKE_MONO
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
76 static int synth_1to1_l(real *bandPtr,int channel,unsigned char *out,int *pnt)
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
77 {
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
78 int i,ret;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
79
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
80 ret = synth_1to1(bandPtr,channel,out,pnt);
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
81 out = out + *pnt - 128;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
82
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
83 for(i=0;i<32;i++) {
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
84 ((short *)out)[1] = ((short *)out)[0];
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
85 out+=4;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
86 }
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
87
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
88 return ret;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
89 }
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
90
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
91
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
92 static int synth_1to1_r(real *bandPtr,int channel,unsigned char *out,int *pnt)
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
93 {
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
94 int i,ret;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
95
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
96 ret = synth_1to1(bandPtr,channel,out,pnt);
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
97 out = out + *pnt - 128;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
98
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
99 for(i=0;i<32;i++) {
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
100 ((short *)out)[0] = ((short *)out)[1];
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
101 out+=4;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
102 }
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
103
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
104 return ret;
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
105 }
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
106 #endif
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
107
e14114170e01 applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents: 1
diff changeset
108
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 static real buffs[2][2][0x110];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 static const int step = 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 static int bo = 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 short *samples = (short *) (out + *pnt);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 real *b0,(*buf)[0x110];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 int clip = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 int bo1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119
787
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
120 #ifdef HAVE_SSE_MP3
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
121 //if ( _3dnow )
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
122 {
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
123 int ret;
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
124 ret=synth_1to1_sse( bandPtr,channel,out+*pnt );
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
125 *pnt+=128;
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
126 return ret;
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
127 }
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
128 #endif
736
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
129 #ifdef HAVE_3DNOWEX
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
130 if ( _3dnow > 1 )
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
131 {
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
132 int ret;
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
133 ret=synth_1to1_3dnowex( bandPtr,channel,out+*pnt );
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
134 *pnt+=128;
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
135 return ret;
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
136 }
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 732
diff changeset
137 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 #ifdef HAVE_3DNOW
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 if ( _3dnow )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 int ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 ret=synth_1to1_3dnow( bandPtr,channel,out+*pnt );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 *pnt+=128;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 if ( _i586 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 int ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 ret=synth_1to1_pent( bandPtr,channel,out+*pnt );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 *pnt+=128;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 if(!channel) { /* channel=0 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 bo--;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 bo &= 0xf;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 buf = buffs[0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 samples++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 buf = buffs[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 if(bo & 0x1) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 b0 = buf[0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 bo1 = bo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 b0 = buf[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 bo1 = bo+1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 dct64(buf[0]+bo,buf[1]+bo+1,bandPtr);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177 register int j;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 real *window = decwin + 16 - bo1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 for (j=16;j;j--,b0+=0x10,window+=0x20,samples+=step)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 real sum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 sum = window[0x0] * b0[0x0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 sum -= window[0x1] * b0[0x1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185 sum += window[0x2] * b0[0x2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 sum -= window[0x3] * b0[0x3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 sum += window[0x4] * b0[0x4];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 sum -= window[0x5] * b0[0x5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 sum += window[0x6] * b0[0x6];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 sum -= window[0x7] * b0[0x7];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 sum += window[0x8] * b0[0x8];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 sum -= window[0x9] * b0[0x9];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 sum += window[0xA] * b0[0xA];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 sum -= window[0xB] * b0[0xB];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 sum += window[0xC] * b0[0xC];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 sum -= window[0xD] * b0[0xD];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 sum += window[0xE] * b0[0xE];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 sum -= window[0xF] * b0[0xF];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200 WRITE_SAMPLE(samples,sum,clip);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204 real sum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 sum = window[0x0] * b0[0x0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 sum += window[0x2] * b0[0x2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 sum += window[0x4] * b0[0x4];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 sum += window[0x6] * b0[0x6];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 sum += window[0x8] * b0[0x8];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 sum += window[0xA] * b0[0xA];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 sum += window[0xC] * b0[0xC];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 sum += window[0xE] * b0[0xE];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 WRITE_SAMPLE(samples,sum,clip);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 b0-=0x10,window-=0x20,samples+=step;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 window += bo1<<1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 for (j=15;j;j--,b0-=0x10,window-=0x20,samples+=step)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 real sum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 sum = -window[-0x1] * b0[0x0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 sum -= window[-0x2] * b0[0x1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 sum -= window[-0x3] * b0[0x2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224 sum -= window[-0x4] * b0[0x3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 sum -= window[-0x5] * b0[0x4];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 sum -= window[-0x6] * b0[0x5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227 sum -= window[-0x7] * b0[0x6];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 sum -= window[-0x8] * b0[0x7];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 sum -= window[-0x9] * b0[0x8];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 sum -= window[-0xA] * b0[0x9];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 sum -= window[-0xB] * b0[0xA];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 sum -= window[-0xC] * b0[0xB];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 sum -= window[-0xD] * b0[0xC];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 sum -= window[-0xE] * b0[0xD];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235 sum -= window[-0xF] * b0[0xE];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 sum -= window[-0x0] * b0[0xF];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 WRITE_SAMPLE(samples,sum,clip);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 *pnt += 128;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 return clip;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246