summaryrefslogtreecommitdiff
path: root/libavcodec/alacenc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-21 00:12:03 +0000
committerMans Rullgard <mans@mansr.com>2011-01-21 19:59:08 +0000
commit77a78e9bdcc589efac41da4f92a489f4523667c0 (patch)
tree90c798d89322e0799f72faacff3eb8cda0a5f3c6 /libavcodec/alacenc.c
parent56f8952b252f85281317ecd3e0b04c4cae93fd72 (diff)
Separate window function from autocorrelation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/alacenc.c')
-rw-r--r--libavcodec/alacenc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c
index 5706ae9f4d..d9ff2b8e0a 100644
--- a/libavcodec/alacenc.c
+++ b/libavcodec/alacenc.c
@@ -378,6 +378,7 @@ static void write_compressed_frame(AlacEncodeContext *s)
static av_cold int alac_encode_init(AVCodecContext *avctx)
{
AlacEncodeContext *s = avctx->priv_data;
+ int ret;
uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1);
avctx->frame_size = DEFAULT_FRAME_SIZE;
@@ -455,9 +456,10 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
avctx->coded_frame->key_frame = 1;
s->avctx = avctx;
- ff_lpc_init(&s->lpc_ctx);
+ ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size, s->max_prediction_order,
+ AV_LPC_TYPE_LEVINSON);
- return 0;
+ return ret;
}
static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
@@ -513,6 +515,8 @@ verbatim:
static av_cold int alac_encode_close(AVCodecContext *avctx)
{
+ AlacEncodeContext *s = avctx->priv_data;
+ ff_lpc_end(&s->lpc_ctx);
av_freep(&avctx->extradata);
avctx->extradata_size = 0;
av_freep(&avctx->coded_frame);