Go to the documentation of this file.
77 for (j = 0; j <
f->plane_count; j++) {
101 for (j = 1; j < 256; j++) {
102 sc->
c. one_state[ j] =
f->state_transition[j];
113 for (
i = 0;
i <
f->max_slice_count;
i++) {
121 int mpw = 1<<chroma_shift;
128 int mpw = 1<<chroma_shift;
131 if (
f->combined_version <= 0x40002)
132 return width * sx / num_h_slices;
134 sx = (2LL * awidth * sx + num_h_slices * mpw) / (2 * num_h_slices * mpw) * mpw;
142 int max_slice_count =
f->num_h_slices *
f->num_v_slices;
146 f->slices =
av_calloc(max_slice_count,
sizeof(*
f->slices));
150 f->max_slice_count = max_slice_count;
152 for (
int i = 0;
i < max_slice_count;
i++) {
154 int sx =
i %
f->num_h_slices;
155 int sy =
i /
f->num_h_slices;
156 int sxs =
ff_slice_coord(
f,
f->avctx->width , sx ,
f->num_h_slices,
f->chroma_h_shift);
157 int sxe =
ff_slice_coord(
f,
f->avctx->width , sx + 1,
f->num_h_slices,
f->chroma_h_shift);
158 int sys =
ff_slice_coord(
f,
f->avctx->height, sy ,
f->num_v_slices,
f->chroma_v_shift);
159 int sye =
ff_slice_coord(
f,
f->avctx->height, sy + 1,
f->num_v_slices,
f->chroma_v_shift);
187 for (
i = 0;
i <
f->quant_table_count;
i++) {
189 sizeof(*
f->initial_states[
i]));
190 if (!
f->initial_states[
i])
192 memset(
f->initial_states[
i], 128,
193 f->context_count[
i] *
sizeof(*
f->initial_states[
i]));
202 for (
i = 0;
i <
f->plane_count;
i++) {
231 for (j = 0; j <
s->max_slice_count; j++) {
242 for (j = 0; j <
s->quant_table_count; j++) {
244 for (
i = 0;
i <
s->max_slice_count;
i++) {
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
RefStruct is an API for creating reference-counted objects with minimal overhead.
uint8_t(* state)[CONTEXT_SIZE]
#define AC_RANGE_CUSTOM_TAB
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
static void planes_free(AVRefStructOpaque opaque, void *obj)
int flags
AV_CODEC_FLAG_*.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void * av_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(AVRefStructOpaque opaque, void *obj))
A wrapper around av_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
int ff_need_new_slices(int width, int num_h_slices, int chroma_shift)
int ff_ffv1_get_symbol(RangeCoder *c, uint8_t *state, int is_signed)
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
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
#define i(width, name, range_min, range_max)
#define av_malloc_array(a, b)
av_cold int ff_ffv1_common_init(AVCodecContext *avctx, FFV1Context *s)
int32_t * sample_buffer32
void * av_calloc(size_t nmemb, size_t size)
av_cold void ff_ffv1_close(FFV1Context *s)
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.
PlaneContext * ff_ffv1_planes_alloc(void)
static const struct @473 planes[]
int ff_ffv1_allocate_initial_states(FFV1Context *f)
main external API structure.
int width
picture width / height.
av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.