summaryrefslogtreecommitdiff
path: root/libavcodec/ra144enc.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/ra144enc.c
parent56f8952b252f85281317ecd3e0b04c4cae93fd72 (diff)
Separate window function from autocorrelation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/ra144enc.c')
-rw-r--r--libavcodec/ra144enc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c
index 3f8694eb8f..2c0a6b1fbd 100644
--- a/libavcodec/ra144enc.c
+++ b/libavcodec/ra144enc.c
@@ -36,6 +36,7 @@
static av_cold int ra144_encode_init(AVCodecContext * avctx)
{
RA144Context *ractx;
+ int ret;
if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
av_log(avctx, AV_LOG_ERROR, "invalid sample format\n");
@@ -52,7 +53,16 @@ static av_cold int ra144_encode_init(AVCodecContext * avctx)
ractx->lpc_coef[0] = ractx->lpc_tables[0];
ractx->lpc_coef[1] = ractx->lpc_tables[1];
ractx->avctx = avctx;
- ff_lpc_init(&ractx->lpc_ctx);
+ ret = ff_lpc_init(&ractx->lpc_ctx, avctx->frame_size, LPC_ORDER,
+ AV_LPC_TYPE_LEVINSON);
+ return ret;
+}
+
+
+static av_cold int ra144_encode_close(AVCodecContext *avctx)
+{
+ RA144Context *ractx = avctx->priv_data;
+ ff_lpc_end(&ractx->lpc_ctx);
return 0;
}
@@ -506,5 +516,6 @@ AVCodec ra_144_encoder =
sizeof(RA144Context),
ra144_encode_init,
ra144_encode_frame,
+ ra144_encode_close,
.long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K) encoder"),
};