Changeset 1196 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.cpp


Ignore:
Timestamp:
4 May 2015, 17:47:40 (9 years ago)
Author:
tech
Message:

Merged 14.0-dev0@1187.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r1179 r1196  
    6060 
    6161  m_skipFlag           = NULL;
    62 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     62#if H_3D
    6363  m_bDISFlag           = NULL;
    6464  m_uiDISType          = NULL;
    65 #else
    66 #if H_3D_SINGLE_DEPTH
    67   m_singleDepthFlag     = NULL;
    68   m_apSingleDepthValue  = NULL;
    69 #endif
    7065#endif
    7166  m_pePartSize         = NULL;
     
    158153  m_pbDBBPFlag         = NULL;
    159154#endif
    160 
    161155}
    162156
     
    186180
    187181    m_skipFlag           = new Bool[ uiNumPartition ];
    188 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     182#if H_3D
    189183    m_bDISFlag           = new Bool[ uiNumPartition ];
    190184    m_uiDISType          = (UInt*)xMalloc(UInt, uiNumPartition);
    191 #else
    192 #if H_3D_SINGLE_DEPTH
    193     m_singleDepthFlag     = new Bool[ uiNumPartition ];
    194     m_apSingleDepthValue  = (Pel*)xMalloc(Pel, uiNumPartition);
    195 #endif
    196185#endif
    197186    m_pePartSize         = new Char[ uiNumPartition ];
     
    337326
    338327    if ( m_skipFlag           ) { delete[] m_skipFlag;          m_skipFlag          = NULL; }
    339 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     328#if H_3D
    340329    if ( m_bDISFlag           ) { delete[] m_bDISFlag;   m_bDISFlag     = NULL; }
    341330    if ( m_uiDISType         ) { xFree(m_uiDISType);  m_uiDISType    = NULL; }
    342 #else
    343 #if H_3D_SINGLE_DEPTH
    344     if ( m_singleDepthFlag    ) { delete[] m_singleDepthFlag;   m_singleDepthFlag     = NULL; }
    345     if ( m_apSingleDepthValue ) { xFree(m_apSingleDepthValue);  m_apSingleDepthValue  = NULL; }
    346 #endif
    347331#endif
    348332    if ( m_pePartSize         ) { delete[] m_pePartSize;        m_pePartSize        = NULL; }
     
    506490    TComDataCU * pcFrom = pcPic->getCU(getAddr());
    507491    m_skipFlag[ui]   = pcFrom->getSkipFlag(ui);
    508 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     492#if H_3D
    509493    m_bDISFlag[ui]   = pcFrom->getDISFlag(ui);
    510494    m_uiDISType[ui]  = pcFrom->getDISType(ui);
    511 #else
    512 #if H_3D_SINGLE_DEPTH
    513     m_singleDepthFlag[ui]    = pcFrom->getSingleDepthFlag(ui);
    514     m_apSingleDepthValue[ui] = pcFrom->getSingleDepthValue(ui);
    515 #endif
    516495#endif
    517496    m_pePartSize[ui] = pcFrom->getPartitionSize(ui);
     
    566545  {
    567546    memset( m_skipFlag          + firstElement, false,                    numElements * sizeof( *m_skipFlag ) );
    568 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     547#if H_3D
    569548    memset( m_bDISFlag          + firstElement, false,                    numElements * sizeof( *m_bDISFlag ) );
    570549    memset( m_uiDISType         + firstElement,     0,                    numElements * sizeof( *m_uiDISType) );
    571 #else
    572 #if H_3D_SINGLE_DEPTH
    573     memset( m_singleDepthFlag     + firstElement, false,                  numElements * sizeof( *m_singleDepthFlag ) );
    574     memset( m_apSingleDepthValue  + firstElement,     0,                  numElements * sizeof( *m_apSingleDepthValue ) );
    575 #endif
    576550#endif
    577551    memset( m_pePartSize        + firstElement, SIZE_NONE,                numElements * sizeof( *m_pePartSize ) );
     
    758732      m_puhTransformSkip[2][ui] = 0;
    759733      m_skipFlag[ui]   = false;
    760 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     734#if H_3D
    761735      m_bDISFlag[ui]   = false;
    762736      m_uiDISType[ui]  = 0;
    763 #else
    764 #if H_3D_SINGLE_DEPTH
    765       m_singleDepthFlag[ui]     = false;
    766       m_apSingleDepthValue[ui]  = 0;
    767 #endif
    768737#endif
    769738      m_pePartSize[ui] = SIZE_NONE;
     
    891860  memset( m_puhCbf[2],          0, iSizeInUchar );
    892861  memset( m_puhDepth,     uiDepth, iSizeInUchar );
    893 #if H_3D_NBDV && !SEC_ARP_REM_ENC_RESTRICT_K0035
    894   m_pDvInfo->bDV = false;
    895 #endif
    896862#if H_3D_ARP
    897863  memset( m_puhARPW,            0, iSizeInUchar  );
     
    934900  {
    935901    m_skipFlag[ui]   = false;
    936 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     902#if H_3D
    937903    m_bDISFlag[ui]   = false;
    938904    m_uiDISType[ui]  = 0;
    939 #else
    940 #if H_3D_SINGLE_DEPTH
    941     m_singleDepthFlag[ui]   = false;
    942     m_apSingleDepthValue[ui]= 0;
    943 #endif
    944905#endif
    945906    m_pePartSize[ui] = SIZE_NONE;
     
    964925      m_puhTransformSkip[2][ui] = pcCU->getTransformSkip(uiPartOffset+ui,TEXT_CHROMA_V);
    965926      m_skipFlag[ui]   = pcCU->getSkipFlag(uiPartOffset+ui);
    966 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     927#if H_3D
    967928      m_bDISFlag[ui]    = pcCU->getDISFlag(uiPartOffset+ui);
    968929      m_uiDISType[ui]   = pcCU->getDISType(uiPartOffset+ui);
    969 #else
    970 #if H_3D_SINGLE_DEPTH
    971       m_singleDepthFlag[ui]    = pcCU->getSingleDepthFlag(uiPartOffset+ui);
    972       m_apSingleDepthValue[ui] = pcCU->getSingleDepthValue(uiPartOffset+ui);
    973 #endif
    974930#endif
    975931      m_pePartSize[ui] = pcCU->getPartitionSize(uiPartOffset+ui);
     
    1000956      m_pbICFlag          [ui] = pcCU->m_pbICFlag[uiPartOffset+ui];
    1001957#endif
    1002 
    1003 
    1004958#if H_3D_DIM
    1005959      for( Int i = 0; i < DIM_NUM_TYPE; i++ )
     
    11181072 
    11191073  m_skipFlag=pcCU->getSkipFlag()          + uiPart;
    1120 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1074#if H_3D
    11211075  m_bDISFlag     = pcCU->getDISFlag()     + uiPart;
    11221076  m_uiDISType    = pcCU->getDISType()     + uiPart;
    1123 #else
    1124 #if H_3D_SINGLE_DEPTH
    1125   m_singleDepthFlag     = pcCU->getSingleDepthFlag()   + uiPart;
    1126   m_apSingleDepthValue  = pcCU->getSingleDepthValue()  + uiPart;
    1127 #endif
    11281077#endif
    11291078  m_phQP=pcCU->getQP()                    + uiPart;
     
    11431092  m_pbSPIVMPFlag        = pcCU->getSPIVMPFlag()          + uiPart;
    11441093#endif
    1145 
    11461094#if H_3D_ARP
    11471095  m_puhARPW             = pcCU->getARPW()             + uiPart;
     
    11501098  m_pbICFlag            = pcCU->getICFlag()           + uiPart;
    11511099#endif
    1152 
    1153 
    11541100  m_puhLumaIntraDir     = pcCU->getLumaIntraDir()     + uiPart;
    11551101  m_puhChromaIntraDir   = pcCU->getChromaIntraDir()   + uiPart;
     
    12601206 
    12611207  m_skipFlag           = pcCU->getSkipFlag ()             + uiAbsPartIdx;
    1262 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1208#if H_3D
    12631209  m_bDISFlag           = pcCU->getDISFlag ()              + uiAbsPartIdx;
    12641210  m_uiDISType          = pcCU->getDISType()               + uiAbsPartIdx;
    1265 #else
    1266 #if H_3D_SINGLE_DEPTH
    1267   m_singleDepthFlag     = pcCU->getSingleDepthFlag ()             + uiAbsPartIdx;
    1268   m_apSingleDepthValue  = pcCU->getSingleDepthValue ()            + uiAbsPartIdx;
    1269 #endif
    12701211#endif
    12711212  m_pePartSize         = pcCU->getPartitionSize ()        + uiAbsPartIdx;
     
    12951236#endif
    12961237#if H_3D_SPIVMP
    1297   m_pbSPIVMPFlag       = pcCU->getSPIVMPFlag()               + uiAbsPartIdx;
    1298 #endif
    1299 
     1238  m_pbSPIVMPFlag       = pcCU->getSPIVMPFlag()            + uiAbsPartIdx;
     1239#endif
    13001240  m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx;
    1301   m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx;
    1302  
     1241  m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 
    13031242#if H_3D_ARP
    13041243  m_puhARPW            = pcCU->getARPW()                  + uiAbsPartIdx;
    1305 #endif
    1306 
    1307    
     1244#endif   
    13081245#if H_3D_DBBP
    13091246  m_pbDBBPFlag       = pcCU->getDBBPFlag()              + uiAbsPartIdx;
     
    13401277  Int sizeInChar  = sizeof( Char ) * uiNumPartition;
    13411278  memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
    1342 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1279#if H_3D
    13431280  memcpy( m_bDISFlag   + uiOffset, pcCU->getDISFlag(),       sizeof( *m_bDISFlag )   * uiNumPartition );
    13441281  memcpy( m_uiDISType  + uiOffset, pcCU->getDISType(),       sizeof( *m_uiDISType )  * uiNumPartition);
    1345 #else
    1346 #if H_3D_SINGLE_DEPTH
    1347   memcpy( m_singleDepthFlag     + uiOffset, pcCU->getSingleDepthFlag(),       sizeof( *m_singleDepthFlag )   * uiNumPartition );
    1348   memcpy( m_apSingleDepthValue  + uiOffset, pcCU->getSingleDepthValue(),      sizeof( *m_apSingleDepthValue ) * uiNumPartition);
    1349 #endif
    13501282#endif
    13511283  memcpy( m_phQP       + uiOffset, pcCU->getQP(),             sizeInChar                        );
     
    13581290  memcpy( m_piVSPFlag           + uiOffset, pcCU->getVSPFlag(),           sizeof( Char ) * uiNumPartition );
    13591291  memcpy( m_pDvInfo             + uiOffset, pcCU->getDvInfo(),            sizeof( *m_pDvInfo ) * uiNumPartition );
    1360 
    13611292#endif
    13621293#if H_3D_SPIVMP
     
    13741305  memcpy( m_puhCbf[1] + uiOffset, pcCU->getCbf(TEXT_CHROMA_U), iSizeInUchar );
    13751306  memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar );
    1376 
    1377 
    1378 
    13791307#if H_3D_DIM
    13801308  for( Int i = 0; i < DIM_NUM_TYPE; i++ )
     
    14651393
    14661394  memcpy( rpcCU->getSkipFlag() + m_uiAbsIdxInLCU, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
    1467 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1395#if H_3D
    14681396  memcpy( rpcCU->getDISFlag()  + m_uiAbsIdxInLCU, m_bDISFlag,    sizeof( *m_bDISFlag )  * m_uiNumPartition );
    14691397  memcpy( rpcCU->getDISType()  + m_uiAbsIdxInLCU, m_uiDISType,   sizeof( *m_uiDISType ) * m_uiNumPartition );
    1470 #else
    1471 #if H_3D_SINGLE_DEPTH
    1472   memcpy( rpcCU->getSingleDepthFlag()  + m_uiAbsIdxInLCU, m_singleDepthFlag,    sizeof( *m_singleDepthFlag ) * m_uiNumPartition );
    1473   memcpy( rpcCU->getSingleDepthValue() + m_uiAbsIdxInLCU, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * m_uiNumPartition);
    1474 #endif
    14751398#endif
    14761399  memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar  );
     
    14781401  memcpy( rpcCU->getDvInfo()         + m_uiAbsIdxInLCU, m_pDvInfo,    sizeof(* m_pDvInfo)     * m_uiNumPartition );
    14791402#endif
    1480 
    1481 
    14821403  memcpy( rpcCU->getPartitionSize()  + m_uiAbsIdxInLCU, m_pePartSize, sizeof( *m_pePartSize ) * m_uiNumPartition );
    14831404  memcpy( rpcCU->getPredictionMode() + m_uiAbsIdxInLCU, m_pePredMode, sizeof( *m_pePredMode ) * m_uiNumPartition );
     
    15851506  Int sizeInChar  = sizeof( Char ) * uiQNumPart;
    15861507  memcpy( rpcCU->getSkipFlag()       + uiPartOffset, m_skipFlag,   sizeof( *m_skipFlag )   * uiQNumPart );
    1587 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1508#if H_3D
    15881509  memcpy( rpcCU->getDISFlag()  + uiPartOffset, m_bDISFlag,    sizeof( *m_bDISFlag )   * uiQNumPart );
    15891510  memcpy( rpcCU->getDISType()  + uiPartOffset, m_uiDISType,   sizeof( *m_uiDISType )  * uiQNumPart );
    1590 #else
    1591 #if H_3D_SINGLE_DEPTH
    1592   memcpy( rpcCU->getSingleDepthFlag()  + uiPartOffset, m_singleDepthFlag,    sizeof( *m_singleDepthFlag )   * uiQNumPart );
    1593   memcpy( rpcCU->getSingleDepthValue() + uiPartOffset, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * uiQNumPart);
    1594 #endif
    15951511#endif
    15961512  memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar );
     
    16161532  memcpy( rpcCU->getCbf(TEXT_CHROMA_U) + uiPartOffset, m_puhCbf[1], iSizeInUchar );
    16171533  memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar );
    1618 
    1619 
    16201534#if H_3D_DIM
    16211535  for( Int i = 0; i < DMM_NUM_TYPE; i++ )
     
    23522266  {
    23532267    return NULL;
    2354   }
    2355  
     2268  } 
    23562269#if H_3D_FCO
    23572270  TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
     
    23882301    Int iPictureHeight = depthPicYuv->getHeight();
    23892302   
    2390 #if !HS_DBBP_CLEAN_K0048
    2391     Int iWidth  = uiWidth;
    2392     Int iHeight = uiHeight;
    2393 #endif
    23942303   
    23952304    Bool depthRefineFlag = false;
     
    24042313    }
    24052314   
    2406 #if HS_DBBP_CLEAN_K0048
    24072315    Int depthPosX = Clip3(0,   iPictureWidth - 1,  iBlkX + ((cDv.getHor()+2)>>2));
    24082316    Int depthPosY = Clip3(0,   iPictureHeight - 1, iBlkY + ((cDv.getVer()+2)>>2));
    2409 #else
    2410     Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
    2411     Int depthPosY = Clip3(0,   iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2));
    2412 #endif
    24132317   
    24142318    pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride;
     
    25002404  memset( m_skipFlag + absPartIdx, skip, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
    25012405}
    2502 
    2503 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2406#if H_3D
    25042407Void TComDataCU::setDISFlagSubParts( Bool bDIS, UInt absPartIdx, UInt depth )
    25052408{
     
    25122415    setSubPartT( uiDISType, m_uiDISType, uiAbsPartIdx, uiDepth, uiPUIdx );
    25132416}
    2514 #else
    2515 #if H_3D_SINGLE_DEPTH
    2516 Void TComDataCU::setSingleDepthFlagSubParts( Bool singleDepth, UInt absPartIdx, UInt depth )
    2517 {
    2518   assert( sizeof( *m_singleDepthFlag) == 1 );
    2519   memset( m_singleDepthFlag + absPartIdx, singleDepth, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
    2520 }
    2521 
    2522 Void TComDataCU::setSingleDepthValueSubParts(Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth )
    2523 {
    2524   setSubPartT<Pel>( singleDepthValue, m_apSingleDepthValue, uiAbsPartIdx, uiDepth, uiPUIdx );
    2525 }
    2526 #endif
    25272417#endif
    25282418
     
    39413831#endif
    39423832#if H_3D_ARP
    3943   Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false;
     3833  Bool bARPFlag = getARPW(uiAbsPartIdx) > 0;
    39443834#endif
    39453835#if H_3D_DBBP
     
    39743864    m_mergCands[MRG_A1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
    39753865#if H_3D_VSP
    3976     ,
    3977       (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
     3866    , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    39783867#if H_3D_IC
    39793868      && !bICFlag
     
    39983887    m_mergCands[MRG_B1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
    39993888#if H_3D_VSP
    4000     ,
    4001       false
     3889    , false
    40023890#endif
    40033891      , false
     
    40263914    m_mergCands[MRG_A0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
    40273915#if H_3D_VSP
    4028     ,
    4029       false
     3916    , false
    40303917#endif
    40313918      , false
     
    40403927    m_mergCands[MRG_B2].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
    40413928#if H_3D_VSP
    4042     ,
    4043       false
     3929    , false
    40443930#endif
    40453931      , false
     
    40683954    TComPic * pcTexPic = m_pcSlice->getTexturePic();
    40693955#if H_3D_FCO
    4070 #if H_3D_FCO
    40713956    if (pcTexPic && pcTexPic->getReconMark())
    4072 #else
    4073     if (pcTexturePic->getReconMark())
    4074 #endif
    40753957    {
    40763958#endif   
     
    41073989      Int         iTexPosX, iTexPosY;
    41083990      const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4109      
     3991
    41103992      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iPUWidth ) >> 1 )  * iPUWidth + ( iPUWidth >> 1 );
    41113993      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iPUHeight ) >> 1 )  * iPUHeight + (iPUHeight >> 1);
     
    41143996      if(iWidth == iPUWidth && iHeight == iPUHeight)
    41153997      {
    4116           iCenterPosX = iCurrPosX + (iWidth >> 1);
    4117           iCenterPosY = iCurrPosY + (iHeight >> 1);
     3998        iCenterPosX = iCurrPosX + (iWidth >> 1);
     3999        iCenterPosY = iCurrPosY + (iHeight >> 1);
    41184000      }
    41194001
     
    41514033      if ( bSPIVMPFlag == true )
    41524034      {   
    4153           iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
    4154           tmpDir = iInterDirSaved;
    4155           tmpMV[0] = cMvFieldSaved[0];
    4156           tmpMV[1] = cMvFieldSaved[1];
     4035        iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
     4036        tmpDir = iInterDirSaved;
     4037        tmpMV[0] = cMvFieldSaved[0];
     4038        tmpMV[1] = cMvFieldSaved[1];
    41574039      }
    41584040
     
    41804062                  TComMv cMv = cTexMvField.getMv() + cMvRounding;
    41814063                  cMv >>=2;         
    4182 #if !(NTT_BUG_FIX_TK54)
    4183                   this->clipMv( cMv );
    4184 #endif
    41854064                  pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
    41864065                }
     
    41974076              }
    41984077            }
    4199 #if !SHARP_SUBBLOCK_CLEAN_K0044
    4200             if (iPUHeight + iPUWidth == 12)
    4201             {
    4202               if (puhInterDirSP[iPartition] == 3)
    4203               {
    4204                 puhInterDirSP[iPartition] = 1;
    4205                 pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
    4206               }
    4207             }
    4208 #endif
    42094078
    42104079            iPartition ++;
     
    43094178    if (!bRemoveSpa)
    43104179    {
    4311       Bool SPIVMPFlag = false;
     4180      Bool spiMvpFlag = false;
    43124181      if(!m_pcSlice->getIsDepth())
    43134182      {
    4314         SPIVMPFlag = true;
     4183        spiMvpFlag = true;
    43154184      }
    43164185#if H_3D_DBBP
    4317       SPIVMPFlag &= !bDBBPFlag;
    4318 #endif
    4319 
    4320       m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);
     4186      spiMvpFlag &= !bDBBPFlag;
     4187#endif
     4188
     4189      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, spiMvpFlag);
    43214190
    43224191      if ( mrgCandIdx == iCount )
     
    54225291}
    54235292
    5424 #if SONY_MV_V_CONST_C0078
    5425 Void TComDataCU::checkMV_V (TComMv&  rcMv,  RefPicList eRefPicList, int iRefIdx )
     5293#if H_MV
     5294Void TComDataCU::checkMvVertRest (TComMv&  rcMv,  RefPicList eRefPicList, int iRefIdx )
    54265295{
    54275296  if ( getSlice()->getSPS()->getInterViewMvVertConstraintFlag() )
     
    57805649  }
    57815650
    5782   if ( bIsCurrRefLongTerm || bIsColRefLongTerm ) // CY: this condition equals to both bIsCurrRefLongTerm and bIsColRefLongTerm being 1
     5651  if ( bIsCurrRefLongTerm || bIsColRefLongTerm )
    57835652  {
    57845653#if H_3D_TMVP
    5785 #if !H_3D_FIX_TMVP_SCALING_VIEW_ID
    5786     Int iCurrViewId    = m_pcSlice->getViewIndex ();
    5787     Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewIndex ();
    5788     Int iColViewId     = pColCU->getSlice()->getViewIndex();
    5789     Int iColRefViewId  = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewIndex();
    5790 #else
    57915654    Int iCurrViewId    = m_pcSlice->getViewId ();
    57925655    Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId ();
    57935656    Int iColViewId     = pColCU->getSlice()->getViewId();
    57945657    Int iColRefViewId  = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId();
    5795 #endif
    5796 #if H_3D_TMVP_SCALING_FIX_K0053
    57975658    iScale = 4096;
    57985659    if ( iCurrRefViewId != iCurrViewId && iColViewId != iColRefViewId )
    5799 #endif
     5660    {
    58005661      iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId );
    5801 #if H_3D_TMVP_FIX_TICKET_97
     5662    }
    58025663    if ( bMRG && iScale != 4096 && m_pcSlice->getIvMvScalingFlag( ) )
    5803 #else
    5804     if ( iScale != 4096 && m_pcSlice->getIvMvScalingFlag( ) )
    5805 #endif
    58065664    {
    58075665      rcMv = cColMv.scaleMv( iScale );
     
    58155673#endif
    58165674  }
    5817   else // CY: both bIsCurrRefLongTerm and bIsColRefLongTerm are 0
     5675  else
    58185676  {
    58195677    iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     
    59795837}
    59805838#endif
     5839
    59815840#if H_3D_IV_MERGE
    5982 #if SEC_ARP_REM_ENC_RESTRICT_K0035
    59835841Void TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    5984 #else
    5985 Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    5986 #endif
    5987 {
    5988 
     5842{
    59895843  assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
    59905844
     
    59925846  if ( getSlice()->getDefaultRefViewIdxAvailableFlag() )
    59935847  {
    5994       Int iViewIdx = getSlice()->getDefaultRefViewIdx();
    5995       pDisp->m_aVIdxCan = iViewIdx;
    5996       Int iDisp     = getSlice()->getDepthToDisparityB( iViewIdx )[ (Int64) (1 << ( getSlice()->getSPS()->getBitDepthY() - 1 )) ];
    5997 
    5998       cMv.setHor(iDisp);
    5999       cMv.setVer(0);
    6000       pDisp->m_acNBDV = cMv;
    6001       pDisp->m_aVIdxCan = iViewIdx;
    6002 #if !SEC_ARP_REM_ENC_RESTRICT_K0035
    6003       return true;
    6004 #endif
    6005   }
    6006 #if !SEC_ARP_REM_ENC_RESTRICT_K0035
    6007   return false;
    6008 #endif
    6009 }
    6010 #endif
    6011 
    6012 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     5848    Int iViewIdx = getSlice()->getDefaultRefViewIdx();
     5849    pDisp->m_aVIdxCan = iViewIdx;
     5850    Int iDisp     = getSlice()->getDepthToDisparityB( iViewIdx )[ (Int64) (1 << ( getSlice()->getSPS()->getBitDepthY() - 1 )) ];
     5851
     5852    cMv.setHor(iDisp);
     5853    cMv.setVer(0);
     5854    pDisp->m_acNBDV = cMv;
     5855    pDisp->m_aVIdxCan = iViewIdx;
     5856  }
     5857}
     5858#endif
     5859
     5860#if H_3D
    60135861Bool TComDataCU::getNeighDepth ( UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index )
    60145862{
    6015 #if NEIGHBORING_PIX_AVAILABILITY_FIX
    60165863  UInt  uiPartIdxLT, uiPartIdxRT;
    60175864  this->deriveLeftRightTopIdxAdi( uiPartIdxLT, uiPartIdxRT, 0, 0 );
     
    60665913
    60675914  return bDepAvail;
    6068 #else
    6069   Bool bDepAvail = false;
    6070   Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
    6071   Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
    6072 
    6073   Int xP, yP, nPSW, nPSH;
    6074   this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
    6075   UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight();
    6076   UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth();
    6077   switch(index)
    6078   {
    6079   case 0: // Mid Left
    6080     if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) )
    6081     {
    6082       *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ];
    6083       bDepAvail = true;
    6084     }
    6085     break;
    6086   case 1: // Mid Above
    6087     if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) )
    6088     {
    6089       *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ];
    6090       bDepAvail = true;
    6091     }
    6092     break;
    6093   default:
    6094     break;
    6095   }
    6096   return bDepAvail;
    6097 #endif
    6098 }
    6099 #else
    6100 #if H_3D_SINGLE_DEPTH
    6101 Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index)
    6102 {
    6103 
    6104   Bool bDepAvail = false;
    6105   Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
    6106   Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
    6107 
    6108   Int xP, yP, nPSW, nPSH;
    6109   this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
    6110   UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight();
    6111   UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth();
    6112   switch(index)
    6113   {
    6114   case 0: // Mid Left
    6115     if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) )
    6116     {
    6117       *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ];
    6118       bDepAvail = true;
    6119     }
    6120     break;
    6121   case 1: // Mid Above
    6122     if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) )
    6123     {
    6124       *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ];
    6125       bDepAvail = true;
    6126     }
    6127     break;
    6128   default:
    6129       break;
    6130   }
    6131   return bDepAvail;
    6132 }
    6133 #endif
    6134 #endif
    6135 
     5915}
     5916#endif
    61365917#if H_3D_NBDV
    61375918//Notes from QC:
     
    61395920//TBD#2: set of DvMCP values need to be done as part of inter-view motion prediction process. Remove this comment once merge related integration is done
    61405921//To be checked: Parallel Merge features for NBDV, related to DV_DERIVATION_PARALLEL_B0096 and LGE_IVMP_PARALLEL_MERGE_B0136 are not integrated. The need of these features due to the adoption of CU-based NBDV is not clear. We need confirmation on this, especially by proponents
    6141 #if SEC_ARP_REM_ENC_RESTRICT_K0035
    61425922Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo
    6143 #else
    6144 Bool TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo
    6145 #endif
    61465923#if H_3D_NBDV_REF
    61475924, Bool bDepthRefine
     
    61515928  //// ******* Init variables ******* /////
    61525929  // Init disparity struct for results
    6153 #if !SEC_ARP_REM_ENC_RESTRICT_K0035
    6154   pDInfo->bDV = false;   
    6155 #endif
    61565930  pDInfo->m_aVIdxCan = -1;
    61575931
     
    62175991      if( bCheck )
    62185992      {
    6219 #if !(NTT_BUG_FIX_TK54)
    6220         clipMv(cColMv);
    6221 #endif
    62225993        pDInfo->m_acNBDV = cColMv;
    62235994        pDInfo->m_aVIdxCan  = iTargetViewIdx;
     
    62396010#else
    62406011        picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
    6241 #if !BUG_FIX_TK65
    6242         assert(picDepth != NULL);
    6243 #endif
    62446012#endif
    62456013        if (picDepth && bDepthRefine)
     6014        {
    62466015          estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv );
    6247 
     6016        }
    62486017        pDInfo->m_acDoNBDV  = cColMv;
    62496018#endif //H_3D_NBDV_REF
    6250 #if SEC_ARP_REM_ENC_RESTRICT_K0035
    62516019        return;
    6252 #else
    6253         return true;
    6254 #endif
    62556020      }
    62566021    }
     
    62696034#endif
    62706035    ) )
    6271 #if SEC_ARP_REM_ENC_RESTRICT_K0035
    62726036    return;
    6273 #else
    6274     return true;
    6275 #endif
    62766037
    62776038  //// ******* Get disparity from above block ******* /////
     
    62856046#endif
    62866047      ) )
    6287 #if SEC_ARP_REM_ENC_RESTRICT_K0035
    62886048      return;
    6289 #else
    6290       return true;
    6291 #endif
    62926049  }
    62936050
     
    63026059        {
    63036060          TComMv cDispVec = cIDVInfo.m_acMvCand[iList][ curPos ];
    6304 #if !(NTT_BUG_FIX_TK54)
    6305           clipMv( cDispVec );
    6306 #endif
    63076061          pDInfo->m_acNBDV = cDispVec;
    63086062          pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ];
     
    63246078#else
    63256079          TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan );
    6326 #if !BUG_FIX_TK65
    6327           assert(picDepth!=NULL);
    6328 #endif
    63296080#endif
    63306081
     
    63356086          pDInfo->m_acDoNBDV = cDispVec;
    63366087#endif
    6337 #if SEC_ARP_REM_ENC_RESTRICT_K0035
    63386088          return;
    6339 #else
    6340           return true;
    6341 #endif
    63426089        }
    63436090      }
     
    63506097  if (getSlice()->getDefaultRefViewIdxAvailableFlag())
    63516098  {
    6352       pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx();
     6099    pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx();
    63536100
    63546101#if H_3D_NBDV_REF
    6355           TComPic* picDepth = NULL;
     6102    TComPic* picDepth = NULL;
    63566103#if H_3D_FCO_VSP_DONBDV_E0163
    6357           picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
    6358       if ( picDepth->getPicYuvRec() != NULL ) 
    6359       {
    6360           defaultDV.setZero();
    6361       }
    6362       else // Go back with virtual depth
    6363       {
    6364           picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());
    6365       }
    6366 
    6367       assert(picDepth != NULL);
     6104    picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
     6105    if ( picDepth->getPicYuvRec() != NULL ) 
     6106    {
     6107      defaultDV.setZero();
     6108    }
     6109    else // Go back with virtual depth
     6110    {
     6111      picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());
     6112    }
     6113
     6114    assert(picDepth != NULL);
    63686115#else
    6369           picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());
    6370 #endif
    6371       if (picDepth && bDepthRefine)
    6372       {
    6373           estimateDVFromDM(getSlice()->getDefaultRefViewIdx(), uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view
    6374       }
    6375       pDInfo->m_acDoNBDV = defaultDV;
    6376 #endif
    6377 #if !SEC_ARP_REM_ENC_RESTRICT_K0035
    6378       return true;
    6379 #endif
    6380   }
    6381 #if !SEC_ARP_REM_ENC_RESTRICT_K0035
    6382   return false;
    6383 #endif
     6116    picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());
     6117#endif
     6118    if (picDepth && bDepthRefine)
     6119    {
     6120      estimateDVFromDM(getSlice()->getDefaultRefViewIdx(), uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view
     6121    }
     6122    pDInfo->m_acDoNBDV = defaultDV;
     6123#endif
     6124  }
    63846125}
    63856126
     
    64236164    Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT );
    64246165    cMvPred->setHor( iDisp );
    6425 #if !(NTT_BUG_FIX_TK54)
    6426     clipMv(*cMvPred);
    6427 #endif
    64286166  }
    64296167}
     
    64516189        if (refViewIdx != m_pcSlice->getViewIndex())
    64526190        {
    6453 #if !(NTT_BUG_FIX_TK54)
    6454           clipMv(cMvPred);
    6455 #endif
    64566191          pNbDvInfo->m_acNBDV = cMvPred;
    64576192          pNbDvInfo->m_aVIdxCan = refViewIdx;
     
    64726207#else
    64736208          picDepth   = getSlice()->getIvPic (true, refViewIdx );
    6474 #if !BUG_FIX_TK65
    6475           assert(picDepth != NULL);
    6476 #endif
    64776209#endif
    64786210          UInt uiPartIdx = 0;   //Notes from MTK: Please confirm that using 0 as partition index and partition address is correct for CU-level DoNBDV
     
    64806212
    64816213          if (picDepth && bDepthRefine)
     6214          {
    64826215            estimateDVFromDM(refViewIdx, uiPartIdx, picDepth, uiPartAddr, &cMvPred );
    6483 
     6216          }
    64846217          pNbDvInfo->m_acDoNBDV = cMvPred;
    64856218#endif
     
    68706603#endif
    68716604#endif
    6872 #if !(NTT_BUG_FIX_TK54)
    6873                       clipMv( cMv );
    6874 #endif
    68756605                      paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
    68766606                      pacPdmMv      [ uiCurrRefListId ] = cMv;
     
    69046634                {
    69056635                  RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    6906                   Bool bLoop_stop = false;
    6907                   for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     6636                  Bool bLoopStop = false;
     6637                  for(Int iLoop = 0; iLoop < 2 && !bLoopStop; ++iLoop)
    69086638                  {
    69096639                    RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     
    69316661                            }
    69326662
    6933 #if !(NTT_BUG_FIX_TK54)
    6934                             clipMv( cMv );
    6935 #endif
    6936                             bLoop_stop = true;
     6663                            bLoopStop = true;
    69376664
    69386665                            pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
     
    69546681
    69556682              }
    6956 #if !SHARP_SUBBLOCK_CLEAN_K0044
    6957               if (iSPHeight + iSPWidth == 12)
    6958               {
    6959                 if (puhInterDirSP[iPartition] == 3)
    6960                 {
    6961                   puhInterDirSP[iPartition] = 1;
    6962                   pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
    6963                 }
    6964               }
    6965 #endif
    69666683              iPartition ++;
    69676684            }
     
    69966713      Int         iBaseAbsPartIdx;
    69976714
    6998 #if SEC_SHIFTED_IVMC_POS_K0036
    69996715      Int offsetW = (iLoopCan == 0) ? 0 : ( iWidth  * 2 );
    70006716      Int offsetH = (iLoopCan == 0) ? 0 : ( iHeight * 2 );
    7001 #else
    7002       Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 );
    7003       Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
    7004 #endif
    70056717
    70066718      Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
     
    70486760#endif
    70496761#endif
    7050 #if !(NTT_BUG_FIX_TK54)
    7051                     clipMv( cMv );
    7052 #endif
    70536762                    paiPdmRefIdx  [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx;
    70546763                    pacPdmMv      [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv;
     
    71046813#endif
    71056814            cMv.setVer( 0 );
    7106 #if !(NTT_BUG_FIX_TK54)
    7107             clipMv( cMv );
    7108 #endif
    71096815            pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
    71106816          }
     
    71876893{
    71886894  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
    7189   for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
     6895  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ )
     6896  {
     6897    m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx;
     6898  }
    71906899}
    71916900#endif
Note: See TracChangeset for help on using the changeset viewer.