Changeset 302 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 28 Jun 2013, 00:40:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r282 r302 1410 1410 1411 1411 #if HHI_RQT_INTRA_SPEEDUP 1412 #if L0232_RD_PENALTY1413 1412 Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1414 1413 Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE); … … 1427 1426 } 1428 1427 if( bCheckFirst && noSplitIntraMaxTuSize ) 1428 { 1429 bCheckSplit = false; 1430 } 1429 1431 #else 1430 if( bCheckFirst && bCheckFull )1431 #endif1432 {1433 bCheckSplit = false;1434 }1435 #else1436 #if L0232_RD_PENALTY1437 1432 Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1438 1433 Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE); … … 1442 1437 bCheckFull = ( uiLog2TrSize <= min(maxTuSize,4)); 1443 1438 } 1444 #endif1445 1439 #endif 1446 1440 Double dSingleCost = MAX_DOUBLE; … … 1617 1611 //----- determine rate and r-d cost ----- 1618 1612 UInt uiSingleBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false ); 1619 #if L0232_RD_PENALTY1620 1613 if(m_pcEncCfg->getRDpenalty() && (uiLog2TrSize==5) && !isIntraSlice) 1621 1614 { 1622 1615 uiSingleBits=uiSingleBits*4; 1623 1616 } 1624 #endif1625 1617 dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDistY + uiSingleDistC ); 1626 1618 } … … 3096 3088 Int iHeight = 0; 3097 3089 3098 #if 0 //REF_IDX_FRAMEWORK // HM bug fix3099 for( UInt uiMergeCand = 0; uiMergeCand < pcCU->getSlice()->getMaxNumMergeCand(); ++uiMergeCand )3100 {3101 uhInterDirNeighbours[uiMergeCand] = 0;3102 cMvFieldNeighbours[0 + 2*uiMergeCand].setMvField(TComMv(), NOT_VALID);3103 cMvFieldNeighbours[1 + 2*uiMergeCand].setMvField(TComMv(), NOT_VALID);3104 }3105 #endif3106 3090 pcCU->getPartIndexAndSize( iPUIdx, uiAbsPartIdx, iWidth, iHeight ); 3107 3091 UInt uiDepth = pcCU->getDepth( uiAbsPartIdx ); … … 3280 3264 UInt uiBitsTempL0[MAX_NUM_REF]; 3281 3265 3282 #if L0034_COMBINED_LIST_CLEANUP3283 3266 TComMv mvValidList1; 3284 3267 Int refIdxValidList1 = 0; 3285 3268 UInt bitsValidList1 = MAX_UINT; 3286 3269 UInt costValidList1 = MAX_UINT; 3287 #endif3288 3270 3289 3271 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); … … 3349 3331 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3350 3332 #if ZERO_MVD_EST 3351 #if L0034_COMBINED_LIST_CLEANUP3352 3333 if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 ) 3353 #else3354 if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) &&3355 (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0))3356 #endif3357 3334 { 3358 3335 uiZeroMvdBitsTemp = uiBitsTemp; … … 3374 3351 3375 3352 #if GPB_SIMPLE_UNI 3376 #if L0034_COMBINED_LIST_CLEANUP3377 3353 if ( iRefList == 1 ) // list 1 3378 3354 { … … 3399 3375 } 3400 3376 #else 3401 if ( pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0)3402 {3403 if ( iRefList && ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag() && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)>=0 ) ) )3404 {3405 if ( pcCU->getSlice()->getNoBackPredFlag() )3406 {3407 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];3408 uiCostTemp = uiCostTempL0[iRefIdxTemp];3409 /*first subtract the bit-rate part of the cost of the other list*/3410 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[iRefIdxTemp] );3411 }3412 else3413 {3414 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];3415 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];3416 /*first subtract the bit-rate part of the cost of the other list*/3417 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] );3418 }3419 /*correct the bit-rate part of the current ref*/3420 m_pcRdCost->setPredictor ( cMvPred[iRefList][iRefIdxTemp] );3421 uiBitsTemp += m_pcRdCost->getBits( cMvTemp[1][iRefIdxTemp].getHor(), cMvTemp[1][iRefIdxTemp].getVer() );3422 /*calculate the correct cost*/3423 uiCostTemp += m_pcRdCost->getCost( uiBitsTemp );3424 }3425 else3426 {3427 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3428 }3429 }3430 else3431 {3432 if (iRefList && pcCU->getSlice()->getNoBackPredFlag())3433 {3434 uiCostTemp = MAX_UINT;3435 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];3436 }3437 else3438 {3439 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3440 }3441 }3442 #endif3443 #else3444 3377 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3445 3378 #endif … … 3447 3380 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3448 3381 3449 #if L0034_COMBINED_LIST_CLEANUP3450 3382 if ( iRefList == 0 ) 3451 3383 { … … 3472 3404 refIdxValidList1 = iRefIdxTemp; 3473 3405 } 3474 #else3475 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())3476 {3477 if(iRefList==REF_PIC_LIST_0)3478 {3479 uiCostTempL0[iRefIdxTemp] = uiCostTemp;3480 uiBitsTempL0[iRefIdxTemp] = uiBitsTemp;3481 if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_0, iRefIdxTemp)<0)3482 {3483 uiCostTemp = MAX_UINT;3484 }3485 }3486 else3487 {3488 if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_1, iRefIdxTemp)<0)3489 {3490 uiCostTemp = MAX_UINT;3491 }3492 }3493 }3494 3495 #if ENCODER_BUGFIX3496 if ( ( iRefList == 0 && uiCostTemp < uiCost[iRefList] ) ||3497 ( iRefList == 1 && pcCU->getSlice()->getNoBackPredFlag() && iRefIdxTemp == iRefIdx[0] ) ||3498 ( iRefList == 1 && !pcCU->getSlice()->getNoBackPredFlag() && uiCostTemp < uiCost[iRefList] ) )3499 #else3500 if ( ( iRefList == 0 && uiCostTemp < uiCost[iRefList] ) ||3501 ( iRefList == 1 && pcCU->getSlice()->getNoBackPredFlag() && iRefIdxTemp == iRefIdx[0] ) ||3502 ( iRefList == 1 && (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0) && (iRefIdxTemp==0 || iRefIdxTemp == iRefIdx[0]) && !pcCU->getSlice()->getNoBackPredFlag() && (iRefIdxTemp == pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)) ) ||3503 ( iRefList == 1 && !pcCU->getSlice()->getNoBackPredFlag() && uiCostTemp < uiCost[iRefList] ) )3504 #endif3505 {3506 uiCost[iRefList] = uiCostTemp;3507 uiBits[iRefList] = uiBitsTemp; // storing for bi-prediction3508 3509 // set motion3510 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp];3511 iRefIdx[iRefList] = iRefIdxTemp;3512 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3513 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3514 3515 if(!pcCU->getSlice()->getMvdL1ZeroFlag())3516 {3517 // storing list 1 prediction signal for iterative bi-directional prediction3518 if ( eRefPicList == REF_PIC_LIST_1 )3519 {3520 TComYuv* pcYuvPred = &m_acYuvPred[iRefList];3521 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );3522 }3523 if ( (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) && eRefPicList == REF_PIC_LIST_0 )3524 {3525 TComYuv* pcYuvPred = &m_acYuvPred[iRefList];3526 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );3527 }3528 }3529 }3530 #endif3531 3406 } 3532 3407 } … … 3596 3471 3597 3472 Int iRefList = iIter % 2; 3598 #if L0034_COMBINED_LIST_CLEANUP3599 3473 if ( m_pcEncCfg->getUseFastEnc() ) 3600 3474 { … … 3619 3493 motionCompensation ( pcCU, pcYuvPred, RefPicList(1-iRefList), iPartIdx ); 3620 3494 } 3621 #else3622 if ( m_pcEncCfg->getUseFastEnc() && (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) )3623 {3624 iRefList = 1;3625 }3626 #endif3627 3495 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 3628 3496 … … 3785 3653 UInt uiMEBits = 0; 3786 3654 // Set Motion Field_ 3787 #if L0034_COMBINED_LIST_CLEANUP3788 3655 cMv[1] = mvValidList1; 3789 3656 iRefIdx[1] = refIdxValidList1; 3790 3657 uiBits[1] = bitsValidList1; 3791 3658 uiCost[1] = costValidList1; 3792 #else3793 if ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 ) )3794 {3795 uiCost[1] = MAX_UINT;3796 }3797 #endif3798 3659 #if AMP_MRG 3799 3660 if (bTestNormalMC)
Note: See TracChangeset for help on using the changeset viewer.