diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index b116979c83bed81ea2d770bdf133e980e278d51d..5eea18a95f44a383867e38515fed857afe55b2b3 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -879,9 +879,7 @@ void EncApp::xInitLibCfg() m_cEncLib.setReshapeSignalType ( m_reshapeSignalType ); m_cEncLib.setReshapeIntraCMD ( m_intraCMD ); m_cEncLib.setReshapeCW ( m_reshapeCW ); -#if JVET_P0371_CHROMA_SCALING_OFFSET m_cEncLib.setReshapeCSoffset ( m_CSoffset ); -#endif #if JVET_O0756_CALCULATE_HDRMETRICS for (int i=0; i<hdrtoolslib::NB_REF_WHITE; i++) diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index df66f589e0e31bd4cd07478f08e0d4db627a2558..8e7433cbe44efb837f4c287c00193a2ef1b394ab 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1157,9 +1157,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) "1: rsp both (CW66 for QP<=22), 2: rsp TID0 (for all QP)," "3: rsp inter(CW66 for QP<=22), 4: rsp inter(for all QP).") ("LMCSInitialCW", m_initialCW, 0u, "LMCS initial total codeword (0~1023) when LMCSAdpOption > 0") -#if JVET_P0371_CHROMA_SCALING_OFFSET ("LMCSOffset", m_CSoffset, 0, "LMCS chroma residual scaling offset") -#endif ("IntraCMD", m_intraCMD, 0u, "IntraChroma MD: 0: none, 1:fixed to default wPSNR weight") ("LCTUFast", m_useFastLCTU, false, "Fast methods for large CTU") ("FastMrg", m_useFastMrg, false, "Fast methods for inter merge") @@ -3046,10 +3044,8 @@ bool EncAppCfg::xCheckParameter() xConfirmPara(m_adpOption > 4, "Max. LMCS Adaptation Option is 4"); xConfirmPara(m_initialCW < 0, "Min. Initial Total Codeword is 0"); xConfirmPara(m_initialCW > 1023, "Max. Initial Total Codeword is 1023"); -#if JVET_P0371_CHROMA_SCALING_OFFSET xConfirmPara(m_CSoffset < -7, "Min. LMCS Offset value is -7"); xConfirmPara(m_CSoffset > 7, "Max. LMCS Offset value is 7"); -#endif if (m_updateCtrl > 0 && m_adpOption > 2) { m_adpOption -= 2; } } @@ -4379,9 +4375,7 @@ void EncAppCfg::xPrintParameter() msg(VERBOSE, "(Signal:%s ", m_reshapeSignalType == 0 ? "SDR" : (m_reshapeSignalType == 2 ? "HDR-HLG" : "HDR-PQ")); msg(VERBOSE, "Opt:%d", m_adpOption); if (m_adpOption > 0) { msg(VERBOSE, " CW:%d", m_initialCW); } -#if JVET_P0371_CHROMA_SCALING_OFFSET msg(VERBOSE, " CSoffset:%d", m_CSoffset); -#endif msg(VERBOSE, ") "); } msg(VERBOSE, "MRL:%d ", m_MRL); diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 6c72bbdfa80dcd6fb2abcb215127ae0575b5b6c8..729c033c8e34cf8dcbeda7e8ef1adc283f49e4d7 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -364,9 +364,7 @@ protected: int m_updateCtrl; int m_adpOption; uint32_t m_initialCW; -#if JVET_P0371_CHROMA_SCALING_OFFSET int m_CSoffset; -#endif bool m_encDbOpt; unsigned m_uiMaxCUWidth; ///< max. CU width in pixel unsigned m_uiMaxCUHeight; ///< max. CU height in pixel diff --git a/source/Lib/CommonLib/Reshape.cpp b/source/Lib/CommonLib/Reshape.cpp index bbcdbd37b9090342dd5d03cd3dfdf8ffbf4a9ad7..4d6ac24644cca6d38c6a471c10d8c092ebb6a3fb 100644 --- a/source/Lib/CommonLib/Reshape.cpp +++ b/source/Lib/CommonLib/Reshape.cpp @@ -225,9 +225,7 @@ void Reshape::copySliceReshaperInfo(SliceReshapeInfo& tInfo, SliceReshapeInfo& s tInfo.reshaperModelMinBinIdx = sInfo.reshaperModelMinBinIdx; memcpy(tInfo.reshaperModelBinCWDelta, sInfo.reshaperModelBinCWDelta, sizeof(int)*(PIC_CODE_CW_BINS)); tInfo.maxNbitsNeededDeltaCW = sInfo.maxNbitsNeededDeltaCW; -#if JVET_P0371_CHROMA_SCALING_OFFSET tInfo.chrResScalingOffset = sInfo.chrResScalingOffset; -#endif } tInfo.sliceReshaperEnableFlag = sInfo.sliceReshaperEnableFlag; if (sInfo.sliceReshaperEnableFlag) @@ -265,11 +263,7 @@ void Reshape::constructReshaper() else { m_invScaleCoef[i] = (int32_t)(m_initCW * (1 << FP_PREC) / m_binCW[i]); -#if JVET_P0371_CHROMA_SCALING_OFFSET m_chromaAdjHelpLUT[i] = (int32_t)(m_initCW * (1 << FP_PREC) / ( m_binCW[i] + m_sliceReshapeInfo.chrResScalingOffset ) ); -#else - m_chromaAdjHelpLUT[i] = m_invScaleCoef[i]; -#endif } } for (int lumaSample = 0; lumaSample < m_reshapeLUTSize; lumaSample++) diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index d3bb52a7e726bcda20ee906f2b3627431da2b61d..9fe624b154344143076afff008f0e6db5d39686e 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -473,9 +473,7 @@ public: uint32_t reshaperModelMaxBinIdx; int reshaperModelBinCWDelta[PIC_CODE_CW_BINS]; int maxNbitsNeededDeltaCW; -#if JVET_P0371_CHROMA_SCALING_OFFSET int chrResScalingOffset; -#endif void setUseSliceReshaper(bool b) { sliceReshaperEnableFlag = b; } bool getUseSliceReshaper() const { return sliceReshaperEnableFlag; } void setSliceReshapeModelPresentFlag(bool b) { sliceReshaperModelPresentFlag = b; } @@ -509,12 +507,10 @@ public: { return false; } -#if JVET_P0371_CHROMA_SCALING_OFFSET if (chrResScalingOffset != other.chrResScalingOffset) { return false; } -#endif if( memcmp( reshaperModelBinCWDelta, other.reshaperModelBinCWDelta, sizeof( reshaperModelBinCWDelta ) ) ) { return false; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 7ebd5f4f8e30914760b90a8ae017ed4f3139f34a..5c7e0f7f4becf8e49e2fc1fdf5de0f8665242d17 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -78,7 +78,6 @@ -#define JVET_P0371_CHROMA_SCALING_OFFSET 1 // JVET-P0371: Signalling offset for chroma residual scaling #define JVET_P0469_QP_OUT_VAL 1 // JVET-P0469: Coding delta_qp_diff_val instead of delta_qp_out_val diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index b9369e2006f8d66c3c5c8a4c2b55834fae81e985..48953a68e7e948413cf1d3a60aa3b9185f208d3f 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -1609,9 +1609,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl tInfo.reshaperModelMinBinIdx = sInfo.reshaperModelMinBinIdx; memcpy(tInfo.reshaperModelBinCWDelta, sInfo.reshaperModelBinCWDelta, sizeof(int)*(PIC_CODE_CW_BINS)); tInfo.maxNbitsNeededDeltaCW = sInfo.maxNbitsNeededDeltaCW; -#if JVET_P0371_CHROMA_SCALING_OFFSET tInfo.chrResScalingOffset = sInfo.chrResScalingOffset; -#endif tInfo.setUseSliceReshaper(pcSlice->getPicHeader()->getLmcsEnabledFlag()); tInfo.setSliceReshapeChromaAdj(pcSlice->getPicHeader()->getLmcsChromaResidualScaleFlag()); tInfo.setSliceReshapeModelPresentFlag(true); diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index f5d19d3ad519b0d775884404ace443b88ec1b69c..694aa16facec7024d6426ecebef8bbafd364937b 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -892,7 +892,6 @@ void HLSyntaxReader::parseLmcsAps( APS* aps ) int signCW = code; info.reshaperModelBinCWDelta[i] = (1 - 2 * signCW) * absCW; } -#if JVET_P0371_CHROMA_SCALING_OFFSET READ_CODE(3, code, "lmcs_delta_abs_crs"); int absCW = code; if (absCW > 0) @@ -901,7 +900,6 @@ void HLSyntaxReader::parseLmcsAps( APS* aps ) } int signCW = code; info.chrResScalingOffset = (1 - 2 * signCW) * absCW; -#endif aps->setReshaperAPSInfo(info); } diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index fee02f9352102b7cd6fec09d66892597d839a8f5..04f47baab19f6e04f6d0210c452360e91ec01955 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -354,9 +354,7 @@ protected: unsigned m_reshapeSignalType; unsigned m_intraCMD; ReshapeCW m_reshapeCW; -#if JVET_P0371_CHROMA_SCALING_OFFSET int m_CSoffset; -#endif bool m_encDbOpt; bool m_useFastLCTU; bool m_useFastMrg; @@ -1169,10 +1167,8 @@ public: uint32_t getReshapeIntraCMD () { return m_intraCMD; } void setReshapeCW (const ReshapeCW &reshapeCW) { m_reshapeCW = reshapeCW; } const ReshapeCW& getReshapeCW () { return m_reshapeCW; } -#if JVET_P0371_CHROMA_SCALING_OFFSET void setReshapeCSoffset (int CSoffset) { m_CSoffset = CSoffset; } int getReshapeCSoffset () { return m_CSoffset; } -#endif void setMaxCUWidth ( uint32_t u ) { m_maxCUWidth = u; } uint32_t getMaxCUWidth () const { return m_maxCUWidth; } void setMaxCUHeight ( uint32_t u ) { m_maxCUHeight = u; } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 96af0263746511671d1b50b9641ed6d155a8f51b..c61b792c2d4cad152a68dffa33112411010f8574 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -1885,9 +1885,7 @@ void EncGOP::xPicInitLMCS(Picture *pic, PicHeader *picHeader, Slice *slice) m_pcReshaper->setSrcReshaped(false); m_pcReshaper->setRecReshaped(true); -#if JVET_P0371_CHROMA_SCALING_OFFSET m_pcReshaper->getSliceReshaperInfo().chrResScalingOffset = m_pcCfg->getReshapeCSoffset(); -#endif if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ) { @@ -1990,9 +1988,7 @@ void EncGOP::xPicInitLMCS(Picture *pic, PicHeader *picHeader, Slice *slice) tInfo.reshaperModelMinBinIdx = sInfo.reshaperModelMinBinIdx; memcpy(tInfo.reshaperModelBinCWDelta, sInfo.reshaperModelBinCWDelta, sizeof(int)*(PIC_CODE_CW_BINS)); tInfo.maxNbitsNeededDeltaCW = sInfo.maxNbitsNeededDeltaCW; -#if JVET_P0371_CHROMA_SCALING_OFFSET tInfo.chrResScalingOffset = sInfo.chrResScalingOffset; -#endif m_pcEncLib->getApsMap()->setChangedFlag((lmcsAPS->getAPSId() << NUM_APS_TYPE_LEN) + LMCS_APS); } diff --git a/source/Lib/EncoderLib/EncReshape.cpp b/source/Lib/EncoderLib/EncReshape.cpp index 1cfbe1f462b2b21d416d2dbbd9bc89777c28d6b7..27d5ae535f845188a40c21b020262bf7cf6d89ea 100644 --- a/source/Lib/EncoderLib/EncReshape.cpp +++ b/source/Lib/EncoderLib/EncReshape.cpp @@ -93,9 +93,7 @@ void EncReshape::createEnc(int picWidth, int picHeight, uint32_t maxCUWidth, ui m_sliceReshapeInfo.reshaperModelMinBinIdx = 0; m_sliceReshapeInfo.reshaperModelMaxBinIdx = PIC_CODE_CW_BINS - 1; memset(m_sliceReshapeInfo.reshaperModelBinCWDelta, 0, (PIC_CODE_CW_BINS) * sizeof(int)); -#if JVET_P0371_CHROMA_SCALING_OFFSET m_sliceReshapeInfo.chrResScalingOffset = 0; -#endif m_picWidth = picWidth; m_picHeight = picHeight; @@ -965,11 +963,7 @@ void EncReshape::initLUTfromdQPModel() else { m_invScaleCoef[i] = (int32_t)(m_initCW * (1 << FP_PREC) / m_binCW[i]); -#if JVET_P0371_CHROMA_SCALING_OFFSET m_chromaAdjHelpLUT[i] = (int32_t)(m_initCW * (1 << FP_PREC) / (m_binCW[i] + m_sliceReshapeInfo.chrResScalingOffset)); -#else - m_chromaAdjHelpLUT[i] = m_invScaleCoef[i]; -#endif } } for (int lumaSample = 0; lumaSample < m_reshapeLUTSize; lumaSample++) @@ -1061,11 +1055,7 @@ void EncReshape::constructReshaperLMCS() else { m_invScaleCoef[i] = (int32_t)(m_initCW * (1 << FP_PREC) / m_binCW[i]); -#if JVET_P0371_CHROMA_SCALING_OFFSET m_chromaAdjHelpLUT[i] = (int32_t)(m_initCW * (1 << FP_PREC) / (m_binCW[i] + m_sliceReshapeInfo.chrResScalingOffset)); -#else - m_chromaAdjHelpLUT[i] = m_invScaleCoef[i]; -#endif } } for (int lumaSample = 0; lumaSample < m_reshapeLUTSize; lumaSample++) diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 3f9d501b94278191a3bee5f26f2b0dfa7bd66b46..ddfa8bc62c19202cff1d24477d3416f0cbdd3a2f 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -575,7 +575,6 @@ void HLSWriter::codeLmcsAps( APS* pcAPS ) WRITE_FLAG(signCW, "lmcs_delta_sign_cw_flag[ i ]"); } } -#if JVET_P0371_CHROMA_SCALING_OFFSET int deltaCRS = param.chrResScalingOffset; int signCRS = (deltaCRS < 0) ? 1 : 0; int absCRS = (deltaCRS < 0) ? (-deltaCRS) : deltaCRS; @@ -584,7 +583,6 @@ void HLSWriter::codeLmcsAps( APS* pcAPS ) { WRITE_FLAG(signCRS, "lmcs_delta_crs_val_flag"); } -#endif } void HLSWriter::codeScalingListAps( APS* pcAPS )