aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-06-19 11:00:17 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-06-19 11:00:17 +0000
commit50c52d22502d649db0fdecde6de64532e20c5dda (patch)
tree3468253b4f6c5e28459790e0d7fcc06cbde1afd6
parent0e0d6cfd486e26f9db649278803b9ca2e46a41b4 (diff)
downloadffmpeg-50c52d22502d649db0fdecde6de64532e20c5dda.tar.gz
Factorize c->ap += (-c->ap) >> 4 out
Originally committed as revision 13817 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/g726.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index b8abd297a1..9d4c87d66b 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -239,10 +239,11 @@ static int16_t g726_decode(G726Context* c, int I)
c->dml += ((c->tbls.F[I]<<11) - c->dml) >> 7;
if (tr)
c->ap = 256;
- else if (c->y > 1535 && !c->td && abs((c->dms << 2) - c->dml) < (c->dml >> 3))
+ else {
c->ap += (-c->ap) >> 4;
- else
- c->ap += (0x200 - c->ap) >> 4;
+ if (c->y <= 1535 || c->td || abs((c->dms << 2) - c->dml) >= (c->dml >> 3))
+ c->ap += 0x20;
+ }
/* Update Yu and Yl */
c->yu = av_clip(c->y + c->tbls.W[I] + ((-c->y)>>5), 544, 5120);