Commit ff225093 authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'R0156_proposal4' into 'master'

JVET-R0071 item 1, R0156 item 4, R0284 item 1

See merge request jvet/VVCSoftware_VTM!1531
parents 6e37508f 8ebd637b
......@@ -2376,6 +2376,9 @@ SPS::SPS()
, m_maxHeightInLumaSamples (288)
, m_subPicInfoPresentFlag (false)
, m_numSubPics(1)
#if JVET_R0156_ASPECT4_SPS_CLEANUP
, m_independentSubPicsFlag (false)
#endif
, m_subPicIdMappingExplicitlySignalledFlag ( false )
, m_subPicIdMappingInSpsFlag ( false )
, m_subPicIdLen(16)
......
......@@ -1217,6 +1217,9 @@ private:
Window m_conformanceWindow;
bool m_subPicInfoPresentFlag; // indicates the presence of sub-picture info
uint32_t m_numSubPics; //!< number of sub-pictures used
#if JVET_R0156_ASPECT4_SPS_CLEANUP
bool m_independentSubPicsFlag;
#endif
std::vector<uint32_t> m_subPicCtuTopLeftX;
std::vector<uint32_t> m_subPicCtuTopLeftY;
std::vector<uint32_t> m_subPicWidth;
......@@ -1402,6 +1405,10 @@ public:
m_loopFilterAcrossSubpicEnabledFlag.resize(m_numSubPics);
m_subPicId.resize(m_numSubPics);
}
#if JVET_R0156_ASPECT4_SPS_CLEANUP
void setIndependentSubPicsFlag(bool b) { m_independentSubPicsFlag = b; }
bool getIndependentSubPicsFlag() const { return m_independentSubPicsFlag; }
#endif
uint32_t getNumSubPics( ) const { return m_numSubPics; }
void setSubPicCtuTopLeftX( int i, uint32_t u ) { m_subPicCtuTopLeftX[i] = u; }
uint32_t getSubPicCtuTopLeftX( int i ) const { return m_subPicCtuTopLeftX[i]; }
......
......@@ -57,6 +57,7 @@
#define JVET_R0143_TSRCdisableLL 1 // JVET-R0143: disable TSRC for lossless coding
#define JVET_R0233_CCALF_LINE_BUFFER_REDUCTION 1 // JVET-R0233 method 2: Line buffer reduction for CCALF
#define JVET_Q0471_CHROMA_QT_SPLIT 1 // JVET-Q0471: Chroma QT split
......@@ -64,8 +65,15 @@
#define JVET_R0232_CCALF_APS_CONSTRAINT 1 // JVET-R0232 section 3.2: APS contraint for CCALF
#define JVET_R0210_NUMTILESINSLICE_SIGNALLING 1 // JVET-R0210 section 3.3: Don't signal NumTilesInSlice syntax element when numTilesInPic - slice_address is 1.
#define JVET_R0156_ASPECT4_SPS_CLEANUP 1 // JVET-R0071 #1, R0156 #4, R0284 #1: Condition sps_independent_subpics_flag on "sps_num_subpics_minus1 > 0"
#define JVET_R0156_ASPECT3_SPS_CLEANUP 1 // Condition sps_sublayer_dpb_params_flag on sps_ptl_dpb_hrd_params_present_flag, in addition to sps_max_sublayer_minus1, JVET-R0156 proposal 3, JVET-R0170, JVET-R0222 proposal 2
//########### place macros to be be kept below this line ###############
#define JVET_M0497_MATRIX_MULT 0 // 0: Fast method; 1: Matrix multiplication
......
......@@ -1291,6 +1291,11 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setSubPicCtuTopLeftY( 0, 0 );
pcSPS->setSubPicWidth( 0, ( pcSPS->getMaxPicWidthInLumaSamples() + pcSPS->getCTUSize() - 1 ) >> floorLog2( pcSPS->getCTUSize() ) );
pcSPS->setSubPicHeight( 0, ( pcSPS->getMaxPicHeightInLumaSamples() + pcSPS->getCTUSize() - 1 ) >> floorLog2( pcSPS->getCTUSize() ) );
#if JVET_R0156_ASPECT4_SPS_CLEANUP
pcSPS->setIndependentSubPicsFlag(1);
#endif
#if JVET_R0071_SPS_PPS_CELANUP
pcSPS->setSubPicTreatedAsPicFlag(0, 1);
pcSPS->setLoopFilterAcrossSubpicEnabledFlag(0, 0);
......@@ -1301,6 +1306,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
}
else
{
#if JVET_R0156_ASPECT4_SPS_CLEANUP
READ_FLAG(uiCode, "sps_independent_subpics_flag"); pcSPS->setIndependentSubPicsFlag(uiCode != 0);
#endif
for (int picIdx = 0; picIdx < pcSPS->getNumSubPics(); picIdx++)
{
if ((picIdx > 0) && (pcSPS->getMaxPicWidthInLumaSamples() > pcSPS->getCTUSize()))
......@@ -1339,10 +1347,17 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{
pcSPS->setSubPicHeight(picIdx, (pcSPS->getMaxPicHeightInLumaSamples() + pcSPS->getCTUSize() - 1) /pcSPS->getCTUSize() - pcSPS->getSubPicCtuTopLeftY(picIdx));
}
READ_FLAG(uiCode, "subpic_treated_as_pic_flag[ i ]");
pcSPS->setSubPicTreatedAsPicFlag(picIdx, uiCode);
READ_FLAG(uiCode, "loop_filter_across_subpic_enabled_flag[ i ]");
pcSPS->setLoopFilterAcrossSubpicEnabledFlag(picIdx, uiCode);
#if JVET_R0156_ASPECT4_SPS_CLEANUP
if (!pcSPS->getIndependentSubPicsFlag())
{
#endif
READ_FLAG(uiCode, "subpic_treated_as_pic_flag[ i ]");
pcSPS->setSubPicTreatedAsPicFlag(picIdx, uiCode);
READ_FLAG(uiCode, "loop_filter_across_subpic_enabled_flag[ i ]");
pcSPS->setLoopFilterAcrossSubpicEnabledFlag(picIdx, uiCode);
#if JVET_R0156_ASPECT4_SPS_CLEANUP
}
#endif
}
}
......
......@@ -792,6 +792,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(pcSPS->getNumSubPics() - 1, "sps_num_subpics_minus1");
if( pcSPS->getNumSubPics() > 1 )
{
#if JVET_R0156_ASPECT4_SPS_CLEANUP
WRITE_FLAG(pcSPS->getIndependentSubPicsFlag(), "sps_independent_subpics_flag");
#endif
for (int picIdx = 0; picIdx < pcSPS->getNumSubPics(); picIdx++)
{
if ((picIdx > 0) && (pcSPS->getMaxPicWidthInLumaSamples() > pcSPS->getCTUSize()))
......@@ -810,8 +813,15 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
{
WRITE_CODE( pcSPS->getSubPicHeight(picIdx) - 1, ceilLog2(( pcSPS->getMaxPicHeightInLumaSamples() + pcSPS->getCTUSize() - 1) / pcSPS->getCTUSize()), "subpic_height_minus1[ i ]" );
}
WRITE_FLAG( pcSPS->getSubPicTreatedAsPicFlag(picIdx), "subpic_treated_as_pic_flag[ i ]" );
WRITE_FLAG( pcSPS->getLoopFilterAcrossSubpicEnabledFlag(picIdx), "loop_filter_across_subpic_enabled_flag[ i ]" );
#if JVET_R0156_ASPECT4_SPS_CLEANUP
if (!pcSPS->getIndependentSubPicsFlag())
{
#endif
WRITE_FLAG( pcSPS->getSubPicTreatedAsPicFlag(picIdx), "subpic_treated_as_pic_flag[ i ]" );
WRITE_FLAG( pcSPS->getLoopFilterAcrossSubpicEnabledFlag(picIdx), "loop_filter_across_subpic_enabled_flag[ i ]" );
#if JVET_R0156_ASPECT4_SPS_CLEANUP
}
#endif
}
}
......
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