Go to the documentation of this file.
23 #ifndef AVCODEC_FFV1_H
24 #define AVCODEC_FFV1_H
39 #ifdef __INTEL_COMPILER
45 #define CONTEXT_SIZE 32
47 #define MAX_QUANT_TABLES 8
48 #define MAX_QUANT_TABLE_SIZE 256
49 #define MAX_QUANT_TABLE_MASK (MAX_QUANT_TABLE_SIZE - 1)
50 #define MAX_CONTEXT_INPUTS 5
52 #define AC_GOLOMB_RICE 0
53 #define AC_RANGE_DEFAULT_TAB 1
54 #define AC_RANGE_CUSTOM_TAB 2
55 #define AC_RANGE_DEFAULT_TAB_FORCE -2
71 #define MAX_SLICES 1024
206 int drift =
state->drift;
207 int count =
state->count;
214 state->error_sum >>= 1;
218 if (drift <= -count) {
221 drift =
FFMAX(drift + count, -count + 1);
222 }
else if (drift > 0) {
225 drift =
FFMIN(drift - count, 0);
228 state->drift = drift;
229 state->count = count;
249 for (
int i = e - 1;
i >= 0;
i--)
AVPixelFormat
Pixel format.
static void update_vlc_state(VlcState *const state, const int v)
ProgressFrame last_picture
int context_count[MAX_QUANT_TABLES]
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
This structure describes decoded (raw) audio or video data.
#define MAX_QUANT_TABLE_SIZE
uint8_t(* state)[CONTEXT_SIZE]
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE]
int ff_ffv1_read_extra_header(FFV1Context *f)
int ff_ffv1_common_init(AVCodecContext *avctx, FFV1Context *s)
int ff_ffv1_get_symbol(RangeCoder *c, uint8_t *state, int is_signed)
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
static av_always_inline int fold(int diff, int bits)
int ac
1=range coder <-> 0=golomb rice
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static const int16_t quant_table[64]
void ff_ffv1_close(FFV1Context *s)
Describe the class of an AVClass context structure.
FFV1SliceContext * slices
uint8_t state_transition[256]
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
PlaneContext * ff_ffv1_planes_alloc(void)
int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
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
int ff_ffv1_init_slices_state(FFV1Context *f)
int ff_slice_coord(const FFV1Context *f, int width, int sx, int num_h_slices, int chroma_shift)
This is intended for both width and height.
uint8_t(*[MAX_QUANT_TABLES] initial_states)[32]
int ff_ffv1_allocate_initial_states(FFV1Context *f)
int ff_need_new_slices(int width, int num_h_slices, int chroma_shift)
#define i(width, name, range_min, range_max)
int32_t * sample_buffer32
static int get_rac(RangeCoder *c, uint8_t *const state)
#define MAX_CONTEXT_INPUTS
int ff_ffv1_read_quant_tables(RangeCoder *c, int16_t quant_table[MAX_CONTEXT_INPUTS][256])
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
enum AVPixelFormat pix_fmt
main external API structure.
static av_const int sign_extend(int val, unsigned bits)
int ff_ffv1_parse_header(FFV1Context *f, RangeCoder *c, uint8_t *state)
int ff_ffv1_init_slice_contexts(FFV1Context *f)
The ProgressFrame structure.
const AVFrame * cur_enc_frame
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ac_byte_count
number of bytes used for AC coding