[FFmpeg-soc] [soc]: r4679 - amr/amr-ffmpeg.diff

cmcq subversion at mplayerhq.hu
Sun Jul 12 13:22:07 CEST 2009


Author: cmcq
Date: Sun Jul 12 13:22:07 2009
New Revision: 4679

Log:
Make ff_celp_lp_zero_synthesis_filterf a general FIR filter.
It shouldn't negate the coefficients and it's useful to allow the z^0
coefficient to vary.

Modified:
   amr/amr-ffmpeg.diff

Modified: amr/amr-ffmpeg.diff
==============================================================================
--- amr/amr-ffmpeg.diff	Sun Jul 12 13:19:21 2009	(r4678)
+++ amr/amr-ffmpeg.diff	Sun Jul 12 13:22:07 2009	(r4679)
@@ -85,11 +85,28 @@ Index: libavcodec/celp_filters.c
  void ff_celp_lp_synthesis_filterf(
          float *out,
          const float* filter_coeffs,
+@@ -113,13 +138,10 @@
+ {
+     int i,n;
+ 
+-    // Avoids a +1 in the inner loop.
+-    filter_length++;
+-
+     for(n=0; n<buffer_length; n++)
+     {
+-        out[n] = in[n];
+-        for(i=1; i<filter_length; i++)
+-            out[n] -= filter_coeffs[i-1] * in[n-i];
++        out[n] = 0;
++        for(i=0; i<filter_length; i++)
++            out[n] += filter_coeffs[i] * in[n-i];
+     }
+ }
 Index: libavcodec/celp_filters.h
 ===================================================================
 --- libavcodec/celp_filters.h	(revision 19401)
 +++ libavcodec/celp_filters.h	(working copy)
-@@ -70,6 +70,23 @@
+@@ -70,14 +70,31 @@
          int rounder);
  
  /**
@@ -113,9 +130,29 @@ Index: libavcodec/celp_filters.h
   * LP synthesis filter.
   * @param out [out] pointer to output buffer
   *        - the array out[-filter_length, -1] must
-@@ -101,9 +118,6 @@
+  *        contain the previous result of this filter
+- * @param filter_coeffs filter coefficients.
++ * @param filter_coeffs filter coefficients not including z^0
+  * @param in input signal
   * @param buffer_length amount of data to process
-  * @param filter_length filter length (10 for 10th order LP filter)
+- * @param filter_length filter length (10 for 10th order LP filter)
++ * @param filter_length filter_coeffs length (10 for 10th order LP filter)
+  *
+  * @note Output buffer must contain filter_length samples of past
+  *       speech data before pointer.
+@@ -94,16 +111,13 @@
+ /**
+  * LP zero synthesis filter.
+  * @param out [out] pointer to output buffer
+- * @param filter_coeffs filter coefficients.
++ * @param filter_coeffs filter coefficients including z^0 coefficient
+  * @param in input signal
+- *        - the array in[-filter_length, -1] must
++ *        - the array in[-filter_length+1, -1] must
+  *        contain the previous input of this filter
+  * @param buffer_length amount of data to process
+- * @param filter_length filter length (10 for 10th order LP filter)
++ * @param filter_length filter_coeffs length (11 for 10th order LP filter)
   *
 - * @note Output buffer must contain filter_length samples of past
 - *       speech data before pointer.


More information about the FFmpeg-soc mailing list