Mercurial > libavcodec.hg
comparison ra144.c @ 7516:11fe8c09948e libavcodec
Cosmetics: rename loop counters in eval_refl()
author | vitor |
---|---|
date | Wed, 06 Aug 2008 21:19:30 +0000 |
parents | 1d5800cec7ad |
children | a84494aa3818 |
comparison
equal
deleted
inserted
replaced
7515:1d5800cec7ad | 7516:11fe8c09948e |
---|---|
224 * @return 1 if one of the reflection coefficients is of magnitude greater than | 224 * @return 1 if one of the reflection coefficients is of magnitude greater than |
225 * 4095, 0 if not. | 225 * 4095, 0 if not. |
226 */ | 226 */ |
227 static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx) | 227 static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx) |
228 { | 228 { |
229 int b, c, i; | 229 int b, i, j; |
230 unsigned int u; | |
231 int buffer1[10]; | 230 int buffer1[10]; |
232 int buffer2[10]; | 231 int buffer2[10]; |
233 int *bp1 = buffer1; | 232 int *bp1 = buffer1; |
234 int *bp2 = buffer2; | 233 int *bp2 = buffer2; |
235 | 234 |
241 if ((unsigned) bp2[9] + 0x1000 > 0x1fff) { | 240 if ((unsigned) bp2[9] + 0x1000 > 0x1fff) { |
242 av_log(ractx, AV_LOG_ERROR, "Overflow. Broken sample?\n"); | 241 av_log(ractx, AV_LOG_ERROR, "Overflow. Broken sample?\n"); |
243 return 1; | 242 return 1; |
244 } | 243 } |
245 | 244 |
246 for (c=8; c >= 0; c--) { | 245 for (i=8; i >= 0; i--) { |
247 b = 0x1000-((bp2[c+1] * bp2[c+1]) >> 12); | 246 b = 0x1000-((bp2[i+1] * bp2[i+1]) >> 12); |
248 | 247 |
249 if (!b) | 248 if (!b) |
250 b = -2; | 249 b = -2; |
251 | 250 |
252 for (u=0; u<=c; u++) | 251 for (j=0; j <= i; j++) |
253 bp1[u] = ((bp2[u] - ((refl[c+1] * bp2[c-u]) >> 12)) * (0x1000000 / b)) >> 12; | 252 bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * (0x1000000 / b)) >> 12; |
254 | 253 |
255 refl[c] = bp1[c]; | 254 refl[i] = bp1[i]; |
256 | 255 |
257 if ((unsigned) bp1[c] + 0x1000 > 0x1fff) | 256 if ((unsigned) bp1[i] + 0x1000 > 0x1fff) |
258 return 1; | 257 return 1; |
259 | 258 |
260 FFSWAP(int *, bp1, bp2); | 259 FFSWAP(int *, bp1, bp2); |
261 } | 260 } |
262 return 0; | 261 return 0; |