diff options
author | Kenan Gillet <kenan.gillet@gmail.com> | 2008-11-09 12:00:47 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-11-09 12:00:47 +0000 |
commit | 2ae1a9b2642d848d01475386f15967f00ae43503 (patch) | |
tree | 141d7a4323bfd69ae0eddfbc267e4a67177b2176 /libavcodec/qcelpdec.c | |
parent | 3d4fc61064624ab3c65ea525b6b104ca1fa40c1f (diff) | |
download | ffmpeg-2ae1a9b2642d848d01475386f15967f00ae43503.tar.gz |
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
Diffstat (limited to 'libavcodec/qcelpdec.c')
-rw-r--r-- | libavcodec/qcelpdec.c | 29 |
1 files changed, 29 insertions, 0 deletions
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 <assert.h> +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); |