diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 634662b63a66034dde2f5fba8ef2f0069f1820aa..328a0ceadb23055c40a934a39099096c184ee6fa 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -1632,7 +1632,9 @@ PPS::PPS() , m_numRefIdxL1DefaultActive (1) , m_rpl1IdxPresentFlag (false) , m_TransquantBypassEnabledFlag (false) -#if !JVET_O1136_TS_BDPCM_SIGNALLING +#if JVET_O1136_TS_BDPCM_SIGNALLING +, m_log2MaxTransformSkipBlockSize (2) +#else , m_useTransformSkip (false) #endif , m_entropyCodingSyncEnabledFlag (false) diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 3422d3701c56a94061e90767aaae7f429ab3ce17..7bac2fcb0b7627d851ea7b51f34e0593a24e8262 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -1286,7 +1286,9 @@ private: bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE) bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header bool m_TransquantBypassEnabledFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs. -#if !JVET_O1136_TS_BDPCM_SIGNALLING +#if JVET_O1136_TS_BDPCM_SIGNALLING + int m_log2MaxTransformSkipBlockSize; +#else bool m_useTransformSkip; #endif bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts @@ -1429,7 +1431,10 @@ public: void setTransquantBypassEnabledFlag( bool b ) { m_TransquantBypassEnabledFlag = b; } bool getTransquantBypassEnabledFlag() const { return m_TransquantBypassEnabledFlag; } -#if !JVET_O1136_TS_BDPCM_SIGNALLING +#if JVET_O1136_TS_BDPCM_SIGNALLING + uint32_t getLog2MaxTransformSkipBlockSize() const { return m_log2MaxTransformSkipBlockSize; } + void setLog2MaxTransformSkipBlockSize(uint32_t u) { m_log2MaxTransformSkipBlockSize = u; } +#else bool getUseTransformSkip() const { return m_useTransformSkip; } void setUseTransformSkip( bool b ) { m_useTransformSkip = b; } #endif diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 8978e6191347769ee70c15f71a049f53065d4ee9..f4240e72276f9d62c55f52740ac2c46f3e0ee48a 100755 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -4479,7 +4479,7 @@ uint8_t CU::deriveGbiIdx( uint8_t gbiLO, uint8_t gbiL1 ) bool CU::bdpcmAllowed( const CodingUnit& cu, const ComponentID compID ) { #if JVET_O1136_TS_BDPCM_SIGNALLING - SizeType transformSkipMaxSize = 1 << cu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize(); + SizeType transformSkipMaxSize = 1 << cu.cs->pps->getLog2MaxTransformSkipBlockSize(); #endif bool bdpcmAllowed = compID == COMPONENT_Y; @@ -4524,7 +4524,7 @@ void TU::setCbfAtDepth(TransformUnit &tu, const ComponentID &compID, const unsig bool TU::isTSAllowed(const TransformUnit &tu, const ComponentID compID) { bool tsAllowed = compID == COMPONENT_Y; - const int maxSize = tu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize(); + const int maxSize = tu.cs->pps->getLog2MaxTransformSkipBlockSize(); #if JVET_O1136_TS_BDPCM_SIGNALLING tsAllowed &= tu.cs->sps->getTransformSkipEnabledFlag(); @@ -4556,7 +4556,7 @@ bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID) mtsAllowed &= !tu.cu->ispMode; mtsAllowed &= !tu.cu->sbtInfo; #if JVET_O1136_TS_BDPCM_SIGNALLING - SizeType transformSkipMaxSize = 1 << tu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize(); + SizeType transformSkipMaxSize = 1 << tu.cs->pps->getLog2MaxTransformSkipBlockSize(); mtsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize); #else mtsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE ); diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 91c9ec1632fd0d6f75213610691d56142017a745..b269c6fa0362b1a1fddf36b70e39a7dc1820133e 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -448,7 +448,13 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); READ_FLAG( uiCode, "constrained_intra_pred_flag" ); pcPPS->setConstrainedIntraPred( uiCode ? true : false ); -#if !JVET_O1136_TS_BDPCM_SIGNALLING +#if JVET_O1136_TS_BDPCM_SIGNALLING + if (parameterSetManager->getSPS(pcPPS->getSPSId())->getTransformSkipEnabledFlag()) + { + READ_UVLC(uiCode, "log2_max_transform_skip_block_size_minus2"); + pcPPS->setLog2MaxTransformSkipBlockSize(uiCode + 2); + } +#else READ_FLAG( uiCode, "transform_skip_enabled_flag" ); pcPPS->setUseTransformSkip ( uiCode ? true : false ); #endif diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 85e527c3ced427332fe67e1abf8bdec6fd32dd7f..451aa305fe50be8ce8bbd6f259169d2953c729fc 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1546,10 +1546,12 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) pps.setNumRefIdxL0DefaultActive(bestPos); pps.setNumRefIdxL1DefaultActive(bestPos); pps.setTransquantBypassEnabledFlag(getTransquantBypassEnabledFlag()); -#if !JVET_O1136_TS_BDPCM_SIGNALLING +#if JVET_O1136_TS_BDPCM_SIGNALLING + pps.setLog2MaxTransformSkipBlockSize(m_log2MaxTransformSkipBlockSize); +#else pps.setUseTransformSkip( m_useTransformSkip ); -#endif pps.getPpsRangeExtension().setLog2MaxTransformSkipBlockSize( m_log2MaxTransformSkipBlockSize ); +#endif xInitPPSforTiles(pps); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 58338f9c5e945f45e9a3c8607c620ea2d6764b01..55b63286fce9a1391f2521f9bc2f5f7d6ac30c7f 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -274,7 +274,12 @@ void HLSWriter::codePPS( const PPS* pcPPS ) WRITE_SVLC( pcPPS->getPicInitQPMinus26(), "init_qp_minus26"); WRITE_FLAG( pcPPS->getConstrainedIntraPred() ? 1 : 0, "constrained_intra_pred_flag" ); -#if !JVET_O1136_TS_BDPCM_SIGNALLING +#if JVET_O1136_TS_BDPCM_SIGNALLING + if (pcSPS->getTransformSkipEnabledFlag()) + { + WRITE_UVLC(pcPPS->getLog2MaxTransformSkipBlockSize() - 2, "log2_max_transform_skip_block_size_minus2"); + } +#else WRITE_FLAG( pcPPS->getUseTransformSkip() ? 1 : 0, "transform_skip_enabled_flag" ); #endif WRITE_FLAG( pcPPS->getUseDQP() ? 1 : 0, "cu_qp_delta_enabled_flag" ); @@ -442,11 +447,8 @@ void HLSWriter::codePPS( const PPS* pcPPS ) bool pps_extension_present_flag=false; bool pps_extension_flags[NUM_PPS_EXTENSION_FLAGS]={false}; -#if JVET_O1136_TS_BDPCM_SIGNALLING - pps_extension_flags[PPS_EXT__REXT] = pcPPS->getPpsRangeExtension().settingsDifferFromDefaults(pcSPS->getTransformSkipEnabledFlag()); -#else +#if !JVET_O1136_TS_BDPCM_SIGNALLING pps_extension_flags[PPS_EXT__REXT] = pcPPS->getPpsRangeExtension().settingsDifferFromDefaults(pcPPS->getUseTransformSkip()); -#endif // Other PPS extension flags checked here. @@ -454,7 +456,7 @@ void HLSWriter::codePPS( const PPS* pcPPS ) { pps_extension_present_flag|=pps_extension_flags[i]; } - +#endif WRITE_FLAG( (pps_extension_present_flag?1:0), "pps_extension_present_flag" ); if (pps_extension_present_flag)