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.
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.
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 FF_CODEC_DECODE_CB(func)
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
#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
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
@ 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.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#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.