72 for (j = 0; j < 2; j++)
73 memset(dst + j * linesize, v[0], 2);
78 for (j = 0; j < 2; j++)
79 for (
i = 0;
i < 2;
i++)
83 for (j = 0; j < 2; j++)
84 for (
i = 0;
i < 2;
i++)
99 for (j = 0; j < 4; j++)
100 memset(dst + j * linesize, v[0], 4);
105 for (j = 2; j >= 0; j -= 2) {
106 for (
i = 0;
i < 4;
i++)
108 for (
i = 0;
i < 4;
i++)
109 dst[(j + 1) * linesize +
i] = v[
get_bits1(gb)];
113 for (j = 0; j < 4; j += 2)
114 for (
i = 0;
i < 4;
i += 2)
115 decode2x2(gb, dst + j * linesize +
i, linesize);
135 for (j = 7; j >= 0; j--)
136 for (
i = 0;
i < 8;
i++)
140 for (j = 0; j < 8; j += 4)
141 for (
i = 0;
i < 8;
i += 4)
142 decode4x4(gb, dst + j * linesize +
i, linesize);
152 int video_size, video_type,
i, j, ret;
162 if (video_size < 0 || video_size > avpkt->
size - 5) {
167 if (video_type == 0 || video_type == 1) {
174 if (avctx->
height/8 * (avctx->
width/8) > 4 * video_size) {
179 for (j = 0; j < avctx->
height; j += 8)
180 for (
i = 0;
i < avctx->
width;
i += 8)
182 s->frame->data[0] + j *
s->frame->linesize[0] +
i,
183 s->frame->linesize[0], &
s->bdsp);
186 }
else if (video_type == 2) {
193 for (j = 0; j < avctx->
height; j++)
194 memset(
s->frame->data[0] + j *
s->frame->linesize[0],
198 "unsupported frame type %i\n", video_type);
206 s->palette[
i] = 0xFFU << 24 | pal << 2 | ((pal >> 4) & 0x30303);
209 s->palette_has_changed = 1;
213 s->frame->key_frame = 1;
215 s->frame->palette_has_changed =
s->palette_has_changed;
216 s->palette_has_changed = 0;
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
bitstream reader API header.
static unsigned int get_bits1(GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
static void decode2x2(GetBitContext *gb, uint8_t *dst, int linesize)
Decode 2x2 block.
static void decode4x4(GetBitContext *gb, uint8_t *dst, int linesize)
Decode 4x4 block.
static av_cold int decode_close(AVCodecContext *avctx)
static av_cold int decode_init(AVCodecContext *avctx)
static void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, BlockDSPContext *bdsp)
Decode 8x8 block.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ 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.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
op_fill_func fill_block_tab[2]
uint32_t palette[AVPALETTE_COUNT]