57 for (
i = e - 1;
i >= 0;
i--)
77 while (i < state->error_sum) {
82 ff_dlog(
NULL,
"k-overflow bias:%d error:%d drift:%d count:%d k:%d",
88 ff_dlog(
NULL,
"v:%d bias:%d error:%d drift:%d count:%d k:%d",
91 v ^= ((2 *
state->drift +
state->count) >> 31);
114 #define RENAME(name) name
120 #define RENAME(name) name ## 32
124 int w,
int h,
int stride,
int plane_index,
129 sample[0] =
s->sample_buffer + 3;
130 sample[1] =
s->sample_buffer +
w + 6 + 3;
134 memset(
s->sample_buffer, 0, 2 * (
w + 6) *
sizeof(*
s->sample_buffer));
136 for (y = 0; y <
h; y++) {
145 if (
s->avctx->bits_per_raw_sample <= 8) {
149 for (x = 0; x <
w; x++)
155 if (
s->packed_at_lsb) {
156 for (x = 0; x <
w; x++) {
160 for (x = 0; x <
w; x++) {
161 ((uint16_t*)(
src +
stride*y))[x*pixel_stride] =
sample[1][x] << (16 -
s->avctx->bits_per_raw_sample) | ((uint16_t **)
sample)[1][x] >> (2 *
s->avctx->bits_per_raw_sample - 16);
173 unsigned ps,
i, context_count;
185 if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0)
187 if (sx >
f->num_h_slices - sw || sy >
f->num_v_slices - sh)
190 fs->slice_x = sx * (
int64_t)
f->width /
f->num_h_slices;
191 fs->slice_y = sy * (
int64_t)
f->height /
f->num_v_slices;
192 fs->slice_width = (sx + sw) * (
int64_t)
f->width /
f->num_h_slices -
fs->slice_x;
193 fs->slice_height = (sy + sh) * (
int64_t)
f->height /
f->num_v_slices -
fs->slice_y;
196 (
unsigned)
fs->slice_height <=
f->height);
197 av_assert0 ( (
unsigned)
fs->slice_x + (uint64_t)
fs->slice_width <=
f->width
198 && (
unsigned)
fs->slice_y + (uint64_t)
fs->slice_height <=
f->height);
203 for (
i = 0;
i <
f->plane_count;
i++) {
206 if (idx >= (
unsigned)
f->quant_table_count) {
212 context_count =
f->context_count[idx];
223 f->cur->interlaced_frame = 1;
224 f->cur->top_field_first = 1;
225 }
else if (ps == 2) {
226 f->cur->interlaced_frame = 1;
227 f->cur->top_field_first = 0;
228 }
else if (ps == 3) {
229 f->cur->interlaced_frame = 0;
235 f->cur->sample_aspect_ratio) < 0) {
237 f->cur->sample_aspect_ratio.num,
238 f->cur->sample_aspect_ratio.den);
239 f->cur->sample_aspect_ratio = (
AVRational){ 0, 1 };
242 if (
fs->version > 3) {
245 if (
fs->slice_coding_mode != 1) {
248 if ((uint64_t)
fs->slice_rct_by_coef + (uint64_t)
fs->slice_rct_ry_coef > 4) {
267 for( si=0;
fs !=
f->slice_context[si]; si ++)
282 for (
i = 0;
i <
f->plane_count;
i++) {
288 memcpy(pdst, psrc,
sizeof(*pdst));
302 fs->slice_rct_by_coef = 1;
303 fs->slice_rct_ry_coef = 1;
305 if (
f->version > 2) {
309 fs->slice_x =
fs->slice_y =
fs->slice_height =
fs->slice_width = 0;
310 fs->slice_damaged = 1;
316 if (
f->cur->key_frame ||
fs->slice_reset_contexts) {
318 }
else if (
fs->slice_damaged) {
328 if (
f->version == 3 &&
f->micro_version > 1 ||
f->version > 3)
330 fs->ac_byte_count =
f->version > 2 || (!x && !y) ?
fs->c.bytestream -
fs->c.bytestream_start - 1 : 0;
332 fs->c.bytestream_start +
fs->ac_byte_count,
333 (
fs->c.bytestream_end -
fs->c.bytestream_start -
fs->ac_byte_count) * 8);
337 if (
f->colorspace == 0 && (
f->chroma_planes || !
fs->transparency)) {
340 const int cx = x >>
f->chroma_h_shift;
341 const int cy = y >>
f->chroma_v_shift;
344 if (
f->chroma_planes) {
348 if (
fs->transparency)
350 }
else if (
f->colorspace == 0) {
353 }
else if (
f->use32bit) {
369 v =
fs->c.bytestream_end -
fs->c.bytestream - 2 - 5*!!
f->ec;
372 fs->slice_damaged = 1;
391 for (v = 0;
i < 128; v++) {
403 for (
i = 1;
i < 128;
i++)
414 int context_count = 1;
416 for (
i = 0;
i < 5;
i++) {
420 context_count *= ret;
421 if (context_count > 32768U) {
425 return (context_count + 1) / 2;
436 memset(state2, 128,
sizeof(state2));
443 if (
f->version < 2) {
447 if (
f->version > 2) {
448 c->bytestream_end -= 4;
450 if (
f->micro_version < 0)
456 for (
i = 1;
i < 256;
i++)
466 f->plane_count = 1 + (
f->chroma_planes ||
f->version<4) +
f->transparency;
470 if (
f->chroma_h_shift > 4U ||
f->chroma_v_shift > 4U) {
472 f->chroma_h_shift,
f->chroma_v_shift);
476 if (
f->num_h_slices > (
unsigned)
f->width || !
f->num_h_slices ||
477 f->num_v_slices > (
unsigned)
f->height || !
f->num_v_slices
491 f->quant_table_count = 0;
495 for (
i = 0;
i <
f->quant_table_count;
i++) {
497 if (
f->context_count[
i] < 0) {
505 for (
i = 0;
i <
f->quant_table_count;
i++)
507 for (j = 0; j <
f->context_count[
i]; j++)
509 int pred = j ?
f->initial_states[
i][j - 1][k] : 128;
510 f->initial_states[
i][j][k] =
515 if (
f->version > 2) {
517 if (
f->micro_version > 2)
521 if (
f->version > 2) {
524 f->avctx->extradata,
f->avctx->extradata_size);
525 if (v ||
f->avctx->extradata_size < 4) {
529 crc =
AV_RB32(
f->avctx->extradata +
f->avctx->extradata_size - 4);
534 "global: ver:%d.%d, coder:%d, colorspace: %d bpr:%d chroma:%d(%d:%d), alpha:%d slices:%dx%d qtabs:%d ec:%d intra:%d CRC:0x%08X\n",
535 f->version,
f->micro_version,
538 f->avctx->bits_per_raw_sample,
539 f->chroma_planes,
f->chroma_h_shift,
f->chroma_v_shift,
541 f->num_h_slices,
f->num_v_slices,
542 f->quant_table_count,
553 int i, j, context_count = -1;
558 if (
f->version < 2) {
559 int chroma_planes, chroma_h_shift, chroma_v_shift, transparency, colorspace, bits_per_raw_sample;
569 for (
i = 1;
i < 256;
i++) {
571 if (st < 1 || st > 255) {
575 f->state_transition[
i] = st;
580 bits_per_raw_sample =
f->version > 0 ?
get_symbol(
c,
state, 0) :
f->avctx->bits_per_raw_sample;
585 if (colorspace == 0 &&
f->avctx->skip_alpha)
588 if (
f->plane_count) {
589 if (colorspace !=
f->colorspace ||
590 bits_per_raw_sample !=
f->avctx->bits_per_raw_sample ||
591 chroma_planes !=
f->chroma_planes ||
592 chroma_h_shift !=
f->chroma_h_shift ||
593 chroma_v_shift !=
f->chroma_v_shift ||
594 transparency !=
f->transparency) {
600 if (chroma_h_shift > 4U || chroma_v_shift > 4U) {
602 chroma_h_shift, chroma_v_shift);
606 f->colorspace = colorspace;
607 f->avctx->bits_per_raw_sample = bits_per_raw_sample;
608 f->chroma_planes = chroma_planes;
609 f->chroma_h_shift = chroma_h_shift;
610 f->chroma_v_shift = chroma_v_shift;
611 f->transparency = transparency;
613 f->plane_count = 2 +
f->transparency;
616 if (
f->colorspace == 0) {
617 if (!
f->transparency && !
f->chroma_planes) {
618 if (
f->avctx->bits_per_raw_sample <= 8)
620 else if (
f->avctx->bits_per_raw_sample == 9) {
621 f->packed_at_lsb = 1;
623 }
else if (
f->avctx->bits_per_raw_sample == 10) {
624 f->packed_at_lsb = 1;
626 }
else if (
f->avctx->bits_per_raw_sample == 12) {
627 f->packed_at_lsb = 1;
629 }
else if (
f->avctx->bits_per_raw_sample == 16) {
630 f->packed_at_lsb = 1;
632 }
else if (
f->avctx->bits_per_raw_sample < 16) {
636 }
else if (
f->transparency && !
f->chroma_planes) {
637 if (
f->avctx->bits_per_raw_sample <= 8)
641 }
else if (
f->avctx->bits_per_raw_sample<=8 && !
f->transparency) {
642 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
650 }
else if (
f->avctx->bits_per_raw_sample <= 8 &&
f->transparency) {
651 switch(16*
f->chroma_h_shift +
f->chroma_v_shift) {
656 }
else if (
f->avctx->bits_per_raw_sample == 9 && !
f->transparency) {
657 f->packed_at_lsb = 1;
658 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
663 }
else if (
f->avctx->bits_per_raw_sample == 9 &&
f->transparency) {
664 f->packed_at_lsb = 1;
665 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
670 }
else if (
f->avctx->bits_per_raw_sample == 10 && !
f->transparency) {
671 f->packed_at_lsb = 1;
672 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
678 }
else if (
f->avctx->bits_per_raw_sample == 10 &&
f->transparency) {
679 f->packed_at_lsb = 1;
680 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
685 }
else if (
f->avctx->bits_per_raw_sample == 12 && !
f->transparency) {
686 f->packed_at_lsb = 1;
687 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
693 }
else if (
f->avctx->bits_per_raw_sample == 14 && !
f->transparency) {
694 f->packed_at_lsb = 1;
695 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
700 }
else if (
f->avctx->bits_per_raw_sample == 16 && !
f->transparency){
701 f->packed_at_lsb = 1;
702 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
707 }
else if (
f->avctx->bits_per_raw_sample == 16 &&
f->transparency){
708 f->packed_at_lsb = 1;
709 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
715 }
else if (
f->colorspace == 1) {
716 if (
f->chroma_h_shift ||
f->chroma_v_shift) {
718 "chroma subsampling not supported in this colorspace\n");
721 if (
f->avctx->bits_per_raw_sample <= 8 && !
f->transparency)
723 else if (
f->avctx->bits_per_raw_sample <= 8 &&
f->transparency)
725 else if (
f->avctx->bits_per_raw_sample == 9 && !
f->transparency)
727 else if (
f->avctx->bits_per_raw_sample == 10 && !
f->transparency)
729 else if (
f->avctx->bits_per_raw_sample == 10 &&
f->transparency)
731 else if (
f->avctx->bits_per_raw_sample == 12 && !
f->transparency)
733 else if (
f->avctx->bits_per_raw_sample == 12 &&
f->transparency)
735 else if (
f->avctx->bits_per_raw_sample == 14 && !
f->transparency)
737 else if (
f->avctx->bits_per_raw_sample == 16 && !
f->transparency) {
741 else if (
f->avctx->bits_per_raw_sample == 16 &&
f->transparency) {
755 f->chroma_h_shift,
f->chroma_v_shift,
f->avctx->pix_fmt);
756 if (
f->version < 2) {
758 if (context_count < 0) {
762 f->slice_count =
f->max_slice_count;
763 }
else if (
f->version < 3) {
766 const uint8_t *p =
c->bytestream_end;
767 for (
f->slice_count = 0;
768 f->slice_count <
MAX_SLICES && 3 + 5*!!
f->ec < p -
c->bytestream_start;
770 int trailer = 3 + 5*!!
f->ec;
772 if (
size + trailer > p -
c->bytestream_start)
777 if (
f->slice_count > (
unsigned)
MAX_SLICES ||
f->slice_count <= 0 ||
f->slice_count >
f->max_slice_count) {
778 av_log(
f->avctx,
AV_LOG_ERROR,
"slice count %d is invalid (max=%d)\n",
f->slice_count,
f->max_slice_count);
782 for (j = 0; j <
f->slice_count; j++) {
785 fs->packed_at_lsb =
f->packed_at_lsb;
787 fs->slice_damaged = 0;
789 if (
f->version == 2) {
795 if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0)
797 if (sx >
f->num_h_slices - sw || sy >
f->num_v_slices - sh)
800 fs->slice_x = sx * (
int64_t)
f->width /
f->num_h_slices;
801 fs->slice_y = sy * (
int64_t)
f->height /
f->num_v_slices;
802 fs->slice_width = (sx + sw) * (
int64_t)
f->width /
f->num_h_slices -
fs->slice_x;
803 fs->slice_height = (sy + sh) * (
int64_t)
f->height /
f->num_v_slices -
fs->slice_y;
806 (
unsigned)
fs->slice_height <=
f->height);
807 av_assert0 ( (
unsigned)
fs->slice_x + (uint64_t)
fs->slice_width <=
f->width
808 && (
unsigned)
fs->slice_y + (uint64_t)
fs->slice_height <=
f->height);
811 for (
i = 0;
i <
f->plane_count;
i++) {
814 if (
f->version == 2) {
816 if (idx >= (
unsigned)
f->quant_table_count) {
818 "quant_table_index out of range\n");
824 context_count =
f->context_count[idx];
829 if (
f->version <= 2) {
862 int buf_size = avpkt->
size;
870 if (
f->last_picture.f)
874 f->cur = p =
f->picture.f;
895 if (!
f->key_frame_ok) {
897 "Cannot decode non-keyframe without valid keyframe\n");
908 f->version, p->
key_frame,
f->ac,
f->ec,
f->slice_count,
f->avctx->bits_per_raw_sample);
912 buf_p = buf + buf_size;
913 for (
i =
f->slice_count - 1;
i >= 0;
i--) {
915 int trailer = 3 + 5*!!
f->ec;
918 if (
i ||
f->version > 2) {
919 if (trailer > buf_p - buf) v = INT_MAX;
920 else v =
AV_RB24(buf_p-trailer) + trailer;
921 }
else v = buf_p -
c->bytestream_start;
922 if (buf_p -
c->bytestream_start < v) {
941 fs->slice_damaged = 1;
951 fs->c.bytestream_end = buf_p + v;
959 &
f->slice_context[0],
964 for (
i =
f->slice_count - 1;
i >= 0;
i--) {
967 if (
fs->slice_damaged &&
f->last_picture.f->data[0]) {
972 for (j = 0; j <
desc->nb_components; j++) {
973 int pixshift =
desc->comp[j].depth > 8;
974 int sh = (j == 1 || j == 2) ?
f->chroma_h_shift : 0;
975 int sv = (j == 1 || j == 2) ?
f->chroma_v_shift : 0;
977 (
fs->slice_y >> sv) + ((
fs->slice_x >> sh) << pixshift);
978 src[j] =
f->last_picture.f->data[j] +
f->last_picture.f->linesize[j] *
979 (
fs->slice_y >> sv) + ((
fs->slice_x >> sh) << pixshift);
985 src[1] =
f->last_picture.f->data[1];
988 f->last_picture.f->linesize,
998 if (
f->last_picture.f)
1018 fsdst->
ac = fsrc->
ac;
1021 fsdst->
ec = fsrc->
ec;
1054 memcpy(fdst,
fsrc,
sizeof(*fdst));
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
#define FF_DEBUG_PICT_INFO
static av_cold int init(AVCodecContext *avctx)
#define fs(width, name, subs,...)
#define FFSWAP(type, a, b)
#define AV_CEIL_RSHIFT(a, b)
Public header for CRC hash function implementation.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
av_cold int ff_ffv1_close(AVCodecContext *avctx)
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)
static void update_vlc_state(VlcState *const state, const int v)
#define AC_RANGE_CUSTOM_TAB
static av_always_inline int fold(int diff, int bits)
#define MAX_CONTEXT_INPUTS
static int read_header(FFV1Context *f)
static void copy_fields(FFV1Context *fsdst, FFV1Context *fssrc, FFV1Context *fsrc)
static int read_quant_tables(RangeCoder *c, int16_t quant_table[MAX_CONTEXT_INPUTS][256])
static int read_extra_header(FFV1Context *f)
static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale)
static int get_vlc_symbol(GetBitContext *gb, VlcState *const state, int bits)
static av_noinline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed)
static int decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index, int pixel_stride)
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_slice(AVCodecContext *c, void *arg)
static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
static int is_input_end(FFV1Context *s)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_always_inline int RENAME() decode_line(FFV1Context *s, int w, TYPE *sample[2], int plane_index, int bits)
static int RENAME() decode_rgb_frame(FFV1Context *s, uint8_t *src[4], int w, int h, int stride[4])
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static int get_sr_golomb(GetBitContext *gb, int k, int limit, int esc_len)
read signed golomb rice code (ffv1).
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar)
Check if the given sample aspect ratio of an image is valid.
@ AV_PICTURE_TYPE_I
Intra.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static const int16_t quant_table[64]
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
static const struct @322 planes[]
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
#define AV_PIX_FMT_0RGB32
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUV420P14
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P10
void ff_thread_report_progress(ThreadFrame *f, int n, int field)
Notify later decoding threads when part of their reference picture is ready.
FF_ENABLE_DEPRECATION_WARNINGS int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
void ff_thread_await_progress(ThreadFrame *f, int n, int field)
Wait for earlier decoding threads to finish reference pictures.
void ff_thread_finish_setup(AVCodecContext *avctx)
If the codec defines update_thread_context(), call this when they are ready for the next thread to st...
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size)
void ff_build_rac_states(RangeCoder *c, int factor, int max_p)
static int get_rac(RangeCoder *c, uint8_t *const state)
static const float pred[4]
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
enum AVFieldOrder field_order
Field order.
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
const char * name
Name of the codec implementation.
int step
Number of elements between 2 horizontally consecutive pixels.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int key_frame
1 -> keyframe, 0-> not
int top_field_first
If the content is interlaced, is top field displayed first.
int interlaced_frame
The content of the picture is interlaced.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Rational number (pair of numerator and denominator).
int ac
1=range coder <-> 0=golomb rice
struct FFV1Context * fsrc
PlaneContext plane[MAX_PLANES]
struct FFV1Context * slice_context[MAX_SLICES]
uint8_t(*[MAX_QUANT_TABLES] initial_states)[32]
int16_t quant_table[MAX_CONTEXT_INPUTS][256]
uint8_t(* state)[CONTEXT_SIZE]
#define av_malloc_array(a, b)
enum AVPictureType last_picture