Ignore:
Timestamp:
31 Jan 2013, 03:48:51 (12 years ago)
Author:
mediatek-htm
Message:

Implementation of C0138
Added macro "MTK_MDIVRP_C0138"

Location:
branches/HTM-5.1-dev2-Mediatek/source/Lib/TLibEncoder
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev2-Mediatek/source/Lib/TLibEncoder/TEncCu.cpp

    r189 r244  
    636636      {
    637637#if HHI_INTER_VIEW_RESIDUAL_PRED
     638#if MTK_MDIVRP_C0138
     639        Bool  bResPredAvailable   = false;
     640        UInt uiResPrdId = 0;
     641#else
    638642        // check availability of residual prediction
    639643        Bool  bResPredAvailable   = false;
     
    651655
    652656        for( UInt uiResPrdId = 0; uiResPrdId < ( bResPredAvailable ? 2 : 1 ); uiResPrdId++ )
     657#endif
    653658        {
    654659          Bool bResPredFlag  = ( uiResPrdId > 0 );
     
    764769      {
    765770#if HHI_INTER_VIEW_RESIDUAL_PRED
     771#if MTK_MDIVRP_C0138
     772        Bool  bResPredAvailable   = false;
     773        UInt uiResPrdId = 0;
     774#else
    766775        // check availability of residual prediction
    767776        Bool  bResPredAvailable   = false;
     
    779788
    780789        for( UInt uiResPrdId = 0; uiResPrdId < ( bResPredAvailable ? 2 : 1 ); uiResPrdId++ )
     790#endif
    781791        {
    782792          Bool bResPredFlag  = ( uiResPrdId > 0 );
     
    17891799    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
    17901800#endif
    1791 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1801#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    17921802    m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
    17931803#endif
     
    18201830    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
    18211831#endif
    1822 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1832#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    18231833    if( !pcCU->isIntra( uiAbsPartIdx ) )
    18241834    {
     
    18601870  Int numValidMergeCand = 0;
    18611871
    1862 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1872#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    18631873  Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
    18641874  Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
     
    18911901  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    18921902  rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     1903
     1904#if MTK_MDIVRP_C0138
     1905  Bool bResPredAvail = rpcTempCU->getResPredAvail(0);
     1906#endif
    18931907
    18941908#if FAST_DECISION_FOR_MRG_RD_COST
     
    19381952
    19391953#if HHI_INTER_VIEW_RESIDUAL_PRED
     1954#if MTK_MDIVRP_C0138
     1955          rpcTempCU->setResPredAvailSubParts(bResPredAvail, 0, 0, uhDepth);
     1956#else
    19401957          rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
    19411958          rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
     1959#endif
    19421960#endif
    19431961#if LGE_ILLUCOMP_B0045
     
    19531971        {
    19541972            m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1973#if MTK_MDIVRP_C0138
     1974            if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
     1975            {
     1976              m_pcPredSearch->residualPrediction(rpcTempCU, m_ppcPredYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth]);
     1977            }
     1978#endif
    19551979            // save pred adress
    19561980            pcPredYuvTemp = m_ppcPredYuvTemp[uhDepth];
     
    19631987            {
    19641988              m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1989#if MTK_MDIVRP_C0138
     1990              if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
     1991              {
     1992                m_pcPredSearch->residualPrediction(rpcTempCU, m_ppcPredYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth]);
     1993              }
     1994#endif
    19651995              // save pred adress
    19661996              pcPredYuvTemp = m_ppcPredYuvTemp[uhDepth];
     
    20832113  rpcTempCU->setMergeAMP (true);
    20842114  #if HHI_INTERVIEW_SKIP
    2085 #if LG_RESTRICTEDRESPRED_M24766
     2115#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    20862116  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG  );
    20872117#else
  • branches/HTM-5.1-dev2-Mediatek/source/Lib/TLibEncoder/TEncEntropy.cpp

    r210 r244  
    489489}
    490490
    491 #if HHI_INTER_VIEW_RESIDUAL_PRED
     491#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    492492Void
    493493TEncEntropy::encodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD )
  • branches/HTM-5.1-dev2-Mediatek/source/Lib/TLibEncoder/TEncEntropy.h

    r210 r244  
    270270  Void encodeMergeFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx );
    271271  Void encodeMergeIndex   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
    272 #if HHI_INTER_VIEW_RESIDUAL_PRED
     272#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    273273  Void encodeResPredFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
    274274#endif
  • branches/HTM-5.1-dev2-Mediatek/source/Lib/TLibEncoder/TEncSearch.cpp

    r210 r244  
    29422942#endif
    29432943#else
    2944 #if LG_RESTRICTEDRESPRED_M24766
     2944#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    29452945Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    29462946#else
     
    29942994  const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
    29952995#endif
    2996 #if LG_RESTRICTEDRESPRED_M24766
     2996#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    29972997  Int iPUResiPredShift[4];
    29982998  Int iLastAddResiShift = -1000;
     
    30093009      pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    30103010      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    3011 #if LG_RESTRICTEDRESPRED_M24766
     3011#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    30123012      Int iAddResiShift;
    30133013      UInt uiPartAddr;
     
    30593059    }
    30603060  }
    3061 #if LG_RESTRICTEDRESPRED_M24766
     3061#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    30623062  if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    30633063  {
     
    30783078 */
    30793079#if AMP_MRG
    3080 #if LG_RESTRICTEDRESPRED_M24766
     3080#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    30813081Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    30823082#else
     
    31853185    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    31863186    UInt          uiBitsTempL0[MAX_NUM_REF];
    3187 #if LG_RESTRICTEDRESPRED_M24766
     3187#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    31883188    Int iPUResiPredShift[4] = {0, 0, 0, 0};
    31893189#endif
     
    32033203    {
    32043204#endif
    3205 #if LG_RESTRICTEDRESPRED_M24766
     3205#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    32063206      Bool bLastResiFlag = false;
    32073207#endif
     
    32133213      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    32143214      {
    3215 #if LG_RESTRICTEDRESPRED_M24766
     3215#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    32163216        if( pcCU->getResPredFlag( 0 ))
    32173217        {
     
    33933393      }
    33943394    }
    3395 #if LG_RESTRICTEDRESPRED_M24766
     3395#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    33963396    if( pcCU->getResPredFlag( 0 ) && bLastResiFlag)
    33973397    { // subtract residual prediction from original in motion search
     
    34023402    if ( pcCU->getSlice()->isInterB() )
    34033403    {
    3404 #if LG_RESTRICTEDRESPRED_M24766
     3404#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    34053405      Int iLastAddResiShift = -1000;
    34063406#endif
     
    35073507          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    35083508#endif
    3509 #if LG_RESTRICTEDRESPRED_M24766
     3509#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    35103510          Int iAddResiShift = -1, iPredFrom = 0;
    35113511          Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr);
     
    35923592        }
    35933593      } // for loop-iter
    3594 #if LG_RESTRICTEDRESPRED_M24766
     3594#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    35953595      if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    35963596      {
     
    38053805      if (bTestNormalMC)
    38063806      {
    3807 #if LG_RESTRICTEDRESPRED_M24766
     3807#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    38083808        Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr);
    38093809        iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \
     
    38163816        xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() );
    38173817        uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits );
    3818 #if LG_RESTRICTEDRESPRED_M24766
     3818#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    38193819        if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)
    38203820        {
     
    38433843#endif
    38443844#else
    3845 #if LG_RESTRICTEDRESPRED_M24766
     3845#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    38463846      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    38473847#else
     
    47544754  UInt      uiWidth      = pcCU->getWidth ( 0 );
    47554755  UInt      uiHeight     = pcCU->getHeight( 0 );
    4756 #if LG_RESTRICTEDRESPRED_M24766
     4756#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    47574757  Int       iPUResiPredShift[4];
    47584758#endif
     
    47644764    pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    47654765   
     4766#if MTK_MDIVRP_C0138
     4767    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
     4768    {
     4769      rpcYuvRec->clip( uiWidth, uiHeight );
     4770    }
     4771#else
    47664772#if HHI_INTER_VIEW_RESIDUAL_PRED
    47674773    // add residual prediction
     
    47764782      rpcYuvRec->clip( uiWidth, uiHeight );
    47774783    }
     4784#endif
    47784785#endif
    47794786
     
    48214828    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
    48224829#endif
    4823 #if HHI_INTER_VIEW_RESIDUAL_PRED
     4830#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    48244831    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    48254832#endif
     
    48994906  else
    49004907  {
    4901 #if LG_RESTRICTEDRESPRED_M24766
     4908#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    49024909    iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;
    49034910    rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth );
     
    49054912  rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth );
    49064913#endif
    4907 #if HHI_INTER_VIEW_RESIDUAL_PRED
     4914#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    49084915    // subtract residual prediction
    49094916    if( pcCU->getResPredFlag( 0 ) )
     
    51275134#endif
    51285135  }
    5129 #if HHI_INTER_VIEW_RESIDUAL_PRED
     5136#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    51305137  // add residual prediction
    51315138  if( pcCU->getResPredFlag( 0 ) )
     
    62046211    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
    62056212#endif
    6206 #if HHI_INTER_VIEW_RESIDUAL_PRED
     6213#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    62076214    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    62086215#endif
     
    62276234    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
    62286235#endif
    6229 #if HHI_INTER_VIEW_RESIDUAL_PRED
     6236#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    62306237    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    62316238#endif
  • branches/HTM-5.1-dev2-Mediatek/source/Lib/TLibEncoder/TEncSearch.h

    r210 r244  
    196196  Void predInterSearch          ( TComDataCU* pcCU,
    197197                                  TComYuv*    pcOrgYuv,
    198 #if LG_RESTRICTEDRESPRED_M24766
     198#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    199199                                  TComYuv*    rpcResiPredYuv,
    200200#endif
     
    500500  Void xMergeEstimation           ( TComDataCU*     pcCU,
    501501                                    TComYuv*        pcYuvOrg,
    502 #if LG_RESTRICTEDRESPRED_M24766
     502#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    503503                                    TComYuv*        rpcResiPredYuv,
    504504#endif
Note: See TracChangeset for help on using the changeset viewer.