From 2ae1a9b2642d848d01475386f15967f00ae43503 Mon Sep 17 00:00:00 2001 From: Kenan Gillet Date: Sun, 9 Nov 2008 12:00:47 +0000 Subject: More OKed parts of the QCELP decoder patch by Kenan Gillet, kenan.gillet gmail com Originally committed as revision 15797 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/qcelpdec.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libavcodec/qcelpdec.c') diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 1b52d3f5cd..1ad76590f9 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -38,6 +38,19 @@ #undef NDEBUG #include +static void weighted_vector_sumf(float *out, + const float *in_a, + const float *in_b, + float weight_coeff_a, + float weight_coeff_b, + int length) { + int i; + + for (i = 0; i < length; i++) + out[i] = weight_coeff_a * in_a[i] + + weight_coeff_b * in_b[i]; +} + /** * Apply filter in pitch-subframe steps. * @@ -90,6 +103,22 @@ static const float *do_pitchfilter(float memory[303], return memory + 143; } +static int buf_size2framerate(const int buf_size) { + switch (buf_size) { + case 35: + return RATE_FULL; + case 17: + return RATE_HALF; + case 8: + return RATE_QUARTER; + case 4: + return RATE_OCTAVE; + case 1: + return SILENCE; + } + return -1; +} + static void warn_insufficient_frame_quality(AVCodecContext *avctx, const char *message) { av_log(avctx, AV_LOG_WARNING, "Frame #%d, IFQ: %s\n", avctx->frame_number, message); -- cgit v1.2.3