Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
CHECK(!m_intraModeReady[iMode], "OBIC mode is not ready!");
PelBuf predBufTmp(m_intraPredBuf[iMode], pu.Y());
predFusion[idx].copyFrom(predBufTmp);
if (iMode == PLANAR_IDX)
{
planarIdx = idx;
}
}
else
{
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], pu.Y());
predFusion[idx].copyFrom(planarBuf);
}
}
if (cu.obicIsBlended)
{
generateObicBlending(piPred, pu, predFusion, blendModes, planarIdx);
}
else
{
initIntraPatternChType(cu, pu.Y(), false);
predIntraAng(COMPONENT_Y, piPred, pu);
}
PelBuf obicSaveBuf(m_obicPredBuf, pu.Y());
obicSaveBuf.copyFrom(piPred);
Thierry Dumas
committed
#if JVET_AJ0249_NEURAL_NETWORK_BASED
m_isObicPredictionSaved = true;
#endif
Distortion sadCost = distParamSad.distFunc(distParamSad);
Distortion minSadHadObic = std::min(sadCost * 2, distParamHad.distFunc(distParamHad));
m_satdCostOBIC = minSadHadObic;
}
if (dimdSaveFlag)
{
cu.obicFlag = false;
int dimdMode = cu.dimdMode;
pu.intraDir[CHANNEL_TYPE_LUMA] = dimdMode;
if (cu.dimdBlending)
{
#if JVET_AH0209_PDP
PelBuf predBuf(m_pdpIntraPredReady[dimdMode]? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
#else
PelBuf predBuf(m_intraPredBuf[dimdMode], tmpArea);
#endif
piPred.copyFrom(predBuf);
#if JVET_AJ0267_ADAPTIVE_HOG
PelBuf predFusion[ DIMD_FUSION_NUM - 2 ];
const UnitArea localUnitArea( pu.chromaFormat, Area( 0, 0, iWidth, iHeight ) );
for( int i = 0; i < DIMD_FUSION_NUM - 2; i++ )
{
predFusion[ i ] = m_tempBuffer[ i + 1 ].getBuf( localUnitArea.Y() );
#if JVET_AH0209_PDP
dimdMode = cu.dimdBlendMode[ i ] > 0 ? cu.dimdBlendMode[ i ] : PLANAR_IDX;
PelBuf predBufTmp( dimdMode && m_pdpIntraPredReady[ dimdMode ] ? m_pdpIntraPredBuf[ dimdMode ] : m_intraPredBuf[ dimdMode ], tmpArea );
#else
PelBuf predBufTmp( ( m_intraPredBuf[ cu.dimdBlendMode[ i ] > 0 ? cu.dimdBlendMode[ i ] : PLANAR_IDX ] ), tmpArea );
#endif
predFusion[ i ].copyFrom( predBufTmp );
}
PelBuf planarBuf( m_intraPredBuf[ PLANAR_IDX ], tmpArea );
generateDimdBlending( piPred, pu, predFusion, planarBuf );
#else
#if JVET_AH0209_PDP
dimdMode = cu.dimdBlendMode[0] > 0 ? cu.dimdBlendMode[0] : PLANAR_IDX;
PelBuf blendBuf0(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
dimdMode = cu.dimdBlendMode[1] > 0 ? cu.dimdBlendMode[1] : PLANAR_IDX;
PelBuf blendBuf1(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
dimdMode = cu.dimdBlendMode[2] > 0 ? cu.dimdBlendMode[2] : PLANAR_IDX;
PelBuf blendBuf2(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
dimdMode = cu.dimdBlendMode[3] > 0 ? cu.dimdBlendMode[3] : PLANAR_IDX;
PelBuf blendBuf3(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], tmpArea);
#else
PelBuf blendBuf0((m_intraPredBuf[cu.dimdBlendMode[0] > 0 ?cu.dimdBlendMode[0] : PLANAR_IDX]), tmpArea);
PelBuf blendBuf1((m_intraPredBuf[cu.dimdBlendMode[1] > 0 ?cu.dimdBlendMode[1] : PLANAR_IDX]), tmpArea);
PelBuf blendBuf2((m_intraPredBuf[cu.dimdBlendMode[2] > 0 ?cu.dimdBlendMode[2] : PLANAR_IDX]), tmpArea);
PelBuf blendBuf3((m_intraPredBuf[cu.dimdBlendMode[3] > 0 ?cu.dimdBlendMode[3] : PLANAR_IDX]), tmpArea);
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], tmpArea);
#endif
generateDimdBlending(piPred, pu, blendBuf0, blendBuf1, blendBuf2, blendBuf3, planarBuf);
}
else
{
initIntraPatternChType(cu, pu.Y(), false);
predIntraAng(COMPONENT_Y, piPred, pu);
}
PelBuf dimdSaveBuf(m_dimdPredBuf, pu.Y());
dimdSaveBuf.copyFrom(piPred);
Thierry Dumas
committed
#if JVET_AJ0249_NEURAL_NETWORK_BASED
m_isDimdPredictionSaved = true;
#endif
Distortion sadCost = distParamSad.distFunc(distParamSad);
Distortion minSadHadDimd = std::min(sadCost * 2, distParamHad.distFunc(distParamHad));
m_satdCostDIMD = minSadHadDimd;
}
}
cu.dimd = false;
cu.obicFlag = false;
#endif
if (!cu.lfnstIdx && !cu.mtsFlag && testMip)
{
// now reduce the candidates
const double thresholdHadCost = 1.0 + 1.4 / sqrt((double) (pu.lwidth() * pu.lheight()));
reduceHadCandList(uiRdModeList, candCostList, numModesForFullRD, thresholdHadCost, mipHadCostStore, pu, fastMip
#if JVET_AB0157_TMRL
, tmrlCostList
#endif
#if JVET_AC0105_DIRECTIONAL_PLANAR
, dirPlanarCostList
Döne Bugdayci Sansli
committed
#endif
#if JVET_AJ0146_TIMDSAD
, (modList ? 1 : 0)
#endif

Karsten Suehring
committed
{
// save found best modes
m_uiSavedNumRdModesLFNST = numModesForFullRD;
m_uiSavedRdModeListLFNST = uiRdModeList;
m_dSavedModeCostLFNST = candCostList;
// PBINTRA fast
m_uiSavedHadModeListLFNST = uiHadModeList;
Bappaditya Ray
committed
m_dSavedHadListLFNST = candHadList;
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
#if JVET_AJ0061_TIMD_MERGE
m_uiSavedRdModeListTimd = timdModes;
m_uiSavedModeCostTimd = timdCosts;
for (int i = numTimdSatd - 1; i >= 0; i--)
{
if(timdModes[i].mRefId > 0)
{
m_uiSavedRdModeListTimd.erase(m_uiSavedRdModeListTimd.begin() + i);
m_uiSavedModeCostTimd.erase(m_uiSavedModeCostTimd.begin() + i);
}
}
ModeInfo m;
for (int i = numModesForFullRD - 1; i >= 0; i--)
{
m = m_uiSavedRdModeListLFNST.at(i);
if (m.modeId == TIMD_IDX && m.mRefId)
{
m_uiSavedRdModeListLFNST.erase(m_uiSavedRdModeListLFNST.begin() + i);
m_dSavedModeCostLFNST.erase(m_dSavedModeCostLFNST.begin() + i);
m_uiSavedNumRdModesLFNST--;
}
}
for (int i = (int)(uiHadModeList.size()) - 1; i >= 0; i--)
{
m = m_uiSavedHadModeListLFNST.at(i);
if (m.modeId == TIMD_IDX && m.mRefId)
{
m_uiSavedHadModeListLFNST.erase(m_uiSavedHadModeListLFNST.begin() + i);
m_dSavedHadListLFNST.erase(m_dSavedHadListLFNST.begin() + i);
}
}
#endif

Karsten Suehring
committed
}
}
else // if( sps.getUseMIP() && LFNSTLoadFlag)
{
// restore saved modes
numModesForFullRD = m_uiSavedNumRdModesLFNST;
uiRdModeList = m_uiSavedRdModeListLFNST;
candCostList = m_dSavedModeCostLFNST;
// PBINTRA fast
uiHadModeList = m_uiSavedHadModeListLFNST;
Bappaditya Ray
committed
candHadList = m_dSavedHadListLFNST;
#if JVET_AJ0061_TIMD_MERGE
timdModes = m_uiSavedRdModeListTimd;
timdCosts = m_uiSavedModeCostTimd;
if (cu.mtsFlag)
{
for (int i = (int)timdModes.size() - 1; i >= 0; i--)
{
if (timdModes[i].modeId == TIMDM_IDX)
{
timdModes.erase(timdModes.begin() + i);
timdCosts.erase(timdCosts.begin() + i);
}
}
}
#endif
#if JVET_AH0076_OBIC && !JVET_AJ0061_TIMD_MERGE
if (obicSaveFlag || dimdSaveFlag)
{
cu.dimd = true;
cu.obicFlag = false;
cu.timd = false;
cu.mipFlag = false;
cu.tmpFlag = false;
cu.tmrlFlag = false;
cu.firstPU->multiRefIdx = 0;
cu.ispMode = NOT_INTRA_SUBPARTITIONS;
int iWidth = cu.lwidth();
int iHeight = cu.lheight();
if (obicSaveFlag)
{
cu.obicFlag = true;
int obicMode = cu.obicMode[0];
pu.intraDir[CHANNEL_TYPE_LUMA] = obicMode;
bool blendModes[OBIC_FUSION_NUM - 1] = {false};
PelBuf predFusion[OBIC_FUSION_NUM - 1];
Bappaditya Ray
committed
#if JVET_AH0209_PDP
CHECK(!m_intraModeReady[obicMode] && !m_pdpIntraPredReady[obicMode], "OBIC mode is not ready!");
#else
CHECK(!m_intraModeReady[obicMode], "OBIC mode is not ready!");
Bappaditya Ray
committed
#endif
const UnitArea localUnitArea( pu.chromaFormat, Area( 0, 0, iWidth, iHeight ) );
Bappaditya Ray
committed
#if JVET_AH0209_PDP
PelBuf predBuf(m_pdpIntraPredReady[obicMode]? m_pdpIntraPredBuf[obicMode]: m_intraPredBuf[obicMode], pu.Y());
#else
PelBuf predBuf(m_intraPredBuf[obicMode], pu.Y());
Bappaditya Ray
committed
#endif
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
piPred.copyFrom(predBuf);
int planarIdx = 0;
for (int idx = 0; idx < OBIC_FUSION_NUM - 1; idx++)
{
blendModes[idx] = false;
predFusion[idx] = m_tempBuffer[idx].getBuf( localUnitArea.Y() );
int iMode = cu.obicMode[idx + 1];
if (iMode >= 0)
{
blendModes[idx] = true;
CHECK(!m_intraModeReady[iMode], "OBIC mode is not ready!");
PelBuf predBufTmp(m_intraPredBuf[iMode], pu.Y());
predFusion[idx].copyFrom(predBufTmp);
if (iMode == PLANAR_IDX)
{
planarIdx = idx;
}
}
else
{
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], pu.Y());
predFusion[idx].copyFrom(planarBuf);
}
}
if (cu.obicIsBlended)
{
generateObicBlending(piPred, pu, predFusion, blendModes, planarIdx);
}
else
{
initIntraPatternChType(cu, pu.Y(), false);
predIntraAng(COMPONENT_Y, piPred, pu);
}
PelBuf obicSaveBuf(m_obicPredBuf, pu.Y());
obicSaveBuf.copyFrom(piPred);
Thierry Dumas
committed
#if JVET_AJ0249_NEURAL_NETWORK_BASED
m_isObicPredictionSaved = true;
#endif
}
if (dimdSaveFlag)
{
cu.obicFlag = false;
int dimdMode = cu.dimdMode;
pu.intraDir[CHANNEL_TYPE_LUMA] = dimdMode;
if (cu.dimdBlending)
{
Bappaditya Ray
committed
#if JVET_AH0209_PDP
PelBuf predBuf(m_pdpIntraPredReady[dimdMode]? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
#else
PelBuf predBuf(m_intraPredBuf[dimdMode], tmpArea);
Bappaditya Ray
committed
#endif
piPred.copyFrom(predBuf);
Alexey Filippov
committed
#if JVET_AJ0267_ADAPTIVE_HOG
PelBuf predFusion[DIMD_FUSION_NUM - 2];
const UnitArea localUnitArea( pu.chromaFormat, Area( 0, 0, iWidth, iHeight ) );
for (int i = 0; i < DIMD_FUSION_NUM - 2; i++)
{
predFusion[i] = m_tempBuffer[i+1].getBuf( localUnitArea.Y() );
#if JVET_AH0209_PDP
dimdMode = cu.dimdBlendMode[i] > 0 ? cu.dimdBlendMode[i] : PLANAR_IDX;
PelBuf predBufTmp(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
#else
PelBuf predBufTmp((m_intraPredBuf[cu.dimdBlendMode[i] > 0 ?cu.dimdBlendMode[i] : PLANAR_IDX]), tmpArea);
#endif
predFusion[i].copyFrom(predBufTmp);
}
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], tmpArea);
generateDimdBlending(piPred, pu, predFusion, planarBuf);
#else
Bappaditya Ray
committed
#if JVET_AH0209_PDP
dimdMode = cu.dimdBlendMode[0] > 0 ? cu.dimdBlendMode[0] : PLANAR_IDX;
PelBuf blendBuf0(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
dimdMode = cu.dimdBlendMode[1] > 0 ? cu.dimdBlendMode[1] : PLANAR_IDX;
PelBuf blendBuf1(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
dimdMode = cu.dimdBlendMode[2] > 0 ? cu.dimdBlendMode[2] : PLANAR_IDX;
PelBuf blendBuf2(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
dimdMode = cu.dimdBlendMode[3] > 0 ? cu.dimdBlendMode[3] : PLANAR_IDX;
PelBuf blendBuf3(dimdMode && m_pdpIntraPredReady[dimdMode] ? m_pdpIntraPredBuf[dimdMode] : m_intraPredBuf[dimdMode], tmpArea);
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], tmpArea);
#else
PelBuf blendBuf0((m_intraPredBuf[cu.dimdBlendMode[0] > 0 ?cu.dimdBlendMode[0] : PLANAR_IDX]), tmpArea);
PelBuf blendBuf1((m_intraPredBuf[cu.dimdBlendMode[1] > 0 ?cu.dimdBlendMode[1] : PLANAR_IDX]), tmpArea);
PelBuf blendBuf2((m_intraPredBuf[cu.dimdBlendMode[2] > 0 ?cu.dimdBlendMode[2] : PLANAR_IDX]), tmpArea);
PelBuf blendBuf3((m_intraPredBuf[cu.dimdBlendMode[3] > 0 ?cu.dimdBlendMode[3] : PLANAR_IDX]), tmpArea);
PelBuf planarBuf(m_intraPredBuf[PLANAR_IDX], tmpArea);
Bappaditya Ray
committed
#endif
generateDimdBlending(piPred, pu, blendBuf0, blendBuf1, blendBuf2, blendBuf3, planarBuf);
Alexey Filippov
committed
#endif
}
else
{
initIntraPatternChType(cu, pu.Y(), false);
predIntraAng(COMPONENT_Y, piPred, pu);
}
PelBuf dimdSaveBuf(m_dimdPredBuf, pu.Y());
dimdSaveBuf.copyFrom(piPred);
Thierry Dumas
committed
#if JVET_AJ0249_NEURAL_NETWORK_BASED
m_isDimdPredictionSaved = true;
#endif
}
}
cu.dimd = false;
cu.obicFlag = false;
#endif
#if JVET_AJ0112_REGRESSION_SGPM
if ((m_pcEncCfg->getUseFastLFNST() && !LFNSTLoadFlag) || !m_pcEncCfg->getUseFastLFNST() || mtsUsageFlag == 0)
#endif
#if JVET_AB0155_SGPM
if (testSgpm)
if (SGPMSaveFlag)
{
m_uiSavedRdModeListSGPM.clear();
m_dSavedModeCostSGPM.clear();
m_uiSavedHadModeListSGPM.clear();
m_dSavedHadListSGPM.clear();
#if JVET_V0130_INTRA_TMP
cu.tmpFlag = false;
pu.multiRefIdx = 0;
cu.mipFlag = false;
Thierry Dumas
committed
#if JVET_AJ0249_NEURAL_NETWORK_BASED
cu.sgpm = true;
#endif
initIntraPatternChType(cu, pu.Y(), true, 0, false);
initIntraPatternChType(cu, pu.Y(), true);
Thierry Dumas
committed
#if JVET_AJ0249_NEURAL_NETWORK_BASED
cu.sgpm = false;
#endif
// get single mode predictions
for (int sgpmIdx = 0; sgpmIdx < SGPM_NUM; sgpmIdx++)
{
int sgpmMode[2];
sgpmMode[0] = sgpmInfoList[sgpmIdx].sgpmMode0;
sgpmMode[1] = sgpmInfoList[sgpmIdx].sgpmMode1;
#if JVET_AG0152_SGPM_ITMP_IBC
Mv sgpmBV[2];
sgpmBV[0] = sgpmInfoList[sgpmIdx].sgpmBv0;
sgpmBV[1] = sgpmInfoList[sgpmIdx].sgpmBv1;
for (int idxIn2 = 0; idxIn2 < 2; idxIn2++)
if (!m_intraModeReady[sgpmMode[idxIn2]])
#if JVET_AG0152_SGPM_ITMP_IBC
if (sgpmMode[idxIn2] >= SGPM_BV_START_IDX)
{
// BV based mode
Mv timdBv = sgpmBV[idxIn2];
Wei Chen
committed
#if JVET_AH0200_INTRA_TMP_BV_REORDER
predUsingBv(piPred.buf, piPred.stride, timdBv, cu, false);
Wei Chen
committed
#else
predUsingBv(piPred.buf, piPred.stride, timdBv, cu);
Wei Chen
committed
#endif
}
else
{
pu.intraDir[0] = sgpmMode[idxIn2];
initPredIntraParams(pu, pu.Y(), sps);
Bappaditya Ray
committed
#if JVET_AH0209_PDP
#if JVET_AK0118_BF_FOR_INTRA_PRED
predIntraAng(COMPONENT_Y, piPred, pu, true, false, false);
#else
predIntraAng(COMPONENT_Y, piPred, pu, false, false);
Bappaditya Ray
committed
#elif JVET_AB0157_INTRA_FUSION
predIntraAng(COMPONENT_Y, piPred, pu, false);
predIntraAng(COMPONENT_Y, piPred, pu);
#if JVET_AG0152_SGPM_ITMP_IBC
PelBuf predBuf(m_intraPredBuf[sgpmMode[idxIn2]], tmpArea);
predBuf.copyFrom(piPred);
m_intraModeReady[sgpmMode[idxIn2]] = 1;
}
cu.sgpm = true;
// frac bits calculate once because all are the same
cu.sgpmIdx = 0;
cu.sgpmSplitDir = sgpmInfoList[0].sgpmSplitDir;
cu.sgpmMode0 = sgpmInfoList[0].sgpmMode0;
cu.sgpmMode1 = sgpmInfoList[0].sgpmMode1;
#if JVET_AG0152_SGPM_ITMP_IBC
cu.sgpmBv0 = sgpmInfoList[0].sgpmBv0;
cu.sgpmBv1 = sgpmInfoList[0].sgpmBv1;
pu.intraDir[0] = cu.sgpmMode0 >= SGPM_BV_START_IDX ? 0 : cu.sgpmMode0;
pu.intraDir1[0] = cu.sgpmMode1 >= SGPM_BV_START_IDX ? 0 : cu.sgpmMode1;
pu.intraDir[0] = cu.sgpmMode0;
pu.intraDir1[0] = cu.sgpmMode1;
#if JVET_AJ0112_REGRESSION_SGPM
cu.blendModel = sgpmInfoList[0].blendModel;
#endif
#if !JVET_AJ0112_REGRESSION_SGPM
loadStartStates();
uint64_t fracModeBits = xFracModeBitsIntra(pu, 0, CHANNEL_TYPE_LUMA);
#endif
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
for (int sgpmIdx = 0; sgpmIdx < SGPM_NUM; sgpmIdx++)
{
int sgpmMode0 = sgpmInfoList[sgpmIdx].sgpmMode0;
int sgpmMode1 = sgpmInfoList[sgpmIdx].sgpmMode1;
PelBuf src0(m_intraPredBuf[sgpmMode0], tmpArea);
PelBuf src1(m_intraPredBuf[sgpmMode1], tmpArea);
#if JVET_AJ0112_REGRESSION_SGPM
cu.sgpmIdx = sgpmIdx;
loadStartStates();
uint64_t fracModeBits = xFracModeBitsIntra(pu, 0, CHANNEL_TYPE_LUMA);
if (sgpmInfoList[sgpmIdx].isRegression)
{
PelUnitBuf pred = PelUnitBuf(pu.chromaFormat, piPred);
PelUnitBuf pred0 = PelUnitBuf(pu.chromaFormat, src0);
PelUnitBuf pred1 = PelUnitBuf(pu.chromaFormat, src1);
m_blendBuf.resize(pu.lwidth() * pu.lheight());
int16_t* blendBuf = m_blendBuf.data();
WeightBuf bufWeight = WeightBuf(blendBuf, pu.lumaSize());
const int geoBlendingLog2WeightBase = 5;
pcInterPred->weightedAffineBlk(pu, bufWeight, geoBlendingLog2WeightBase, sgpmInfoList[sgpmIdx].blendModel);
pcInterPred->weightedBlendBlk(pu, 0, pred, pred0, pred1, bufWeight, geoBlendingLog2WeightBase, false);
}
else
{
#if JVET_AJ0107_GPM_SHAPE_ADAPT
m_if.m_weightedSgpm(pu, width, height, COMPONENT_Y, g_sgpmSplitDir[sgpmInfoList[sgpmIdx].sgpmSplitDir], piPred, src0, src1);
#else
m_if.m_weightedSgpm(pu, width, height, COMPONENT_Y, sgpmInfoList[sgpmIdx].sgpmSplitDir, piPred, src0, src1);
#endif
}
#else
#if JVET_AJ0107_GPM_SHAPE_ADAPT
m_if.m_weightedSgpm(pu, width, height, COMPONENT_Y, g_sgpmSplitDir[sgpmInfoList[sgpmIdx].sgpmSplitDir], piPred, src0, src1);
m_if.m_weightedSgpm(pu, width, height, COMPONENT_Y, sgpmInfoList[sgpmIdx].sgpmSplitDir, piPred, src0, src1);
#endif
PelBuf predBuf(m_sgpmPredBuf[sgpmIdx], tmpArea);
predBuf.copyFrom(piPred);
Distortion minSadHad = 0;
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
Distortion sadCost = distParamSad.distFunc(distParamSad);
minSadHad += std::min(sadCost * 2, distParamHad.distFunc(distParamHad));
#else
minSadHad += std::min(distParamSad.distFunc(distParamSad) * 2, distParamHad.distFunc(distParamHad));
#endif
double cost = (double)minSadHad + (double)fracModeBits * sqrtLambdaForFirstPass;
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
m_bestIntraSADCost = std::min(m_bestIntraSADCost, cost - (double)minSadHad + (double)sadCost);
#endif
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, SGPM_IDX,
#if JVET_V0130_INTRA_TMP
#endif
#if JVET_AD0086_ENHANCED_INTRA_TMP
#if JVET_AG0136_INTRA_TMP_LIC
Wei Chen
committed
#if JVET_AH0200_INTRA_TMP_BV_REORDER
Wei Chen
committed
#endif
true, sgpmInfoList[sgpmIdx].sgpmSplitDir, sgpmInfoList[sgpmIdx].sgpmMode0,
sgpmInfoList[sgpmIdx].sgpmMode1, sgpmIdx
#if JVET_AG0152_SGPM_ITMP_IBC
, sgpmInfoList[sgpmIdx].sgpmBv0, sgpmInfoList[sgpmIdx].sgpmBv1
#if JVET_AJ0112_REGRESSION_SGPM
, sgpmInfoList[sgpmIdx].isRegression, sgpmInfoList[sgpmIdx].blendModel
#endif
),
cost, m_uiSavedRdModeListSGPM, m_dSavedModeCostSGPM, SGPM_NUM);
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, SGPM_IDX,
#if JVET_V0130_INTRA_TMP
#endif
#if JVET_AD0086_ENHANCED_INTRA_TMP
#if JVET_AG0136_INTRA_TMP_LIC
Wei Chen
committed
#if JVET_AH0200_INTRA_TMP_BV_REORDER
Wei Chen
committed
#endif
true, sgpmInfoList[sgpmIdx].sgpmSplitDir, sgpmInfoList[sgpmIdx].sgpmMode0,
sgpmInfoList[sgpmIdx].sgpmMode1, sgpmIdx
#if JVET_AG0152_SGPM_ITMP_IBC
, sgpmInfoList[sgpmIdx].sgpmBv0, sgpmInfoList[sgpmIdx].sgpmBv1
#if JVET_AJ0112_REGRESSION_SGPM
, sgpmInfoList[sgpmIdx].isRegression, sgpmInfoList[sgpmIdx].blendModel
#endif
),
double(minSadHad), m_uiSavedHadModeListSGPM, m_dSavedHadListSGPM, SGPM_NUM);
}
cu.sgpm = false;
}
#if JVET_AJ0112_REGRESSION_SGPM
numModesForFullRD++;
int updateNum = (int)m_uiSavedRdModeListSGPM.size();
#else
int updateNum = std::min<int>((numModesForFullRD + 1) / 2, (int)m_uiSavedRdModeListSGPM.size());
#endif
for (auto listIdx = 0; listIdx < updateNum; listIdx++)
{
updateCandList(m_uiSavedRdModeListSGPM[listIdx], m_dSavedModeCostSGPM[listIdx], uiRdModeList,
candCostList, numModesForFullRD);
updateCandList(m_uiSavedHadModeListSGPM[listIdx], m_dSavedHadListSGPM[listIdx], uiHadModeList,
candHadList, numHadCand);
}
Döne Bugdayci Sansli
committed
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
#if JVET_AJ0146_TIMDSAD
cu.timd = false;
cu.timdSad = false;
#if !JVET_AJ0061_TIMD_MERGE
if (testTimd)
{
if (timdSaveFlag)
{
cu.timdSad = false;
cu.timd = true;
cu.dimd = false;
cu.mipFlag = false;
cu.tmpFlag = false;
cu.tmrlFlag = false;
cu.sgpm = false;
cu.eipFlag = false;
cu.firstPU->multiRefIdx = 0;
cu.ispMode = NOT_INTRA_SUBPARTITIONS;
cu.firstPU->intraDir[CHANNEL_TYPE_LUMA] = cu.timdMode;
initIntraPatternChType(cu, pu.Y());
predIntraAng(COMPONENT_Y, piPred, pu);
PelBuf timdSaveBuf(m_timdPredBuf, pu.Y());
timdSaveBuf.copyFrom(piPred);
}
cu.timd = false;
cu.timdSad = false;
}
#endif
if (testTimdSad)
{
#if JVET_AJ0061_TIMD_MERGE
cu.timdMrg = false;
#endif
cu.timdSad = true;
cu.timd = true;
if (timdSadSaveFlag)
{
cu.dimd = false;
cu.mipFlag = false;
cu.tmpFlag = false;
cu.tmrlFlag = false;
cu.sgpm = false;
cu.eipFlag = false;
cu.firstPU->multiRefIdx = 0;
cu.ispMode = NOT_INTRA_SUBPARTITIONS;
cu.firstPU->intraDir[CHANNEL_TYPE_LUMA] = cu.timdModeSad;
initIntraPatternChType(cu, pu.Y());
predIntraAng(COMPONENT_Y, piPred, pu);
PelBuf timdSadSaveBuf(m_timdSadPredBuf, pu.Y());
timdSadSaveBuf.copyFrom(piPred);
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
Distortion sadCost = distParamSad.distFunc(distParamSad);
Distortion minSadHad = sadCost * 2;
#else
Distortion minSadHad = std::min(distParamSad.distFunc(distParamSad) * 2, distParamHad.distFunc(distParamHad));
#endif
loadStartStates();
uint64_t fracModeBits = xFracModeBitsIntra(pu, cu.timdModeSad, CHANNEL_TYPE_LUMA);
double cost = double(minSadHad) + double(fracModeBits) * sqrtLambdaForFirstPass;
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
m_bestIntraSADCost = std::min(m_bestIntraSADCost, cost - (double)minSadHad + (double)sadCost);
#endif
m_dSavedRDCostTimdSad = cost;
m_dSavedHadTimdSad = double(minSadHad);
}
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, TIMDSAD_IDX), m_dSavedRDCostTimdSad, uiRdModeList,
candCostList, numModesForFullRD
#if JVET_AJ0061_TIMD_MERGE
+1
#endif
);
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, TIMDSAD_IDX), m_dSavedHadTimdSad, uiHadModeList, candHadList, numHadCand);
cu.timd = false;
cu.timdSad = false;
}
#endif
Myungoh Hong
committed
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
#if JVET_AK0059_MDIP
numModesForFullRD = int(uiRdModeList.size());
if (testMdip)
{
if (mdipSaveFlag)
{
uint32_t uiMode = cu.mdipMode;
cu.mdip = true;
cu.dimd = false;
cu.obicFlag = false;
cu.timd = false;
cu.sgpm = false;
cu.ispMode = 0;
cu.tmpFlag = false;
cu.tmrlFlag = false;
pu.multiRefIdx = 0;
cu.mipFlag = false;
cu.eipFlag = false;
pu.intraDir[0] = uiMode;
Distortion sadCost;
Distortion minSadHad;
#if JVET_AH0209_PDP
const int sizeKey = (area.width << 8) + area.height;
const int sizeIdx = g_size.find(sizeKey) != g_size.end() ? g_size[sizeKey] : -1;
bool isPDPMode = sizeIdx >= 0 && !pu.cu->ispMode && pu.cu->cs->sps->getUsePDP();
if (isPDPMode)
{
const int m = sizeIdx > 12 ? 2 : 0;
const int s = sizeIdx > 12 ? 4 : 2;
isPDPMode &= (g_pdpFilters[uiMode][sizeIdx] && !(uiMode > 1 && (uiMode % s != m)));
}
isPDPMode &= m_refAvailable;
if(isPDPMode)
{
sadCost = (Distortion)m_dSavedSadPdp;
minSadHad = (Distortion)m_dSavedSadHadPdp;
}
else
{
#endif
initIntraPatternChType(cu, area, false, 0, true, !isPDPMode, isPDPMode);
predIntraAng(COMPONENT_Y, piPred, pu);
if (mdipNeededMode[uiMode])
{
PelBuf predBuf(m_mdipPredBuf, tmpArea);
predBuf.copyFrom(piPred);
}
// Use the min between SAD and SATD as the cost criterion
// SAD is scaled by 2 to align with the scaling of HAD
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
sadCost = distParamSad.distFunc(distParamSad);
minSadHad = std::min(sadCost * 2, distParamHad.distFunc(distParamHad));
#else
minSadHad =
std::min(distParamSad.distFunc(distParamSad) * 2, distParamHad.distFunc(distParamHad));
#endif
#if JVET_AH0209_PDP
}
#endif
loadStartStates();
uint64_t fracModeBits = xFracModeBitsIntra(pu, pu.intraDir[0], CHANNEL_TYPE_LUMA);
double cost = (double) minSadHad + (double) fracModeBits * sqrtLambdaForFirstPass;
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
m_bestIntraSADCost = std::min(m_bestIntraSADCost, cost - (double)minSadHad + (double)sadCost);
#endif
m_dSavedSadHadRdCostMdip = cost;
m_dSavedSadHadMdip = double(minSadHad);
cu.mdip = false;
}
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, MDIP_IDX), m_dSavedSadHadRdCostMdip, uiRdModeList,
candCostList, numModesForFullRD);
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, MDIP_IDX), m_dSavedSadHadMdip, uiHadModeList, candHadList, numHadCand);
}
#endif
Thierry Dumas
committed
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
#if JVET_AH0076_OBIC && JVET_AJ0249_NEURAL_NETWORK_BASED
if (testObic && isNnIn)
{
PelBuf obicSaveBuf(m_obicPredBuf, pu.Y());
CHECK(!m_isObicPredictionSaved, "A prediction buffer for OBIC is not saved before loading.");
piPred.copyFrom(obicSaveBuf);
cu.dimd = true;
cu.obicFlag = true;
cu.tmpFlag = false;
cu.mipFlag = false;
cu.sgpm = false;
pu.multiRefIdx = 0;
const uint32_t uiMode = cu.obicMode[0];
pu.intraDir[CHANNEL_TYPE_LUMA] = uiMode;
CHECK(!m_intraModeReady[uiMode], "`m_intraModeReady[uiMode]` is false.");
const Distortion sadCost = distParamSad.distFunc(distParamSad);
const Distortion minSadHad = std::min(sadCost * 2, distParamHad.distFunc(distParamHad));
loadStartStates();
const uint64_t fracModeBits = xFracModeBitsIntra(pu, uiMode, CHANNEL_TYPE_LUMA);
const double cost = (double)minSadHad + (double)fracModeBits * sqrtLambdaForFirstPass;
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
m_bestIntraSADCost = std::min(m_bestIntraSADCost, cost - (double)minSadHad + (double)sadCost);
#endif
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, OBIC_IDX), cost, uiRdModeList, candCostList, numModesForFullRD);
updateCandList(ModeInfo(false, false, 0, NOT_INTRA_SUBPARTITIONS, OBIC_IDX), double(minSadHad), uiHadModeList, candHadList, numHadCand);
cu.dimd = false;
cu.obicFlag = false;
}
#endif
Döne Bugdayci Sansli
committed
#if JVET_AG0058_EIP
{
if (eipSaveFlag)
{
m_uiSavedRdModeListEip.clear();
m_uiSavedHadModeListEip.clear();
m_dSavedModeCostEip.clear();
m_dSavedHadListEip.clear();
m_encBestEipCost = MAX_DOUBLE;
cu.eipMmFlag = false;
m_numSigEip = 0;
cu.tmpFlag = false;
cu.mipFlag = false;
cu.sgpm = false;
pu.multiRefIdx = 0;
cu.eipFlag = true;
cu.eipMerge = false;
initEipParams(pu, COMPONENT_Y);
static_vector<EipModelCandidate, NUM_DERIVED_EIP> eipModelCandList;
static_vector<EipModelCandidate, MAX_MERGE_EIP> eipMergeCandList;
getCurEipCands(pu, eipModelCandList);
getNeiEipCands(pu, eipMergeCandList);
reorderEipCands(pu, eipMergeCandList);
const int numRdEIP = std::max(NUM_EIP_MERGE_SIGNAL + NUM_DERIVED_EIP, (numModesForFullRD + 1) / 2);
for (int mergeFlag = 0; mergeFlag < 2; mergeFlag++)
{
cu.eipMerge = bool(mergeFlag);
for (int i = 0; i < (cu.eipMerge ? eipMergeCandList.size() : eipModelCandList.size()); i++)
pu.intraDir[0] = i;
#if JVET_AJ0082_MM_EIP
cu.eipMmFlag = (!cu.eipMerge) && (i >= m_numSigEip);
if (cu.eipMmFlag)
{
pu.intraDir[0] -= m_numSigEip;
}
cu.eipModel = cu.eipMerge ? eipMergeCandList[i] : eipModelCandList[i];
if (cu.eipMerge)
{
m_eipMergeModel[i] = cu.eipModel;
m_eipMergeModel[i].eipDimdMode = -1;
#if JVET_AK0217_INTRA_MTSS || JVET_AK0187_IMPLICIT_MTS_LUT_EXTENSION
m_eipMergeModel[i].eipDimdMode2nd = -1;
}
else
{
m_eipModel[i] = cu.eipModel;
}
eipPred(pu, piPred);
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
Distortion sadCost = distParamSad.distFunc(distParamSad);
Distortion minSadHad = std::min(sadCost * 2, distParamHad.distFunc(distParamHad));
#else
Distortion minSadHad = std::min(distParamSad.distFunc(distParamSad) * 2, distParamHad.distFunc(distParamHad));
#endif
loadStartStates();
uint64_t fracModeBits = xFracModeBitsIntra(pu, pu.intraDir[0], CHANNEL_TYPE_LUMA);
uint64_t fracModeBits = xFracModeBitsIntra(pu, i, CHANNEL_TYPE_LUMA);
double cost = double(minSadHad) + double(fracModeBits) * sqrtLambdaForFirstPass;
#if JVET_AD0208_IBC_ADAPT_FOR_CAM_CAPTURED_CONTENTS
m_bestIntraSADCost = std::min(m_bestIntraSADCost, cost - (double)minSadHad + (double)sadCost);
#endif
ModeInfo modeInfo(false, cu.eipMerge, 0, NOT_INTRA_SUBPARTITIONS, EIP_IDX + i);
PelBuf eipSaveBuf(cu.eipMerge ? m_eipMergePredBuf[i] : m_eipPredBuf[i], pu.Y());
eipSaveBuf.copyFrom(piPred);
if (!cu.eipModel.bMm && cost < m_encBestEipCost)
{
m_encBestEipCost = cost;
}
updateCandList(modeInfo, cost, m_uiSavedRdModeListEip, m_dSavedModeCostEip, numRdEIP);
updateCandList(modeInfo, double(minSadHad * 0.8), m_uiSavedHadModeListEip, m_dSavedHadListEip, numRdEIP);
}
}
for (const auto& modeInfo : m_uiSavedRdModeListEip)
CHECK(modeInfo.modeId < EIP_IDX || modeInfo.modeId >= EIP_IDX + std::max(NUM_DERIVED_EIP, MAX_MERGE_EIP), "A non-EIP mode is in EIP mode list")
const auto modeIdx = modeInfo.modeId - EIP_IDX;
if (modeInfo.mipTrFlg)
{
PelBuf eipSaveBuf(m_eipMergePredBuf[modeIdx], pu.Y());
#if JVET_AI0050_INTER_MTSS
int secondDimdIntraDir = 0;
m_eipMergeModel[modeIdx].eipDimdMode = deriveIpmForTransform(eipSaveBuf, cu
#if JVET_AI0050_INTER_MTSS
, secondDimdIntraDir
#if JVET_AI0050_INTER_MTSS
cu.dimdDerivedIntraDir2nd = secondDimdIntraDir;
#endif
#if JVET_AK0217_INTRA_MTSS
m_eipMergeModel[modeIdx].eipDimdMode2nd = secondDimdIntraDir;
CHECK(modeIdx >= NUM_EIP_MERGE_SIGNAL, "modeIdx >= NUM_EIP_MERGE_SIGNAL");
}
else
{
PelBuf eipSaveBuf(m_eipPredBuf[modeIdx], pu.Y());
#if JVET_AI0050_INTER_MTSS
int secondDimdIntraDir = 0;
m_eipModel[modeIdx].eipDimdMode = deriveIpmForTransform(eipSaveBuf, cu
#if JVET_AI0050_INTER_MTSS
, secondDimdIntraDir
#if JVET_AI0050_INTER_MTSS
cu.dimdDerivedIntraDir2nd = secondDimdIntraDir;
#endif
#if JVET_AK0217_INTRA_MTSS
m_eipModel[modeIdx].eipDimdMode2nd = secondDimdIntraDir;
CHECK(modeIdx >= NUM_DERIVED_EIP, "modeIdx >= NUM_DERIVED_EIP");
}
}
#endif
#if JVET_AJ0082_MM_EIP
if (m_dSavedModeCostEip.size() > 0)
{
isEipModeTested = true;
eipBestSatdCost = m_dSavedModeCostEip[0];
}
cu.eipFlag = false;
cu.eipMerge = false;
cu.eipMmFlag = false;
}
for (auto i = 0; i < m_uiSavedRdModeListEip.size(); i++)
{
updateCandList(m_uiSavedRdModeListEip[i], m_dSavedModeCostEip[i], uiRdModeList, candCostList, numModesForFullRD);
updateCandList(m_uiSavedHadModeListEip[i], m_dSavedHadListEip[i], uiHadModeList, candHadList, numHadCand);
}
int numEip = 0;
for (int i = 0; i < numModesForFullRD - 1; i++)
{
bool isEip = (uiRdModeList[i].modeId >= EIP_IDX && uiRdModeList[i].modeId < EIP_IDX + std::max(NUM_DERIVED_EIP, MAX_MERGE_EIP));
numEip += (isEip ? 1 : 0);
}
int numNonEip = numModesForFullRD - numEip;
int lastModeId = uiRdModeList[numModesForFullRD - 1].modeId;
bool lastModeIsEip = (lastModeId >= EIP_IDX && lastModeId < EIP_IDX + std::max(NUM_DERIVED_EIP, MAX_MERGE_EIP));
bool reduceRD = m_dSavedModeCostEip.size() ? (pu.Y().area() < 256) && (m_encBestEipCost < candCostList[numModesForFullRD - 1]) && (lastModeIsEip || (numNonEip > 1)) : false;
if (reduceRD && m_pcEncCfg->getIntraPeriod() == 1)
bool reduceRD = m_dSavedModeCostEip.size() ? (pu.Y().area() < 256) && (m_dSavedModeCostEip[0] < candCostList[numModesForFullRD - 1]) && (lastModeIsEip || (numNonEip > 1)) : false;
if (reduceRD && pu.cs->slice->isIntra())
{
uiRdModeList.pop_back();
candCostList.pop_back();
numModesForFullRD = int(uiRdModeList.size());
}
}
#endif
#if JVET_AE0169_BIPREDICTIVE_IBC
m_bestIntraSADHADCost = candCostList[numModesForFullRD - 1];
Wei Chen
committed
#if JVET_AH0200_INTRA_TMP_BV_REORDER
if (isTmpModeTestd)
#if JVET_AI0136_ADAPTIVE_DUAL_TREE
if (relatedCU && !relatedCU->skipFracTmp && (tmpBestSatdCost > m_bestIntraSADHADCost * TMP_ENC_REFINE_THRESHOLD))
{
relatedCU->skipFracTmp = true;
}
if (!relatedCU.skipFracTmp && (tmpBestSatdCost > m_bestIntraSADHADCost * TMP_ENC_REFINE_THRESHOLD))
{
relatedCU.skipFracTmp = true;
}
#endif
Vadim Seregin
committed
}
Wei Chen
committed
#endif
if (isEipModeTested && m_pcEncCfg->getIntraPeriod() == 1)
#if JVET_AI0136_ADAPTIVE_DUAL_TREE
if (relatedCU && !relatedCU->skipEip && (eipBestSatdCost > m_bestIntraSADHADCost * ENC_EIP_SAD_CHK_RATE))
{
relatedCU->skipEip = true;
}
if (!relatedCU.skipEip && (eipBestSatdCost > m_bestIntraSADHADCost * ENC_EIP_SAD_CHK_RATE))
{
relatedCU.skipEip = true;
}
Döne Bugdayci Sansli
committed
#endif
#if JVET_AJ0146_TIMDSAD
Vadim Seregin
committed
if (modList)
Döne Bugdayci Sansli
committed
{
Vadim Seregin
committed
if((testTimdSad && uiRdModeList[numModesForFullRD - 1].modeId == TIMDSAD_IDX) || (candCostList[numModesForFullRD - 1] > candCostList[0] * 1.015))
{
numModesForFullRD--;
uiRdModeList.pop_back();
candCostList.pop_back();
}
Döne Bugdayci Sansli
committed
}
Myungoh Hong
committed
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
#endif
#if JVET_AK0059_MDIP
cu.mdip = false;
if (testMdip)
{
bool mdipIncluded = false;
ModeInfo mdipCandidate( false, false, 0, NOT_INTRA_SUBPARTITIONS, MDIP_IDX);
for(int j = 0; j < numModesForFullRD; j++)
{
mdipIncluded |= (mdipCandidate == uiRdModeList[j]);
}
const double thresholdMdip = 1.5;
if(!mdipIncluded)
{
if(m_dSavedSadHadRdCostMdip < candCostList[0] * thresholdMdip)
{
numModesForFullRD++;
uiRdModeList.push_back(mdipCandidate);
candCostList.push_back(0);
}
}
}
if (m_pcEncCfg->getFastUDIUseMPMEnabled())
{
auto uiPreds = m_intraMPM;
const int numMPMs = NUM_MOST_PROBABLE_MODES;
unsigned uiPreds[numMPMs];
pu.multiRefIdx = 0;
cu.tmrlFlag = false;;
int numCand = m_mpmListSize;
Thierry Dumas
committed
#if !JVET_AJ0249_NEURAL_NETWORK_BASED
numCand = (numCand > 2) ? 2 : numCand;
Thierry Dumas
committed
#endif
const int numCand = PU::getIntraMPMs(pu, uiPreds);