AOMedia AV1 Codec: AV1Common Struct Reference

| AOMedia AV1 Codec

Data Fields
AV1Common Struct Reference

Top level common structure used by both encoder and decoder. More...

`#include <av1_common_int.h>`

## Data Fields
CurrentFrame | current_frame
struct aom_internal_error_info * | error
uint8_t | superres_scale_denominator
uint32_t | buffer_removal_times [(8 *4)+1]
uint32_t | frame_presentation_time
RefCntBuffer * | prev_frame
RefCntBuffer * | cur_frame
int | remapped_ref_idx [REF_FRAMES]
struct scale_factors | sf_identity
struct scale_factors | ref_scale_factors [REF_FRAMES]
RefCntBuffer * | ref_frame_map [REF_FRAMES]
int | show_frame
int | showable_frame
int | show_existing_frame
FeatureFlags | features
CommonModeInfoParams | mi_params
CommonQuantParams | quant_params
struct segmentation | seg
uint8_t * | last_frame_seg_map
CdefInfo | cdef_info
aom_film_grain_t | film_grain_params
DeltaQInfo | delta_q_info
WarpedMotionParams | global_motion [REF_FRAMES]
SequenceHeader * | seq_params
FRAME_CONTEXT * | fc
FRAME_CONTEXT * | default_frame_context
CommonTileParams | tiles
BufferPool * | buffer_pool
CommonContexts | above_contexts
TPL_MV_REF * | tpl_mvs
int | tpl_mvs_mem_size
int | ref_frame_sign_bias [REF_FRAMES]
int8_t | ref_frame_side [REF_FRAMES]
int | temporal_layer_id
int | spatial_layer_id
Coded frame dimensions.
AV1 allows two types of frame scaling operations: Frame super-resolution: that allows coding a frame at lower resolution and after decoding the frame, normatively uscales and restores the frame – inside the coding loop. Frame resize: that allows coding frame at lower/higher resolution, and then non-normatively upscale the frame at the time of rendering – outside the coding loop. Hence, the need for 3 types of dimensions.
int | width
int | height
Rendered frame dimensions.
Dimensions after applying both super-resolution and resize to the coded frame. Different from coded dimensions if super-resolution and/or resize are being used for this frame.
int | render_width
int | render_height
Super-resolved frame dimensions.
Frame dimensions after applying super-resolution to the coded frame (if present), but before applying resize. Larger than the coded dimensions if super-resolution is being used for this frame. Different from rendered dimensions if resize is being used for this frame.
int | superres_upscaled_width
int | superres_upscaled_height
Deblocking filter parameters.
loop_filter_info_n | lf_info
struct loopfilter | lf
Loop Restoration filter parameters.
RestorationInfo | rst_info [3]
int32_t * | rst_tmpbuf
RestorationLineBuffers * | rlbs
YV12_BUFFER_CONFIG | rst_frame
Signaled when cm->seq_params->frame_id_numbers_present_flag == 1
int | current_frame_id
int | ref_frame_id [REF_FRAMES]

## Detailed Description

Top level common structure used by both encoder and decoder.

## Field Documentation

## ◆ current_frame

CurrentFrame AV1Common::current_frame

Information about the current frame that is being coded.

Referenced by av1_encode_frame(), av1_rc_update_rate_correction_factors(), av1_rd_pick_inter_mode(), av1_rd_pick_partition(), av1_save_layer_context(), av1_set_reference_structure_one_pass_rt(), dynamic_resize_one_pass_cbr(), encode_b(), encode_frame_internal(), encode_frame_to_data_rate(), encode_with_recode_loop(), encode_without_recode(), find_next_key_frame(), grade_source_content_sb(), handle_inter_mode(), motion_mode_rd(), rc_pick_q_and_bounds_no_stats(), rc_pick_q_and_bounds_no_stats_cbr(), and recode_loop_update_q().

## ◆ error

struct aom_internal_error_info* AV1Common::error

Code and details about current error status.

Referenced by encode_frame_internal().

## ◆ width

int AV1Common::width

Coded frame width

Referenced by av1_rd_pick_inter_mode(), av1_restore_layer_context(), define_gf_group(), define_gf_group_pass3(), dynamic_resize_one_pass_cbr(), encode_frame_to_data_rate(), encode_without_recode(), fast_interp_search(), grade_source_content_sb(), rc_scene_detection_onepass_rt(), and recode_loop_update_q().

