diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 7119a8aab8a013181fba514592351e39a6d8e316..61c3a6d9a2998cda8e7336d77f1de026459fd65e 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -3133,7 +3133,6 @@ bool EncAppCfg::xCheckParameter() xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] < m_inputBitDepth[CHANNEL_TYPE_LUMA ]), "MSB-extended bit depth for luma channel (--MSBExtendedBitDepth) must be greater than or equal to input bit depth for luma channel (--InputBitDepth)" ); xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] < m_inputBitDepth[CHANNEL_TYPE_CHROMA]), "MSB-extended bit depth for chroma channel (--MSBExtendedBitDepthC) must be greater than or equal to input bit depth for chroma channel (--InputBitDepthC)" ); -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS bool check_sps_range_extension_flag = m_extendedPrecisionProcessingFlag || m_rrcRiceExtensionEnableFlag || m_persistentRiceAdaptationEnabledFlag || @@ -3141,7 +3140,6 @@ bool EncAppCfg::xCheckParameter() if (m_internalBitDepth[CHANNEL_TYPE_LUMA] <= 10) xConfirmPara( (check_sps_range_extension_flag == 1) , "RExt tools (Extended Precision Processing, RRC Rice Extension, Persistent Rice Adaptation and TSRC Rice Extension) must be disabled for BitDepth is less than or equal to 10 (the value of sps_range_extension_flag shall be 0 when BitDepth is less than or equal to 10.)"); -#endif xConfirmPara( m_chromaFormatIDC >= NUM_CHROMA_FORMAT, "ChromaFormatIDC must be either 400, 420, 422 or 444" ); std::string sTempIPCSC="InputColourSpaceConvert must be empty, "+getListOfColourSpaceConverts(true); diff --git a/source/Lib/CommonLib/ContextModelling.cpp b/source/Lib/CommonLib/ContextModelling.cpp index c7d90841cc0470a28ca48226da0936bed2533560..e9c7b39839868c1b5c7c9c9f9bcd2ff79488f61b 100644 --- a/source/Lib/CommonLib/ContextModelling.cpp +++ b/source/Lib/CommonLib/ContextModelling.cpp @@ -54,11 +54,7 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit &tu, ComponentID comp , m_log2BlockHeight((unsigned) floorLog2(m_height)) , m_maxNumCoeff(m_width * m_height) , m_signHiding(signHide) -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS , m_extendedPrecision(tu.cs->sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag()) -#else - , m_extendedPrecision(tu.cs->sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag() && tu.cs->sps->getBitDepth( m_chType ) > 10) -#endif , m_maxLog2TrDynamicRange(tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)) , m_scanType(SCAN_DIAG) , m_scan( diff --git a/source/Lib/CommonLib/Contexts.h b/source/Lib/CommonLib/Contexts.h index d733b3106538afd5f94c000614903e419599f502..b30e584ef67907804d27896950b7f2c9342e56a6 100644 --- a/source/Lib/CommonLib/Contexts.h +++ b/source/Lib/CommonLib/Contexts.h @@ -382,15 +382,10 @@ public: } } -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS void riceStatReset(int bitDepth, bool persistentRiceAdaptationEnabledFlag) -#else - void riceStatReset(int bitDepth) -#endif { for (std::size_t k = 0; k < RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS; k++) { -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS if (persistentRiceAdaptationEnabledFlag) { CHECK(bitDepth <= 10,"BitDepth shall be larger than 10."); @@ -400,9 +395,6 @@ public: { m_GRAdaptStats[k] = 0; } -#else - m_GRAdaptStats[k] = (bitDepth > 10) ? 2 * floorLog2(bitDepth - 10) : 0; -#endif } } diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 2de5643423977555c08fc61c79f68eefd6b9df93..ea918f3356b296ab2c1792a6618c984f5b2db93f 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -1731,11 +1731,7 @@ public: void setEntropyCodingSyncEnabledFlag(bool val) { m_entropyCodingSyncEnabledFlag = val; } bool getEntryPointsPresentFlag() const { return m_entryPointPresentFlag; } void setEntryPointsPresentFlag(bool val) { m_entryPointPresentFlag = val; } -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS int getMaxLog2TrDynamicRange(ChannelType channelType) const { return getSpsRangeExtension().getExtendedPrecisionProcessingFlag() ? std::min<int>(20, int(m_bitDepths.recon[channelType] + 6)) : 15; } -#else - int getMaxLog2TrDynamicRange(ChannelType channelType) const { return getSpsRangeExtension().getExtendedPrecisionProcessingFlag() && int(m_bitDepths.recon[channelType]) > 10 ? std::min<int>(20, int(m_bitDepths.recon[channelType] + 6)) : 15; } -#endif int getDifferentialLumaChromaBitDepth() const { return int(m_bitDepths.recon[CHANNEL_TYPE_LUMA]) - int(m_bitDepths.recon[CHANNEL_TYPE_CHROMA]); } int getQpBDOffset(ChannelType type) const { return m_qpBDOffset[type]; } void setQpBDOffset(ChannelType type, int i) { m_qpBDOffset[type] = i; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 9d30e64f418bd5886c320c8ab0e15fe66e166248..fea3de2568c9b2eb629ad02bb25f8d8151541c41 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -61,7 +61,6 @@ -#define JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS 1 // JVET-W0178: bitstream constraints on RExt tools for low bit-depth (bit-depth <=10) #define JVET_W0046_RLSCP 1 // JVET-W0046: CE1.1 reverse last significant coefficient position diff --git a/source/Lib/DecoderLib/BinDecoder.cpp b/source/Lib/DecoderLib/BinDecoder.cpp index df60845123c3ad2eddb8e0f2431ffc6a116ea257..97d969ef1d740105966fea8a87d2ca12ec3d34a0 100644 --- a/source/Lib/DecoderLib/BinDecoder.cpp +++ b/source/Lib/DecoderLib/BinDecoder.cpp @@ -97,17 +97,9 @@ void BinDecoderBase::reset( int qp, int initId ) start(); } -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS void BinDecoderBase::riceStatReset(int bitDepth, bool persistentRiceAdaptationEnabledFlag) -#else -void BinDecoderBase::riceStatReset(int bitDepth) -#endif { -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS Ctx::riceStatReset(bitDepth, persistentRiceAdaptationEnabledFlag); -#else - Ctx::riceStatReset(bitDepth); -#endif } unsigned BinDecoderBase::decodeBinEP() diff --git a/source/Lib/DecoderLib/BinDecoder.h b/source/Lib/DecoderLib/BinDecoder.h index 15b6f0ce456751fc586eeef25afe3eedc5aa20b0..985c7f8d1e7c5433c9590e7431cf5a2305310e4c 100644 --- a/source/Lib/DecoderLib/BinDecoder.h +++ b/source/Lib/DecoderLib/BinDecoder.h @@ -61,11 +61,7 @@ public: void start (); void finish (); void reset ( int qp, int initId ); -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS void riceStatReset(int bitDepth, bool persistentRiceAdaptationEnabledFlag); -#else - void riceStatReset(int bitDepth); -#endif #if RExt__DECODER_DEBUG_BIT_STATISTICS void set ( const CodingStatisticsClassType& type) { ptype = &type; } #endif diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index d5c5d364bb853f9f4facea22f555eeb428719c88..0ccdc2228299227973794931a04081a5b58a7335 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -84,11 +84,7 @@ void CABACReader::initCtxModels( Slice& slice ) } m_BinDecoder.reset( qp, (int)sliceType ); m_BinDecoder.setBaseLevel(slice.getRiceBaseLevel()); -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS m_BinDecoder.riceStatReset(slice.getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), slice.getSPS()->getSpsRangeExtension().getPersistentRiceAdaptationEnabledFlag()); -#else - m_BinDecoder.riceStatReset(slice.getSPS()->getBitDepth(CHANNEL_TYPE_LUMA)); -#endif } diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index d31391e26e40a1c8e71db413b2fc7e9bdb9129f0..44f8ea4bf2037a9613b575d16152cdf74bbfdba9 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2103,11 +2103,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) sps_extension_flags[i] = uiCode!=0; } -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS if (pcSPS->getBitDepth(CHANNEL_TYPE_LUMA) <= 10) CHECK(sps_extension_flags[SPS_EXT__REXT] == 1, "The value of sps_range_extension_flag shall be 0 when BitDepth is less than or equal to 10."); -#endif bool bSkipTrailingExtensionBits=false; for(int i=0; i<NUM_SPS_EXTENSION_FLAGS; i++) // loop used so that the order is determined by the enum. diff --git a/source/Lib/EncoderLib/BinEncoder.h b/source/Lib/EncoderLib/BinEncoder.h index ddd5d878fcd46545f96e47e8d7ff457fd60844e8..4e3b9117287290c9bcfe8f2cac8a0e58055c1bc5 100644 --- a/source/Lib/EncoderLib/BinEncoder.h +++ b/source/Lib/EncoderLib/BinEncoder.h @@ -172,11 +172,7 @@ public: void finish (); void restart (); void reset ( int qp, int initId ); -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS void riceStatReset(int bitDepth, bool persistentRiceAdaptationEnabledFlag); -#else - void riceStatReset(int bitDepth); -#endif public: void resetBits (); uint64_t getEstFracBits () const { THROW( "not supported" ); return 0; } diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 40a1dd2634ebabed818de3500f9b12bf65c253e2..7d84b3cd9e8ec9ac8642c95036a8b0817c7c0ab2 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -62,11 +62,7 @@ void CABACWriter::initCtxModels( const Slice& slice ) } m_BinEncoder.reset( qp, (int)sliceType ); m_BinEncoder.setBaseLevel(slice.getRiceBaseLevel()); -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS m_BinEncoder.riceStatReset(slice.getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), slice.getSPS()->getSpsRangeExtension().getPersistentRiceAdaptationEnabledFlag()); // provide bit depth for derivation (CE14_C method) -#else - m_BinEncoder.riceStatReset(slice.getSPS()->getBitDepth(CHANNEL_TYPE_LUMA)); // provide bit depth for derivation (CE14_C method) -#endif } diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 568b9df5f177c425733f2176d243415b98b9eb19..6ea1b50a40290b863ceb5f29f97d73cce134c6b7 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1282,11 +1282,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) #endif #endif -#if JVET_W0178_CONSTRAINTS_ON_REXT_TOOLS if (pcSPS->getBitDepth(CHANNEL_TYPE_LUMA) <= 10) CHECK((sps_extension_flags[SPS_EXT__REXT] == 1), "The value of sps_range_extension_flag shall be 0 when BitDepth is less than or equal to 10."); -#endif for(int i=0; i<NUM_SPS_EXTENSION_FLAGS; i++) {