Go to the documentation of this file.
60 {{1, 2, 3, 4}, {1, 2, 0, 3},
61 {1, 2, 1, 3}, {1, 2, 2, 3},
62 {1, 0, 2, 3}, {1, 0, 0, 2},
63 {1, 0, 1, 2}, {1, 1, 2, 3},
64 {0, 1, 2, 3}, {0, 1, 0, 2},
65 {1, 1, 0, 2}, {0, 1, 1, 2},
66 {0, 0, 1, 2}, {0, 0, 0, 1},
116 if (
s->num_pal_colors +
s->first_color[0] > 256 ||
117 s->num_pal_colors +
s->first_color[1] > 256) {
119 "Palette parameters invalid, header probably corrupt\n");
142 s->dstptr[0] =
s->srcptr[0];
163 if (bufptr < s->dstbuf) {
168 s->dstptr[0] = bufptr[0];
169 s->dstptr[1] = bufptr[1];
170 s->dstptr[linesize] = bufptr[linesize];
171 s->dstptr[linesize + 1] = bufptr[linesize + 1];
185 ret = *
s->low_nibble & 0xf;
186 s->low_nibble =
NULL;
188 s->low_nibble =
s->srcptr++;
189 ret = *
s->low_nibble >> 4;
199 int tag, firstcolor, is_odd_frame;
203 if (avpkt->
size < 4 + 3 *
s->num_pal_colors) {
214 s->dstbuf =
frame->data[0];
215 s->dstptr =
frame->data[0];
216 s->srcptr = avpkt->
data + 4;
218 s->low_nibble =
NULL;
220 is_odd_frame = avpkt->
data[0];
225 firstcolor =
s->first_color[is_odd_frame];
226 palette = (uint32_t *)
frame->data[1];
228 for (
i = 0;
i <
s->num_pal_colors;
i++,
s->srcptr += 3) {
229 palette[
i + firstcolor] = (
s->srcptr[0] << 18) |
230 (
s->srcptr[1] << 10) |
232 palette[
i + firstcolor] |= 0xFF
U << 24 |
233 (palette[
i + firstcolor] >> 6) & 0x30303;
236 frame->palette_has_changed = 1;
238 for (y = 0; y < avctx->
height; y += 2) {
239 for (x = 0; x < avctx->
width; x += 2) {
240 if (
s->srcptr - avpkt->
data >= avpkt->
size) {
259 s->dstptr += 2*
frame->linesize[0] - x;
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
const FFCodec ff_yop_decoder
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.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
static const uint8_t paint_lut[15][4]
Lookup table for painting macroblocks.
const uint8_t * low_nibble
AVCodec p
The public AVCodec.
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.
#define FF_CODEC_DECODE_CB(func)
static const int8_t motion_vector[16][2]
Lookup table for copying macroblocks.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
static av_cold int yop_decode_close(AVCodecContext *avctx)
static av_cold int yop_decode_init(AVCodecContext *avctx)
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define xf(width, name, var, range_min, range_max, subs,...)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
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.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
static int yop_copy_previous_block(YopDecContext *s, int linesize, int copy_tag)
Copy a previously painted macroblock to the current_block.
main external API structure.
int frame_number
Frame counter, set by libavcodec.
This structure stores compressed data.
static int yop_paint_block(YopDecContext *s, int linesize, int tag)
Paint a macroblock using the pattern in paint_lut.
int width
picture width / height.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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 yop_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
static int copy_tag(AVIOContext *in, AVIOContext *out, int32_t tag_name)