Go to the documentation of this file.
23 #ifndef AVCODEC_VVC_VVC_CTU_H
24 #define AVCODEC_VVC_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 EDGE_EMU_BUFFER_STRIDE (MAX_PB_SIZE + 32)
51 #define CHROMA_EXTRA_BEFORE 1
52 #define CHROMA_EXTRA_AFTER 2
53 #define CHROMA_EXTRA 3
54 #define LUMA_EXTRA_BEFORE 3
55 #define LUMA_EXTRA_AFTER 4
57 #define BILINEAR_EXTRA_BEFORE 0
58 #define BILINEAR_EXTRA_AFTER 1
59 #define BILINEAR_EXTRA 1
61 #define MAX_CONTROL_POINTS 3
63 #define AFFINE_MIN_BLOCK_SIZE 4
65 #define MRG_MAX_NUM_CANDS 6
66 #define MAX_NUM_HMVP_CANDS 5
68 #define SAO_PADDING_SIZE 1
70 #define ALF_PADDING_SIZE 8
71 #define ALF_BLOCK_SIZE 4
73 #define ALF_BORDER_LUMA 3
74 #define ALF_BORDER_CHROMA 2
76 #define ALF_VB_POS_ABOVE_LUMA 4
77 #define ALF_VB_POS_ABOVE_CHROMA 2
79 #define ALF_GRADIENT_STEP 2
80 #define ALF_GRADIENT_BORDER 2
81 #define ALF_GRADIENT_SIZE ((MAX_CU_SIZE + ALF_GRADIENT_BORDER * 2) / ALF_GRADIENT_STEP)
88 #define SAMPLE(tab, x, y) ((tab)[(y) * s->pps->width + (x)])
89 #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
90 #define CTB(tab, x, y) ((tab)[(y) * fc->ps.pps->ctb_width + (x)])
348 #define VVC_CONTEXTS 378
422 #define BOUNDARY_LEFT_SLICE (1 << 0)
423 #define BOUNDARY_LEFT_TILE (1 << 1)
424 #define BOUNDARY_UPPER_SLICE (1 << 2)
425 #define BOUNDARY_UPPER_TILE (1 << 3)
484 #endif // AVCODEC_VVC_VVC_CTU_H
struct CodingUnit::@220 tus
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.
int mts_dc_only
MtsDcOnly.
uint8_t intra_mip_flag
intra_mip_flag
int offset_sign[3][4]
sao_offset_sign
int ff_vvc_get_qPy(const VVCFrameContext *fc, int xc, int yc)
uint8_t edge_emu_buffer2[(MAX_PB_SIZE+7) *EDGE_EMU_BUFFER_STRIDE *2]
#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.
void ff_vvc_decode_neighbour(VVCLocalContext *lc, int x_ctb, int y_ctb, int rx, int ry, int rs)
uint8_t sao_buffer[(MAX_CTU_SIZE+2 *SAO_PADDING_SIZE) *EDGE_EMU_BUFFER_STRIDE *2]
int stat_coeff[VVC_MAX_SAMPLE_ARRAYS]
StatCoeff.
int apply_lfnst_flag[VVC_MAX_SAMPLE_ARRAYS]
ApplyLfnstFlag[].
int16_t tmp1[MAX_PB_SIZE *MAX_PB_SIZE]
struct VVCLocalContext::@222 lmcs
VVCCabacState cabac_state[VVC_CONTEXTS]
#define MAX_NUM_HMVP_CANDS
int32_t alf_gradient_tmp[ALF_GRADIENT_SIZE *ALF_GRADIENT_SIZE *ALF_NUM_DIR]
#define MAX_CONTROL_POINTS
uint8_t alf_buffer_luma[(MAX_CTU_SIZE+2 *ALF_PADDING_SIZE) *EDGE_EMU_BUFFER_STRIDE *2]
#define EDGE_EMU_BUFFER_STRIDE
int offset_abs[3][4]
sao_offset_abs
uint8_t intra_luma_ref_idx
IntraLumaRefLineIdx[][].
MotionModelIdc motion_model_idc
MotionModelIdc.
uint8_t ciip_flag
ciip_flag
int16_t offset_val[3][5]
SaoOffsetVal.
int num_hmvp_ibc
NumHmvpIbcCand.
IntraPredMode intra_pred_mode_y
IntraPredModeY.
int ff_vvc_coding_tree_unit(VVCLocalContext *lc, int ctu_idx, int rs, int rx, int ry)
parse a CTU
#define DECLARE_ALIGNED(n, t, v)
uint8_t hpel_if_idx
hpelIfIdx
#define AFFINE_MIN_BLOCK_SIZE
uint8_t sbt_horizontal_flag
int infer_tu_cbf_luma
InferTuCbfLuma.
int16_t diff_mv_x[2][AFFINE_MIN_BLOCK_SIZE *AFFINE_MIN_BLOCK_SIZE]
diffMvLX
uint8_t edge_emu_buffer[(MAX_PB_SIZE+7) *EDGE_EMU_BUFFER_STRIDE *2]
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.
uint8_t ciip_tmp2[MAX_PB_SIZE *MAX_PB_SIZE *2]
int prev_tu_cbf_y
prevTuCbfY;
int cu_qg_top_left_x
CuQgTopLeftX.
#define ALF_GRADIENT_SIZE
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
uint8_t ciip_tmp1[MAX_PB_SIZE *MAX_PB_SIZE *2]
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.
void ff_vvc_ep_init_stat_coeff(EntryPoint *ep, int bit_depth, int persistent_rice_adaptation_enabled_flag)
int mip_chroma_direct_flag
MipChromaDirectFlag.
uint8_t ctb_flag[3]
alf_ctb_flag[]
uint8_t skip_flag
cu_skip_flag;
struct VVCLocalContext::@221 parse
void ff_vvc_ctu_free_cus(CTU *ctu)
uint8_t band_position[3]
sao_band_position
int cu_qg_top_left_y
CuQgTopLeftY.
uint8_t merge_subblock_flag
int num_intra_subpartitions
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.
void ff_vvc_set_neighbour_available(VVCLocalContext *lc, int x0, int y0, int w, int h)