aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2010-04-21 17:45:24 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-04-21 17:45:24 +0000
commit8955a9d79c9bc5b9bdcb333d8f41654c7920c60a (patch)
tree4b32770cd010826287719ec0c39595a5bafd3f42
parentbb2dd9efd8e88a71882bb1fabe1dc5f8fa34afba (diff)
downloadffmpeg-8955a9d79c9bc5b9bdcb333d8f41654c7920c60a.tar.gz
Split input/output data arguments to ff_acelp_apply_order_2_transfer_function().
Originally committed as revision 22933 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/acelp_filters.c6
-rw-r--r--libavcodec/acelp_filters.h5
-rw-r--r--libavcodec/amrnbdec.c2
-rw-r--r--libavcodec/sipr.c4
4 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/acelp_filters.c b/libavcodec/acelp_filters.c
index 0156d763fc..31f0e86f5b 100644
--- a/libavcodec/acelp_filters.c
+++ b/libavcodec/acelp_filters.c
@@ -114,7 +114,7 @@ void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2],
}
}
-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_function(float *buf,
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;
diff --git a/libavcodec/acelp_filters.h b/libavcodec/acelp_filters.h
index c5be5a6cb1..09b5da45be 100644
--- a/libavcodec/acelp_filters.h
+++ b/libavcodec/acelp_filters.h
@@ -92,14 +92,15 @@ void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2],
/**
* 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,
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 3e7515d0f1..40cd91d110 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -1044,7 +1044,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
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);
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
index 5b7d87f14e..d409484b61 100644
--- a/libavcodec/sipr.c
+++ b/libavcodec/sipr.c
@@ -490,14 +490,14 @@ static void decode_frame(SiprContext *ctx, SiprParameters *params,
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);
}