RA144Context *ractx = avctx->priv_data;
ff_lpc_end(&ractx->lpc_ctx);
ff_af_queue_close(&ractx->afq);
-#if FF_API_OLD_ENCODE_AUDIO
- av_freep(&avctx->coded_frame);
-#endif
return 0;
}
ff_af_queue_init(avctx, &ractx->afq);
-#if FF_API_OLD_ENCODE_AUDIO
- avctx->coded_frame = avcodec_alloc_frame();
- if (!avctx->coded_frame) {
- ret = AVERROR(ENOMEM);
- goto error;
- }
-#endif
-
return 0;
error:
ra144_encode_close(avctx);
const int16_t *lpc_coefs, unsigned int rms,
PutBitContext *pb)
{
- float data[BLOCKSIZE], work[LPC_ORDER + BLOCKSIZE];
+ float data[BLOCKSIZE] = { 0 }, work[LPC_ORDER + BLOCKSIZE];
float coefs[LPC_ORDER];
float zero[BLOCKSIZE], cba[BLOCKSIZE], cb1[BLOCKSIZE], cb2[BLOCKSIZE];
int16_t cba_vect[BLOCKSIZE];
* Calculate the zero-input response of the LPC filter and subtract it from
* input data.
*/
- memset(data, 0, sizeof(data));
ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, data, BLOCKSIZE,
LPC_ORDER);
for (i = 0; i < BLOCKSIZE; i++) {
for (; i < frame->nb_samples; i++)
ractx->curr_block[i] = samples[i] >> 2;
- if ((ret = ff_af_queue_add(&ractx->afq, frame) < 0))
+ if ((ret = ff_af_queue_add(&ractx->afq, frame)) < 0)
return ret;
} else
ractx->last_frame = 1;
AVCodec ff_ra_144_encoder = {
.name = "real_144",
+ .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"),
.type = AVMEDIA_TYPE_AUDIO,
- .id = CODEC_ID_RA_144,
+ .id = AV_CODEC_ID_RA_144,
.priv_data_size = sizeof(RA144Context),
.init = ra144_encode_init,
.encode2 = ra144_encode_frame,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
- .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"),
};