Go to the documentation of this file.
23 #ifndef AVCODEC_VVC_CTU_H
24 #define AVCODEC_VVC_CTU_H
31 #define MAX_CTU_SIZE 128
33 #define MAX_CU_SIZE MAX_CTU_SIZE
36 #define MAX_CU_DEPTH 7
38 #define MAX_PARTS_IN_CTU ((MAX_CTU_SIZE >> MIN_CU_LOG2) * (MAX_CTU_SIZE >> MIN_CU_LOG2))
42 #define MAX_TB_SIZE 64
44 #define MAX_TUS_IN_CU 64
48 #define MAX_PB_SIZE 128
49 #define MAX_SCALING_RATIO 8
50 #define EDGE_EMU_BUFFER_STRIDE ((MAX_PB_SIZE + 32) * MAX_SCALING_RATIO)
52 #define CHROMA_EXTRA_BEFORE 1
53 #define CHROMA_EXTRA_AFTER 2
54 #define CHROMA_EXTRA 3
55 #define LUMA_EXTRA_BEFORE 3
56 #define LUMA_EXTRA_AFTER 4
58 #define BILINEAR_EXTRA_BEFORE 0
59 #define BILINEAR_EXTRA_AFTER 1
60 #define BILINEAR_EXTRA 1
62 #define SCALED_INT(pos) ((pos) >> 10)
64 #define MAX_CONTROL_POINTS 3
66 #define AFFINE_MIN_BLOCK_SIZE 4
68 #define MRG_MAX_NUM_CANDS 6
69 #define MAX_NUM_HMVP_CANDS 5
71 #define SAO_PADDING_SIZE 1
73 #define ALF_PADDING_SIZE 8
74 #define ALF_BLOCK_SIZE 4
76 #define ALF_BORDER_LUMA 3
77 #define ALF_BORDER_CHROMA 2
79 #define ALF_VB_POS_ABOVE_LUMA 4
80 #define ALF_VB_POS_ABOVE_CHROMA 2
82 #define ALF_GRADIENT_STEP 2
83 #define ALF_GRADIENT_BORDER 2
84 #define ALF_GRADIENT_SIZE ((MAX_CU_SIZE + ALF_GRADIENT_BORDER * 2) / ALF_GRADIENT_STEP)
91 #define SAMPLE(tab, x, y) ((tab)[(y) * s->pps->width + (x)])
92 #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
93 #define CTB(tab, x, y) ((tab)[(y) * fc->ps.pps->ctb_width + (x)])
350 #define VVC_CONTEXTS 378
421 #define BOUNDARY_LEFT_SLICE (1 << 0)
422 #define BOUNDARY_LEFT_TILE (1 << 1)
423 #define BOUNDARY_LEFT_SUBPIC (1 << 2)
424 #define BOUNDARY_UPPER_SLICE (1 << 3)
425 #define BOUNDARY_UPPER_TILE (1 << 4)
426 #define BOUNDARY_UPPER_SUBPIC (1 << 5)
490 #endif // AVCODEC_VVC_CTU_H
int mts_zero_out_sig_coeff_flag
MtsZeroOutSigCoeffFlag;.
Mv mv[2][MAX_CONTROL_POINTS]
uint8_t alf_buffer_chroma[(MAX_CTU_SIZE+2 *ALF_PADDING_SIZE) *EDGE_EMU_BUFFER_STRIDE *2]
uint8_t gpm_partition_idx
TransformUnit * head
RefStruct reference.
int16_t tmp[MAX_PB_SIZE *MAX_PB_SIZE]
int bdpcm_flag[VVC_MAX_SAMPLE_ARRAYS]
BdpcmFlag.
uint8_t ciip_tmp[MAX_PB_SIZE *MAX_PB_SIZE *2]
#define MAX_NUM_HMVP_CANDS
int mts_dc_only
MtsDcOnly.
#define ALF_GRADIENT_SIZE
uint8_t intra_mip_flag
intra_mip_flag
int offset_sign[3][4]
sao_offset_sign
#define fc(width, name, range_min, range_max)
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
ReconstructedArea ras[2][MAX_PARTS_IN_CTU]
uint8_t ctb_up_right_flag
int lfnst_zero_out_sig_coeff_flag
LfnstZeroOutSigCoeffFlag.
int y
vertical component of motion vector
int lfnst_dc_only
LfnstDcOnly.
uint8_t sao_buffer[(MAX_CTU_SIZE+2 *SAO_PADDING_SIZE) *EDGE_EMU_BUFFER_STRIDE *2]
int stat_coeff[VVC_MAX_SAMPLE_ARRAYS]
StatCoeff.
#define EDGE_EMU_BUFFER_STRIDE
int apply_lfnst_flag[VVC_MAX_SAMPLE_ARRAYS]
ApplyLfnstFlag[].
int16_t tmp1[MAX_PB_SIZE *MAX_PB_SIZE]
VVCCabacState cabac_state[VVC_CONTEXTS]
uint8_t edge_emu_buffer[EDGE_EMU_BUFFER_STRIDE *EDGE_EMU_BUFFER_STRIDE *2]
int32_t alf_gradient_tmp[ALF_GRADIENT_SIZE *ALF_GRADIENT_SIZE *ALF_NUM_DIR]
uint8_t alf_buffer_luma[(MAX_CTU_SIZE+2 *ALF_PADDING_SIZE) *EDGE_EMU_BUFFER_STRIDE *2]
int offset_abs[3][4]
sao_offset_abs
int ff_vvc_coding_tree_unit(VVCLocalContext *lc, int ctu_idx, int rs, int rx, int ry)
parse a CTU
uint8_t intra_luma_ref_idx
IntraLumaRefLineIdx[][].
void ff_vvc_ep_init_stat_coeff(EntryPoint *ep, int bit_depth, int persistent_rice_adaptation_enabled_flag)
MotionModelIdc motion_model_idc
MotionModelIdc.
uint8_t ciip_flag
ciip_flag
void ff_vvc_decode_neighbour(VVCLocalContext *lc, int x_ctb, int y_ctb, int rx, int ry, int rs)
struct CodingUnit::@284 tus
int16_t offset_val[3][5]
SaoOffsetVal.
int num_hmvp_ibc
NumHmvpIbcCand.
IntraPredMode intra_pred_mode_y
IntraPredModeY.
#define DECLARE_ALIGNED(n, t, v)
uint8_t hpel_if_idx
hpelIfIdx
uint8_t sbt_horizontal_flag
int infer_tu_cbf_luma
InferTuCbfLuma.
#define AFFINE_MIN_BLOCK_SIZE
int16_t diff_mv_x[2][AFFINE_MIN_BLOCK_SIZE *AFFINE_MIN_BLOCK_SIZE]
diffMvLX
#define MAX_CONTROL_POINTS
IntraPredMode intra_pred_mode_c
IntraPredModeC.
uint8_t hpel_if_idx
hpelIfIdx
int eo_class[3]
sao_eo_class
uint8_t ctb_cc_idc[2]
alf_ctb_cc_cb_idc, alf_ctb_cc_cr_idc
int max_y[2][VVC_MAX_REF_ENTRIES]
int x
horizontal component of motion vector
MvField hmvp[MAX_NUM_HMVP_CANDS]
HmvpCandList.
void ff_vvc_ctu_free_cus(CodingUnit **cus)
struct VVCLocalContext::@285 parse
int prev_tu_cbf_y
prevTuCbfY;
int cu_qg_top_left_x
CuQgTopLeftX.
void ff_vvc_set_neighbour_available(VVCLocalContext *lc, int x0, int y0, int w, int h)
int chroma_qp_offset[3]
CuQpOffsetCb, CuQpOffsetCr, CuQpOffsetCbCr.
int sbt_num_fourths_tb0
SbtNumFourthsTb0.
uint8_t alf_ctb_filter_alt_idx[2]
alf_ctb_filter_alt_idx[]
uint8_t inter_affine_flag
TransformUnit * tail
RefStruct reference.
enum PredMode pred_mode
PredMode.
int16_t tmp2[MAX_PB_SIZE *MAX_PB_SIZE]
uint8_t ctb_filt_set_idx_y
AlfCtbFiltSetIdxY.
uint8_t type_idx[3]
sao_type_idx
int ff_vvc_get_qPy(const VVCFrameContext *fc, int xc, int yc)
uint8_t general_merge_flag
int16_t diff_mv_y[2][AFFINE_MIN_BLOCK_SIZE *AFFINE_MIN_BLOCK_SIZE]
diffMvLX
struct CodingUnit * next
RefStruct reference.
MvField hmvp_ibc[MAX_NUM_HMVP_CANDS]
HmvpIbcCandList.
int8_t ref_idx[2]
refIdxL0, refIdxL1
int8_t ref_idx[2]
refIdxL0, refIdxL1
enum IspType isp_split_type
IntraSubPartitionsSplitType.
int mip_chroma_direct_flag
MipChromaDirectFlag.
uint8_t ctb_flag[3]
alf_ctb_flag[]
uint8_t skip_flag
cu_skip_flag;
uint8_t band_position[3]
sao_band_position
int cu_qg_top_left_y
CuQgTopLeftY.
uint8_t merge_subblock_flag
int num_intra_subpartitions
struct VVCLocalContext::@286 lmcs
int is_cu_chroma_qp_offset_coded
IsCuChromaQpOffsetCoded.
uint8_t is_cu_qp_delta_coded
IsCuQpDeltaCoded.
int8_t qp[4]
QpY, Qp′Cb, Qp′Cr, Qp′CbCr.