changeset 7073:33dc1d1705f0 libavcodec

Factorize c->ap += (-c->ap) >> 4 out
author michael
date Thu, 19 Jun 2008 11:00:17 +0000
parents be6f9be3a79d
children 6f70dc804076
files g726.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/g726.c	Thu Jun 19 10:52:47 2008 +0000
+++ b/g726.c	Thu Jun 19 11:00:17 2008 +0000
@@ -239,10 +239,11 @@
     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);