* KMVC decoder
* Copyright (c) 2006 Konstantin Shishkov
*
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * 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 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library 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 this library; 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
*
*/
#include <stdio.h>
#include <stdlib.h>
-#include "common.h"
#include "avcodec.h"
#define KMVC_KEYFRAME 0x80
static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, uint8_t * buf,
int buf_size)
{
- KmvcContext *const ctx = (KmvcContext *) avctx->priv_data;
+ KmvcContext *const ctx = avctx->priv_data;
uint8_t *out, *src;
int i;
int header;
*/
static int decode_init(AVCodecContext * avctx)
{
- KmvcContext *const c = (KmvcContext *) avctx->priv_data;
+ KmvcContext *const c = avctx->priv_data;
int i;
c->avctx = avctx;
- avctx->has_b_frames = 0;
c->pic.data[0] = NULL;
av_log(NULL, 0, "Extradata missing, decoding may not work properly...\n");
c->palsize = 127;
} else {
- c->palsize = LE_16(avctx->extradata + 10);
+ c->palsize = AV_RL16(avctx->extradata + 10);
}
if (avctx->extradata_size == 1036) { // palette in extradata
uint8_t *src = avctx->extradata + 12;
for (i = 0; i < 256; i++) {
- c->pal[i] = LE_32(src);
+ c->pal[i] = AV_RL32(src);
src += 4;
}
c->setpal = 1;
*/
static int decode_end(AVCodecContext * avctx)
{
- KmvcContext *const c = (KmvcContext *) avctx->priv_data;
+ KmvcContext *const c = avctx->priv_data;
av_freep(&c->frm0);
av_freep(&c->frm1);