summaryrefslogtreecommitdiffstats
path: root/libavcodec/amrnbdec.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-08-26 11:29:39 +0200
committerDiego Biurrun <diego@biurrun.de>2012-08-27 20:37:49 +0200
commitdafcbfe44361b0d3caa22b15bc95e38ba80af7e6 (patch)
treebe178be68a80c2ee0a2251b52f4238b476994156 /libavcodec/amrnbdec.c
parent55498543354335697bf1c5616a2ba94c64fbdcf1 (diff)
downloadffmpeg-streaming-dafcbfe44361b0d3caa22b15bc95e38ba80af7e6.zip
ffmpeg-streaming-dafcbfe44361b0d3caa22b15bc95e38ba80af7e6.tar.gz
celp_math: Replace duplicate ff_dot_productf() by ff_scalarproduct_c()
Diffstat (limited to 'libavcodec/amrnbdec.c')
-rw-r--r--libavcodec/amrnbdec.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 28f3021..d0ad76c 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -44,8 +44,8 @@
#include <math.h>
#include "avcodec.h"
+#include "dsputil.h"
#include "libavutil/common.h"
-#include "celp_math.h"
#include "celp_filters.h"
#include "acelp_filters.h"
#include "acelp_vectors.h"
@@ -784,8 +784,8 @@ static int synthesis(AMRContext *p, float *lpc,
// emphasize pitch vector contribution
if (p->pitch_gain[4] > 0.5 && !overflow) {
- float energy = ff_dot_productf(excitation, excitation,
- AMR_SUBFRAME_SIZE);
+ float energy = ff_scalarproduct_float_c(excitation, excitation,
+ AMR_SUBFRAME_SIZE);
float pitch_factor =
p->pitch_gain[4] *
(p->cur_frame_mode == MODE_12k2 ?
@@ -861,8 +861,8 @@ static float tilt_factor(float *lpc_n, float *lpc_d)
ff_celp_lp_synthesis_filterf(hf, lpc_d, hf, AMR_TILT_RESPONSE,
LP_FILTER_ORDER);
- rh0 = ff_dot_productf(hf, hf, AMR_TILT_RESPONSE);
- rh1 = ff_dot_productf(hf, hf + 1, AMR_TILT_RESPONSE - 1);
+ rh0 = ff_scalarproduct_float_c(hf, hf, AMR_TILT_RESPONSE);
+ rh1 = ff_scalarproduct_float_c(hf, hf + 1, AMR_TILT_RESPONSE - 1);
// The spec only specifies this check for 12.2 and 10.2 kbit/s
// modes. But in the ref source the tilt is always non-negative.
@@ -882,8 +882,8 @@ static void postfilter(AMRContext *p, float *lpc, float *buf_out)
int i;
float *samples = p->samples_in + LP_FILTER_ORDER; // Start of input
- float speech_gain = ff_dot_productf(samples, samples,
- AMR_SUBFRAME_SIZE);
+ float speech_gain = ff_scalarproduct_float_c(samples, samples,
+ AMR_SUBFRAME_SIZE);
float pole_out[AMR_SUBFRAME_SIZE + LP_FILTER_ORDER]; // Output of pole filter
const float *gamma_n, *gamma_d; // Formant filter factor table
@@ -988,8 +988,10 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
p->fixed_gain[4] =
ff_amr_set_fixed_gain(fixed_gain_factor,
- ff_dot_productf(p->fixed_vector, p->fixed_vector,
- AMR_SUBFRAME_SIZE)/AMR_SUBFRAME_SIZE,
+ ff_scalarproduct_float_c(p->fixed_vector,
+ p->fixed_vector,
+ AMR_SUBFRAME_SIZE) /
+ AMR_SUBFRAME_SIZE,
p->prediction_error,
energy_mean[p->cur_frame_mode], energy_pred_fac);
OpenPOWER on IntegriCloud