Go to the documentation of this file.
65 while (
r->sum >
val && cnt < 9) {
100 r->save +=
r->run + 1;
106 v = ((v >> 1) +
r->lossy) ^ -(v & 1);
132 int stride,
const uint8_t *buf,
int buf_size)
164 for (j = 1; j <
height; j++) {
187 for (y=1; y<
height; y++) {
203 const uint8_t *buf = avpkt->
data;
204 int buf_size = avpkt->
size;
211 #define ADVANCE_BY_DECODED do { \
212 if (decoded < 0 || decoded >= buf_size) goto buf_too_small; \
213 buf += decoded; buf_size -= decoded; \
245 if (avctx->
width & 1) {
269 if (decoded < 0 || decoded > buf_size)
275 return avpkt->
size - buf_size;
static int get_bits_left(GetBitContext *gb)
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 int get_bits_count(const GetBitContext *s)
This structure describes decoded (raw) audio or video data.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
static int loco_get_rice(RICEContext *r)
#define FF_DEBUG_PICT_INFO
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
static double val(void *priv, double ch)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len)
read unsigned golomb rice code (jpegls).
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define ADVANCE_BY_DECODED
#define FF_CODEC_DECODE_CB(func)
int(* init)(AVBSFContext *ctx)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const FFCodec ff_loco_decoder
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define CODEC_LONG_NAME(str)
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
static int loco_predict(uint8_t *data, int stride)
static void rotate_faulty_loco(uint8_t *data, int width, int height, int stride)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
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.
static int loco_get_rice_param(RICEContext *r)
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
static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height, int stride, const uint8_t *buf, int buf_size)
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static void loco_update_rice_param(RICEContext *r, int val)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define avpriv_request_sample(...)
This structure stores compressed data.
static av_cold int decode_init(AVCodecContext *avctx)
int width
picture width / height.
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.