aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/acelp_pitch_delay.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-12-29 17:14:30 +0000
committerReynaldo H. Verdejo Pinochet <reynaldo@opendot.cl>2008-12-29 17:14:30 +0000
commit275131628d12392d6ea40aa63e557290d13088e4 (patch)
treed6e86582261d3312bee309e83c855385fc3e1417 /libavcodec/acelp_pitch_delay.c
parent0a11fc82ae4e488d9802ea15c79711e71813c48a (diff)
downloadffmpeg-275131628d12392d6ea40aa63e557290d13088e4.tar.gz
Remove duplicated dot product code. Use dsputil's
scalarproduct instead. Patch by Aurelien Jacobs. Originally committed as revision 16391 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/acelp_pitch_delay.c')
-rw-r--r--libavcodec/acelp_pitch_delay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/acelp_pitch_delay.c b/libavcodec/acelp_pitch_delay.c
index 3db5ea3b20..ac929c4689 100644
--- a/libavcodec/acelp_pitch_delay.c
+++ b/libavcodec/acelp_pitch_delay.c
@@ -21,6 +21,7 @@
*/
#include "avcodec.h"
+#include "dsputil.h"
#include "acelp_pitch_delay.h"
#include "celp_math.h"
@@ -87,6 +88,7 @@ void ff_acelp_update_past_gain(
}
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 @@ int16_t ff_acelp_decode_gain_code(
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 @@ int16_t ff_acelp_decode_gain_code(
);
#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
}