## ◆ height

int AV1Common::height

Coded frame height

Referenced by av1_rd_pick_inter_mode(), av1_restore_layer_context(), define_gf_group(), define_gf_group_pass3(), dynamic_resize_one_pass_cbr(), encode_frame_to_data_rate(), encode_without_recode(), fast_interp_search(), grade_source_content_sb(), rc_scene_detection_onepass_rt(), and recode_loop_update_q().

## ◆ render_width

int AV1Common::render_width

Rendered frame width

Referenced by encode_with_recode_loop_and_filter(), and rc_scene_detection_onepass_rt().

## ◆ render_height

int AV1Common::render_height

Rendered frame height

Referenced by encode_with_recode_loop_and_filter(), and rc_scene_detection_onepass_rt().

## ◆ superres_upscaled_width

int AV1Common::superres_upscaled_width

Super-resolved frame width

## ◆ superres_upscaled_height

int AV1Common::superres_upscaled_height

Super-resolved frame height

## ◆ superres_scale_denominator

uint8_t AV1Common::superres_scale_denominator

The denominator of the superres scale used by this frame. Note: The numerator is fixed to be SCALE_NUMERATOR.

Referenced by encode_with_recode_loop(), rc_pick_q_and_bounds(), and rc_pick_q_and_bounds_no_stats().

## ◆ buffer_removal_times

uint32_t AV1Common::buffer_removal_times[(8 * 4)+1]

buffer_removal_times[op_num] specifies the frame removal time in units of DecCT clock ticks counted from the removal time of the last random access point for operating point op_num. TODO(urvang): We probably don't need the +1 here.

## ◆ frame_presentation_time

uint32_t AV1Common::frame_presentation_time

Presentation time of the frame in clock ticks DispCT counted from the removal time of the last random access point for the operating point that is being decoded.

## ◆ prev_frame

RefCntBuffer* AV1Common::prev_frame

Buffer where previous frame is stored.

Referenced by encode_frame_internal().

## ◆ cur_frame

RefCntBuffer* AV1Common::cur_frame

Buffer into which the current frame will be stored and other related info. TODO(hkuang): Combine this with cur_buf in macroblockd.

Referenced by av1_encode_frame(), av1_rd_pick_inter_mode(), cdef_restoration_frame(), encode_frame_internal(), encode_frame_to_data_rate(), encode_with_recode_loop_and_filter(), loopfilter_frame(), and recode_loop_update_q().

## ◆ remapped_ref_idx

int AV1Common::remapped_ref_idx[REF_FRAMES]

For encoder, we have a two-level mapping from reference frame type to the corresponding buffer in the buffer pool:

- 'remapped_ref_idx[i - 1]' maps reference type 'i' (range: LAST_FRAME ... EXTREF_FRAME) to a remapped index 'j' (in range: 0 ... REF_FRAMES - 1)
- Later, 'cm->ref_frame_map[j]' maps the remapped index 'j' to a pointer to the reference counted buffer structure RefCntBuffer, taken from the buffer pool cm->buffer_pool->frame_bufs.

LAST_FRAME, ..., EXTREF_FRAME | | v v remapped_ref_idx[LAST_FRAME - 1], ..., remapped_ref_idx[EXTREF_FRAME - 1] | | v v ref_frame_map[], ..., ref_frame_map[]

Note: INTRA_FRAME always refers to the current frame, so there's no need to have a remapped index for the same.

## ◆ sf_identity

struct scale_factors AV1Common::sf_identity

Scale of the current frame with respect to itself. This is currently used for intra block copy, which behaves like an inter prediction mode, where the reference frame is the current frame itself.

## ◆ ref_scale_factors

struct scale_factors AV1Common::ref_scale_factors[REF_FRAMES]

Scale factors of the reference frame with respect to the current frame. This is required for generating inter prediction and will be non-identity for a reference frame, if it has different dimensions than the coded dimensions of the current frame.

## ◆ ref_frame_map

RefCntBuffer* AV1Common::ref_frame_map[REF_FRAMES]

