[FFmpeg-soc] [soc]: r4992 - amr/amrnbdec.c

cmcq subversion at mplayerhq.hu
Sat Aug 8 22:56:03 CEST 2009


Author: cmcq
Date: Sat Aug  8 22:56:03 2009
New Revision: 4992

Log:
Use x*10923>>16 instead of x/6 for consistency in decode_pitch_lag

Modified:
   amr/amrnbdec.c

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Sat Aug  8 22:49:12 2009	(r4991)
+++ amr/amrnbdec.c	Sat Aug  8 22:56:03 2009	(r4992)
@@ -362,7 +362,7 @@ static void decode_pitch_lag(int *lag_in
         (subframe == 2 && mode != MODE_475 && mode != MODE_515)) {
         if (mode == MODE_122) {
             if (pitch_index < 463) {
-                *lag_int  = (pitch_index + 5) / 6 + 17;
+                *lag_int  = ((pitch_index + 5) * 10923 >> 16) + 17;
                 *lag_frac = pitch_index - *lag_int * 6 + 105;
             } else {
                 *lag_int  = pitch_index - 368;
@@ -377,7 +377,7 @@ static void decode_pitch_lag(int *lag_in
         }
     } else {
         if (mode == MODE_122) {
-            *lag_int  = (pitch_index + 5) / 6 - 1;
+            *lag_int  = ((pitch_index + 5) * 10923 >> 16) - 1;
             *lag_frac = pitch_index - *lag_int * 6 - 3;
             *lag_int += av_clip(prev_lag_int - 5, PITCH_LAG_MIN_MODE_122,
                                 PITCH_LAG_MAX - 9);


More information about the FFmpeg-soc mailing list