一个 CU 由一个亮度 CB、两个色度 CBs 和关联的语法元素构成。一个 CTB 可以只包含一个 CU,也可以包含好几个 CUs,每一个 CU
都有一个分区关联的预测单元(PU)和一个变换树单元(TU)。
coding_unit( x0, y0, log2CbSize ) {
if( transquant_bypass_enabled_flag )
cu_transquant_bypass_flag
if( slice_type != I )
cu_skip_flag[ x0 ][ y0 ]
nCbS = ( 1 << log2CbSize )
if( cu_skip_flag[ x0 ][ y0 ] )
prediction_unit( x0, y0, nCbS, nCbS )
else {
if( slice_type != I )
pred_mode_flag
if( CuPredMode[ x0 ][ y0 ] != MODE_INTRA | | log2CbSize = = MinCbLog2SizeY )
part_mode
if( CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) {
if( PartMode = = PART_2Nx2N && pcm_enabled_flag &&
log2CbSize >= Log2MinIpcmCbSizeY &&
log2CbSize <= Log2MaxIpcmCbSizeY )
pcm_flag[ x0 ][ y0 ]
if( pcm_flag[ x0 ][ y0 ] ) {
while( !byte_aligned( ) )
pcm_alignment_zero_bit
pcm_sample( x0, y0, log2CbSize )
} else {
pbOffset = ( PartMode = = PART_NxN ) ? ( nCbS / 2 ) : nCbS
for( j = 0; j < nCbS; j = j + pbOffset )
for( i = 0; i < nCbS; i = i + pbOffset )
prev_intra_luma_pred_flag[ x0 + i ][ y0 + j ]
for( j = 0; j < nCbS; j = j + pbOffset )
for( i = 0; i < nCbS; i = i + pbOffset )
if( prev_intra_luma_pred_flag[ x0 + i ][ y0 + j ] )
mpm_idx[ x0 + i ][ y0 + j ]
else
rem_intra_luma_pred_mode[ x0 + i ][ y0 + j ]
intra_chroma_pred_mode[ x0 ][ y0 ]
}
} else {
if( PartMode = = PART_2Nx2N )
prediction_unit( x0, y0, nCbS, nCbS )