Mercurial > libavcodec.hg
changeset 7161:2b763a495c07 libavcodec
Add a rounding parameter to ff_acelp_lp_synthesis_filter()
author | vitor |
---|---|
date | Sun, 29 Jun 2008 11:19:50 +0000 |
parents | 05c4de3904f6 |
children | ad0d9713e953 |
files | acelp_filters.c acelp_filters.h |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/acelp_filters.c Sun Jun 29 08:32:27 2008 +0000 +++ b/acelp_filters.c Sun Jun 29 11:19:50 2008 +0000 @@ -116,13 +116,14 @@ const int16_t* in, int buffer_length, int filter_length, - int stop_on_overflow) + int stop_on_overflow, + int rounder) { int i,n; for(n=0; n<buffer_length; n++) { - int sum = 0x800; + int sum = rounder; for(i=1; i<filter_length; i++) sum -= filter_coeffs[i] * out[n-i];
--- a/acelp_filters.h Sun Jun 29 08:32:27 2008 +0000 +++ b/acelp_filters.h Sun Jun 29 11:19:50 2008 +0000 @@ -128,6 +128,7 @@ * \param filter_length filter length (11 for 10th order LP filter) * \param stop_on_overflow 1 - return immediately if overflow occurs * 0 - ignore overflows + * \param rounder the amount to add for rounding (usually 0x800 or 0xfff) * * \return 1 if overflow occurred, 0 - otherwise * @@ -142,7 +143,8 @@ const int16_t* in, int buffer_length, int filter_length, - int stop_on_overflow); + int stop_on_overflow, + int rounder); /** * \brief Calculates coefficients of weighted A(z/weight) filter.