Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 23 May 2013, 15:40:36 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r362 r438 3209 3209 UInt uiBitsTempL0[MAX_NUM_REF]; 3210 3210 3211 #if L0034_COMBINED_LIST_CLEANUP3212 TComMv mvValidList1;3213 Int refIdxValidList1 = 0;3214 UInt bitsValidList1 = MAX_UINT;3215 UInt costValidList1 = MAX_UINT;3216 #endif3217 3218 3211 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 3219 3212 … … 3262 3255 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3263 3256 #if ZERO_MVD_EST 3264 #if L0034_COMBINED_LIST_CLEANUP3265 if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 )3266 #else3267 3257 if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) && 3268 3258 (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0)) 3269 #endif3270 3259 { 3271 3260 uiZeroMvdBitsTemp = uiBitsTemp; … … 3287 3276 3288 3277 #if GPB_SIMPLE_UNI 3289 #if L0034_COMBINED_LIST_CLEANUP3290 if ( iRefList == 1 ) // list 13291 {3292 if ( pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) >= 0 )3293 {3294 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp )];3295 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp )];3296 /*first subtract the bit-rate part of the cost of the other list*/3297 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp )] );3298 /*correct the bit-rate part of the current ref*/3299 m_pcRdCost->setPredictor ( cMvPred[iRefList][iRefIdxTemp] );3300 uiBitsTemp += m_pcRdCost->getBits( cMvTemp[1][iRefIdxTemp].getHor(), cMvTemp[1][iRefIdxTemp].getVer() );3301 /*calculate the correct cost*/3302 uiCostTemp += m_pcRdCost->getCost( uiBitsTemp );3303 }3304 else3305 {3306 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3307 }3308 }3309 else3310 {3311 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3312 }3313 #else3314 3278 if ( pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0) 3315 3279 { … … 3353 3317 } 3354 3318 } 3355 #endif3356 3319 #else 3357 3320 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); … … 3360 3323 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3361 3324 3362 #if L0034_COMBINED_LIST_CLEANUP3363 if ( iRefList == 0 )3364 {3365 uiCostTempL0[iRefIdxTemp] = uiCostTemp;3366 uiBitsTempL0[iRefIdxTemp] = uiBitsTemp;3367 }3368 if ( uiCostTemp < uiCost[iRefList] )3369 {3370 uiCost[iRefList] = uiCostTemp;3371 uiBits[iRefList] = uiBitsTemp; // storing for bi-prediction3372 3373 // set motion3374 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp];3375 iRefIdx[iRefList] = iRefIdxTemp;3376 }3377 3378 if ( iRefList == 1 && uiCostTemp < costValidList1 && pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 )3379 {3380 costValidList1 = uiCostTemp;3381 bitsValidList1 = uiBitsTemp;3382 3383 // set motion3384 mvValidList1 = cMvTemp[iRefList][iRefIdxTemp];3385 refIdxValidList1 = iRefIdxTemp;3386 }3387 #else3388 3325 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag()) 3389 3326 { … … 3435 3372 } 3436 3373 } 3437 #endif3438 3374 } 3439 3375 } … … 3499 3435 3500 3436 Int iRefList = iIter % 2; 3501 #if L0034_COMBINED_LIST_CLEANUP3502 if ( m_pcEncCfg->getUseFastEnc() )3503 {3504 if( uiCost[0] <= uiCost[1] )3505 {3506 iRefList = 1;3507 }3508 else3509 {3510 iRefList = 0;3511 }3512 }3513 else if ( iIter == 0 )3514 {3515 iRefList = 0;3516 }3517 if ( iIter == 0 && !pcCU->getSlice()->getMvdL1ZeroFlag())3518 {3519 pcCU->getCUMvField(RefPicList(1-iRefList))->setAllMv( cMv[1-iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3520 pcCU->getCUMvField(RefPicList(1-iRefList))->setAllRefIdx( iRefIdx[1-iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3521 TComYuv* pcYuvPred = &m_acYuvPred[1-iRefList];3522 motionCompensation ( pcCU, pcYuvPred, RefPicList(1-iRefList), iPartIdx );3523 }3524 #else3525 3437 if ( m_pcEncCfg->getUseFastEnc() && (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) ) 3526 3438 { 3527 3439 iRefList = 1; 3528 3440 } 3529 #endif3530 3441 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 3531 3442 … … 3662 3573 UInt uiMEBits = 0; 3663 3574 // Set Motion Field_ 3664 #if L0034_COMBINED_LIST_CLEANUP3665 cMv[1] = mvValidList1;3666 iRefIdx[1] = refIdxValidList1;3667 uiBits[1] = bitsValidList1;3668 uiCost[1] = costValidList1;3669 #else3670 3575 if ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 ) ) 3671 3576 { 3672 3577 uiCost[1] = MAX_UINT; 3673 3578 } 3674 #endif3675 3579 #if AMP_MRG 3676 3580 if (bTestNormalMC) … … 4618 4522 while( pcCU->getWidth(0) > (pcCU->getSlice()->getSPS()->getMaxTrSize()<<uiTrLevel) ) uiTrLevel++; 4619 4523 } 4620 UInt uiMaxTrMode = 1+ uiTrLevel;4524 UInt uiMaxTrMode = pcCU->getSlice()->getSPS()->getMaxTrDepth() + uiTrLevel; 4621 4525 4622 4526 while((uiWidth>>uiMaxTrMode) < (g_uiMaxCUWidth>>g_uiMaxCUDepth)) uiMaxTrMode--;
Note: See TracChangeset for help on using the changeset viewer.