Go to the documentation of this file.
59 c0 = bytestream2_get_byte(&qctx->
buffer);
60 c1 = bytestream2_get_byte(&qctx->
buffer);
61 run = ((
code & 0x7) << 16) + (c0 << 8) +
c1 + 2;
62 }
else if (
code >= 0xF0) {
63 c0 = bytestream2_get_byte(&qctx->
buffer);
64 run = ((
code & 0xF) << 8) + c0 + 2;
65 }
else if (
code >= 0xE0) {
67 }
else if (
code >= 0xC0) {
68 c0 = bytestream2_get_byte(&qctx->
buffer);
69 c1 = bytestream2_get_byte(&qctx->
buffer);
70 copy = ((
code & 0x3F) << 16) + (c0 << 8) +
c1 + 1;
71 }
else if (
code >= 0x80) {
72 c0 = bytestream2_get_byte(&qctx->
buffer);
73 copy = ((
code & 0x7F) << 8) + c0 + 1;
82 p = bytestream2_get_byte(&qctx->
buffer);
85 memset(dst+filled, p,
step);
88 if (filled >=
width) {
92 while (
run -
i >
width && rows_to_go > 0) {
93 memset(dst, p,
width);
110 if (filled >=
width) {
123 { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
125 { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
130 int delta,
const uint8_t *ctable,
158 int me_w, me_h, me_x, me_y;
168 corr = bytestream2_get_byte(&qctx->
buffer);
181 if ((me_x + filled < 0) || (me_x + me_w + filled >
width) ||
182 (
height - me_y - me_h < 0) || (
height - me_y >= orig_height) ||
185 me_x, me_y, me_w, me_h, filled,
height);
188 me_plane = refdata + (filled + me_x) + (
height - me_y) *
stride;
189 for(j = 0; j < me_h; j++) {
190 for(
i = 0;
i < me_w;
i++)
205 p = bytestream2_get_byte(&qctx->
buffer);
208 if(filled >=
width) {
216 }
else if(
code >= 0xC0) {
223 dst[filled++] = bytestream2_get_byte(&qctx->
buffer);
224 if(filled >=
width) {
232 }
else if(
code >= 0x80) {
239 skip = bytestream2_get_byte(&qctx->
buffer) + 64;
241 skip = bytestream2_get_byte(&qctx->
buffer) + 320;
245 while( filled >=
width) {
255 dst[filled++] = ctable[
code & 0x7F];
259 if(filled >=
width) {
269 void *
data,
int *got_frame,
279 if (avpkt->
size < 0x86) {
288 outdata = p->
data[0];
293 delta = bytestream2_get_byte(&
a->buffer);
294 intra =
delta == 0x10;
320 const uint8_t *pal_src;
327 for (
i=0;
i<pal_size/4;
i++)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
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
static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst, int stride, int width, int height, int delta, const uint8_t *ctable, uint8_t *refdata)
static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst, int stride, int width, int height)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static void decode_flush(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
int key_frame
1 -> keyframe, 0-> not
static double val(void *priv, double ch)
static const uint8_t qpeg_table_h[16]
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.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
static void flush(AVCodecContext *avctx)
@ AV_PICTURE_TYPE_I
Intra.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static const uint8_t qpeg_table_w[16]
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
enum AVPictureType pict_type
Picture type of the frame.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static void copy(const float *p1, float *p2, const int length)
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 decode_end(AVCodecContext *avctx)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
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
static av_cold int decode_init(AVCodecContext *avctx)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
int palette_has_changed
Tell user application that palette has changed from previous frame.
static int ref[MAX_W *MAX_W]
@ AV_PICTURE_TYPE_P
Predicted.
const AVCodec ff_qpeg_decoder
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
This structure stores compressed data.
int width
picture width / height.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...