目录
H265 CTU、CU、PU、TU划分的特点及要求
以下的size特指luma块的大小,min_cu_size 默认情况下= 8。
大小及划分模式
CTU size:16x16,32x32,64x64
CU size:8x8,16x16,32x32,64x64
PU size
设CU size = MxM
Intra PU:M/2 * M/2 (only when CU size reaches min_cu_size),MxM
Inter PU:支持8种划分模式
Iinter PU的限制
- The splitting into four PBs is allowed only when the CB size is equal
to the minimum allowed CB size (只有CB为最小的CB时才可以分成4个PB,由下文得知而且只有CB
大于8时才允许继续成4个PB) - The lower four partition types are only allowed when M is 16 or
larger for luma. (spec: If log2CbSize is greater than MinCbLog2SizeY
and amp_enabled_flag is equal to 1) - PBs of luma size 4×4 are not allowed for interpicture prediction, and
PBs of luma sizes 4×8 and 8×4 are restricted to unipredictive
coding.(帧间预测模式下,4x4的PB不允许,4×8 and 8×4只允许在单向预测模式下)
TU size
4x4,8x8, 16x16, 32x32
当CB大于最大TB时,隐含表示该CB需要做进一步的分隔;当CB继续分隔会小于最小TB时,隐含表示该CB不会继续作分隔。在正常范围内且划分深度小于最大划分深度时,都可选择继续划分或不划分。最大划分深度由encoder写在sps中,允许范围为[0,CtbLog2SizeY − MinTbLog2SizeY]。
此外,根据inter/intra PU的划分方式,TU存在默认划分机制(见后文中的记录),TU必须等于或小于intra PU,但可以跨越inter PU边界。
常见问题
1、Spec里对于CTU大小的规定在哪?
在“附录A Profiles, tiers and levels”中,如
Main Profile
– CtbLog2SizeY derived according to active SPSs for the base layer shall be in the range of 4 to 6, inclusive.
2、Spec对于TU大小的规定在哪?
7.4.3.2.1 General sequence parameter set RBSP semantics
log2_diff_max_min_luma_transform_block_size
The variable MaxTbLog2SizeY is set equal to log2_min_luma_transform_block_size_minus2 + 2 + log2_diff_max_min_luma_transform_block_size.
The CVS shall not contain data that result in MaxTbLog2SizeY greater than Min( CtbLog2SizeY, 5 ).
3、Spec里对于M/2*M/2的划分方式的规定在哪里?
syntax的解析过程有:
When part_mode is not present, the variables PartMode and IntraSplitFlag are derived as follows:
– PartMode is set equal to PART_2Nx2N.
– IntraSplitFlag is set equal to 0.
所以当intra,而且不是最小CB时,part_mode不存在,则默认不进行划分。Inter时,spec对其取值有限制。
The value of part_mode is restricted as follows:
– If CuPredMode[ x0 ][ y0 ] is equal to MODE_INTRA, part_mode shall be equal to 0 or 1.
– Otherwise (CuPredMode[ x0 ][ y0 ] is equal to MODE_INTER), the following applies:
– If log2CbSize is greater than MinCbLog2SizeY and amp_enabled_flag is equal to 1, part_mode shall be in the range of 0 to 2, inclusive, or in the range of 4 to 7, inclusive.
– Otherwise, if log2CbSize is greater than MinCbLog2SizeY and amp_enabled_flag is equal to 0, or log2CbSize is equal to 3, part_mode shall be in the range of 0 to 2, inclusive.
– Otherwise (log2CbSize is greater than 3 and equal to MinCbLog2SizeY), the value of part_mode shall be in the range of 0 to 3, inclusive.
下表为part_mode和IntraSplitFlag的意义
4、8x4和4x8不支持双向参考的规定在哪?
5、TU划分是如何受PU划分的影响的?TU和PU大小一样吗?
rqt_root_cbf equal to 1 specifies that the transform_tree( ) syntax structure is present for the current coding unit.
rqt_root_cbf equal to 0 specifies that the transform_tree( ) syntax structure is not present for the current coding unit.
When rqt_root_cbf is not present, its value is inferred to be equal to 1.
只有当intra为最小CB时,IntraSplitFlag才有可能等于1,此时MaxTrafoDepth = max_transform_hierarchy_depth_intra+1,允许TU的划分更进一步。
split_transform_flag表示一个block是否要分成等分的4个小块,当split_transform_flag不存在时,按如下方式取值:
When split_transform_flag[ x0 ][ y0 ][ trafoDepth ] is not present, it is inferred as follows:
– If one or more of the following conditions are true, the value of split_transform_flag[ x0 ][ y0 ][ trafoDepth ] is
inferred to be equal to 1:
– log2TrafoSize is greater than MaxTbLog2SizeY.
– IntraSplitFlag is equal to 1 and trafoDepth is equal to 0.
– interSplitFlag is equal to 1.
– Otherwise, the value of split_transform_flag[ x0 ][ y0 ][ trafoDepth ] is inferred to be equal to 0.
The variable int