Commit 39f5c659 authored by Yao-Jen Chang's avatar Yao-Jen Chang

JVET-S0221: Constraints on the numbers of virtual boundaries

parent ffa9403d
......@@ -53,6 +53,7 @@
//########### place macros to be removed in next cycle below this line ###############
#define JVET_R0042_SUBPIC_CHECK 1 // JVET_R0042: SubPicture types related constraints
//########### place macros to be be kept below this line ###############
......
......@@ -1870,11 +1870,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);
......@@ -2579,11 +2591,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);
......
......@@ -1136,11 +1136,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");
......@@ -1580,11 +1592,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