Commit 0ac56cfc authored by Xiang Li's avatar Xiang Li

Merge branch 'JVET_S0186' into 'master'

JVET-S0186: VPS cleanup

See merge request jvet/VVCSoftware_VTM!1751
parents 88d5eda4 847202c8
......@@ -85,6 +85,7 @@
#define JVET_R0068_ASPECT6_ENC_RESTRICTION 1 // encoder restriction for JVET-R0068 apsect 6
#define JVET_S0186_SPS_CLEANUP 1 // JVET-S0186: Proposal 1, move sps_chroma_format_idc and sps_log2_ctu_size_minus5 to take place sps_reserved_zero_4bits
//########### place macros to be be kept below this line ###############
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
......
......@@ -1306,8 +1306,20 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_CODE( 4, uiCode, "sps_video_parameter_set_id" ); pcSPS->setVPSId( uiCode );
READ_CODE(3, uiCode, "sps_max_sub_layers_minus1"); pcSPS->setMaxTLayers (uiCode + 1);
CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled");
#if JVET_S0186_SPS_CLEANUP
READ_CODE(2, uiCode, "chroma_format_idc");
pcSPS->setChromaFormatIdc(ChromaFormat(uiCode));
READ_CODE(2, uiCode, "sps_log2_ctu_size_minus5");
pcSPS->setCTUSize(1 << (uiCode + 5));
CHECK(uiCode > 2, "sps_log2_ctu_size_minus5 must be less than or equal to 2");
unsigned ctbLog2SizeY = uiCode + 5;
pcSPS->setMaxCUWidth(pcSPS->getCTUSize());
pcSPS->setMaxCUHeight(pcSPS->getCTUSize());
#else
READ_CODE(4, uiCode, "sps_reserved_zero_4bits");
CHECK(uiCode != 0, "sps_reserved_zero_4bits not equal to zero");
#endif
READ_FLAG(uiCode, "sps_ptl_dpb_hrd_params_present_flag"); pcSPS->setPtlDpbHrdParamsPresentFlag(uiCode);
if( !pcSPS->getVPSId() )
......@@ -1324,7 +1336,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG(uiCode, "gdr_enabled_flag");
pcSPS->setGDREnabledFlag(uiCode);
#if !JVET_S0186_SPS_CLEANUP
READ_CODE(2, uiCode, "chroma_format_idc"); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) );
#endif
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
if( pcSPS->getChromaFormatIdc() == CHROMA_444 )
......@@ -1364,11 +1378,13 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
const uint32_t chromaArrayType = (int) pcSPS->getSeparateColourPlaneFlag() ? 0 : pcSPS->getChromaFormatIdc();
#endif
#if !JVET_S0186_SPS_CLEANUP
READ_CODE(2, uiCode, "sps_log2_ctu_size_minus5"); pcSPS->setCTUSize(1 << (uiCode + 5));
CHECK(uiCode > 2, "sps_log2_ctu_size_minus5 must be less than or equal to 2");
unsigned ctbLog2SizeY = uiCode + 5;
pcSPS->setMaxCUWidth(pcSPS->getCTUSize());
pcSPS->setMaxCUHeight(pcSPS->getCTUSize());
#endif
READ_FLAG( uiCode, "subpic_info_present_flag" ); pcSPS->setSubPicInfoPresentFlag(uiCode);
......
......@@ -777,7 +777,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
CHECK(pcSPS->getMaxTLayers() == 0, "Maximum number of temporal sub-layers is '0'");
WRITE_CODE(pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1");
#if JVET_S0186_SPS_CLEANUP
WRITE_CODE(int(pcSPS->getChromaFormatIdc()), 2, "chroma_format_idc");
WRITE_CODE(floorLog2(pcSPS->getCTUSize()) - 5, 2, "sps_log2_ctu_size_minus5");
#else
WRITE_CODE(0, 4, "sps_reserved_zero_4bits");
#endif
WRITE_FLAG(pcSPS->getPtlDpbHrdParamsPresentFlag(), "sps_ptl_dpb_hrd_params_present_flag");
if( !pcSPS->getVPSId() )
......@@ -791,7 +796,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
}
WRITE_FLAG(pcSPS->getGDREnabledFlag(), "gdr_enabled_flag");
#if !JVET_S0186_SPS_CLEANUP
WRITE_CODE(int(pcSPS->getChromaFormatIdc ()), 2, "chroma_format_idc");
#endif
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
const ChromaFormat format = pcSPS->getChromaFormatIdc();
......@@ -823,7 +830,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(conf.getWindowBottomOffset(), "sps_conf_win_bottom_offset");
}
#if !JVET_S0186_SPS_CLEANUP
WRITE_CODE(floorLog2(pcSPS->getCTUSize()) - 5, 2, "sps_log2_ctu_size_minus5");
#endif
WRITE_FLAG(pcSPS->getSubPicInfoPresentFlag(), "subpic_info_present_flag");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment