diff acelp_pitch_delay.c @ 8505:c8743c33eeef libavcodec

Remove duplicated dot product code. Use dsputil's scalarproduct instead. Patch by Aurelien Jacobs.
author reynaldo
date Mon, 29 Dec 2008 17:14:30 +0000
parents ecb1962c12f3
children afad312b9989
line wrap: on
line diff
--- a/acelp_pitch_delay.c	Mon Dec 29 10:20:03 2008 +0000
+++ b/acelp_pitch_delay.c	Mon Dec 29 17:14:30 2008 +0000
@@ -21,6 +21,7 @@
  */
 
 #include "avcodec.h"
+#include "dsputil.h"
 #include "acelp_pitch_delay.h"
 #include "celp_math.h"
 
@@ -87,6 +88,7 @@
 }
 
 int16_t ff_acelp_decode_gain_code(
+    DSPContext *dsp,
     int gain_corr_factor,
     const int16_t* fc_v,
     int mr_energy,
@@ -103,7 +105,7 @@
         mr_energy += quant_energy[i] * ma_prediction_coeff[i];
 
 #ifdef G729_BITEXACT
-    mr_energy += (((-6165LL * ff_log2(dot_product(fc_v, fc_v, subframe_size, 0))) >> 3) & ~0x3ff);
+    mr_energy += (((-6165LL * ff_log2(dsp->scalarproduct_int16(fc_v, fc_v, subframe_size, 0))) >> 3) & ~0x3ff);
 
     mr_energy = (5439 * (mr_energy >> 15)) >> 8;           // (0.15) = (0.15) * (7.23)
 
@@ -113,7 +115,7 @@
            );
 #else
     mr_energy = gain_corr_factor * exp(M_LN10 / (20 << 23) * mr_energy) /
-                sqrt(dot_product(fc_v, fc_v, subframe_size, 0));
+                sqrt(dsp->scalarproduct_int16(fc_v, fc_v, subframe_size, 0));
     return mr_energy >> 12;
 #endif
 }