summaryrefslogtreecommitdiffstats
path: root/libavcodec/kmvc.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-01 03:04:15 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-06 14:12:42 +0200
commit8f689770548c86151071ef976cf9b6998ba21c2a (patch)
tree49945421eb33be202242ce8cf09ddf23cb3d782a /libavcodec/kmvc.c
parent4972e5a186fe8c0552869f793982627d1b318306 (diff)
downloadffmpeg-streaming-8f689770548c86151071ef976cf9b6998ba21c2a.zip
ffmpeg-streaming-8f689770548c86151071ef976cf9b6998ba21c2a.tar.gz
kmvc: use fixed sized arrays in the context
Avoid some boilerplate code to dynamically allocate and then free the buffers.
Diffstat (limited to 'libavcodec/kmvc.c')
-rw-r--r--libavcodec/kmvc.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index 574d053..42a1e01 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -46,7 +46,7 @@ typedef struct KmvcContext {
int palsize;
uint32_t pal[MAX_PALSIZE];
uint8_t *cur, *prev;
- uint8_t *frm0, *frm1;
+ uint8_t frm0[320 * 200], frm1[320 * 200];
GetByteContext g;
} KmvcContext;
@@ -364,8 +364,6 @@ static av_cold int decode_init(AVCodecContext * avctx)
return AVERROR(EINVAL);
}
- c->frm0 = av_mallocz(320 * 200);
- c->frm1 = av_mallocz(320 * 200);
c->cur = c->frm0;
c->prev = c->frm1;
@@ -399,28 +397,12 @@ static av_cold int decode_init(AVCodecContext * avctx)
return 0;
}
-
-
-/*
- * Uninit kmvc decoder
- */
-static av_cold int decode_end(AVCodecContext * avctx)
-{
- KmvcContext *const c = avctx->priv_data;
-
- av_freep(&c->frm0);
- av_freep(&c->frm1);
-
- return 0;
-}
-
AVCodec ff_kmvc_decoder = {
.name = "kmvc",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_KMVC,
.priv_data_size = sizeof(KmvcContext),
.init = decode_init,
- .close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
OpenPOWER on IntegriCloud