comparison filter_templates.h @ 380:44ed8bdeba74

More fixes from Frank.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 03 Jul 2002 04:33:23 +0000
parents 24a610dfbbfd
children b1e511c879d1
comparison
equal deleted inserted replaced
379:7e49f4901ceb 380:44ed8bdeba74
128 128
129 while( inp > to ) 129 while( inp > to )
130 { 130 {
131 out = 0; 131 out = 0;
132 f = filter->c[pos]; 132 f = filter->c[pos];
133 for( i = _fsize + 1; --i; inp+=CH(8), f+=4 ) 133 for( i = _fsize + 1; --i; inp+=CH(4), f+=4 )
134 { 134 {
135 out+= f[0] * (int)inp[CH(0)]; 135 out+= f[0] * (int)inp[CH(0)];
136 out+= f[1] * (int)inp[CH(2)]; 136 out+= f[1] * (int)inp[CH(1)];
137 out+= f[2] * (int)inp[CH(4)]; 137 out+= f[2] * (int)inp[CH(2)];
138 out+= f[3] * (int)inp[CH(6)]; 138 out+= f[3] * (int)inp[CH(3)];
139 } 139 }
140 outp[0] = out >> 16; 140 outp[0] = out >> 16;
141 141
142 pos = ( pos + filter->denominator - 1 ) % filter->denominator; 142 pos = ( pos + filter->ratio.denominator - 1 )
143 inp -= CH( 8 * _fsize ); 143 % filter->ratio.denominator;
144 inp -= CH( 4 * _fsize );
144 inp -= CH( filter->incr[pos] ); 145 inp -= CH( filter->incr[pos] );
145 outp -= CH(1); 146 outp -= CH(1);
146 } 147 }
147 148
148 *cpos = pos; 149 *cpos = pos;
177 outp[0] = out >> 16; 178 outp[0] = out >> 16;
178 179
179 inp -= CH( 4 * _fsize ); 180 inp -= CH( 4 * _fsize );
180 inp += CH( filter->incr[pos] ); 181 inp += CH( filter->incr[pos] );
181 outp += CH(1); 182 outp += CH(1);
182 pos = ( pos + 1 ) % filter->denominator; 183 pos = ( pos + 1 ) % filter->ratio.denominator;
183 } 184 }
184 185
185 *cpos = pos; 186 *cpos = pos;
186 return outp; 187 return outp;
187 } 188 }