54 int buf_size = avpkt->
size;
57 uint8_t *
src, *dst_offset, colour1, colour2;
76 pal = (uint32_t *)
frame->data[1];
80 for (j = 0; j < 3; j++,
shift -= 8)
95 static const uint8_t lentab[4] = { 0, 2, 0, 1 };
97 unsigned int code =
byte >> 6;
98 unsigned int length =
byte & ~0xC0;
102 "Input resolution larger than actual frame.\n");
109 length = bytestream2_get_byte(&
g);
110 offset = bytestream2_get_le16(&
g);
112 length = bytestream2_get_le16(&
g);
113 if (
code == 2 && length == 0)
118 offset = bytestream2_get_byte(&
g);
137 if (dst_offset < bfi->
dst)
140 *
dst++ = *dst_offset++;
146 colour1 = bytestream2_get_byte(&
g);
147 colour2 = bytestream2_get_byte(&
g);
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
const FFCodec ff_bfi_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define i(width, name, range_min, range_max)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
static av_cold int bfi_decode_close(AVCodecContext *avctx)
static int bfi_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static av_cold int bfi_decode_init(AVCodecContext *avctx)
static int shift(int a, int b)
Memory handling functions.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int64_t frame_num
Frame counter, set by libavcodec.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static int64_t frame_end(const SyncQueue *sq, SyncQueueFrame frame, int nb_samples)
Compute the end timestamp of a frame.