Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-21 03:12:03 +0300
committerMichael Niedermayer <michaelni@gmx.at>2011-01-23 21:32:06 +0300
commit7101b1850822c2490cfaf2c5f4addf2ccbf7eab1 (patch)
tree6515ce34a76a082c1bef7cf9c946e4cf676d2a0a /libavcodec/flacenc.c
parent0d8837bdda4cad7e6c280d2648cef8077e54947b (diff)
Separate window function from autocorrelation.
Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 77a78e9bdcc589efac41da4f92a489f4523667c0)
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r--libavcodec/flacenc.c10
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;