Do not shift F[I] twice, it is also clearer and smaller now.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Jun 2008 11:04:31 +0000 (11:04 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Jun 2008 11:04:31 +0000 (11:04 +0000)
Originally committed as revision 13818 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/g726.c

index 9d4c87d66b3e37827620f15c174290b4f71cc586..bace3d045bea10fa0b4a663f164607c9909f01f9 100644 (file)
@@ -235,8 +235,8 @@ static int16_t g726_decode(G726Context* c, int I)
     c->td = c->a[1] < -11776;
 
     /* Update Ap */
-    c->dms += ((c->tbls.F[I]<<9) - c->dms) >> 5;
-    c->dml += ((c->tbls.F[I]<<11) - c->dml) >> 7;
+    c->dms += (c->tbls.F[I]<<4) + ((- c->dms) >> 5);
+    c->dml += (c->tbls.F[I]<<4) + ((- c->dml) >> 7);
     if (tr)
         c->ap = 256;
     else {