diff options
Diffstat (limited to 'libavcodec/kmvc.c')
-rw-r--r-- | libavcodec/kmvc.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 6c55863e7d..19f9677649 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -2,20 +2,20 @@ * KMVC decoder * Copyright (c) 2006 Konstantin Shishkov * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -288,7 +288,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa if (ctx->pic.data[0]) avctx->release_buffer(avctx, &ctx->pic); - ctx->pic.reference = 1; + ctx->pic.reference = 3; ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID; if (avctx->get_buffer(avctx, &ctx->pic) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); @@ -301,7 +301,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa if (buf[0] == 127) { buf += 3; for (i = 0; i < 127; i++) { - ctx->pal[i + (header & 0x81)] = AV_RB24(buf); + ctx->pal[i + (header & 0x81)] = 0xFF << 24 | AV_RB24(buf); buf += 4; } buf -= 127 * 4 + 3; @@ -319,7 +319,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa ctx->pic.palette_has_changed = 1; // palette starts from index 1 and has 127 entries for (i = 1; i <= ctx->palsize; i++) { - ctx->pal[i] = bytestream_get_be24(&buf); + ctx->pal[i] = 0xFF << 24 | bytestream_get_be24(&buf); } } @@ -406,7 +406,7 @@ static av_cold int decode_init(AVCodecContext * avctx) c->prev = c->frm1; for (i = 0; i < 256; i++) { - c->pal[i] = i * 0x10101; + c->pal[i] = 0xFF << 24 | i * 0x10101; } if (avctx->extradata_size < 12) { @@ -425,6 +425,7 @@ static av_cold int decode_init(AVCodecContext * avctx) c->setpal = 1; } + avcodec_get_frame_defaults(&c->pic); avctx->pix_fmt = PIX_FMT_PAL8; return 0; |