From 77a78e9bdcc589efac41da4f92a489f4523667c0 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Fri, 21 Jan 2011 00:12:03 +0000 Subject: Separate window function from autocorrelation. Signed-off-by: Mans Rullgard --- libavcodec/flacenc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libavcodec/flacenc.c') diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index d6f0f87376..2bfe56e8eb 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -211,13 +211,11 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) int freq = avctx->sample_rate; int channels = avctx->channels; FlacEncodeContext *s = avctx->priv_data; - int i, level; + int i, level, ret; uint8_t *streaminfo; s->avctx = avctx; - ff_lpc_init(&s->lpc_ctx); - if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) return -1; @@ -438,9 +436,12 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) if (!avctx->coded_frame) return AVERROR(ENOMEM); + ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size, + s->options.max_prediction_order, AV_LPC_TYPE_LEVINSON); + dprint_compression_options(s); - return 0; + return ret; } @@ -1316,6 +1317,7 @@ static av_cold int flac_encode_close(AVCodecContext *avctx) if (avctx->priv_data) { FlacEncodeContext *s = avctx->priv_data; av_freep(&s->md5ctx); + ff_lpc_end(&s->lpc_ctx); } av_freep(&avctx->extradata); avctx->extradata_size = 0; -- cgit v1.2.3