X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fkmvc.c;h=5d3dd4ce63790dd3ff950d11aa684cf4ac65e3e6;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=8d9f0a96937a3d2e8ece287a866d572a3b652bda;hpb=fb6a8847ad60cd5d6f50d459743b46c23900d542;p=ffmpeg diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 8d9f0a96937..5d3dd4ce637 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -44,12 +44,12 @@ typedef struct KmvcContext { AVCodecContext *avctx; + GetByteContext g; + uint8_t *cur, *prev; int setpal; int palsize; uint32_t pal[MAX_PALSIZE]; - uint8_t *cur, *prev; uint8_t frm0[320 * 200], frm1[320 * 200]; - GetByteContext g; } KmvcContext; typedef struct BitBuf { @@ -345,13 +345,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame, } /* flip buffers */ - if (ctx->cur == ctx->frm0) { - ctx->cur = ctx->frm1; - ctx->prev = ctx->frm0; - } else { - ctx->cur = ctx->frm0; - ctx->prev = ctx->frm1; - } + FFSWAP(uint8_t *, ctx->cur, ctx->prev); *got_frame = 1; @@ -410,7 +404,7 @@ static av_cold int decode_init(AVCodecContext * avctx) return 0; } -AVCodec ff_kmvc_decoder = { +const AVCodec ff_kmvc_decoder = { .name = "kmvc", .long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"), .type = AVMEDIA_TYPE_VIDEO,