#include <stddef.h>
+#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
-
+#include "dsputil.h"
#include "qcelpdata.h"
-
-#include "celp_math.h"
#include "celp_filters.h"
#include "acelp_filters.h"
#include "acelp_vectors.h"
QCELPContext *q = avctx->priv_data;
int i;
- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+ avctx->channels = 1;
+ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
for (i = 0; i < 10; i++)
q->prev_lspf[i] = (i + 1) / 11.;
for (i = 0; i < 160; i += 40)
ff_scale_vector_to_given_sum_of_squares(v_out + i, v_in + i,
- ff_dot_productf(v_ref + i,
- v_ref + i, 40),
+ ff_scalarproduct_float_c(v_ref + i,
+ v_ref + i,
+ 40),
40);
}
ff_tilt_compensation(&q->postfilter_tilt_mem, 0.3, pole_out + 10, 160);
ff_adaptive_gain_control(samples, pole_out + 10,
- ff_dot_productf(q->formant_mem + 10,
- q->formant_mem + 10, 160),
+ ff_scalarproduct_float_c(q->formant_mem + 10,
+ q->formant_mem + 10, 160),
160, 0.9375, &q->postfilter_agc_mem);
}
/* get output buffer */
q->avframe.nb_samples = 160;
- if ((ret = avctx->get_buffer(avctx, &q->avframe)) < 0) {
+ if ((ret = ff_get_buffer(avctx, &q->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
AVCodec ff_qcelp_decoder = {
.name = "qcelp",
.type = AVMEDIA_TYPE_AUDIO,
- .id = CODEC_ID_QCELP,
+ .id = AV_CODEC_ID_QCELP,
.init = qcelp_decode_init,
.decode = qcelp_decode_frame,
.capabilities = CODEC_CAP_DR1,