Mercurial > libavcodec.hg
diff qcelpdec.c @ 8123:cd756806be02 libavcodec
More OKed parts of the QCELP decoder
patch by Kenan Gillet, kenan.gillet gmail com
| author | vitor |
|---|---|
| date | Sun, 09 Nov 2008 12:00:47 +0000 |
| parents | eb55481f35fa |
| children | 3b5256153553 |
line wrap: on
line diff
--- a/qcelpdec.c Sat Nov 08 18:15:13 2008 +0000 +++ b/qcelpdec.c Sun Nov 09 12:00:47 2008 +0000 @@ -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 @@ 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);
