45 uint32_t *pal,
int colors)
49 for (i = 0; i <= colors; i++) {
51 unsigned int idx = bytestream2_get_be16(gbc);
54 "Palette index out of range: %u\n", idx);
58 r = bytestream2_get_byte(gbc);
60 g = bytestream2_get_byte(gbc);
62 b = bytestream2_get_byte(gbc);
64 pal[idx] = (0xFF
U << 24) | (r << 16) | (g << 8) | b;
76 for (i = 0; i < avctx->
height; i++) {
77 int size, left, code, pix;
82 size = left = bytestream2_get_be16(gbc);
88 code = bytestream2_get_byte(gbc);
90 pix = bytestream2_get_byte(gbc);
91 for (j = 0; j < 257 - code; j++) {
103 for (j = 0; j < code + 1; j++) {
104 out[pos] = bytestream2_get_byte(gbc);
123 unsigned w,
h,
v0, v1;
138 if (v0 == 0x0011 && v1 == 0x02FF)
145 void *
data,
int *got_frame,
170 h = bytestream2_get_be16(&gbc);
171 w = bytestream2_get_be16(&gbc);
182 }
else if (ver != 2) {
191 int rowbytes, pack_type;
192 int opcode = bytestream2_get_be16(&gbc);
200 bppcnt = bytestream2_get_be16(&gbc);
201 bpp = bytestream2_get_be16(&gbc);
204 if (bppcnt == 1 && bpp == 8) {
208 "Invalid pixel format (bppcnt %d bpp %d) in Packbit\n",
215 colors = bytestream2_get_be16(&gbc);
217 if (colors < 0 || colors > 256) {
219 "Error color count - %i(0x%X)\n", colors, colors);
251 rowbytes = bytestream2_get_be16(&gbc) & 0x3FFF;
252 if (rowbytes <= 250) {
258 pack_type = bytestream2_get_be16(&gbc);
261 bppcnt = bytestream2_get_be16(&gbc);
262 bpp = bytestream2_get_be16(&gbc);
265 if (bppcnt == 3 && bpp == 8) {
267 }
else if (bppcnt == 4 && bpp == 8) {
271 "Invalid pixel format (bppcnt %d bpp %d) in Directbit\n",
280 if (pack_type != 3 && pack_type != 4) {
313 eop = bytestream2_get_be16(&gbc);
317 "Missing end of picture opcode (found 0x%04X)\n", eop);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
#define AV_LOG_WARNING
Something somehow does not look correct.
packed RGB 8:8:8, 24bpp, RGBRGB...
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int parse_palette(AVCodecContext *avctx, GetByteContext *gbc, uint32_t *pal, int colors)
8 bit with AV_PIX_FMT_RGB32 palette
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc, int step)
const char * name
Name of the codec implementation.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static const uint8_t offset[127][2]
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int palette_has_changed
Tell user application that palette has changed from previous frame.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
common internal and external API header
int key_frame
1 -> keyframe, 0-> not
static int check_header(const char *buf, int buf_size)
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.