131
131
static int flic_decode_frame_8BPP(AVCodecContext *avctx,
132
void *data, int *data_size,
132
void *data, int *got_frame,
133
133
const uint8_t *buf, int buf_size)
135
135
FlicDecodeContext *s = avctx->priv_data;
419
419
s->new_palette = 0;
422
*data_size=sizeof(AVFrame);
423
423
*(AVFrame*)data = s->frame;
428
428
static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
429
void *data, int *data_size,
429
void *data, int *got_frame,
430
430
const uint8_t *buf, int buf_size)
432
432
/* Note, the only difference between the 15Bpp and 16Bpp */
583
583
/* Now FLX is strange, in that it is "byte" as opposed to "pixel" run length compressed.
584
* This does not give us any good oportunity to perform word endian conversion
584
* This does not give us any good opportunity to perform word endian conversion
585
585
* during decompression. So if it is required (i.e., this is not a LE target, we do
586
586
* a second pass over the line here, swapping the bytes.
681
681
"and final chunk ptr = %d\n", buf_size, bytestream2_tell(&g2));
684
*data_size=sizeof(AVFrame);
685
685
*(AVFrame*)data = s->frame;
690
690
static int flic_decode_frame_24BPP(AVCodecContext *avctx,
691
void *data, int *data_size,
691
void *data, int *got_frame,
692
692
const uint8_t *buf, int buf_size)
694
694
av_log(avctx, AV_LOG_ERROR, "24Bpp FLC Unsupported due to lack of test files.\n");
698
698
static int flic_decode_frame(AVCodecContext *avctx,
699
void *data, int *data_size,
699
void *data, int *got_frame,
702
702
const uint8_t *buf = avpkt->data;
703
703
int buf_size = avpkt->size;
704
704
if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
705
return flic_decode_frame_8BPP(avctx, data, data_size,
705
return flic_decode_frame_8BPP(avctx, data, got_frame,
708
708
else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) ||
709
709
(avctx->pix_fmt == AV_PIX_FMT_RGB565)) {
710
return flic_decode_frame_15_16BPP(avctx, data, data_size,
710
return flic_decode_frame_15_16BPP(avctx, data, got_frame,
713
713
else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) {
714
return flic_decode_frame_24BPP(avctx, data, data_size,
714
return flic_decode_frame_24BPP(avctx, data, got_frame,