diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-01-21 03:12:03 +0300 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-01-21 22:59:08 +0300 |
commit | 77a78e9bdcc589efac41da4f92a489f4523667c0 (patch) | |
tree | 90c798d89322e0799f72faacff3eb8cda0a5f3c6 /libavcodec/flacenc.c | |
parent | 56f8952b252f85281317ecd3e0b04c4cae93fd72 (diff) |
Separate window function from autocorrelation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r-- | libavcodec/flacenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; |