[FFmpeg-soc] [soc]: r1461 - amr/amrnbfloatdec.c

superdump subversion at mplayerhq.hu
Mon Nov 26 19:07:54 CET 2007


Author: superdump
Date: Mon Nov 26 19:07:53 2007
New Revision: 1461

Log:
Calculate average lsp vector once per frame, not once per subframe


Modified:
   amr/amrnbfloatdec.c

Modified: amr/amrnbfloatdec.c
==============================================================================
--- amr/amrnbfloatdec.c	(original)
+++ amr/amrnbfloatdec.c	Mon Nov 26 19:07:53 2007
@@ -861,6 +861,13 @@ static int amrnb_decode_frame(AVCodecCon
         lsp2lpc(p->lsp[i], p->lpc[i]);
     }
 
+    // update averaged lsp vectors (used for fixed gain smoothing)
+    memmove(p->lsp_avg[0], p->lsp_avg[1], 9*LP_FILTER_ORDER*sizeof(float));
+    for(i=0; i<LP_FILTER_ORDER; i++) {
+        // calculate averaged lsp vector
+        p->lsp_avg[9][i] = 0.84*p->lsp_avg[8][i] + 0.16*p->prev_lsp_sub4[i];
+    }
+
 /*** end of LPC coefficient decoding ***/
 
     for(subframe = 0; subframe < 5; subframe++) {
@@ -965,10 +972,7 @@ static int amrnb_decode_frame(AVCodecCon
             float diff = 0.0;
             float smoothing_factor = 0.0;
 
-            memmove(p->lsp_avg[0], p->lsp_avg[1], 9*LP_FILTER_ORDER*sizeof(float));
             for(i=0; i<LP_FILTER_ORDER; i++) {
-                // calculate averaged lsp vector
-                p->lsp_avg[9][i] = 0.84*p->lsp_avg[8][i] + 0.16*p->prev_lsp_sub4[i];
                 // calculate diff
                 diff += fabs(p->lsp_avg[9][i]-p->lsp[subframe][i])/p->lsp_avg[9][i];
             }



More information about the FFmpeg-soc mailing list