For decoder, ref_frame_map[i] maps reference type 'i' to a pointer to the buffer in the buffer pool 'cm->buffer_pool.frame_bufs'. For encoder, ref_frame_map[j] (where j = remapped_ref_idx[i]) maps remapped reference index 'j' (that is, original reference type 'i') to a pointer to the buffer in the buffer pool 'cm->buffer_pool.frame_bufs'.

## ◆ show_frame

int AV1Common::show_frame

If true, this frame is actually shown after decoding. If false, this frame is coded in the bitstream, but not shown. It is only used as a reference for other frames coded later.

Referenced by av1_rd_pick_partition(), and encode_frame_to_data_rate().

## ◆ showable_frame

int AV1Common::showable_frame

If true, this frame can be used as a show-existing frame for other frames coded later. When 'show_frame' is true, this is always true for all non-keyframes. When 'show_frame' is false, this value is transmitted in the bitstream.

## ◆ show_existing_frame

int AV1Common::show_existing_frame

If true, show an existing frame coded before, instead of actually coding a frame. The existing frame comes from one of the existing reference buffers, as signaled in the bitstream.

## ◆ features

FeatureFlags AV1Common::features

Whether some features are allowed or not.

Referenced by av1_block_yrd(), av1_encode_frame(), av1_interpolation_filter_search(), av1_nonrd_pick_inter_mode_sb(), av1_rd_pick_inter_mode(), av1_search_intra_uv_modes_in_interframe(), encode_b(), encode_frame_internal(), encode_frame_to_data_rate(), encode_sb_row(), encode_with_recode_loop_and_filter(), fast_interp_search(), find_predictors(), loopfilter_frame(), motion_mode_rd(), process_compound_inter_mode(), and search_filter_ref().

## ◆ mi_params

CommonModeInfoParams AV1Common::mi_params

Params related to MB_MODE_INFO arrays and related info.

Referenced by av1_encode_frame(), av1_nonrd_use_partition(), av1_rd_use_partition(), encode_frame_internal(), encode_nonrd_sb(), encode_rd_sb(), encode_sb(), encode_sb_row(), handle_inter_mode(), pick_sb_modes_nonrd(), rc_scene_detection_onepass_rt(), and setup_delta_q().

## ◆ quant_params

CommonQuantParams AV1Common::quant_params

Quantization params.

Referenced by av1_handle_intra_y_mode(), av1_nonrd_use_partition(), av1_rc_update_rate_correction_factors(), cdef_restoration_frame(), encode_frame_internal(), encode_frame_to_data_rate(), encode_sb_row(), estimate_intra_mode(), and setup_delta_q().

## ◆ seg

struct segmentation AV1Common::seg

Segmentation info for current frame.

Referenced by av1_encode_frame(), av1_rd_pick_inter_mode(), encode_b(), encode_frame_internal(), encode_frame_to_data_rate(), encode_sb_row(), pick_sb_modes(), and pick_sb_modes_nonrd().

## ◆ last_frame_seg_map

uint8_t* AV1Common::last_frame_seg_map

Segmentation map for previous frame.

Referenced by encode_frame_internal(), and encode_sb_row().

## ◆ lf_info

loop_filter_info_n AV1Common::lf_info

Loop filter info

## ◆ lf

struct loopfilter AV1Common::lf

Loop filter parameters

Referenced by encode_frame_internal(), encode_frame_to_data_rate(), encode_with_recode_loop_and_filter(), and loopfilter_frame().

## ◆ rst_info

RestorationInfo AV1Common::rst_info[3]

Loop Restoration filter info

Referenced by encode_with_recode_loop_and_filter().

## ◆ rst_tmpbuf

int32_t* AV1Common::rst_tmpbuf

Scratch buffer for self-guided restoration

## ◆ rlbs

RestorationLineBuffers* AV1Common::rlbs

Line buffers needed by loop restoration

## ◆ rst_frame

YV12_BUFFER_CONFIG AV1Common::rst_frame

Stores the output of loop restoration

## ◆ cdef_info

CdefInfo AV1Common::cdef_info

CDEF (Constrained Directional Enhancement Filter) parameters.

Referenced by encode_with_recode_loop_and_filter().

## ◆ film_grain_params

aom_film_grain_t AV1Common::film_grain_params

Parameters for film grain synthesis.

## ◆ delta_q_info

DeltaQInfo AV1Common::delta_q_info

Parameters for delta quantization and delta loop filter level.

