Commit aaab9269 authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'JVET-S0221' into 'master'

JVET-S0221: Constraints on the number of virtual boundaries

See merge request jvet/VVCSoftware_VTM!1709
parents 87cc8d5a c05ae257
......@@ -1615,6 +1615,17 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
CHECK(m_resChangeInClvsEnabled, "resolution change in CLVS and subpictures cannot be enabled together");
}
#if JVET_S0221_NUM_VB_CHECK
if (m_virtualBoundariesPresentFlag)
{
if (m_iSourceWidth <= 8)
CHECK(m_numVerVirtualBoundaries != 0, "The number of vertical virtual boundaries shall be 0 when the picture width is less than or equal to 8");
if (m_iSourceHeight <= 8)
CHECK(m_numHorVirtualBoundaries != 0, "The number of horizontal virtual boundaries shall be 0 when the picture height is less than or equal to 8");
}
#endif
if (m_cfgSubpictureLevelInfoSEI.m_enabled)
{
CHECK (m_numSubPics != m_cfgSubpictureLevelInfoSEI.m_numSubpictures, "NumSubPics must be equal to SEISubpicLevelInfoNumSubpics" );
......
......@@ -56,6 +56,7 @@
#define JVET_S0132_HLS_REORDER 1 // Rearrange syntax elements in SPS and PPS
#define JVET_S0221_NUM_VB_CHECK 1 // JVET_S0221: Constraints on the number of virtual boundaries
//########### place macros to be be kept below this line ###############
......
......@@ -1938,11 +1938,23 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
if( pcSPS->getVirtualBoundariesPresentFlag() )
{
READ_CODE( 2, uiCode, "sps_num_ver_virtual_boundaries"); pcSPS->setNumVerVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pcSPS->getMaxPicWidthInLumaSamples() <= 8)
{
CHECK(pcSPS->getNumVerVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < pcSPS->getNumVerVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "sps_virtual_boundaries_pos_x"); pcSPS->setVirtualBoundariesPosX(uiCode << 3, i);
}
READ_CODE( 2, uiCode, "sps_num_hor_virtual_boundaries"); pcSPS->setNumHorVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pcSPS->getMaxPicHeightInLumaSamples() <= 8)
{
CHECK(pcSPS->getNumHorVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < pcSPS->getNumHorVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "sps_virtual_boundaries_pos_y"); pcSPS->setVirtualBoundariesPosY(uiCode << 3, i);
......@@ -2647,11 +2659,23 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
if( picHeader->getVirtualBoundariesPresentFlag() )
{
READ_CODE( 2, uiCode, "ph_num_ver_virtual_boundaries"); picHeader->setNumVerVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pps->getPicWidthInLumaSamples() <= 8)
{
CHECK(picHeader->getNumVerVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < picHeader->getNumVerVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "ph_virtual_boundaries_pos_x"); picHeader->setVirtualBoundariesPosX(uiCode << 3, i);
}
READ_CODE( 2, uiCode, "ph_num_hor_virtual_boundaries"); picHeader->setNumHorVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pps->getPicHeightInLumaSamples() <= 8)
{
CHECK(picHeader->getNumHorVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < picHeader->getNumHorVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "ph_virtual_boundaries_pos_y"); picHeader->setVirtualBoundariesPosY(uiCode << 3, i);
......
......@@ -1190,11 +1190,23 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
if( pcSPS->getVirtualBoundariesPresentFlag() )
{
WRITE_CODE( pcSPS->getNumVerVirtualBoundaries(), 2, "sps_num_ver_virtual_boundaries");
#if JVET_S0221_NUM_VB_CHECK
if (pcSPS->getMaxPicWidthInLumaSamples() <= 8)
{
CHECK(pcSPS->getNumVerVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < pcSPS->getNumVerVirtualBoundaries(); i++ )
{
WRITE_UVLC((pcSPS->getVirtualBoundariesPosX(i)>>3), "sps_virtual_boundaries_pos_x");
}
WRITE_CODE(pcSPS->getNumHorVirtualBoundaries(), 2, "sps_num_hor_virtual_boundaries");
#if JVET_S0221_NUM_VB_CHECK
if (pcSPS->getMaxPicHeightInLumaSamples() <= 8)
{
CHECK(pcSPS->getNumHorVirtualBoundaries() != 0, "SPS: When picture height is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < pcSPS->getNumHorVirtualBoundaries(); i++ )
{
WRITE_UVLC((pcSPS->getVirtualBoundariesPosY(i)>>3), "sps_virtual_boundaries_pos_y");
......@@ -1634,11 +1646,23 @@ void HLSWriter::codePictureHeader( PicHeader* picHeader, bool writeRbspTrailingB
if( picHeader->getVirtualBoundariesPresentFlag() )
{
WRITE_CODE(picHeader->getNumVerVirtualBoundaries(), 2, "ph_num_ver_virtual_boundaries");
#if JVET_S0221_NUM_VB_CHECK
if (pps->getPicWidthInLumaSamples() <= 8)
{
CHECK(picHeader->getNumVerVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < picHeader->getNumVerVirtualBoundaries(); i++ )
{
WRITE_UVLC(picHeader->getVirtualBoundariesPosX(i) >> 3, "ph_virtual_boundaries_pos_x");
}
WRITE_CODE(picHeader->getNumHorVirtualBoundaries(), 2, "ph_num_hor_virtual_boundaries");
#if JVET_S0221_NUM_VB_CHECK
if (pps->getPicHeightInLumaSamples() <= 8)
{
CHECK(picHeader->getNumHorVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < picHeader->getNumHorVirtualBoundaries(); i++ )
{
WRITE_UVLC(picHeader->getVirtualBoundariesPosY(i)>>3, "ph_virtual_boundaries_pos_y");
......
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