Opened 4 years ago
Last modified 3 years ago
#1430 new enhancement
Cannot set MTT depth equal to 0 in VTM (Unnecessary encoder config check?)
Reported by: | Tomohiro Ikai | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | VTM | Version: | VTM-10.0 |
Keywords: | Cc: | ksuehring, XiangLi, fbossen, jvet@… |
Description
Hi experts,
It seems we cannot set MTT depth equal to 0 in VTM with
--MaxMTTHierarchyDepth=0 --MaxMTTHierarchyDepthISliceL=0 --MaxMTTHierarchyDepthISliceC=0
Comment out the following checks resolved this issue. If the comment out is unnecessary, I'd suggest to remove it.
+#if 0
if (m_uiMaxMTTHierarchyDepthI == 0)
{
xConfirmPara(m_uiMaxBT[0] != m_uiMinQT[0], "MaxBTLumaISlice shall be equal to MinQTLumaISlice when MaxMTTHierarchyDepthISliceL is 0.");
xConfirmPara(m_uiMaxTT[0] != m_uiMinQT[0], "MaxTTLumaISlice shall be equal to MinQTLumaISlice when MaxMTTHierarchyDepthISliceL is 0.");
}
if (m_uiMaxMTTHierarchyDepthIChroma == 0)
{
xConfirmPara(m_uiMaxBT[2] != (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)), "MaxBTChromaISlice shall be equal to MinQTChromaISlice when MaxMTTHierarc\
hyDepthISliceC is 0.");
xConfirmPara(m_uiMaxTT[2] != (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)), "MaxTTChromaISlice shall be equal to MinQTChromaISlice when MaxMTTHierarc\
hyDepthISliceC is 0.");
}
if (m_uiMaxMTTHierarchyDepth == 0)
{
xConfirmPara(m_uiMaxBT[1] != m_uiMinQT[1], "MaxBTNonISlice shall be equal to MinQTNonISlice when MaxMTTHierarchyDepth is 0.");
xConfirmPara(m_uiMaxTT[1] != m_uiMinQT[1], "MaxTTNonISlice shall be equal to MinQTNonISlice when MaxMTTHierarchyDepth is 0.");
}
#endif
Without the above changes, the following error occured when MTT depth equal to 0.
Error: MaxBTChromaISlice shall be equal to MinQTChromaISlice when MaxMTTHierarchyDepthISliceC is 0.
Error: MaxTTChromaISlice shall be equal to MinQTChromaISlice when MaxMTTHierarchyDepthISliceC is 0.
Error: MaxTTNonISlice shall be equal to MinQTNonISlice when MaxMTTHierarchyDepth is 0.
Even if we fix encoder settings as below as the above error msg suggested,
--MaxBTChromaISlice=4 --MaxTTChromaISlice=4 --MaxTTNonISlice=8
We have another errors, which should be contradicted with each other.
Error: Maximum BT size for chroma block in I slice should be larger than minimum QT size
Error: Maximum TT size for chroma block in I slice should be larger than minimum QT size
If something is missed, please let me know. There could be easy way to set MTT depth equal to 0, which I couldn't find in short time.
Change history (3)
comment:1 Changed 4 years ago by XiangLi
comment:2 Changed 4 years ago by Tomohiro Ikai
Thanks for looking into the issue. Your setting works well!
Still I believe the encoder-check is not necessary and it should be removed to avoid confusions / to reduce setting's difficulty.
In the spec, If MaxMttDepthY is equal to 0, max BT size(MaxBtSizeY/MaxTtSizeY) doesn't matter (any value should be ok) in terms of 6.4.2 Allowed binary split process. And MaxBtSizeY/MaxTtSizeY has no range definition/constraint. Yes, ph_log2_diff_max_bt_min_qt_intra_slice_luma is infered to be sps_log2_diff_max_bt_min_qt_intra_slice_luma and it has a range constraint but the range is always guaranteed in my understanding*1
In the software, even if we check the range of m_uiMaxBT[0],m_uiMaxBT[2],or m_uiMaxBT[1], the values doesn't affect encoding process nor signalled in the bitstream in the case max BT/TT depth is equal to 0. To confirm, I run the software with different max BT/TT sizes, but the resulted bitstream didn't change. The encoder check was removed in the test.
In conclusion, I'd like to suggest to remove the encoder-check if someone could be confused in some cases.
*1)
ph_log2_diff_max_bt_min_qt_intra_slice_luma shall be in the range of 0 to ( sps_qtbtt_dual_tree_intra_flag ? Min( 6, CtbLog2SizeY ) : CtbLog2SizeY ) − MinQtLog2SizeIntraY
Here, MinQtLog2SizeIntraY = sps_log2_diff_min_qt_min_cb_intra_slice_luma + MinCbLog2SizeY
But the range is always guaranteed by the following.
sps_log2_diff_min_qt_min_cb_intra_slice_luma shall be in the range of 0 to Min( 6, CtbLog2SizeY ) − MinCbLog2SizeY, inclusive
comment:3 Changed 3 years ago by fbossen
- Type changed from defect to enhancement
In spec we have
When sps_log2_diff_max_bt_min_qt_intra_slice_luma is not present, the value of sps_log2_diff_max_bt_min_qt_intra_slice_luma is inferred to be equal to 0.
Therefore, when sps_max_mtt_hierarchy_depth_intra_slice_luma is 0, sps_log2_diff_max_bt_min_qt_intra_slice_luma has to be 0, which means max luma BT size needs to be equal to min luma QT size. This is the reason why we have above checking and the checking should not be disabled.
To use MTT depth zero, maybe you could try following settings
-c ..\cfg\encoder_randomaccess_vtm.cfg -c .\foreman.cfg -v 6 -dph 1 -f 1 --MaxMTTHierarchyDepth=0 --MaxMTTHierarchyDepthISliceL=0 --MaxMTTHierarchyDepthISliceC=0 --MaxBTChromaISlice=8 --MaxTTChromaISlice=8 --MaxTTNonISlice=8 --MaxBTLumaISlice=8 --MaxTTLumaISlice=8 --MaxBTNonISlice=8
Note that the unit of luma sample is used by default for chroma parameters unless there is explicit note in parameter name.