diff --git a/doc/software-manual.tex b/doc/software-manual.tex index f7f7a823673ac956452e674c93a60b0e8a5258fc..1b23a4290c8e9b16a523fb7af6e67861aa5b222d 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -2842,11 +2842,6 @@ This setting is only valid for the 16-bit RExt profiles. Specifies the value of high_precision_prediction_weighting_flag. This setting is only valid for the 16-bit or 4:4:4 RExt profiles. \\ -\Option{CrossComponentPrediction} & -\Default{false} & -When true, specifies the use of the cross component prediction tool (4:4:4 processing only). Version 1 and some Version 2 (RExt) profiles require this to be false. -\\ - \Option{ReconBasedCrossCPredictionEstimate} & \Default{false} & If true, then when determining the alpha value for cross-component prediction, use the reconstructed residual rather than the pre-transform encoder-side residual diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 6039fb4ed385678552ab36058b3ce02c25dfe91f..2e97dd54880210818e655867055a6614091524dd 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -569,7 +569,9 @@ void EncApp::xInitLibCfg() m_cEncLib.setUseMIP ( m_MIP ); m_cEncLib.setUseFastMIP ( m_useFastMIP ); m_cEncLib.setFastLocalDualTreeMode ( m_fastLocalDualTreeMode ); +#if !REMOVE_PPS_REXT m_cEncLib.setCrossComponentPredictionEnabledFlag ( m_crossComponentPredictionEnabledFlag ); +#endif m_cEncLib.setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate ); #if !JVET_Q0441_SAO_MOD_12_BIT m_cEncLib.setLog2SaoOffsetScale ( CHANNEL_TYPE_LUMA , m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 98c5503d0203c2bb2af06a9a2bad5e8c3abb0ddb..2a1d9ab19bd15c4051ce5ea10db717754721ae95 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1124,7 +1124,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("DeblockingFilterMetric", m_DeblockingFilterMetric, false) #endif // Coding tools +#if !REMOVE_PPS_REXT ("CrossComponentPrediction", m_crossComponentPredictionEnabledFlag, false, "Enable the use of cross-component prediction (not valid in V1 profiles)") +#endif ("ReconBasedCrossCPredictionEstimate", m_reconBasedCrossCPredictionEstimate, false, "When determining the alpha value for cross-component prediction, use the decoded residual rather than the pre-transform encoder-side residual") #if !JVET_Q0441_SAO_MOD_12_BIT ("SaoLumaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_LUMA], 0, "Specify the luma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP") @@ -2438,7 +2440,9 @@ bool EncAppCfg::xCheckParameter() xConfirmPara(m_internalBitDepth[CHANNEL_TYPE_CHROMA] != m_internalBitDepth[CHANNEL_TYPE_LUMA], "The internalBitDepth must be the same for luma and chroma"); if (m_profile==Profile::MAIN_10 || m_profile==Profile::MAIN_444_10) { +#if !REMOVE_PPS_REXT xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for given profile."); +#endif xConfirmPara(m_log2MaxTransformSkipBlockSize>=6, "Transform Skip Log2 Max Size must be less or equal to 5 for given profile."); xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for given profile."); xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for given profile."); @@ -2512,6 +2516,7 @@ bool EncAppCfg::xCheckParameter() m_pictureTimingSEIEnabled = false; } +#if !REMOVE_PPS_REXT if(m_crossComponentPredictionEnabledFlag && (m_chromaFormatIDC != CHROMA_444)) { msg( WARNING, "****************************************************************************\n"); @@ -2520,7 +2525,7 @@ bool EncAppCfg::xCheckParameter() m_crossComponentPredictionEnabledFlag = false; } - +#endif xConfirmPara( m_bufferingPeriodSEIEnabled == true && m_RCCpbSize == 0, "RCCpbSize must be greater than zero, when buffering period SEI is enabled" ); xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)"); @@ -3754,7 +3759,9 @@ void EncAppCfg::xPrintParameter() msg( DETAILS, "explicit_rdpcm_enabled_flag : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] ? "Enabled" : "Disabled") ); msg( DETAILS, "transform_skip_rotation_enabled_flag : %s\n", (m_transformSkipRotationEnabledFlag ? "Enabled" : "Disabled") ); msg( DETAILS, "transform_skip_context_enabled_flag : %s\n", (m_transformSkipContextEnabledFlag ? "Enabled" : "Disabled") ); +#if !REMOVE_PPS_REXT msg( DETAILS, "cross_component_prediction_enabled_flag: %s\n", (m_crossComponentPredictionEnabledFlag ? (m_reconBasedCrossCPredictionEstimate ? "Enabled (reconstructed-residual-based estimate)" : "Enabled (encoder-side-residual-based estimate)") : "Disabled") ); +#endif msg( DETAILS, "high_precision_offsets_enabled_flag : %s\n", (m_highPrecisionOffsetsEnabledFlag ? "Enabled" : "Disabled") ); msg( DETAILS, "persistent_rice_adaptation_enabled_flag: %s\n", (m_persistentRiceAdaptationEnabledFlag ? "Enabled" : "Disabled") ); msg( DETAILS, "cabac_bypass_alignment_enabled_flag : %s\n", (m_cabacBypassAlignmentEnabledFlag ? "Enabled" : "Disabled") ); diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 45a8d427cf6429f2ef6974b0fa75bb505293243f..ad2704015f439ce7bc9457ce32fa5e0f745a36d6 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -212,7 +212,9 @@ protected: GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of pictures in the decoded picture buffer +#if !REMOVE_PPS_REXT bool m_crossComponentPredictionEnabledFlag; ///< flag enabling the use of cross-component prediction +#endif bool m_reconBasedCrossCPredictionEstimate; ///< causes the alpha calculation in encoder search to be based on the decoded residual rather than the pre-transform encoder-side residual #if !JVET_Q0441_SAO_MOD_12_BIT uint32_t m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]; ///< number of bits for the upward bit shift operation on the decoded SAO offsets diff --git a/source/Lib/CommonLib/CrossCompPrediction.cpp b/source/Lib/CommonLib/CrossCompPrediction.cpp index 95d99cfc3c2fadfff5c0edc769090c708ddd0397..a334dae975719724430fc4244119a048d0bc1ee2 100644 --- a/source/Lib/CommonLib/CrossCompPrediction.cpp +++ b/source/Lib/CommonLib/CrossCompPrediction.cpp @@ -42,6 +42,8 @@ #include "CodingStructure.h" #include "Slice.h" +#if !REMOVE_PPS_REXT + //! \ingroup CommonLib //! \{ @@ -129,3 +131,4 @@ void CrossComponentPrediction::crossComponentPrediction( TransformUnit &t } } } +#endif diff --git a/source/Lib/CommonLib/CrossCompPrediction.h b/source/Lib/CommonLib/CrossCompPrediction.h index f4bb776bd363db942a802d6bdb59c12d87813750..7ed591f1c3a7c337efe87989d85ef5e263521e22 100644 --- a/source/Lib/CommonLib/CrossCompPrediction.h +++ b/source/Lib/CommonLib/CrossCompPrediction.h @@ -30,7 +30,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ - +#if !REMOVE_PPS_REXT /** \file Prediction.h \brief prediction class (header) */ @@ -69,3 +69,4 @@ public: //! \} #endif // __PREDICTION__ +#endif diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 9073bb3e46c5f805f9155817051473fc990d96f1..5540139f995b1fe74299f7b528742b18a9bb229f 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -2498,6 +2498,7 @@ SubPic::~SubPic() } #endif +#if !REMOVE_PPS_REXT PPSRExt::PPSRExt() : m_crossComponentPredictionEnabledFlag(false) #if JVET_Q0441_SAO_MOD_12_BIT @@ -2511,7 +2512,8 @@ PPSRExt::PPSRExt() } #endif } - +#endif + PPS::PPS() : m_PPSId (0) , m_SPSId (0) @@ -2582,7 +2584,9 @@ PPS::PPS() #endif , m_picWidthInLumaSamples(352) , m_picHeightInLumaSamples( 288 ) +#if !REMOVE_PPS_REXT , m_ppsRangeExtension () +#endif , pcv (NULL) { m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.CbOffset = 0; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0. This is initialised here and never subsequently changed. diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index eb2d77d487fa7b0af7c1f3ed994af172c8b7a9bd..b98776a366071273f6395ac2ae34768fea9fa8bc 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -1792,7 +1792,7 @@ void setCCALFEnabledFlag( bool b ) #endif }; - +#if !REMOVE_PPS_REXT /// Reference Picture Lists class @@ -1829,7 +1829,7 @@ public: void setLog2SaoOffsetScale(ChannelType type, uint32_t uiBitShift) { m_log2SaoOffsetScale[type] = uiBitShift; } #endif }; - +#endif /// PPS class class PPS @@ -1957,8 +1957,10 @@ private: Window m_conformanceWindow; Window m_scalingWindow; +#if !REMOVE_PPS_REXT PPSRExt m_ppsRangeExtension; - +#endif + public: PreCalcValues *pcv; @@ -2223,8 +2225,10 @@ public: bool getQpDeltaInfoInPhFlag() const { return m_qpDeltaInfoInPhFlag; } #endif +#if !REMOVE_PPS_REXT const PPSRExt& getPpsRangeExtension() const { return m_ppsRangeExtension; } PPSRExt& getPpsRangeExtension() { return m_ppsRangeExtension; } +#endif void setPicWidthInLumaSamples( uint32_t u ) { m_picWidthInLumaSamples = u; } uint32_t getPicWidthInLumaSamples() const { return m_picWidthInLumaSamples; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index fb3957887df80ffa4646ef9fd32b4ab0d7c642db..e5d30b279a4056c5241bcbfc0f4f06405eaf0571 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -240,6 +240,7 @@ #define APPLY_SBT_SL_ON_MTS 1 // apply save & load fast algorithm on inter MTS when SBT is on +#define REMOVE_PPS_REXT 1 // remove RExt PPS extension typedef std::pair<int, bool> TrMode; typedef std::pair<int, int> TrCost; diff --git a/source/Lib/CommonLib/Unit.cpp b/source/Lib/CommonLib/Unit.cpp index 22f05d2c966080555aaba76d0503ad52e0009297..03b0cf861927dee870906902dcbbf9d0c7194968 100644 --- a/source/Lib/CommonLib/Unit.cpp +++ b/source/Lib/CommonLib/Unit.cpp @@ -771,7 +771,9 @@ void TransformUnit::initData() { cbf[i] = 0; rdpcm[i] = NUMBER_OF_RDPCM_MODES; +#if !REMOVE_PPS_REXT compAlpha[i] = 0; +#endif mtsIdx[i] = MTS_DCT2_DCT2; } depth = 0; @@ -819,7 +821,9 @@ TransformUnit& TransformUnit::operator=(const TransformUnit& other) } cbf[i] = other.cbf[i]; rdpcm[i] = other.rdpcm[i]; +#if !REMOVE_PPS_REXT compAlpha[i] = other.compAlpha[i]; +#endif mtsIdx[i] = other.mtsIdx[i]; } depth = other.depth; @@ -845,8 +849,9 @@ void TransformUnit::copyComponentFrom(const TransformUnit& other, const Componen cbf[i] = other.cbf[i]; rdpcm[i] = other.rdpcm[i]; +#if !REMOVE_PPS_REXT compAlpha[i] = other.compAlpha[i]; - +#endif depth = other.depth; mtsIdx[i] = other.mtsIdx[i]; noResidual = other.noResidual; diff --git a/source/Lib/CommonLib/Unit.h b/source/Lib/CommonLib/Unit.h index 5d147c31f3eee7d80406a3ff00b3d5f196866bb5..2412174df3b69082356174d2446199977135d65b 100644 --- a/source/Lib/CommonLib/Unit.h +++ b/source/Lib/CommonLib/Unit.h @@ -471,7 +471,9 @@ struct TransformUnit : public UnitArea uint8_t jointCbCr; uint8_t cbf [ MAX_NUM_TBLOCKS ]; RDPCMMode rdpcm [ MAX_NUM_TBLOCKS ]; +#if !REMOVE_PPS_REXT int8_t compAlpha [ MAX_NUM_TBLOCKS ]; +#endif TransformUnit() : chType( CH_L ) { } TransformUnit(const UnitArea& unit); diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 00860acaf37a540cf64a0fe3a9a7ca6bf2db9c61..c7a92d38d51f05425ac02bc372a4927bb3cf0790 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -4019,12 +4019,13 @@ int TU::getICTMode( const TransformUnit& tu, int jointCbCr ) return g_ictModes[ tu.cs->picHeader->getJointCbCrSignFlag() ][ jointCbCr ]; } +#if !REMOVE_PPS_REXT bool TU::hasCrossCompPredInfo( const TransformUnit &tu, const ComponentID &compID ) { return (isChroma(compID) && tu.cs->pps->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && TU::getCbf(tu, COMPONENT_Y) && (!CU::isIntra(*tu.cu) || PU::isChromaIntraModeCrossCheckMode(*tu.cs->getPU(tu.blocks[compID].pos(), toChannelType(compID))))); } - +#endif bool TU::needsSqrt2Scale( const TransformUnit &tu, const ComponentID &compID ) { diff --git a/source/Lib/CommonLib/UnitTools.h b/source/Lib/CommonLib/UnitTools.h index 3807321f851979aa4cdd2aa63b62ca1156880703..bf8a058370742abebd006cb515bf7250486e7506 100644 --- a/source/Lib/CommonLib/UnitTools.h +++ b/source/Lib/CommonLib/UnitTools.h @@ -195,8 +195,9 @@ namespace TU bool getCbfAtDepth (const TransformUnit &tu, const ComponentID &compID, const unsigned &depth); void setCbfAtDepth ( TransformUnit &tu, const ComponentID &compID, const unsigned &depth, const bool &cbf); bool isTSAllowed (const TransformUnit &tu, const ComponentID compID); +#if !REMOVE_PPS_REXT bool hasCrossCompPredInfo (const TransformUnit &tu, const ComponentID &compID); - +#endif bool needsSqrt2Scale ( const TransformUnit &tu, const ComponentID &compID ); bool needsBlockSizeTrafoScale ( const TransformUnit &tu, const ComponentID &compID ); diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp index a70a852e437f651c1eea8a72e614309faa349b93..9a4130a11a652eb1ed15146b0ffece3a6c9f3643 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp +++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp @@ -968,6 +968,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::JointCbCr), tu.jointCbCr); } +#if !REMOVE_PPS_REXT bool lumaOnly = ( cu.chromaFormat == CHROMA_400 || !tu.blocks[COMPONENT_Cb].valid() ); if( !lumaOnly ) { @@ -980,7 +981,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::CompAlphaCr), tu.compAlpha[COMPONENT_Cr] ); } } - +#endif if( !(cu.chromaFormat == CHROMA_400 || (cu.isSepTree() && cu.chType == CHANNEL_TYPE_LUMA)) ) { DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cb), tu.cbf[COMPONENT_Cb]); diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.h b/source/Lib/CommonLib/dtrace_blockstatistics.h index d804555d5f1458970b2ce7fd9c4dd8bd64af50ce..a900eec517a7625e704218939fc3615456ba07b2 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.h +++ b/source/Lib/CommonLib/dtrace_blockstatistics.h @@ -72,8 +72,10 @@ enum class BlockStatistic { IndependentSliceIdx, LFNSTIdx, JointCbCr, +#if !REMOVE_PPS_REXT CompAlphaCb, CompAlphaCr, +#endif RDPCM_Y, RDPCM_Cb, RDPCM_Cr, @@ -175,8 +177,10 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::IndependentSliceIdx, std::tuple<std::string, BlockStatisticType, std::string>{"IndependentSliceIdx", BlockStatisticType::Integer, ""}}, { BlockStatistic::LFNSTIdx, std::tuple<std::string, BlockStatisticType, std::string>{"LFNSTIdx", BlockStatisticType::Integer, "[0, 3]"}}, { BlockStatistic::JointCbCr, std::tuple<std::string, BlockStatisticType, std::string>{"JointCbCr", BlockStatisticType::Flag, ""}}, +#if !REMOVE_PPS_REXT { BlockStatistic::CompAlphaCb, std::tuple<std::string, BlockStatisticType, std::string>{"CompAlphaCb", BlockStatisticType::Integer, ""}}, { BlockStatistic::CompAlphaCr, std::tuple<std::string, BlockStatisticType, std::string>{"CompAlphaCr", BlockStatisticType::Integer, ""}}, +#endif { BlockStatistic::RDPCM_Y, std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Y", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}}, { BlockStatistic::RDPCM_Cb, std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Cb", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}}, { BlockStatistic::RDPCM_Cr, std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Cr", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}}, diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 909dad9cf388c605c89b6d62750614ef5b539863..1914eda59adc305a95c310200c72bbcb224ec5c8 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -2972,10 +2972,12 @@ void CABACReader::transform_unit( TransformUnit& tu, CUCtx& cuCtx, Partitioner& { for( ComponentID compID = COMPONENT_Cb; compID <= COMPONENT_Cr; compID = ComponentID( compID + 1 ) ) { +#if !REMOVE_PPS_REXT if( TU::hasCrossCompPredInfo( tu, compID ) ) { cross_comp_pred( tu, compID ); } +#endif if( tu.cbf[ compID ] ) { residual_coding( tu, compID, cuCtx ); @@ -3721,7 +3723,7 @@ void CABACReader::residual_coding_subblockTS( CoeffCodingContext& cctx, TCoeff* } } - +#if !REMOVE_PPS_REXT //================================================================================ // clause 7.3.8.12 //-------------------------------------------------------------------------------- @@ -3754,7 +3756,7 @@ void CABACReader::cross_comp_pred( TransformUnit& tu, ComponentID compID ) DTRACE( g_trace_ctx, D_SYNTAX, "cross_comp_pred() etype=%d pos=(%d,%d) alpha=%d\n", compID, tu.blocks[compID].x, tu.blocks[compID].y, tu.compAlpha[compID] ); tu.compAlpha[compID] = alpha; } - +#endif //================================================================================ diff --git a/source/Lib/DecoderLib/CABACReader.h b/source/Lib/DecoderLib/CABACReader.h index e1b33238b52ff4a9db971d2a50615dc0cb8be9f2..8d0b2bf0b32d09612aaf2511931c2c260b4d0b9b 100644 --- a/source/Lib/DecoderLib/CABACReader.h +++ b/source/Lib/DecoderLib/CABACReader.h @@ -144,8 +144,10 @@ public: void residual_coding_subblockTS( CoeffCodingContext& cctx, TCoeff* coeff ); void joint_cb_cr ( TransformUnit& tu, const int cbfMask ); +#if !REMOVE_PPS_REXT // cross component prediction (clause 7.3.8.12) void cross_comp_pred ( TransformUnit& tu, ComponentID compID ); +#endif private: unsigned unary_max_symbol ( unsigned ctxId0, unsigned ctxIdN, unsigned maxSymbol ); diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index 690e7dd3ea37db11367514d49c90a00ec7340c92..6a53cc354bef040192e6cd68ad721122dc257598 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -281,11 +281,12 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) { piResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID)); } +#if !REMOVE_PPS_REXT if( isChroma(compID) && tu.compAlpha[compID] != 0 ) { CrossComponentPrediction::crossComponentPrediction( tu, compID, cs.getResiBuf( tu.Y() ), piResi, piResi, true ); } - +#endif if( !tu.cu->ispMode || !isLuma( compID ) ) { @@ -867,10 +868,12 @@ void DecCu::xDecodeInterTU( TransformUnit & currTU, const ComponentID compID ) { resiBuf.scaleSignal(currTU.getChromaAdj(), 0, currTU.cu->cs->slice->clpRng(compID)); } +#if !REMOVE_PPS_REXT if( isChroma( compID ) && currTU.compAlpha[compID] != 0 ) { CrossComponentPrediction::crossComponentPrediction( currTU, compID, cs.getResiBuf( currTU.Y() ), resiBuf, resiBuf, true ); } +#endif } void DecCu::xDecodeInterTexture(CodingUnit &cu) diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index dddde5651e8336401aba8f57a499852d965de6d8..ce9368c04715e90b2f6c4912796f68ce84475687 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -870,6 +870,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) READ_FLAG( uiCode, "pps_extension_present_flag"); if (uiCode) { +#if !REMOVE_PPS_REXT #if ENABLE_TRACING || RExt__DECODER_DEBUG_BIT_STATISTICS static const char *syntaxStrings[]={ "pps_range_extension_flag", "pps_multilayer_extension_flag", @@ -918,11 +919,14 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) } if (bSkipTrailingExtensionBits) { +#endif while ( xMoreRbspData() ) { READ_FLAG( uiCode, "pps_extension_data_flag"); } +#if !REMOVE_PPS_REXT } +#endif } xReadRbspTrailingBits(); } diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 5525fe5b912ef1a903416df16cf684a69f4eddda..7b1e5c9fc0c154843610994fae3ed53315d8fb5f 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -2694,10 +2694,12 @@ void CABACWriter::transform_unit( const TransformUnit& tu, CUCtx& cuCtx, Partiti { for( ComponentID compID = COMPONENT_Cb; compID <= COMPONENT_Cr; compID = ComponentID( compID + 1 ) ) { +#if !REMOVE_PPS_REXT if( TU::hasCrossCompPredInfo( tu, compID ) ) { cross_comp_pred( tu, compID ); } +#endif if( cbf[ compID ] ) { residual_coding( tu, compID, &cuCtx ); @@ -3378,7 +3380,7 @@ void CABACWriter::residual_coding_subblockTS( CoeffCodingContext& cctx, const TC - +#if !REMOVE_PPS_REXT //================================================================================ // clause 7.3.8.12 //-------------------------------------------------------------------------------- @@ -3418,7 +3420,7 @@ void CABACWriter::cross_comp_pred( const TransformUnit& tu, ComponentID compID ) DTRACE( g_trace_ctx, D_SYNTAX, "cross_comp_pred() etype=%d pos=(%d,%d) alpha=%d\n", compID, tu.blocks[compID].x, tu.blocks[compID].y, tu.compAlpha[compID] ); } - +#endif diff --git a/source/Lib/EncoderLib/CABACWriter.h b/source/Lib/EncoderLib/CABACWriter.h index 8f2124456874fb612b18025a44150acf086681ab..cd8dc1ae6a53ba593573f93963f9c82767a9efcc 100644 --- a/source/Lib/EncoderLib/CABACWriter.h +++ b/source/Lib/EncoderLib/CABACWriter.h @@ -153,9 +153,11 @@ public: void residual_coding_subblockTS( CoeffCodingContext& cctx, const TCoeff* coeff ); void joint_cb_cr ( const TransformUnit& tu, const int cbfMask ); +#if !REMOVE_PPS_REXT // cross component prediction (clause 7.3.8.12) void cross_comp_pred ( const TransformUnit& tu, ComponentID compID ); - +#endif + void codeAlfCtuEnableFlags ( CodingStructure& cs, ChannelType channel, AlfParam* alfParam); void codeAlfCtuEnableFlags ( CodingStructure& cs, ComponentID compID, AlfParam* alfParam); void codeAlfCtuEnableFlag ( CodingStructure& cs, uint32_t ctuRsAddr, const int compIdx, AlfParam* alfParam ); diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 727c03c667574b552685bba385d8bbe7e082f7c0..e1cc0f71b4c1104c62c3893e6117c3332e23c8b2 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -478,7 +478,9 @@ protected: bool m_useFastDecisionForMerge; bool m_bUseCbfFastMode; bool m_useEarlySkipDetection; +#if !REMOVE_PPS_REXT bool m_crossComponentPredictionEnabledFlag; +#endif bool m_reconBasedCrossCPredictionEstimate; #if !JVET_Q0441_SAO_MOD_12_BIT uint32_t m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]; @@ -1395,8 +1397,10 @@ public: void setGopBasedTemporalFilterEnabled(bool flag) { m_gopBasedTemporalFilterEnabled = flag; } bool getGopBasedTemporalFilterEnabled() { return m_gopBasedTemporalFilterEnabled; } +#if !REMOVE_PPS_REXT bool getCrossComponentPredictionEnabledFlag () const { return m_crossComponentPredictionEnabledFlag; } void setCrossComponentPredictionEnabledFlag (const bool value) { m_crossComponentPredictionEnabledFlag = value; } +#endif bool getUseReconBasedCrossCPredictionEstimate () const { return m_reconBasedCrossCPredictionEstimate; } void setUseReconBasedCrossCPredictionEstimate (const bool value) { m_reconBasedCrossCPredictionEstimate = value; } #if !JVET_Q0441_SAO_MOD_12_BIT diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 08d00c4938e717fd856bd5e578fdda39479d0360..a4399ed4bb1240c3bc699483daf6f8ecfc9f3689 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1691,12 +1691,13 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) { pps.clearChromaQpOffsetList(); } +#if !REMOVE_PPS_REXT pps.getPpsRangeExtension().setCrossComponentPredictionEnabledFlag(m_crossComponentPredictionEnabledFlag); #if !JVET_Q0441_SAO_MOD_12_BIT pps.getPpsRangeExtension().setLog2SaoOffsetScale(CHANNEL_TYPE_LUMA, m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA ]); pps.getPpsRangeExtension().setLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA, m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA]); #endif - +#endif { int baseQp = 26; if( 16 == getGOPSize() ) diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index 91fcfd1333db435b5df1dd5532b29c05c5ff5cd6..0baacef5d8076e13b2d7319f2c4821724329b784 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -6164,10 +6164,12 @@ void InterSearch::xEncodeInterResidualQT(CodingStructure &cs, Partitioner &parti const int cbfMask = ( TU::getCbf( currTU, COMPONENT_Cb ) ? 2 : 0) + ( TU::getCbf( currTU, COMPONENT_Cr ) ? 1 : 0 ); m_CABACEstimator->joint_cb_cr( currTU, cbfMask ); } +#if !REMOVE_PPS_REXT if( TU::hasCrossCompPredInfo( currTU, compID ) ) { m_CABACEstimator->cross_comp_pred( currTU, compID ); } +#endif if( TU::getCbf( currTU, compID ) ) { m_CABACEstimator->residual_coding( currTU, compID ); @@ -6482,7 +6484,9 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par Distortion uiSingleDist = 0; Distortion uiSingleDistComp [3] = { 0, 0, 0 }; uint64_t uiSingleFracBits[3] = { 0, 0, 0 }; +#if !REMOVE_PPS_REXT TCoeff uiAbsSum [3] = { 0, 0, 0 }; +#endif const TempCtx ctxStart ( m_CtxCache, m_CABACEstimator->getCtx() ); TempCtx ctxBest ( m_CtxCache ); @@ -6538,9 +6542,11 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par continue; } - +#if !REMOVE_PPS_REXT const bool isCrossCPredictionAvailable = TU::hasCrossCompPredInfo( tu, compID ); - +#endif + +#if !REMOVE_PPS_REXT int8_t preCalcAlpha = 0; const CPelBuf lumaResi = csFull->getResiBuf(tu.Y()); @@ -6549,7 +6555,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par csFull->getResiBuf( compArea ).copyFrom( cs.getOrgResiBuf( compArea ) ); preCalcAlpha = xCalcCrossComponentPredictionAlpha( tu, compID, m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate() ); } - +#endif const bool tsAllowed = TU::isTSAllowed(tu, compID) && (isLuma(compID) || (isChroma(compID) && m_pcEncCfg->getUseChromaTS())); const bool mtsAllowed = CU::isMTSAllowed( *tu.cu, compID ); @@ -6607,7 +6613,9 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par m_pcRdCost->lambdaAdjustColorTrans(true, compID); } +#if !REMOVE_PPS_REXT const int crossCPredictionModesToTest = preCalcAlpha != 0 ? 2 : 1; +#endif const int numTransformCandidates = nNumTransformCands; #if !JVET_Q0695_CHROMA_TS_JCCR const bool isOneMode = crossCPredictionModesToTest == 1 && numTransformCandidates == 1; @@ -6616,6 +6624,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par #endif for( int transformMode = 0; transformMode < numTransformCandidates; transformMode++ ) { +#if !REMOVE_PPS_REXT for( int crossCPredictionModeId = 0; crossCPredictionModeId < crossCPredictionModesToTest; crossCPredictionModeId++ ) { const bool isFirstMode = transformMode == 0 && crossCPredictionModeId == 0; @@ -6623,7 +6632,12 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par const bool isLastMode = ( transformMode + 1 ) == numTransformCandidates && ( crossCPredictionModeId + 1 ) == crossCPredictionModesToTest; #endif const bool bUseCrossCPrediction = crossCPredictionModeId != 0; - +#else + const bool isFirstMode = transformMode == 0; +#if !JVET_Q0695_CHROMA_TS_JCCR + const bool isLastMode = ( transformMode + 1 ) == numTransformCandidates; +#endif +#endif // copy the original residual into the residual buffer csFull->getResiBuf(compArea).copyFrom(cs.getOrgResiBuf(compArea)); @@ -6648,8 +6662,9 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par #endif tu.mtsIdx[compID] = trModes[transformMode].first; } +#if !REMOVE_PPS_REXT tu.compAlpha[compID] = bUseCrossCPrediction ? preCalcAlpha : 0; - +#endif QpParam cQP(tu, compID); // note: uses tu.transformSkip[compID] #if !JVET_Q0820_ACT if (colorTransFlag) @@ -6684,11 +6699,13 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par Distortion nonCoeffDist = 0; double nonCoeffCost = 0; +#if !REMOVE_PPS_REXT if (bUseCrossCPrediction) { PelBuf resiBuf = csFull->getResiBuf( compArea ); crossComponentPrediction( tu, compID, lumaResi, resiBuf, resiBuf, false ); } +#endif if (slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4) { PelBuf resiBuf = csFull->getResiBuf(compArea); @@ -6720,6 +6737,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par const CPelBuf zeroBuf(m_pTempPel, compArea); const CPelBuf orgResi = csFull->getOrgResiBuf( compArea ); +#if !REMOVE_PPS_REXT if (bUseCrossCPrediction) { PelBuf resi = csFull->getResiBuf( compArea ); @@ -6727,6 +6745,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par nonCoeffDist = m_pcRdCost->getDistPart( orgResi, resi, channelBitDepth, compID, DF_SSE ); } else +#endif { nonCoeffDist = m_pcRdCost->getDistPart( zeroBuf, orgResi, channelBitDepth, compID, DF_SSE ); // initialized with zero residual distortion } @@ -6736,10 +6755,12 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par const bool prevCbf = ( compID == COMPONENT_Cr ? tu.cbf[COMPONENT_Cb] : false ); m_CABACEstimator->cbf_comp( *csFull, false, compArea, currDepth, prevCbf ); +#if !REMOVE_PPS_REXT if( isCrossCPredictionAvailable ) { m_CABACEstimator->cross_comp_pred( tu, compID ); } +#endif } nonCoeffFracBits = m_CABACEstimator->getEstFracBits(); @@ -6788,11 +6809,13 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par m_CABACEstimator->joint_cb_cr( tu, cbfMask ); } +#if !REMOVE_PPS_REXT if( isCrossCPredictionAvailable ) { m_CABACEstimator->cross_comp_pred( tu, compID ); } -#if JVET_Q0516_MTS_SIGNALLING_DC_ONLY_COND +#endif +#if JVET_Q0516_MTS_SIGNALLING_DC_ONLY_COND CUCtx cuCtx; cuCtx.isDQPCoded = true; cuCtx.isChromaQpAdjCoded = true; @@ -6820,11 +6843,12 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par resiBuf.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID)); } +#if !REMOVE_PPS_REXT if (bUseCrossCPrediction) { crossComponentPrediction(tu, compID, lumaResi, resiBuf, resiBuf, true); } - +#endif currCompDist = m_pcRdCost->getDistPart(orgResiBuf, resiBuf, channelBitDepth, compID, DF_SSE); #if WCG_EXT @@ -6836,7 +6860,11 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par } #endif } +#if !REMOVE_PPS_REXT else if( transformMode > 0 && !bUseCrossCPrediction ) +#else + else if( transformMode > 0 ) +#endif { currCompCost = MAX_DOUBLE; } @@ -6865,11 +6893,14 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par currCompCost = nonCoeffCost; } +#if !REMOVE_PPS_REXT uiAbsSum[compID] = currAbsSum; +#endif uiSingleDistComp[compID] = currCompDist; uiSingleFracBits[compID] = currCompFracBits; minCost[compID] = currCompCost; +#if !REMOVE_PPS_REXT if (uiAbsSum[compID] == 0) { if (bUseCrossCPrediction) @@ -6880,7 +6911,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par crossComponentPrediction( tu, compID, lumaResi, zeroBuf, resiBuf, true ); } } - +#endif #if !JVET_Q0695_CHROMA_TS_JCCR if( !isLastMode || (compID != COMPONENT_Y && !tu.noResidual) ) { @@ -6897,7 +6928,9 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par { CHECK( currCompFracBits > 0 || currAbsSum, "currCompFracBits > 0 when tu noResidual" ); } +#if !REMOVE_PPS_REXT } +#endif } #if !JVET_Q0695_CHROMA_TS_JCCR @@ -7028,8 +7061,10 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par double currCompCost = 0; tu.jointCbCr = (uint8_t) cbfMask; +#if !REMOVE_PPS_REXT tu.compAlpha[COMPONENT_Cb] = tu.compAlpha[COMPONENT_Cr] = 0; - // encoder bugfix: initialize mtsIdx for chroma under JointCbCrMode. +#endif + // encoder bugfix: initialize mtsIdx for chroma under JointCbCrMode. #if JVET_Q0695_CHROMA_TS_JCCR tu.mtsIdx[codeCompId] = trModes[modeId].first; tu.mtsIdx[otherCompId] = MTS_DCT2_DCT2; @@ -7188,8 +7223,10 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par // evaluate if( currCompCost < minCostCbCr ) { +#if !REMOVE_PPS_REXT uiAbsSum[COMPONENT_Cb] = currAbsSum; uiAbsSum[COMPONENT_Cr] = currAbsSum; +#endif uiSingleDistComp[COMPONENT_Cb] = currCompDistCb; uiSingleDistComp[COMPONENT_Cr] = currCompDistCr; if (colorTransFlag) @@ -7280,10 +7317,12 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par const int cbfMask = ( TU::getCbf( tu, COMPONENT_Cb ) ? 2 : 0 ) + ( TU::getCbf( tu, COMPONENT_Cr ) ? 1 : 0 ); m_CABACEstimator->joint_cb_cr(tu, cbfMask); } +#if !REMOVE_PPS_REXT if( cs.pps->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && isChroma(compID) && uiAbsSum[COMPONENT_Y] ) { m_CABACEstimator->cross_comp_pred( tu, compID ); } +#endif if( TU::getCbf( tu, compID ) ) { m_CABACEstimator->residual_coding( tu, compID ); diff --git a/source/Lib/EncoderLib/InterSearch.h b/source/Lib/EncoderLib/InterSearch.h index 27430d67c7660e084b8eec83208886117cfc6a41..f3506532e46be81d22dfae00c6a252668c6af723 100644 --- a/source/Lib/EncoderLib/InterSearch.h +++ b/source/Lib/EncoderLib/InterSearch.h @@ -97,7 +97,11 @@ typedef struct } EncAffineMotion; /// encoder search class +#if !REMOVE_PPS_REXT class InterSearch : public InterPrediction, CrossComponentPrediction, AffineGradientSearch +#else +class InterSearch : public InterPrediction, AffineGradientSearch +#endif { private: EncModeCtrl *m_modeCtrl; diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index d87ffdac7c9c61306b705a783dfef02a3963e27e..98c88417da6233e4b6d03f53c92460824f7bc3e4 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -387,8 +387,9 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c const TempCtx ctxStartMrlIdx ( m_CtxCache, SubCtx( Ctx::MultiRefLineIdx, m_CABACEstimator->getCtx() ) ); CHECK( !cu.firstPU, "CU has no PUs" ); +#if !REMOVE_PPS_REXT const bool keepResi = cs.pps->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() || KEEP_PRED_AND_RESI_SIGNALS; - +#endif // variables for saving fast intra modes scan results across multiple LFNST passes bool LFNSTLoadFlag = sps.getUseLFNST() && cu.lfnstIdx != 0; bool LFNSTSaveFlag = sps.getUseLFNST() && cu.lfnstIdx == 0; @@ -1196,12 +1197,21 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c { if (cu.colorTransform) { +#if !REMOVE_PPS_REXT cs.useSubStructure(*csBest, partitioner.chType, pu, true, true, keepResi, keepResi); +#else + cs.useSubStructure(*csBest, partitioner.chType, pu, true, true, KEEP_PRED_AND_RESI_SIGNALS, KEEP_PRED_AND_RESI_SIGNALS); +#endif } else { +#if !REMOVE_PPS_REXT cs.useSubStructure(*csBest, partitioner.chType, pu.singleChan(CHANNEL_TYPE_LUMA), true, true, keepResi, keepResi); +#else + cs.useSubStructure(*csBest, partitioner.chType, pu.singleChan(CHANNEL_TYPE_LUMA), true, true, KEEP_PRED_AND_RESI_SIGNALS, + KEEP_PRED_AND_RESI_SIGNALS); +#endif } } csBest->releaseIntermediateData(); @@ -1438,15 +1448,15 @@ void IntraSearch::estIntraPredChromaQT( CodingUnit &cu, Partitioner &partitioner } else { - cu.bdpcmModeChroma = 0; - if( PU::isLMCMode( chromaIntraMode ) && ! PU::isLMCModeEnabled( pu, chromaIntraMode ) ) - { - continue; - } - if (!modeIsEnable[chromaIntraMode] && PU::isLMCModeEnabled(pu, chromaIntraMode)) // when CCLM is disable, then MDLM is disable. not use satd checking - { - continue; - } + cu.bdpcmModeChroma = 0; + if( PU::isLMCMode( chromaIntraMode ) && ! PU::isLMCModeEnabled( pu, chromaIntraMode ) ) + { + continue; + } + if (!modeIsEnable[chromaIntraMode] && PU::isLMCModeEnabled(pu, chromaIntraMode)) // when CCLM is disable, then MDLM is disable. not use satd checking + { + continue; + } } cs.setDecomp( pu.Cb(), false ); cs.dist = baseDist; @@ -3237,10 +3247,12 @@ void IntraSearch::xEncCoeffQT( CodingStructure &cs, Partitioner &partitioner, co const int cbfMask = ( TU::getCbf( currTU, COMPONENT_Cb ) ? 2 : 0 ) + ( TU::getCbf( currTU, COMPONENT_Cr ) ? 1 : 0 ); m_CABACEstimator->joint_cb_cr( currTU, cbfMask ); } +#if !REMOVE_PPS_REXT if( TU::hasCrossCompPredInfo( currTU, compID ) ) { m_CABACEstimator->cross_comp_pred( currTU, compID ); } +#endif if( TU::getCbf( currTU, compID ) ) { if( isLuma(compID) ) @@ -3302,10 +3314,12 @@ uint64_t IntraSearch::xGetIntraFracBitsQTSingleChromaComponent( CodingStructure const bool prevCbf = ( compID == COMPONENT_Cr ? TU::getCbfAtDepth( currTU, COMPONENT_Cb, partitioner.currTrDepth ) : false ); m_CABACEstimator->cbf_comp( cs, TU::getCbfAtDepth( currTU, compID, partitioner.currTrDepth ), currArea.blocks[compID], partitioner.currTrDepth - 1, prevCbf ); //coeffs coding and cross comp coding +#if !REMOVE_PPS_REXT if( TU::hasCrossCompPredInfo( currTU, compID ) ) { m_CABACEstimator->cross_comp_pred( currTU, compID ); } +#endif if( TU::getCbf( currTU, compID ) ) { m_CABACEstimator->residual_coding( currTU, compID ); @@ -3318,12 +3332,12 @@ uint64_t IntraSearch::xGetIntraFracBitsQTSingleChromaComponent( CodingStructure uint64_t IntraSearch::xGetIntraFracBitsQTChroma(TransformUnit& currTU, const ComponentID &compID) { m_CABACEstimator->resetBits(); - +#if !REMOVE_PPS_REXT if( TU::hasCrossCompPredInfo( currTU, compID ) ) { m_CABACEstimator->cross_comp_pred( currTU, compID ); } - +#endif // Include Cbf and jointCbCr flags here as we make decisions across components CodingStructure &cs = *currTU.cs; @@ -3362,7 +3376,11 @@ uint64_t IntraSearch::xGetIntraFracBitsQTChroma(TransformUnit& currTU, const Com return fracBits; } +#if !REMOVE_PPS_REXT void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &compID, const bool &checkCrossCPrediction, Distortion& ruiDist, const int &default0Save1Load2, uint32_t* numSig, std::vector<TrMode>* trModes, const bool loadTr) +#else +void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &compID, Distortion& ruiDist, const int &default0Save1Load2, uint32_t* numSig, std::vector<TrMode>* trModes, const bool loadTr) +#endif { if (!tu.blocks[compID].valid()) { @@ -3374,7 +3392,9 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp const CompArea &area = tu.blocks[compID]; const SPS &sps = *cs.sps; +#if !REMOVE_PPS_REXT const PPS &pps = *cs.pps; +#endif const ChannelType chType = toChannelType(compID); const int bitDepth = sps.getBitDepth(chType); @@ -3382,14 +3402,18 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp PelBuf piOrg = cs.getOrgBuf (area); PelBuf piPred = cs.getPredBuf (area); PelBuf piResi = cs.getResiBuf (area); +#if !REMOVE_PPS_REXT PelBuf piOrgResi = cs.getOrgResiBuf(area); +#endif PelBuf piReco = cs.getRecoBuf (area); const PredictionUnit &pu = *cs.getPU(area.pos(), chType); const uint32_t uiChFinalMode = PU::getFinalIntraMode(pu, chType); +#if !REMOVE_PPS_REXT const bool bUseCrossCPrediction = pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && isChroma( compID ) && PU::isChromaIntraModeCrossCheckMode( pu ) && checkCrossCPrediction; const bool ccUseRecoResi = m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate(); +#endif //===== init availability pattern ===== @@ -3402,73 +3426,72 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp if (compID == COMPONENT_Y || (isChroma(compID) && tu.cu->bdpcmModeChroma)) #endif { - PelBuf sharedPredTS( m_pSharedPredTransformSkip[compID], area ); - if( default0Save1Load2 != 2 ) - { - bool predRegDiffFromTB = CU::isPredRegDiffFromTB(*tu.cu, compID); - bool firstTBInPredReg = CU::isFirstTBInPredReg(*tu.cu, compID, area); - CompArea areaPredReg(COMPONENT_Y, tu.chromaFormat, area); - if (tu.cu->ispMode && isLuma(compID)) + PelBuf sharedPredTS( m_pSharedPredTransformSkip[compID], area ); + if( default0Save1Load2 != 2 ) { - if (predRegDiffFromTB) + bool predRegDiffFromTB = CU::isPredRegDiffFromTB(*tu.cu, compID); + bool firstTBInPredReg = CU::isFirstTBInPredReg(*tu.cu, compID, area); + CompArea areaPredReg(COMPONENT_Y, tu.chromaFormat, area); + if (tu.cu->ispMode && isLuma(compID)) { - if (firstTBInPredReg) + if (predRegDiffFromTB) { - CU::adjustPredArea(areaPredReg); - initIntraPatternChTypeISP(*tu.cu, areaPredReg, piReco); + if (firstTBInPredReg) + { + CU::adjustPredArea(areaPredReg); + initIntraPatternChTypeISP(*tu.cu, areaPredReg, piReco); + } } + else + initIntraPatternChTypeISP(*tu.cu, area, piReco); } else - initIntraPatternChTypeISP(*tu.cu, area, piReco); - } - else - { - initIntraPatternChType(*tu.cu, area); - } - - //===== get prediction signal ===== - if(compID != COMPONENT_Y && !tu.cu->bdpcmModeChroma && PU::isLMCMode(uiChFinalMode)) - { { - xGetLumaRecPixels( pu, area ); + initIntraPatternChType(*tu.cu, area); } - predIntraChromaLM( compID, piPred, pu, area, uiChFinalMode ); - } - else - { - if( PU::isMIP( pu, chType ) ) + + //===== get prediction signal ===== + if(compID != COMPONENT_Y && !tu.cu->bdpcmModeChroma && PU::isLMCMode(uiChFinalMode)) { - initIntraMip( pu, area ); - predIntraMip( compID, piPred, pu ); + xGetLumaRecPixels( pu, area ); + predIntraChromaLM( compID, piPred, pu, area, uiChFinalMode ); } else { - if (predRegDiffFromTB) + if( PU::isMIP( pu, chType ) ) { - if (firstTBInPredReg) + initIntraMip( pu, area ); + predIntraMip( compID, piPred, pu ); + } + else + { + if (predRegDiffFromTB) { - PelBuf piPredReg = cs.getPredBuf(areaPredReg); - predIntraAng(compID, piPredReg, pu); + if (firstTBInPredReg) + { + PelBuf piPredReg = cs.getPredBuf(areaPredReg); + predIntraAng(compID, piPredReg, pu); + } + } + else + { + predIntraAng(compID, piPred, pu); } } - else - predIntraAng(compID, piPred, pu); } - } - - // save prediction - if( default0Save1Load2 == 1 ) + // save prediction + if( default0Save1Load2 == 1 ) + { + sharedPredTS.copyFrom( piPred ); + } + } + else { - sharedPredTS.copyFrom( piPred ); + // load prediction + piPred.copyFrom( sharedPredTS ); } } - else - { - // load prediction - piPred.copyFrom( sharedPredTS ); - } - } DTRACE( g_trace_ctx, D_PRED, "@(%4d,%4d) [%2dx%2d] IMode=%d\n", tu.lx(), tu.ly(), tu.lwidth(), tu.lheight(), uiChFinalMode ); @@ -3478,32 +3501,36 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp bool flag = slice.getPicHeader()->getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); if (isLuma(compID)) { - //===== get residual signal ===== - piResi.copyFrom( piOrg ); - if (slice.getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) - { - CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); - PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea); - tmpPred.copyFrom(piPred); - piResi.rspSignal(m_pcReshape->getFwdLUT()); - piResi.subtract(tmpPred); - } - else - piResi.subtract( piPred ); + //===== get residual signal ===== + piResi.copyFrom( piOrg ); + if (slice.getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) + { + CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); + PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea); + tmpPred.copyFrom(piPred); + piResi.rspSignal(m_pcReshape->getFwdLUT()); + piResi.subtract(tmpPred); + } + else + { + piResi.subtract( piPred ); + } - if (pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && isLuma(compID)) - { - piOrgResi.copyFrom (piResi); - } +#if !REMOVE_PPS_REXT + if (pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && isLuma(compID)) + { + piOrgResi.copyFrom (piResi); + } - if (bUseCrossCPrediction) - { - if (xCalcCrossComponentPredictionAlpha(tu, compID, ccUseRecoResi) == 0) + if (bUseCrossCPrediction) { - return; + if (xCalcCrossComponentPredictionAlpha(tu, compID, ccUseRecoResi) == 0) + { + return; + } + CrossComponentPrediction::crossComponentPrediction(tu, compID, cs.getResiBuf(tu.Y()), piResi, piResi, false); } - CrossComponentPrediction::crossComponentPrediction(tu, compID, cs.getResiBuf(tu.Y()), piResi, piResi, false); - } +#endif } //===== transform and quantization ===== @@ -3689,6 +3716,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp crResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(COMPONENT_Cr)); } } +#if !REMOVE_PPS_REXT if (bUseCrossCPrediction) { CrossComponentPrediction::crossComponentPrediction(tu, compID, cs.getResiBuf(tu.Y()), piResi, piResi, true); @@ -3697,6 +3725,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp CrossComponentPrediction::crossComponentPrediction(tu, COMPONENT_Cr, cs.getResiBuf(tu.Y()), crResi, crResi, true); } } +#endif if (slice.getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) { @@ -3966,8 +3995,11 @@ bool IntraSearch::xIntraCodingLumaISP(CodingStructure& cs, Partitioner& partitio tu.depth = partitioner.currTrDepth; // Encode TU +#if !REMOVE_PPS_REXT xIntraCodingTUBlock(tu, COMPONENT_Y, false, singleDistTmpLuma, 0, &numSig); - +#else + xIntraCodingTUBlock(tu, COMPONENT_Y, singleDistTmpLuma, 0, &numSig); +#endif if (singleDistTmpLuma == MAX_INT) // all zero CBF skip { earlySkipISP = true; @@ -4060,8 +4092,10 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par bool earlySkipISP = false; uint32_t currDepth = partitioner.currTrDepth; const SPS &sps = *cs.sps; +#if !REMOVE_PPS_REXT const PPS &pps = *cs.pps; const bool keepResi = pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() || KEEP_PRED_AND_RESI_SIGNALS; +#endif bool bCheckFull = true; bool bCheckSplit = false; bCheckFull = !partitioner.canSplit( TU_MAX_TR_SPLIT, cs ); @@ -4299,7 +4333,11 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par if( !cu.mtsFlag && checkTransformSkip ) { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig, modeId == 0 ? &trModes : nullptr, true ); +#else + xIntraCodingTUBlock( tu, COMPONENT_Y, singleDistTmpLuma, default0Save1Load2, &numSig, modeId == 0 ? &trModes : nullptr, true ); +#endif if( modeId == 0 ) { for( int i = 0; i < 2; i++ ) @@ -4313,14 +4351,22 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par } else { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig ); +#else + xIntraCodingTUBlock( tu, COMPONENT_Y, singleDistTmpLuma, default0Save1Load2, &numSig ); +#endif } } else { if( nNumTransformCands > 1 ) { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig, modeId == 0 ? &trModes : nullptr, true ); +#else + xIntraCodingTUBlock( tu, COMPONENT_Y, singleDistTmpLuma, default0Save1Load2, &numSig, modeId == 0 ? &trModes : nullptr, true ); +#endif if( modeId == 0 ) { for( int i = 0; i < nNumTransformCands; i++ ) @@ -4334,7 +4380,11 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par } else { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig ); +#else + xIntraCodingTUBlock( tu, COMPONENT_Y, singleDistTmpLuma, default0Save1Load2, &numSig ); +#endif } } @@ -4416,7 +4466,11 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par saveCS.getPredBuf( tu.Y() ).copyFrom( csFull->getPredBuf( tu.Y() ) ); saveCS.getRecoBuf( tu.Y() ).copyFrom( csFull->getRecoBuf( tu.Y() ) ); +#if !REMOVE_PPS_REXT if( keepResi ) +#else + if( KEEP_PRED_AND_RESI_SIGNALS ) +#endif { saveCS.getResiBuf ( tu.Y() ).copyFrom( csFull->getResiBuf ( tu.Y() ) ); saveCS.getOrgResiBuf( tu.Y() ).copyFrom( csFull->getOrgResiBuf( tu.Y() ) ); @@ -4445,7 +4499,11 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par csFull->getPredBuf( tu.Y() ).copyFrom( saveCS.getPredBuf( tu.Y() ) ); csFull->getRecoBuf( tu.Y() ).copyFrom( saveCS.getRecoBuf( tu.Y() ) ); +#if !REMOVE_PPS_REXT if( keepResi ) +#else + if( KEEP_PRED_AND_RESI_SIGNALS ) +#endif { csFull->getResiBuf ( tu.Y() ).copyFrom( saveCS.getResiBuf ( tu.Y() ) ); csFull->getOrgResiBuf( tu.Y() ).copyFrom( saveCS.getOrgResiBuf( tu.Y() ) ); @@ -5458,7 +5516,9 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio bool lumaUsesISP = false; uint32_t currDepth = partitioner.currTrDepth; +#if !REMOVE_PPS_REXT const PPS &pps = *cs.pps; +#endif ChromaCbfs cbfs ( false ); if (currDepth == currTU.depth) @@ -5550,6 +5610,7 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio } //----- get cross component prediction parameters ----- +#if !REMOVE_PPS_REXT bool checkCrossComponentPrediction = PU::isChromaIntraModeCrossCheckMode( pu ) && pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && TU::getCbf( currTU, COMPONENT_Y ); int compAlpha[MAX_NUM_COMPONENT] = { 0, 0, 0 }; if( checkCrossComponentPrediction ) @@ -5561,7 +5622,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio checkCrossComponentPrediction = false; } } - //===== store original residual signals (std and crossCompPred) ===== CompStorage orgResiCb[5], orgResiCr[5]; // 0:std, 1-3:jointCbCr (placeholder at this stage), 4:crossComp for( int k = 0; k < (checkCrossComponentPrediction?5:1); k+=4 ) @@ -5571,7 +5631,8 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio if( k >= 4 ) { CrossComponentPrediction::crossComponentPrediction( currTU, COMPONENT_Cb, cs.getResiBuf(currTU.Y()), resiCb, orgResiCb[k], false); CrossComponentPrediction::crossComponentPrediction( currTU, COMPONENT_Cr, cs.getResiBuf(currTU.Y()), resiCr, orgResiCr[k], false); - } else { + } else + { orgResiCb[k].copyFrom( resiCb ); orgResiCr[k].copyFrom( resiCr ); } @@ -5582,6 +5643,20 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio orgResiCr[k].scaleSignal( cResScaleInv, 1, currTU.cu->cs->slice->clpRng(COMPONENT_Cr) ); } } +#else + //===== store original residual signals ===== + CompStorage orgResiCb[4], orgResiCr[4]; // 0:std, 1-3:jointCbCr (placeholder at this stage) + orgResiCb[0].create( cbArea ); + orgResiCr[0].create( crArea ); + orgResiCb[0].copyFrom( resiCb ); + orgResiCr[0].copyFrom( resiCr ); + if( doReshaping ) + { + int cResScaleInv = currTU.getChromaAdj(); + orgResiCb[0].scaleSignal( cResScaleInv, 1, currTU.cu->cs->slice->clpRng(COMPONENT_Cb) ); + orgResiCr[0].scaleSignal( cResScaleInv, 1, currTU.cu->cs->slice->clpRng(COMPONENT_Cr) ); + } +#endif for( uint32_t c = COMPONENT_Cb; c < numTBlocks; c++) { @@ -5592,7 +5667,9 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio int bestModeId = 0; Distortion singleDistCTmp = 0; double singleCostTmp = 0; +#if !REMOVE_PPS_REXT const int crossCPredictionModesToTest = checkCrossComponentPrediction ? 2 : 1; +#endif #if JVET_Q0784_LFNST_COMBINATION const bool tsAllowed = TU::isTSAllowed(currTU, compID) && m_pcEncCfg->getUseChromaTS() && !currTU.cu->lfnstIdx; #else @@ -5628,7 +5705,12 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio #endif CHECK(!currTU.Cb().valid(), "Invalid TU"); + +#if !REMOVE_PPS_REXT const int totalModesToTest = crossCPredictionModesToTest * nNumTransformCands; +#else + const int totalModesToTest = nNumTransformCands; +#endif bool cbfDCT2 = true; const bool isOneMode = false; maxModesTested = totalModesToTest > maxModesTested ? totalModesToTest : maxModesTested; @@ -5644,13 +5726,17 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio for (int modeId = 0; modeId < nNumTransformCands; modeId++) { +#if !REMOVE_PPS_REXT for (int crossCPredictionModeId = 0; crossCPredictionModeId < crossCPredictionModesToTest; crossCPredictionModeId++) { resiCb.copyFrom( orgResiCb[4*crossCPredictionModeId] ); resiCr.copyFrom( orgResiCr[4*crossCPredictionModeId] ); currTU.compAlpha [compID] = ( crossCPredictionModeId ? compAlpha[compID] : 0 ); - +#else + resiCb.copyFrom( orgResiCb[0] ); + resiCr.copyFrom( orgResiCr[0] ); +#endif currTU.mtsIdx[compID] = currTU.cu->bdpcmModeChroma ? MTS_SKIP : trModes[modeId].first; currModeId++; @@ -5684,14 +5770,26 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio if (nNumTransformCands > 1) { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock(currTU, compID, crossCPredictionModeId != 0, singleDistCTmp, default0Save1Load2, nullptr, modeId == 0 ? &trModes : nullptr, true); +#else + xIntraCodingTUBlock(currTU, compID, singleDistCTmp, default0Save1Load2, nullptr, modeId == 0 ? &trModes : nullptr, true); +#endif } else { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock(currTU, compID, crossCPredictionModeId != 0, singleDistCTmp, default0Save1Load2); +#else + xIntraCodingTUBlock(currTU, compID, singleDistCTmp, default0Save1Load2); +#endif } +#if !REMOVE_PPS_REXT if (((crossCPredictionModeId == 1) && (currTU.compAlpha[compID] == 0)) || ((currTU.mtsIdx[compID] == MTS_SKIP && !currTU.cu->bdpcmModeChroma) && !TU::getCbf(currTU, compID))) //In order not to code TS flag when cbf is zero, the case for TS with cbf being zero is forbidden. +#else + if (((currTU.mtsIdx[compID] == MTS_SKIP && !currTU.cu->bdpcmModeChroma) && !TU::getCbf(currTU, compID))) //In order not to code TS flag when cbf is zero, the case for TS with cbf being zero is forbidden. +#endif { #if JVET_Q0820_ACT if (m_pcEncCfg->getCostMode() != COST_LOSSLESS_CODING) @@ -5759,7 +5857,9 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio ctxBest = m_CABACEstimator->getCtx(); } } +#if !REMOVE_PPS_REXT } +#endif } if( lumaUsesISP && dSingleCost > bestCostSoFar && c == COMPONENT_Cb ) @@ -5820,8 +5920,10 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio #endif currTU.jointCbCr = (uint8_t)cbfMask; +#if !REMOVE_PPS_REXT currTU.compAlpha[COMPONENT_Cb] = 0; currTU.compAlpha[COMPONENT_Cr] = 0; +#endif #if JVET_Q0695_CHROMA_TS_JCCR ComponentID codeCompId = ((currTU.jointCbCr >> 1) ? COMPONENT_Cb : COMPONENT_Cr); ComponentID otherCompId = ((codeCompId == COMPONENT_Cb) ? COMPONENT_Cr : COMPONENT_Cb); @@ -5871,12 +5973,19 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio #if JVET_Q0695_CHROMA_TS_JCCR if (numTransformCands > 1) { +#if !REMOVE_PPS_REXT xIntraCodingTUBlock(currTU, COMPONENT_Cb, false, distTmp, 0, nullptr, modeId == 0 ? &trModes : nullptr, true); +#else + xIntraCodingTUBlock(currTU, COMPONENT_Cb, distTmp, 0, nullptr, modeId == 0 ? &trModes : nullptr, true); +#endif } else #endif +#if !REMOVE_PPS_REXT xIntraCodingTUBlock( currTU, COMPONENT_Cb, false, distTmp, 0 ); - +#else + xIntraCodingTUBlock( currTU, COMPONENT_Cb, distTmp, 0 ); +#endif double costTmp = std::numeric_limits<double>::max(); if( distTmp < std::numeric_limits<Distortion>::max() ) { diff --git a/source/Lib/EncoderLib/IntraSearch.h b/source/Lib/EncoderLib/IntraSearch.h index 190eff53b2fd7515d09841303aa7b48654577c24..3a4ba0b4b3a0800933c07549edc327ad1cc8aacb 100644 --- a/source/Lib/EncoderLib/IntraSearch.h +++ b/source/Lib/EncoderLib/IntraSearch.h @@ -260,7 +260,11 @@ private: #endif }; /// encoder search class +#if !REMOVE_PPS_REXT class IntraSearch : public IntraPrediction, CrossComponentPrediction +#else +class IntraSearch : public IntraPrediction +#endif { private: EncModeCtrl *m_modeCtrl; @@ -529,7 +533,11 @@ protected: uint64_t xGetIntraFracBitsQTChroma(TransformUnit& tu, const ComponentID &compID); void xEncCoeffQT ( CodingStructure &cs, Partitioner& pm, const ComponentID compID, const int subTuIdx = -1, const PartSplit ispType = TU_NO_ISP, CUCtx * cuCtx = nullptr ); +#if !REMOVE_PPS_REXT void xIntraCodingTUBlock (TransformUnit &tu, const ComponentID &compID, const bool &checkCrossCPrediction, Distortion& ruiDist, const int &default0Save1Load2 = 0, uint32_t* numSig = nullptr, std::vector<TrMode>* trModes=nullptr, const bool loadTr=false ); +#else + void xIntraCodingTUBlock (TransformUnit &tu, const ComponentID &compID, Distortion& ruiDist, const int &default0Save1Load2 = 0, uint32_t* numSig = nullptr, std::vector<TrMode>* trModes=nullptr, const bool loadTr=false ); +#endif void xIntraCodingACTTUBlock(TransformUnit &tu, const ComponentID &compID, Distortion& ruiDist, std::vector<TrMode>* trModes = nullptr, const bool loadTr = false); ChromaCbfs xRecurIntraChromaCodingQT( CodingStructure &cs, Partitioner& pm, const double bestCostSoFar = MAX_DOUBLE, const PartSplit ispType = TU_NO_ISP ); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index f6c43970785e7aac520103b59481fa22e179a8c2..b7a6f466c81f3cfad32e27411efe71bfd55971db 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -521,6 +521,7 @@ void HLSWriter::codePPS( const PPS* pcPPS ) if (pps_extension_present_flag) { +#if !REMOVE_PPS_REXT #if ENABLE_TRACING /*|| RExt__DECODER_DEBUG_BIT_STATISTICS*/ static const char *syntaxStrings[]={ "pps_range_extension_flag", "pps_multilayer_extension_flag", @@ -560,6 +561,12 @@ void HLSWriter::codePPS( const PPS* pcPPS ) } // switch } // if flag present } // loop over PPS flags +#else + for(int i=0; i<NUM_PPS_EXTENSION_FLAGS; i++) + { + WRITE_FLAG( pps_extension_flags[i]?1:0, "pps_extension_data_flag" ); + } +#endif } // pps_extension_present_flag is non-zero xWriteRbspTrailingBits(); }