23 #ifndef AVCODEC_FFV1_H
24 #define AVCODEC_FFV1_H
34 #define CONTEXT_SIZE 32
36 #define MAX_QUANT_TABLES 8
37 #define MAX_CONTEXT_INPUTS 5
63 #define MAX_SLICES 256
123 diff += 1 << (bits - 1);
124 diff &= (1 <<
bits) - 1;
125 diff -= 1 << (bits - 1);
131 static inline int predict(int16_t *src, int16_t *last)
133 const int LT = last[-1];
134 const int T = last[0];
135 const int L = src[-1];
141 int16_t *last, int16_t *last2)
143 const int LT = last[-1];
144 const int T = last[0];
145 const int RT = last[1];
146 const int L = src[-1];
149 const int TT = last2[0];
150 const int LL = src[-2];
164 int drift = state->
drift;
165 int count = state->
count;
176 if (drift <= -count) {
177 if (state->
bias > -128)
183 }
else if (drift > 0) {
184 if (state->
bias < 127)
192 state->
drift = drift;
193 state->
count = count;
static av_always_inline int fold(int diff, int bits)
This structure describes decoded (raw) audio or video data.
int ffv1_close(AVCodecContext *avctx)
int16_t quant_table[MAX_CONTEXT_INPUTS][256]
#define MAX_CONTEXT_INPUTS
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
const int8_t ffv1_quant11[256]
uint8_t(*[MAX_QUANT_TABLES] initial_states)[32]
bitstream reader API header.
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][256]
static int predict(int16_t *src, int16_t *last)
const uint8_t ff_log2_run[41]
const int8_t ffv1_quant5_10bit[256]
int16_t quant_table[MAX_CONTEXT_INPUTS][256]
uint8_t state_transition[256]
static int get_context(PlaneContext *p, int16_t *src, int16_t *last, int16_t *last2)
static void update_vlc_state(VlcState *const state, const int v)
int context_count[MAX_QUANT_TABLES]
Libavcodec external API header.
void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
main external API structure.
int ffv1_common_init(AVCodecContext *avctx)
int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
Describe the class of an AVClass context structure.
int ffv1_init_slice_contexts(FFV1Context *f)
const uint8_t ffv1_ver2_state[256]
const int8_t ffv1_quant5[256]
const int8_t ffv1_quant9_10bit[256]
uint8_t(* state)[CONTEXT_SIZE]
PlaneContext plane[MAX_PLANES]
int ffv1_allocate_initial_states(FFV1Context *f)
struct FFV1Context * slice_context[MAX_SLICES]
uint8_t interlace_bit_state[2]