[FFmpeg-cvslog] r18616 - in trunk/libavcodec: celp_filters.c celp_filters.h
reynaldo
subversion
Sun Apr 19 00:53:37 CEST 2009
Author: reynaldo
Date: Sun Apr 19 00:53:37 2009
New Revision: 18616
Log:
Add LP zero synthesis filter. Patch by Kenan Gillet.
Modified:
trunk/libavcodec/celp_filters.c
trunk/libavcodec/celp_filters.h
Modified: trunk/libavcodec/celp_filters.c
==============================================================================
--- trunk/libavcodec/celp_filters.c Sat Apr 18 22:23:13 2009 (r18615)
+++ trunk/libavcodec/celp_filters.c Sun Apr 19 00:53:37 2009 (r18616)
@@ -103,3 +103,23 @@ void ff_celp_lp_synthesis_filterf(
out[n] -= filter_coeffs[i-1] * out[n-i];
}
}
+
+void ff_celp_lp_zero_synthesis_filterf(
+ float *out,
+ const float* filter_coeffs,
+ const float* in,
+ int buffer_length,
+ int filter_length)
+{
+ 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];
+ }
+}
Modified: trunk/libavcodec/celp_filters.h
==============================================================================
--- trunk/libavcodec/celp_filters.h Sat Apr 18 22:23:13 2009 (r18615)
+++ trunk/libavcodec/celp_filters.h Sun Apr 19 00:53:37 2009 (r18616)
@@ -91,4 +91,26 @@ void ff_celp_lp_synthesis_filterf(
int buffer_length,
int filter_length);
+/**
+ * LP zero synthesis filter.
+ * @param out [out] pointer to output buffer
+ * @param filter_coeffs filter coefficients.
+ * @param in input signal
+ * - the array in[-filter_length, -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)
+ *
+ * @note Output buffer must contain filter_length samples of past
+ * speech data before pointer.
+ *
+ * Routine applies A(z) filter to given speech data.
+ */
+void ff_celp_lp_zero_synthesis_filterf(
+ float *out,
+ const float* filter_coeffs,
+ const float* in,
+ int buffer_length,
+ int filter_length);
+
#endif /* AVCODEC_CELP_FILTERS_H */
More information about the ffmpeg-cvslog
mailing list