]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Add a rounding parameter to ff_acelp_lp_synthesis_filter()
authorvitor <vitor@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 29 Jun 2008 11:19:50 +0000 (11:19 +0000)
committervitor <vitor@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 29 Jun 2008 11:19:50 +0000 (11:19 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14028 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/acelp_filters.c
libavcodec/acelp_filters.h

index 2aedbddab36ffa7a30534e95075ba1f08aa51c80..fb52d0f8c91aa5c96f8f6eed2d21a406cebe477a 100644 (file)
@@ -116,13 +116,14 @@ int ff_acelp_lp_synthesis_filter(
         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];
 
index 167faf72c3c74c1587f9f13a2530b07fdb57658f..a21fc88a492142ae03be36806aa95afaae7cc14f 100644 (file)
@@ -128,6 +128,7 @@ void ff_acelp_convolve_circ(
  * \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 @@ int ff_acelp_lp_synthesis_filter(
         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.