[FFmpeg-cvslog] g723.1: drop unnecessary variable buf_ptr in formant_postfilter()

Mans Rullgard git at videolan.org
Mon Aug 13 14:49:45 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sat Aug 11 03:39:30 2012 +0100| [1953264331ec653bff2e3d85391b91c0ea5299ae] | committer: Mans Rullgard

g723.1: drop unnecessary variable buf_ptr in formant_postfilter()

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1953264331ec653bff2e3d85391b91c0ea5299ae
---

 libavcodec/g723_1.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index 6f4898c..a2f7dee 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -926,7 +926,7 @@ static void gain_scale(G723_1_Context *p, int16_t * buf, int energy)
  */
 static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
 {
-    int16_t filter_coef[2][LPC_ORDER], *buf_ptr;
+    int16_t filter_coef[2][LPC_ORDER];
     int filter_signal[LPC_ORDER + FRAME_LEN], *signal_ptr;
     int i, j, k;
 
@@ -949,7 +949,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
     memcpy(p->iir_mem, filter_signal + FRAME_LEN,
            LPC_ORDER * sizeof(*p->iir_mem));
 
-    buf_ptr    = buf + LPC_ORDER;
+    buf += LPC_ORDER;
     signal_ptr = filter_signal + LPC_ORDER;
     for (i = 0; i < SUBFRAMES; i++) {
         int16_t temp_vector[SUBFRAME_LEN];
@@ -958,7 +958,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
         int scale, energy;
 
         /* Normalize */
-        scale = scale_vector(temp_vector, buf_ptr, SUBFRAME_LEN);
+        scale = scale_vector(temp_vector, buf, SUBFRAME_LEN);
 
         /* Compute auto correlation coefficients */
         auto_corr[0] = dot_product(temp_vector, temp_vector + 1,
@@ -975,8 +975,8 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
 
         /* Compensation filter */
         for (j = 0; j < SUBFRAME_LEN; j++) {
-            buf_ptr[j] = av_sat_dadd32(signal_ptr[j],
-                                       (signal_ptr[j - 1] >> 16) * temp) >> 16;
+            buf[j] = av_sat_dadd32(signal_ptr[j],
+                                   (signal_ptr[j - 1] >> 16) * temp) >> 16;
         }
 
         /* Compute normalized signal energy */
@@ -986,9 +986,9 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
         } else
             energy = auto_corr[1] >> temp;
 
-        gain_scale(p, buf_ptr, energy);
+        gain_scale(p, buf, energy);
 
-        buf_ptr    += SUBFRAME_LEN;
+        buf        += SUBFRAME_LEN;
         signal_ptr += SUBFRAME_LEN;
     }
 }



More information about the ffmpeg-cvslog mailing list