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
229 int drift =
state->drift;
230 int count =
state->count;
237 state->error_sum >>= 1;
241 if (drift <= -count) {
244 drift =
FFMAX(drift + count, -count + 1);
245 }
else if (drift > 0) {
248 drift =
FFMIN(drift - count, 0);
251 state->drift = drift;
252 state->count = count;
272 for (
int i = e - 1;
i >= 0;
i--)
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static struct @346255127015250356166251341105367306144006377143 state
static const uint8_t bits[8]
int ff_ffv1_read_extra_header(FFV1Context *f)
int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
int ff_ffv1_init_slice_contexts(FFV1Context *f)
int ff_ffv1_common_init(AVCodecContext *avctx, FFV1Context *s)
int ff_ffv1_init_slices_state(FFV1Context *f)
void ff_ffv1_close(FFV1Context *s)
PlaneContext * ff_ffv1_planes_alloc(void)
static void update_vlc_state(VlcState *const state, const int v)
int ff_ffv1_parse_header(FFV1Context *f, RangeCoder *c, uint8_t *state)
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.
#define MAX_QUANT_TABLE_SIZE
int ff_ffv1_read_quant_tables(RangeCoder *c, int16_t quant_table[MAX_CONTEXT_INPUTS][256])
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
int ff_need_new_slices(int width, int num_h_slices, int chroma_shift)
int ff_ffv1_allocate_initial_states(FFV1Context *f)
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
void ff_ffv1_compute_bits_per_plane(const FFV1Context *f, FFV1SliceContext *sc, int bits[4], int *offset, int mask[4], int bits_per_raw_sample)
static av_always_inline int fold(int diff, int bits)
int ff_ffv1_get_symbol(RangeCoder *c, uint8_t *state, int is_signed)
#define MAX_CONTEXT_INPUTS
bitstream reader API header.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const int16_t quant_table[64]
Macro definitions for various function/variable attributes.
static const uint16_t mask[17]
static av_const int sign_extend(int val, unsigned bits)
AVPixelFormat
Pixel format.
static int get_rac(RangeCoder *c, uint8_t *const state)
Describe the class of an AVClass context structure.
main external API structure.
This structure describes decoded (raw) audio or video data.
ProgressFrame last_picture
int ac
1=range coder <-> 0=golomb rice
void * hwaccel_last_picture_private
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
enum AVPixelFormat configured_pix_fmt
void * hwaccel_picture_private
int context_count[MAX_QUANT_TABLES]
const AVFrame * cur_enc_frame
FFV1SliceContext * slices
uint8_t state_transition[256]
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE]
enum AVPixelFormat pix_fmt
uint8_t(*[MAX_QUANT_TABLES] initial_states)[32]
unsigned int fltmap32_size[4]
int ac_byte_count
number of bytes used for AC coding
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
int32_t * sample_buffer32
unsigned int fltmap_size[4]
struct FFV1SliceContext::Unit * unit[4]
uint8_t(* state)[CONTEXT_SIZE]
The ProgressFrame structure.
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)