diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h index f491e1bebbde8e385f7444236f43364ed204d580..b3894ed01e7ced2bcda3a0fef84685463d411724 100644 --- a/source/Lib/CommonLib/CommonDef.h +++ b/source/Lib/CommonLib/CommonDef.h @@ -458,7 +458,7 @@ static const int MVD_MIN = -(1 << 17); static const int PIC_ANALYZE_CW_BINS = 32; static const int PIC_CODE_CW_BINS = 16; -static const int LMCS_SEG_SIZE = (PIC_CODE_CW_BINS << 1); +static const int LMCS_SEG_NUM = 32; static const int FP_PREC = 11; static const int CSCALE_FP_PREC = 11; static const int NEIG_NUM_LOG = 6; diff --git a/source/Lib/EncoderLib/EncReshape.cpp b/source/Lib/EncoderLib/EncReshape.cpp index 247c4cb3c650e438e81c6b9ae0f038791b0cfc52..b92b0cdb46b4da91a6835d9046c3a23045cae6d3 100644 --- a/source/Lib/EncoderLib/EncReshape.cpp +++ b/source/Lib/EncoderLib/EncReshape.cpp @@ -1016,8 +1016,6 @@ void EncReshape::constructReshaperLMCS() } } - adjustLmcsPivot(); - if (bdShift != 0) { for (int i = 0; i < PIC_ANALYZE_CW_BINS; i++) @@ -1026,6 +1024,8 @@ void EncReshape::constructReshaperLMCS() } } + adjustLmcsPivot(); + int maxAbsDeltaCW = 0, absDeltaCW = 0, deltaCW = 0; for (int i = m_sliceReshapeInfo.reshaperModelMinBinIdx; i <= m_sliceReshapeInfo.reshaperModelMaxBinIdx; i++) { @@ -1080,7 +1080,7 @@ void EncReshape::adjustLmcsPivot() int bdShift = m_lumaBD - 10; int totCW = bdShift != 0 ? (bdShift > 0 ? m_reshapeLUTSize / (1 << bdShift) : m_reshapeLUTSize * (1 << (-bdShift))) : m_reshapeLUTSize; int orgCW = totCW / PIC_CODE_CW_BINS; - int log2SegSize = floorLog2(LMCS_SEG_SIZE); + int log2SegSize = m_lumaBD - floorLog2(LMCS_SEG_NUM); m_reshapePivot[0] = 0; for (int i = 0; i < PIC_CODE_CW_BINS; i++)