Referenced by encode_b(), encode_frame_internal(), encode_sb_row(), and setup_delta_q().

## ◆ global_motion

WarpedMotionParams AV1Common::global_motion[REF_FRAMES]

Global motion parameters for each reference frame.

## ◆ seq_params

SequenceHeader* AV1Common::seq_params

Elements part of the sequence header, that are applicable for all the frames in the video.

Referenced by av1_encode_tile(), av1_handle_intra_y_mode(), av1_interpolation_filter_search(), av1_rc_update_rate_correction_factors(), av1_rd_pick_inter_mode(), av1_rd_pick_intra_sbuv_mode(), av1_rd_pick_partition(), av1_rd_use_partition(), encode_b(), encode_frame_internal(), encode_frame_to_data_rate(), encode_nonrd_sb(), encode_rd_sb(), encode_sb_row(), encode_with_recode_loop_and_filter(), estimate_intra_mode(), fast_interp_search(), loopfilter_frame(), motion_mode_rd(), pick_sb_modes(), pick_sb_modes_nonrd(), process_compound_inter_mode(), rc_pick_q_and_bounds_no_stats(), rc_pick_q_and_bounds_no_stats_cbr(), rd_pick_intrabc_mode_sb(), recode_loop_update_q(), search_filter_ref(), and setup_delta_q().

## ◆ fc

FRAME_CONTEXT* AV1Common::fc

Current CDFs of all the symbols for the current frame.

## ◆ default_frame_context

FRAME_CONTEXT* AV1Common::default_frame_context

Default CDFs used when features.primary_ref_frame = PRIMARY_REF_NONE (e.g. for a keyframe). These default CDFs are defined by the bitstream and copied from default CDF tables for each symbol.

## ◆ tiles

CommonTileParams AV1Common::tiles

Parameters related to tiling.

Referenced by av1_encode_frame(), av1_encode_sb_row(), av1_encode_tile(), encode_frame_internal(), encode_frame_to_data_rate(), encode_rd_sb(), encode_tiles(), and loopfilter_frame().

## ◆ buffer_pool

BufferPool* AV1Common::buffer_pool

External BufferPool passed from outside.

## ◆ above_contexts

CommonContexts AV1Common::above_contexts

Above context buffers and their sizes. Note: above contexts are allocated in this struct, as their size is dependent on frame width, while left contexts are declared and allocated in MACROBLOCKD struct, as they have a fixed size.

Referenced by av1_encode_tile(), av1_nonrd_use_partition(), av1_rd_pick_partition(), and av1_rd_use_partition().

## ◆ current_frame_id

int AV1Common::current_frame_id

frame ID for the current frame.

## ◆ ref_frame_id

int AV1Common::ref_frame_id[REF_FRAMES]

frame IDs for the reference frames.

Referenced by encode_frame_to_data_rate().

## ◆ tpl_mvs

TPL_MV_REF* AV1Common::tpl_mvs

Motion vectors provided by motion field estimation. tpl_mvs[row * stride + col] stores MV for block at [mi_row, mi_col] where: mi_row = 2 * row, mi_col = 2 * col, and stride = cm->mi_params.mi_stride / 2

## ◆ tpl_mvs_mem_size

int AV1Common::tpl_mvs_mem_size

Allocated size of 'tpl_mvs' array. Refer to 'ensure_mv_buffer()' function.

## ◆ ref_frame_sign_bias

int AV1Common::ref_frame_sign_bias[REF_FRAMES]

ref_frame_sign_bias[k] is 1 if relative distance between reference 'k' and current frame is positive; and 0 otherwise.

## ◆ ref_frame_side

int8_t AV1Common::ref_frame_side[REF_FRAMES]

ref_frame_side[k] is 1 if relative distance between reference 'k' and current frame is positive, -1 if relative distance is 0; and 0 otherwise. TODO(jingning): This can be combined with sign_bias later.

## ◆ temporal_layer_id

int AV1Common::temporal_layer_id

Temporal layer ID of this frame (in the range 0 ... (number_temporal_layers - 1)).

## ◆ spatial_layer_id

int AV1Common::spatial_layer_id

Spatial layer ID of this frame (in the range 0 ... (number_spatial_layers - 1)).

Referenced by rc_scene_detection_onepass_rt().

The documentation for this struct was generated from the following file:

- av1/common/av1_common_int.h