Ignore:
Timestamp:
23 May 2013, 15:40:36 (12 years ago)
Author:
tech
Message:

Integrated 3D encoder control, camera parameters, renderer and MV fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r362 r438  
    32093209    UInt          uiBitsTempL0[MAX_NUM_REF];
    32103210
    3211 #if L0034_COMBINED_LIST_CLEANUP
    3212     TComMv        mvValidList1;
    3213     Int           refIdxValidList1 = 0;
    3214     UInt          bitsValidList1 = MAX_UINT;
    3215     UInt          costValidList1 = MAX_UINT;
    3216 #endif
    3217 
    32183211    xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits);
    32193212   
     
    32623255        uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    32633256#if ZERO_MVD_EST
    3264 #if L0034_COMBINED_LIST_CLEANUP
    3265         if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 )
    3266 #else
    32673257        if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) &&
    32683258            (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0))
    3269 #endif
    32703259        {
    32713260          uiZeroMvdBitsTemp = uiBitsTemp;
     
    32873276       
    32883277#if GPB_SIMPLE_UNI
    3289 #if L0034_COMBINED_LIST_CLEANUP
    3290         if ( iRefList == 1 )    // list 1
    3291         {
    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           else
    3305           {
    3306             xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    3307           }
    3308         }
    3309         else
    3310         {
    3311           xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    3312         }
    3313 #else
    33143278        if ( pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0)
    33153279        {
     
    33533317          }       
    33543318        }
    3355 #endif
    33563319#else
    33573320        xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     
    33603323        xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    33613324
    3362 #if L0034_COMBINED_LIST_CLEANUP
    3363         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-prediction
    3372 
    3373           // set motion
    3374           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 motion
    3384           mvValidList1     = cMvTemp[iRefList][iRefIdxTemp];
    3385           refIdxValidList1 = iRefIdxTemp;
    3386         }
    3387 #else
    33883325        if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())
    33893326        {
     
    34353372            }
    34363373          }
    3437 #endif
    34383374      }
    34393375    }
     
    34993435       
    35003436        Int         iRefList    = iIter % 2;
    3501 #if L0034_COMBINED_LIST_CLEANUP
    3502         if ( m_pcEncCfg->getUseFastEnc() )
    3503         {
    3504           if( uiCost[0] <= uiCost[1] )
    3505           {
    3506             iRefList = 1;
    3507           }
    3508           else
    3509           {
    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 #else
    35253437        if ( m_pcEncCfg->getUseFastEnc() && (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) )
    35263438        {
    35273439          iRefList = 1;
    35283440        }
    3529 #endif
    35303441        RefPicList  eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
    35313442
     
    36623573    UInt uiMEBits = 0;
    36633574    // Set Motion Field_
    3664 #if L0034_COMBINED_LIST_CLEANUP
    3665     cMv[1] = mvValidList1;
    3666     iRefIdx[1] = refIdxValidList1;
    3667     uiBits[1] = bitsValidList1;
    3668     uiCost[1] = costValidList1;
    3669 #else
    36703575    if ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 ) )
    36713576    {
    36723577      uiCost[1] = MAX_UINT;
    36733578    }
    3674 #endif
    36753579#if AMP_MRG
    36763580    if (bTestNormalMC)
     
    46184522    while( pcCU->getWidth(0) > (pcCU->getSlice()->getSPS()->getMaxTrSize()<<uiTrLevel) ) uiTrLevel++;
    46194523  }
    4620   UInt uiMaxTrMode = 1 + uiTrLevel;
     4524  UInt uiMaxTrMode = pcCU->getSlice()->getSPS()->getMaxTrDepth() + uiTrLevel;
    46214525 
    46224526  while((uiWidth>>uiMaxTrMode) < (g_uiMaxCUWidth>>g_uiMaxCUDepth)) uiMaxTrMode--;
Note: See TracChangeset for help on using the changeset viewer.