59 {{1, 2, 3, 4}, {1, 2, 0, 3},
60 {1, 2, 1, 3}, {1, 2, 2, 3},
61 {1, 0, 2, 3}, {1, 0, 0, 2},
62 {1, 0, 1, 2}, {1, 1, 2, 3},
63 {0, 1, 2, 3}, {0, 1, 0, 2},
64 {1, 1, 0, 2}, {0, 1, 1, 2},
65 {0, 0, 1, 2}, {0, 0, 0, 1},
115 if (
s->num_pal_colors +
s->first_color[0] > 256 ||
116 s->num_pal_colors +
s->first_color[1] > 256) {
118 "Palette parameters invalid, header probably corrupt\n");
141 s->dstptr[0] =
s->srcptr[0];
162 if (bufptr < s->dstbuf) {
167 s->dstptr[0] = bufptr[0];
168 s->dstptr[1] = bufptr[1];
169 s->dstptr[linesize] = bufptr[linesize];
170 s->dstptr[linesize + 1] = bufptr[linesize + 1];
184 ret = *
s->low_nibble & 0xf;
185 s->low_nibble =
NULL;
187 s->low_nibble =
s->srcptr++;
188 ret = *
s->low_nibble >> 4;
198 int tag, firstcolor, is_odd_frame;
202 if (avpkt->
size < 4 + 3 *
s->num_pal_colors) {
215 s->srcptr = avpkt->
data + 4;
217 s->low_nibble =
NULL;
219 is_odd_frame = avpkt->
data[0];
224 firstcolor =
s->first_color[is_odd_frame];
227 for (
i = 0;
i <
s->num_pal_colors;
i++,
s->srcptr += 3) {
228 palette[
i + firstcolor] = (
s->srcptr[0] << 18) |
229 (
s->srcptr[1] << 10) |
231 palette[
i + firstcolor] |= 0xFFU << 24 |
232 (palette[
i + firstcolor] >> 6) & 0x30303;
237 for (y = 0; y < avctx->
height; y += 2) {
238 for (x = 0; x < avctx->
width; x += 2) {
239 if (
s->srcptr - avpkt->
data >= avpkt->
size) {
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
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)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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_ERROR
Something went wrong and cannot losslessly be recovered.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
static int copy_tag(AVIOContext *in, AVIOContext *out, int32_t tag_name)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static const int8_t motion_vector[16][2]
Lookup table for copying macroblocks.
static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static uint8_t yop_get_next_nibble(YopDecContext *s)
Return the next nibble in sequence, consuming a new byte on the input only if necessary.
static int yop_paint_block(YopDecContext *s, int linesize, int tag)
Paint a macroblock using the pattern in paint_lut.
static av_cold int yop_decode_init(AVCodecContext *avctx)
static int yop_copy_previous_block(YopDecContext *s, int linesize, int copy_tag)
Copy a previously painted macroblock to the current_block.
static const uint8_t paint_lut[15][4]
Lookup table for painting macroblocks.
static av_cold int yop_decode_close(AVCodecContext *avctx)
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.
int frame_number
Frame counter, set by libavcodec.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
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.
This structure stores compressed data.