From b0f45b4b2f3f2f66f35cda1597393376d72dd09b Mon Sep 17 00:00:00 2001 From: Vadim Seregin <vseregin@qti.qualcomm.com> Date: Wed, 20 Nov 2024 13:14:36 +0000 Subject: [PATCH] Formatting and cleanup (lossless) --- cfg/per-class/classF.cfg | 44 +- cfg/per-class/classF_lowdelay.cfg | 47 +- source/Lib/CommonLib/InterPrediction.cpp | 221 +++++++-- source/Lib/CommonLib/InterPrediction.h | 559 +++++++++-------------- source/Lib/CommonLib/IntraPrediction.cpp | 12 +- source/Lib/CommonLib/IntraPrediction.h | 293 ++++++------ source/Lib/CommonLib/Rom.h | 16 +- source/Lib/CommonLib/RomNSPT.h | 16 +- source/Lib/CommonLib/TrQuant.cpp | 16 +- source/Lib/EncoderLib/IntraSearch.h | 16 +- 10 files changed, 614 insertions(+), 626 deletions(-) diff --git a/cfg/per-class/classF.cfg b/cfg/per-class/classF.cfg index 6d55b9bda..9ad9d415f 100644 --- a/cfg/per-class/classF.cfg +++ b/cfg/per-class/classF.cfg @@ -1,24 +1,24 @@ -IBC: 3 -HashME: 1 -BDPCM: 1 -TemporalFilter: 0 -IntraTMP: 1 -FastIntraTMP: 0 -SGPMnoBlend: 1 -PLT: 1 -RRIBC: 1 -TMIBC: 1 -IBCFastMethod: 6 -IBCMerge: 1 -IBCMBVDAdaptive: 1 -IBCHashSearch: 1 -IBCCIIP: 1 -IBCGPM: 1 -BvpCluster: 1 -IBCBiPred: 0 -IBCNonAdjCand: 1 -IBCFilter: 1 -ItmpLicExtension: 1 +IBC: 3 +HashME: 1 +BDPCM: 1 +TemporalFilter: 0 +IntraTMP: 1 +FastIntraTMP: 0 +SGPMnoBlend: 1 +PLT: 1 +RRIBC: 1 +TMIBC: 1 +IBCFastMethod: 6 +IBCMerge: 1 +IBCMBVDAdaptive: 1 +IBCHashSearch: 1 +IBCCIIP: 1 +IBCGPM: 1 +BvpCluster: 1 +IBCBiPred: 0 +IBCNonAdjCand: 1 +IBCFilter: 1 +ItmpLicExtension: 1 InterSliceSeparateTree: 0 -GeoInterIbc: 1 +GeoInterIbc: 1 IntraToolControlMode: 2 diff --git a/cfg/per-class/classF_lowdelay.cfg b/cfg/per-class/classF_lowdelay.cfg index a92d9b377..8338bf230 100644 --- a/cfg/per-class/classF_lowdelay.cfg +++ b/cfg/per-class/classF_lowdelay.cfg @@ -1,25 +1,26 @@ -MaxMTTHierarchyDepthByTidOverrideByQP: 22 322222 -IBC: 3 -HashME: 1 -BDPCM: 1 -TemporalFilter: 0 -IntraTMP: 1 -FastIntraTMP: 0 -SGPMnoBlend: 1 -PLT: 1 -RRIBC: 1 -TMIBC: 1 -IBCFastMethod: 6 -IBCMerge: 1 -IBCMBVDAdaptive: 1 -IBCHashSearch: 1 -IBCCIIP: 1 -IBCGPM: 1 -BvpCluster: 1 -IBCBiPred: 0 -IBCNonAdjCand: 1 -IBCFilter: 1 -ItmpLicExtension: 1 +IBC: 3 +HashME: 1 +BDPCM: 1 +TemporalFilter: 0 +IntraTMP: 1 +FastIntraTMP: 0 +SGPMnoBlend: 1 +PLT: 1 +RRIBC: 1 +TMIBC: 1 +IBCFastMethod: 6 +IBCMerge: 1 +IBCMBVDAdaptive: 1 +IBCHashSearch: 1 +IBCCIIP: 1 +IBCGPM: 1 +BvpCluster: 1 +IBCBiPred: 0 +IBCNonAdjCand: 1 +IBCFilter: 1 +ItmpLicExtension: 1 InterSliceSeparateTree: 0 -GeoInterIbc: 1 +GeoInterIbc: 1 IntraToolControlMode: 2 + +MaxMTTHierarchyDepthByTidOverrideByQP: 22 322222 \ No newline at end of file diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp index 69929d973..d098ad30c 100644 --- a/source/Lib/CommonLib/InterPrediction.cpp +++ b/source/Lib/CommonLib/InterPrediction.cpp @@ -217,10 +217,10 @@ InterPrediction::InterPrediction() m_fillLicTpl[i] = false; } #endif - m_LICMultApprox[0] = 0; + m_licMultApprox[0] = 0; for (int k = 1; k < 64; k++) { - m_LICMultApprox[k] = ((1 << 15) + (k >> 1)) / k; + m_licMultApprox[k] = ((1 << 15) + (k >> 1)) / k; } #endif @@ -1787,12 +1787,12 @@ void InterPrediction::xPredInterUni(const PredictionUnit &pu, const RefPicList & const int biShift = IF_INTERNAL_PREC - clpRng.bd; const Pel biOffset = -IF_INTERNAL_OFFS; pcYuvPred.bufs[compID].toLast(clpRng); - pcYuvPred.bufs[compID].linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + pcYuvPred.bufs[compID].linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); pcYuvPred.bufs[compID].linearTransform(1, -biShift, biOffset, false, clpRng); } else { - pcYuvPred.bufs[compID].linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + pcYuvPred.bufs[compID].linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); } } pu.cu->licFlag = true; @@ -3753,6 +3753,143 @@ void InterPrediction::xPredInterBi(PredictionUnit &pu, PelUnitBuf &pcYuvPred, co } #if JVET_AG0276_NLIC +#if JVET_AG0276_LIC_FLAG_SIGNALING +// explicit instantiation +template void InterPrediction::xDevSecLicPara<true> ( CodingUnit& cu, PelUnitBuf& predBuf, PelUnitBuf& dstBuf ); +template void InterPrediction::xDevSecLicPara<false>( CodingUnit& cu, PelUnitBuf& predBuf, PelUnitBuf& dstBuf ); + +template <bool isBRcand> +#endif +void InterPrediction::xDevSecLicPara( CodingUnit& cu, PelUnitBuf& predBuf, PelUnitBuf& dstBuf ) +{ + for( int comp = 0; comp < MAX_NUM_COMPONENT; comp++ ) + { + ComponentID compID = ComponentID( comp ); + Pel* pred = predBuf.get( compID ).buf; + int predStride = predBuf.get( compID ).stride; + Pel* rec = dstBuf.get( compID ).buf; + int recStride = dstBuf.get( compID ).stride; + + const int cuWidth = cu.blocks[ compID ].width; + const int cuHeight = cu.blocks[ compID ].height; + + const int bitDepth = cu.cs->sps->getBitDepth( toChannelType( compID ) ); + const int precShift = std::max( 0, bitDepth - 12 ); +#if JVET_AG0276_LIC_FLAG_SIGNALING + const int maxNumMinus1 = isBRcand ? ( 30 - 2 * std::min( bitDepth, 12 ) - 1 ) : ( 30 - 2 * std::min( bitDepth, 12 ) ); +#else + const int maxNumMinus1 = 30 - 2 * std::min( bitDepth, 12 ); +#endif + const int minDimBit = floorLog2( std::min( cuHeight, cuWidth ) ); + const int minDim = 1 << minDimBit; + int minStepBit = minDim > 8 ? 1 : 0; +#if JVET_AG0276_LIC_FLAG_SIGNALING + while( isBRcand ? ( minDimBit > minStepBit + maxNumMinus1 ) : ( ( ( minDimBit - minStepBit ) << 1 ) > maxNumMinus1 ) ) +#else + while( ( ( minDimBit - minStepBit ) << 1 ) > maxNumMinus1 ) +#endif + { + minStepBit++; + } //make sure 2*log2(minDim/tmpStep) + 2*min(bitDepth,12) <= 30 + const int numSteps = minDim >> minStepBit; + const int dimShift = minDimBit - minStepBit; + + //----- get correlation data ----- + int x = 0, y = 0, xx = 0, xy = 0; +#if JVET_AG0276_LIC_FLAG_SIGNALING + int cntShift = 0; + if( isBRcand ) + { + Pel* refBottom = pred + ( cuHeight - 1 ) * predStride; + Pel* recBottom = rec + ( cuHeight - 1 ) * recStride; + for( int k = 0; k < numSteps; k++ ) + { + int idx = ( k * cuWidth ) >> dimShift; + int refVal = refBottom[ idx ]; + int recVal = recBottom[ idx ]; + x += refVal; + y += recVal; + xx += refVal * refVal; + xy += refVal * recVal; + } + cntShift = dimShift; + + Pel* refRight = pred + cuWidth - 1; + Pel* recRight = rec + cuWidth - 1; + for( int k = 0; k < numSteps; k++ ) + { + int idx = ( k * cuHeight ) >> dimShift; + int refVal = refRight[ idx * predStride ]; + int recVal = recRight[ idx * recStride ]; + x += refVal; + y += recVal; + xx += refVal * refVal; + xy += refVal * recVal; + } + cntShift += ( cntShift ? 1 : dimShift ); + } + else +#endif + { + for( int h = 0; h < numSteps; h++ ) + { + int vDim = ( ( h * cuHeight ) >> dimShift ); + + for( int w = 0; w < numSteps; w++ ) + { + int hDim = ( ( w * cuWidth ) >> dimShift ); + + int predVal = pred[ vDim * predStride + hDim ] >> precShift; + int recVal = rec[ vDim * recStride + hDim ] >> precShift; + + x += predVal; + y += recVal; + xx += predVal * predVal; + xy += predVal * recVal; + } + } + } + + int shift = m_licShift; +#if JVET_AG0276_LIC_FLAG_SIGNALING + int& scale = isBRcand ? cu.altLMBRParaUnit.scale[ compID ] : cu.altLMParaUnit.scale[ compID ]; + int& offset = isBRcand ? cu.altLMBRParaUnit.offset[ compID ] : cu.altLMParaUnit.offset[ compID ]; + if( !isBRcand ) + { + cntShift = ( dimShift << 1 ); + CHECK( !cntShift, "cntShift == 0" ); + } +#else + int& scale = cu.altLMParaUnit.scale[ compID ]; + int& offset = cu.altLMParaUnit.offset[ compID ]; + int cntShift = ( dimShift << 1 ); CHECK( !cntShift, "cntShift == 0" ); +#endif + const int cropShift = std::max( 0, bitDepth - precShift + cntShift - 15 ); + const int xzOffset = ( xx >> m_licRegShift ); + const int sumX = ( x << precShift ); + const int sumY = ( y << precShift ); + const int sumXX = ( ( xx + xzOffset ) >> ( cropShift << 1 ) ) << cntShift; + const int sumXY = ( ( xy + xzOffset ) >> ( cropShift << 1 ) ) << cntShift; + const int sumXsumX = ( x >> cropShift ) * ( x >> cropShift ); + const int sumXsumY = ( x >> cropShift ) * ( y >> cropShift ); + int a1 = sumXY - sumXsumY; + int a2 = sumXX - sumXsumX; + int scaleShiftA2 = getMSB( abs( a2 ) ) - 6; + int scaleShiftA1 = scaleShiftA2 - m_licShiftDiff; + scaleShiftA2 = std::max( 0, scaleShiftA2 ); + scaleShiftA1 = std::max( 0, scaleShiftA1 ); + const int scaleShiftA = scaleShiftA2 + 15 - shift - scaleShiftA1; + a1 = a1 >> scaleShiftA1; + a2 = Clip3( 0, 63, a2 >> scaleShiftA2 ); + scale = int( ( int64_t( a1 ) * int64_t( m_licMultApprox[ a2 ] ) ) >> scaleShiftA ); + scale = Clip3( 0, 1 << ( shift + 2 ), scale ); + const int maxOffset = ( 1 << ( bitDepth - 1 ) ) - 1; + const int minOffset = -1 - maxOffset; + offset = ( sumY - ( ( scale * sumX ) >> shift ) + ( ( 1 << ( cntShift ) ) >> 1 ) ) >> cntShift; + offset = Clip3( minOffset, maxOffset, offset ); + } +} + void InterPrediction::xPredWoRefinement(PredictionUnit& pu, PelUnitBuf &pcYuvPred, const bool luma, const bool chroma) { if (xCheckIdenticalMotion(pu)) @@ -4448,7 +4585,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio if (!pu.cs->sps->getRprEnabledFlag()) { #endif - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); #if !JVET_AF0190_RPR_TMP_REORDER_LIC } #endif @@ -4513,7 +4650,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio } dstBuf.toLast(clpRng); - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); dstBuf.linearTransform(1, -biShift, biOffset, false, clpRng); if (bioApplied && compID == COMPONENT_Y) { @@ -4525,14 +4662,14 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio } else { - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); } } if (!m_isAddHypMC) { m_scale [m_iRefListIdx][compID] = pu.cu->licScale[m_iRefListIdx][compID]; m_offset[m_iRefListIdx][compID] = pu.cu->licOffset[m_iRefListIdx][compID]; - m_shift [m_iRefListIdx][compID] = m_LICShift; + m_shift [m_iRefListIdx][compID] = m_licShift; } return; } @@ -4561,16 +4698,16 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio const int biShift = IF_INTERNAL_PREC - clpRng.bd; const Pel biOffset = -IF_INTERNAL_OFFS; dstBuf.toLast(clpRng); - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); dstBuf.linearTransform(1, -biShift, biOffset, false, clpRng); } else { - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); } m_scale [m_iRefListIdx][compID] = pu.cu->licScale[m_iRefListIdx][compID]; m_offset[m_iRefListIdx][compID] = pu.cu->licOffset[m_iRefListIdx][compID]; - m_shift [m_iRefListIdx][compID] = m_LICShift; + m_shift [m_iRefListIdx][compID] = m_licShift; return; } #endif @@ -5259,7 +5396,7 @@ void InterPrediction::xPredInterBlk64(const ComponentID& compID, const Predictio if (!pu.cs->sps->getRprEnabledFlag()) { #endif - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); #if !JVET_AF0190_RPR_TMP_REORDER_LIC } #endif @@ -5324,7 +5461,7 @@ void InterPrediction::xPredInterBlk64(const ComponentID& compID, const Predictio } dstBuf.toLast(clpRng); - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); dstBuf.linearTransform(1, -biShift, biOffset, false, clpRng); if (bioApplied && compID == COMPONENT_Y) { @@ -5336,14 +5473,14 @@ void InterPrediction::xPredInterBlk64(const ComponentID& compID, const Predictio } else { - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); } } if (!m_isAddHypMC) { m_scale[m_iRefListIdx][compID] = pu.cu->licScale[m_iRefListIdx][compID]; m_offset[m_iRefListIdx][compID] = pu.cu->licOffset[m_iRefListIdx][compID]; - m_shift[m_iRefListIdx][compID] = m_LICShift; + m_shift[m_iRefListIdx][compID] = m_licShift; } return; } @@ -5372,16 +5509,16 @@ void InterPrediction::xPredInterBlk64(const ComponentID& compID, const Predictio const int biShift = IF_INTERNAL_PREC - clpRng.bd; const Pel biOffset = -IF_INTERNAL_OFFS; dstBuf.toLast(clpRng); - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); dstBuf.linearTransform(1, -biShift, biOffset, false, clpRng); } else { - dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_LICShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); + dstBuf.linearTransform(pu.cu->licScale[m_iRefListIdx][compID], m_licShift, pu.cu->licOffset[m_iRefListIdx][compID], true, clpRng); } m_scale[m_iRefListIdx][compID] = pu.cu->licScale[m_iRefListIdx][compID]; m_offset[m_iRefListIdx][compID] = pu.cu->licOffset[m_iRefListIdx][compID]; - m_shift[m_iRefListIdx][compID] = m_LICShift; + m_shift[m_iRefListIdx][compID] = m_licShift; return; } #endif @@ -18374,11 +18511,11 @@ void InterPrediction::getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBuf const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); if (m_bAMLTemplateAvailabe[0]) { - pcBufPredRefTop.Y().linearTransform(pu.cu->licScale[REF_PIC_LIST_0][0], m_LICShift, pu.cu->licOffset[REF_PIC_LIST_0][0], true, clpRng); + pcBufPredRefTop.Y().linearTransform(pu.cu->licScale[REF_PIC_LIST_0][0], m_licShift, pu.cu->licOffset[REF_PIC_LIST_0][0], true, clpRng); } if (m_bAMLTemplateAvailabe[1]) { - pcBufPredRefLeft.Y().linearTransform(pu.cu->licScale[REF_PIC_LIST_0][0], m_LICShift, pu.cu->licOffset[REF_PIC_LIST_0][0], true, clpRng); + pcBufPredRefLeft.Y().linearTransform(pu.cu->licScale[REF_PIC_LIST_0][0], m_licShift, pu.cu->licOffset[REF_PIC_LIST_0][0], true, clpRng); } } #endif @@ -18453,7 +18590,7 @@ void InterPrediction::getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBuf { const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); pcMbBuf.Y().toLast(clpRng); - pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_LICShift, pu.cu->licOffset[refList][0], true, clpRng); + pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_licShift, pu.cu->licOffset[refList][0], true, clpRng); pcMbBuf.Y().linearTransform(1, -biShift, biOffset, false, clpRng); } #endif @@ -18483,7 +18620,7 @@ void InterPrediction::getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBuf if (pu.cu->licInheritPara) { const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); - pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_LICShift, pu.cu->licOffset[refList][0], true, clpRng); + pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_licShift, pu.cu->licOffset[refList][0], true, clpRng); } #endif } @@ -18534,7 +18671,7 @@ void InterPrediction::getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBuf { const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); pcMbBuf.Y().toLast(clpRng); - pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_LICShift, pu.cu->licOffset[refList][0], true, clpRng); + pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_licShift, pu.cu->licOffset[refList][0], true, clpRng); pcMbBuf.Y().linearTransform(1, -biShift, biOffset, false, clpRng); } #endif @@ -18564,7 +18701,7 @@ void InterPrediction::getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBuf if (pu.cu->licInheritPara) { const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); - pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_LICShift, pu.cu->licOffset[refList][0], true, clpRng); + pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_licShift, pu.cu->licOffset[refList][0], true, clpRng); } #endif } @@ -18771,7 +18908,7 @@ void InterPrediction::getBlkAMLRefTemplateAlt(PredictionUnit &pu, PelUnitBuf &pc { const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); pcMbBuf.Y().toLast(clpRng); - pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_LICShift, pu.cu->licOffset[refList][0], true, clpRng); + pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_licShift, pu.cu->licOffset[refList][0], true, clpRng); pcMbBuf.Y().linearTransform(1, -biShift, biOffset, false, clpRng); } #endif @@ -18813,7 +18950,7 @@ void InterPrediction::getBlkAMLRefTemplateAlt(PredictionUnit &pu, PelUnitBuf &pc { const ClpRng& clpRng = pu.cu->slice->clpRng(COMPONENT_Y); pcMbBuf.Y().toLast(clpRng); - pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_LICShift, pu.cu->licOffset[refList][0], true, clpRng); + pcMbBuf.Y().linearTransform(pu.cu->licScale[refList][0], m_licShift, pu.cu->licOffset[refList][0], true, clpRng); pcMbBuf.Y().linearTransform(1, -biShift, biOffset, false, clpRng); } #endif @@ -20304,10 +20441,10 @@ void InterPrediction::getAffAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBuf { CHECK(!pu.cu->licFlag, "LIC flag must be set when inherited LIC mode is used"); pu.cu->licFlag = false; - LICshift[0] = m_LICShift; + LICshift[0] = m_licShift; scale [0] = pu.cu->licScale [0][0]; offset [0] = pu.cu->licOffset[0][0]; - LICshift[1] = m_LICShift; + LICshift[1] = m_licShift; scale [1] = pu.cu->licScale [1][0]; offset [1] = pu.cu->licOffset[1][0]; } @@ -21137,10 +21274,10 @@ void InterPrediction::getAffAndSbtmvpRefTemplate(PredictionUnit& pu, PelUnitBuf& #if JVET_AH0314_LIC_INHERITANCE_FOR_MRG && JVET_AJ0274_GPM_AFFINE_TM if (pu.cu->licInheritPara && pu.cu->geoFlag && pu.cs->sps->getMaxNumGpmAffTmCand() > 0) { - LICshift[0] = m_LICShift; + LICshift[0] = m_licShift; scale[0] = pu.cu->licScale[0][0]; offset[0] = pu.cu->licOffset[0][0]; - LICshift[1] = m_LICShift; + LICshift[1] = m_licShift; scale[1] = pu.cu->licScale[1][0]; offset[1] = pu.cu->licOffset[1][0]; } @@ -21337,10 +21474,10 @@ void InterPrediction::getAffAMLRefTemplateAlt(PredictionUnit &pu, PelUnitBuf &pc { CHECK(!pu.cu->licFlag, "LCI flag must be set when inherited LIC mode is used"); pu.cu->licFlag = false; - licShift[0] = m_LICShift; + licShift[0] = m_licShift; scale[0] = pu.cu->licScale[0][0]; offset[0] = pu.cu->licOffset[0][0]; - licShift[1] = m_LICShift; + licShift[1] = m_licShift; scale[1] = pu.cu->licScale[1][0]; offset[1] = pu.cu->licOffset[1][0]; } @@ -22742,7 +22879,7 @@ void InterPrediction::getBlkOBMCRefTemplate(PredictionUnit &subblockPu, PelUnitB const Pel biOffset = -IF_INTERNAL_OFFS; const int biShift = IF_INTERNAL_PREC - clpRng.bd; pcMbBuf.bufs[COMPONENT_Y].toLast(clpRng); - pcMbBuf.bufs[COMPONENT_Y].linearTransform(subblockPu.cu->licScale[refList][COMPONENT_Y], m_LICShift, subblockPu.cu->licOffset[refList][COMPONENT_Y], true, clpRng); + pcMbBuf.bufs[COMPONENT_Y].linearTransform(subblockPu.cu->licScale[refList][COMPONENT_Y], m_licShift, subblockPu.cu->licOffset[refList][COMPONENT_Y], true, clpRng); pcMbBuf.bufs[COMPONENT_Y].linearTransform(1, -biShift, biOffset, false, clpRng); } #endif @@ -22858,7 +22995,7 @@ void InterPrediction::getBlkOBMCRefTemplate(PredictionUnit &subblockPu, PelUnitB const int biShift = IF_INTERNAL_PREC - clpRng.bd; PelUnitBuf pcMbBufTranspose = PelUnitBuf(subblockPu.chromaFormat, PelBuf(m_acYuvRefLeftTemplate[refList][0], pcBufPredRefLeftTranspose.Y())); pcMbBufTranspose.bufs[COMPONENT_Y].toLast(clpRng); - pcMbBufTranspose.bufs[COMPONENT_Y].linearTransform(subblockPu.cu->licScale[refList][COMPONENT_Y], m_LICShift, subblockPu.cu->licOffset[refList][COMPONENT_Y], true, clpRng); + pcMbBufTranspose.bufs[COMPONENT_Y].linearTransform(subblockPu.cu->licScale[refList][COMPONENT_Y], m_licShift, subblockPu.cu->licOffset[refList][COMPONENT_Y], true, clpRng); pcMbBufTranspose.bufs[COMPONENT_Y].linearTransform(1, -biShift, biOffset, false, clpRng); } #endif @@ -24205,7 +24342,7 @@ void InterPrediction::xLicCompAdj(const PredictionUnit& pu, PelUnitBuf& pcYuvPre const ClpRng& clpRng = pu.cu->slice->clpRng(ComponentID(compID)); const int biShift = IF_INTERNAL_PREC - clpRng.bd; curSrcPred.bufs[compID].toLast(clpRng); - curSrcPred.bufs[compID].linearTransform(pu.cu->licScale[refList][compID], m_LICShift, pu.cu->licOffset[refList][compID], true, clpRng); + curSrcPred.bufs[compID].linearTransform(pu.cu->licScale[refList][compID], m_licShift, pu.cu->licOffset[refList][compID], true, clpRng); curSrcPred.bufs[compID].linearTransform(1, -biShift, biOffset, false, clpRng); } } @@ -24230,7 +24367,7 @@ void InterPrediction::xLicCompAdj(const PredictionUnit& pu, PelUnitBuf& pcYuvPre { m_scale [refList][compID] = pu.cu->licScale[refList][compID]; m_offset[refList][compID] = pu.cu->licOffset[refList][compID]; - m_shift [refList][compID] = m_LICShift; + m_shift [refList][compID] = m_licShift; } } } @@ -24334,7 +24471,7 @@ void InterPrediction::xLicCompAdjBdof(const PredictionUnit& pu, PelUnitBuf& pcYu { m_scale [refList][compID] = pu.cu->licScale[refList][compID]; m_offset[refList][compID] = pu.cu->licOffset[refList][compID]; - m_shift [refList][compID] = m_LICShift; + m_shift [refList][compID] = m_licShift; } } } @@ -24572,7 +24709,7 @@ void InterPrediction::xGetLICParamGeneral(const CodingUnit& cu, return; } #endif - shift = m_LICShift; + shift = m_licShift; if (cntShift == 0) { scale = (1 << shift); @@ -24581,7 +24718,7 @@ void InterPrediction::xGetLICParamGeneral(const CodingUnit& cu, } const int cropShift = std::max(0, bitDepth - precShift + cntShift - 15); - const int xzOffset = (xx >> m_LICRegShift); + const int xzOffset = (xx >> m_licRegShift); const int sumX = x << precShift; const int sumY = y << precShift; const int sumXX = ((xx + xzOffset) >> (cropShift << 1)) << cntShift; @@ -24591,13 +24728,13 @@ void InterPrediction::xGetLICParamGeneral(const CodingUnit& cu, int a1 = sumXY - sumXsumY; int a2 = sumXX - sumXsumX; int scaleShiftA2 = getMSB(abs(a2)) - 6; - int scaleShiftA1 = scaleShiftA2 - m_LICShiftDiff; + int scaleShiftA1 = scaleShiftA2 - m_licShiftDiff; scaleShiftA2 = std::max(0, scaleShiftA2); scaleShiftA1 = std::max(0, scaleShiftA1); const int scaleShiftA = scaleShiftA2 + 15 - shift - scaleShiftA1; a1 = a1 >> scaleShiftA1; a2 = Clip3(0, 63, a2 >> scaleShiftA2); - scale = int((int64_t(a1) * int64_t(m_LICMultApprox[a2])) >> scaleShiftA); + scale = int((int64_t(a1) * int64_t(m_licMultApprox[a2])) >> scaleShiftA); scale = Clip3(0, 1 << (shift + 2), scale); const int maxOffset = (1 << (bitDepth - 1)) - 1; const int minOffset = -1 - maxOffset; @@ -25745,7 +25882,7 @@ Distortion InterPrediction::deriveTMMv(const PredictionUnit& pu, bool fillCurTpl { m_scale [eRefList][COMPONENT_Y] = pu.cu->licScale [eRefList][COMPONENT_Y]; m_offset[eRefList][COMPONENT_Y] = pu.cu->licOffset[eRefList][COMPONENT_Y]; - m_shift [eRefList][COMPONENT_Y] = m_LICShift; + m_shift [eRefList][COMPONENT_Y] = m_licShift; } #endif diff --git a/source/Lib/CommonLib/InterPrediction.h b/source/Lib/CommonLib/InterPrediction.h index a0c580588..e46bec251 100644 --- a/source/Lib/CommonLib/InterPrediction.h +++ b/source/Lib/CommonLib/InterPrediction.h @@ -190,7 +190,7 @@ public: }; #endif #if JVET_Z0136_OOB - bool isMvOOB(const Mv& rcMv, const struct Position pos, const struct Size size, const SPS* sps, const PPS* pps, bool *mcMask, bool *mcMaskChroma, bool lumaOnly = false); + bool isMvOOB (const Mv& rcMv, const struct Position pos, const struct Size size, const SPS* sps, const PPS* pps, bool *mcMask, bool *mcMaskChroma, bool lumaOnly = false); bool isMvOOBSubBlk(const Mv& rcMv, const struct Position pos, const struct Size size, const SPS* sps, const PPS* pps, bool *mcMask, int mcStride, bool *mcMaskChroma, int mcCStride, bool lumaOnly = false); #endif #if INTER_LIC || (TM_AMVP || TM_MRG || JVET_Z0084_IBC_TM) || JVET_W0090_ARMC_TM || JVET_Z0056_GPM_SPLIT_MODE_REORDERING || JVET_Z0061_TM_OBMC // note: already refactor @@ -199,10 +199,10 @@ public: private: #if INTER_LIC - static const int m_LICShift = 5; - static const int m_LICRegShift = 7; - static const int m_LICShiftDiff = 12; - int m_LICMultApprox[64]; + static const int m_licShift = 5; + static const int m_licRegShift = 7; + static const int m_licShiftDiff = 12; + int m_licMultApprox[64]; #endif #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED Pel* m_intraOBMCBuf[MAX_NUM_COMPONENT]; @@ -274,12 +274,12 @@ public: DistParam m_bmDistParam; int32_t m_bmCostShift; // bilateral matching cost shift - int32_t m_bmSubBlkW; - int32_t m_bmSubBlkH; + int32_t m_bmSubBlkW; + int32_t m_bmSubBlkH; std::vector<BMSubBlkInfo> m_bmSubBlkList; #endif #if JVET_AH0119_SUBBLOCK_TM - MotionInfo m_sbMiBuf[3][(MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1)]; + MotionInfo m_sbMiBuf[3][(MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1)]; #endif protected: InterpolationFilter m_if; @@ -464,14 +464,11 @@ protected: #endif #else #if JVET_Z0136_OOB - void applyBiOptFlow(const PredictionUnit &pu, const CPelUnitBuf &yuvSrc0, const CPelUnitBuf &yuvSrc1, const int &refIdx0, const int &refIdx1, PelUnitBuf &yuvDst, const BitDepths &clipBitDepths, bool *mcMask[2] = NULL, bool *mcMaskChroma[2] = NULL, bool *isOOB = NULL); + void applyBiOptFlow (const PredictionUnit &pu, const CPelUnitBuf &yuvSrc0, const CPelUnitBuf &yuvSrc1, const int &refIdx0, const int &refIdx1, PelUnitBuf &yuvDst, const BitDepths &clipBitDepths, bool *mcMask[2] = NULL, bool *mcMaskChroma[2] = NULL, bool *isOOB = NULL); #else - void applyBiOptFlow(const PredictionUnit &pu, const CPelUnitBuf &yuvSrc0, const CPelUnitBuf &yuvSrc1, const int &refIdx0, const int &refIdx1, PelUnitBuf &yuvDst, const BitDepths &clipBitDepths); + void applyBiOptFlow (const PredictionUnit &pu, const CPelUnitBuf &yuvSrc0, const CPelUnitBuf &yuvSrc1, const int &refIdx0, const int &refIdx1, PelUnitBuf &yuvDst, const BitDepths &clipBitDepths); #endif - void xPredInterUni ( const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi - , const bool& bioApplied - , const bool luma, const bool chroma - ); + void xPredInterUni ( const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi, const bool& bioApplied, const bool luma, const bool chroma ); #endif #if MULTI_PASS_DMVR || SAMPLE_BASED_BDOF #if JVET_Z0136_OOB @@ -571,20 +568,20 @@ protected: #if JVET_W0090_ARMC_TM || JVET_Z0056_GPM_SPLIT_MODE_REORDERING #if !INTER_LIC template <bool trueAfalseL> - void xGetPredBlkTpl(const CodingUnit& cu, const ComponentID compID, const CPelBuf& refBuf, const Mv& mv, const int posW, const int posH, const int tplSize, Pel* predBlkTpl + void xGetPredBlkTpl (const CodingUnit& cu, const ComponentID compID, const CPelBuf& refBuf, const Mv& mv, const int posW, const int posH, const int tplSize, Pel* predBlkTpl #if JVET_Y0067_ENHANCED_MMVD_MVD_SIGN_PRED , bool AML = false #endif ); #endif - void xWeightedAverageY(const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs); + void xWeightedAverageY (const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs); #endif #if JVET_W0090_ARMC_TM #if JVET_AD0140_MVD_PREDICTION template <bool exitIfOob, int iAbove1Left2All3> - bool xPredAffineTpl(const PredictionUnit& pu, const RefPicList& eRefPicList, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate + bool xPredAffineTpl (const PredictionUnit& pu, const RefPicList& eRefPicList, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate #else - void xPredAffineTpl(const PredictionUnit &pu, const RefPicList &eRefPicList, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate + void xPredAffineTpl (const PredictionUnit &pu, const RefPicList &eRefPicList, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate #endif #if JVET_AC0185_ENHANCED_TEMPORAL_MOTION_DERIVATION , AffineMergeCtx affMrgCtx, bool isBilinear @@ -610,23 +607,23 @@ protected: static bool xCheckIdenticalMotion( const PredictionUnit& pu ); - void xSubPuMC(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X, const bool luma = true, const bool chroma = true); + void xSubPuMC (PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X, const bool luma = true, const bool chroma = true); #if JVET_AF0159_AFFINE_SUBPU_BDOF_REFINEMENT - bool xGetSubPuGroupArea2D(PredictionUnit& pu, PredictionUnit& subPu, uint8_t* sbtmvpSubPuDerivedPtr, Position& subPuStartPos); - bool xGetSubPuGroupAreaStartPos(PredictionUnit& pu, Position& subPuStartPos, uint8_t* sbtmvpSubPuDerivedPtr); - bool xCheckIdenticalMotionInfo(MotionInfo orgMotionInfo, MotionInfo targetMotionInfo, MergeType puMergeType); + bool xGetSubPuGroupArea2D (PredictionUnit& pu, PredictionUnit& subPu, uint8_t* sbtmvpSubPuDerivedPtr, Position& subPuStartPos); + bool xGetSubPuGroupAreaStartPos (PredictionUnit& pu, Position& subPuStartPos, uint8_t* sbtmvpSubPuDerivedPtr); + bool xCheckIdenticalMotionInfo (MotionInfo orgMotionInfo, MotionInfo targetMotionInfo, MergeType puMergeType); #endif #if ENABLE_OBMC #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED - void xSubblockOBMC(const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, PelUnitBuf &pcYuvBefore, int iDir, bool bSubMotion = false, bool bIsIntra = false); + void xSubblockOBMC (const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, PelUnitBuf &pcYuvBefore, int iDir, bool bSubMotion = false, bool bIsIntra = false); #else - void xSubblockOBMC(const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, int iDir, bool bSubMotion = false); + void xSubblockOBMC (const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, int iDir, bool bSubMotion = false); #endif - void xSubBlockMotionCompensation(PredictionUnit &pu, PelUnitBuf &pcYuvPred); - void xSubblockOBMCBlending(const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc1, PelUnitBuf &pcYuvPredSrc2, PelUnitBuf &pcYuvPredSrc3, PelUnitBuf &pcYuvPredSrc4, bool isAboveAvail = false, bool isLeftAvail = false, bool isBelowAvail = false, bool isRightAvail = false, bool bSubMotion = false); + void xSubBlockMotionCompensation (PredictionUnit &pu, PelUnitBuf &pcYuvPred); + void xSubblockOBMCBlending (const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc1, PelUnitBuf &pcYuvPredSrc2, PelUnitBuf &pcYuvPredSrc3, PelUnitBuf &pcYuvPredSrc4, bool isAboveAvail = false, bool isLeftAvail = false, bool isBelowAvail = false, bool isRightAvail = false, bool bSubMotion = false); #endif #if !BDOF_RM_CONSTRAINTS - void xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X, PelUnitBuf* yuvDstTmp = NULL); + void xSubPuBio (PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X, PelUnitBuf* yuvDstTmp = NULL); #endif #if !JVET_AI0183_MVP_EXTENSION @@ -732,21 +729,20 @@ public: #if JVET_Y0067_ENHANCED_MMVD_MVD_SIGN_PRED #if JVET_AD0140_MVD_PREDICTION - void deriveMVDCandVecFromMotionInforPred(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec, bool &isMvdDerivedVecOrigSpecified); - void deriveAffineMVDCandVecFromMotionInforPred(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> cMvdDerivedVec[3], bool &isMvdDerivedVecOrigSpecified); - void deriveMVDCandVecFromMotionInforPredGeneral(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec, bool &isMvdDerivedVecOrigSpecified); + void deriveMVDCandVecFromMotionInforPred (const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec, bool &isMvdDerivedVecOrigSpecified); + void deriveAffineMVDCandVecFromMotionInforPred (const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> cMvdDerivedVec[3], bool &isMvdDerivedVecOrigSpecified); + void deriveMVDCandVecFromMotionInforPredGeneral (const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec, bool &isMvdDerivedVecOrigSpecified); void deriveAffineMVDCandVecFromMotionInforPredGeneral(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> cMvdDerivedVec[3], bool &isMvdDerivedVecOrigSpecified); #else - void deriveMVDCandVecFromMotionInforPred(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec); - void deriveAffineMVDCandVecFromMotionInforPred(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> cMvdDerivedVec[3]); - void deriveMVDCandVecFromMotionInforPredGeneral(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec); + void deriveMVDCandVecFromMotionInforPred (const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec); + void deriveAffineMVDCandVecFromMotionInforPred (const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> cMvdDerivedVec[3]); + void deriveMVDCandVecFromMotionInforPredGeneral (const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> &cMvdDerivedVec); void deriveAffineMVDCandVecFromMotionInforPredGeneral(const PredictionUnit &pu, std::vector<MotionInfoPred> &miPredList, RefPicList eRefPicList, std::vector<Mv> cMvdDerivedVec[3]); #endif #endif - void setBiRefPairIdx(PredictionUnit &pu); - void setBiRefIdx(PredictionUnit &pu); - void reorderRefPairList(PredictionUnit &pu, std::vector<RefPicPair> &refPairList - , std::vector<MotionInfoPred> &miPredList + void setBiRefPairIdx (PredictionUnit &pu); + void setBiRefIdx (PredictionUnit &pu); + void reorderRefPairList (PredictionUnit &pu, std::vector<RefPicPair> &refPairList, std::vector<MotionInfoPred> &miPredList #if JVET_AD0140_MVD_PREDICTION , std::vector<Mv> (&cMvdDerivedVec)[2][3] , bool &isMvdDerivedVecOrigSpecified @@ -756,21 +752,14 @@ public: // inter #if JVET_AE0046_BI_GPM - void setLumaBdofReady(bool isReady) { m_lumaBdofReady = isReady; } - void convert2HighPrec(PredictionUnit& pu, PelUnitBuf& predBuf, bool lumaOnly, bool chromaOnly, PelUnitBuf* yuvPredTmp = nullptr); + void setLumaBdofReady (bool isReady) { m_lumaBdofReady = isReady; } + void convert2HighPrec (PredictionUnit& pu, PelUnitBuf& predBuf, bool lumaOnly, bool chromaOnly, PelUnitBuf* yuvPredTmp = nullptr); #endif - void motionCompensation (PredictionUnit &pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X - , const bool luma = true, const bool chroma = true - , PelUnitBuf* predBufWOBIO = NULL - ); - void motionCompensation (PredictionUnit &pu, const RefPicList &eRefPicList = REF_PIC_LIST_X - , const bool luma = true, const bool chroma = true - ); - void motionCompensation (CodingUnit &cu, const RefPicList &eRefPicList = REF_PIC_LIST_X - , const bool luma = true, const bool chroma = true - ); + void motionCompensation (PredictionUnit &pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X, const bool luma = true, const bool chroma = true, PelUnitBuf* predBufWOBIO = nullptr ); + void motionCompensation (PredictionUnit &pu, const RefPicList &eRefPicList = REF_PIC_LIST_X, const bool luma = true, const bool chroma = true ); + void motionCompensation (CodingUnit &cu, const RefPicList &eRefPicList = REF_PIC_LIST_X, const bool luma = true, const bool chroma = true ); #if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS || JVET_AF0066_ENABLE_DBV_4_SINGLE_TREE - inline void getPredIBCBlk(const PredictionUnit& pu, ComponentID comp, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, bool bilinearMC = false + inline void getPredIBCBlk (const PredictionUnit& pu, ComponentID comp, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, bool bilinearMC = false #if JVET_AC0112_IBC_LIC , bool bypassIBCLic = false #endif @@ -785,7 +774,7 @@ public: m_storeBeforeLIC = false; } #endif - xPredInterBlk(comp, pu, refPic, _mv, dstPic, false, pu.cu->slice->clpRng(comp), false, true, SCALE_1X, 0, 0, bilinearMC); + xPredInterBlk (comp, pu, refPic, _mv, dstPic, false, pu.cu->slice->clpRng(comp), false, true, SCALE_1X, 0, 0, bilinearMC); #if JVET_AC0112_IBC_LIC if (bypassIBCLic) { @@ -796,7 +785,7 @@ public: } #endif #if JVET_AG0136_INTRA_TMP_LIC - inline void LicItmp(PredictionUnit &pu, PelBuf &dstBuf, const bool isLinearTransformDone) + inline void LicItmp (PredictionUnit &pu, PelBuf &dstBuf, const bool isLinearTransformDone) { CHECKD(pu.cu->ibcLicFlag!=pu.cu->tmpLicFlag, "InterPrediction::LicItmp: abnormal: pu.cu->ibcLicFlag and pu.cu->tmpLicFlag should be equal"); CHECKD((pu.cu)->ibcFilterFlag, "`pu.cu->ibcFilterFlag` is not false."); @@ -808,12 +797,12 @@ public: #endif #if ENABLE_OBMC #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED - void subBlockOBMC(PredictionUnit &pu, PelUnitBuf *pDst = nullptr, IntraPrediction *pcIntraPred = nullptr); + void subBlockOBMC (PredictionUnit &pu, PelUnitBuf *pDst = nullptr, IntraPrediction *pcIntraPred = nullptr); #else - void subBlockOBMC(PredictionUnit &pu, PelUnitBuf *pDst = nullptr); + void subBlockOBMC (PredictionUnit &pu, PelUnitBuf *pDst = nullptr); #endif #if JVET_AD0193_ADAPTIVE_OBMC_CONTROL - bool isSCC(const PredictionUnit &pu); + bool isSCC (const PredictionUnit &pu); bool skipObmcConditionByPixel(PredictionUnit& pu, ComponentID comp, int width, int height, const Pel* src, int strideSrc, const Pel* dst, int strideDst, int bitDepth); #endif #endif @@ -924,20 +913,20 @@ public: #endif #endif #if JVET_AA0058_GPM_ADAPTIVE_BLENDING - void weightedGeoBlk(PredictionUnit &pu, const uint8_t splitDir, const uint8_t bldIdx, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); + void weightedGeoBlk (PredictionUnit &pu, const uint8_t splitDir, const uint8_t bldIdx, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); #if JVET_Y0065_GPM_INTRA void weightedGeoBlkRounded(PredictionUnit &pu, const uint8_t splitDir, const uint8_t bldIdx, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); #endif #else - void weightedGeoBlk(PredictionUnit &pu, const uint8_t splitDir, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); + void weightedGeoBlk (PredictionUnit &pu, const uint8_t splitDir, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); #if JVET_Y0065_GPM_INTRA void weightedGeoBlkRounded( PredictionUnit &pu, const uint8_t splitDir, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); #endif #endif #if JVET_AG0112_REGRESSION_BASED_GPM_BLENDING - void weightedBlendBlk( const PredictionUnit& pu, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1, WeightBuf& weightBuf, const int log2WeightBase, const bool roundOutputBD); - void weightedBlend( const PredictionUnit& pu, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1, const bool chromaOnly, const bool lumaOnly, const bool roundOutputBD = false); - void weightedAffineBlk( const PredictionUnit& pu, WeightBuf& weightBuf, const int log2WeightBase, AffineBlendingModel& blendModel ); + void weightedBlendBlk ( const PredictionUnit& pu, int32_t channel, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1, WeightBuf& weightBuf, const int log2WeightBase, const bool roundOutputBD); + void weightedBlend ( const PredictionUnit& pu, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1, const bool chromaOnly, const bool lumaOnly, const bool roundOutputBD = false); + void weightedAffineBlk ( const PredictionUnit& pu, WeightBuf& weightBuf, const int log2WeightBase, AffineBlendingModel& blendModel ); #endif #if JVET_Z0056_GPM_SPLIT_MODE_REORDERING #if JVET_W0097_GPM_MMVD_TM && TM_MRG @@ -949,25 +938,22 @@ public: #endif ); template <bool trueTFalseL> - void weightedGeoTpl(PredictionUnit &pu, const uint8_t splitDir, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); + void weightedGeoTpl (PredictionUnit &pu, const uint8_t splitDir, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1); #endif #if JVET_AF0057 bool dmvrEnableEncoderCheck; void xDmvrSetEncoderCheckFlag(bool enableFlag) { dmvrEnableEncoderCheck = enableFlag; } bool xDmvrGetEncoderCheckFlag() { return dmvrEnableEncoderCheck; } #endif - void xPrefetch(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicList refId, bool forLuma); - void xPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicList refId); - void xFinalPaddedMCForDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvSrc0, PelUnitBuf &pcYuvSrc1, PelUnitBuf &pcPad0, PelUnitBuf &pcPad1, const bool bioApplied - , const Mv startMV[NUM_REF_PIC_LIST_01] - , bool blockMoved - ); - void xBIPMVRefine(int bd, Pel *pRefL0, Pel *pRefL1, uint64_t& minCost, int16_t *deltaMV, uint64_t *pSADsArray, int width, int height); - uint64_t xDMVRCost(int bitDepth, Pel* pRef, uint32_t refStride, const Pel* pOrg, uint32_t orgStride, int width, int height); - void xinitMC(PredictionUnit& pu, const ClpRngs &clpRngs); - void xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, const ClpRngs &clpRngs, const bool bioApplied ); + void xPrefetch (PredictionUnit& pu, PelUnitBuf &pcPad, RefPicList refId, bool forLuma); + void xPad (PredictionUnit& pu, PelUnitBuf &pcPad, RefPicList refId); + void xFinalPaddedMCForDMVR (PredictionUnit& pu, PelUnitBuf &pcYuvSrc0, PelUnitBuf &pcYuvSrc1, PelUnitBuf &pcPad0, PelUnitBuf &pcPad1, const bool bioApplied, const Mv startMV[NUM_REF_PIC_LIST_01], bool blockMoved ); + void xBIPMVRefine (int bd, Pel *pRefL0, Pel *pRefL1, uint64_t& minCost, int16_t *deltaMV, uint64_t *pSADsArray, int width, int height); + uint64_t xDMVRCost (int bitDepth, Pel* pRef, uint32_t refStride, const Pel* pOrg, uint32_t orgStride, int width, int height); + void xinitMC (PredictionUnit& pu, const ClpRngs &clpRngs); + void xProcessDMVR (PredictionUnit& pu, PelUnitBuf &pcYuvDst, const ClpRngs &clpRngs, const bool bioApplied ); #if JVET_AA0061_IBC_MBVD - void sortIbcMergeMbvdCandidates(PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t * ibcMbvdLUT, uint32_t * ibcMbvdValidNum, int ibcMbvdIdx= -1); + void sortIbcMergeMbvdCandidates (PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t * ibcMbvdLUT, uint32_t * ibcMbvdValidNum, int ibcMbvdIdx= -1); #if JVET_AE0169_IBC_MBVD_LIST_DERIVATION void sortIbcAdaptiveMergeMbvdCandidates(PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t * ibcMbvdLUT, uint32_t * ibcMbvdValidNum, int ibcMbvdIdx= -1); #endif @@ -1016,23 +1002,23 @@ public: } void deriveMVDcandAffineSingleMv(const PredictionUnit& pu, RefPicList eRefPicList, int affineIdx, std::vector<Mv>& cMvdCandList); - uint16_t deriveMVDcandTrans(const PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdCandList); + uint16_t deriveMVDcandTrans (const PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdCandList); #endif - void deriveMvdSign(const Mv& cMvPred, const Mv& cMvdKnownAtDecoder, PredictionUnit& pu, RefPicList eRefPicList, int iRefIdx, std::vector<Mv>& cMvdDerived); + void deriveMvdSign (const Mv& cMvPred, const Mv& cMvdKnownAtDecoder, PredictionUnit& pu, RefPicList eRefPicList, int iRefIdx, std::vector<Mv>& cMvdDerived); #if JVET_AD0140_MVD_PREDICTION - void initOffsetsMvd(Mv& cMvdInput, std::vector<Mv>& cMvdDerived, MvdSuffixInfo& si, int imv); - void defineSignHypMatch(const Mv &cMvdInput, MvdSuffixInfo &si, const int mvsdIdx); - void defineSignHypMatchAffine(PredictionUnit &pu, const RefPicList eRefPicList); - void applyOffsetsMvd(Mv& cMvdInput, std::vector<Mv>& cMvdDerived, const MvdSuffixInfo& si, int imv); + void initOffsetsMvd (Mv& cMvdInput, std::vector<Mv>& cMvdDerived, MvdSuffixInfo& si, int imv); + void defineSignHypMatch (const Mv &cMvdInput, MvdSuffixInfo &si, const int mvsdIdx); + void defineSignHypMatchAffine (PredictionUnit &pu, const RefPicList eRefPicList); + void applyOffsetsMvd (Mv& cMvdInput, std::vector<Mv>& cMvdDerived, const MvdSuffixInfo& si, int imv); - int deriveMVSDIdxFromMVDTransSI(const Mv& cMvd, const std::vector<Mv>& cMvdDerived, const MvdSuffixInfo &si); - Mv deriveMVDFromMVSDIdxTransSI(int mvsdIdx, const std::vector<Mv> &cMvdDerived, const MvdSuffixInfo &si); + int deriveMVSDIdxFromMVDTransSI (const Mv& cMvd, const std::vector<Mv>& cMvdDerived, const MvdSuffixInfo &si); + Mv deriveMVDFromMVSDIdxTransSI (int mvsdIdx, const std::vector<Mv> &cMvdDerived, const MvdSuffixInfo &si); #endif - int deriveMVSDIdxFromMVDTrans(Mv cMvd, std::vector<Mv>& cMvdDerived); - Mv deriveMVDFromMVSDIdxTrans(int mvsdIdx, std::vector<Mv>& cMvdDerived); - void deriveMvdSignSMVD(const Mv& cMvPred, const Mv& cMvPred2, const Mv& cMvdKnownAtDecoder, PredictionUnit& pu, std::vector<Mv>& cMvdDerived); - void deriveMvdSignAffine(const Mv& cMvPred, const Mv& cMvPred2, const Mv& cMvPred3, + int deriveMVSDIdxFromMVDTrans (Mv cMvd, std::vector<Mv>& cMvdDerived); + Mv deriveMVDFromMVSDIdxTrans (int mvsdIdx, std::vector<Mv>& cMvdDerived); + void deriveMvdSignSMVD (const Mv& cMvPred, const Mv& cMvPred2, const Mv& cMvdKnownAtDecoder, PredictionUnit& pu, std::vector<Mv>& cMvdDerived); + void deriveMvdSignAffine (const Mv& cMvPred, const Mv& cMvPred2, const Mv& cMvPred3, #if JVET_Z0054_BLK_REF_PIC_REORDER const Mv cMvdKnownAtDecoder[3], #else @@ -1041,29 +1027,29 @@ public: PredictionUnit& pu, RefPicList eRefList, int refIdx, std::vector<Mv>& cMvdDerived, std::vector<Mv>& cMvdDerived2, std::vector<Mv>& cMvdDerived3); #if JVET_AA0146_WRAP_AROUND_FIX #if JVET_AD0213_LIC_IMP - void xGetSublkTemplateCost(const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, + void xGetSublkTemplateCost (const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate, bool wrapRef = false); #else - Distortion xGetSublkTemplateCost(const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, + Distortion xGetSublkTemplateCost (const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate, bool wrapRef = false); #endif #else #if JVET_AD0213_LIC_IMP - void xGetSublkTemplateCost(const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, + void xGetSublkTemplateCost (const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate); #else - Distortion xGetSublkTemplateCost(const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, + Distortion xGetSublkTemplateCost (const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate); #endif #endif #if JVET_AD0140_MVD_PREDICTION - void initOffsetsAffineMvd(PredictionUnit &pu, RefPicList eRefList, const std::vector<Mv> (&cMvdDerived)[3]); - void applyOffsetsAffineMvd(const PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdInput, const std::vector<Mv>(&cMvdDerived)[3]); + void initOffsetsAffineMvd (PredictionUnit &pu, RefPicList eRefList, const std::vector<Mv> (&cMvdDerived)[3]); + void applyOffsetsAffineMvd (const PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdInput, const std::vector<Mv>(&cMvdDerived)[3]); - int deriveMVSDIdxFromMVDAffineSI(PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdDerived, std::vector<Mv>& cMvdDerived2, std::vector<Mv>& cMvdDerived3); + int deriveMVSDIdxFromMVDAffineSI (PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdDerived, std::vector<Mv>& cMvdDerived2, std::vector<Mv>& cMvdDerived3); std::vector<Mv> deriveMVDFromMVSDIdxAffineSI(PredictionUnit& pu, RefPicList eRefList, const std::vector<Mv>& cMvdDerived, const std::vector<Mv>& cMvdDerived2, const std::vector<Mv>& cMvdDerived3, std::vector<Mv>& cMvd); #endif - int deriveMVSDIdxFromMVDAffine(PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdDerived, std::vector<Mv>& cMvdDerived2, std::vector<Mv>& cMvdDerived3); + int deriveMVSDIdxFromMVDAffine (PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdDerived, std::vector<Mv>& cMvdDerived2, std::vector<Mv>& cMvdDerived3); void deriveMVDFromMVSDIdxAffine(PredictionUnit& pu, RefPicList eRefList, std::vector<Mv>& cMvdDerived, std::vector<Mv>& cMvdDerived2, std::vector<Mv>& cMvdDerived3); #endif #if JVET_AC0104_IBC_BVD_PREDICTION @@ -1071,10 +1057,10 @@ public: Mv deriveMVDFromMVSDIdxTransIBC(int mvsdIdx, const std::vector<Mv>& cMvdDerived, const MvdSuffixInfo& si) const; #endif #if JVET_AD0140_MVD_PREDICTION - static int selectMvdCodingList(const PredictionUnit& pu, const int numCandL0 = -1); + static int selectMvdCodingList (const PredictionUnit& pu, const int numCandL0 = -1); #endif #if JVET_J0090_MEMORY_BANDWITH_MEASURE - void cacheAssign( CacheModel *cache ); + void cacheAssign ( CacheModel *cache ); #endif #if !AFFINE_RM_CONSTRAINTS_AND_OPT static bool isSubblockVectorSpreadOverLimit( int a, int b, int c, int d, int predType ); @@ -1095,46 +1081,42 @@ public: #endif #endif #if JVET_AC0185_ENHANCED_TEMPORAL_MOTION_DERIVATION - void getBlkAMLRefTemplateSubTMVP(PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft); - static bool xCheckIdenticalMotionSubTMVP(const PredictionUnit& pu); + void getBlkAMLRefTemplateSubTMVP (PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft); + static bool xCheckIdenticalMotionSubTMVP (const PredictionUnit& pu); void adjustMergeCandidatesInOneCandidateGroupSubTMVP(PredictionUnit &pu, MergeCtx& smvpMergeCandCtx, int numRetrievedMergeCand, int mrgCandIdx = -1); #endif #if JVET_W0090_ARMC_TM void adjustInterMergeCandidates(PredictionUnit &pu, MergeCtx& mrgCtx, int mrgCandIdx = -1); #endif #if JVET_W0090_ARMC_TM || JVET_Z0056_GPM_SPLIT_MODE_REORDERING || JVET_Z0061_TM_OBMC || JVET_AA0061_IBC_MBVD || JVET_Y0058_IBC_LIST_MODIFY - bool xAMLGetCurBlkTemplate(PredictionUnit& pu, int nCurBlkWidth, int nCurBlkHeight); - bool xAMLIsTopTempAvailable(PredictionUnit& pu); - bool xAMLIsLeftTempAvailable(PredictionUnit& pu); + bool xAMLGetCurBlkTemplate (PredictionUnit& pu, int nCurBlkWidth, int nCurBlkHeight); + bool xAMLIsTopTempAvailable (PredictionUnit& pu); + bool xAMLIsLeftTempAvailable (PredictionUnit& pu); #endif #if JVET_Z0061_TM_OBMC - void xOBMCWeightedAverageY(const PredictionUnit &pu, const CPelUnitBuf &pcYuvSrc0, const CPelUnitBuf &pcYuvSrc1, - PelUnitBuf &pcYuvDst, const BitDepths &clipBitDepths, const ClpRngs &clpRngs, - MotionInfo currMi); - int selectOBMCmode(PredictionUnit &curPu, PredictionUnit &neigPu, bool isAbove, int nLength, uint32_t minCUW, - Position curOffset); - void getBlkOBMCRefTemplate(PredictionUnit &subblockPu, PelUnitBuf &pcBufPredRef, bool isAbove, MotionInfo currMi); + void xOBMCWeightedAverageY (const PredictionUnit &pu, const CPelUnitBuf &pcYuvSrc0, const CPelUnitBuf &pcYuvSrc1, + PelUnitBuf &pcYuvDst, const BitDepths &clipBitDepths, const ClpRngs &clpRngs, MotionInfo currMi); + int selectOBMCmode (PredictionUnit &curPu, PredictionUnit &neigPu, bool isAbove, int nLength, uint32_t minCUW, Position curOffset); + void getBlkOBMCRefTemplate (PredictionUnit &subblockPu, PelUnitBuf &pcBufPredRef, bool isAbove, MotionInfo currMi); bool xCheckIdenticalMotionOBMC(PredictionUnit &pu, MotionInfo tryMi); - void xSubblockOBMCCopy(const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, - PelUnitBuf &pcYuvPredSrc, int iDir); - void xSubblockTMOBMC(const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, + void xSubblockOBMCCopy (const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, int iDir); + void xSubblockTMOBMC (const ComponentID eComp, PredictionUnit &pu, PelUnitBuf &pcYuvPredDst, PelUnitBuf &pcYuvPredSrc, #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED PelUnitBuf &pcYuvBefore, #endif int iDir, int iOBMCmode = 0); #endif #if JVET_W0090_ARMC_TM || JVET_AA0070_RRIBC - void updateCandList(uint32_t uiCand, Distortion uiCost, uint32_t uiMrgCandNum, uint32_t* rdCandList, Distortion* candCostList); + void updateCandList (uint32_t uiCand, Distortion uiCost, uint32_t uiMrgCandNum, uint32_t* rdCandList, Distortion* candCostList); #endif #if JVET_W0090_ARMC_TM - void updateCandInfo(MergeCtx& mrgCtx, uint32_t(*RdCandList)[MRG_MAX_NUM_CANDS], int mrgCandIdx = -1); + void updateCandInfo (MergeCtx& mrgCtx, uint32_t(*RdCandList)[MRG_MAX_NUM_CANDS], int mrgCandIdx = -1); #endif #if JVET_W0090_ARMC_TM || JVET_Z0056_GPM_SPLIT_MODE_REORDERING #if JVET_AA0093_ENHANCED_MMVD_EXTENSION - void getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft, - int8_t posList0 = -1, int8_t posList1 = -1, bool load0 = false, bool load1 = false); + void getBlkAMLRefTemplate (PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft, int8_t posList0 = -1, int8_t posList1 = -1, bool load0 = false, bool load1 = false); #else - void getBlkAMLRefTemplate(PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft); + void getBlkAMLRefTemplate (PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft); #endif #if JVET_AD0213_LIC_IMP void getBlkAMLRefTemplateAlt(PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft, int8_t posList0 = -1, int8_t posList1 = -1, bool load0 = false, bool load1 = false); @@ -1146,14 +1128,14 @@ public: bool getBlkAMLRefTemplateMvdPred (PredictionUnit& pu, PelUnitBuf& pcBufPredRefTop, PelUnitBuf& pcBufPredRefLeft); #endif #if JVET_W0090_ARMC_TM - void adjustAffineMergeCandidates(PredictionUnit &pu, AffineMergeCtx& affMrgCtx, int mrgCandIdx = -1 + void adjustAffineMergeCandidates (PredictionUnit &pu, AffineMergeCtx& affMrgCtx, int mrgCandIdx = -1 #if JVET_Z0139_NA_AFF , int sortedCandNum = -1 #endif ); #if JVET_AG0276_NLIC void adjustAffineMergeCandidates(PredictionUnit &pu, AffineMergeCtx& affMrgCtx, AltLMAffineMergeCtx& altLMAffMrgCtx, AltLMAffineMergeCtx& altLMRMVFMrgCtx); - void updateAffineCandInThreeGrp(PredictionUnit &pu, AffineMergeCtx& affMrgCtx, AffineMergeCtx& altLMAffMrgCtx, AffineMergeCtx& altLMAffMrgCtx1, uint32_t* rdCandList, uint32_t* rdCandGrpList, int listsize); + void updateAffineCandInThreeGrp (PredictionUnit &pu, AffineMergeCtx& affMrgCtx, AffineMergeCtx& altLMAffMrgCtx, AffineMergeCtx& altLMAffMrgCtx1, uint32_t* rdCandList, uint32_t* rdCandGrpList, int listsize); #endif void updateAffineCandInfo(PredictionUnit &pu, AffineMergeCtx& affMrgCtx, #if JVET_AA0107_RMVF_AFFINE_MERGE_DERIVATION @@ -1194,7 +1176,7 @@ public: , bool isBilinear, AffineMergeCtx affMrgCtx #endif ); - bool fillAMLRefTemplateCache(PredictionUnit& pu, int refList, const int candIdx, const Size& topSize, const Size& leftSize ); + bool fillAMLRefTemplateCache (PredictionUnit& pu, int refList, const int candIdx, const Size& topSize, const Size& leftSize ); #endif @@ -1214,14 +1196,14 @@ public: #endif #if JVET_AG0164_AFFINE_GPM - bool getAffAMLRefTemplateImp(PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft + bool getAffAMLRefTemplateImp (PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft #if JVET_AC0185_ENHANCED_TEMPORAL_MOTION_DERIVATION ,bool isBilinear, AffineMergeCtx affMrgCtx #endif ); #endif #if JVET_AH0119_SUBBLOCK_TM - void getAffAndSbtmvpRefTemplate(PredictionUnit& pu, PelUnitBuf& pcBufPredRefTop, PelUnitBuf& pcBufPredRefLeft,bool isBilinear, AffineMergeCtx affMrgCtx, int interpolationIdx = 2, bool isStore = false, Mv mvOffset = Mv(0, 0), int targetList = 0); + void getAffAndSbtmvpRefTemplate (PredictionUnit& pu, PelUnitBuf& pcBufPredRefTop, PelUnitBuf& pcBufPredRefLeft,bool isBilinear, AffineMergeCtx affMrgCtx, int interpolationIdx = 2, bool isStore = false, Mv mvOffset = Mv(0, 0), int targetList = 0); #endif #if JVET_AD0140_MVD_PREDICTION template <int iAbove1Left2All3 = 3> @@ -1232,17 +1214,17 @@ public: ); #endif #if JVET_AD0213_LIC_IMP - void getAffAMLRefTemplateAlt(PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft, + void getAffAMLRefTemplateAlt (PredictionUnit &pu, PelUnitBuf &pcBufPredRefTop, PelUnitBuf &pcBufPredRefLeft, #if JVET_AC0185_ENHANCED_TEMPORAL_MOTION_DERIVATION bool isBilinear, AffineMergeCtx affMrgCtx, #endif int8_t posList0 = -1, int8_t posList1 = -1, bool loadSave0 = false, bool loadSave1 = false); #endif #if JVET_Z0102_NO_ARMC_FOR_ZERO_CAND - void adjustMergeCandidates(PredictionUnit& pu, MergeCtx& smvpMergeCandCtx, int numRetrievedMergeCand); + void adjustMergeCandidates (PredictionUnit& pu, MergeCtx& smvpMergeCandCtx, int numRetrievedMergeCand); #endif #if JVET_AG0276_NLIC || JVET_AH0314_LIC_INHERITANCE_FOR_MRG - void adjustMergeCandidates(PredictionUnit& pu, MergeCtx& mvpMergeCandCtx + void adjustMergeCandidates (PredictionUnit& pu, MergeCtx& mvpMergeCandCtx #if JVET_AH0314_LIC_INHERITANCE_FOR_MRG , AltLMMergeCtx* pMrgCtxAlt , AltLMMergeCtx* pMrgCtxInherit @@ -1252,13 +1234,13 @@ public: , int numRetrievedMergeCand); #endif #if JVET_AB0079_TM_BCW_MRG - void adjustMergeCandidatesBcwIdx(PredictionUnit& pu, MergeCtx& mrgCtx, const int mergeIdx = -1); + void adjustMergeCandidatesBcwIdx (PredictionUnit& pu, MergeCtx& mrgCtx, const int mergeIdx = -1); #endif #if JVET_AF0128_LIC_MERGE_TM - void adjustMergeCandidatesLicFlag(PredictionUnit& pu, MergeCtx& mrgCtx, const int mergeIdx = -1); + void adjustMergeCandidatesLicFlag (PredictionUnit& pu, MergeCtx& mrgCtx, const int mergeIdx = -1); #endif #if JVET_AG0112_REGRESSION_BASED_GPM_BLENDING - Distortion deriveBcwBlending( PredictionUnit& pu, bool bUniDir[2] ); + Distortion deriveBcwBlending ( PredictionUnit& pu, bool bUniDir[2] ); Distortion deriveBcwBlendingBiDir( PredictionUnit& pu, MvField mvfld0[2], MvField mvfld1[2] #if JVET_AH0314_LIC_INHERITANCE_FOR_MRG , bool isLicA, bool isLicB @@ -1288,7 +1270,7 @@ public: #endif #if JVET_AA0093_REFINED_MOTION_FOR_ARMC void adjustMergeCandidatesInOneCandidateGroup(PredictionUnit &pu, MergeCtx& smvpMergeCandCtx, bool* applyBDMVR, Mv** mvBufBDMVR, Mv** mvBufBDMVRTmp, int numRetrievedMergeCand, bool subRefineList[][2] = NULL, bool subRefineListTmp[][2] = NULL, int mrgCandIdx = -1); - void updateCandInOneCandidateGroup(MergeCtx& mrgCtx, uint32_t* rdCandList, bool* applyBDMVR, Mv** mvBufBDMVR, Mv** mvBufBDMVRTmp, bool subRefineList[][2] = NULL, bool subRefineListTmp[][2] = NULL, int numCandInCategory = -1); + void updateCandInOneCandidateGroup (MergeCtx& mrgCtx, uint32_t* rdCandList, bool* applyBDMVR, Mv** mvBufBDMVR, Mv** mvBufBDMVRTmp, bool subRefineList[][2] = NULL, bool subRefineListTmp[][2] = NULL, int numCandInCategory = -1); #endif #if JVET_AA0107_RMVF_AFFINE_MERGE_DERIVATION void adjustAffineMergeCandidatesOneGroup(PredictionUnit &pu, AffineMergeCtx& affMrgCtx, int listsize @@ -1296,37 +1278,37 @@ public: , AffineMergeCtx& affOriMrgCtx #endif , int mrgCandIdx = -1); - void updateAffineCandInfo2(PredictionUnit &pu, AffineMergeCtx& affMrgCtx, uint32_t(*rdCandList)[RMVF_AFFINE_MRG_MAX_CAND_LIST_SIZE], int listsize, int mrgCandIdx = -1); + void updateAffineCandInfo2 (PredictionUnit &pu, AffineMergeCtx& affMrgCtx, uint32_t(*rdCandList)[RMVF_AFFINE_MRG_MAX_CAND_LIST_SIZE], int listsize, int mrgCandIdx = -1); #endif #if JVET_AJ0126_INTER_AMVP_ENHANCEMENT - void adjustAffineAMVPCandidates(PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AffineAMVPInfo &affiAMVPInfo, int extCond); + void adjustAffineAMVPCandidates (PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AffineAMVPInfo &affiAMVPInfo, int extCond); void tmRefineAffineAMVPCandidates(PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AffineAMVPInfo &affiAMVPInfo, int extCond); #endif #if JVET_Y0058_IBC_LIST_MODIFY - void adjustIBCMergeCandidates(PredictionUnit &pu, MergeCtx& mrgCtx, int mrgCandIdx = -1); - void updateIBCCandInfo(PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t(*RdCandList)[IBC_MRG_MAX_NUM_CANDS], int mrgCandIdx = -1); + void adjustIBCMergeCandidates (PredictionUnit &pu, MergeCtx& mrgCtx, int mrgCandIdx = -1); + void updateIBCCandInfo (PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t(*RdCandList)[IBC_MRG_MAX_NUM_CANDS], int mrgCandIdx = -1); #endif #if JVET_Z0075_IBC_HMVP_ENLARGE - void adjustIBCMergeCandidates(PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t startPos,uint32_t endPos); + void adjustIBCMergeCandidates (PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t startPos,uint32_t endPos); #endif #endif #if JVET_AC0060_IBC_BVP_CLUSTER_RRIBC_BVD_SIGN_DERIV - Distortion getTempCost(const PredictionUnit &pu, const PelBuf &org, const PelBuf &cur); + Distortion getTempCost (const PredictionUnit &pu, const PelBuf &org, const PelBuf &cur); #endif #if JVET_AC0112_IBC_GPM - void motionCompensationIbcGpm(CodingUnit &cu, MergeCtx &ibcGpmMrgCtx, IntraPrediction* pcIntraPred); + void motionCompensationIbcGpm (CodingUnit &cu, MergeCtx &ibcGpmMrgCtx, IntraPrediction* pcIntraPred); #if JVET_AA0070_RRIBC - void adjustIbcMergeRribcCand(PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t startPos, uint32_t endPos, bool *isSkipThisCand = NULL); + void adjustIbcMergeRribcCand (PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t startPos, uint32_t endPos, bool *isSkipThisCand = NULL); #endif #endif #if JVET_Z0075_IBC_HMVP_ENLARGE || JVET_AA0070_RRIBC - void updateIBCCandInfo(PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t* RdCandList, uint32_t startPos,uint32_t endPos); + void updateIBCCandInfo (PredictionUnit &pu, MergeCtx& mrgCtx, uint32_t* RdCandList, uint32_t startPos,uint32_t endPos); #endif #if JVET_Z0056_GPM_SPLIT_MODE_REORDERING template <uint8_t partIdx, bool useDefaultPelBuffer = true> - void fillPartGPMRefTemplate(PredictionUnit &pu, Pel* bufTop = nullptr, Pel* bufLeft = nullptr) + void fillPartGPMRefTemplate (PredictionUnit &pu, Pel* bufTop = nullptr, Pel* bufLeft = nullptr) { if (useDefaultPelBuffer) { @@ -1463,12 +1445,12 @@ public: #endif #endif #if JVET_AE0159_FIBC - void xGetIbcFilterRefBuf(PelBuf& piPred, CodingUnit* pcCU, const ComponentID compID, const Mv& mv, unsigned int uiBlkWidth, unsigned int uiBlkHeight ); - void xCalIbcFilterParam(PelBuf& piPred, CodingUnit* pcCU, const ComponentID compID, const Mv& mv, unsigned int uiBlkWidth, unsigned int uiBlkHeight ); + void xGetIbcFilterRefBuf (PelBuf& piPred, CodingUnit* pcCU, const ComponentID compID, const Mv& mv, unsigned int uiBlkWidth, unsigned int uiBlkHeight ); + void xCalIbcFilterParam (PelBuf& piPred, CodingUnit* pcCU, const ComponentID compID, const Mv& mv, unsigned int uiBlkWidth, unsigned int uiBlkHeight ); void xGenerateIbcFilterPred(PelBuf& piPred, unsigned int uiBlkWidth, unsigned int uiBlkHeight, const ComponentID compID, CodingUnit* pcCU); #endif #if JVET_AE0159_FIBC || JVET_AE0059_INTER_CCCM || JVET_AE0078_IBC_LIC_EXTENSION || JVET_AF0073_INTER_CCP_MERGE - void setIntraPrediction( IntraPrediction* intra ); + void setIntraPrediction ( IntraPrediction* intra ); #endif #if INTER_LIC #if JVET_AA0146_WRAP_AROUND_FIX @@ -1489,16 +1471,16 @@ public: #else void xGetSublkTemplateAndRef(const CodingUnit& cu, const ComponentID compID, const Picture& refPic, const Mv& mv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate, bool recSample, bool refSample); #endif - void xLicRemHighFreq(const CodingUnit& cu, int compID, int licIdx); - void setLicParam(int refList, int compID, int& licScale, int& licOffset) { licScale = m_scale[refList][compID]; licOffset = m_offset[refList][compID]; } - void resetFillLicTpl() { m_fillLicTpl[COMPONENT_Y] = m_fillLicTpl[COMPONENT_Cb] = m_fillLicTpl[COMPONENT_Cr] = false; } - void xLicCompAdj(const PredictionUnit& pu, PelUnitBuf& pcYuvPred, const bool lumaOnly, const bool chromaOnly); + void xLicRemHighFreq (const CodingUnit& cu, int compID, int licIdx); + void setLicParam (int refList, int compID, int& licScale, int& licOffset) { licScale = m_scale[refList][compID]; licOffset = m_offset[refList][compID]; } + void resetFillLicTpl () { m_fillLicTpl[COMPONENT_Y] = m_fillLicTpl[COMPONENT_Cb] = m_fillLicTpl[COMPONENT_Cr] = false; } + void xLicCompAdj (const PredictionUnit& pu, PelUnitBuf& pcYuvPred, const bool lumaOnly, const bool chromaOnly); #if JVET_AG0276_LIC_BDOF_BDMVR - void xLicCompAdjBdof(const PredictionUnit& pu, PelUnitBuf& pcYuvPred, const bool lumaOnly, const bool chromaOnly); + void xLicCompAdjBdof (const PredictionUnit& pu, PelUnitBuf& pcYuvPred, const bool lumaOnly, const bool chromaOnly); #endif #endif template <bool trueAfalseL> - void xGetPredBlkTpl(const CodingUnit& cu, const ComponentID compID, const CPelBuf& refBuf, const Mv& mv, const int posW, const int posH, const int tplSize, Pel* predBlkTpl + void xGetPredBlkTpl (const CodingUnit& cu, const ComponentID compID, const CPelBuf& refBuf, const Mv& mv, const int posW, const int posH, const int tplSize, Pel* predBlkTpl #if JVET_Y0067_ENHANCED_MMVD_MVD_SIGN_PRED , bool AML = false #endif @@ -1509,25 +1491,25 @@ public: ); #endif #if JVET_AG0276_LIC_SLOPE_ADJUST - void xUpdateLicModel (int &scale, int &offset, int &shift, int midVal, int delta); + void xUpdateLicModel (int &scale, int &offset, int &shift, int midVal, int delta); #endif #if JVET_AC0112_IBC_LIC - void xGetSublkTemplate (const CodingUnit& cu, const ComponentID compID, const Mv& bv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate); - void xLocalIlluComp (const PredictionUnit& pu, const ComponentID compID, const Mv& bv, PelBuf& dstBuf + void xGetSublkTemplate (const CodingUnit& cu, const ComponentID compID, const Mv& bv, const int sublkWidth, const int sublkHeight, const int posW, const int posH, int* numTemplate, Pel* refLeftTemplate, Pel* refAboveTemplate, Pel* recLeftTemplate, Pel* recAboveTemplate); + void xLocalIlluComp (const PredictionUnit& pu, const ComponentID compID, const Mv& bv, PelBuf& dstBuf #if JVET_AG0136_INTRA_TMP_LIC , const bool isLinearTransformDone #endif ); template <bool trueAfalseL> - void xGetIbcLicPredBlkTpl(const CodingUnit& cu, const ComponentID compID, const CPelBuf& refBuf, const Mv& mv, const int posW, const int posH, const int tplSize, Pel* predBlkTpl); + void xGetIbcLicPredBlkTpl (const CodingUnit& cu, const ComponentID compID, const CPelBuf& refBuf, const Mv& mv, const int posW, const int posH, const int tplSize, Pel* predBlkTpl); #endif #if TM_AMVP || TM_MRG || JVET_Z0084_IBC_TM #if JVET_AF0163_TM_SUBBLOCK_REFINEMENT - void deriveSubTmvpTMMv(PredictionUnit& pu); + void deriveSubTmvpTMMv (PredictionUnit& pu); void deriveSubTmvpTMMv2Pel(PredictionUnit& pu, int step); - Distortion deriveTMMv2Pel(const PredictionUnit& pu, int step, bool fillCurTpl, Distortion curBestCost, RefPicList eRefList, int refIdx, int maxSearchRounds, Mv& mv, const MvField* otherMvf = nullptr); + Distortion deriveTMMv2Pel (const PredictionUnit& pu, int step, bool fillCurTpl, Distortion curBestCost, RefPicList eRefList, int refIdx, int maxSearchRounds, Mv& mv, const MvField* otherMvf = nullptr); #endif #if TM_MRG || (JVET_Z0084_IBC_TM && IBC_TM_MRG) #if JVET_AA0093_REFINED_MOTION_FOR_ARMC @@ -1548,9 +1530,9 @@ public: #if JVET_AD0213_LIC_IMP #if JVET_AA0093_REFINED_MOTION_FOR_ARMC template <int tplSize> - void deriveTemplateLIC(TplMatchingCtrl& tplCtrl, RefPicList eRefList); + void deriveTemplateLIC (TplMatchingCtrl& tplCtrl, RefPicList eRefList); #else - void deriveTemplateLIC(TplMatchingCtrl& tplCtrl, RefPicList eRefList); + void deriveTemplateLIC (TplMatchingCtrl& tplCtrl, RefPicList eRefList); #endif #endif #endif // TM_AMVP || TM_MRG || JVET_Z0084_IBC_TM @@ -1559,8 +1541,8 @@ public: void writeTplAmvpBuffer (const AMVPInfo& src, const CodingUnit& cu, RefPicList eRefList, int refIdx); bool readTplAmvpBuffer ( AMVPInfo& dst, const CodingUnit& cu, RefPicList eRefList, int refIdx); #if JVET_AC0185_ENHANCED_TEMPORAL_MOTION_DERIVATION - void writeMergeBuffer(const MergeCtx& srcList0, const MergeCtx& srcList1, const CodingUnit& cu); - bool readMergeBuffer( MergeCtx& dstList0, MergeCtx& dstList1, const CodingUnit& cu); + void writeMergeBuffer (const MergeCtx& srcList0, const MergeCtx& srcList1, const CodingUnit& cu); + bool readMergeBuffer ( MergeCtx& dstList0, MergeCtx& dstList1, const CodingUnit& cu); void clearAmvpTmvpBuffer(); #endif #endif @@ -1572,17 +1554,17 @@ public: #if TM_AMVP || TM_MRG || JVET_Z0084_IBC_TM || MULTI_PASS_DMVR static Distortion getDecoderSideDerivedMvCost (const Mv& mvStart, const Mv& mvCur, int searchRangeInFullPel, int weight); #if MULTI_PASS_DMVR - void xBDMVRUpdateSquareSearchCostLog (Distortion* costLog, int bestDirect); + void xBDMVRUpdateSquareSearchCostLog (Distortion* costLog, int bestDirect); #endif #endif #if MULTI_PASS_DMVR private: - void xBDMVRFillBlkPredPelBuffer(const PredictionUnit& pu, const Picture& refPic, const Mv &_mv, PelUnitBuf &dstBuf, const ClpRng& clpRng); + void xBDMVRFillBlkPredPelBuffer (const PredictionUnit& pu, const Picture& refPic, const Mv &_mv, PelUnitBuf &dstBuf, const ClpRng& clpRng); #if JVET_AB0112_AFFINE_DMVR && !JVET_AC0144_AFFINE_DMVR_REGRESSION - void xBDMVRFillBlkPredPelBufferAffine(const PredictionUnit& pu, const Picture& refPic, const Mv(&_mv)[3], PelUnitBuf& dstUnitBuf, const ClpRng& clpRng); + void xBDMVRFillBlkPredPelBufferAffine (const PredictionUnit& pu, const Picture& refPic, const Mv(&_mv)[3], PelUnitBuf& dstUnitBuf, const ClpRng& clpRng); void xBDMVRFillBlkPredPelBufferAffineOPT(const PredictionUnit& pu, const Picture& refPic, const RefPicList eRefPicList, const Mv(&_mv)[3], const Mv mvCur, const Mv mvCenter, const bool doInterpolation, PelUnitBuf& dstUnitBuf, const ClpRng& clpRng, const bool profTh,const int blockWidth,const int blockHeight ,const int memBlockWidthExt,const int memBlockHeight,const int memHeight,const int memStride); - void xCalculteAffineParameters(const PredictionUnit& pu, const Picture& refPic, const Mv(&_mv)[3],int refList, bool& profTH, int& blockWidth, int& blockHeight, int& memBlockWidthExt, int& memBlockHeight, int& memHeight, int& memStride); + void xCalculteAffineParameters (const PredictionUnit& pu, const Picture& refPic, const Mv(&_mv)[3],int refList, bool& profTH, int& blockWidth, int& blockHeight, int& memBlockWidthExt, int& memBlockHeight, int& memHeight, int& memStride); #endif #if JVET_X0049_ADAPT_DMVR template <uint8_t dir> @@ -1605,7 +1587,7 @@ private: , int nDirect // only used for half-pel MVD ); #if JVET_AF0057 - bool isDMVRmvReliable(Pel* pelBuffer[2], const int stride, const Mv(&initialMv)[2], int horOffset, int verOffset, int xx, int yy, const int widthInSubPu, int theWidth, int theHeight); + bool isDMVRmvReliable (Pel* pelBuffer[2], const int stride, const Mv(&initialMv)[2], int horOffset, int verOffset, int xx, int yy, const int widthInSubPu, int theWidth, int theHeight); #endif #if JVET_X0049_BDMVR_SW_OPT template <bool adaptRange, bool useHadamard> @@ -1617,7 +1599,7 @@ private: const Distortion earlyTerminateTh, DistParam &cDistParam, Pel* pelBuffer[2], const int stride); template<bool hPel> - Distortion xBDMVRMvSquareSearch(Mv(&curBestMv)[2], Distortion curBestCost, PredictionUnit& pu, const Mv(&initialMv)[2], int32_t maxSearchRounds, int32_t searchStepShift, bool useMR, bool useHadmard); + Distortion xBDMVRMvSquareSearch (Mv(&curBestMv)[2], Distortion curBestCost, PredictionUnit& pu, const Mv(&initialMv)[2], int32_t maxSearchRounds, int32_t searchStepShift, bool useMR, bool useHadmard); #if JVET_AB0112_AFFINE_DMVR && !JVET_AC0144_AFFINE_DMVR_REGRESSION template<bool hPel> Distortion xBDMVRMvSquareSearchAffine(Mv(&curBestMv)[2], Distortion curBestCost, PredictionUnit& pu, const Mv(&initialMv)[2], int32_t maxSearchRounds, int32_t searchStepShift, bool useMR, bool useHadmard); @@ -1648,11 +1630,11 @@ public: #if JVET_AC0144_AFFINE_DMVR_REGRESSION #if JVET_AI0185_ADAPTIVE_COST_IN_MERGE_MODE - void bmAffineInit(const PredictionUnit& pu, int mergeIdx = -1); + void bmAffineInit (const PredictionUnit& pu, int mergeIdx = -1); #else - void bmAffineInit(const PredictionUnit &pu); + void bmAffineInit (const PredictionUnit &pu); #endif - void bmInitAffineSubBlocks(const Position puPos, const int width, const int height, const int dx, const int dy, + void bmInitAffineSubBlocks (const Position puPos, const int width, const int height, const int dx, const int dy, int mvScaleHor[2], int mvScaleVer[2], int deltaMvHorX[2], int deltaMvHorY[2], int deltaMvVerX[2], int deltaMvVerY[2]); #if JVET_AD0182_AFFINE_DMVR_PLUS_EXTENSIONS #if JVET_AI0185_ADAPTIVE_COST_IN_MERGE_MODE @@ -1660,16 +1642,16 @@ public: #else bool processBDMVR4AdaptiveAffine(PredictionUnit& pu, Mv(&mvAffiL0)[2][3], Mv(&mvAffiL1)[2][3], EAffineModel& affTypeL0, EAffineModel& affTypeL1); #endif - void xDeriveCPMV(PredictionUnit &pu, const Mv(&curShiftMv)[2][3], int deltaMvHorX, int deltaMvHorY, int deltaMvVerX, int deltaMvVerY, int baseCP, Mv(&cpMV)[2][3]); + void xDeriveCPMV (PredictionUnit &pu, const Mv(&curShiftMv)[2][3], int deltaMvHorX, int deltaMvHorY, int deltaMvVerX, int deltaMvVerY, int baseCP, Mv(&cpMV)[2][3]); Distortion xBDMVRMv6ParameterSearchAffine(Distortion curBestCost, PredictionUnit& pu); #if JVET_AI0185_ADAPTIVE_COST_IN_MERGE_MODE - void bmAdaptiveAffineIntSearch(const PredictionUnit& pu, Mv(&mvOffsetL0)[2], Distortion& minCostL0, Mv(&mvOffsetL1)[2], Distortion& minCostL1, int mergeIdx = -1); + void bmAdaptiveAffineIntSearch (const PredictionUnit& pu, Mv(&mvOffsetL0)[2], Distortion& minCostL0, Mv(&mvOffsetL1)[2], Distortion& minCostL1, int mergeIdx = -1); #else - void bmAdaptiveAffineIntSearch(const PredictionUnit &pu, Mv(&mvOffsetL0)[2], Distortion &minCostL0, Mv(&mvOffsetL1)[2], Distortion &minCostL1); + void bmAdaptiveAffineIntSearch (const PredictionUnit &pu, Mv(&mvOffsetL0)[2], Distortion &minCostL0, Mv(&mvOffsetL1)[2], Distortion &minCostL1); #endif - void bmAdaptiveAffineHPelSearch(const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion localCostArray[9], RefPicList refList); + void bmAdaptiveAffineHPelSearch (const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion localCostArray[9], RefPicList refList); Distortion xGetBilateralMatchingErrorAdaptiveAffine(const PredictionUnit& pu, Mv(&mvOffset)[2], RefPicList refList, bool skipOtherRef); - bool bmAdaptiveAffineRegression(PredictionUnit &pu, Distortion &minCost, RefPicList refList); + bool bmAdaptiveAffineRegression (PredictionUnit &pu, Distortion &minCost, RefPicList refList); Distortion xGetBilateralMatchingErrorAffine(const PredictionUnit& pu, Mv(&mvAffi)[2][3], bool skipInterpolation = false); template <bool checkMv> Distortion xGetBilateralMatchingErrorAffineCheckMv(const PredictionUnit& pu, Mv(&mvAffi)[2][3]); @@ -1677,17 +1659,17 @@ public: Distortion xGetBilateralMatchingErrorAffine(const PredictionUnit& pu, Mv(&mvAffi)[2][3]); #endif #if JVET_AI0185_ADAPTIVE_COST_IN_MERGE_MODE - void bmAffineIntSearch(const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion totalCost[(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1][(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1], int mergeIdx = -1); + void bmAffineIntSearch (const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion totalCost[(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1][(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1], int mergeIdx = -1); #else - void bmAffineIntSearch(const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion totalCost[(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1][(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1]); + void bmAffineIntSearch (const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion totalCost[(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1][(AFFINE_DMVR_INT_SRCH_RANGE << 1) + 1]); #endif - void bmAffineHPelSearch(const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion localCostArray[9]); + void bmAffineHPelSearch (const PredictionUnit &pu, Mv(&mvOffset)[2], Distortion &minCost, Distortion localCostArray[9]); void xInitBilateralMatching(const int width, const int height, const int bitDepth, const bool useMR, const bool useHadmard); Distortion xGetBilateralMatchingErrorAffine(const PredictionUnit& pu, Mv(&mvOffset)[2]); - bool bmAffineRegression(PredictionUnit &pu, Distortion &minCost); + bool bmAffineRegression (PredictionUnit &pu, Distortion &minCost); #if JVET_AJ0158_SUBBLOCK_INTER_EXTENSION - void bmAffineCpmvSearch(PredictionUnit &pu, Distortion &minCost); + void bmAffineCpmvSearch (PredictionUnit &pu, Distortion &minCost); #endif #endif public: @@ -1703,7 +1685,7 @@ public: bool processBDMVR (PredictionUnit& pu); #endif #if JVET_AB0112_AFFINE_DMVR - bool processBDMVR4Affine(PredictionUnit& pu + bool processBDMVR4Affine (PredictionUnit& pu #if JVET_AH0119_SUBBLOCK_TM , AffineMergeCtx &affineMergeCtx, bool doTM #endif @@ -1715,14 +1697,14 @@ public: #if JVET_AH0119_SUBBLOCK_TM #if JVET_AI0185_ADAPTIVE_COST_IN_MERGE_MODE bool processTM4SbTmvpBaseMV(PredictionUnit& pu, AffineMergeCtx& affineMergeCtx, int uiAffMergeCand, Distortion& uiCostOri, Distortion& uiCostBest, uint32_t targetList, int mergeIdx = -1); - bool processTM4SbTmvp(PredictionUnit& pu, AffineMergeCtx& affineMergeCtx, int uiAffMergeCand, bool isEncoder, int mergeIdx = -1); + bool processTM4SbTmvp (PredictionUnit& pu, AffineMergeCtx& affineMergeCtx, int uiAffMergeCand, bool isEncoder, int mergeIdx = -1); #else bool processTM4SbTmvpBaseMV(PredictionUnit& pu, AffineMergeCtx &affineMergeCtx, int uiAffMergeCand, Distortion& uiCostOri, Distortion& uiCostBest, uint32_t targetList); - bool processTM4SbTmvp(PredictionUnit& pu, AffineMergeCtx &affineMergeCtx, int uiAffMergeCand, bool isEncoder); + bool processTM4SbTmvp (PredictionUnit& pu, AffineMergeCtx &affineMergeCtx, int uiAffMergeCand, bool isEncoder); #endif #endif #if JVET_AF0163_TM_SUBBLOCK_REFINEMENT - bool processTM4Affine(PredictionUnit& pu, AffineMergeCtx &affineMergeCtx, int uiAffMergeCand, bool isEncoder + bool processTM4Affine (PredictionUnit& pu, AffineMergeCtx &affineMergeCtx, int uiAffMergeCand, bool isEncoder #if JVET_AH0119_SUBBLOCK_TM , bool isTmPara = true #endif @@ -1747,7 +1729,7 @@ public: , bool isInt4PosRefine = false #endif ); - void xUpdateCPMV(PredictionUnit &pu, int32_t targetRefList, const Mv(&curCPMV)[2][3], const int deltaMvHorX, const int deltaMvHorY, const int deltaMvVerX, const int deltaMvVerY, const int baseCP); + void xUpdateCPMV (PredictionUnit &pu, int32_t targetRefList, const Mv(&curCPMV)[2][3], const int deltaMvHorX, const int deltaMvHorY, const int deltaMvVerX, const int deltaMvVerY, const int baseCP); bool processTM4AffinePara(PredictionUnit& pu, AffineMergeCtx &affineMergeCtx, int uiAffMergeCand, int32_t targetRefList, Mv(&cpBestMVF)[2][3], Distortion& uiCostOri, Distortion& uiCostBest #if JVET_AI0185_ADAPTIVE_COST_IN_MERGE_MODE , int mergeIdx = -1 @@ -1769,29 +1751,29 @@ public: private: Mv* m_bdofSubPuMvBuf; public: - void setBdofSubPuMvBuf(Mv* bdofMvBuf) { m_bdofSubPuMvBuf = bdofMvBuf; } - Mv* getBdofSubPuMvBuf() { return m_bdofSubPuMvBuf; } - void setDoAffineSubPuBdof(bool doAffineSubPuBdof) { m_doAffineSubPuBdof = doAffineSubPuBdof; } - bool getDoAffineSubPuBdof() { return m_doAffineSubPuBdof; } + void setBdofSubPuMvBuf (Mv* bdofMvBuf) { m_bdofSubPuMvBuf = bdofMvBuf; } + Mv* getBdofSubPuMvBuf () { return m_bdofSubPuMvBuf; } + void setDoAffineSubPuBdof (bool doAffineSubPuBdof) { m_doAffineSubPuBdof = doAffineSubPuBdof; } + bool getDoAffineSubPuBdof () { return m_doAffineSubPuBdof; } #endif #if JVET_AJ0158_SUBBLOCK_INTER_EXTENSION - void setAffineBdofChroma(bool isAffineBdofChroma) { m_isAffBdofChroma = isAffineBdofChroma; } - bool getAffineBdofChroma() { return m_isAffBdofChroma; } - void setDeriveOobMask(bool isDeriveOobMask) { m_isDeriveOobMask = isDeriveOobMask; } - bool getDeriveOobMask() { return m_isDeriveOobMask; } + void setAffineBdofChroma (bool isAffineBdofChroma) { m_isAffBdofChroma = isAffineBdofChroma; } + bool getAffineBdofChroma () { return m_isAffBdofChroma; } + void setDeriveOobMask (bool isDeriveOobMask) { m_isDeriveOobMask = isDeriveOobMask; } + bool getDeriveOobMask () { return m_isDeriveOobMask; } #endif - void xFillIBCBuffer(CodingUnit &cu); + void xFillIBCBuffer (CodingUnit &cu); #if JVET_Z0118_GDR - void resetCurIBCBuffer(const ChromaFormat chromaFormatIDC, const Area ctuArea, const int ctuSize, const Pel dirtyPel); + void resetCurIBCBuffer (const ChromaFormat chromaFormatIDC, const Area ctuArea, const int ctuSize, const Pel dirtyPel); #endif - void resetIBCBuffer(const ChromaFormat chromaFormatIDC, const int ctuSize); - void resetVPDUforIBC(const ChromaFormat chromaFormatIDC, const int ctuSize, const int vSize, const int xPos, const int yPos); + void resetIBCBuffer (const ChromaFormat chromaFormatIDC, const int ctuSize); + void resetVPDUforIBC (const ChromaFormat chromaFormatIDC, const int ctuSize, const int vSize, const int xPos, const int yPos); - bool isLumaBvValid(const int ctuSize, const int xCb, const int yCb, const int width, const int height, const int xBv, const int yBv); + bool isLumaBvValid (const int ctuSize, const int xCb, const int yCb, const int width, const int height, const int xBv, const int yBv); - bool xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, const PPS& pps, const CompArea &blk, const Picture* refPic, const Mv& mv, Pel* dst, const int dstStride, const bool bi, const bool wrapRef, const ClpRng& clpRng, const int filterIndex, const bool useAltHpelIf = false); + bool xPredInterBlkRPR ( const std::pair<int, int>& scalingRatio, const PPS& pps, const CompArea &blk, const Picture* refPic, const Mv& mv, Pel* dst, const int dstStride, const bool bi, const bool wrapRef, const ClpRng& clpRng, const int filterIndex, const bool useAltHpelIf = false); #if JVET_Z0118_GDR - void xPadIBCBuffer(const CodingStructure &cs, const UnitArea& ctuArea); + void xPadIBCBuffer (const CodingStructure &cs, const UnitArea& ctuArea); #endif #if JVET_Z0054_BLK_REF_PIC_REORDER @@ -1799,8 +1781,8 @@ private: bool m_fillCurTplLeftARMC; bool m_fillCurTplAboveARMC; public: - void setFillCurTplAboveARMC(bool b) { m_fillCurTplAboveARMC = b; } - void setFillCurTplLeftARMC(bool b) { m_fillCurTplLeftARMC = b; } + void setFillCurTplAboveARMC (bool b) { m_fillCurTplAboveARMC = b; } + void setFillCurTplLeftARMC (bool b) { m_fillCurTplLeftARMC = b; } #endif #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED private: @@ -1808,179 +1790,53 @@ private: int m_modeBuf[2][MAX_CU_SIZE >> MIN_CU_LOG2]; int m_modeGetCheck[2]; public: - void setDIMDForOBMC(bool b) { m_dimdForOBMCFilled = b; } - void setModeGetCheck(int i, bool b) { m_modeGetCheck[i] = b; } - void setClearModeBuf(int i) { memset(m_modeBuf[i], -1, sizeof(int) * (MAX_CU_SIZE >> MIN_CU_LOG2)); } + void setDIMDForOBMC (bool b) { m_dimdForOBMCFilled = b; } + void setModeGetCheck (int i, bool b) { m_modeGetCheck[i] = b; } + void setClearModeBuf (int i) { memset(m_modeBuf[i], -1, sizeof(int) * (MAX_CU_SIZE >> MIN_CU_LOG2)); } #endif #if JVET_AG0276_NLIC public: - void xPredWoRefinement(PredictionUnit& pu, PelUnitBuf &pcYuvPred, const bool luma = true, const bool chroma = true); + void xPredWoRefinement (PredictionUnit& pu, PelUnitBuf &pcYuvPred, const bool luma = true, const bool chroma = true); #if JVET_AG0276_LIC_FLAG_SIGNALING template <bool isBRcand> #endif - void xDevSecLicPara(CodingUnit& cu, PelUnitBuf& predBuf, PelUnitBuf& dstBuf) - { - for (int comp = 0; comp < MAX_NUM_COMPONENT; comp++) - { - ComponentID compID = ComponentID(comp); - Pel* pred = predBuf.get(compID).buf; - int predStride = predBuf.get(compID).stride; - Pel* rec = dstBuf.get(compID).buf; - int recStride = dstBuf.get(compID).stride; - - const int cuWidth = cu.blocks[compID].width; - const int cuHeight = cu.blocks[compID].height; - - const int bitDepth = cu.cs->sps->getBitDepth(toChannelType(compID)); - const int precShift = std::max(0, bitDepth - 12); -#if JVET_AG0276_LIC_FLAG_SIGNALING - const int maxNumMinus1 = isBRcand ? (30 - 2 * std::min(bitDepth, 12) - 1) : (30 - 2 * std::min(bitDepth, 12)); -#else - const int maxNumMinus1 = 30 - 2 * std::min(bitDepth, 12); -#endif - const int minDimBit = floorLog2(std::min(cuHeight, cuWidth)); - const int minDim = 1 << minDimBit; - int minStepBit = minDim > 8 ? 1 : 0; -#if JVET_AG0276_LIC_FLAG_SIGNALING - while (isBRcand ? (minDimBit > minStepBit + maxNumMinus1) : (((minDimBit - minStepBit) << 1) > maxNumMinus1)) -#else - while (((minDimBit - minStepBit) << 1) > maxNumMinus1) -#endif - { minStepBit++; } //make sure 2*log2(minDim/tmpStep) + 2*min(bitDepth,12) <= 30 - const int numSteps = minDim >> minStepBit; - const int dimShift = minDimBit - minStepBit; - - //----- get correlation data ----- - int x = 0, y = 0, xx = 0, xy = 0; -#if JVET_AG0276_LIC_FLAG_SIGNALING - int cntShift = 0; - if (isBRcand) - { - Pel* refBottom = pred + (cuHeight - 1) * predStride; - Pel* recBottom = rec + (cuHeight - 1) * recStride; - for (int k = 0; k < numSteps; k++) - { - int idx = (k * cuWidth) >> dimShift; - int refVal = refBottom[idx]; - int recVal = recBottom[idx]; - x += refVal; - y += recVal; - xx += refVal * refVal; - xy += refVal * recVal; - } - cntShift = dimShift; - - Pel* refRight = pred + cuWidth - 1; - Pel* recRight = rec + cuWidth - 1; - for (int k = 0; k < numSteps; k++) - { - int idx = (k * cuHeight) >> dimShift; - int refVal = refRight[idx * predStride]; - int recVal = recRight[idx * recStride]; - x += refVal; - y += recVal; - xx += refVal * refVal; - xy += refVal * recVal; - } - cntShift += (cntShift ? 1 : dimShift); - } - else -#endif - { - for (int h = 0; h < numSteps; h++) - { - int vDim = ((h * cuHeight) >> dimShift); - - for (int w = 0; w < numSteps; w++) - { - int hDim = ((w * cuWidth) >> dimShift); - - int predVal = pred[vDim * predStride + hDim] >> precShift; - int recVal = rec[vDim * recStride + hDim] >> precShift; - - x += predVal; - y += recVal; - xx += predVal * predVal; - xy += predVal * recVal; - } - } - } - - int shift = m_LICShift; -#if JVET_AG0276_LIC_FLAG_SIGNALING - int& scale = isBRcand ? cu.altLMBRParaUnit.scale[compID] : cu.altLMParaUnit.scale[compID]; - int& offset = isBRcand ? cu.altLMBRParaUnit.offset[compID] : cu.altLMParaUnit.offset[compID]; - if (!isBRcand) - { - cntShift = (dimShift << 1); - CHECK(!cntShift, "cntShift == 0"); - } -#else - int& scale = cu.altLMParaUnit.scale[compID]; - int& offset = cu.altLMParaUnit.offset[compID]; - int cntShift = (dimShift << 1); CHECK(!cntShift, "cntShift == 0"); -#endif - const int cropShift = std::max(0, bitDepth - precShift + cntShift - 15); - const int xzOffset = (xx >> m_LICRegShift); - const int sumX = (x << precShift); - const int sumY = (y << precShift); - const int sumXX = ((xx + xzOffset) >> (cropShift << 1)) << cntShift; - const int sumXY = ((xy + xzOffset) >> (cropShift << 1)) << cntShift; - const int sumXsumX = (x >> cropShift) * (x >> cropShift); - const int sumXsumY = (x >> cropShift) * (y >> cropShift); - int a1 = sumXY - sumXsumY; - int a2 = sumXX - sumXsumX; - int scaleShiftA2 = getMSB(abs(a2)) - 6; - int scaleShiftA1 = scaleShiftA2 - m_LICShiftDiff; - scaleShiftA2 = std::max(0, scaleShiftA2); - scaleShiftA1 = std::max(0, scaleShiftA1); - const int scaleShiftA = scaleShiftA2 + 15 - shift - scaleShiftA1; - a1 = a1 >> scaleShiftA1; - a2 = Clip3(0, 63, a2 >> scaleShiftA2); - scale = int((int64_t(a1) * int64_t(m_LICMultApprox[a2])) >> scaleShiftA); - scale = Clip3(0, 1 << (shift + 2), scale); - const int maxOffset = (1 << (bitDepth - 1)) - 1; - const int minOffset = -1 - maxOffset; - offset = (sumY - ((scale * sumX) >> shift) + ((1 << (cntShift)) >> 1)) >> cntShift; - offset = Clip3(minOffset, maxOffset, offset); - } - } + void xDevSecLicPara (CodingUnit& cu, PelUnitBuf& predBuf, PelUnitBuf& dstBuf); #endif #if JVET_AA0096_MC_BOUNDARY_PADDING - void mcFramePad(Picture *pcCurPic, Slice &slice); + void mcFramePad (Picture *pcCurPic, Slice &slice); #if JVET_Z0118_GDR - void mcFramePadOneSide(Picture *pcCurPic, Slice &slice, PadDirection padDir, PelStorage *pPadBuffYUV, - PredictionUnit *blkDataTmp, PelStorage *pPadYUVContainerDyn, const UnitArea blkUnitAreaBuff, - PelStorage *pCurBuffYUV, PictureType pt); - void mcFramePadRepExt(Picture *pcCurPic, Slice &slice, PictureType pt); + void mcFramePadOneSide (Picture *pcCurPic, Slice &slice, PadDirection padDir, PelStorage *pPadBuffYUV, + PredictionUnit *blkDataTmp, PelStorage *pPadYUVContainerDyn, const UnitArea blkUnitAreaBuff, + PelStorage *pCurBuffYUV, PictureType pt); + void mcFramePadRepExt (Picture *pcCurPic, Slice &slice, PictureType pt); #else - void mcFramePadOneSide(Picture *pcCurPic, Slice &slice, PadDirection padDir, PelStorage *pPadBuffYUV, - PredictionUnit *blkDataTmp, PelStorage *pPadYUVContainerDyn, const UnitArea blkUnitAreaBuff, - PelStorage *pCurBuffYUV); - void mcFramePadRepExt(Picture *pcCurPic, Slice &slice); + void mcFramePadOneSide (Picture *pcCurPic, Slice &slice, PadDirection padDir, PelStorage *pPadBuffYUV, + PredictionUnit *blkDataTmp, PelStorage *pPadYUVContainerDyn, const UnitArea blkUnitAreaBuff, + PelStorage *pCurBuffYUV); + void mcFramePadRepExt (Picture *pcCurPic, Slice &slice); #endif #endif #if JVET_Z0118_GDR && JVET_AD0123_REF_PICTURE_PADDING_FOR_GDR - void padDirtyArea(Picture* pcCurPic, Slice& slice, PictureType pt); + void padDirtyArea (Picture* pcCurPic, Slice& slice, PictureType pt); #endif #if JVET_AE0059_INTER_CCCM inline void getNonDownSampledLumaValsOffset( const PredictionUnit* pu, const PelBuf& luma, const int x, const int y, Pel* s, const int offset, const int flipType = 0 ); - inline void getNonDownSampledLumaVals( const PredictionUnit* pu, const PelBuf& luma, const int x, const int y, Pel* s, const int flipType = 0 ); - inline int computeOffset( const PelBuf& buf ); + inline void getNonDownSampledLumaVals ( const PredictionUnit* pu, const PelBuf& luma, const int x, const int y, Pel* s, const int flipType = 0 ); + inline int computeOffset ( const PelBuf& buf ); #if JVET_AF0073_INTER_CCP_MERGE - bool deriveInterCccmPrediction( TransformUnit* tu, const PelBuf& lumaPrediction, const PelBuf& lumaReconstruction, const PelBuf& inBufCb, const PelBuf& inBufCr, PelBuf& outBufCb, PelBuf& outBufCr ); + bool deriveInterCccmPrediction ( TransformUnit* tu, const PelBuf& lumaPrediction, const PelBuf& lumaReconstruction, const PelBuf& inBufCb, const PelBuf& inBufCr, PelBuf& outBufCb, PelBuf& outBufCr ); #else - bool deriveInterCccmPrediction( const TransformUnit* tu, const PelBuf& lumaPrediction, const PelBuf& lumaReconstruction, const PelBuf& inBufCb, const PelBuf& inBufCr, PelBuf& outBufCb, PelBuf& outBufCr ); + bool deriveInterCccmPrediction ( const TransformUnit* tu, const PelBuf& lumaPrediction, const PelBuf& lumaReconstruction, const PelBuf& inBufCb, const PelBuf& inBufCr, PelBuf& outBufCb, PelBuf& outBufCr ); #endif #endif #if JVET_AF0073_INTER_CCP_MERGE - bool deriveInterCcpMergePrediction( TransformUnit* tu, const PelBuf& lumaReconstruction, PelBuf& inBufCb, PelBuf& inBufCr, PelBuf& outBufCb, PelBuf& outBufCr, CCPModelCandidate interCcpMergeList[], int validNum); + bool deriveInterCcpMergePrediction ( TransformUnit* tu, const PelBuf& lumaReconstruction, PelBuf& inBufCb, PelBuf& inBufCr, PelBuf& outBufCb, PelBuf& outBufCr, CCPModelCandidate interCcpMergeList[], int validNum); #endif #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED - void subBlockIntraForOBMC(PredictionUnit &subPu, const int iSub, const bool isAbove, PelUnitBuf &cTmp, IntraPrediction *pcIntraPred); + void subBlockIntraForOBMC (PredictionUnit &subPu, const int iSub, const bool isAbove, PelUnitBuf &cTmp, IntraPrediction *pcIntraPred); #endif }; @@ -2097,14 +1953,14 @@ public: template <int tplSize> void removeHighFreqLIC(const Picture& otherRefPic, const Mv& otherRefMv, const uint8_t curRefBcwWeight, int shift, int scale, int offset); #endif private: - template <int tplSize, bool trueAfalseL> bool xFillCurTemplate (Pel* tpl); - template <int tplSize, bool trueAfalseL, int sr> PelBuf xGetRefTemplate (const PredictionUnit& curPu, const Picture& refPic, const Mv& _mv, PelBuf& dstBuf); + template <int tplSize, bool trueAfalseL> bool xFillCurTemplate (Pel* tpl); + template <int tplSize, bool trueAfalseL, int sr> PelBuf xGetRefTemplate (const PredictionUnit& curPu, const Picture& refPic, const Mv& _mv, PelBuf& dstBuf); #if JVET_AC0104_IBC_BVD_PREDICTION template <int tplSize, bool trueAfalseL> bool xGetCurTemplateAvailable(); - template <int tplSize, bool trueAfalseL> PelBuf xGetCurTemplateBvd(const PredictionUnit& curPu, const Picture& refPic, PelBuf& dstBuf); - template <int tplSize, bool trueAfalseL> PelBuf xGetRefTemplateBvd (const PredictionUnit& curPu, const Picture& refPic, const Mv& _mv, PelBuf& dstBuf); + template <int tplSize, bool trueAfalseL> PelBuf xGetCurTemplateBvd (const PredictionUnit& curPu, const Picture& refPic, PelBuf& dstBuf); + template <int tplSize, bool trueAfalseL> PelBuf xGetRefTemplateBvd (const PredictionUnit& curPu, const Picture& refPic, const Mv& _mv, PelBuf& dstBuf); #endif - template <int tplSize, bool trueAfalseL> void xRemoveHighFreq (const Picture& otherRefPic, const Mv& otherRefMv, const uint8_t curRefBcwWeight); + template <int tplSize, bool trueAfalseL> void xRemoveHighFreq (const Picture& otherRefPic, const Mv& otherRefMv, const uint8_t curRefBcwWeight); #if JVET_AD0213_LIC_IMP template <int tplSize, bool trueAfalseL> void xRemoveHighFreqLIC (const Picture& otherRefPic, const Mv& otherRefMv, const uint8_t curRefBcwWeight, int shift, int scale, int offet); #endif @@ -2118,12 +1974,12 @@ private: #if JVET_Y0067_ENHANCED_MMVD_MVD_SIGN_PRED || JVET_AC0104_IBC_BVD_PREDICTION public: #endif - template <int tplSize> Distortion xGetTempMatchError (const Mv& mv); + template <int tplSize> Distortion xGetTempMatchError (const Mv& mv); #if JVET_AC0104_IBC_BVD_PREDICTION - template <int tplSize> Distortion xGetTempMatchErrorBvd(const Mv& mv); + template <int tplSize> Distortion xGetTempMatchErrorBvd (const Mv& mv); template <int tplSize, bool trueAfalseL, bool useForBvd=false> - Distortion xGetTempMatchError (const Mv& mv); - bool& getCurTopRefAvailFlag() { return m_useTop; } + Distortion xGetTempMatchError (const Mv& mv); + bool& getCurTopRefAvailFlag () { return m_useTop; } bool& getCurLeftRefAvailFlag() { return m_useLeft; } #else template <int tplSize, bool trueAfalseL> Distortion xGetTempMatchError(const Mv& mv); @@ -2136,5 +1992,6 @@ public: }; #endif // TM_AMVP || TM_MRG //! \} +//! #endif // __INTERPREDICTION__ diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp index 7a2416aab..cb3dc4c48 100644 --- a/source/Lib/CommonLib/IntraPrediction.cpp +++ b/source/Lib/CommonLib/IntraPrediction.cpp @@ -493,8 +493,8 @@ void IntraPrediction::init(ChromaFormat chromaFormatIDC, const unsigned bitDepth } #endif - memset(tempRefAbove, 0, ((MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX) * sizeof(Pel)); - memset(tempRefLeft, 0, ((MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX) * sizeof(Pel)); + memset(m_tempRefAbove, 0, ((MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX) * sizeof(Pel)); + memset(m_tempRefLeft, 0, ((MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX) * sizeof(Pel)); #if JVET_AD0120_LBCCP || JVET_AG0154_DECODER_DERIVED_CCP_FUSION if (m_pCCFilterTemp == nullptr) @@ -8514,8 +8514,8 @@ void IntraPrediction::xPredTimdIntraAng( const CPelBuf &pSrc, const ClpRng& clpR Pel* refMain; Pel* refSide; #if JVET_AC0094_REF_SAMPLES_OPT - Pel * refAbove = tempRefAbove; - Pel * refLeft = tempRefLeft; + Pel * refAbove = m_tempRefAbove; + Pel * refLeft = m_tempRefLeft; #else static Pel refAbove[2 * MAX_CU_SIZE + 5 + 33 * MAX_REF_LINE_IDX]; static Pel refLeft[2 * MAX_CU_SIZE + 5 + 33 * MAX_REF_LINE_IDX]; @@ -31388,8 +31388,8 @@ void IntraPrediction::xPredTmrlIntraAng(const CPelBuf& pSrc, const ClpRng& clpRn Pel* refSide; #if JVET_AC0094_REF_SAMPLES_OPT - Pel * refAbove = tempRefAbove; - Pel * refLeft = tempRefLeft; + Pel * refAbove = m_tempRefAbove; + Pel * refLeft = m_tempRefLeft; #else Pel refAbove[2 * MAX_CU_SIZE + 3 + 33 * MAX_REF_LINE_IDX]; Pel refLeft[2 * MAX_CU_SIZE + 3 + 33 * MAX_REF_LINE_IDX]; diff --git a/source/Lib/CommonLib/IntraPrediction.h b/source/Lib/CommonLib/IntraPrediction.h index 8c5f4153f..da9ded88c 100644 --- a/source/Lib/CommonLib/IntraPrediction.h +++ b/source/Lib/CommonLib/IntraPrediction.h @@ -84,8 +84,8 @@ public: #if JVET_AI0129_INTRA_TMP_OVERLAPPING_REFINEMENT Mv m_windTL; // TL offset of refine window Mv m_windBR; // BR offset of refine window - bool m_isTransferredLeft; - bool m_isTransferredTop; + bool m_isTransferredLeft; + bool m_isTransferredTop; #endif #if JVET_AD0086_ENHANCED_INTRA_TMP int m_rId; @@ -284,12 +284,12 @@ private: #if JVET_AJ0061_TIMD_MERGE struct TimdMergeInfo { - int timdMode[TIMD_FUSION_NUM]; - int timdFusionWeight[TIMD_FUSION_NUM]; - bool timdModeCheckWA[TIMD_FUSION_NUM]; + int timdMode[TIMD_FUSION_NUM]; + int timdFusionWeight[TIMD_FUSION_NUM]; + bool timdModeCheckWA[TIMD_FUSION_NUM]; int8_t timdLocDep[TIMD_FUSION_NUM]; - bool timdIsBlended; - int timdmTrType[2]; + bool timdIsBlended; + int timdmTrType[2]; }; #endif @@ -300,10 +300,10 @@ public: bool m_encPreRDRun; #endif #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED - int m_intraOBMCNeighState; + int m_intraOBMCNeighState; bool m_refSampleForOBMC; - Pel m_refSampleForOBMCBuf[MAX_INTRA_SIZE + 3]; - Pel m_refSampleForOBMCBufFiltered[MAX_INTRA_SIZE + 3]; + Pel m_refSampleForOBMCBuf[MAX_INTRA_SIZE + 3]; + Pel m_refSampleForOBMCBufFiltered[MAX_INTRA_SIZE + 3]; #endif #if JVET_AC0147_CCCM_NO_SUBSAMPLING @@ -335,8 +335,8 @@ public: #if JVET_AH0209_PDP Pel* m_pdpIntraPredBufIP[NUM_LUMA_MODE]; bool m_pdpIntraPredReady[NUM_LUMA_MODE]; - Pel m_ref[256] = {0}; - Pel m_refShort[256] = {0}; + Pel m_ref[256] = {0}; + Pel m_refShort[256] = {0}; bool m_refAvailable; #endif @@ -345,16 +345,16 @@ protected: std::vector <int16_t> m_blendBuf; #endif #if JVET_AC0094_REF_SAMPLES_OPT - Pel m_refBuffer[MAX_NUM_COMPONENT][NUM_PRED_BUF][((MAX_CU_SIZE << 3) + 1 + MAX_REF_LINE_IDX) * 2]; + Pel m_refBuffer[MAX_NUM_COMPONENT][NUM_PRED_BUF][((MAX_CU_SIZE << 3) + 1 + MAX_REF_LINE_IDX) * 2]; #else - Pel m_refBuffer[MAX_NUM_COMPONENT][NUM_PRED_BUF][(MAX_CU_SIZE * 2 + 1 + MAX_REF_LINE_IDX) * 2]; + Pel m_refBuffer[MAX_NUM_COMPONENT][NUM_PRED_BUF][(MAX_CU_SIZE * 2 + 1 + MAX_REF_LINE_IDX) * 2]; #endif - uint32_t m_refBufferStride[MAX_NUM_COMPONENT]; + uint32_t m_refBufferStride[MAX_NUM_COMPONENT]; #if JVET_AB0155_SGPM InterpolationFilter m_if; #endif #if JVET_AB0157_INTRA_FUSION - Pel m_refBuffer2nd[MAX_NUM_COMPONENT][(MAX_CU_SIZE * 2 + 1 + MAX_REF_LINE_IDX) * 2]; + Pel m_refBuffer2nd[MAX_NUM_COMPONENT][(MAX_CU_SIZE * 2 + 1 + MAX_REF_LINE_IDX) * 2]; #endif #if JVET_AG0058_EIP Pel m_eipBuffer[(MAX_EIP_SIZE * 2 + MAX_EIP_REF_SIZE) * (MAX_EIP_SIZE * 2 + MAX_EIP_REF_SIZE)]; @@ -506,31 +506,31 @@ private: std::array<std::array<std::array<int, 7>, MTMP_NUM>, 4> m_memLicParams; #endif #if JVET_AJ0249_NEURAL_NETWORK_BASED - IntraPredictionNN m_intraPredNN; + IntraPredictionNN m_intraPredNN; #endif protected: - ChromaFormat m_currChromaFormat; + ChromaFormat m_currChromaFormat; #if JVET_AJ0249_NEURAL_NETWORK_BASED - int8_t m_evalIdx; + int8_t m_evalIdx; #endif - int m_topRefLength; - int m_leftRefLength; - ScanElement* m_scanOrder; - bool m_bestScanRotationMode; + int m_topRefLength; + int m_leftRefLength; + ScanElement* m_scanOrder; + bool m_bestScanRotationMode; std::vector<PelStorage> m_tempBuffer; #if JVET_AB0155_SGPM std::vector<PelStorage> m_sgpmBuffer; #endif // used in timd tmrl sortedMPM std::vector<PelStorage> m_intraPredBuffer; - Pel tempRefAbove[(MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX]; - Pel tempRefLeft[(MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX]; + Pel m_tempRefAbove[(MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX]; + Pel m_tempRefLeft [(MAX_CU_SIZE << 3) + 5 + 33 * MAX_REF_LINE_IDX]; #if JVET_AH0209_PDP - bool (*m_xPredIntraOpt)(PelBuf &pDst, const PredictionUnit &pu, const uint32_t modeIdx, const ClpRng& clpRng, Pel* refF, Pel* refS); + bool (*m_xPredIntraOpt) (PelBuf &pDst, const PredictionUnit &pu, const uint32_t modeIdx, const ClpRng& clpRng, Pel* refF, Pel* refS); static bool xPredIntraOpt(PelBuf &pDst, const PredictionUnit &pu, const uint32_t modeIdx, const ClpRng& clpRng, Pel* refF, Pel* refS); #endif #if JVET_V0130_INTRA_TMP @@ -540,7 +540,7 @@ protected: static_vector<uint64_t, MTMP_NUM> m_mtmpCostList; #if JVET_AH0200_INTRA_TMP_BV_REORDER static_vector<TempLibFracFast, TMP_BV_REORDER_MAX> m_mtmpFracCandList[MTMP_NUM]; - static_vector<uint64_t, TMP_BV_REORDER_MAX> m_mtmpFracCostList[MTMP_NUM]; + static_vector<uint64_t, TMP_BV_REORDER_MAX> m_mtmpFracCostList[MTMP_NUM]; int m_log2SizeTop; int m_log2SizeLeft; int m_sizeTopLeft; @@ -559,7 +559,7 @@ protected: unsigned int m_uiPicStride; unsigned int m_uiVaildCandiNum; #if JVET_AI0129_INTRA_TMP_OVERLAPPING_REFINEMENT - Pel* m_pppTarPatch; + Pel* m_pppTarPatch; #else Pel*** m_pppTarPatch; #endif @@ -620,15 +620,15 @@ protected: #endif #if !(JVET_AC0112_IBC_CIIP || JVET_AC0112_IBC_GPM) #if JVET_AB0155_SGPM - void initPredIntraParams(const PredictionUnit &pu, const CompArea compArea, const SPS &sps, const int partIdx = 0); + void initPredIntraParams (const PredictionUnit &pu, const CompArea compArea, const SPS &sps, const int partIdx = 0); #else void initPredIntraParams ( const PredictionUnit & pu, const CompArea compArea, const SPS& sps ); #endif #endif - static bool isIntegerSlope(const int absAng) { return (0 == (absAng & 0x1F)); } + static bool isIntegerSlope (const int absAng) { return (0 == (absAng & 0x1F)); } #if JVET_W0123_TIMD_FUSION - static bool isIntegerSlopeExt(const int absAng) { return (0 == (absAng & 0x3F)); } + static bool isIntegerSlopeExt (const int absAng) { return (0 == (absAng & 0x3F)); } #endif void xPredIntraBDPCM ( const CPelBuf &pSrc, PelBuf &pDst, const uint32_t dirMode, const ClpRng& clpRng ); @@ -638,48 +638,46 @@ protected: #endif #if JVET_AJ0249_NEURAL_NETWORK_BASED - void xPredIntraPnn(const CPelBuf& recoBuf, PelBuf& pDst, const CPelBuf& srcBuf, CodingUnit& cu, const ComponentID compID); - void xFillReferenceSamples ( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu, const bool forceDeac0 = false, const bool forceDeac1 = false ); + void xPredIntraPnn (const CPelBuf& recoBuf, PelBuf& pDst, const CPelBuf& srcBuf, CodingUnit& cu, const ComponentID compID); + void xFillReferenceSamples ( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu, const bool forceDeac0 = false, const bool forceDeac1 = false ); #else - void xFillReferenceSamples ( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu ); + void xFillReferenceSamples ( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu ); #endif #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED - void xFillReferenceSamplesOBMC( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu ); + void xFillReferenceSamplesOBMC ( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu ); #endif #if JVET_AH0136_CHROMA_REORDERING void xFillReferenceSamplesForCoLuma(const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu); #endif #if JVET_AH0209_PDP - void xFillReferenceSamples2(const CPelBuf &recoBuf, const CompArea &area, const CodingUnit &cu); + void xFillReferenceSamples2 (const CPelBuf &recoBuf, const CompArea &area, const CodingUnit &cu); #endif - void xFilterReferenceSamples(const Pel *refBufUnfiltered, Pel *refBufFiltered, const CompArea &area, const SPS &sps, - int multiRefIdx - ); + void xFilterReferenceSamples (const Pel *refBufUnfiltered, Pel *refBufFiltered, const CompArea &area, const SPS &sps, int multiRefIdx ); - static int getModifiedWideAngle ( int width, int height, int predMode ); + static int getModifiedWideAngle ( int width, int height, int predMode ); #if JVET_W0123_TIMD_FUSION #if JVET_AB0155_SGPM - static int getWideAngleExt(int width, int height, int predMode, bool bSgpm = false); + static int getWideAngleExt (int width, int height, int predMode, bool bSgpm = false); #else - static int getWideAngleExt ( int width, int height, int predMode ); + static int getWideAngleExt ( int width, int height, int predMode ); #endif #if JVET_AC0094_REF_SAMPLES_OPT - static int getTimdWideAngleExt(int width, int height, int predMode); + static int getTimdWideAngleExt (int width, int height, int predMode); static int getTimdRegularAngleExt(int width, int height, int predMode); #endif #endif #if JVET_AC0094_REF_SAMPLES_OPT - static int getTimdWideAngle(int width, int height, int predMode); + static int getTimdWideAngle (int width, int height, int predMode); #endif - void setReferenceArrayLengths ( const CompArea &area ); + void setReferenceArrayLengths ( const CompArea &area ); - void destroy (); + void destroy (); #if LMS_LINEAR_MODEL - void xPadMdlmTemplateSample (Pel*pSrc, Pel*pCur, int cWidth, int cHeight, int existSampNum, int targetSampNum); - void xGetLMParametersLMS (const PredictionUnit &pu, const ComponentID compID, const CompArea& chromaArea, CclmModel &cclmModel); + void xPadMdlmTemplateSample (Pel*pSrc, Pel*pCur, int cWidth, int cHeight, int existSampNum, int targetSampNum); + void xGetLMParametersLMS (const PredictionUnit &pu, const ComponentID compID, const CompArea& chromaArea, CclmModel &cclmModel); #else - void xGetLMParameters (const PredictionUnit &pu, const ComponentID compID, const CompArea& chromaArea, CclmModel &cclmModel); + void xGetLMParameters (const PredictionUnit &pu, const ComponentID compID, const CompArea& chromaArea, CclmModel &cclmModel); #endif #if JVET_AE0078_IBC_LIC_EXTENSION public: @@ -698,23 +696,23 @@ public: int shift; }; #if JVET_AJ0237_INTERNAL_12BIT - int xCalcLMParametersGeneralized(int64_t x, int64_t y, int64_t xx, int64_t xy, int count, int bitDepth, int& a, int& b, int& iShift); + int xCalcLMParametersGeneralized (int64_t x, int64_t y, int64_t xx, int64_t xy, int count, int bitDepth, int& a, int& b, int& iShift); #else - int xCalcLMParametersGeneralized(int x, int y, int xx, int xy, int count, int bitDepth, int &a, int &b, int &iShift); + int xCalcLMParametersGeneralized (int x, int y, int xx, int xy, int count, int bitDepth, int &a, int &b, int &iShift); #endif - int xLMSampleClassifiedTraining (int count, int mean, int meanC, int lumaSamples[], int chrmSamples[], int bitDepth, MMLMParameters parameters[]); + int xLMSampleClassifiedTraining (int count, int mean, int meanC, int lumaSamples[], int chrmSamples[], int bitDepth, MMLMParameters parameters[]); #if JVET_AG0136_INTRA_TMP_LIC std::array<int, 7>& getMemLicParams(const int licIdc, const int idx) { return m_memLicParams[licIdc][idx]; } #endif #endif #if JVET_AJ0249_NEURAL_NETWORK_BASED - void setEvalIdx(const int8_t evalIdx) { m_evalIdx = evalIdx; } + void setEvalIdx (const int8_t evalIdx) { m_evalIdx = evalIdx; } #endif #if JVET_AE0078_IBC_LIC_EXTENSION protected: #endif #if JVET_Z0050_CCLM_SLOPE - void xUpdateCclmModel (int &a, int &b, int &iShift, int midLuma, int delta); + void xUpdateCclmModel (int &a, int &b, int &iShift, int midLuma, int delta); #endif public: @@ -733,13 +731,13 @@ public: static_vector<std::pair<uint64_t,int>, NUM_LUMA_MODE> m_timdModeCostList; #endif #if JVET_AA0057_CCCM || JVET_AC0119_LM_CHROMA_FUSION || JVET_AG0154_DECODER_DERIVED_CCP_FUSION - Pel xCccmGetLumaVal(const PredictionUnit& pu, const CPelBuf pi, const int x, const int y + Pel xCccmGetLumaVal (const PredictionUnit& pu, const CPelBuf pi, const int x, const int y #if JVET_AD0202_CCCM_MDF , int downsFilterIdx = 0 #endif ) const; #if JVET_AB0174_CCCM_DIV_FREE - void xCccmSetLumaRefValue(const PredictionUnit& pu); + void xCccmSetLumaRefValue (const PredictionUnit& pu); #endif #endif #if JVET_AA0057_CCCM || JVET_AG0154_DECODER_DERIVED_CCP_FUSION @@ -809,10 +807,10 @@ public: , int downsFilterIdx = 0 #endif ); - int xBvgCccmCalcBlkAver (const PredictionUnit& pu) const; - void xBvgCccmCalcBlkRange (const PredictionUnit& pu, int& minVal, int&maxVal) const; - void xBvgCccmCalcModels ( const PredictionUnit& pu, CccmModel& cccmModelCb, CccmModel& cccmModelCr, int modelId, int modelThr, int minVal, int maxVal ); - void xBvgCccmApplyModel ( const PredictionUnit& pu, const ComponentID compId, CccmModel& cccmModel, int modelId, int modelThr, PelBuf &piPred ); + int xBvgCccmCalcBlkAver (const PredictionUnit& pu) const; + void xBvgCccmCalcBlkRange (const PredictionUnit& pu, int& minVal, int&maxVal) const; + void xBvgCccmCalcModels ( const PredictionUnit& pu, CccmModel& cccmModelCb, CccmModel& cccmModelCr, int modelId, int modelThr, int minVal, int maxVal ); + void xBvgCccmApplyModel ( const PredictionUnit& pu, const ComponentID compId, CccmModel& cccmModel, int modelId, int modelThr, PelBuf &piPred ); #endif #endif #if JVET_AB0092_GLM_WITH_LUMA @@ -832,8 +830,8 @@ public: #endif #endif #if JVET_AC0119_LM_CHROMA_FUSION - void xCflmCalcModels(const PredictionUnit& pu, const ComponentID compId, const CompArea& chromaArea, CccmModel& cflmModel, int modelId, int modelThr); - void xCflmApplyModel(const PredictionUnit& pu, const ComponentID compId, const CompArea& chromaArea, CccmModel& cflmModel, int modelId, int modelThr, PelBuf& piPred); + void xCflmCalcModels (const PredictionUnit& pu, const ComponentID compId, const CompArea& chromaArea, CccmModel& cflmModel, int modelId, int modelThr); + void xCflmApplyModel (const PredictionUnit& pu, const ComponentID compId, const CompArea& chromaArea, CccmModel& cflmModel, int modelId, int modelThr, PelBuf& piPred); void xCflmCreateLumaRef (const PredictionUnit& pu, const CompArea& chromaArea); bool xCflmCreateChromaPred (const PredictionUnit& pu, const ComponentID compId, PelBuf& piPred #if JVET_AH0136_CHROMA_REORDERING @@ -861,7 +859,7 @@ public: void xGlmApplyModelOffset (const PredictionUnit& pu, const ComponentID compId, const CompArea& chromaArea, CccmModel& glmModel, int glmIdc, PelBuf& piPred, int lumaOffset, int chromaOffset); #if JVET_AG0154_DECODER_DERIVED_CCP_FUSION - int xGetCostCCPFusion(const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, int candIdx0, int candIdx1); + int xGetCostCCPFusion (const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, int candIdx0, int candIdx1); template <const bool updateOffsets> int xUpdateOffsetsAndGetCostCCLM(const PredictionUnit &pu, const ComponentID compID, const CompArea &chromaArea, CclmModel &cclmModel, int modelNum, int glmIdc, int candIdx = 0); @@ -869,7 +867,7 @@ public: int xUpdateOffsetsAndGetCostCCCM(const PredictionUnit &pu, const ComponentID compID, const CompArea &chromaArea, CccmModel cccmModel[2], int modelThr, int lumaOffset, int chromaOffset[2], int type, int candIdx = 0, int refSizeX = 0, int refSizeY = 0, const int cccmMultiFilterIdx = -1); template <const bool updateOffsets> - int xUpdateOffsetsAndGetCostGLM(const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, CccmModel& glmModel, int glmIdc, int lumaOffset, int& chromaOffset, int candIdx = 0); + int xUpdateOffsetsAndGetCostGLM (const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, CccmModel& glmModel, int glmIdc, int lumaOffset, int& chromaOffset, int candIdx = 0); #else template <const bool updateOffsets> int xUpdateOffsetsAndGetCostCCLM(const PredictionUnit &pu, const ComponentID compID, const CompArea &chromaArea, CclmModel &cclmModel, int modelNum, int glmIdc); @@ -878,34 +876,31 @@ public: int xUpdateOffsetsAndGetCostCCCM(const PredictionUnit &pu, const ComponentID compID, const CompArea &chromaArea, CccmModel cccmModel[2], int modelThr, int lumaOffset, int chromaOffset[2], int type, int refSizeX = 0, int refSizeY = 0, const int cccmMultiFilterIdx = -1 ); template <const bool updateOffsets> - int xUpdateOffsetsAndGetCostGLM(const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, CccmModel& glmModel, int glmIdc, int lumaOffset, int& chromaOffset); + int xUpdateOffsetsAndGetCostGLM (const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, CccmModel& glmModel, int glmIdc, int lumaOffset, int& chromaOffset); #endif #endif #if JVET_AG0154_DECODER_DERIVED_CCP_FUSION - void filterPredInsideProbeLine(const ComponentID compID, const PredictionUnit &pu, bool above); // training stage - int ddccpFusionTemplateCost(const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, int candIdx0, int candIdx1, int cost0, int cost1); - int decoderDerivedCccmCost(const PredictionUnit &pu, int currIdx, const ComponentID compID, int intraDir, const CompArea &chromaArea, CccmModel cccmModel[2], int modelThr); // training stage - int decoderDerivedCclmCost(const PredictionUnit &pu, int currIdx, const ComponentID compID, int intraDir, const CompArea &chromaArea, const CclmModel &cclmModel); - int tmCostDecoderDerivedCcp(PredictionUnit& pu, int currIdx, int intraDir, bool isCcpMerge = false); // training stage + void filterPredInsideProbeLine (const ComponentID compID, const PredictionUnit &pu, bool above); // training stage + int ddccpFusionTemplateCost (const PredictionUnit& pu, const ComponentID compID, const CompArea& chromaArea, int candIdx0, int candIdx1, int cost0, int cost1); + int decoderDerivedCccmCost (const PredictionUnit &pu, int currIdx, const ComponentID compID, int intraDir, const CompArea &chromaArea, CccmModel cccmModel[2], int modelThr); // training stage + int decoderDerivedCclmCost (const PredictionUnit &pu, int currIdx, const ComponentID compID, int intraDir, const CompArea &chromaArea, const CclmModel &cclmModel); + int tmCostDecoderDerivedCcp (PredictionUnit& pu, int currIdx, int intraDir, bool isCcpMerge = false); // training stage void predDecoderDerivedIntraCCCMFusions(PredictionUnit& pu, PelBuf &predCb, PelBuf &predCr, std::vector<DecoderDerivedCcpCandidate> &decoderDerivedCcpList); - int decoderDerivedCcp(PredictionUnit& pu, std::vector<DecoderDerivedCcpCandidate> &decoderDerivedCcpList); // training stage + int decoderDerivedCcp (PredictionUnit& pu, std::vector<DecoderDerivedCcpCandidate> &decoderDerivedCcpList); // training stage void predDecoderDerivedCcpMergeFusion(PredictionUnit& pu, PelBuf &predCb, PelBuf &predCr, CCPModelCandidate decoderDerivedCcp1, CCPModelCandidate decoderDerivedCcp2); #endif #if JVET_AF0073_INTER_CCP_MERGE || JVET_AG0154_DECODER_DERIVED_CCP_FUSION - void xInterCccmApplyModelOffset(const PredictionUnit &pu, const ComponentID compId, CccmModel &cccmModel, - PelBuf &piPred, int lumaOffset, int chromaOffset); - int xGetCostInterCccm(const PredictionUnit &pu, const ComponentID compID, const CompArea &chromaArea, - CccmModel &cccmModel, int lumaOffset, int chromaOffset + void xInterCccmApplyModelOffset (const PredictionUnit &pu, const ComponentID compId, CccmModel &cccmModel, PelBuf &piPred, int lumaOffset, int chromaOffset); + int xGetCostInterCccm (const PredictionUnit &pu, const ComponentID compID, const CompArea &chromaArea, CccmModel &cccmModel, int lumaOffset, int chromaOffset #if JVET_AG0154_DECODER_DERIVED_CCP_FUSION , int candIdx = 0 #endif ); - void xAddOnTheFlyCalcCCPCands4InterBlk(const PredictionUnit &pu, CompArea chromaArea, CCPModelCandidate candList[], - int &validNum); - void selectCcpMergeCand(PredictionUnit &pu, CCPModelCandidate candList[], int reorderlistSize); - void combineCcpAndInter(PredictionUnit &pu, PelBuf &inPredCb, PelBuf &inPredCr, PelBuf &outPredCb, PelBuf &outPredCr + void xAddOnTheFlyCalcCCPCands4InterBlk (const PredictionUnit &pu, CompArea chromaArea, CCPModelCandidate candList[], int &validNum); + void selectCcpMergeCand (PredictionUnit &pu, CCPModelCandidate candList[], int reorderlistSize); + void combineCcpAndInter (PredictionUnit &pu, PelBuf &inPredCb, PelBuf &inPredCr, PelBuf &outPredCb, PelBuf &outPredCr #if JVET_AH0066_JVET_AH0202_CCP_MERGE_LUMACBF0 , bool useExistCcp = false #endif @@ -913,26 +908,26 @@ public: #endif #if JVET_AJ0161_OBMC_EXT_WITH_INTRA_PRED - const IntraPredParam* getIpaParam () { return &m_ipaParam; }; - bool getGradForOBMC(const PredictionUnit pu, const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu, const bool isAbove, const int blkSize, int* modeBuf); + const IntraPredParam* getIpaParam () { return &m_ipaParam; }; + bool getGradForOBMC (const PredictionUnit pu, const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu, const bool isAbove, const int blkSize, int* modeBuf); #endif #if ENABLE_DIMD - static void deriveDimdMode (const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu); + static void deriveDimdMode (const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu); #if JVET_AJ0267_ADAPTIVE_HOG static void deriveDimdModeAdaptive (const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu); #endif #if JVET_Z0050_DIMD_CHROMA_FUSION && ENABLE_DIMD - static void deriveDimdChromaMode(const CPelBuf &recoBufY, const CPelBuf &recoBufCb, const CPelBuf &recoBufCr, const CompArea &areaY, const CompArea &areaCb, const CompArea &areaCr, CodingUnit &cu); + static void deriveDimdChromaMode (const CPelBuf &recoBufY, const CPelBuf &recoBufCb, const CPelBuf &recoBufCr, const CompArea &areaY, const CompArea &areaCb, const CompArea &areaCr, CodingUnit &cu); #if JVET_AH0136_CHROMA_REORDERING - void deriveNonCcpChromaModes(const CPelBuf &recoBufY, const CPelBuf &recoBufCb, const CPelBuf &recoBufCr, const CompArea &areaY, const CompArea &areaCb, const CompArea &areaCr, CodingUnit &cu, PredictionUnit &pu, InterPrediction *pcInterPred); - void buildChromaModeList(const CompArea &area, CodingUnit &cu, PredictionUnit &pu, uint8_t chromaList[NUM_CHROMA_LIST_MODE], int &existNum, bool &hasDBV); - void predCoLuma(const CompArea &area, const CPelBuf &recoBuf, PredictionUnit &pu, uint8_t predMode, PelBuf predBuf, InterPrediction *pcInterPred, CodingUnit &chromaCu); - void predChromaTM(const CompArea &areaCb, const CompArea &areaCr, PredictionUnit &pu, uint8_t predMode, PelBuf predCb, PelBuf predCr, TemplateType eTplType, InterPrediction *pcInterPred); + void deriveNonCcpChromaModes (const CPelBuf &recoBufY, const CPelBuf &recoBufCb, const CPelBuf &recoBufCr, const CompArea &areaY, const CompArea &areaCb, const CompArea &areaCr, CodingUnit &cu, PredictionUnit &pu, InterPrediction *pcInterPred); + void buildChromaModeList (const CompArea &area, CodingUnit &cu, PredictionUnit &pu, uint8_t chromaList[NUM_CHROMA_LIST_MODE], int &existNum, bool &hasDBV); + void predCoLuma (const CompArea &area, const CPelBuf &recoBuf, PredictionUnit &pu, uint8_t predMode, PelBuf predBuf, InterPrediction *pcInterPred, CodingUnit &chromaCu); + void predChromaTM (const CompArea &areaCb, const CompArea &areaCr, PredictionUnit &pu, uint8_t predMode, PelBuf predCb, PelBuf predCr, TemplateType eTplType, InterPrediction *pcInterPred); #endif #endif #if ENABLE_DIMD && (JVET_AB0067_MIP_DIMD_LFNST || JVET_AC0115_INTRA_TMP_DIMD_MTS_LFNST || JVET_AG0058_EIP || JVET_AG0061_INTER_LFNST_NSPT) - static int deriveIpmForTransform(CPelBuf predBuf, CodingUnit& cu + static int deriveIpmForTransform (CPelBuf predBuf, CodingUnit& cu #if JVET_AI0050_INTER_MTSS , int &secondMode #endif @@ -942,7 +937,7 @@ public: ); #endif #if !JVET_AG0061_INTER_LFNST_NSPT - static int buildHistogram ( const Pel *pReco, int iStride, uint32_t uiHeight, uint32_t uiWidth, int* piHistogram, int direction, int bw, int bh ); + static int buildHistogram ( const Pel *pReco, int iStride, uint32_t uiHeight, uint32_t uiWidth, int* piHistogram, int direction, int bw, int bh ); #endif #endif #if JVET_W0123_TIMD_FUSION || JVET_AC0119_LM_CHROMA_FUSION @@ -955,25 +950,25 @@ public: #endif ); #if (JVET_AG0146_DIMD_ITMP_IBC || JVET_AG0152_SGPM_ITMP_IBC || JVET_AG0151_INTRA_TMP_MERGE_MODE) - void predTimdIbcItmp(const ComponentID compId, const PredictionUnit& pu, Mv Bv, Pel* pPred, uint32_t uiStride, uint32_t iWidth, uint32_t iHeight, TemplateType eTempType, int32_t iTemplateWidth, int32_t iTemplateHeight, Pel* piOrg, int orgStride); - void predUsingBv(Pel* piPred, unsigned int uiStride, Mv Bv, CodingUnit cu + void predTimdIbcItmp (const ComponentID compId, const PredictionUnit& pu, Mv Bv, Pel* pPred, uint32_t uiStride, uint32_t iWidth, uint32_t iHeight, TemplateType eTempType, int32_t iTemplateWidth, int32_t iTemplateHeight, Pel* piOrg, int orgStride); + void predUsingBv (Pel* piPred, unsigned int uiStride, Mv Bv, CodingUnit cu #if JVET_AH0200_INTRA_TMP_BV_REORDER , bool isIntBv = true #endif ); #endif - void xIntraPredTimdAngLuma(Pel* pDstBuf, const ptrdiff_t dstStride, Pel* refMain, int width, int height, int deltaPos, int intraPredAngle, const ClpRng& clpRng, int xOffset, int yOffset); + void xIntraPredTimdAngLuma (Pel* pDstBuf, const ptrdiff_t dstStride, Pel* refMain, int width, int height, int deltaPos, int intraPredAngle, const ClpRng& clpRng, int xOffset, int yOffset); #if JVET_AC0119_LM_CHROMA_FUSION - void xIntraPredTimdAngChroma(Pel* pDstBuf, const ptrdiff_t dstStride, Pel* refMain, int width, int height, int deltaPos, int intraPredAngle, const ClpRng& clpRng, int xOffset, int yOffset); + void xIntraPredTimdAngChroma (Pel* pDstBuf, const ptrdiff_t dstStride, Pel* refMain, int width, int height, int deltaPos, int intraPredAngle, const ClpRng& clpRng, int xOffset, int yOffset); #endif void xIntraPredTimdPlanarDcPdpc (const CPelBuf &pSrc, Pel* pDst, int iDstStride, int width, int height, TemplateType eTempType, int iTemplateWidth , int iTemplateHeight); - void xIntraPredTimdAngPdpc(Pel* pDsty,const int dstStride,Pel* refSide,const int width,const int height, int xOffset, int yOffset, int scale, int invAngle); + void xIntraPredTimdAngPdpc (Pel* pDsty,const int dstStride,Pel* refSide,const int width,const int height, int xOffset, int yOffset, int scale, int invAngle); void xFillTimdReferenceSamples ( const CPelBuf &recoBuf, Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu, int iTemplateWidth, int iTemplateHeight ); Pel xGetPredTimdValDc ( const CPelBuf &pSrc, const Size &dstSize, TemplateType eTempType, int iTempHeight, int iTempWidth ); #if JVET_AB0155_SGPM - void initPredTimdIntraParams(const PredictionUnit &pu, const CompArea area, int dirMode, bool bSgpm = false + void initPredTimdIntraParams (const PredictionUnit &pu, const CompArea area, int dirMode, bool bSgpm = false #if JVET_AC0094_REF_SAMPLES_OPT - , bool checkWideAngle = true + , bool checkWideAngle = true #endif ); #else @@ -988,7 +983,7 @@ public: #endif void predTimdIntraAng ( const ComponentID compId, const PredictionUnit &pu, uint32_t uiDirMode, Pel* pPred, uint32_t uiStride, uint32_t iWidth, uint32_t iHeight, TemplateType eTempType, int32_t iTemplateWidth, int32_t iTemplateHeight); #if JVET_AG0146_DIMD_ITMP_IBC - int getBestNonAnglularMode(const CPelBuf& recoBuf, const CompArea& area, CodingUnit& cu, std::vector<Mv> BVs); + int getBestNonAnglularMode (const CPelBuf& recoBuf, const CompArea& area, CodingUnit& cu, std::vector<Mv> BVs); #endif #if JVET_AH0076_OBIC void deriveObicMode ( const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu ); @@ -1000,7 +995,7 @@ public: #endif #endif #if JVET_AJ0146_TIMDSAD - int deriveTimdModeSad(const CPelBuf& recoBuf, const CompArea& area, CodingUnit& cu); + int deriveTimdModeSad (const CPelBuf& recoBuf, const CompArea& area, CodingUnit& cu); #endif #if JVET_AB0155_SGPM int deriveTimdMode ( const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu, bool bFull = true, bool bHorVer = false @@ -1023,26 +1018,24 @@ public: #if CIIP_PDPC void xIntraPredPlanarDcPdpc (const CPelBuf &pSrc, Pel *pDst, int iDstStride, int width, int height, bool ciipPDPC); #else - void xIntraPredPlanarDcPdpc( const CPelBuf &pSrc, Pel *pDst, int iDstStride, int width, int height ); + void xIntraPredPlanarDcPdpc ( const CPelBuf &pSrc, Pel *pDst, int iDstStride, int width, int height ); #endif #endif #endif #if JVET_AB0155_SGPM - void deriveSgpmModeOrdered(const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu, - static_vector<SgpmInfo, SGPM_NUM> &candModeList, - static_vector<double, SGPM_NUM> & candCostList); + void deriveSgpmModeOrdered (const CPelBuf &recoBuf, const CompArea &area, CodingUnit &cu, static_vector<SgpmInfo, SGPM_NUM> &candModeList, static_vector<double, SGPM_NUM> & candCostList); #if JVET_AJ0112_REGRESSION_SGPM - int deriveSgpmBlending(PredictionUnit& pu, PelBuf &predBuf0, PelBuf &predBuf1, PelBuf &recBuf, PelBuf &adBuf, AffineBlendingModel &blendModel); + int deriveSgpmBlending (PredictionUnit& pu, PelBuf &predBuf0, PelBuf &predBuf1, PelBuf &recBuf, PelBuf &adBuf, AffineBlendingModel &blendModel); #endif #endif #if JVET_AD0085_MPM_SORTING - void deriveMPMSorted(const PredictionUnit& pu, uint8_t* mpm, int& sortedSize, int iStartIdx); + void deriveMPMSorted (const PredictionUnit& pu, uint8_t* mpm, int& sortedSize, int iStartIdx); #endif #if JVET_AG0136_INTRA_TMP_LIC - void setBvMvFromMemory(const CodingUnit& cu, const int idx, const bool useMR); + void setBvMvFromMemory (const CodingUnit& cu, const int idx, const bool useMR); #endif #if TMP_FAST_ENC && JVET_AD0086_ENHANCED_INTRA_TMP - int64_t m_tmpFlmParams[TMP_FLM_PARAMS][MTMP_NUM]; + int64_t m_tmpFlmParams[TMP_FLM_PARAMS][MTMP_NUM]; #endif #if JVET_AB0157_TMRL struct TmrlInfo @@ -1065,31 +1058,31 @@ public: }; TmrlInfo tmrlInfo; - void xPredTmrlIntraDc(const CPelBuf& pSrc, Pel* pDst, int iDstStride); - void xPredTmrlIntraAng(const CPelBuf& pSrc, const ClpRng& clpRng, Pel* pTrueDst, int iDstStride); - void predTmrlIntraAng(const PredictionUnit& pu, Pel* pPred, uint32_t uiStride); - void initTmrlIntraParams(const PredictionUnit& pu, const CompArea area, const SPS& sps); - void getTmrlSearchRange(const PredictionUnit& pu, int8_t* tmrlRefList, uint8_t* tmrlIntraList, uint8_t& sizeRef, uint8_t& sizeMode); TmrlMode m_tmrlList[MRL_LIST_SIZE]; - void getTmrlList(CodingUnit& cu); + void xPredTmrlIntraDc (const CPelBuf& pSrc, Pel* pDst, int iDstStride); + void xPredTmrlIntraAng (const CPelBuf& pSrc, const ClpRng& clpRng, Pel* pTrueDst, int iDstStride); + void predTmrlIntraAng (const PredictionUnit& pu, Pel* pPred, uint32_t uiStride); + void initTmrlIntraParams (const PredictionUnit& pu, const CompArea area, const SPS& sps); + void getTmrlSearchRange (const PredictionUnit& pu, int8_t* tmrlRefList, uint8_t* tmrlIntraList, uint8_t& sizeRef, uint8_t& sizeMode); + void getTmrlList (CodingUnit& cu); #if JVET_AJ0081_CHROMA_TMRL TmrlMode m_chromaTmrlList[CHROMA_TMRL_LIST_SIZE]; - void getChromaTmrlSearchRange(const PredictionUnit& pu, int8_t* tmrlRefList, uint8_t* tmrlIntraList, uint8_t& sizeRef, uint8_t& sizeMode); - void predChromaTmrlIntraAng(PredictionUnit& pu, const ComponentID compID, Pel* pPred, uint32_t uiStride); - void getChromaTmrlList(const CPelBuf& recoBufY, const CPelBuf& recoBufCb, const CPelBuf& recoBufCr, const CompArea& areaY, const CompArea& areaCb, const CompArea& areaCr, CodingUnit& cu, PredictionUnit& pu, InterPrediction* pcInterPred); + void getChromaTmrlSearchRange (const PredictionUnit& pu, int8_t* tmrlRefList, uint8_t* tmrlIntraList, uint8_t& sizeRef, uint8_t& sizeMode); + void predChromaTmrlIntraAng (PredictionUnit& pu, const ComponentID compID, Pel* pPred, uint32_t uiStride); + void getChromaTmrlList (const CPelBuf& recoBufY, const CPelBuf& recoBufCb, const CPelBuf& recoBufCr, const CompArea& areaY, const CompArea& areaCb, const CompArea& areaCr, CodingUnit& cu, PredictionUnit& pu, InterPrediction* pcInterPred); #endif #endif #if JVET_AG0058_EIP - void initEipParams(const PredictionUnit& pu, const ComponentID compId); - void eipPred(const PredictionUnit& pu, PelBuf& piPred, const ComponentID compId = COMPONENT_Y); - void getCurEipCands(const PredictionUnit& pu, static_vector<EipModelCandidate, NUM_DERIVED_EIP>& candList, const ComponentID compId = COMPONENT_Y, const bool fastTest = true); - int64_t (*m_calcAeipGroupSum)(const Pel* src1, const Pel* src2, const int numSamples); + void initEipParams (const PredictionUnit& pu, const ComponentID compId); + void eipPred (const PredictionUnit& pu, PelBuf& piPred, const ComponentID compId = COMPONENT_Y); + void getCurEipCands (const PredictionUnit& pu, static_vector<EipModelCandidate, NUM_DERIVED_EIP>& candList, const ComponentID compId = COMPONENT_Y, const bool fastTest = true); + int64_t (*m_calcAeipGroupSum) (const Pel* src1, const Pel* src2, const int numSamples); static int64_t calcAeipGroupSum(const Pel* src1, const Pel* src2, const int numSamples); - void getNeiEipCands(const PredictionUnit &pu, static_vector<EipModelCandidate, MAX_MERGE_EIP> &candList, const ComponentID compId = COMPONENT_Y); - void reorderEipCands(const PredictionUnit &pu, static_vector<EipModelCandidate, MAX_MERGE_EIP> &candList, const ComponentID compId = COMPONENT_Y); + void getNeiEipCands (const PredictionUnit &pu, static_vector<EipModelCandidate, MAX_MERGE_EIP> &candList, const ComponentID compId = COMPONENT_Y); + void reorderEipCands (const PredictionUnit &pu, static_vector<EipModelCandidate, MAX_MERGE_EIP> &candList, const ComponentID compId = COMPONENT_Y); #if JVET_AH0086_EIP_BIAS_AND_CLIP - void setInputsVec(Pel *inputs, PelBuf &reco, int w, int h, int filterShape); + void setInputsVec (Pel *inputs, PelBuf &reco, int w, int h, int filterShape); #endif #if JVET_AJ0082_MM_EIP inline Pel getEipInputsAvg(Pel *inputs, int filterShape) @@ -1116,8 +1109,8 @@ protected: Pel m_acYuvRefGPMIntraTemplate[NUM_INTRA_MODE][2][GEO_MAX_CU_SIZE * GEO_MODE_SEL_TM_SIZE]; //[][0][]: top, [][1][]: left template <uint8_t partIdx> - bool xFillIntraGPMRefTemplateAll(PredictionUnit& pu, TemplateType eTempType, bool readBufferedMPMList, bool doInitMPMList, bool loadIntraRef, std::vector<Pel>* lut = nullptr, uint8_t candIdx = std::numeric_limits<uint8_t>::max()); - bool xFillIntraGPMRefTemplate (PredictionUnit& pu, TemplateType eTempType, uint8_t intraMode, bool loadIntraRef, Pel* bufTop, Pel* bufLeft, std::vector<Pel>* lut = nullptr); + bool xFillIntraGPMRefTemplateAll (PredictionUnit& pu, TemplateType eTempType, bool readBufferedMPMList, bool doInitMPMList, bool loadIntraRef, std::vector<Pel>* lut = nullptr, uint8_t candIdx = std::numeric_limits<uint8_t>::max()); + bool xFillIntraGPMRefTemplate (PredictionUnit& pu, TemplateType eTempType, uint8_t intraMode, bool loadIntraRef, Pel* bufTop, Pel* bufLeft, std::vector<Pel>* lut = nullptr); public: uint8_t prefillIntraGPMReferenceSamples (PredictionUnit& pu, int iTempWidth, int iTempHeight); @@ -1130,7 +1123,7 @@ public: #endif // Angular Intra #if JVET_AH0209_PDP - void predIntraAng(const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu, const bool applyFusion = true, const bool applyPDPFilter = true); + void predIntraAng (const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu, const bool applyFusion = true, const bool applyPDPFilter = true); #elif JVET_AB0157_INTRA_FUSION void predIntraAng ( const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu, const bool applyFusion = true); #else @@ -1143,12 +1136,12 @@ public: #if JVET_AC0071_DBV // Direct Block Vector - void predIntraDbv(const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu + void predIntraDbv (const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu #if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS , InterPrediction *pcInterPred #endif ); - Mv refineChromaBv(const ComponentID compId, const PredictionUnit &pu + Mv refineChromaBv (const ComponentID compId, const PredictionUnit &pu #if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS , InterPrediction *pcInterPred #endif @@ -1157,11 +1150,11 @@ public: // Cross-component chroma #if JVET_AD0188_CCP_MERGE - void predIntraChromaLM( const ComponentID compID, PelBuf &piPred, PredictionUnit &pu, const CompArea& chromaArea, int intraDir, bool createModel = true, CclmModel *cclmModelStored = nullptr ); + void predIntraChromaLM ( const ComponentID compID, PelBuf &piPred, PredictionUnit &pu, const CompArea& chromaArea, int intraDir, bool createModel = true, CclmModel *cclmModelStored = nullptr ); #else - void predIntraChromaLM(const ComponentID compID, PelBuf &piPred, const PredictionUnit &pu, const CompArea& chromaArea, int intraDir, bool createModel = true, CclmModel *cclmModelStored = nullptr); + void predIntraChromaLM (const ComponentID compID, PelBuf &piPred, const PredictionUnit &pu, const CompArea& chromaArea, int intraDir, bool createModel = true, CclmModel *cclmModelStored = nullptr); #endif - void xGetLumaRecPixels(const PredictionUnit &pu, CompArea chromaArea + void xGetLumaRecPixels (const PredictionUnit &pu, CompArea chromaArea #if JVET_AD0202_CCCM_MDF , int downsFilterIdx = 0 #endif @@ -1170,20 +1163,20 @@ public: #endif ); #if JVET_AA0126_GLM - void xGetLumaRecPixelsGlmAll(const PredictionUnit &pu, CompArea chromaArea); - Pel xGlmGetLumaVal (const int s[6], const int c[6], const int glmIdx, const Pel val) const; + void xGetLumaRecPixelsGlmAll (const PredictionUnit &pu, CompArea chromaArea); + Pel xGlmGetLumaVal (const int s[6], const int c[6], const int glmIdx, const Pel val) const; #endif /// set parameters from CU data for accessing intra data #if JVET_AC0112_IBC_CIIP || JVET_AC0112_IBC_GPM #if JVET_AB0155_SGPM - void initPredIntraParams(const PredictionUnit &pu, const CompArea compArea, const SPS &sps, const int partIdx = 0); + void initPredIntraParams (const PredictionUnit &pu, const CompArea compArea, const SPS &sps, const int partIdx = 0); #else - void initPredIntraParams ( const PredictionUnit & pu, const CompArea compArea, const SPS& sps ); + void initPredIntraParams ( const PredictionUnit & pu, const CompArea compArea, const SPS& sps ); #endif #endif #if JVET_AB0155_SGPM - void initIntraPatternChType(const CodingUnit &cu, const CompArea &area, const bool forceRefFilterFlag = false, + void initIntraPatternChType (const CodingUnit &cu, const CompArea &area, const bool forceRefFilterFlag = false, const int partIdx = 0 #if JVET_AB0157_INTRA_FUSION , bool applyFusion = true @@ -1262,34 +1255,34 @@ public: #if JVET_AD0086_ENHANCED_INTRA_TMP #if JVET_AG0136_INTRA_TMP_LIC #if JVET_AI0129_INTRA_TMP_OVERLAPPING_REFINEMENT - void (*m_calcTemplateDiffJointSadMrsad) (const Pel* const ref, const unsigned int uiStride, Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, int* diffSad, int* diffMrsad, int* iMaxSad, int* iMaxMrsad, const RefTemplateType tempType, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean, const int licShift); - void(*m_calcTargetMean) (Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); + void (*m_calcTemplateDiffJointSadMrsad) (const Pel* const ref, const unsigned int uiStride, Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, int* diffSad, int* diffMrsad, int* iMaxSad, int* iMaxMrsad, const RefTemplateType tempType, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean, const int licShift); + void(*m_calcTargetMean) (Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); static void calcTemplateDiffJointSadMrsad(const Pel* const ref, const unsigned int uiStride, Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, int* diffSad, int* diffMrsad, int* iMaxSad, int* iMaxMrsad, const RefTemplateType tempType, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean, const int licShift); - static void calcTargetMean(Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); + static void calcTargetMean (Pel* tarPatch, int tarStride, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); #else - void (*m_calcTemplateDiffJointSadMrsad) (const Pel* const ref, const unsigned int uiStride, Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, int* diffSad, int* diffMrsad, int* iMaxSad, int* iMaxMrsad, const RefTemplateType tempType, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean); - void(*m_calcTargetMean) (Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); + void (*m_calcTemplateDiffJointSadMrsad) (const Pel* const ref, const unsigned int uiStride, Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, int* diffSad, int* diffMrsad, int* iMaxSad, int* iMaxMrsad, const RefTemplateType tempType, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean); + void(*m_calcTargetMean) (Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); static void calcTemplateDiffJointSadMrsad(const Pel* const ref, const unsigned int uiStride, Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, int* diffSad, int* diffMrsad, int* iMaxSad, int* iMaxMrsad, const RefTemplateType tempType, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean); - static void calcTargetMean(Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); + static void calcTargetMean (Pel** tarPatch, const unsigned int uiPatchWidth, const unsigned int uiPatchHeight, const RefTemplateType tempType, const int requiredTemplate, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, int& topTargetMean, int& leftTargetMean); #endif // #endif #if JVET_AI0129_INTRA_TMP_OVERLAPPING_REFINEMENT - void(*m_calcTemplateDiff) (Pel* ref, unsigned int uiStride, Pel* tarPatch, int tarStride, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int* diff, int* iMax, RefTemplateType TempType, int requiredTemplate + void(*m_calcTemplateDiff) (Pel* ref, unsigned int uiStride, Pel* tarPatch, int tarStride, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int* diff, int* iMax, RefTemplateType TempType, int requiredTemplate #else - void(*m_calcTemplateDiff) (Pel* ref, unsigned int uiStride, Pel** tarPatch, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int *diff, int *iMax, RefTemplateType TempType, int requiredTemplate + void(*m_calcTemplateDiff) (Pel* ref, unsigned int uiStride, Pel** tarPatch, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int *diff, int *iMax, RefTemplateType TempType, int requiredTemplate #endif #if JVET_AG0136_INTRA_TMP_LIC , const bool isMrSad, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean #endif ); #if JVET_AI0129_INTRA_TMP_OVERLAPPING_REFINEMENT - static void calcTemplateDiff(Pel* ref, unsigned int uiStride, Pel* tarPatch, int tarStride, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int* diff, int* iMax, RefTemplateType TempType, int requiredTemplate + static void calcTemplateDiff (Pel* ref, unsigned int uiStride, Pel* tarPatch, int tarStride, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int* diff, int* iMax, RefTemplateType TempType, int requiredTemplate #if JVET_AG0136_INTRA_TMP_LIC , const bool isMrSad, const int log2SizeTop, const int log2SizeLeft, const int sizeTopLeft, const int topTargetMean, const int leftTargetMean #endif ); #else - static void calcTemplateDiff(Pel *ref, unsigned int uiStride, Pel **tarPatch, unsigned int uiPatchWidth, + static void calcTemplateDiff (Pel *ref, unsigned int uiStride, Pel **tarPatch, unsigned int uiPatchWidth, unsigned int uiPatchHeight, int *diff, int *iMax, RefTemplateType TempType, int requiredTemplate #if JVET_AG0136_INTRA_TMP_LIC @@ -1336,14 +1329,14 @@ public: ); #if JVET_AH0200_INTRA_TMP_BV_REORDER void xPadForFracSearchInterpolation (CodingUnit* pcCU, RefTemplateType tempType); - void xTmpFracSearchIF(PredictionUnit& pu, Pel* padbf0, unsigned int padStride, Pel* preTmpbf0, unsigned int predTempStride, Pel* tmp0, unsigned int tmpStride, int extUiWidth, int extUiHeight, int fracPrec, int fracDir); + void xTmpFracSearchIF (PredictionUnit& pu, Pel* padbf0, unsigned int padStride, Pel* preTmpbf0, unsigned int predTempStride, Pel* tmp0, unsigned int tmpStride, int extUiWidth, int extUiHeight, int fracPrec, int fracDir); #if JVET_AI0129_INTRA_TMP_OVERLAPPING_REFINEMENT - void searchFracCandidate(CodingUnit* pcCU, Pel* tarPatch, RefTemplateType tempType); + void searchFracCandidate (CodingUnit* pcCU, Pel* tarPatch, RefTemplateType tempType); #else - void searchFracCandidate( CodingUnit* pcCU, Pel** tarPatch, RefTemplateType tempType); + void searchFracCandidate ( CodingUnit* pcCU, Pel** tarPatch, RefTemplateType tempType); #endif InterPrediction *m_pcInterPred; - void setInterPrediction( InterPrediction *inter); + void setInterPrediction ( InterPrediction *inter); #endif #else void searchCandidateFromOnePicIntra( CodingUnit* pcCU, Pel** tarPatch, unsigned int uiPatchWidth, unsigned int uiPatchHeight, ); @@ -1478,7 +1471,7 @@ public: //! \} #if JVET_W0123_TIMD_FUSION && JVET_AG0092_ENHANCED_TIMD_FUSION -void xLocationdepBlending(Pel *pDst, int strideDst, Pel *pVer, int strideVer, Pel *pHor, int strideHor,Pel *pNonLocDep, int strideNonLocDep, int width, int height, int mode, int wVer, int wHor, int wNonLocDep, int range = 10); +void xLocationdepBlending (Pel *pDst, int strideDst, Pel *pVer, int strideVer, Pel *pHor, int strideHor,Pel *pNonLocDep, int strideNonLocDep, int width, int height, int mode, int wVer, int wHor, int wNonLocDep, int range = 10); #else #if ENABLE_DIMD #if JVET_AC0098_LOC_DEP_DIMD diff --git a/source/Lib/CommonLib/Rom.h b/source/Lib/CommonLib/Rom.h index 9783b2769..f3adf3205 100644 --- a/source/Lib/CommonLib/Rom.h +++ b/source/Lib/CommonLib/Rom.h @@ -287,14 +287,14 @@ extern const int8_t g_nspt32x4[ NUM_NSPT_CLUSTERS_32x4 ][ 20 ][ 128 ]; extern const int8_t g_nspt8x32[ NUM_NSPT_CLUSTERS_8x32 ][ 24 ][ 256 ]; extern const int8_t g_nspt32x8[ NUM_NSPT_CLUSTERS_32x8 ][ 24 ][ 256 ]; #endif -extern const uint8_t g_nsptIdx_4x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_4x8[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_8x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_8x8[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_4x16[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_16x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_8x16[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; -extern const uint8_t g_nsptIdx_16x8[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx4x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx4x8[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx8x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx8x8[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx4x16[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx16x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx8x16[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; +extern const uint8_t g_nsptIdx16x8[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; #if JVET_AE0086_LARGE_NSPT extern const uint8_t g_nsptIdx_4x32[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; extern const uint8_t g_nsptIdx_32x4[ 35 ][ NUM_NSPT_BLOCK_TYPES ][ 3 ]; diff --git a/source/Lib/CommonLib/RomNSPT.h b/source/Lib/CommonLib/RomNSPT.h index 33b59065d..8f986629f 100644 --- a/source/Lib/CommonLib/RomNSPT.h +++ b/source/Lib/CommonLib/RomNSPT.h @@ -41,7 +41,7 @@ #include "TypeDef.h" #if JVET_AJ0175_NSPT_FOR_NONREG_MODES -const uint8_t g_nsptIdx_4x4[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx4x4[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, // block type 0 { 3, 4, 5, }, // block type 1 @@ -219,7 +219,7 @@ const uint8_t g_nsptIdx_4x4[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_4x8[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx4x8[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, @@ -397,7 +397,7 @@ const uint8_t g_nsptIdx_4x8[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_4x16[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx4x16[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, @@ -575,7 +575,7 @@ const uint8_t g_nsptIdx_4x16[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_8x4[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx8x4[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, @@ -753,7 +753,7 @@ const uint8_t g_nsptIdx_8x4[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_8x8[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx8x8[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, @@ -931,7 +931,7 @@ const uint8_t g_nsptIdx_8x8[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_8x16[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx8x16[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, @@ -1109,7 +1109,7 @@ const uint8_t g_nsptIdx_8x16[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_16x4[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx16x4[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, @@ -1287,7 +1287,7 @@ const uint8_t g_nsptIdx_16x4[ 35 ][ 3 ][ 3 ] = { }, }; -const uint8_t g_nsptIdx_16x8[ 35 ][ 3 ][ 3 ] = { +const uint8_t g_nsptIdx16x8[ 35 ][ 3 ][ 3 ] = { { // 0 { 0, 1, 2, }, { 3, 4, 5, }, diff --git a/source/Lib/CommonLib/TrQuant.cpp b/source/Lib/CommonLib/TrQuant.cpp index a67c5d822..da9689945 100644 --- a/source/Lib/CommonLib/TrQuant.cpp +++ b/source/Lib/CommonLib/TrQuant.cpp @@ -2035,35 +2035,35 @@ uint8_t TrQuant::getNsptKernelCluster(const uint32_t mode, const uint32_t width, CHECK(bktIdx < 0 || bktIdx >= NUM_NSPT_BLOCK_TYPES, "bktIdx outside range"); if (width == 4 && height == 4) { - return g_nsptIdx_4x4[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx4x4[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 8 && height == 8) { - return g_nsptIdx_8x8[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx8x8[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 4 && height == 8) { - return g_nsptIdx_4x8[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx4x8[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 8 && height == 4) { - return g_nsptIdx_8x4[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx8x4[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 4 && height == 16) { - return g_nsptIdx_4x16[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx4x16[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 16 && height == 4) { - return g_nsptIdx_16x4[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx16x4[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 8 && height == 16) { - return g_nsptIdx_8x16[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx8x16[ mode ][ bktIdx ][ nsptIdx ]; } else if (width == 16 && height == 8) { - return g_nsptIdx_16x8[ mode ][ bktIdx ][ nsptIdx ]; + return g_nsptIdx16x8[ mode ][ bktIdx ][ nsptIdx ]; } #if JVET_AE0086_LARGE_NSPT else if (width == 4 && height == 32) diff --git a/source/Lib/EncoderLib/IntraSearch.h b/source/Lib/EncoderLib/IntraSearch.h index c8f0b6049..3f8253599 100644 --- a/source/Lib/EncoderLib/IntraSearch.h +++ b/source/Lib/EncoderLib/IntraSearch.h @@ -236,8 +236,8 @@ private: bool tmpFusionFlag; bool tmpFlmFlag; #if JVET_AG0136_INTRA_TMP_LIC - bool tmpLicFlag; - uint8_t tmpLicIdc; + bool tmpLicFlag; + uint8_t tmpLicIdc; #endif int tmpIsSubPel; int tmpSubPelIdx; @@ -802,15 +802,15 @@ public: int m_isCccmWithMdfEnabledInRdo[5][MMLM_T_IDX + 1]; #endif #if JVET_AG0154_DECODER_DERIVED_CCP_FUSION - bool m_skipDdCcpListConstruction; - bool firstTransformDdccp; + bool m_skipDdCcpListConstruction; + bool firstTransformDdccp; PelStorage m_ddCcpStorage; PelUnitBuf m_ddCcpStorageTemp; std::vector<DecoderDerivedCcpCandidate> m_decoderDerivedCcpList; - bool m_skipDdCcpMergeFusionList; - int m_numCcpMergefusionRdo; - double m_ddccpMergeFusionCost[2]; - int m_ddCcpMergeFusionModeIndex[2]; + bool m_skipDdCcpMergeFusionList; + int m_numCcpMergefusionRdo; + double m_ddccpMergeFusionCost[2]; + int m_ddCcpMergeFusionModeIndex[2]; PelStorage m_ddCcpFusionStorage[2]; PelUnitBuf m_ddCcpFusionStorageTemp[2]; #endif -- GitLab