64 while (r->
sum > val && cnt < 9) {
105 v = ((v >> 1) + r->
lossy) ^ -(v & 1);
125 c = data[-stride - 1];
156 for (i = 1; i <
width; i++) {
160 data[
i] = data[i - 1] +
val;
163 for (j = 1; j <
height; j++) {
170 for (i = 1; i <
width; i++) {
186 for (y=1; y<
height; y++) {
188 memmove(data + y*stride,
189 data + y*(stride + 1),
192 memmove(data + y*stride + (width-y),
193 data + (y+1)*stride, y);
199 void *
data,
int *got_frame,
204 int buf_size = avpkt->
size;
212 #define ADVANCE_BY_DECODED do { \ 213 if (decoded < 0 || decoded >= buf_size) goto buf_too_small; \ 214 buf += decoded; buf_size -= decoded; \ 246 if (avctx->
width & 1) {
270 if (decoded < 0 || decoded > buf_size)
276 return avpkt->
size - buf_size;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static av_cold int init(AVCodecContext *avctx)
#define avpriv_request_sample(...)
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
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len)
read unsigned golomb rice code (jpegls).
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void rotate_faulty_loco(uint8_t *data, int width, int height, int stride)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static int loco_get_rice_param(RICEContext *r)
static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height, int stride, const uint8_t *buf, int buf_size)
#define FF_DEBUG_PICT_INFO
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
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
static int loco_get_rice(RICEContext *r)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static void loco_update_rice_param(RICEContext *r, int val)
static av_cold int decode_init(AVCodecContext *avctx)
int width
picture width / height.
#define AV_LOG_INFO
Standard information.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define ADVANCE_BY_DECODED
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
GLint GLenum GLboolean GLsizei stride
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
planar GBRA 4:4:4:4 32bpp
static int loco_predict(uint8_t *data, int stride)
int key_frame
1 -> keyframe, 0-> not
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 decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
static double val(void *priv, double ch)
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators...