FFmpeg
Data Structures | Macros | Functions | Variables
flicvideo.c File Reference
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  FlicDecodeContext
 

Macros

#define FLI_256_COLOR   4
 
#define FLI_DELTA   7
 
#define FLI_COLOR   11
 
#define FLI_LC   12
 
#define FLI_BLACK   13
 
#define FLI_BRUN   15
 
#define FLI_COPY   16
 
#define FLI_MINI   18
 
#define FLI_DTA_BRUN   25
 
#define FLI_DTA_COPY   26
 
#define FLI_DTA_LC   27
 
#define FLI_TYPE_CODE   (0xAF11)
 
#define FLC_FLX_TYPE_CODE   (0xAF12)
 
#define FLC_DTA_TYPE_CODE   (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */
 
#define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE   (0xAF13)
 
#define CHECK_PIXEL_PTR(n)
 
#define CHECK_Y_PTR()
 

Functions

static int check_pixel_ptr (ptrdiff_t ptr, int n, ptrdiff_t limit, int direction)
 
static av_cold int flic_decode_init (AVCodecContext *avctx)
 
static int flic_decode_frame_1BPP (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size)
 
static int flic_decode_frame_8BPP (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size)
 
static int flic_decode_frame_15_16BPP (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size)
 
static int flic_decode_frame_24BPP (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size)
 
static int flic_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold int flic_decode_end (AVCodecContext *avctx)
 

Variables

const FFCodec ff_flic_decoder
 

Detailed Description

Autodesk Animator FLI/FLC Video Decoder by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) for more information on the .fli/.flc file format and all of its many variations, visit: http://www.compuphase.com/flic.htm

This decoder outputs PAL8/RGB555/RGB565/BGR24. To use this decoder, be sure that your demuxer sends the FLI file header to the decoder via the extradata chunk in AVCodecContext. The chunk should be 128 bytes large. The only exception is for FLI files from the game "Magic Carpet", in which the header is only 12 bytes.

Definition in file flicvideo.c.

Macro Definition Documentation

◆ FLI_256_COLOR

#define FLI_256_COLOR   4

Definition at line 46 of file flicvideo.c.

◆ FLI_DELTA

#define FLI_DELTA   7

Definition at line 47 of file flicvideo.c.

◆ FLI_COLOR

#define FLI_COLOR   11

Definition at line 48 of file flicvideo.c.

◆ FLI_LC

#define FLI_LC   12

Definition at line 49 of file flicvideo.c.

◆ FLI_BLACK

#define FLI_BLACK   13

Definition at line 50 of file flicvideo.c.

◆ FLI_BRUN

#define FLI_BRUN   15

Definition at line 51 of file flicvideo.c.

◆ FLI_COPY

#define FLI_COPY   16

Definition at line 52 of file flicvideo.c.

◆ FLI_MINI

#define FLI_MINI   18

Definition at line 53 of file flicvideo.c.

◆ FLI_DTA_BRUN

#define FLI_DTA_BRUN   25

Definition at line 54 of file flicvideo.c.

◆ FLI_DTA_COPY

#define FLI_DTA_COPY   26

Definition at line 55 of file flicvideo.c.

◆ FLI_DTA_LC

#define FLI_DTA_LC   27

Definition at line 56 of file flicvideo.c.

◆ FLI_TYPE_CODE

#define FLI_TYPE_CODE   (0xAF11)

Definition at line 58 of file flicvideo.c.

◆ FLC_FLX_TYPE_CODE

#define FLC_FLX_TYPE_CODE   (0xAF12)

Definition at line 59 of file flicvideo.c.

◆ FLC_DTA_TYPE_CODE

#define FLC_DTA_TYPE_CODE   (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */

Definition at line 60 of file flicvideo.c.

◆ FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE

#define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE   (0xAF13)

Definition at line 61 of file flicvideo.c.

◆ CHECK_PIXEL_PTR

#define CHECK_PIXEL_PTR (   n)
Value:
{ \
ret = check_pixel_ptr(pixel_ptr, (n), pixel_limit, direction); \
if (ret < 0) \
return ret; \
}

Definition at line 72 of file flicvideo.c.

◆ CHECK_Y_PTR

#define CHECK_Y_PTR ( )
Value:
{ \
ret = check_pixel_ptr(y_ptr, 0, pixel_limit, direction); \
if (ret < 0) \
return ret; \
}

Definition at line 79 of file flicvideo.c.

Function Documentation

◆ check_pixel_ptr()

static int check_pixel_ptr ( ptrdiff_t  ptr,
int  n,
ptrdiff_t  limit,
int  direction 
)
inlinestatic

◆ flic_decode_init()

static av_cold int flic_decode_init ( AVCodecContext avctx)
static

Definition at line 95 of file flicvideo.c.

◆ flic_decode_frame_1BPP()

static int flic_decode_frame_1BPP ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 166 of file flicvideo.c.

Referenced by flic_decode_frame().

◆ flic_decode_frame_8BPP()

static int flic_decode_frame_8BPP ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 358 of file flicvideo.c.

Referenced by flic_decode_frame().

◆ flic_decode_frame_15_16BPP()

static int flic_decode_frame_15_16BPP ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 701 of file flicvideo.c.

Referenced by flic_decode_frame().

◆ flic_decode_frame_24BPP()

static int flic_decode_frame_24BPP ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 1003 of file flicvideo.c.

Referenced by flic_decode_frame().

◆ flic_decode_frame()

static int flic_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 1283 of file flicvideo.c.

◆ flic_decode_end()

static av_cold int flic_decode_end ( AVCodecContext avctx)
static

Definition at line 1312 of file flicvideo.c.

Variable Documentation

◆ ff_flic_decoder

const FFCodec ff_flic_decoder
Initial value:
= {
.p.name = "flic",
CODEC_LONG_NAME("Autodesk Animator Flic video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(FlicDecodeContext),
.close = flic_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 1321 of file flicvideo.c.

flic_decode_end
static av_cold int flic_decode_end(AVCodecContext *avctx)
Definition: flicvideo.c:1312
AV_CODEC_ID_FLIC
@ AV_CODEC_ID_FLIC
Definition: codec_id.h:102
flic_decode_init
static av_cold int flic_decode_init(AVCodecContext *avctx)
Definition: flicvideo.c:95
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
flic_decode_frame
static int flic_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: flicvideo.c:1283
check_pixel_ptr
static int check_pixel_ptr(ptrdiff_t ptr, int n, ptrdiff_t limit, int direction)
Definition: flicvideo.c:63
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
FlicDecodeContext
Definition: flicvideo.c:86
ret
ret
Definition: filter_design.txt:187
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201