53 if (!
s->picture.f || !
s->last_picture.f)
70 fs->plane_count =
f->plane_count;
71 fs->transparency =
f->transparency;
72 for (j = 0; j <
f->plane_count; j++) {
96 for (j = 1; j < 256; j++) {
97 fs->c. one_state[ j] =
f->state_transition[j];
98 fs->c.zero_state[256 - j] = 256 -
fs->c.one_state[j];
108 for (
i = 0;
i <
f->max_slice_count;
i++) {
118 int i, max_slice_count =
f->num_h_slices *
f->num_v_slices;
122 for (
i = 0;
i < max_slice_count;) {
123 int sx =
i %
f->num_h_slices;
124 int sy =
i /
f->num_h_slices;
125 int sxs =
f->avctx->width * sx /
f->num_h_slices;
126 int sxe =
f->avctx->width * (sx + 1) /
f->num_h_slices;
127 int sys =
f->avctx->height * sy /
f->num_v_slices;
128 int sye =
f->avctx->height * (sy + 1) /
f->num_v_slices;
134 f->slice_context[
i++] =
fs;
135 memcpy(
fs,
f,
sizeof(*
fs));
136 memset(
fs->rc_stat2, 0,
sizeof(
fs->rc_stat2));
138 fs->slice_width = sxe - sxs;
139 fs->slice_height = sye - sys;
144 sizeof(*
fs->sample_buffer));
146 sizeof(*
fs->sample_buffer32));
147 if (!
fs->sample_buffer || !
fs->sample_buffer32)
150 f->max_slice_count = max_slice_count;
154 f->max_slice_count =
i;
162 for (
i = 0;
i <
f->quant_table_count;
i++) {
164 sizeof(*
f->initial_states[
i]));
165 if (!
f->initial_states[
i])
167 memset(
f->initial_states[
i], 128,
168 f->context_count[
i] *
sizeof(*
f->initial_states[
i]));
177 for (
i = 0;
i <
f->plane_count;
i++) {
210 if (
s->last_picture.f)
214 for (j = 0; j <
s->max_slice_count; j++) {
216 for (
i = 0;
i <
s->plane_count;
i++) {
227 for (j = 0; j <
s->quant_table_count; j++) {
229 for (
i = 0;
i <
s->max_slice_count;
i++) {
236 for (
i = 0;
i <
s->max_slice_count;
i++)
Macro definitions for various function/variable attributes.
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
#define fs(width, name, subs,...)
Public header for CRC hash function implementation.
av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
av_cold int ff_ffv1_close(AVCodecContext *avctx)
av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
int ff_ffv1_allocate_initial_states(FFV1Context *f)
av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
FF Video Codec 1 (a lossless codec)
#define AC_RANGE_CUSTOM_TAB
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
common internal API header
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
main external API structure.
int width
picture width / height.
char * stats_out
pass1 encoding statistics output buffer
int flags
AV_CODEC_FLAG_*.
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
uint8_t interlace_bit_state[2]
uint8_t(* state)[CONTEXT_SIZE]
#define av_malloc_array(a, b)