diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/qcelpdec.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/qcelpdec.c')
| -rw-r--r-- | ffmpeg/libavcodec/qcelpdec.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ffmpeg/libavcodec/qcelpdec.c b/ffmpeg/libavcodec/qcelpdec.c index f8fe85d..9650711 100644 --- a/ffmpeg/libavcodec/qcelpdec.c +++ b/ffmpeg/libavcodec/qcelpdec.c @@ -29,6 +29,7 @@ #include <stddef.h> +#include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/float_dsp.h" #include "avcodec.h" @@ -40,9 +41,6 @@ #include "acelp_vectors.h" #include "lsp.h" -#undef NDEBUG -#include <assert.h> - typedef enum { I_F_Q = -1, /**< insufficient frame quality */ SILENCE, @@ -94,7 +92,7 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLT; for (i = 0; i < 10; i++) - q->prev_lspf[i] = (i + 1) / 11.; + q->prev_lspf[i] = (i + 1) / 11.0; return 0; } @@ -135,7 +133,7 @@ static int decode_lspf(QCELPContext *q, float *lspf) } else { erasure_coeff = QCELP_LSP_OCTAVE_PREDICTOR; - assert(q->bitrate == I_F_Q); + av_assert2(q->bitrate == I_F_Q); if (q->erasure_count > 1) erasure_coeff *= q->erasure_count < 4 ? 0.9 : 0.7; @@ -162,7 +160,7 @@ static int decode_lspf(QCELPContext *q, float *lspf) } else { q->octave_count = 0; - tmp_lspf = 0.; + tmp_lspf = 0.0; for (i = 0; i < 5; i++) { lspf[2 * i + 0] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][0] * 0.0001; lspf[2 * i + 1] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][1] * 0.0001; @@ -239,7 +237,7 @@ static void decode_gain_and_index(QCELPContext *q, float *gain) av_clip((q->prev_g1[0] + q->prev_g1[1]) / 2 - 5, 0, 54); subframes_count = 8; } else { - assert(q->bitrate == I_F_Q); + av_assert2(q->bitrate == I_F_Q); g1[0] = q->prev_g1[1]; switch (q->erasure_count) { @@ -434,7 +432,7 @@ static const float *do_pitchfilter(float memory[303], const float v_in[160], v_lag = memory + 143 + 40 * i - lag[i]; for (v_len = v_in + 40; v_in < v_len; v_in++) { if (pfrac[i]) { // If it is a fractional lag... - for (j = 0, *v_out = 0.; j < 4; j++) + for (j = 0, *v_out = 0.0; j < 4; j++) *v_out += qcelp_hammsinc_table[j] * (v_lag[j - 4] + v_lag[3 - j]); } else *v_out = *v_lag; @@ -486,7 +484,7 @@ static void apply_pitch_filters(QCELPContext *q, float *cdn_vector) else max_pitch_gain = 0.0; } else { - assert(q->bitrate == SILENCE); + av_assert2(q->bitrate == SILENCE); max_pitch_gain = 1.0; } for (i = 0; i < 4; i++) @@ -787,11 +785,11 @@ erasure: AVCodec ff_qcelp_decoder = { .name = "qcelp", + .long_name = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"), .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_QCELP, .init = qcelp_decode_init, .decode = qcelp_decode_frame, .capabilities = CODEC_CAP_DR1, .priv_data_size = sizeof(QCELPContext), - .long_name = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"), }; |
