[FFmpeg-cvslog] r22933 - in trunk/libavcodec: acelp_filters.c acelp_filters.h amrnbdec.c sipr.c

rbultje subversion
Wed Apr 21 19:45:24 CEST 2010


Author: rbultje
Date: Wed Apr 21 19:45:24 2010
New Revision: 22933

Log:
Split input/output data arguments to ff_acelp_apply_order_2_transfer_function().

Modified:
   trunk/libavcodec/acelp_filters.c
   trunk/libavcodec/acelp_filters.h
   trunk/libavcodec/amrnbdec.c
   trunk/libavcodec/sipr.c

Modified: trunk/libavcodec/acelp_filters.c
==============================================================================
--- trunk/libavcodec/acelp_filters.c	Wed Apr 21 19:43:52 2010	(r22932)
+++ trunk/libavcodec/acelp_filters.c	Wed Apr 21 19:45:24 2010	(r22933)
@@ -114,7 +114,7 @@ void ff_acelp_high_pass_filter(int16_t* 
     }
 }
 
-void ff_acelp_apply_order_2_transfer_function(float *buf,
+void ff_acelp_apply_order_2_transfer_function(float *out, const float *in,
                                               const float zero_coeffs[2],
                                               const float pole_coeffs[2],
                                               float gain, float mem[2], int n)
@@ -123,8 +123,8 @@ void ff_acelp_apply_order_2_transfer_fun
     float tmp;
 
     for (i = 0; i < n; i++) {
-        tmp = gain * buf[i] - pole_coeffs[0] * mem[0] - pole_coeffs[1] * mem[1];
-        buf[i] =        tmp + zero_coeffs[0] * mem[0] + zero_coeffs[1] * mem[1];
+        tmp = gain * in[i] - pole_coeffs[0] * mem[0] - pole_coeffs[1] * mem[1];
+        out[i] =       tmp + zero_coeffs[0] * mem[0] + zero_coeffs[1] * mem[1];
 
         mem[1] = mem[0];
         mem[0] = tmp;

Modified: trunk/libavcodec/acelp_filters.h
==============================================================================
--- trunk/libavcodec/acelp_filters.h	Wed Apr 21 19:43:52 2010	(r22932)
+++ trunk/libavcodec/acelp_filters.h	Wed Apr 21 19:45:24 2010	(r22933)
@@ -92,14 +92,15 @@ void ff_acelp_high_pass_filter(int16_t* 
 /**
  * Apply an order 2 rational transfer function in-place.
  *
- * @param samples [in/out]
+ * @param out output buffer for filtered speech samples
+ * @param in input buffer containing speech data (may be the same as out)
  * @param zero_coeffs z^-1 and z^-2 coefficients of the numerator
  * @param pole_coeffs z^-1 and z^-2 coefficients of the denominator
  * @param gain scale factor for final output
  * @param mem intermediate values used by filter (should be 0 initially)
  * @param n number of samples
  */
-void ff_acelp_apply_order_2_transfer_function(float *samples,
+void ff_acelp_apply_order_2_transfer_function(float *out, const float *in,
                                               const float zero_coeffs[2],
                                               const float pole_coeffs[2],
                                               float gain,

Modified: trunk/libavcodec/amrnbdec.c
==============================================================================
--- trunk/libavcodec/amrnbdec.c	Wed Apr 21 19:43:52 2010	(r22932)
+++ trunk/libavcodec/amrnbdec.c	Wed Apr 21 19:45:24 2010	(r22933)
@@ -1044,7 +1044,7 @@ static int amrnb_decode_frame(AVCodecCon
         update_state(p);
     }
 
-    ff_acelp_apply_order_2_transfer_function(buf_out, highpass_zeros,
+    ff_acelp_apply_order_2_transfer_function(buf_out, buf_out, highpass_zeros,
                                              highpass_poles, highpass_gain,
                                              p->high_pass_mem, AMR_BLOCK_SIZE);
 

Modified: trunk/libavcodec/sipr.c
==============================================================================
--- trunk/libavcodec/sipr.c	Wed Apr 21 19:43:52 2010	(r22932)
+++ trunk/libavcodec/sipr.c	Wed Apr 21 19:45:24 2010	(r22933)
@@ -490,14 +490,14 @@ static void decode_frame(SiprContext *ct
     memcpy(ctx->excitation, excitation - PITCH_DELAY_MAX - L_INTERPOL,
            (PITCH_DELAY_MAX + L_INTERPOL) * sizeof(float));
 
-    ff_acelp_apply_order_2_transfer_function(synth,
+    ff_acelp_apply_order_2_transfer_function(out_data, synth,
                                              (const float[2]) {-1.99997   , 1.000000000},
                                              (const float[2]) {-1.93307352, 0.935891986},
                                              0.939805806,
                                              ctx->highpass_filt_mem,
                                              frame_size);
 
-    ctx->dsp.vector_clipf(out_data, synth, -1, 32767./(1<<15), frame_size);
+    ctx->dsp.vector_clipf(out_data, out_data, -1, 32767./(1<<15), frame_size);
 
 }
 



More information about the ffmpeg-cvslog mailing list