Go to the documentation of this file.
26 #ifndef AVCODEC_VP56_H
27 #define AVCODEC_VP56_H
73 #define VP56_SIZE_CHANGE 1
78 int offset1,
int offset2, ptrdiff_t
stride,
224 int flip,
int has_alpha);
243 if (
c->end <=
c->buffer &&
c->bits >= 0)
245 return c->end_reached > 10;
252 unsigned int code_word =
c->code_word;
257 if(
bits >= 0 &&
c->buffer <
c->end) {
258 code_word |= bytestream_get_be16(&
c->buffer) <<
bits;
271 #ifndef vp56_rac_get_prob
272 #define vp56_rac_get_prob vp56_rac_get_prob
276 unsigned int low = 1 + (((
c->high - 1) *
prob) >> 8);
277 unsigned int low_shift = low << 16;
278 int bit = code_word >= low_shift;
280 c->high =
bit ?
c->high - low : low;
281 c->code_word =
bit ? code_word - low_shift : code_word;
287 #ifndef vp56_rac_get_prob_branchy
292 unsigned low = 1 + (((
c->high - 1) *
prob) >> 8);
293 unsigned low_shift = low << 16;
295 if (code_word >= low_shift) {
297 c->code_word = code_word - low_shift;
302 c->code_word = code_word;
311 int low = (
c->high + 1) >> 1;
312 unsigned int low_shift = low << 16;
313 int bit = code_word >= low_shift;
316 code_word -= low_shift;
321 c->code_word = code_word;
385 const uint8_t *probs)
387 while (tree->
val > 0) {
399 const uint8_t *probs)
H264ChromaContext h264chroma
static av_always_inline int vp56_rac_get(VP56RangeCoder *c)
int16_t block_coeff[6][64]
int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s, int flip, int has_alpha)
Initializes an VP56Context.
static av_always_inline int vp8_rac_get_coeff(VP56RangeCoder *c, const uint8_t *prob)
@ VP56_MB_INTER_DELTA_GF
Inter MB, above/left vector + delta, from golden frame.
static av_always_inline int vpX_rac_is_end(VP56RangeCoder *c)
vp5689 returns 1 if the end of the stream has been reached, 0 otherwise.
int(* VP56ParseHeader)(VP56Context *s, const uint8_t *buf, int buf_size)
uint8_t mb_types_stats[3][10][2]
uint8_t coeff_acct[2][3][3][6][5]
@ VP56_MB_INTER_V2_GF
Inter MB, second vector, from golden frame.
static const int8_t mv[256][2]
void(* VP56Filter)(VP56Context *s, uint8_t *dst, uint8_t *src, int offset1, int offset2, ptrdiff_t stride, VP56mv mv, int mask, int select, int luma)
This structure describes decoded (raw) audio or video data.
VP56mv vector_candidate[2]
uint8_t * edge_emu_buffer_alloc
uint8_t * edge_emu_buffer
uint8_t coeff_index_to_pos[64]
VP56ParseCoeff parse_coeff
uint8_t coeff_ract[2][3][6][11]
static av_unused int vp56_rac_gets_nn(VP56RangeCoder *c, int bits)
static av_unused int vp8_rac_get_nn(VP56RangeCoder *c)
#define bit(string, value)
int(* VP56ParseCoeffModels)(VP56Context *s)
static av_always_inline int vp56_rac_get_prob_branchy(VP56RangeCoder *c, int prob)
void(* VP56ParseVectorAdjustment)(VP56Context *s, VP56mv *vect)
static av_always_inline int vp8_rac_get(VP56RangeCoder *c)
@ VP56_MB_INTER_NOVEC_PF
Inter MB, no vector, from previous frame.
static av_unused int vp8_rac_get_sint(VP56RangeCoder *c, int bits)
@ VP56_MB_INTER_V1_PF
Inter MB, first vector, from previous frame.
int(* VP56ParseCoeff)(VP56Context *s)
uint8_t mb_type[3][10][10]
static const uint16_t mask[17]
@ VP56_MB_INTER_4V
Inter MB, 4 vectors, from previous frame.
unsigned int nb_null[2][2]
static int vp56_rac_gets(VP56RangeCoder *c, int bits)
uint8_t coeff_dccv[2][11]
uint8_t coeff_dcct[2][36][5]
uint8_t coeff_runv[2][14]
void(* VP56DefaultModelsInit)(VP56Context *s)
static int vp8_rac_get_uint(VP56RangeCoder *c, int bits)
@ VP56_MB_INTER_DELTA_PF
Inter MB, above/left vector + delta, from previous frame.
static av_always_inline int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t(*tree)[2], const uint8_t *probs)
@ VP56_MB_INTER_NOVEC_GF
Inter MB, no vector, from golden frame.
@ VP56_MB_INTER_V2_PF
Inter MB, second vector, from previous frame.
VP56Context * alpha_context
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
VP56DefaultModelsInit default_models_init
static void flip(AVCodecContext *avctx, AVFrame *frame)
int sample_variance_threshold
static av_always_inline int vp56_rac_get_tree(VP56RangeCoder *c, const VP56Tree *tree, const uint8_t *probs)
void(* VP56ParseVectorModels)(VP56Context *s)
int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size)
uint8_t coeff_index_to_idct_selector[64]
@ VP56_MB_INTER_V1_GF
Inter MB, first vector, from golden frame.
#define DECLARE_ALIGNED(n, t, v)
#define i(width, name, range_min, range_max)
void ff_vp56_init_dequant(VP56Context *s, int quantizer)
VP56ParseHeader parse_header
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
VP56Macroblock * macroblocks
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define prob(name, subs,...)
uint8_t idct_scantable[64]
main external API structure.
static int shift(int a, int b)
#define vp56_rac_get_prob
int bounding_values_array[256]
int ff_vp56_free_context(VP56Context *s)
This structure stores compressed data.
const uint8_t ff_vp56_norm_shift[256]
vp56 specific range coder implementation
int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
VP56ParseCoeffModels parse_coeff_models
VP56ParseVectorModels parse_vector_models
uint8_t coeff_ctx_last[4]
const uint8_t * vp56_coord_div
static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c)
uint8_t coeff_reorder[64]
VP56ParseVectorAdjustment parse_vector_adjustment