Ignore:
Timestamp:
28 Jun 2013, 00:40:00 (11 years ago)
Author:
seregin
Message:

update to HM11.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r282 r302  
    14101410 
    14111411#if HHI_RQT_INTRA_SPEEDUP
    1412 #if L0232_RD_PENALTY
    14131412  Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
    14141413  Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE);
     
    14271426  }
    14281427  if( bCheckFirst && noSplitIntraMaxTuSize )
     1428  {
     1429    bCheckSplit = false;
     1430  }
    14291431#else
    1430   if( bCheckFirst && bCheckFull )
    1431 #endif
    1432   {
    1433     bCheckSplit = false;
    1434   }
    1435 #else
    1436 #if L0232_RD_PENALTY
    14371432  Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
    14381433  Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE);
     
    14421437    bCheckFull    = ( uiLog2TrSize  <= min(maxTuSize,4));
    14431438  }
    1444 #endif
    14451439#endif
    14461440  Double  dSingleCost   = MAX_DOUBLE;
     
    16171611      //----- determine rate and r-d cost -----
    16181612      UInt uiSingleBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false );
    1619 #if L0232_RD_PENALTY
    16201613      if(m_pcEncCfg->getRDpenalty() && (uiLog2TrSize==5) && !isIntraSlice)
    16211614      {
    16221615        uiSingleBits=uiSingleBits*4;
    16231616      }
    1624 #endif
    16251617      dSingleCost       = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDistY + uiSingleDistC );
    16261618    }
     
    30963088  Int iHeight = 0;
    30973089
    3098 #if 0 //REF_IDX_FRAMEWORK  // HM bug fix
    3099   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 #endif
    31063090  pcCU->getPartIndexAndSize( iPUIdx, uiAbsPartIdx, iWidth, iHeight );
    31073091  UInt uiDepth = pcCU->getDepth( uiAbsPartIdx );
     
    32803264    UInt          uiBitsTempL0[MAX_NUM_REF];
    32813265
    3282 #if L0034_COMBINED_LIST_CLEANUP
    32833266    TComMv        mvValidList1;
    32843267    Int           refIdxValidList1 = 0;
    32853268    UInt          bitsValidList1 = MAX_UINT;
    32863269    UInt          costValidList1 = MAX_UINT;
    3287 #endif
    32883270
    32893271    xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits);
     
    33493331        uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    33503332#if ZERO_MVD_EST
    3351 #if L0034_COMBINED_LIST_CLEANUP
    33523333        if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 )
    3353 #else
    3354         if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) &&
    3355             (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0))
    3356 #endif
    33573334        {
    33583335          uiZeroMvdBitsTemp = uiBitsTemp;
     
    33743351       
    33753352#if GPB_SIMPLE_UNI
    3376 #if L0034_COMBINED_LIST_CLEANUP
    33773353        if ( iRefList == 1 )    // list 1
    33783354        {
     
    33993375        }
    34003376#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               else
    3413               {
    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             else
    3426             {
    3427               xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    3428             }
    3429         }
    3430         else
    3431         {
    3432           if (iRefList && pcCU->getSlice()->getNoBackPredFlag())
    3433           {
    3434             uiCostTemp = MAX_UINT;
    3435             cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];
    3436           }
    3437           else
    3438           {
    3439             xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    3440           }       
    3441         }
    3442 #endif
    3443 #else
    34443377        xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    34453378#endif
     
    34473380        xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    34483381
    3449 #if L0034_COMBINED_LIST_CLEANUP
    34503382        if ( iRefList == 0 )
    34513383        {
     
    34723404          refIdxValidList1 = iRefIdxTemp;
    34733405        }
    3474 #else
    3475         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           else
    3487           {
    3488             if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_1, iRefIdxTemp)<0)
    3489             {
    3490               uiCostTemp = MAX_UINT;
    3491             }           
    3492           }
    3493         }
    3494 
    3495 #if ENCODER_BUGFIX
    3496         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 #else
    3500         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 #endif
    3505           {
    3506             uiCost[iRefList] = uiCostTemp;
    3507             uiBits[iRefList] = uiBitsTemp; // storing for bi-prediction
    3508            
    3509             // set motion
    3510             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 prediction
    3518               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 #endif
    35313406      }
    35323407    }
     
    35963471       
    35973472        Int         iRefList    = iIter % 2;
    3598 #if L0034_COMBINED_LIST_CLEANUP
    35993473        if ( m_pcEncCfg->getUseFastEnc() )
    36003474        {
     
    36193493          motionCompensation ( pcCU, pcYuvPred, RefPicList(1-iRefList), iPartIdx );
    36203494        }
    3621 #else
    3622         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 #endif
    36273495        RefPicList  eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
    36283496
     
    37853653    UInt uiMEBits = 0;
    37863654    // Set Motion Field_
    3787 #if L0034_COMBINED_LIST_CLEANUP
    37883655    cMv[1] = mvValidList1;
    37893656    iRefIdx[1] = refIdxValidList1;
    37903657    uiBits[1] = bitsValidList1;
    37913658    uiCost[1] = costValidList1;
    3792 #else
    3793     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 #endif
    37983659#if AMP_MRG
    37993660    if (bTestNormalMC)
Note: See TracChangeset for help on using the changeset viewer.