diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-01 03:04:15 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-07-06 15:06:31 +0200 |
commit | 1c2bd6fe5f962b32ca48e6a6fa4e179d02e6bf90 (patch) | |
tree | fb17b6f978b6b38ae953ae7c41d489f341e4b985 | |
parent | 73d5d7acb0e01142fe6935196f57000f26717d30 (diff) | |
download | ffmpeg-1c2bd6fe5f962b32ca48e6a6fa4e179d02e6bf90.tar.gz |
kmvc: use fixed sized arrays in the context
Avoid some boilerplate code to dynamically allocate and then free the
buffers.
(cherry picked from commit 8f689770548c86151071ef976cf9b6998ba21c2a)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Conflicts:
libavcodec/kmvc.c
-rw-r--r-- | libavcodec/kmvc.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index d9fbbb0d71..1bfc0da802 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -47,7 +47,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; @@ -369,8 +369,6 @@ static av_cold int decode_init(AVCodecContext * avctx) return -1; } - c->frm0 = av_mallocz(320 * 200); - c->frm1 = av_mallocz(320 * 200); c->cur = c->frm0; c->prev = c->frm1; @@ -404,30 +402,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); - if (c->pic.data[0]) - avctx->release_buffer(avctx, &c->pic); - - 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"), |