53 const uint8_t *buf = avpkt->
data;
54 int buf_size = avpkt->
size;
56 const uint8_t *encoded = buf;
57 uint8_t *pixptr, *pixptr_end;
59 unsigned int dlen, p, row;
60 const uint8_t *lp, *dp, *ep;
62 const uint8_t *planemap =
c->planemap;
63 unsigned int planes =
c->planes;
72 ep = encoded + buf_size;
77 for (p = 0; p <
planes; p++) {
78 const int pi = planemap[p];
80 lp = encoded + p * (
height << 1);
83 for (row = 0; row <
height; row++) {
84 pixptr =
frame->data[pi] + row *
frame->linesize[pi];
85 pixptr_end = pixptr +
frame->linesize[pi];
86 if (ep - lp < row * 2 + 2)
93 if ((count = *dp++) <= 127) {
96 if (pixptr_end - pixptr < count)
100 memcpy(pixptr, dp, count);
105 if (pixptr_end - pixptr < count)
107 memset(pixptr, dp[0], count);
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static av_cold int decode_init(AVCodecContext *avctx)
const FFCodec ff_eightbps_decoder
Libavcodec external API header.
#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 ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...
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_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
common internal API header
static const struct @257111027162314367033347246032313251342043035002 planes[]
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.