Go to the documentation of this file.
60 for (
int i = e - 1;
i >= 0;
i--)
80 while (i < state->error_sum) {
86 ff_dlog(
NULL,
"v:%d bias:%d error:%d drift:%d count:%d k:%d",
89 v ^= ((2 *
state->drift +
state->count) >> 31);
111 #define RENAME(name) name
117 #define RENAME(name) name ## 32
122 uint8_t *
src,
int w,
int h,
int stride,
int plane_index,
123 int pixel_stride,
int ac)
134 for (y = 0; y <
h; y++) {
143 if (
f->avctx->bits_per_raw_sample <= 8) {
147 for (x = 0; x <
w; x++)
153 if (
f->packed_at_lsb) {
154 for (x = 0; x <
w; x++) {
158 for (x = 0; x <
w; x++) {
159 ((uint16_t*)(
src +
stride*y))[x*pixel_stride] =
sample[1][x] << (16 -
f->avctx->bits_per_raw_sample) | ((uint16_t **)
sample)[1][x] >> (2 *
f->avctx->bits_per_raw_sample - 16);
172 unsigned ps, context_count;
184 if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0)
186 if (sx >
f->num_h_slices - sw || sy >
f->num_v_slices - sh)
202 for (
unsigned i = 0;
i <
f->plane_count;
i++) {
205 if (idx >= (
unsigned)
f->quant_table_count) {
210 context_count =
f->context_count[idx];
223 }
else if (ps == 2) {
226 }
else if (ps == 3) {
233 frame->sample_aspect_ratio) < 0) {
235 frame->sample_aspect_ratio.num,
236 frame->sample_aspect_ratio.den);
240 if (
f->version > 3) {
263 f->frame_damaged = 1;
273 const int si = sc -
f->slices;
280 if (
f->slice_damaged[si])
286 if (
f->version > 2) {
309 if (
f->version == 3 &&
f->micro_version > 1 ||
f->version > 3)
310 get_rac(&sc->
c, (uint8_t[]) { 129 });
318 if (
f->colorspace == 0 && (
f->chroma_planes || !
f->transparency)) {
321 const int cx = x >>
f->chroma_h_shift;
322 const int cy = y >>
f->chroma_v_shift;
325 if (
f->chroma_planes) {
331 }
else if (
f->colorspace == 0) {
334 }
else if (
f->use32bit) {
349 get_rac(&sc->
c, (uint8_t[]) { 129 });
374 for (v = 0;
i < 128; v++) {
386 for (
i = 1;
i < 128;
i++)
397 int context_count = 1;
399 for (
i = 0;
i < 5;
i++) {
403 context_count *=
ret;
404 if (context_count > 32768
U) {
408 return (context_count + 1) / 2;
419 memset(state2, 128,
sizeof(state2));
426 if (
f->version < 2) {
430 if (
f->version > 4) {
435 if (
f->version > 2) {
436 c.bytestream_end -= 4;
438 if (
f->micro_version < 0)
444 for (
int i = 1;
i < 256;
i++)
454 f->plane_count = 1 + (
f->chroma_planes ||
f->version<4) +
f->transparency;
458 if (
f->chroma_h_shift > 4
U ||
f->chroma_v_shift > 4
U) {
460 f->chroma_h_shift,
f->chroma_v_shift);
464 if (
f->num_h_slices > (
unsigned)
f->width || !
f->num_h_slices ||
465 f->num_v_slices > (
unsigned)
f->height || !
f->num_v_slices
479 f->quant_table_count = 0;
483 for (
int i = 0;
i <
f->quant_table_count;
i++) {
485 if (
f->context_count[
i] < 0) {
493 for (
int i = 0;
i <
f->quant_table_count;
i++)
495 for (
int j = 0; j <
f->context_count[
i]; j++)
497 int pred = j ?
f->initial_states[
i][j - 1][k] : 128;
498 f->initial_states[
i][j][k] =
503 if (
f->version > 2) {
506 f->crcref = 0x7a8c4079;
507 if (
f->micro_version > 2)
511 if (
f->version > 2) {
514 f->avctx->extradata,
f->avctx->extradata_size);
515 if (v !=
f->crcref ||
f->avctx->extradata_size < 4) {
519 crc =
AV_RB32(
f->avctx->extradata +
f->avctx->extradata_size - 4);
524 "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",
525 f->version,
f->micro_version,
528 f->avctx->bits_per_raw_sample,
529 f->chroma_planes,
f->chroma_h_shift,
f->chroma_v_shift,
531 f->num_h_slices,
f->num_v_slices,
532 f->quant_table_count,
543 int context_count = -1;
548 if (
f->version < 2) {
549 int chroma_planes, chroma_h_shift, chroma_v_shift, transparency, colorspace, bits_per_raw_sample;
559 for (
int i = 1;
i < 256;
i++) {
561 if (st < 1 || st > 255) {
565 f->state_transition[
i] = st;
570 bits_per_raw_sample =
f->version > 0 ?
get_symbol(
c,
state, 0) :
f->avctx->bits_per_raw_sample;
575 if (colorspace == 0 &&
f->avctx->skip_alpha)
578 if (
f->plane_count) {
579 if (colorspace !=
f->colorspace ||
580 bits_per_raw_sample !=
f->avctx->bits_per_raw_sample ||
581 chroma_planes !=
f->chroma_planes ||
582 chroma_h_shift !=
f->chroma_h_shift ||
583 chroma_v_shift !=
f->chroma_v_shift ||
584 transparency !=
f->transparency) {
590 if (chroma_h_shift > 4
U || chroma_v_shift > 4
U) {
592 chroma_h_shift, chroma_v_shift);
596 f->colorspace = colorspace;
597 f->avctx->bits_per_raw_sample = bits_per_raw_sample;
598 f->chroma_planes = chroma_planes;
599 f->chroma_h_shift = chroma_h_shift;
600 f->chroma_v_shift = chroma_v_shift;
601 f->transparency = transparency;
603 f->plane_count = 2 +
f->transparency;
606 if (
f->colorspace == 0) {
607 if (!
f->transparency && !
f->chroma_planes) {
608 if (
f->avctx->bits_per_raw_sample <= 8)
610 else if (
f->avctx->bits_per_raw_sample == 9) {
611 f->packed_at_lsb = 1;
613 }
else if (
f->avctx->bits_per_raw_sample == 10) {
614 f->packed_at_lsb = 1;
616 }
else if (
f->avctx->bits_per_raw_sample == 12) {
617 f->packed_at_lsb = 1;
619 }
else if (
f->avctx->bits_per_raw_sample == 14) {
620 f->packed_at_lsb = 1;
622 }
else if (
f->avctx->bits_per_raw_sample == 16) {
623 f->packed_at_lsb = 1;
625 }
else if (
f->avctx->bits_per_raw_sample < 16) {
629 }
else if (
f->transparency && !
f->chroma_planes) {
630 if (
f->avctx->bits_per_raw_sample <= 8)
634 }
else if (
f->avctx->bits_per_raw_sample<=8 && !
f->transparency) {
635 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
643 }
else if (
f->avctx->bits_per_raw_sample <= 8 &&
f->transparency) {
644 switch(16*
f->chroma_h_shift +
f->chroma_v_shift) {
649 }
else if (
f->avctx->bits_per_raw_sample == 9 && !
f->transparency) {
650 f->packed_at_lsb = 1;
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 == 10 && !
f->transparency) {
664 f->packed_at_lsb = 1;
665 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
671 }
else if (
f->avctx->bits_per_raw_sample == 10 &&
f->transparency) {
672 f->packed_at_lsb = 1;
673 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
678 }
else if (
f->avctx->bits_per_raw_sample == 12 && !
f->transparency) {
679 f->packed_at_lsb = 1;
680 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
686 }
else if (
f->avctx->bits_per_raw_sample == 12 &&
f->transparency) {
687 f->packed_at_lsb = 1;
688 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
692 }
else if (
f->avctx->bits_per_raw_sample == 14 && !
f->transparency) {
693 f->packed_at_lsb = 1;
694 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
699 }
else if (
f->avctx->bits_per_raw_sample == 16 && !
f->transparency){
700 f->packed_at_lsb = 1;
701 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
706 }
else if (
f->avctx->bits_per_raw_sample == 16 &&
f->transparency){
707 f->packed_at_lsb = 1;
708 switch(16 *
f->chroma_h_shift +
f->chroma_v_shift) {
714 }
else if (
f->colorspace == 1) {
715 if (
f->chroma_h_shift ||
f->chroma_v_shift) {
717 "chroma subsampling not supported in this colorspace\n");
720 if (
f->avctx->bits_per_raw_sample <= 8 && !
f->transparency)
722 else if (
f->avctx->bits_per_raw_sample <= 8 &&
f->transparency)
724 else if (
f->avctx->bits_per_raw_sample == 9 && !
f->transparency)
726 else if (
f->avctx->bits_per_raw_sample == 10 && !
f->transparency)
728 else if (
f->avctx->bits_per_raw_sample == 10 &&
f->transparency)
730 else if (
f->avctx->bits_per_raw_sample == 12 && !
f->transparency)
732 else if (
f->avctx->bits_per_raw_sample == 12 &&
f->transparency)
734 else if (
f->avctx->bits_per_raw_sample == 14 && !
f->transparency)
736 else if (
f->avctx->bits_per_raw_sample == 14 &&
f->transparency)
738 else if (
f->avctx->bits_per_raw_sample == 16 && !
f->transparency) {
742 else if (
f->avctx->bits_per_raw_sample == 16 &&
f->transparency) {
756 f->chroma_h_shift,
f->chroma_v_shift,
f->avctx->pix_fmt);
757 if (
f->version < 2) {
759 if (context_count < 0) {
763 f->slice_count =
f->max_slice_count;
764 }
else if (
f->version < 3) {
767 const uint8_t *p =
c->bytestream_end;
768 for (
f->slice_count = 0;
769 f->slice_count <
MAX_SLICES && 3 + 5*!!
f->ec < p -
c->bytestream_start;
771 int trailer = 3 + 5*!!
f->ec;
773 if (
size + trailer > p -
c->bytestream_start)
778 if (
f->slice_count > (
unsigned)
MAX_SLICES ||
f->slice_count <= 0 ||
f->slice_count >
f->max_slice_count) {
779 av_log(
f->avctx,
AV_LOG_ERROR,
"slice count %d is invalid (max=%d)\n",
f->slice_count,
f->max_slice_count);
785 if (!
f->slice_damaged)
788 for (
int j = 0; j <
f->slice_count; j++) {
791 if (
f->version == 2) {
797 if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0)
799 if (sx >
f->num_h_slices - sw || sy >
f->num_v_slices - sh)
818 for (
int i = 0;
i <
f->plane_count;
i++) {
821 if (
f->version == 2) {
823 if (idx >= (
unsigned)
f->quant_table_count) {
825 "quant_table_index out of range\n");
829 context_count =
f->context_count[idx];
832 if (
f->version <= 2) {
861 uint8_t *buf = avpkt->
data;
862 int buf_size = avpkt->
size;
866 uint8_t keystate = 128;
875 f->frame_damaged = 0;
886 if (!
f->key_frame_ok) {
888 "Cannot decode non-keyframe without valid keyframe\n");
895 if (buf_size < avctx->
width * avctx->
height / (128*8))
899 int s = 1 +
w / (1<<23);
906 if (buf_size < (avctx->
height +
i + 6) / 8 *
s)
933 buf_p = buf + buf_size;
934 for (
int i =
f->slice_count - 1;
i >= 0;
i--) {
936 int trailer = 3 + 5*!!
f->ec;
941 if (
i ||
f->version > 2) {
942 if (trailer > buf_p - buf) v = INT_MAX;
943 else v =
AV_RB24(buf_p-trailer) + trailer;
944 }
else v = buf_p -
c->bytestream_start;
945 if (buf_p -
c->bytestream_start < v) {
954 if (crc !=
f->crcref) {
986 for (
int i =
f->slice_count - 1;
i >= 0;
i--) {
990 const uint8_t *
src[4];
993 for (
int j = 0; j <
desc->nb_components; j++) {
994 int pixshift =
desc->comp[j].depth > 8;
995 int sh = (j == 1 || j == 2) ?
f->chroma_h_shift : 0;
996 int sv = (j == 1 || j == 2) ?
f->chroma_v_shift : 0;
999 src[j] =
f->last_picture.f->data[j] +
f->last_picture.f->linesize[j] *
1005 f->last_picture.f->linesize,
1010 f->slice_damaged[
i] = 1;
1040 fdst->
ac = fsrc->
ac;
1043 fdst->
ec = fsrc->
ec;
#define AV_PIX_FMT_YUVA422P16
void ff_progress_frame_report(ProgressFrame *f, int n)
Notify later decoding threads when part of their reference frame is ready.
static int read_extra_header(FFV1Context *f)
#define AV_PIX_FMT_GBRAP16
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_EF_EXPLODE
abort decoding on minor error detection
static void update_vlc_state(VlcState *const state, const int v)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static int get_bits_left(GetBitContext *gb)
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
static int decode_slice(AVCodecContext *c, void *arg)
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_YUVA422P9
static int get_sr_golomb(GetBitContext *gb, int k, int limit, int esc_len)
read signed golomb rice code (ffv1).
This structure describes decoded (raw) audio or video data.
av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P10
enum AVFieldOrder field_order
Field order.
static int decode_plane(FFV1Context *f, FFV1SliceContext *sc, GetBitContext *gb, uint8_t *src, int w, int h, int stride, int plane_index, int pixel_stride, int ac)
int ff_progress_frame_get_buffer(AVCodecContext *avctx, ProgressFrame *f, int flags)
This function sets up the ProgressFrame, i.e.
int step
Number of elements between 2 horizontally consecutive pixels.
#define AV_PIX_FMT_YUV420P10
uint8_t(* state)[CONTEXT_SIZE]
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale)
static av_always_inline int RENAME() decode_line(FFV1Context *f, FFV1SliceContext *sc, GetBitContext *gb, int w, TYPE *sample[2], int plane_index, int bits, int ac)
#define AC_RANGE_CUSTOM_TAB
#define AV_PIX_FMT_YUVA422P10
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE]
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
#define FF_DEBUG_PICT_INFO
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
#define AV_PIX_FMT_YUVA420P9
@ AV_FIELD_TT
Top coded_first, top displayed first.
AVCodec p
The public AVCodec.
#define AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUVA444P16
static av_cold int ffv1_decode_close(AVCodecContext *avctx)
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_GRAY16
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
@ AV_FIELD_TB
Top coded first, bottom displayed first.
static int RENAME() decode_rgb_frame(FFV1Context *f, FFV1SliceContext *sc, GetBitContext *gb, uint8_t *src[4], int w, int h, int stride[4])
#define AV_PIX_FMT_YUV444P10
#define FF_CODEC_CAP_USES_PROGRESSFRAMES
The decoder might make use of the ProgressFrame API.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PIX_FMT_YUV422P16
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define AV_PIX_FMT_GBRAP10
#define FF_CODEC_DECODE_CB(func)
#define AV_PIX_FMT_GBRAP14
#define AV_PIX_FMT_GBRAP12
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define AV_PIX_FMT_YUV444P16
#define AV_CEIL_RSHIFT(a, b)
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
static double av_q2d(AVRational a)
Convert an AVRational to a double.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int is_input_end(RangeCoder *c, GetBitContext *gb, int ac)
#define AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUV420P9
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int read_quant_tables(RangeCoder *c, int16_t quant_table[MAX_CONTEXT_INPUTS][256])
#define AV_PIX_FMT_YUV420P16
void ff_progress_frame_unref(ProgressFrame *f)
Give up a reference to the underlying frame contained in a ProgressFrame and reset the ProgressFrame,...
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before ff_progress_frame_await() has been called on them. reget_buffer() and buffer age optimizations no longer work. *The contents of buffers must not be written to after ff_progress_frame_report() has been called on them. This includes draw_edges(). Porting codecs to frame threading
#define AV_PIX_FMT_GRAY14
static av_always_inline int fold(int diff, int bits)
int ac
1=range coder <-> 0=golomb rice
static int get_vlc_symbol(GetBitContext *gb, VlcState *const state, int bits)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define CODEC_LONG_NAME(str)
#define AV_PIX_FMT_GRAY10
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
static const int16_t quant_table[64]
#define AV_PIX_FMT_GBRP16
static const struct @465 planes[]
static int read_header(FFV1Context *f)
static av_noinline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Rational number (pair of numerator and denominator).
@ AV_PICTURE_TYPE_I
Intra.
const FFCodec ff_ffv1_decoder
FFV1SliceContext * slices
uint8_t state_transition[256]
#define AV_PIX_FMT_YUV440P10
static void * ff_refstruct_allocz(size_t size)
Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL)
#define UPDATE_THREAD_CONTEXT(func)
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
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
av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size)
enum AVPictureType pict_type
Picture type of the frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define AV_PIX_FMT_YUV422P12
av_cold int ff_ffv1_close(AVCodecContext *avctx)
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed.
void ff_build_rac_states(RangeCoder *c, int factor, int max_p)
#define AV_NOPTS_VALUE
Undefined timestamp value.
static void slice_set_damaged(FFV1Context *f, FFV1SliceContext *sc)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
#define AV_PIX_FMT_YUV444P12
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
#define AV_PIX_FMT_YUVA444P10
av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1SliceContext *sc)
#define FF_THREAD_FRAME
Decode more than one frame at once.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_PIX_FMT_GBRP12
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
const char * name
Name of the codec implementation.
static int get_rac(RangeCoder *c, uint8_t *const state)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
#define AV_PIX_FMT_YUV444P9
#define MAX_CONTEXT_INPUTS
static const float pred[4]
#define FFSWAP(type, a, b)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_PIX_FMT_0RGB32
static int decode_slice_header(const FFV1Context *f, FFV1SliceContext *sc, AVFrame *frame)
#define AV_PIX_FMT_YUVA444P9
void ff_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call ff_thread_finish_setup() afterwards. If some code can 't be moved
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 AV_PIX_FMT_YUV420P12
PlaneContext * ff_ffv1_planes_alloc(void)
void ff_progress_frame_replace(ProgressFrame *dst, const ProgressFrame *src)
Do nothing if dst and src already refer to the same AVFrame; otherwise unreference dst and if src is ...
#define AV_PIX_FMT_YUV422P14
int ff_ffv1_allocate_initial_states(FFV1Context *f)
main external API structure.
uint8_t * bytestream_start
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.
static av_cold int decode_init(AVCodecContext *avctx)
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
#define AV_PIX_FMT_YUVA422P12
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have update_thread_context() run it in the next thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. Use ff_thread_get_buffer()(or ff_progress_frame_get_buffer() in case you have inter-frame dependencies and use the ProgressFrame API) to allocate frame buffers. Call ff_progress_frame_report() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static void scale(int *out, const int *in, const int w, const int h, const int shift)
The ProgressFrame structure.
This structure stores compressed data.
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
int width
picture width / height.
av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
const uint8_t ff_log2_run[41]
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV444P14
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.
#define AV_PIX_FMT_GRAY12
void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], const uint8_t *const 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 ac_byte_count
number of bytes used for AC coding
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_PIX_FMT_YUV420P14