diff --git a/source/Lib/CommonLib/DepQuant.cpp b/source/Lib/CommonLib/DepQuant.cpp index 72f65178e982ac2a3892a14fe323a98ca5b7e603..673a445a9efdabf2c1b2b906878e7996c9416d15 100644 --- a/source/Lib/CommonLib/DepQuant.cpp +++ b/source/Lib/CommonLib/DepQuant.cpp @@ -1600,11 +1600,7 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff const uint32_t log2TrWidth = floorLog2(width); const uint32_t log2TrHeight = floorLog2(height); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); @@ -1640,11 +1636,7 @@ void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const Compo const uint32_t log2TrWidth = floorLog2(width); const uint32_t log2TrHeight = floorLog2(height); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); diff --git a/source/Lib/CommonLib/Quant.cpp b/source/Lib/CommonLib/Quant.cpp index b95d60fb332f175377cefb9b49a23744af794b4c..391073096d886714f1f8ab9c9d164354e92c0578 100644 --- a/source/Lib/CommonLib/Quant.cpp +++ b/source/Lib/CommonLib/Quant.cpp @@ -382,11 +382,7 @@ void Quant::dequant(const TransformUnit &tu, const TCoeff transformMaximum = (1 << maxLog2TrDynamicRange) - 1; const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); @@ -1033,11 +1029,7 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf const uint32_t uiLog2TrWidth = floorLog2(uiWidth); const uint32_t uiLog2TrHeight = floorLog2(uiHeight); int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem(useTransformSkip), uiLog2TrWidth, uiLog2TrHeight); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); @@ -1121,11 +1113,7 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff const uint32_t uiLog2TrHeight = floorLog2(uiHeight); int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem(useTransformSkip), uiLog2TrWidth, uiLog2TrHeight); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); @@ -1182,11 +1170,7 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange); const int scalingListType = getScalingListType(tu.cu->predMode, compID); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); @@ -1252,11 +1236,7 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange); const int scalingListType = getScalingListType(tu.cu->predMode, compID); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); diff --git a/source/Lib/CommonLib/QuantRDOQ.cpp b/source/Lib/CommonLib/QuantRDOQ.cpp index 23f3951d3109ee8012c15dc50f1440f7893e5012..b3362f2b86ef4036eba15bbc784a96ee0187c1b7 100644 --- a/source/Lib/CommonLib/QuantRDOQ.cpp +++ b/source/Lib/CommonLib/QuantRDOQ.cpp @@ -635,11 +635,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, const double *const pdErrScale = xGetErrScaleCoeffSL(scalingListType, uiLog2BlockWidth, uiLog2BlockHeight, cQP.rem(isTransformSkip)); const int *const piQCoef = getQuantCoeff(scalingListType, cQP.rem(isTransformSkip), uiLog2BlockWidth, uiLog2BlockHeight); -#if JVET_R0064 const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->slice->getSPS()->getDisableScalingMatrixForLfnstBlks() : false; -#else - const bool disableSMForLFNST = tu.cs->slice->getExplicitScalingListUsed() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false; -#endif const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID)); #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB const bool disableSMForACT = tu.cs->slice->getSPS()->getScalingMatrixForAlternativeColourSpaceDisabledFlag() && (tu.cs->slice->getSPS()->getScalingMatrixDesignatedColourSpaceFlag() == tu.cu->colorTransform); diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 2e2d3aa4b54da1ab1912f8617d24bfc8b8677b26..0ffee7cb17b7e23f7d7c9275c2d613bd2eb86aa2 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -2863,9 +2863,7 @@ SPS::SPS() , m_scalingMatrixAlternativeColourSpaceDisabledFlag( false ) , m_scalingMatrixDesignatedColourSpaceFlag( true ) #endif -#if JVET_R0064 , m_disableScalingMatrixForLfnstBlks( true) -#endif { for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) { @@ -3713,9 +3711,6 @@ void ReferencePictureList::printRefPicInfo() const ScalingList::ScalingList() { -#if !JVET_R0064 - m_disableScalingMatrixForLfnstBlks = true; -#endif m_chromaScalingListPresentFlag = true; for (uint32_t scalingListId = 0; scalingListId < 28; scalingListId++) { diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 28c4fd35db9f91c60dbc4c67c2d964c58ef679f8..a4de9a95b6e107b4392e77e8dadafba2a5651dfd 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -164,10 +164,6 @@ public: ScalingList(); virtual ~ScalingList() { } -#if !JVET_R0064 - bool getDisableScalingMatrixForLfnstBlks() const { return m_disableScalingMatrixForLfnstBlks;} - void setDisableScalingMatrixForLfnstBlks(bool flag) { m_disableScalingMatrixForLfnstBlks = flag;} -#endif int* getScalingListAddress(uint32_t scalingListId) { return &(m_scalingListCoef[scalingListId][0]); } //!< get matrix coefficient const int* getScalingListAddress(uint32_t scalingListId) const { return &(m_scalingListCoef[scalingListId][0]); } //!< get matrix coefficient void checkPredMode(uint32_t scalingListId); @@ -229,9 +225,6 @@ public: private: void outputScalingLists(std::ostream &os) const; -#if !JVET_R0064 - bool m_disableScalingMatrixForLfnstBlks; -#endif bool m_scalingListPredModeFlagIsCopy [30]; //!< reference list index int m_scalingListDC [30]; //!< the DC value of the matrix coefficient for 16x16 uint32_t m_refMatrixId [30]; //!< RefMatrixID @@ -1517,9 +1510,7 @@ private: bool m_scalingMatrixDesignatedColourSpaceFlag; #endif -#if JVET_R0064 bool m_disableScalingMatrixForLfnstBlks; -#endif public: @@ -1589,10 +1580,8 @@ public: void setSubPicTreatedAsPicFlag (const std::vector<bool> &v) { CHECK(v.size()!=m_numSubPics, "number of vector entries must be equal to numSubPics") ;m_subPicTreatedAsPicFlag = v; } void setLoopFilterAcrossSubpicEnabledFlag (const std::vector<bool> &v) { CHECK(v.size()!=m_numSubPics, "number of vector entries must be equal to numSubPics") ;m_loopFilterAcrossSubpicEnabledFlag = v; } -#if JVET_R0064 bool getDisableScalingMatrixForLfnstBlks() const { return m_disableScalingMatrixForLfnstBlks; } void setDisableScalingMatrixForLfnstBlks(bool flag) { m_disableScalingMatrixForLfnstBlks = flag; } -#endif void setSubPicIdMappingExplicitlySignalledFlag( bool b ) { m_subPicIdMappingExplicitlySignalledFlag = b; } bool getSubPicIdMappingExplicitlySignalledFlag() const { return m_subPicIdMappingExplicitlySignalledFlag; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index ffd91ae042c058dcc0f966ade04f3a782be7ec63..e59062982e65ab1de4a91ede816da2798799c18e 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -64,7 +64,6 @@ // Add a flag aud_irap_or_gdr_au_flag to the AUD, and mandate the presence of AUD in each IRAP or GDR AU when vps_max_layers_minus1 is greater than 0 -#define JVET_R0064 1 // JVET-R0064, aspect 2: Move the flag scaling_matrix_for_lfnst_disabled_flag from the scaling_list_data( ) syntax to the SPS. #define RETRAIN_CABAC 1 // CABAC initial values retrained on VTM-9.0rc1 diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 0ac8079dc99f82c370c2eba4562a60322b98000e..142bd15158e889281886612f9ebe5dced98285d8 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2190,12 +2190,10 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) #endif READ_FLAG(uiCode, "sps_explicit_scaling_list_enabled_flag"); pcSPS->setScalingListFlag(uiCode); -#if JVET_R0064 if (pcSPS->getUseLFNST() && pcSPS->getScalingListFlag()) { READ_FLAG(uiCode, "scaling_matrix_for_lfnst_disabled_flag"); pcSPS->setDisableScalingMatrixForLfnstBlks(uiCode ? true : false); } -#endif #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB if (pcSPS->getUseColorTrans() && pcSPS->getScalingListFlag()) @@ -5494,9 +5492,6 @@ void HLSyntaxReader::parseScalingList(ScalingList* scalingList) uint32_t code; bool scalingListCopyModeFlag; -#if !JVET_R0064 - READ_FLAG(code, "scaling_matrix_for_lfnst_disabled_flag"); scalingList->setDisableScalingMatrixForLfnstBlks(code ? true : false); -#endif READ_FLAG(code, "scaling_list_chroma_present_flag"); scalingList->setChromaScalingListPresentFlag(code ? true : false); for (int scalingListId = 0; scalingListId < 28; scalingListId++) diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 57f97f75f7d23443769964819dbb94320d2e873e..00f8f9f39f29b22f5d5ca4b2c6022a7ac7d6207d 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -519,11 +519,7 @@ void EncLib::xInitScalingLists( SPS &sps, APS &aps ) { getTrQuant( jId )->getQuant()->setUseScalingList( true ); } -#if JVET_R0064 sps.setDisableScalingMatrixForLfnstBlks(getDisableScalingMatrixForLfnstBlks()); -#else - aps.getScalingList().setDisableScalingMatrixForLfnstBlks(getDisableScalingMatrixForLfnstBlks()); -#endif #endif } else if(getUseScalingListId() == SCALING_LIST_FILE_READ) @@ -545,11 +541,7 @@ void EncLib::xInitScalingLists( SPS &sps, APS &aps ) } #endif -#if JVET_R0064 sps.setDisableScalingMatrixForLfnstBlks(getDisableScalingMatrixForLfnstBlks()); -#else - aps.getScalingList().setDisableScalingMatrixForLfnstBlks(getDisableScalingMatrixForLfnstBlks()); -#endif } else { diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index ff3f57a11c7890238d3463e455b2c91fa2607b08..a0a9bb7c4a95ca1c45bdf000dfcfd64803b9c7b2 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1362,12 +1362,10 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) // KJS: remove scaling lists? WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0, "sps_scaling_list_enabled_flag" ); -#if JVET_R0064 if (pcSPS->getUseLFNST() && pcSPS->getScalingListFlag()) { WRITE_FLAG(pcSPS->getDisableScalingMatrixForLfnstBlks(), "scaling_matrix_for_lfnst_disabled_flag"); } -#endif #if JVET_R0380_SCALING_MATRIX_DISABLE_YCC_OR_RGB if (pcSPS->getUseColorTrans() && pcSPS->getScalingListFlag()) @@ -3208,9 +3206,6 @@ void HLSWriter::xCodePredWeightTable(PicHeader *picHeader, const SPS *sps) void HLSWriter::codeScalingList( const ScalingList &scalingList ) { //for each size -#if !JVET_R0064 - WRITE_FLAG(scalingList.getDisableScalingMatrixForLfnstBlks(), "scaling_matrix_for_lfnst_disabled_flag"); -#endif WRITE_FLAG(scalingList.getChromaScalingListPresentFlag(), "scaling_list_chroma_present_flag"); for (uint32_t scalingListId = 0; scalingListId < 28; scalingListId++) {