Commit 8b5ebd9a authored by Zhipin Deng's avatar Zhipin Deng

Merge branch 'master' into 'S0052'

# Conflicts:
#   source/Lib/CommonLib/TypeDef.h
parents 5b3206ab d444f86b
This diff is collapsed.
ColorTransform : 1
Log2MaxTbSize : 5
DualITree: 0
\ No newline at end of file
DualITree: 0
LMCSEnable : 0
\ No newline at end of file
......@@ -325,12 +325,22 @@ void DecApp::writeLineToOutputLog(Picture * pcPic)
{
if (m_oplFileStream.is_open() && m_oplFileStream.good())
{
const SPS* sps = pcPic->cs->sps;
PictureHash recon_digest;
auto numChar = calcMD5(((const Picture*)pcPic)->getRecoBuf(), recon_digest, sps->getBitDepths());
m_oplFileStream << std::setw(8) << pcPic->getPOC() << "," << std::setw(5) << pcPic->Y().width << "," << std::setw(5) << pcPic->Y().height << "," << hashToString(recon_digest, numChar) << "\n";
const SPS * sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
const Window &conf = pcPic->getConformanceWindow();
const int leftOffset = conf.getWindowLeftOffset() * SPS::getWinUnitX(chromaFormatIDC);
const int rightOffset = conf.getWindowRightOffset() * SPS::getWinUnitX(chromaFormatIDC);
const int topOffset = conf.getWindowTopOffset() * SPS::getWinUnitY(chromaFormatIDC);
const int bottomOffset = conf.getWindowBottomOffset() * SPS::getWinUnitY(chromaFormatIDC);
PictureHash recon_digest;
auto numChar = calcMD5WithCropping(((const Picture *) pcPic)->getRecoBuf(), recon_digest, sps->getBitDepths(),
leftOffset, rightOffset, topOffset, bottomOffset);
const int croppedWidth = pcPic->Y().width - leftOffset - rightOffset;
const int croppedHeight = pcPic->Y().height - topOffset - bottomOffset;
m_oplFileStream << std::setw(8) << pcPic->getPOC() << "," << std::setw(5) << croppedWidth << "," << std::setw(5)
<< croppedHeight << "," << hashToString(recon_digest, numChar) << "\n";
}
}
......
......@@ -1242,13 +1242,7 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier **classifier, const PelUnitBuf
bool isNearVBbelow = yVb >= vbPos && (yVb <= vbPos);
for( int jj = 0; jj < clsSizeX; jj++ )
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel sum = 0;
#else
int sum = 0;
#endif
int32_t sum = 0;
const Pel curr = pImg0[+0];
if( filtType == ALF_FILTER_7 )
{
......
......@@ -186,6 +186,12 @@ uint32_t calcChecksum(const CPelUnitBuf& pic, PictureHash &digest, const BitDept
* uses little-endian two byte words; 8bit data uses single byte words.
*/
uint32_t calcMD5(const CPelUnitBuf& pic, PictureHash &digest, const BitDepths &bitDepths)
{
return calcMD5WithCropping(pic, digest, bitDepths, 0, 0, 0, 0);
}
uint32_t calcMD5WithCropping(const CPelUnitBuf &pic, PictureHash &digest, const BitDepths &bitDepths,
const int leftOffset, const int rightOffset, const int topOffset, const int bottomOffset)
{
/* choose an md5_plane packing function based on the system bitdepth */
typedef void (*MD5PlaneFunc)(MD5&, const Pel*, uint32_t, uint32_t, uint32_t);
......@@ -197,17 +203,26 @@ uint32_t calcMD5(const CPelUnitBuf& pic, PictureHash &digest, const BitDepths &b
for (uint32_t chan = 0; chan< (uint32_t)pic.bufs.size(); chan++)
{
const ComponentID compID=ComponentID(chan);
const CPelBuf area = pic.get(compID);
const ComponentID compID = ComponentID(chan);
const CPelBuf area = pic.get(compID);
const int chromaScaleX = getComponentScaleX(compID, pic.chromaFormat);
const int chromaScaleY = getComponentScaleY(compID, pic.chromaFormat);
const int compLeftOffset = leftOffset >> chromaScaleX;
const int compRightOffset = rightOffset >> chromaScaleX;
const int compTopOffset = topOffset >> chromaScaleY;
const int compBottomOffset = bottomOffset >> chromaScaleY;
md5_plane_func = bitDepths.recon[toChannelType(compID)] <= 8 ? (MD5PlaneFunc)md5_plane<1> : (MD5PlaneFunc)md5_plane<2>;
uint8_t tmp_digest[MD5_DIGEST_STRING_LENGTH];
md5_plane_func(md5[compID], area.bufAt(0, 0), area.width, area.height, area.stride );
md5_plane_func(md5[compID], area.bufAt(compLeftOffset, compTopOffset),
area.width - compRightOffset - compLeftOffset, area.height - compTopOffset - compBottomOffset,
area.stride);
md5[compID].finalize(tmp_digest);
for(uint32_t i=0; i<MD5_DIGEST_STRING_LENGTH; i++)
for (uint32_t i = 0; i < MD5_DIGEST_STRING_LENGTH; i++)
{
digest.hash.push_back(tmp_digest[i]);
}
}
return 16;
}
......
......@@ -338,6 +338,9 @@ public:
int calcAndPrintHashStatus(const CPelUnitBuf& pic, const class SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths, const MsgLevel msgl);
uint32_t calcMD5(const CPelUnitBuf& pic, PictureHash &digest, const BitDepths &bitDepths);
uint32_t calcMD5WithCropping(const CPelUnitBuf &pic, PictureHash &digest, const BitDepths &bitDepths,
const int leftOffset, const int rightOffset, const int topOffset, const int bottomOffset);
std::string hashToString(const PictureHash &digest, int numChar);
typedef std::list<Picture*> PicList;
......
......@@ -54,6 +54,11 @@
//########### place macros to be removed in next cycle below this line ###############
#define JVET_S0052_RM_SEPARATE_COLOUR_PLANE 1 // JVET-S0052: Remove separate colour plane coding from VVC version 1
#define JVET_S0074_SPS_REORDER 1 // JVET-S0074: aspect 1, rearrange some syntax elements in SPS
#define JVET_S0132_HLS_REORDER 1 // Rearrange syntax elements in SPS and PPS
//########### place macros to be be kept below this line ###############
#define JVET_R0351_HIGH_BIT_DEPTH_SUPPORT 1 // JVET-R0351: high bit depth coding support (syntax changes, no mathematical differences for CTCs)
......
#if ! defined( VTM_VERSION )
#define VTM_VERSION "9.2"
#define VTM_VERSION "9.3"
#endif
......@@ -683,7 +683,22 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
READ_FLAG(uiCode, "rpl1_idx_present_flag");
pcPPS->setRpl1IdxPresentFlag(uiCode);
#if JVET_S0132_HLS_REORDER
READ_FLAG( uiCode, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE)
pcPPS->setUseWP( uiCode==1 );
READ_FLAG( uiCode, "weighted_bipred_flag" ); // Use of Bi-Directional Weighting Prediction (B_SLICE)
pcPPS->setWPBiPred( uiCode==1 );
READ_FLAG(uiCode, "pps_ref_wraparound_enabled_flag"); pcPPS->setWrapAroundEnabledFlag( uiCode ? true : false );
if (pcPPS->getWrapAroundEnabledFlag())
{
READ_UVLC(uiCode, "pps_ref_wraparound_offset");
pcPPS->setPicWidthMinusWrapAroundOffset(uiCode);
}
else
{
pcPPS->setPicWidthMinusWrapAroundOffset(0);
}
#endif
READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode);
READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false );
......@@ -765,12 +780,12 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
pcPPS->setSliceChromaQpFlag(0);
pcPPS->clearChromaQpOffsetList();
}
#if !JVET_S0132_HLS_REORDER
READ_FLAG( uiCode, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE)
pcPPS->setUseWP( uiCode==1 );
READ_FLAG( uiCode, "weighted_bipred_flag" ); // Use of Bi-Directional Weighting Prediction (B_SLICE)
pcPPS->setWPBiPred( uiCode==1 );
#endif
READ_FLAG( uiCode, "deblocking_filter_control_present_flag" ); pcPPS->setDeblockingFilterControlPresentFlag( uiCode ? true : false );
if(pcPPS->getDeblockingFilterControlPresentFlag())
{
......@@ -852,6 +867,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
pcPPS->setQpDeltaInfoInPhFlag(false);
}
#if !JVET_S0132_HLS_REORDER
READ_FLAG(uiCode, "pps_ref_wraparound_enabled_flag"); pcPPS->setWrapAroundEnabledFlag( uiCode ? true : false );
if (pcPPS->getWrapAroundEnabledFlag())
{
......@@ -862,7 +878,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
{
pcPPS->setPicWidthMinusWrapAroundOffset(0);
}
#endif
READ_FLAG( uiCode, "picture_header_extension_present_flag");
pcPPS->setPictureHeaderExtensionPresentFlag(uiCode);
READ_FLAG( uiCode, "slice_header_extension_present_flag");
......@@ -1499,6 +1515,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
unsigned maxBTSize[3] = { 0, 0, 0 };
unsigned maxTTSize[3] = { 0, 0, 0 };
#if !JVET_S0132_HLS_REORDER
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
{
READ_FLAG(uiCode, "qtbtt_dual_tree_intra_flag"); pcSPS->setUseDualITree(uiCode);
......@@ -1507,7 +1524,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{
pcSPS->setUseDualITree(0);
}
#endif
READ_UVLC(uiCode, "log2_min_luma_coding_block_size_minus2");
int log2MinCUSize = uiCode + 2;
pcSPS->setLog2MinCodingBlockSize(log2MinCUSize);
......@@ -1536,6 +1553,30 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(uiCode > ctbLog2SizeY - minQtLog2SizeIntraY, "The value of sps_log2_diff_max_tt_min_qt_intra_slice_luma shall be in the range of 0 to CtbLog2SizeY - MinQtLog2SizeIntraY");
CHECK(maxTTSize[0] > 64, "The value of sps_log2_diff_max_tt_min_qt_intra_slice_luma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraY");
}
#if JVET_S0132_HLS_REORDER
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
{
READ_FLAG(uiCode, "qtbtt_dual_tree_intra_flag"); pcSPS->setUseDualITree(uiCode);
}
else
{
pcSPS->setUseDualITree(0);
}
if (pcSPS->getUseDualITree())
{
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma"); minQT[2] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slice_chroma"); maxBTD[2] = uiCode;
CHECK(uiCode > 2 * (ctbLog2SizeY - log2MinCUSize), "sps_max_mtt_hierarchy_depth_intra_slice_chroma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
maxTTSize[2] = maxBTSize[2] = minQT[2];
if (maxBTD[2] != 0)
{
READ_UVLC(uiCode, "sps_log2_diff_max_bt_min_qt_intra_slice_chroma"); maxBTSize[2] <<= uiCode;
READ_UVLC(uiCode, "sps_log2_diff_max_tt_min_qt_intra_slice_chroma"); maxTTSize[2] <<= uiCode;
CHECK(maxTTSize[2] > 64, "The value of sps_log2_diff_max_tt_min_qt_intra_slice_chroma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraChroma");
CHECK(maxBTSize[2] > 64, "The value of sps_log2_diff_max_bt_min_qt_intra_slice_chroma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraChroma");
}
}
#endif
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_inter_slice");
unsigned minQtLog2SizeInterY = uiCode + pcSPS->getLog2MinCodingBlockSize();
minQT[1] = 1 << minQtLog2SizeInterY;
......@@ -1550,6 +1591,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(uiCode > ctbLog2SizeY - minQtLog2SizeInterY, "The value of sps_log2_diff_max_tt_min_qt_inter_slice shall be in the range of 0 to CtbLog2SizeY - MinQtLog2SizeInterY");
CHECK(maxTTSize[1] > 64, "The value of sps_log2_diff_max_tt_min_qt_inter_slice shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeInterY");
}
#if !JVET_S0132_HLS_REORDER
if (pcSPS->getUseDualITree())
{
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma"); minQT[2] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
......@@ -1564,6 +1606,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(maxBTSize[2] > 64, "The value of sps_log2_diff_max_bt_min_qt_intra_slice_chroma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraChroma");
}
}
#endif
pcSPS->setMinQTSizes(minQT);
pcSPS->setMaxMTTHierarchyDepth(maxBTD[1], maxBTD[0], maxBTD[2]);
......@@ -1578,6 +1621,23 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setLog2MaxTbSize(5);
}
#if JVET_S0074_SPS_REORDER
READ_FLAG(uiCode, "sps_transform_skip_enabled_flag"); pcSPS->setTransformSkipEnabledFlag(uiCode ? true : false);
if (pcSPS->getTransformSkipEnabledFlag())
{
READ_UVLC(uiCode, "log2_transform_skip_max_size_minus2");
pcSPS->setLog2MaxTransformSkipBlockSize(uiCode + 2);
READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false);
}
READ_FLAG(uiCode, "sps_mts_enabled_flag"); pcSPS->setUseMTS(uiCode != 0);
if (pcSPS->getUseMTS())
{
READ_FLAG(uiCode, "sps_explicit_mts_intra_enabled_flag"); pcSPS->setUseIntraMTS(uiCode != 0);
READ_FLAG(uiCode, "sps_explicit_mts_inter_enabled_flag"); pcSPS->setUseInterMTS(uiCode != 0);
}
READ_FLAG(uiCode, "sps_lfnst_enabled_flag"); pcSPS->setUseLFNST(uiCode != 0);
#endif
if (chromaArrayType != CHROMA_400)
{
READ_FLAG(uiCode, "sps_joint_cbcr_enabled_flag"); pcSPS->setJointCbCrEnabledFlag(uiCode ? true : false);
......@@ -1617,6 +1677,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setCCALFEnabledFlag(false);
}
#if JVET_S0074_SPS_REORDER
READ_FLAG(uiCode, "sps_lmcs_enable_flag"); pcSPS->setUseLmcs(uiCode == 1);
#else
READ_FLAG(uiCode, "sps_transform_skip_enabled_flag"); pcSPS->setTransformSkipEnabledFlag(uiCode ? true : false);
if (pcSPS->getTransformSkipEnabledFlag())
{
......@@ -1624,6 +1687,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setLog2MaxTransformSkipBlockSize(uiCode + 2);
READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false);
}
#endif
READ_FLAG( uiCode, "sps_weighted_pred_flag" ); pcSPS->setUseWP( uiCode ? true : false );
READ_FLAG( uiCode, "sps_weighted_bipred_flag" ); pcSPS->setUseWPBiPred( uiCode ? true : false );
......@@ -1801,13 +1865,14 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setHorCollocatedChromaFlag(true);
pcSPS->setVerCollocatedChromaFlag(true);
}
#if !JVET_S0074_SPS_REORDER
READ_FLAG( uiCode, "sps_mts_enabled_flag" ); pcSPS->setUseMTS ( uiCode != 0 );
if ( pcSPS->getUseMTS() )
{
READ_FLAG( uiCode, "sps_explicit_mts_intra_enabled_flag" ); pcSPS->setUseIntraMTS ( uiCode != 0 );
READ_FLAG( uiCode, "sps_explicit_mts_inter_enabled_flag" ); pcSPS->setUseInterMTS ( uiCode != 0 );
}
#endif
READ_FLAG( uiCode, "sps_palette_enabled_flag"); pcSPS->setPLTMode ( uiCode != 0 );
if (chromaArrayType == CHROMA_444 && pcSPS->getLog2MaxTbSize() != 6)
{
......@@ -1833,8 +1898,11 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
}
else
pcSPS->setMaxNumIBCMergeCand(0);
#if !JVET_S0074_SPS_REORDER
READ_FLAG(uiCode, "sps_lmcs_enable_flag"); pcSPS->setUseLmcs(uiCode == 1);
READ_FLAG( uiCode, "sps_lfnst_enabled_flag" ); pcSPS->setUseLFNST( uiCode != 0 );
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
READ_FLAG( uiCode, "sps_ladf_enabled_flag" ); pcSPS->setLadfEnabled( uiCode != 0 );
......
......@@ -396,7 +396,15 @@ void HLSWriter::codePPS( const PPS* pcPPS )
WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive()-1, "num_ref_idx_l0_default_active_minus1");
WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive()-1, "num_ref_idx_l1_default_active_minus1");
WRITE_FLAG( pcPPS->getRpl1IdxPresentFlag() ? 1 : 0, "rpl1_idx_present_flag");
#if JVET_S0132_HLS_REORDER
WRITE_FLAG( pcPPS->getUseWP() ? 1 : 0, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE)
WRITE_FLAG( pcPPS->getWPBiPred() ? 1 : 0, "weighted_bipred_flag" ); // Use of Weighting Bi-Prediction (B_SLICE)
WRITE_FLAG( pcPPS->getWrapAroundEnabledFlag() ? 1 : 0, "pps_ref_wraparound_enabled_flag" );
if( pcPPS->getWrapAroundEnabledFlag() )
{
WRITE_UVLC(pcPPS->getPicWidthMinusWrapAroundOffset(), "pps_pic_width_minus_wraparound_offset");
}
#endif
WRITE_SVLC( pcPPS->getPicInitQPMinus26(), "init_qp_minus26");
WRITE_FLAG( pcPPS->getUseDQP() ? 1 : 0, "cu_qp_delta_enabled_flag" );
......@@ -429,10 +437,10 @@ void HLSWriter::codePPS( const PPS* pcPPS )
}
}
}
#if !JVET_S0132_HLS_REORDER
WRITE_FLAG( pcPPS->getUseWP() ? 1 : 0, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE)
WRITE_FLAG( pcPPS->getWPBiPred() ? 1 : 0, "weighted_bipred_flag" ); // Use of Weighting Bi-Prediction (B_SLICE)
#endif
WRITE_FLAG( pcPPS->getDeblockingFilterControlPresentFlag()?1 : 0, "deblocking_filter_control_present_flag");
if(pcPPS->getDeblockingFilterControlPresentFlag())
{
......@@ -466,11 +474,13 @@ void HLSWriter::codePPS( const PPS* pcPPS )
}
WRITE_FLAG(pcPPS->getQpDeltaInfoInPhFlag() ? 1 : 0, "pps_qp_delta_info_in_ph_flag");
}
#if !JVET_S0132_HLS_REORDER
WRITE_FLAG( pcPPS->getWrapAroundEnabledFlag() ? 1 : 0, "pps_ref_wraparound_enabled_flag" );
if( pcPPS->getWrapAroundEnabledFlag() )
{
WRITE_UVLC(pcPPS->getPicWidthMinusWrapAroundOffset(), "pps_pic_width_minus_wraparound_offset");
}
#endif
WRITE_FLAG( pcPPS->getPictureHeaderExtensionPresentFlag() ? 1 : 0, "picture_header_extension_present_flag");
WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_header_extension_present_flag");
......@@ -888,10 +898,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
dpb_parameters(pcSPS->getMaxTLayers() - 1, pcSPS->getSubLayerDpbParamsFlag(), pcSPS);
}
CHECK( pcSPS->getMaxCUWidth() != pcSPS->getMaxCUHeight(), "Rectangular CTUs not supported" );
#if !JVET_S0132_HLS_REORDER
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
{
WRITE_FLAG(pcSPS->getUseDualITree(), "qtbtt_dual_tree_intra_flag");
}
#endif
WRITE_UVLC(pcSPS->getLog2MinCodingBlockSize() - 2, "log2_min_luma_coding_block_size_minus2");
WRITE_FLAG(pcSPS->getSplitConsOverrideEnabledFlag(), "partition_constraints_override_enabled_flag");
WRITE_UVLC(floorLog2(pcSPS->getMinQTSize(I_SLICE)) - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice_luma");
......@@ -901,6 +913,22 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(floorLog2(pcSPS->getMaxBTSizeI()) - floorLog2(pcSPS->getMinQTSize(I_SLICE)), "sps_log2_diff_max_bt_min_qt_intra_slice_luma");
WRITE_UVLC(floorLog2(pcSPS->getMaxTTSizeI()) - floorLog2(pcSPS->getMinQTSize(I_SLICE)), "sps_log2_diff_max_tt_min_qt_intra_slice_luma");
}
#if JVET_S0132_HLS_REORDER
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
{
WRITE_FLAG(pcSPS->getUseDualITree(), "qtbtt_dual_tree_intra_flag");
}
if (pcSPS->getUseDualITree())
{
WRITE_UVLC(floorLog2(pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)) - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice_chroma");
WRITE_UVLC(pcSPS->getMaxMTTHierarchyDepthIChroma(), "sps_max_mtt_hierarchy_depth_intra_slice_chroma");
if (pcSPS->getMaxMTTHierarchyDepthIChroma() != 0)
{
WRITE_UVLC(floorLog2(pcSPS->getMaxBTSizeIChroma()) - floorLog2(pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)), "sps_log2_diff_max_bt_min_qt_intra_slice_chroma");
WRITE_UVLC(floorLog2(pcSPS->getMaxTTSizeIChroma()) - floorLog2(pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)), "sps_log2_diff_max_tt_min_qt_intra_slice_chroma");
}
}
#endif
WRITE_UVLC(floorLog2(pcSPS->getMinQTSize(B_SLICE)) - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_inter_slice");
WRITE_UVLC(pcSPS->getMaxMTTHierarchyDepth(), "sps_max_mtt_hierarchy_depth_inter_slice");
if (pcSPS->getMaxMTTHierarchyDepth() != 0)
......@@ -908,6 +936,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(floorLog2(pcSPS->getMaxBTSize()) - floorLog2(pcSPS->getMinQTSize(B_SLICE)), "sps_log2_diff_max_bt_min_qt_inter_slice");
WRITE_UVLC(floorLog2(pcSPS->getMaxTTSize()) - floorLog2(pcSPS->getMinQTSize(B_SLICE)), "sps_log2_diff_max_tt_min_qt_inter_slice");
}
#if !JVET_S0132_HLS_REORDER
if (pcSPS->getUseDualITree())
{
WRITE_UVLC(floorLog2(pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)) - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice_chroma");
......@@ -918,9 +947,30 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(floorLog2(pcSPS->getMaxTTSizeIChroma()) - floorLog2(pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)), "sps_log2_diff_max_tt_min_qt_intra_slice_chroma");
}
}
#endif
if (pcSPS->getCTUSize() > 32)
WRITE_FLAG( (pcSPS->getLog2MaxTbSize() - 5) ? 1 : 0, "sps_max_luma_transform_size_64_flag" );
#if JVET_S0074_SPS_REORDER
WRITE_FLAG(pcSPS->getTransformSkipEnabledFlag() ? 1 : 0, "sps_transform_skip_enabled_flag");
if (pcSPS->getTransformSkipEnabledFlag())
{
WRITE_UVLC(pcSPS->getLog2MaxTransformSkipBlockSize() - 2, "log2_transform_skip_max_size_minus2");
WRITE_FLAG(pcSPS->getBDPCMEnabledFlag() ? 1 : 0, "sps_bdpcm_enabled_flag");
}
else
{
CHECK(pcSPS->getBDPCMEnabledFlag(), "BDPCM cannot be used when transform skip is disabled");
}
WRITE_FLAG(pcSPS->getUseMTS() ? 1 : 0, "sps_mts_enabled_flag");
if (pcSPS->getUseMTS())
{
WRITE_FLAG(pcSPS->getUseIntraMTS() ? 1 : 0, "sps_explicit_mts_intra_enabled_flag");
WRITE_FLAG(pcSPS->getUseInterMTS() ? 1 : 0, "sps_explicit_mts_inter_enabled_flag");
}
WRITE_FLAG(pcSPS->getUseLFNST() ? 1 : 0, "sps_lfnst_enabled_flag");
#endif
if (chromaArrayType != CHROMA_400)
{
WRITE_FLAG(pcSPS->getJointCbCrEnabledFlag(), "sps_joint_cbcr_enabled_flag");
......@@ -948,7 +998,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
{
WRITE_FLAG( pcSPS->getCCALFEnabledFlag(), "sps_ccalf_enabled_flag" );
}
#if JVET_S0074_SPS_REORDER
WRITE_FLAG(pcSPS->getUseLmcs() ? 1 : 0, "sps_lmcs_enable_flag");
#else
WRITE_FLAG(pcSPS->getTransformSkipEnabledFlag() ? 1 : 0, "sps_transform_skip_enabled_flag");
if (pcSPS->getTransformSkipEnabledFlag())
{
......@@ -959,7 +1011,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
{
CHECK(pcSPS->getBDPCMEnabledFlag(), "BDPCM cannot be used when transform skip is disabled");
}
#endif
WRITE_FLAG(pcSPS->getUseWP() ? 1 : 0, "sps_weighted_pred_flag"); // Use of Weighting Prediction (P_SLICE)
WRITE_FLAG(pcSPS->getUseWPBiPred() ? 1 : 0, "sps_weighted_bipred_flag"); // Use of Weighting Bi-Prediction (B_SLICE)
......@@ -1072,13 +1124,14 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
CHECK(pcSPS->getHorCollocatedChromaFlag() != 1, "Invalid value for horizontal collocated chroma flag");
CHECK(pcSPS->getVerCollocatedChromaFlag() != 1, "Invalid value for vertical collocated chroma flag");
}
#if !JVET_S0074_SPS_REORDER
WRITE_FLAG( pcSPS->getUseMTS() ? 1 : 0, "sps_mts_enabled_flag" );
if ( pcSPS->getUseMTS() )
{
WRITE_FLAG( pcSPS->getUseIntraMTS() ? 1 : 0, "sps_explicit_mts_intra_enabled_flag" );
WRITE_FLAG( pcSPS->getUseInterMTS() ? 1 : 0, "sps_explicit_mts_inter_enabled_flag" );
}
#endif
CHECK(pcSPS->getMaxNumMergeCand() > MRG_MAX_NUM_CANDS, "More merge candidates signalled than supported");
WRITE_FLAG(pcSPS->getPLTMode() ? 1 : 0, "sps_palette_enabled_flag" );
if (pcSPS->getChromaFormatIdc() == CHROMA_444 && pcSPS->getLog2MaxTbSize() != 6)
......@@ -1095,9 +1148,10 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
CHECK(pcSPS->getMaxNumIBCMergeCand() > IBC_MRG_MAX_NUM_CANDS, "More IBC merge candidates signalled than supported");
WRITE_UVLC(IBC_MRG_MAX_NUM_CANDS - pcSPS->getMaxNumIBCMergeCand(), "six_minus_max_num_ibc_merge_cand");
}
#if !JVET_S0074_SPS_REORDER
WRITE_FLAG(pcSPS->getUseLmcs() ? 1 : 0, "sps_lmcs_enable_flag");
WRITE_FLAG( pcSPS->getUseLFNST() ? 1 : 0, "sps_lfnst_enabled_flag" );
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
WRITE_FLAG( pcSPS->getLadfEnabled() ? 1 : 0, "sps_ladf_enabled_flag" );
if ( pcSPS->getLadfEnabled() )
......
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