33 16384, 16320, 16257, 16194, 16132, 16070, 16009, 15948, 15888, 15828, 15768,
34 15709, 15650, 15592, 15534, 15477, 15420, 15364, 15308, 15252, 15197, 15142,
35 15087, 15033, 14980, 14926, 14873, 14821, 14769, 14717, 14665, 14614, 14564,
36 14513, 14463, 14413, 14364, 14315, 14266, 14218, 14170, 14122, 14075, 14028,
37 13981, 13935, 13888, 13843, 13797, 13752, 13707, 13662, 13618, 13574, 13530,
38 13487, 13443, 13400, 13358, 13315, 13273, 13231, 13190, 13148, 13107, 13066,
39 13026, 12985, 12945, 12906, 12866, 12827, 12788, 12749, 12710, 12672, 12633,
40 12596, 12558, 12520, 12483, 12446, 12409, 12373, 12336, 12300, 12264, 12228,
41 12193, 12157, 12122, 12087, 12053, 12018, 11984, 11950, 11916, 11882, 11848,
42 11815, 11782, 11749, 11716, 11683, 11651, 11619, 11586, 11555, 11523, 11491,
43 11460, 11429, 11398, 11367, 11336, 11305, 11275, 11245, 11215, 11185, 11155,
44 11125, 11096, 11067, 11038, 11009, 10980, 10951, 10923, 10894, 10866, 10838,
45 10810, 10782, 10755, 10727, 10700, 10673, 10645, 10618, 10592, 10565, 10538,
46 10512, 10486, 10460, 10434, 10408, 10382, 10356, 10331, 10305, 10280, 10255,
47 10230, 10205, 10180, 10156, 10131, 10107, 10082, 10058, 10034, 10010, 9986,
48 9963, 9939, 9916, 9892, 9869, 9846, 9823, 9800, 9777, 9754, 9732,
49 9709, 9687, 9664, 9642, 9620, 9598, 9576, 9554, 9533, 9511, 9489,
50 9468, 9447, 9425, 9404, 9383, 9362, 9341, 9321, 9300, 9279, 9259,
51 9239, 9218, 9198, 9178, 9158, 9138, 9118, 9098, 9079, 9059, 9039,
52 9020, 9001, 8981, 8962, 8943, 8924, 8905, 8886, 8867, 8849, 8830,
53 8812, 8793, 8775, 8756, 8738, 8720, 8702, 8684, 8666, 8648, 8630,
54 8613, 8595, 8577, 8560, 8542, 8525, 8508, 8490, 8473, 8456, 8439,
55 8422, 8405, 8389, 8372, 8355, 8339, 8322, 8306, 8289, 8273, 8257,
56 8240, 8224, 8208, 8192
64 return r - ((v + 1) >> 1);
88 uint8_t primary_frame, prev_frame;
89 uint32_t abs_bits, prec_bits,
round, prec_diff,
sub, mx;
92 primary_frame =
s->raw_frame_header->primary_ref_frame;
93 prev_frame =
s->raw_frame_header->ref_frame_idx[primary_frame];
102 prev_gm_param =
s->cur_frame.gm_params[
ref][idx];
104 prev_gm_param =
s->ref[prev_frame].gm_params[
ref][idx];
109 !
s->raw_frame_header->allow_high_precision_mv;
111 !
s->raw_frame_header->allow_high_precision_mv;
119 sub = (idx % 3) == 2 ? (1 << prec_bits) : 0;
121 r = (prev_gm_param >> prec_diff) -
sub;
123 s->cur_frame.gm_params[
ref][idx] =
125 -mx, mx + 1,
r) << prec_diff) +
round;
132 return ((x + ((uint64_t)1 << (n - 1))) >> n);
149 e = d - (1 << (*shift));
166 int16_t
alpha, beta, gamma,
delta, divf, divs;
168 int32_t *param = &
s->cur_frame.gm_params[idx][0];
203 for (
int i = 0;
i < 6;
i++)
204 s->cur_frame.gm_params[
ref][
i] = (
i % 3 == 2) ?
231 s->cur_frame.gm_params[
ref][4] = -
s->cur_frame.gm_params[
ref][3];
232 s->cur_frame.gm_params[
ref][5] =
s->cur_frame.gm_params[
ref][2];
246 unsigned int a,
unsigned int b)
248 unsigned int diff =
a -
b;
250 return (
diff & (m - 1)) - (
diff & m);
258 int forward_idx, backward_idx;
259 int forward_hint, backward_hint;
260 int second_forward_idx, second_forward_hint;
261 int ref_hint, dist,
i;
263 if (!
header->skip_mode_present)
269 ref_hint =
s->ref[
header->ref_frame_idx[
i]].raw_frame_header->order_hint;
272 if (forward_idx < 0 ||
275 forward_hint = ref_hint;
277 }
else if (dist > 0) {
278 if (backward_idx < 0 ||
281 backward_hint = ref_hint;
286 if (forward_idx < 0) {
288 }
else if (backward_idx >= 0) {
289 s->cur_frame.skip_mode_frame_idx[0] =
291 s->cur_frame.skip_mode_frame_idx[1] =
296 second_forward_idx = -1;
298 ref_hint =
s->ref[
header->ref_frame_idx[
i]].raw_frame_header->order_hint;
300 if (second_forward_idx < 0 ||
302 second_forward_idx =
i;
303 second_forward_hint = ref_hint;
308 if (second_forward_idx < 0)
311 s->cur_frame.skip_mode_frame_idx[0] =
313 s->cur_frame.skip_mode_frame_idx[1] =
325 s->cur_frame.coded_lossless = 0;
329 s->cur_frame.coded_lossless = 1;
333 qindex = (
header->base_q_idx +
336 qindex =
header->base_q_idx;
341 s->cur_frame.coded_lossless = 0;
357 memcpy(dst, film_grain,
sizeof(*dst));
363 memcpy(dst,
src,
sizeof(*dst));
371 s->raw_frame_header->tile_cols *
s->raw_frame_header->tile_rows;
372 if (
s->tile_num < cur_tile_num) {
380 s->tile_num = cur_tile_num;
389 uint16_t tile_num, tile_row, tile_col;
390 uint32_t
size = 0, size_bytes = 0;
395 s->tg_end = tile_group->
tg_end;
397 for (tile_num = tile_group->
tg_start; tile_num <= tile_group->tg_end; tile_num++) {
398 tile_row = tile_num /
s->raw_frame_header->tile_cols;
399 tile_col = tile_num %
s->raw_frame_header->tile_cols;
401 if (tile_num == tile_group->
tg_end) {
404 s->tile_group_info[tile_num].tile_row = tile_row;
405 s->tile_group_info[tile_num].tile_column = tile_col;
408 size_bytes =
s->raw_frame_header->tile_size_bytes_minus1 + 1;
412 for (
int i = 0;
i < size_bytes;
i++)
413 size |= bytestream2_get_byteu(&gb) << 8 *
i;
418 s->tile_group_info[tile_num].tile_size =
size;
420 s->tile_group_info[tile_num].tile_row = tile_row;
421 s->tile_group_info[tile_num].tile_column = tile_col;
437 #define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \
438 CONFIG_AV1_D3D11VA_HWACCEL * 2 + \
439 CONFIG_AV1_NVDEC_HWACCEL + \
440 CONFIG_AV1_VAAPI_HWACCEL)
504 switch (
s->pix_fmt) {
506 #if CONFIG_AV1_DXVA2_HWACCEL
509 #if CONFIG_AV1_D3D11VA_HWACCEL
513 #if CONFIG_AV1_NVDEC_HWACCEL
516 #if CONFIG_AV1_VAAPI_HWACCEL
521 #if CONFIG_AV1_DXVA2_HWACCEL
524 #if CONFIG_AV1_D3D11VA_HWACCEL
528 #if CONFIG_AV1_NVDEC_HWACCEL
531 #if CONFIG_AV1_VAAPI_HWACCEL
536 #if CONFIG_AV1_NVDEC_HWACCEL
541 #if CONFIG_AV1_NVDEC_HWACCEL
547 *fmtp++ =
s->pix_fmt;
561 " hardware accelerated AV1 decoding.\n");
574 f->hwaccel_picture_private =
NULL;
576 f->raw_frame_header =
NULL;
577 f->spatial_id =
f->temporal_id = 0;
578 memset(
f->skip_mode_frame_idx, 0,
580 memset(&
f->film_grain, 0,
sizeof(
f->film_grain));
581 f->coded_lossless = 0;
598 if (
src->hwaccel_picture_private) {
617 src->skip_mode_frame_idx,
702 int r_width =
header->render_width_minus_1 + 1;
703 int r_height =
header->render_height_minus_1 + 1;
737 if (!
s->ref[
i].tf.f) {
739 "Failed to allocate reference frame buffer %d.\n",
i);
745 if (!
s->cur_frame.tf.f) {
747 "Failed to allocate current frame buffer.\n");
755 av_opt_set_int(
s->cbc->priv_data,
"operating_point",
s->operating_point, 0);
802 f->raw_frame_header =
s->raw_frame_header;
810 switch (
header->frame_type) {
826 f->hwaccel_priv_buf =
828 if (!
f->hwaccel_priv_buf) {
832 f->hwaccel_picture_private =
f->hwaccel_priv_buf->data;
884 for (
int i = 0;
i < 24;
i++) {
887 for (
int i = 0;
i < 25;
i++) {
906 const AVFrame *srcframe =
s->cur_frame.tf.f;
910 if (
s->operating_point_idc &&
911 av_log2(
s->operating_point_idc >> 8) >
s->cur_frame.spatial_id)
942 if (
header->refresh_frame_flags & (1 <<
i)) {
943 if (
s->ref[
i].tf.f->buf[0])
947 "Failed to update frame %d in reference list\n",
i);
960 if (
s->cur_frame.tf.f->buf[0])
966 "Failed to allocate space for current frame.\n");
997 s->current_obu.nb_units);
999 for (
int i = 0;
i <
s->current_obu.nb_units;
i++) {
1010 switch (unit->
type) {
1028 s->operating_point_idc =
s->raw_seq->operating_point_idc[
s->operating_point];
1034 "Failed to get pixel format.\n");
1051 if (
s->raw_frame_header)
1064 if (!
s->header_ref) {
1074 if (
s->raw_frame_header->show_existing_frame) {
1075 if (
s->cur_frame.tf.f->buf[0])
1079 &
s->ref[
s->raw_frame_header->frame_to_show_map_idx]);
1095 s->raw_frame_header =
NULL;
1106 s->cur_frame.spatial_id =
header->spatial_id;
1107 s->cur_frame.temporal_id =
header->temporal_id;
1121 if (!
s->raw_frame_header) {
1142 "HW accel decode slice fail.\n");
1158 if (raw_tile_group && (
s->tile_num == raw_tile_group->
tg_end + 1)) {
1173 if (
s->raw_frame_header->show_frame) {
1180 raw_tile_group =
NULL;
1181 s->raw_frame_header =
NULL;
1188 s->raw_frame_header =
NULL;
1200 s->operating_point_idc = 0;
1201 s->raw_frame_header =
NULL;
1207 #define OFFSET(x) offsetof(AV1DecContext, x)
1208 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
1210 {
"operating_point",
"Select an operating point of the scalable bitstream",
1239 #if CONFIG_AV1_DXVA2_HWACCEL
1242 #if CONFIG_AV1_D3D11VA_HWACCEL
1245 #if CONFIG_AV1_D3D11VA2_HWACCEL
1248 #if CONFIG_AV1_NVDEC_HWACCEL
1251 #if CONFIG_AV1_VAAPI_HWACCEL
static void flush(AVCodecContext *avctx)
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_tell(GetByteContext *g)
int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVCodecContext *avctx)
Read the extradata bitstream found in a codec context into a fragment, then split into units and deco...
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
void ff_cbs_flush(CodedBitstreamContext *ctx)
Reset all internal state in a context.
void ff_cbs_fragment_reset(CodedBitstreamFragment *frag)
Free the units contained in a fragment as well as the fragment's own data buffer, but not the units a...
int ff_cbs_read_packet(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
Read the data bitstream from a packet into a fragment, then split into units and decompose.
int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
void ff_cbs_fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
static int FUNC() sequence_header(CodedBitstreamContext *ctx, RWContext *rw, MPEG2RawSequenceHeader *current)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static enum AVPixelFormat pix_fmt
static float sub(float src0, float src1)
AVFilmGrainParams * av_film_grain_params_create_side_data(AVFrame *frame)
Allocate a complete AVFilmGrainParams and add it to the frame.
@ AV_FILM_GRAIN_PARAMS_AV1
The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
#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_EXPORT_DATA_FILM_GRAIN
Decoding only.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_allocz(buffer_size_t size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
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.
#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.
const char * av_default_item_name(void *ptr)
Return the context name.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array through a pointer to a pointer.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_SP
Switching Predicted.
@ AV_PICTURE_TYPE_P
Predicted.
#define LIBAVUTIL_VERSION_INT
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
#define HWACCEL_DXVA2(codec)
#define HWACCEL_NVDEC(codec)
#define HWACCEL_VAAPI(codec)
#define HWACCEL_D3D11VA(codec)
#define HWACCEL_D3D11VA2(codec)
static const int16_t alpha[]
@ AV1_OBU_TEMPORAL_DELIMITER
@ AV1_OBU_REDUNDANT_FRAME_HEADER
@ AV1_OBU_SEQUENCE_HEADER
@ AV1_GM_TRANS_ONLY_PREC_BITS
@ AV1_WARP_MODEL_IDENTITY
@ AV1_MAX_OPERATING_POINTS
@ AV1_WARPEDMODEL_PREC_BITS
@ AV1_WARP_PARAM_REDUCE_BITS
@ AV1_WARP_MODEL_TRANSLATION
@ AV1_GM_ABS_TRANS_ONLY_BITS
static uint32_t decode_unsigned_subexp_with_ref(uint32_t sub_exp, int mx, int r)
static uint64_t round_two(uint64_t x, uint16_t n)
static const AVOption av1_options[]
static int av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *src)
static void av1_decode_flush(AVCodecContext *avctx)
static void coded_lossless_param(AV1DecContext *s)
static int export_film_grain(AVCodecContext *avctx, AVFrame *frame)
static int get_relative_dist(const AV1RawSequenceHeader *seq, unsigned int a, unsigned int b)
static uint8_t get_shear_params_valid(AV1DecContext *s, int idx)
check if global motion params is valid.
static int32_t decode_signed_subexp_with_ref(uint32_t sub_exp, int low, int high, int r)
static int init_tile_data(AV1DecContext *s)
static uint32_t inverse_recenter(int r, uint32_t v)
static int av1_decode_frame(AVCodecContext *avctx, void *frame, int *got_frame, AVPacket *pkt)
static void skip_mode_params(AV1DecContext *s)
static void read_global_param(AV1DecContext *s, int type, int ref, int idx)
static int update_reference_list(AVCodecContext *avctx)
static int av1_frame_alloc(AVCodecContext *avctx, AV1Frame *f)
static void global_motion_params(AV1DecContext *s)
update gm type/params, since cbs already implemented part of this funcation, so we don't need to full...
static av_cold int av1_decode_init(AVCodecContext *avctx)
static int get_pixel_format(AVCodecContext *avctx)
static int update_context_with_frame_header(AVCodecContext *avctx, const AV1RawFrameHeader *header)
static int get_current_frame(AVCodecContext *avctx)
static int set_output_frame(AVCodecContext *avctx, AVFrame *frame, const AVPacket *pkt, int *got_frame)
static int set_context_with_sequence(AVCodecContext *avctx, const AV1RawSequenceHeader *seq)
static const uint16_t div_lut[AV1_DIV_LUT_NUM]
< same with Div_Lut defined in spec 7.11.3.7
static void load_grain_params(AV1DecContext *s)
static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup *tile_group)
static const AVClass av1_class
static int16_t resolve_divisor(uint32_t d, uint16_t *shift)
Resolve divisor process.
static void av1_frame_unref(AVCodecContext *avctx, AV1Frame *f)
static int64_t round_two_signed(int64_t x, uint16_t n)
static av_cold int av1_decode_free(AVCodecContext *avctx)
#define FF_CODEC_CAP_SETS_PKT_DTS
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
#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_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
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.
static const AVProfile profiles[]
static enum AVPixelFormat pix_fmts[]
static av_always_inline av_const double round(double x)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
#define AV_PIX_FMT_YUV444P12
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
#define AV_PIX_FMT_YUV420P10
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
@ AV_PIX_FMT_D3D11VA_VLD
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_YUV444P10
const AVProfile ff_av1_profiles[]
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_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
FF_DISABLE_DEPRECATION_WARNINGS enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Wrapper around get_format() for frame-multithreaded codecs.
static const uint8_t header[24]
#define FF_ARRAY_ELEMS(a)
static int shift(int a, int b)
uint8_t gm_invalid[AV1_NUM_REF_FRAMES]
AV1RawFrameHeader * raw_frame_header
AVBufferRef * hwaccel_priv_buf
uint8_t skip_mode_frame_idx[2]
int32_t gm_params[AV1_NUM_REF_FRAMES][6]
void * hwaccel_picture_private
AV1RawFilmGrainParams film_grain
uint8_t gm_type[AV1_NUM_REF_FRAMES]
uint8_t matrix_coefficients
uint8_t chroma_sample_position
uint8_t transfer_characteristics
uint8_t ar_coeffs_y_plus_128[24]
uint8_t ar_coeff_shift_minus_6
uint8_t point_y_value[14]
uint8_t grain_scale_shift
uint8_t point_cb_scaling[10]
uint8_t film_grain_params_ref_idx
uint8_t point_cr_scaling[10]
uint8_t ar_coeffs_cr_plus_128[25]
uint8_t clip_to_restricted_range
uint8_t point_cr_value[10]
uint8_t point_cb_value[10]
uint8_t chroma_scaling_from_luma
uint8_t grain_scaling_minus_8
uint8_t point_y_scaling[14]
uint8_t ar_coeffs_cb_plus_128[25]
AV1RawTileGroup tile_group
AV1RawFrameHeader frame_header
AV1RawTileGroup tile_group
AV1RawSequenceHeader sequence_header
uint32_t num_units_in_display_tick
uint32_t num_ticks_per_picture_minus_1
uint8_t equal_picture_interval
uint8_t * data
The data buffer.
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame,...
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
const char * name
Name of the codec implementation.
This structure describes how to handle film grain synthesis for AOM codecs.
int chroma_scaling_from_luma
Signals whether to derive the chroma scaling function from the luma.
int limit_output_range
Signals to clip to limited color levels after film grain application.
int scaling_shift
Specifies the shift applied to the chroma components.
int grain_scale_shift
Signals the down shift applied to the generated gaussian numbers during synthesis.
int num_uv_points[2]
If chroma_scaling_from_luma is set to 0, signals the chroma scaling function parameters.
int overlap_flag
Signals whether to overlap film grain blocks.
int ar_coeff_lag
Specifies the auto-regression lag.
int uv_offset[2]
Offset used for component scaling function.
int ar_coeff_shift
Specifies the range of the auto-regressive coefficients.
uint8_t uv_points[2][10][2]
int8_t ar_coeffs_uv[2][25]
Chroma auto-regression coefficients.
int uv_mult[2]
Specifies the luma/chroma multipliers for the index to the component scaling function.
int8_t ar_coeffs_y[24]
Luma auto-regression coefficients.
int num_y_points
Number of points, and the scale and value for each point of the piecewise linear scaling function for...
This structure describes how to handle film grain synthesis in video for specific codecs.
enum AVFilmGrainParamsType type
Specifies the codec for which this structure is valid.
uint64_t seed
Seed to use for the synthesis process, if the codec allows for it.
union AVFilmGrainParams::@294 codec
Additional fields may be added both here and in any structure included.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int key_frame
1 -> keyframe, 0-> not
int pkt_size
size of the corresponding packet containing the compressed frame.
int64_t pkt_dts
DTS copied from the AVPacket that triggered returning this frame.
enum AVPictureType pict_type
Picture type of the frame.
int(* start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
Called at the beginning of each frame or field picture.
int(* decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
Callback for each slice.
int(* decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size)
Callback for parameter data (SPS/PPS/VPS etc).
int(* end_frame)(AVCodecContext *avctx)
Called at the end of each frame or field picture.
int frame_priv_data_size
Size of per-frame hardware accelerator private data.
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.
Rational number (pair of numerator and denominator).
Coded bitstream unit structure.
void * content
Pointer to the decomposed form of this unit.
AVBufferRef * content_ref
If content is reference counted, a reference to the buffer containing content.
uint8_t * data
Pointer to the directly-parsable bitstream form of this unit.
CodedBitstreamUnitType type
Codec-specific type of this unit.
size_t data_size
The number of bytes in the bitstream (including any padding bits in the final byte).
static int ref[MAX_W *MAX_W]
static av_always_inline int diff(const uint32_t a, const uint32_t b)