summaryrefslogtreecommitdiff
path: root/libavcodec/ra144.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-08-06 21:16:24 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-08-06 21:16:24 +0000
commitbdb34c9f5e490214b3dbcad9c2b09d48fb9018cf (patch)
tree1ac20ab2624aed49dc16631bce0b35cb9419a7b8 /libavcodec/ra144.c
parentaa425ada542ad8c4e9d19414492b7e39cb4ef05f (diff)
Simplify eval_refl(): do not store a buffer value in a var when the buffer could be used directly
Originally committed as revision 14652 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra144.c')
-rw-r--r--libavcodec/ra144.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 2af76133df..bd91c638b8 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -236,15 +236,15 @@ static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx)
for (i=0; i < 10; i++)
buffer2[i] = coefs[i];
- u = refl[9] = bp2[9];
+ refl[9] = bp2[9];
- if (u + 0x1000 > 0x1fff) {
+ if ((unsigned) bp2[9] + 0x1000 > 0x1fff) {
av_log(ractx, AV_LOG_ERROR, "Overflow. Broken sample?\n");
return 1;
}
for (c=8; c >= 0; c--) {
- b = 0x1000-((u * u) >> 12);
+ b = 0x1000-((bp2[c+1] * bp2[c+1]) >> 12);
if (!b)
b = -2;
@@ -252,9 +252,9 @@ static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx)
for (u=0; u<=c; u++)
bp1[u] = ((bp2[u] - ((refl[c+1] * bp2[c-u]) >> 12)) * (0x1000000 / b)) >> 12;
- refl[c] = u = bp1[c];
+ refl[c] = bp1[c];
- if ((u + 0x1000) > 0x1fff)
+ if ((unsigned) bp1[c] + 0x1000 > 0x1fff)
return 1;
FFSWAP(int *, bp1, bp2);