Go to the documentation of this file.
32 uint8_t
index[64][4] = { 0 };
33 uint8_t px[4] = { 0, 0, 0, 255 };
44 width = bytestream2_get_be32(&gb);
45 height = bytestream2_get_be32(&gb);
46 channels = bytestream2_get_byte(&gb);
47 space = bytestream2_get_byte(&gb);
71 for (
int n = 0, off_x = 0; n <
len; n +=
channels, off_x++) {
79 int chunk = bytestream2_get_byteu(&gb);
86 memcpy(px,
index[chunk], 4);
88 px[0] += ((chunk >> 4) & 0x03) - 2;
89 px[1] += ((chunk >> 2) & 0x03) - 2;
90 px[2] += ( chunk & 0x03) - 2;
92 int b2 = bytestream2_get_byteu(&gb);
93 int vg = (chunk & 0x3f) - 32;
94 px[0] += vg - 8 + ((
b2 >> 4) & 0x0f);
96 px[2] += vg - 8 + (
b2 & 0x0f);
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated space
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
This structure describes decoded (raw) audio or video data.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
const FFCodec ff_qoi_decoder
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have so the codec calls ff_thread_report set FF_CODEC_CAP_ALLOCATE_PROGRESS in FFCodec caps_internal and use ff_thread_get_buffer() to allocate frames. Otherwise decode directly into the user-supplied frames. Call ff_thread_report_progress() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
AVCodec p
The public AVCodec.
enum AVDiscard skip_frame
Skip decoding for selected frames.
static int qoi_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
@ AVDISCARD_ALL
discard all
@ AV_PICTURE_TYPE_I
Intra.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
enum AVPictureType pict_type
Picture type of the frame.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
static double b2(void *priv, double x, double y)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define QOI_COLOR_HASH(px)
main external API structure.
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
This structure stores compressed data.
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.