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++) {
101 for (j = 0; j < code + 1; j++) {
102 out[pos] = bytestream2_get_byte(gbc);
118 void *
data,
int *got_frame,
129 if (bytestream2_peek_be32(&gbc) == 0)
140 h = bytestream2_get_be16(&gbc);
141 w = bytestream2_get_be16(&gbc);
149 if (bytestream2_get_be32(&gbc) != 0x001102FF) {
158 int rowbytes, pack_type;
159 int opcode = bytestream2_get_be16(&gbc);
167 bppcnt = bytestream2_get_be16(&gbc);
168 bpp = bytestream2_get_be16(&gbc);
171 if (bppcnt == 1 && bpp == 8) {
175 "Invalid pixel format (bppcnt %d bpp %d) in Packbit\n",
182 colors = bytestream2_get_be16(&gbc);
184 if (colors < 0 || colors > 256) {
186 "Error color count - %i(0x%X)\n", colors, colors);
220 rowbytes = bytestream2_get_be16(&gbc) & 0x3FFF;
221 if (rowbytes <= 250) {
227 pack_type = bytestream2_get_be16(&gbc);
230 bppcnt = bytestream2_get_be16(&gbc);
231 bpp = bytestream2_get_be16(&gbc);
234 if (bppcnt == 3 && bpp == 8) {
236 }
else if (bppcnt == 4 && bpp == 8) {
240 "Invalid pixel format (bppcnt %d bpp %d) in Directbit\n",
249 if (pack_type != 3 && pack_type != 4) {
282 eop = bytestream2_get_be16(&gbc);
286 "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.
#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.
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
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)
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 bits 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)
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 Libav, 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
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.