Changeset 280 in 3DVCSoftware for branches/HTM-5.1-dev0/source


Ignore:
Timestamp:
14 Feb 2013, 23:41:41 (12 years ago)
Author:
tech
Message:

Integration of branch dev 2.

Location:
branches/HTM-5.1-dev0/source
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r231 r280  
    9696#endif
    9797
    98 #if SONY_COLPIC_AVAILABILITY
    99   m_tDecTop[0]->setViewOrderIdx(0);
    100 #endif
    10198  Int                 viewDepthId = 0;
    10299  Int                 previousViewDepthId  = 0;
  • branches/HTM-5.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r231 r280  
    341341#if LGE_ILLUCOMP_B0045
    342342  ("IlluCompEnable",                  m_bUseIC                  , true         , "Use illumination compensation for inter-view prediction" )
     343#endif
     344#if INTER_VIEW_VECTOR_SCALING_C0115
     345  ("IVSEnable",                       m_bUseIVS                 , true         , "Use inter-view vector scaling" )
    343346#endif
    344347#if DBL_CONTROL
     
    18061809  printf("IlluCompEnable: %d ", m_bUseIC);
    18071810#endif
    1808 
     1811#if INTER_VIEW_VECTOR_SCALING_C0115
     1812  printf("IVSEnable: %d ", m_bUseIVS);
     1813#endif
    18091814  printf("\n");
    18101815
  • branches/HTM-5.1-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r210 r280  
    172172  Bool      m_bUseIC;                                     ///< flag for using illumination compensation for inter-view prediction
    173173#endif
     174#if INTER_VIEW_VECTOR_SCALING_C0115
     175  Bool      m_bUseIVS;                                        ///< flag for using inter-view vector scaling
     176#endif
    174177#if SAO_UNIT_INTERLEAVING
    175178  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
  • branches/HTM-5.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r231 r280  
    121121    m_cVPS.setDependentFlag                                    ( iViewIdx ? true:false, layerId );
    122122    m_cVPS.setDependentLayer                                   ( layerId - (m_bUsingDepthMaps ? 2:1), layerId );
     123#if INTER_VIEW_VECTOR_SCALING_C0115
     124    m_cVPS.setIVScalingFlag                                    ( m_bUseIVS );
     125#endif
    123126#endif
    124127   
     
    316319#if LGE_ILLUCOMP_B0045
    317320    m_acTEncTopList[iViewIdx]->setUseIC                ( m_bUseIC          );
     321#endif
     322#if INTER_VIEW_VECTOR_SCALING_C0115
     323    m_acTEncTopList[iViewIdx]->setUseIVS               ( m_bUseIVS          );
    318324#endif
    319325#if SAO_UNIT_INTERLEAVING
     
    639645      m_acTEncDepthTopList[iViewIdx]->setUseIC                ( false     );
    640646#endif
     647#if INTER_VIEW_VECTOR_SCALING_C0115
     648     m_acTEncDepthTopList[iViewIdx]->setUseIVS                ( m_bUseIVS );
     649#endif
    641650#if SAO_UNIT_INTERLEAVING
    642651      m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
     
    793802  m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
    794803#endif
     804
    795805}
    796806
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r273 r280  
    33973397#endif
    33983398
    3399 #if LG_RESTRICTEDRESPRED_M24766
     3399#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    34003400Int TComDataCU::getResiPredMode(UInt uiPartAddr)
    34013401{
     
    37533753{
    37543754#if HHI_INTER_VIEW_MOTION_PRED
     3755#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     3756  const Int extraMergeCand = ( ( getSlice()->getIsDepth() || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 );
     3757#else
    37553758  const Int extraMergeCand = ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     3759#endif
    37563760#endif
    37573761
     
    37843788  deriveLeftRightTopIdxGeneral( cCurPS, uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
    37853789  deriveLeftBottomIdxGeneral( cCurPS, uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
     3790
     3791#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     3792  if( m_pcSlice->getIsDepth())
     3793  {
     3794    UInt uiPartIdxCenter;
     3795    xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter );   
     3796    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
     3797    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
     3798    {
     3799      abCandIsInter[iCount] = true;     
     3800      puhInterDirNeighbours[iCount] = pcTextureCU->getInterDir( uiPartIdxCenter );
     3801      if( ( puhInterDirNeighbours[iCount] & 1 ) == 1 )
     3802      {
     3803        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
     3804        TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
     3805        const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
     3806        cMvPred+=cAdd;
     3807        cMvPred>>=2;
     3808        clipMv(cMvPred);
     3809        pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx());
     3810      }
     3811      if ( getSlice()->isInterB() )
     3812      {
     3813        if( ( puhInterDirNeighbours[iCount] & 2 ) == 2 )
     3814        {
     3815          pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     3816          TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
     3817          const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
     3818          cMvPred+=cAdd;
     3819          cMvPred>>=2;
     3820          clipMv(cMvPred);
     3821          pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx());
     3822        }
     3823      }
     3824#if SIMP_MRG_PRUN
     3825      if ( mrgCandIdx == iCount )
     3826      {
     3827        return;
     3828      }
     3829#endif
     3830      iCount ++;
     3831    }
     3832  }
     3833#endif
    37863834
    37873835#if HHI_INTER_VIEW_MOTION_PRED
     
    38093857#endif
    38103858
     3859#if MTK_MDIVRP_C0138
     3860  Bool bDVAvail = true;
     3861#endif
     3862
    38113863#if QC_MULTI_DIS_CAN_A0097
    38123864  DisInfo cDisInfo;
     
    38373889    cDisInfo.m_acMvCand[0].setVer(0);
    38383890    cDisInfo.m_aVIdxCan[0] = 0;
     3891#if MTK_MDIVRP_C0138
     3892    bDVAvail = false;
     3893#endif
    38393894  }
    38403895#if QC_MRG_CANS_B0048
    38413896  Int iPdmDir[2] = {0, 0};
    38423897#endif
     3898#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     3899  getUnifiedMvPredCan(uiPUIdx, REF_PIC_LIST_0, 0, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir, true);
     3900  Int iPdmInterDir;
     3901#else
    38433902  Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo 
    38443903#if QC_MRG_CANS_B0048
     
    38463905#endif
    38473906    );
     3907#endif
    38483908#else
    38493909  Int     iPdmInterDir      = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv );
     3910#endif
     3911#if MTK_MDIVRP_C0138
     3912  if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail)
     3913  {
     3914    setResPredAvailSubParts(true, 0, 0, uiDepth);
     3915  }
    38503916#endif
    38513917
     
    46454711    UInt uiCurLCUIdx = getAddr();
    46464712    xDeriveCenterIdx( eCUMode, uiPUIdx, uiPartIdxCenter );
    4647     bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx );
     4713    bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx
     4714#if QC_TMVP_MRG_REFIDX_C0047
     4715    , 1
     4716#endif
     4717    );
    46484718    if( bExistMV == false )
    46494719    {
    4650       bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter,  cColMv, iRefIdx );
     4720      bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter,  cColMv, iRefIdx
     4721#if QC_TMVP_MRG_REFIDX_C0047
     4722    , 1
     4723#endif
     4724    );
    46514725    }
    46524726    if( bExistMV )
     
    46634737        iRefIdx = 0;
    46644738#endif
    4665         bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);
     4739        bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx
     4740#if QC_TMVP_MRG_REFIDX_C0047
     4741        , 1
     4742#endif
     4743        );
    46664744        if( bExistMV == false )
    46674745        {
    4668           bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter,  cColMv, iRefIdx );
     4746          bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter,  cColMv, iRefIdx
     4747#if QC_TMVP_MRG_REFIDX_C0047
     4748        , 1
     4749#endif 
     4750        );
    46694751        }
    46704752        if( bExistMV )
     
    68956977        cDisInfo.m_aVIdxCan[0] = 0;
    68966978      }
     6979#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     6980      Int paiPdmRefIdx[4] = {-1, -1, -1, -1};
     6981      Int iPdmDir[4] = {-1, -1, -1, -1};
     6982#if QC_C0051_FIXED_BY_MTK
     6983      TComMv cPdmMvPred[4];
     6984#else
     6985      TComMv cPdmMvPred[2];
     6986#endif
     6987      cPdmMvPred[0].m_bDvMcp = cPdmMvPred[1].m_bDvMcp = false;
     6988      if(getUnifiedMvPredCan(uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, cPdmMvPred, &cDisInfo, iPdmDir, false))
     6989#else
    68976990      TComMv  cPdmMvPred;
    68986991#if QC_MULTI_DIS_CAN_A0097
     
    69016994      if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
    69026995#endif
     6996#endif
     6997#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     6998      {
     6999        clipMv( cPdmMvPred[0] );
     7000        pInfo->m_acMvCand[0] = cPdmMvPred[0];
     7001      }
     7002      else
     7003      {
     7004        pInfo->m_acMvCand[0].set(0,0);
     7005      }
     7006#else
    69037007      {
    69047008        clipMv( cPdmMvPred );
     
    69097013        pInfo->m_acMvCand[0].set(0,0);
    69107014      }
     7015#endif
    69117016    }
    69127017  }
     
    75757680  Int iNeibPOC = iCurrPOC;
    75767681  Int iNeibRefPOC;
    7577 
     7682#if INTER_VIEW_VECTOR_SCALING_C0116
     7683  Int iCurrViewId = m_pcSlice->getViewOrderIdx(); // will be changed to view_id
     7684  Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewOrderIdx(); // will be changed to view_id
     7685  Int iNeibViewId = iCurrViewId;
     7686  Int iNeibRefViewId;
     7687#endif
    75787688#if QC_IV_AS_LT_B0046
    75797689  Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm();
     
    75837693  {
    75847694    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
     7695#if INTER_VIEW_VECTOR_SCALING_C0116
     7696    iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id
     7697#endif
    75857698#if QC_IV_AS_LT_B0046
    75867699    bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm() ;
     7700#if INTER_VIEW_VECTOR_SCALING_C0116
     7701    if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && ((iNeibRefPOC == iCurrRefPOC) && (iNeibRefViewId == iCurrRefViewId)))
     7702#else
    75877703    if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) )
     7704#endif
    75887705#else
    75897706    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
     
    76067723  {
    76077724    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) );
     7725#if INTER_VIEW_VECTOR_SCALING_C0116
     7726    iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id
     7727#endif
    76087728    TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    76097729    TComMv rcMv;
     
    76187738    }
    76197739#endif
     7740#if INTER_VIEW_VECTOR_SCALING_C0116
     7741    Int iScale = 4096;
     7742    if((iCurrRefPOC != iNeibRefPOC)  )    // inter & inter
     7743        iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     7744    else if(m_pcSlice->getIVScalingFlag())    // inter-view & inter-view
     7745        iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iNeibViewId, iNeibRefViewId );
     7746#else
    76207747    Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     7748#endif
    76217749    if ( iScale == 4096 )
    76227750    {
     
    76407768  {
    76417769    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
     7770#if INTER_VIEW_VECTOR_SCALING_C0116
     7771    iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id
     7772#endif
    76427773    TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx);
    76437774    TComMv rcMv;
     
    76527783    }
    76537784#endif
     7785#if INTER_VIEW_VECTOR_SCALING_C0116
     7786    Int iScale = 4096;
     7787    if((iCurrRefPOC != iNeibRefPOC))    // inter & inter
     7788        iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     7789    else if(m_pcSlice->getIVScalingFlag())    // inter-view & inter-view
     7790        iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iNeibViewId, iNeibRefViewId );
     7791#else
    76547792    Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     7793#endif
    76557794    if ( iScale == 4096 )
    76567795    {
     
    77827921 * \returns Bool
    77837922 */
    7784 Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx )
     7923Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx
     7924#if QC_TMVP_MRG_REFIDX_C0047
     7925  ,
     7926  Bool bMRG
     7927#endif
     7928)
    77857929{
    77867930  UInt uiAbsPartAddr = uiPartUnitIdx;
     
    77887932  RefPicList  eColRefPicList;
    77897933  Int iColPOC, iColRefPOC, iCurrPOC, iCurrRefPOC, iScale;
    7790 #if SONY_COLPIC_AVAILABILITY
    7791 #if QC_IV_AS_LT_B0046
    7792   Int iColViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;
    7793 #else
    7794   Int iColViewOrderIdx, iColRefViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;
    7795 #endif
    7796 #endif
    77977934  TComMv cColMv;
    7798 
    7799 #if SONY_COLPIC_AVAILABILITY
    7800   iCurrViewOrderIdx    = m_pcSlice->getViewOrderIdx();
    7801   iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
    7802 #endif
     7935#if INTER_VIEW_VECTOR_SCALING_C0115
     7936  Int iColViewId, iColRefViewId, iCurrViewId, iCurrRefViewId;
     7937#endif
     7938
    78037939  // use coldir.
    78047940#if COLLOCATED_REF_IDX
     
    78157951  iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
    78167952  iColPOC = pColCU->getSlice()->getPOC(); 
    7817 #if SONY_COLPIC_AVAILABILITY
    7818   iColViewOrderIdx = pColCU->getSlice()->getViewOrderIdx();
     7953#if INTER_VIEW_VECTOR_SCALING_C0115
     7954  iCurrViewId = m_pcSlice->getViewOrderIdx(); // will be changed to view_id   
     7955  iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); // will be changed to view_id
     7956  iColViewId = pColCU->getSlice()->getViewOrderIdx(); // will be changed to view_id
    78197957#endif
    78207958
     
    78247962  }
    78257963
    7826 #if !SONY_COLPIC_AVAILABILITY&!QC_IV_AS_LT_B0046
     7964#if !INTER_VIEW_VECTOR_SCALING_C0115&!QC_IV_AS_LT_B0046
    78277965  if( m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId() != m_pcSlice->getViewId() )
    78287966    return false;
     
    78517989  // Scale the vector.
    78527990  iColRefPOC = pColCU->getSlice()->getRefPOC(eColRefPicList, iColRefIdx);
    7853 
     7991#if INTER_VIEW_VECTOR_SCALING_C0115
     7992  iColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); // will be changed to view_id
     7993#endif
    78547994#if !QC_IV_AS_LT_B0046
    7855 #if SONY_COLPIC_AVAILABILITY
    7856   iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
    7857 #else
    78587995  if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != pColCU->getSlice()->getViewId() )
    78597996  {
    78607997    return false;
    78617998  }
    7862 #endif
    78637999#else
    78648000  Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm();
     
    78668002  if(bIsCurrRefLongTerm != bIsColRefLongTerm)
    78678003  {
     8004#if QC_TMVP_MRG_REFIDX_C0047
     8005    cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
     8006    iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
     8007    if(bMRG )
     8008    {
     8009      Int iUpdRefIdx  = m_pcSlice->getNewRefIdx(eRefPicList);
     8010      if(iUpdRefIdx > 0 )
     8011      {
     8012        riRefIdx = iUpdRefIdx;
     8013        bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm();
     8014        iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
     8015#if INTER_VIEW_VECTOR_SCALING_C0115
     8016        iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); // will be changed to view_id
     8017#endif
     8018      }
     8019      else
     8020        return false;
     8021    }else
     8022    {
     8023#endif
    78688024    assert( ((iColPOC == iColRefPOC)&&(iCurrPOC != iCurrRefPOC))||((iColPOC != iColRefPOC)&&(iCurrPOC == iCurrRefPOC)));
    78698025    return false;
     8026#if QC_TMVP_MRG_REFIDX_C0047
     8027    }
     8028#endif
    78708029  }
    78718030#endif
     
    78888047      }
    78898048    }else
    7890 #if QC_MVHEVC_B0046
    7891       rcMv = cColMv; //inter-view
    7892 #else
    7893     {
    7894 #if SONY_COLPIC_AVAILABILITY
    7895       Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
    7896       iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
     8049#if INTER_VIEW_VECTOR_SCALING_C0115
     8050    {
     8051        if((iCurrPOC == iCurrRefPOC) && m_pcSlice->getIVScalingFlag())    // inter-view & inter-view
     8052            iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId );
     8053        else
     8054            iScale = 4096;            // inter & inter
    78978055      if ( iScale == 4096 )
    78988056      {
     
    79038061        rcMv = cColMv.scaleMv( iScale );
    79048062      }
    7905 #else
    7906       return false;
    7907 #endif
    7908     }
    7909 #endif
    7910   }
    7911 #else
    7912 #if SONY_COLPIC_AVAILABILITY
    7913   iScale = 0;
    7914   iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
    7915   if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))
    7916     iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
    7917   else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC))
    7918     iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
    7919   else
    7920     return false;
    7921 
    7922 #else
    7923   iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
    7924 #endif
    7925   if ( iScale == 4096 )
    7926   {
    7927     rcMv = cColMv;
    7928   }
    7929   else
    7930   {
    7931     rcMv = cColMv.scaleMv( iScale );
    7932   }
    7933 #endif
     8063  }
     8064#else
     8065    rcMv = cColMv; //inter-view
     8066#endif
     8067  }
     8068#endif
     8069
    79348070  return true;
    79358071}
     
    89069042}
    89079043#else
     9044#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     9045Bool
     9046TComDataCU::getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
     9047{
     9048  TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
     9049  ROFRS( pcDepthMapGenerator, false );
     9050  if (pDInfo->iN > 0 && pcDepthMapGenerator->getPdmCandidate(this, uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, pacPdmMv, pDInfo, iPdm, bMerge))
     9051    return true;
     9052  return false;
     9053}
     9054#else
    89089055Int
    89099056TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
     
    89319078}
    89329079#endif
    8933 
     9080#endif
    89349081
    89359082Bool     
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h

    r265 r280  
    289289#endif
    290290  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
    291   Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx );
     291  Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx
     292#if QC_TMVP_MRG_REFIDX_C0047
     293  ,
     294  Bool bMRG = 0
     295#endif
     296  );
    292297#if QC_MULTI_DIS_CAN_A0097
    293298  Bool          xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
     
    560565  Bool          getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
    561566#else
     567#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     568  Bool getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
     569#else
    562570  Bool          getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false );
    563571  Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
     
    566574#endif
    567575  );
     576#endif
    568577  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
    569578#if LGE_DVMCP_A0126
     
    627636  Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
    628637#endif
    629 #if LG_RESTRICTEDRESPRED_M24766
     638#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    630639  Int           getResiPredMode(UInt uiPartAddr);
    631640  Void          getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex);
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r249 r280  
    606606
    607607#if HHI_INTER_VIEW_MOTION_PRED
     608#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     609Bool
     610TComDepthMapGenerator::getPdmCandidate(TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
     611{
     612  AOF  ( m_bCreated && m_bInit );
     613  TComSlice*    pcSlice     = pcCU->getSlice ();
     614  TComSPS*      pcSPS       = pcSlice->getSPS();
     615  AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
     616
     617  TComPic*      pcRefPic    = pcSlice->getRefPic( eRefPicList, iRefIdx );
     618  UInt          uiRefViewId = pcRefPic->getSPS()->getViewId();
     619  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
     620  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
     621  Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
     622  Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
     623  if(!bMerge)
     624  {
     625    ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false );
     626    ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false );
     627    ROTRS(                  bMerge   && !bPdmMerge, false );
     628  }
     629  else
     630    ROTRS( !bPdmMerge, 0 );
     631
     632#if QC_MRG_CANS_B0048
     633  Bool abPdmAvailable[4] = {false, false, false, false};
     634#else
     635  Bool abPdmAvailable[2] = {false,false};
     636#endif
     637
     638  Int iValid = 0;
     639  Int iViewId = 0;
     640  for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ )
     641  {
     642#if MTK_C0138_FIXED
     643    UInt        uiBaseId    = uiBId;
     644#else
     645    UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
     646#endif
     647    TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
     648    for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ )
     649    {
     650      RefPicList  eRefPicListTest = RefPicList( iRefListId );
     651      Int         iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ;
     652      for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ )
     653      {
     654        if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC()
     655          && pcBasePic->getViewId() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewId())
     656        {
     657          iValid=1;
     658          iViewId = uiBaseId;
     659          break;
     660        }
     661      }
     662    }
     663  }
     664  if (iValid == 0)
     665    return false;
     666
     667  //--- get base CU/PU and check prediction mode ---
     668  TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( iViewId );
     669  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
     670  if(bMerge || !bInterview)
     671  {
     672#if QC_MULTI_DIS_CAN_A0097
     673    Int  iCurrPosX, iCurrPosY;
     674    UInt          uiPartAddr;
     675    Int           iWidth;
     676    Int           iHeight;
     677
     678    pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
     679    pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
     680    iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
     681    iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
     682
     683    Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) );
     684    Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 ));
     685    Int         iBaseCUAddr;
     686    Int         iBaseAbsPartIdx;
     687    pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
     688#else
     689    Int  iPrdDepth, iCurrPosX, iCurrPosY;
     690    Bool bAvailable  = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY );
     691    AOF( bAvailable );
     692    TComPicYuv* pcBasePdm   = pcBasePic->getPredDepthMap();
     693    Int         iDisparity  = xGetDisparityFromVirtDepth( iViewId, iPrdDepth );
     694    Int         iShiftX     = m_uiSubSampExpX + 2;
     695    Int         iAddX       = ( 1 << iShiftX ) >> 1;
     696    Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) );
     697    Int         iBasePosY   = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY                               );
     698    Int         iBaseCUAddr;
     699    Int         iBaseAbsPartIdx;
     700    pcBaseRec->getCUAddrAndPartIdx( iBasePosX<< m_uiSubSampExpX , iBasePosY<< m_uiSubSampExpY , iBaseCUAddr, iBaseAbsPartIdx );
     701#endif
     702    TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     703    if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTER || pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_SKIP )
     704    {
     705      for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     706      {
     707        RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     708        if(!bMerge && eCurrRefPicList != eRefPicList)
     709          continue;
     710        Bool bLoop_stop = false;
     711        for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     712        {
     713          RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     714          TComMvField cBaseMvField;
     715          pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
     716          Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
     717          if (iBaseRefIdx >= 0)
     718          {
     719            Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
     720            if (iBaseRefPOC != pcSlice->getPOC())   
     721            {
     722              for (Int iPdmRefIdx = (bMerge?0: iRefIdx); iPdmRefIdx < (bMerge? pcSlice->getNumRefIdx( eCurrRefPicList ): (iRefIdx+1)); iPdmRefIdx++)
     723              {
     724                if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     725                {
     726                  abPdmAvailable[ uiCurrRefListId ] = true;
     727                  TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
     728#if LGE_DVMCP_A0126
     729                  if( bMerge )
     730                  {
     731                    cMv.m_bDvMcp = true;
     732                    cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor();
     733                  }
     734#endif
     735                  pcCU->clipMv( cMv );
     736                  if(bMerge)
     737                  {
     738                    paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
     739                    pacPdmMv      [ uiCurrRefListId ] = cMv;
     740                    bLoop_stop = true;
     741                    break;
     742                  }else
     743                  {
     744                    pacPdmMv  [0] = cMv;
     745                    return true;
     746                  }
     747                }
     748              }
     749            }
     750          }
     751        }
     752      }
     753    }
     754    if( bMerge )
     755      iPdm[0] = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
     756  }
     757  if(bMerge || bInterview)
     758  {
     759    for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
     760    {
     761      RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
     762      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
     763      for( Int iPdmRefIdx = (bMerge ? 0: iRefIdx); iPdmRefIdx < (bMerge ? iNumRefPics: (iRefIdx+1) ); iPdmRefIdx++ )
     764      {
     765        if( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC())
     766        {
     767#if QC_MRG_CANS_B0048
     768          abPdmAvailable[ iRefListId+2 ] = true;
     769          paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
     770#else
     771          abPdmAvailable[ iRefListId ] = true;
     772          paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
     773#endif
     774#if QC_MULTI_DIS_CAN_A0097
     775          TComMv cMv = pDInfo->m_acMvCand[0];
     776          cMv.setVer(0);
     777#else
     778          TComMv cMv(iDisparity, 0);
     779#endif
     780          pcCU->clipMv( cMv );
     781#if QC_MRG_CANS_B0048
     782          pacPdmMv      [ iRefListId + 2] = cMv;
     783#else
     784          pacPdmMv      [ iRefListId ] = cMv;
     785#endif
     786          if(bMerge)
     787            break;
     788          else
     789          {
     790            pacPdmMv [0] = cMv;
     791            return true;
     792          }
     793        }
     794      }
     795    }
     796#if QC_MRG_CANS_B0048
     797    iPdm[1] = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 );
     798#else
     799    iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ;
     800   }
     801#endif
     802  }
     803  return false;
     804}
     805#else
    608806#if QC_MULTI_DIS_CAN_A0097
    609807Int
     
    10211219  return false;
    10221220}
     1221#endif
    10231222#endif
    10241223
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r210 r280  
    152152#if HHI_INTER_VIEW_MOTION_PRED
    153153#if QC_MULTI_DIS_CAN_A0097
     154#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
     155  Bool getPdmCandidate ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
     156#else
    154157  Int   getPdmMergeCandidate ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
    155158#if QC_MRG_CANS_B0048
     
    160163  Bool  getPdmMvPredDisCan    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
    161164  Bool  getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
     165#endif
    162166#else
    163167  Int   getPdmMergeCandidate  ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp

    r231 r280  
    7676  m_pcUsedPelsMap     = NULL;
    7777#endif
    78 #if SONY_COLPIC_AVAILABILITY
    79   m_iViewOrderIdx     = 0;
     78#if INTER_VIEW_VECTOR_SCALING_C0115
     79  m_iViewOrderIdx     = 0;    // will be changed to view_id
    8080#endif
    8181  m_aaiCodedScale     = 0;
     
    703703}
    704704
     705
    705706//! \}
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h

    r210 r280  
    112112  TComPicYuv*           m_pcUsedPelsMap;
    113113#endif
    114 #if SONY_COLPIC_AVAILABILITY
    115   Int                   m_iViewOrderIdx;
     114#if INTER_VIEW_VECTOR_SCALING_C0115
     115  Int                   m_iViewOrderIdx;    // will be changed to view_id
    116116#endif
    117117  Int**                 m_aaiCodedScale;
     
    188188#endif
    189189
    190 #if SONY_COLPIC_AVAILABILITY
    191   Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
    192   Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
     190#if INTER_VIEW_VECTOR_SCALING_C0115
     191  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }        // will be changed to view_id
     192  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }    // will be changed to view_id
    193193#endif
    194194
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r275 r280  
    847847}
    848848
    849 
     849#if MTK_MDIVRP_C0138
     850Void TComPrediction::residualPrediction(TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred)
     851{
     852  Int         iWidth;
     853  Int         iHeight;
     854  UInt        uiPartAddr;
     855
     856  pcCU->getPartIndexAndSize( 0, uiPartAddr, iWidth, iHeight );
     857
     858  Bool bResAvail = false;
     859
     860  bResAvail = pcCU->getResidualSamples( 0,
     861#if QC_SIMPLIFIEDIVRP_M24938
     862    true,
     863#endif
     864    pcYuvResPred );
     865
     866  assert (bResAvail);
     867
     868  pcYuvPred->add(pcYuvResPred, iWidth, iHeight);
     869}
     870#endif
    850871
    851872#if DEPTH_MAP_GENERATION
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPrediction.h

    r275 r280  
    189189#endif
    190190
     191#if MTK_MDIVRP_C0138
     192  Void residualPrediction         (TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred);
     193#endif
    191194
    192195  // motion vector prediction
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r259 r280  
    184184  AOF  ( pcPic );
    185185
     186#if MTK_MDIVRP_C0138
     187  if (pcPic->getSPS()->getViewId() != 0)
     188  {
     189    return;
     190  }
     191#endif
     192
    186193  if( pcPic->getPOC() == 0 )
    187194  {
     
    300307#endif
    301308{
     309#if MTK_C0138_FIXED
     310  UInt  uiBaseViewId  = 0;
     311#else
    302312  UInt  uiBaseViewId  = m_pcDepthMapGenerator->getBaseViewId( 0 );
    303 
     313#endif
    304314  if( !pcYuv )
    305315  {
     
    330340    );
    331341#endif
     342#if MTK_MDIVRP_C0138
     343  return true;
     344#else
    332345#if QC_SIMPLIFIEDIVRP_M24938
    333346  return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight );
    334347#else
    335348  return xIsNonZero( pcYuv, uiBlkWidth, uiBlkHeight );
     349#endif
    336350#endif
    337351}
     
    453467  Pel*    pRes      = pcCUResidual->getLumaAddr();
    454468  UInt    uiLumaTrMode, uiChromaTrMode;
    455 #if LG_RESTRICTEDRESPRED_M24766
     469#if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    456470  Int     iPUPredResiShift[4];
    457471#endif
     
    479493  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pRes, 0, pcCUResidual->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );
    480494
     495#if !MTK_MDIVRP_C0138
    481496  if( pcCU->getResPredFlag( 0 ) )
    482497  {
     
    495510#endif
    496511  }
     512#endif
    497513
    498514  //===== clear inter-view predicted parts =====
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r231 r280  
    113113, m_numEntryPointOffsets          ( 0 )
    114114#endif
    115 #if SONY_COLPIC_AVAILABILITY
    116 , m_iViewOrderIdx                 ( 0 )
    117 #endif
    118115#if LGE_ILLUCOMP_B0045
    119116, m_bApplyIC                      ( false )
     117#endif
     118#if INTER_VIEW_VECTOR_SCALING_C0115
     119, m_bIVScalingFlag                (false)
     120, m_iViewOrderIdx                 ( 0 )        // will be changed to view_id
    120121#endif
    121122{
     
    198199#if TILES_WPP_ENTRY_POINT_SIGNALLING
    199200  m_numEntryPointOffsets = 0;
     201#endif
     202#if QC_TMVP_MRG_REFIDX_C0047
     203  m_aiNewRefIdx[0]                  = -1;
     204  m_aiNewRefIdx[1]                  = -1;
    200205#endif
    201206}
     
    419424    }
    420425  }
     426#if QC_TMVP_MRG_REFIDX_C0047
     427  Int  iCurrPOC = this->getPOC();
     428  for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )//just to get one updated ref idx for merge in each L0/L1 direction, if it is not avaialbe, it is still -1
     429  {       
     430    if ( this->getNumRefIdx( RefPicList( uiRefListIdx ) ) == 0)
     431        continue;
     432
     433    Bool bZeroIdxInterViewFlag =  ( this->getRefPic(RefPicList(uiRefListIdx), 0)->getPOC() == iCurrPOC ) ? true : false;
     434    for(Int i = 1; i < this->getNumRefIdx(RefPicList(uiRefListIdx)); i++ )
     435    {
     436      if ( (bZeroIdxInterViewFlag && this->getRefPic(RefPicList(uiRefListIdx), i)->getPOC() != iCurrPOC ) ||
     437           (!bZeroIdxInterViewFlag && this->getRefPic(RefPicList(uiRefListIdx), i)->getPOC() == iCurrPOC ) )
     438      {
     439        this->setNewRefIdx(RefPicList(uiRefListIdx),i);
     440        break;
     441      }
     442    }
     443  }
     444
     445#endif
    421446}
    422447
     
    698723  m_iPOC                 = pSrc->m_iPOC;
    699724  m_viewId               = pSrc->m_viewId;
    700 #if SONY_COLPIC_AVAILABILITY
    701   m_iViewOrderIdx        = pSrc->m_iViewOrderIdx;
     725#if INTER_VIEW_VECTOR_SCALING_C0115   
     726  m_iViewOrderIdx        = pSrc->m_iViewOrderIdx;// will be changed to view_id
     727  m_bIVScalingFlag       = pSrc->m_bIVScalingFlag;
    702728#endif
    703729  m_eNalUnitType         = pSrc->m_eNalUnitType;
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h

    r231 r280  
    179179  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
    180180  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
    181  
     181#if INTER_VIEW_VECTOR_SCALING_C0115
     182  Bool          m_bIVScalingFlag;
     183#endif
    182184public:
    183185  TComVPS();
     
    213215  Void    setDependentLayer(UInt v, UInt layer)                     { m_uiDependentLayer[layer] = v;    }
    214216  UInt    getDependentLayer(UInt layer)                             { return m_uiDependentLayer[layer]; }
     217#endif
     218#if INTER_VIEW_VECTOR_SCALING_C0115
     219  Bool getIVScalingFlag( )                                   { return m_bIVScalingFlag; }
     220  Void setIVScalingFlag(Bool b)                              { m_bIVScalingFlag = b;    }
    215221#endif
    216222  Void    setNumReorderPics(UInt v, UInt tLayer)                { m_numReorderPics[tLayer] = v;    }
     
    12481254
    12491255  Bool        m_bCheckLDC;
     1256#if QC_TMVP_MRG_REFIDX_C0047
     1257  Int         m_aiNewRefIdx    [2];
     1258#endif
    12501259
    12511260  //  Data
     
    13401349  Int        m_aaiCodedOffset[2][MAX_VIEW_NUM];
    13411350
    1342 #if SONY_COLPIC_AVAILABILITY|QC_MVHEVC_B0046
    1343   Int        m_iViewOrderIdx;
    1344 #endif
    13451351#if LGE_ILLUCOMP_B0045
    13461352  Bool        m_bApplyIC;
     1353#endif
     1354#if INTER_VIEW_VECTOR_SCALING_C0115|QC_MVHEVC_B0046
     1355  Bool       m_bIVScalingFlag;
     1356  Int        m_iViewOrderIdx;    // will be changed to view_id
    13471357#endif
    13481358
     
    14371447  Int       getRefViewId        ( RefPicList e, Int iRefIdx)    { return  m_aiRefViewIdList[e][iRefIdx]; }
    14381448  TComPic*  getTexturePic       () const                        { return  m_pcTexturePic; }
    1439 #if SONY_COLPIC_AVAILABILITY
    1440   Int       getViewOrderIdx     ()                                  { return  m_iViewOrderIdx;              }
    1441 #endif
    14421449  Int       getDepth            ()                              { return  m_iDepth;                     }
    14431450  UInt      getColDir           ()                              { return  m_uiColDir;                   }
     
    14891496  Void      setRefViewId        ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdList[e][iRefIdx] = i; }
    14901497  Void      setTexturePic       ( TComPic *pcTexturePic )       { m_pcTexturePic = pcTexturePic; }
    1491 #if SONY_COLPIC_AVAILABILITY
    1492   Void      setViewOrderIdx     ( Int i )                       { m_iViewOrderIdx     = i;      }
    1493 #endif
    14941498  Void      setNumRefIdx        ( RefPicList e, Int i )         { m_aiNumRefIdx[e]    = i;      }
    14951499  Void      setPic              ( TComPic* p )                  { m_pcPic             = p;      }
     
    16611665  Void      xSetApplyIC           ();
    16621666#endif
     1667#if QC_TMVP_MRG_REFIDX_C0047
     1668  Int       getNewRefIdx        ( RefPicList e )                { return  m_aiNewRefIdx[e];     }
     1669  Void      setNewRefIdx        ( RefPicList e, Int i )         { m_aiNewRefIdx[e]    = i;      }
     1670#endif
     1671#if INTER_VIEW_VECTOR_SCALING_C0115
     1672  Void setIVScalingFlag( Bool val )         { m_bIVScalingFlag = val;     }
     1673  Bool getIVScalingFlag()                   { return m_bIVScalingFlag;    }
     1674  Void setViewOrderIdx     ( Int i )        { m_iViewOrderIdx     = i;    }   // will be changed to view_id
     1675  Int  getViewOrderIdx     ()               { return  m_iViewOrderIdx;    }   // will be changed to view_id
     1676#endif
    16631677
    16641678#if MERL_VSP_C0152
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComYuv.cpp

    r189 r280  
    392392}
    393393
    394 #if LG_RESTRICTEDRESPRED_M24766
     394#if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    395395Void
    396396TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize,  TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     
    408408#endif
    409409
    410 #if LG_RESTRICTEDRESPRED_M24766
     410#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    411411Void
    412412TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset)
     
    435435#endif
    436436
    437 #if LG_RESTRICTEDRESPRED_M24766
     437#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    438438Void
    439439TComYuv::addLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     
    449449  Pel*  pDstSamples = getLumaAddr();
    450450
    451 #if LG_RESTRICTEDRESPRED_M24766
     451#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    452452  Int iXOffset, iYOffset;
    453453
     
    502502}
    503503
    504 #if LG_RESTRICTEDRESPRED_M24766
     504#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    505505Void
    506506TComYuv::addChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     
    518518  Pel*  pDstSamplesCr = getCrAddr();
    519519
    520 #if LG_RESTRICTEDRESPRED_M24766
     520#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    521521  Int iXOffset, iYOffset;
    522522 
     
    676676}
    677677
    678 #if LG_RESTRICTEDRESPRED_M24766
     678#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    679679Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    680680{
     
    690690#endif
    691691
    692 #if LG_RESTRICTEDRESPRED_M24766
     692#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    693693Void TComYuv::subtractLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    694694#else
     
    706706  Int  iDstStride  = getStride();
    707707
    708 #if LG_RESTRICTEDRESPRED_M24766
     708#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    709709  Int iXOffset, iYOffset;
    710710
     
    814814}
    815815
    816 #if LG_RESTRICTEDRESPRED_M24766
     816#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    817817Void TComYuv::subtractChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    818818#else
     
    832832  Int  iSrc1Stride = pcYuvSrc1->getCStride();
    833833  Int  iDstStride  = getCStride();
    834 #if LG_RESTRICTEDRESPRED_M24766
     834#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    835835  Int iXOffset, iYOffset;
    836836 
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComYuv.h

    r100 r280  
    146146  Void    addClipPartLuma   ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT
    147147
    148 #if LG_RESTRICTEDRESPRED_M24766
     148#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    149149  //  pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf
    150150  Void    subtract          (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
     
    166166  //   Remove High frequency
    167167  Void    removeHighFreq    ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight );
    168 #if LG_RESTRICTEDRESPRED_M24766
     168#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    169169  Void    getPUXYOffset     (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset);
    170170  Void    add               (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h

    r276 r280  
    7777  #define DISABLE_FCO_FOR_VSO             0 // Optional compile settings to disable VSO with FCO.
    7878#endif
     79#define   QC_TMVP_MRG_REFIDX_C0047        1 //only enabled when QC_TMVP_IDX_MOD_B0046 is enabled.
    7980
    8081///// ***** PATCHES *********
     
    9091///// ***** INTERVIEW MOTION VECTOR PREDICTION *********
    9192#define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
     93#define QC_AMVP_MRG_UNIFY_IVCAN_C0051     1
     94#define QC_C0051_FIXED_BY_MTK             1   // bug fix for C0051 implementation
    9295#define SHARP_INTERVIEW_DECOUPLE_B0111    1   // JCT3V-B0111 decoupling inter-view candidate
    9396#define QC_MRG_CANS_B0048                 1   // JCT3V-B0048, B0086, B0069
     
    105108#define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
    106109#if HHI_INTER_VIEW_RESIDUAL_PRED       
     110#define MTK_MDIVRP_C0138                  1   // mode-dependent inter-view residual prediction
     111#define MTK_C0138_FIXED                   1   // fix for IBP coding structure in view direction (not CTC)
    107112#define LG_RESTRICTEDRESPRED_M24766       1   // restricted inter-view residual prediction
    108113#define QC_SIMPLIFIEDIVRP_M24938          1
     
    119124#define QC_SIMPLE_NBDV_B0047              1   // JCT3V-B0047
    120125///// ***** MOTION PARAMETER INHERITANCE  *********
    121 #define HHI_MPI                           1   // motion parameter inheritance from texture picture for depth map coding
     126#define MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137   1   // JCT3V-C0137
     127#define HHI_MPI                           0   // motion parameter inheritance from texture picture for depth map coding
    122128#if HHI_MPI
    123129#define FIX_MPI_B0065                     1   // JCT3V-B0065, fix the MPI bug when RQT is off
     
    151157///// ***** OTHERS *********
    152158#define LG_ZEROINTRADEPTHRESI_A0087       1   // JCT2-A0087
    153 #define SONY_COLPIC_AVAILABILITY          1
     159#define INTER_VIEW_VECTOR_SCALING_C0115   1   // JCT2-C0115 Inter-view vector scaling for TMVP & flag
     160#define INTER_VIEW_VECTOR_SCALING_C0116   1   // JCT2-C0116 Inter-view vector scaling for AMVP
    154161#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
    155162#define VIDYO_VPS_INTEGRATION             1
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r210 r280  
    14581458      }
    14591459    }
     1460#if INTER_VIEW_VECTOR_SCALING_C0115
     1461    READ_FLAG( uiCode,  "inter_view_vector_scaling_flag" );    pcVPS->setIVScalingFlag( uiCode ? true:false);
     1462#endif
    14601463  }
    14611464 
     
    14681471#endif
    14691472#endif
    1470 #if HHI_MPI
     1473#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    14711474Void TDecCavlc::parseSPS(TComSPS* pcSPS, Bool bIsDepth)
    14721475#else
     
    18921895
    18931896#if LCU_SYNTAX_ALF
     1897#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     1898Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth)
     1899#else
    18941900Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet)
     1901#endif
    18951902#else
    18961903Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl)
     
    24952502  #elif HHI_MPI
    24962503  const int iExtraMergeCandidates = sps->getUseMVI() ? 1 : 0;
     2504  #elif MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     2505  const int iExtraMergeCandidates = (  (isDepth || sps->getMultiviewMvPredMode()) ) ? 1 : 0;   
    24972506  #else
    24982507  const int iExtraMergeCandidates = sps->getMultiviewMvPredMode() ? 1 : 0;
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r210 r280  
    118118  Void  parseVPS            ( TComVPS* pcVPS );
    119119#endif
    120 #if HHI_MPI
     120#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    121121  Void  parseSPS            ( TComSPS* pcSPS, Bool bIsDepth );
    122122#else
     
    131131  Void  parseAPS            ( TComAPS* pAPS );
    132132#if LCU_SYNTAX_ALF
     133#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     134  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth);
     135#else
    133136  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet);
     137#endif
    134138#else
    135139  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl );
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r275 r280  
    424424    }
    425425#endif
    426 #if HHI_INTER_VIEW_RESIDUAL_PRED
     426#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    427427    m_pcEntropyDecoder->decodeResPredFlag( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 );
    428428#endif
     
    476476#endif
    477477
    478 #if HHI_INTER_VIEW_RESIDUAL_PRED
     478#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    479479  if( !pcCU->isIntra( uiAbsPartIdx ) )
    480480  {
     
    692692  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    693693#endif
     694#if MTK_MDIVRP_C0138
     695  if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
     696  {
     697    m_pcPrediction->residualPrediction(pcCU, m_ppcYuvReco[uiDepth], m_ppcYuvResPred[uiDepth]);
     698  }
     699#endif
     700
    694701#if HHI_MPI
    695702  if( pcCU->getTextureModeDepth( 0 ) != -1 )
     
    697704#endif
    698705
    699 #if HHI_INTER_VIEW_RESIDUAL_PRED
     706#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    700707  if( pcCU->getResPredFlag( 0 ) )
    701708  {
     
    728735  {
    729736#if HHI_INTER_VIEW_RESIDUAL_PRED
     737#if MTK_MDIVRP_C0138
     738    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
     739#else
    730740    if( pcCU->getResPredFlag( 0 ) )
     741#endif
    731742    {
    732743      m_ppcYuvReco[uiDepth]->clip( pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
     
    10791090  // reconstruct residual based on mask + DC residuals
    10801091  Pel apDCResiValues[2];
    1081   //Pel apDCRecoValues[2];
     1092  Pel apDCRecoValues[2];
    10821093  for( UInt ui = 0; ui < uiNumSegments; ui++ )
    10831094  {
     
    10861097    Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
    10871098   
    1088     //apDCRecoValues[ui]  = pRecoValue;
     1099    apDCRecoValues[ui]  = pRecoValue;
    10891100    apDCResiValues[ui]  = pRecoValue - apDCPredValues[ui];
    10901101  }
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r231 r280  
    100100}
    101101
    102 #if HHI_INTER_VIEW_RESIDUAL_PRED
     102#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    103103Void
    104104TDecEntropy::decodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
     
    341341      pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
    342342
     343#if HHI_MPI
    343344      if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used
    344345      {
     
    352353      }
    353354      else // MPI not used
     355#endif
    354356      {
    355357        Int iVSPIdx = 0;
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h

    r210 r280  
    7474  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    7575#endif
    76 #if HHI_MPI
     76#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    7777  virtual Void  parseSPS                  ( TComSPS* pcSPS, Bool bIsDepth )                       = 0;
    7878#else
     
    8888
    8989#if LCU_SYNTAX_ALF
     90#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     91  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth)       = 0;
     92#else
    9093  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet)       = 0;
     94#endif
    9195#else
    9296  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl )                                = 0;
     
    179183#endif
    180184 
    181 #if HHI_MPI
     185#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    182186  Void    decodeSPS                   ( TComSPS* pcSPS, Bool bIsDepth ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, bIsDepth); }
    183187#else
     
    193197
    194198#if LCU_SYNTAX_ALF
     199#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     200  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl, alfParamSet, isDepth);         }
     201#else
    195202  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl, alfParamSet);         }
     203#endif
    196204#else
    197205  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl )  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl);         }
     
    210218  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    211219  Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
    212 #if HHI_INTER_VIEW_RESIDUAL_PRED
     220#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    213221  Void decodeResPredFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
    214222#endif
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h

    r210 r280  
    9090  Void  parseVPS                  ( TComVPS* pcVPS )  {}
    9191#endif
    92 #if HHI_MPI
     92#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    9393  Void  parseSPS                  ( TComSPS* pcSPS, Bool bIsDepth ) {}
    9494#else
     
    104104
    105105#if LCU_SYNTAX_ALF
     106#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     107  Void  parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth) {}
     108#else
    106109  Void  parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet) {}
     110#endif
    107111#else
    108112  Void  parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl ) {}
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r231 r280  
    353353  m_iMaxRefPicNum = 0;
    354354  m_uiValidPS = 0;
    355 #if SONY_COLPIC_AVAILABILITY
    356   m_iViewOrderIdx = 0;
    357 #endif
    358355#if ENC_DEC_TRACE
    359356  if(!g_hTrace) g_hTrace = fopen( "TraceDec.txt", "wb" );
     
    788785  }
    789786
    790 #if SONY_COLPIC_AVAILABILITY
    791   m_apcSlicePilot->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx());
    792 #endif
    793 
    794787#if NAL_REF_FLAG
    795788  m_apcSlicePilot->setReferenced(nalu.m_nalRefFlag);
     
    801794  // ALF CU parameters should be part of the slice header -> needs to be fixed
    802795#if LCU_SYNTAX_ALF
     796#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     797  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_cGopDecoder.getAlfCuCtrlParam(), m_cGopDecoder.getAlfParamSet(),m_apcSlicePilot->getVPS()->getDepthFlag(nalu.m_layerId));
     798#else
    803799  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_cGopDecoder.getAlfCuCtrlParam(), m_cGopDecoder.getAlfParamSet());
     800#endif
    804801#else
    805802  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_cGopDecoder.getAlfCuCtrlParam() );
     
    865862    xGetNewPicBuffer (m_apcSlicePilot, pcPic);
    866863
    867 #if SONY_COLPIC_AVAILABILITY
    868     pcPic->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() );
    869 #endif
    870 
     864#if INTER_VIEW_VECTOR_SCALING_C0115
     865    pcPic->setViewOrderIdx( m_apcSlicePilot->getVPS()->getViewOrderIdx(nalu.m_layerId) );    // will be changed to view_id
     866#endif
    871867    /* transfer any SEI messages that have been received to the picture */
    872868    pcPic->setSEIs(m_SEIs);
     
    10931089#endif
    10941090
    1095 #if SONY_COLPIC_AVAILABILITY
     1091#if INTER_VIEW_VECTOR_SCALING_C0115
    10961092#if VIDYO_VPS_INTEGRATION
    1097     pcSlice->setViewOrderIdx( pcSlice->getVPS()->getViewOrderIdx(nalu.m_layerId) );
     1093    pcSlice->setViewOrderIdx( pcSlice->getVPS()->getViewOrderIdx(nalu.m_layerId) );        // will be changed to view_id
    10981094#else
    10991095    pcSlice->setViewOrderIdx( pcPic->getViewOrderIdx() );
    11001096#endif
     1097#endif
     1098
     1099#if INTER_VIEW_VECTOR_SCALING_C0115
     1100    pcSlice->setIVScalingFlag( pcSlice->getVPS()->getIVScalingFlag());
    11011101#endif
    11021102
     
    12691269  sps->setRPSList(rps);
    12701270#endif
    1271 #if HHI_MPI
     1271#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    12721272  m_cEntropyDecoder.decodeSPS( sps, m_isDepth );
    12731273#else
  • branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.h

    r231 r280  
    196196  SEImessages *m_SEIs; ///< "all" SEI messages.  If not NULL, we own the object.
    197197
    198 #if SONY_COLPIC_AVAILABILITY
    199   Int                     m_iViewOrderIdx;
    200 #endif
    201 
    202198  // functional classes
    203199  TComPrediction          m_cPrediction;
     
    264260  Void setIsDepth( Bool isDepth ) { m_isDepth = isDepth; }
    265261
    266 #if SONY_COLPIC_AVAILABILITY
    267   Void setViewOrderIdx(Int i)     { m_iViewOrderIdx = i ;}
    268   Int  getViewOrderIdx()          { return m_iViewOrderIdx ; }
    269 #endif
    270 
    271262#if DEPTH_MAP_GENERATION
    272263  TComDepthMapGenerator*  getDepthMapGenerator  () { return &m_cDepthMapGenerator; }
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r210 r280  
    498498      }
    499499    }
     500#if INTER_VIEW_VECTOR_SCALING_C0115
     501      WRITE_FLAG( pcVPS->getIVScalingFlag(),                      "inter_view_vector_scaling_flag" );
     502#endif
    500503  }
    501504 
     
    508511#endif
    509512#endif
    510 #if HHI_MPI
     513#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    511514Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
    512515#else
     
    13041307  #elif HHI_MPI
    13051308  const int iExtraMergeCandidates = pcSlice->getSPS()->getUseMVI() ? 1 : 0;
     1309  #elif MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     1310  const int iExtraMergeCandidates = ( pcSlice->getIsDepth() || pcSlice->getSPS()->getMultiviewMvPredMode() ) ? 1 : 0;
    13061311  #else
    13071312  const int iExtraMergeCandidates = pcSlice->getSPS()->getMultiviewMvPredMode() ? 1 : 0;
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h

    r210 r280  
    118118#endif
    119119
    120 #if HHI_MPI
     120#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    121121  Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
    122122#else
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r210 r280  
    170170  Bool      m_bUseIC;
    171171#endif
     172#if INTER_VIEW_VECTOR_SCALING_C0115
     173  Bool      m_bUseIVS;
     174#endif
    172175#if SAO_UNIT_INTERLEAVING
    173176  Int       m_maxNumOffsetsPerPic;
     
    713716  Void  setUseIC                       ( Bool bVal )   {m_bUseIC = bVal;}
    714717  Bool  getUseIC                       ()              {return m_bUseIC;}
     718#endif
     719#if INTER_VIEW_VECTOR_SCALING_C0115
     720  Void  setUseIVS                       ( Bool bVal )   {m_bUseIVS = bVal;}
     721  Bool  getUseIVS                       ()              {return m_bUseIVS;}
    715722#endif
    716723#if SAO_UNIT_INTERLEAVING
     
    869876  Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
    870877
    871 #if SONY_COLPIC_AVAILABILITY
    872   Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }
     878#if INTER_VIEW_VECTOR_SCALING_C0115
     879  Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }    // will be changed to view_id
    873880#endif
    874881};
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r275 r280  
    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 );
     
    18961906  rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18971907#endif
     1908#if MTK_MDIVRP_C0138
     1909  Bool bResPredAvail = rpcTempCU->getResPredAvail(0);
     1910#endif
     1911
    18981912#if FAST_DECISION_FOR_MRG_RD_COST
    18991913  Bool bestIsSkip = false;
     
    19581972
    19591973#if HHI_INTER_VIEW_RESIDUAL_PRED
     1974#if MTK_MDIVRP_C0138
     1975          rpcTempCU->setResPredAvailSubParts(bResPredAvail, 0, 0, uhDepth);
     1976#else
    19601977          rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
    19611978          rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
     1979#endif
    19621980#endif
    19631981#if LGE_ILLUCOMP_B0045
     
    19761994#else
    19771995            m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1996#endif
     1997#if MTK_MDIVRP_C0138
     1998            if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
     1999            {
     2000              m_pcPredSearch->residualPrediction(rpcTempCU, m_ppcPredYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth]);
     2001            }
    19782002#endif
    19792003            // save pred adress
     
    19902014#else
    19912015              m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     2016#endif
     2017#if MTK_MDIVRP_C0138
     2018              if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
     2019              {
     2020                m_pcPredSearch->residualPrediction(rpcTempCU, m_ppcPredYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth]);
     2021              }
    19922022#endif
    19932023              // save pred adress
     
    21122142  rpcTempCU->setMergeAMP (true);
    21132143  #if HHI_INTERVIEW_SKIP
    2114 #if LG_RESTRICTEDRESPRED_M24766
     2144#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    21152145  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG);
    21162146#else
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp

    r231 r280  
    133133#endif
    134134
    135 #if HHI_MPI
     135#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    136136Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth )
    137137{
     
    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-dev0/source/Lib/TLibEncoder/TEncEntropy.h

    r210 r280  
    8080#endif
    8181
    82 #if HHI_MPI
     82#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    8383  virtual Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth )                       = 0;
    8484#else
     
    246246#endif
    247247  // SPS
    248 #if HHI_MPI
     248#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    249249  Void encodeSPS               ( TComSPS* pcSPS, Bool bIsDepth );
    250250#else
     
    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-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r231 r280  
    247247      std::vector<TComAPS>& vAPS = m_pcEncTop->getAPS();
    248248#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     249#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     250    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getEncTop()->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), m_pcEncTop->getIsDepth() );
     251#else
    249252    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getEncTop()->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
     253#endif
    250254#else
    251255      m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
     
    255259      pcSlice->setViewId( m_pcEncTop->getViewId() );
    256260      pcSlice->setIsDepth( m_pcEncTop->getIsDepth() );
     261#if INTER_VIEW_VECTOR_SCALING_C0115
     262      pcSlice->setIVScalingFlag( m_pcEncTop->getUseIVS() );
     263#endif
    257264
    258265      m_pcEncTop->getSPS()->setDisInter4x4(m_pcEncTop->getDisInter4x4());
     
    340347      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    341348#else
     349
    342350      Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
    343351      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    344352      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    345353#endif
    346      
    347354      TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    348355      refPicListModification->setRefPicListModificationFlagL0( false );
     
    906913        pcSlice->getSPS()->setNumSubstreams( pcSlice->getPPS()->getNumSubstreams() );
    907914#endif
    908 #if HHI_MPI
     915#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    909916        m_pcEntropyCoder->encodeSPS(pcSlice->getSPS(), m_pcEncTop->getIsDepth());
    910917#else
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r231 r280  
    404404#endif
    405405
    406 #if HHI_MPI
     406#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    407407Void TEncSbac::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
    408408#else
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h

    r210 r280  
    102102#endif
    103103 
    104 #if HHI_MPI
     104#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    105105  Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
    106106#else
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r275 r280  
    29472947#else
    29482948#if LG_RESTRICTEDRESPRED_M24766
    2949 #if MERL_VSP_C0152
     2949#if MERL_VSP_C0152 || MTK_MDIVRP_C0138
     2950#if !MTK_MDIVRP_C0138
    29502951Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue )
     2952#endif
     2953#if !MERL_VSP_C0152
     2954Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
     2955#endif
     2956#if MERL_VSP_C0152 && MTK_MDIVRP_C0138
     2957Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue  )
     2958#endif
    29512959#else
    29522960Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
     
    30073015  const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
    30083016#endif
    3009 #if LG_RESTRICTEDRESPRED_M24766
     3017#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    30103018  Int iPUResiPredShift[4];
    30113019  Int iLastAddResiShift = -1000;
     
    30383046      }
    30393047#endif
    3040 #if LG_RESTRICTEDRESPRED_M24766
     3048#if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    30413049      Int iAddResiShift;
    30423050      UInt uiPartAddr;
     
    30883096    }
    30893097  }
    3090 #if LG_RESTRICTEDRESPRED_M24766
     3098#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    30913099  if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    30923100  {
     
    31073115 */
    31083116#if AMP_MRG
    3109 #if LG_RESTRICTEDRESPRED_M24766
     3117#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    31103118Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    31113119#else
     
    32143222    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    32153223    UInt          uiBitsTempL0[MAX_NUM_REF];
    3216 
    3217 #if LG_RESTRICTEDRESPRED_M24766
     3224#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    32183225    Int iPUResiPredShift[4] = {0, 0, 0, 0};
    32193226#endif
     
    32363243    {
    32373244#endif
    3238 #if LG_RESTRICTEDRESPRED_M24766
     3245#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    32393246      Bool bLastResiFlag = false;
    32403247#endif
     
    32473254      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    32483255      {
    3249 #if LG_RESTRICTEDRESPRED_M24766
     3256#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    32503257        if( pcCU->getResPredFlag( 0 ))
    32513258        {
     
    34353442      }
    34363443    }
    3437 #if LG_RESTRICTEDRESPRED_M24766
     3444#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    34383445    if( pcCU->getResPredFlag( 0 ) && bLastResiFlag)
    34393446    { // subtract residual prediction from original in motion search
     
    34443451    if ( pcCU->getSlice()->isInterB() )
    34453452    {
    3446 #if LG_RESTRICTEDRESPRED_M24766
     3453#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    34473454      Int iLastAddResiShift = -1000;
    34483455#endif
     
    35523559          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    35533560#endif
    3554 #if LG_RESTRICTEDRESPRED_M24766
     3561#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    35553562          Int iAddResiShift = -1, iPredFrom = 0;
    35563563          Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr);
     
    36413648        }
    36423649      } // for loop-iter
    3643 #if LG_RESTRICTEDRESPRED_M24766
     3650#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    36443651      if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    36453652      {
     
    38563863      if (bTestNormalMC)
    38573864      {
    3858 #if LG_RESTRICTEDRESPRED_M24766
     3865#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    38593866        Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr);
    38603867        iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \
     
    38673874        xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() );
    38683875        uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits );
    3869 #if LG_RESTRICTEDRESPRED_M24766
     3876#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    38703877        if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)
    38713878        {
     
    38953902#else
    38963903#if LG_RESTRICTEDRESPRED_M24766
    3897 #if MERL_VSP_C0152
     3904#if MERL_VSP_C0152 || MTK_MDIVRP_C0138
     3905
     3906#if !MTK_MDIVRP_C0138
    38983907      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
     3908#endif
     3909
     3910#if !MERL_VSP_C0152
     3911      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
     3912#endif
     3913
     3914#if MERL_VSP_C0152 && MTK_MDIVRP_C0138
     3915      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
     3916#endif
     3917
    38993918#else
    39003919      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    39013920#endif
     3921
     3922
    39023923#else
    39033924      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
     
    48334854  UInt      uiWidth      = pcCU->getWidth ( 0 );
    48344855  UInt      uiHeight     = pcCU->getHeight( 0 );
    4835 #if LG_RESTRICTEDRESPRED_M24766
     4856#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    48364857  Int       iPUResiPredShift[4];
    48374858#endif
    48384859  //  No residual coding : SKIP mode
    4839   if ( (ePredMode == MODE_SKIP && bSkipRes) )
     4860  if ( ePredMode == MODE_SKIP && bSkipRes )
    48404861  {
    48414862    rpcYuvResi->clear();
     
    48434864    pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    48444865   
     4866#if MTK_MDIVRP_C0138
     4867    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
     4868    {
     4869      rpcYuvRec->clip( uiWidth, uiHeight );
     4870    }
     4871#else
    48454872#if HHI_INTER_VIEW_RESIDUAL_PRED
    48464873    // add residual prediction
     
    48554882      rpcYuvRec->clip( uiWidth, uiHeight );
    48564883    }
     4884#endif
    48574885#endif
    48584886
     
    49004928    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
    49014929#endif
    4902 #if HHI_INTER_VIEW_RESIDUAL_PRED
     4930#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    49034931    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    49044932#endif
     
    49785006  else
    49795007  {
    4980 #if LG_RESTRICTEDRESPRED_M24766
     5008#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    49815009    iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;
    49825010    rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth );
     
    49845012  rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth );
    49855013#endif
    4986 #if HHI_INTER_VIEW_RESIDUAL_PRED
     5014#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    49875015    // subtract residual prediction
    49885016    if( pcCU->getResPredFlag( 0 ) )
     
    52065234#endif
    52075235  }
    5208 #if HHI_INTER_VIEW_RESIDUAL_PRED
     5236#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    52095237  // add residual prediction
    52105238  if( pcCU->getResPredFlag( 0 ) )
     
    62836311    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
    62846312#endif
    6285 #if HHI_INTER_VIEW_RESIDUAL_PRED
     6313#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    62866314    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    62876315#endif
     
    63066334    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
    63076335#endif
    6308 #if HHI_INTER_VIEW_RESIDUAL_PRED
     6336#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
    63096337    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    63106338#endif
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h

    r231 r280  
    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
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSlice.cpp

    r231 r280  
    163163 */
    164164#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     165#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     166Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS * pVPS, TComSPS* pSPS, TComPPS *pPPS, bool isDepth )
     167#else
    165168Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS * pVPS, TComSPS* pSPS, TComPPS *pPPS )
     169#endif
    166170#else
    167171Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )
     
    186190  rpcSlice->setPOC( uiPOCCurr );
    187191 
    188 #if SONY_COLPIC_AVAILABILITY
    189   rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx());
     192#if INTER_VIEW_VECTOR_SCALING_C0115
     193  rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx());    // will be changed to view_id
    190194#endif
    191195#if LGE_ILLUCOMP_B0045
     
    470474  #elif HHI_MPI
    471475  const int iExtraMergeCandidates = pSPS->getUseMVI() ? 1 : 0;
     476  #elif MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     477  const int iExtraMergeCandidates = ( isDepth || pSPS->getMultiviewMvPredMode() ) ? 1 : 0;
    472478  #else
    473479  const int iExtraMergeCandidates = pSPS->getMultiviewMvPredMode() ? 1 : 0;
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSlice.h

    r231 r280  
    120120  /// preparation of slice encoding (reference marking, QP and lambda)
    121121#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     122#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     123  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, bool isDepth );
     124#else
    122125  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS );
     126#endif
    123127#else
    124128  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS );
  • branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r210 r280  
    404404  pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() );
    405405
    406 #if SONY_COLPIC_AVAILABILITY
    407   pcPicCurr->setViewOrderIdx(m_iViewOrderIdx);
     406#if INTER_VIEW_VECTOR_SCALING_C0115
     407  pcPicCurr->setViewOrderIdx(m_iViewOrderIdx);    // will be changed to view_id
    408408#endif
    409409  pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
  • branches/HTM-5.1-dev0/source/Lib/TLibExtractor/TExtrTop.cpp

    r210 r280  
    8181     cSPS.setRPSList( &cRPS );
    8282#endif
    83 #if HHI_MPI
     83#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    8484#if VIDYO_VPS_INTEGRATION
    8585     m_cEntropyDecoder.decodeSPS( &cSPS, m_cVPS.getDepthFlag(uiLayerId) );
Note: See TracChangeset for help on using the changeset viewer.