32 #include "libavutil/intreadwrite.h"
62 for (j = 0; j < 2; j++)
63 memset(dst + j*linesize, v[0], 2);
68 for (j = 0; j < 2; j++)
69 for (i = 0; i < 2; i++)
73 for (j = 0; j < 2; j++)
74 for (i = 0; i < 2; i++)
75 dst[j*linesize + i] =
get_bits(gb, 8);
89 for (j = 0; j < 4; j++)
90 memset(dst + j*linesize, v[0], 4);
95 for (j = 2; j >= 0; j -= 2) {
96 for (i = 0; i < 4; i++)
98 for (i = 0; i < 4; i++)
99 dst[(j+1)*linesize + i] = v[
get_bits1(gb)];
103 for (j = 0; j < 4; j += 2)
104 for (i = 0; i < 4; i += 2)
105 decode2x2(gb, dst + j*linesize + i, linesize);
124 for (j = 7; j >= 0; j--)
125 for (i = 0; i < 8; i++)
129 for (j = 0; j < 8; j += 4)
130 for (i = 0; i < 8; i += 4)
131 decode4x4(gb, dst + j*linesize + i, linesize);
136 void *
data,
int *got_frame,
152 if (video_size < 0 || video_size > avpkt->
size - 5) {
159 if (video_type == 0 || video_type == 1) {
163 for (j = 0; j < avctx->
height; j += 8)
164 for (i = 0; i < avctx->
width; i += 8)
169 }
else if (video_type == 2) {
171 for (j = 0; j < avctx->
height; j++)
182 s->
palette[i] = 0xFFU << 24 | pal << 2 | ((pal >> 4) & 0x30303);
av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int decode_init(AVCodecContext *avctx)
uint32_t palette[AVPALETTE_COUNT]
const char * name
Name of the codec implementation.
int av_frame_ref(AVFrame *dst, AVFrame *src)
Setup a new reference to the data described by a given frame.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
bitstream reader API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Libavcodec external API header.
static void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, DSPContext *dsp)
Decode 8x8 block.
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
static int64_t video_size
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
main external API structure.
static void close(AVCodecParserContext *s)
op_fill_func fill_block_tab[2]
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int palette_has_changed
Tell user application that palette has changed from previous frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static av_cold int decode_close(AVCodecContext *avctx)
static void decode2x2(GetBitContext *gb, uint8_t *dst, int linesize)
Decode 2x2 block.
common internal api header.
static void decode4x4(GetBitContext *gb, uint8_t *dst, int linesize)
Decode 4x4 block.
#define AVERROR_INVALIDDATA
int key_frame
1 -> keyframe, 0-> not
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
8 bit with PIX_FMT_RGB32 palette
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.