Mercurial > libavcodec.hg
comparison ra144.c @ 7509:86b6cb5b04d5 libavcodec
Simplify eval_refl(): return directly when needed instead of storing the return value in a variable
author | vitor |
---|---|
date | Wed, 06 Aug 2008 05:24:21 +0000 |
parents | f516e1101167 |
children | 6766063923df |
comparison
equal
deleted
inserted
replaced
7508:f516e1101167 | 7509:86b6cb5b04d5 |
---|---|
229 * @return 1 if one of the reflection coefficients is of magnitude greater than | 229 * @return 1 if one of the reflection coefficients is of magnitude greater than |
230 * 4095, 0 if not. | 230 * 4095, 0 if not. |
231 */ | 231 */ |
232 static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx) | 232 static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx) |
233 { | 233 { |
234 int retval = 0; | |
235 int b, c, i; | 234 int b, c, i; |
236 unsigned int u; | 235 unsigned int u; |
237 int buffer1[10]; | 236 int buffer1[10]; |
238 int buffer2[10]; | 237 int buffer2[10]; |
239 int *bp1 = buffer1; | 238 int *bp1 = buffer1; |
265 bp1[u] = ((bp2[u] - ((refl[c+1] * bp2[c-u]) >> 12)) * (0x1000000 / b)) >> 12; | 264 bp1[u] = ((bp2[u] - ((refl[c+1] * bp2[c-u]) >> 12)) * (0x1000000 / b)) >> 12; |
266 | 265 |
267 refl[c] = u = bp1[c]; | 266 refl[c] = u = bp1[c]; |
268 | 267 |
269 if ((u + 0x1000) > 0x1fff) | 268 if ((u + 0x1000) > 0x1fff) |
270 retval = 1; | 269 return 1; |
271 | 270 |
272 FFSWAP(int *, bp1, bp2); | 271 FFSWAP(int *, bp1, bp2); |
273 } | 272 } |
274 return retval; | 273 return 0; |
275 } | 274 } |
276 | 275 |
277 static int interp(RA144Context *ractx, int16_t *out, int block_num, | 276 static int interp(RA144Context *ractx, int16_t *out, int block_num, |
278 int copyold, int energy) | 277 int copyold, int energy) |
279 { | 278 { |