Ignore:
Timestamp:
14 Jul 2015, 12:31:09 (9 years ago)
Author:
tech
Message:

Merged HTM-14.1-update-dev3@1273.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComPrediction.cpp

    r1226 r1274  
    8282    }
    8383  }
    84 #if H_3D_VSP
    85   m_pDepthBlock = (Int*) malloc(MAX_NUM_SPU_W*MAX_NUM_SPU_W*sizeof(Int));
     84#if NH_3D_VSP
     85  m_pDepthBlock = (Int*) malloc(MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH*sizeof(Int));
    8686  if (m_pDepthBlock == NULL)
    8787  {
     
    9494TComPrediction::~TComPrediction()
    9595{
    96 #if H_3D_VSP
     96#if NH_3D_VSP
    9797  if (m_pDepthBlock != NULL)
    9898  {
     
    123123  m_cYuvPredTemp.destroy();
    124124
    125 #if H_3D_ARP
     125#if NH_3D_ARP
    126126  m_acYuvPredBase[0].destroy();
    127127  m_acYuvPredBase[1].destroy();
     
    182182
    183183    m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    184 #if H_3D_ARP
    185     m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    186     m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    187 #endif
    188 #if H_3D_VSP
    189     m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     184#if NH_3D_ARP
     185    m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
     186    m_acYuvPredBase[1] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
     187#endif
     188#if NH_3D_VSP
     189    m_cYuvDepthOnVsp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    190190#endif
    191191
     
    648648      Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC();
    649649      Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC();
    650 #if H_3D_ARP
     650#if NH_3D_ARP
    651651      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
    652652#else
     
    661661}
    662662
    663 #if H_3D_SPIVMP
     663#if NH_3D_SPIVMP
    664664Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr )
    665665{
     
    670670    pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
    671671  }
     672#if H_3D_ARP // check this!
    672673  if( pcCU->getARPW( uiPartAddr ) != 0 )
    673674  {
    674675    return;
    675676  }
     677#endif
    676678
    677679  // horizontal sub-PU merge
     
    747749#endif
    748750
    749 #if H_3D_DBBP
     751#if NH_3D_DBBP
    750752PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU)
    751753{
     754  const TComSPS* sps = pcCU->getSlice()->getSPS();
     755  UInt uiMaxCUWidth = sps->getMaxCUWidth();
     756  UInt uiMaxCUHeight = sps->getMaxCUHeight();
     757 
    752758  // find virtual partitioning for this CU based on depth block
    753759  // segmentation of texture block --> mask IDs
     
    757763  Int iSumDepth = 0;
    758764  Int iSubSample = 4;
    759   Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth();
    760   Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight();
     765  Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y);
     766  Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y);
    761767  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
    762768  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     
    764770    cDv.setVer(0);
    765771  }
    766   Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);
    767   Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);
     772  Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2);
     773  Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2);
    768774 
    769775  UInt t=0;
     
    852858  }
    853859
    854   PartSize matchedPartSize = SIZE_NONE;
     860  PartSize matchedPartSize = NUMBER_OF_PART_SIZES;
    855861
    856862  Int iMaxMatchSum = 0;
     
    867873  }
    868874
    869   AOF( matchedPartSize != SIZE_NONE );
     875  AOF( matchedPartSize != NUMBER_OF_PART_SIZES );
    870876
    871877  return matchedPartSize;
     
    874880Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU)
    875881{
     882  const TComSPS* sps = pcCU->getSlice()->getSPS();
     883  UInt uiMaxCUWidth = sps->getMaxCUWidth();
     884  UInt uiMaxCUHeight = sps->getMaxCUHeight();
     885 
    876886  // segmentation of texture block --> mask IDs
    877887  Pel*  pDepthBlockStart      = pDepthPels;
     
    885895  iSumDepth  = pDepthPels[ 0 ];
    886896 
    887   Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth();
    888   Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); 
     897  Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y);
     898  Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 
    889899  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
    890900  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     
    892902    cDv.setVer(0);
    893903  }
    894   Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);
    895   Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);
     904  Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2);
     905  Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2);
    896906  if (iBlkX>(Int)(iPictureWidth - uiWidth))
    897907  {
     
    10081018}
    10091019
    1010 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )
    1011 {
    1012   Pel*  piSrc[2]    = {pInYuv[0]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};
    1013   UInt  uiSrcStride = pInYuv[0]->getStride();
    1014   Pel*  piDst       = pOutYuv->getLumaAddr(uiPartAddr);
    1015   UInt  uiDstStride = pOutYuv->getStride();
     1020Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY )
     1021{
     1022  Pel*  piSrc[2]    = {pInYuv[0]->getAddr(COMPONENT_Y, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Y, uiPartAddr)};
     1023  UInt  uiSrcStride = pInYuv[0]->getStride(COMPONENT_Y);
     1024  Pel*  piDst       = pOutYuv->getAddr(COMPONENT_Y, uiPartAddr);
     1025  UInt  uiDstStride = pOutYuv->getStride(COMPONENT_Y);
    10161026 
    10171027  UInt  uiMaskStride= MAX_CU_SIZE;
     
    10521062        right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
    10531063       
    1054         piDst[x] = (l!=r) ? ClipY( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];
     1064        piDst[x] = (l!=r) ? ClipBD( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x];
    10551065      }
    10561066      piDst     += uiDstStride;
     
    10701080        bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
    10711081       
    1072         piDst[x] = (t!=b) ? ClipY( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];
     1082        piDst[x] = (t!=b) ? ClipBD( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x];
    10731083      }
    10741084      piDst     += uiDstStride;
     
    10831093 
    10841094  // now combine chroma
    1085   Pel*  piSrcU[2]       = { pInYuv[0]->getCbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) };
    1086   Pel*  piSrcV[2]       = { pInYuv[0]->getCrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) };
    1087   UInt  uiSrcStrideC    = pInYuv[0]->getCStride();
    1088   Pel*  piDstU          = pOutYuv->getCbAddr(uiPartAddr);
    1089   Pel*  piDstV          = pOutYuv->getCrAddr(uiPartAddr);
    1090   UInt  uiDstStrideC    = pOutYuv->getCStride();
     1095  Pel*  piSrcU[2]       = { pInYuv[0]->getAddr(COMPONENT_Cb, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cb, uiPartAddr) };
     1096  Pel*  piSrcV[2]       = { pInYuv[0]->getAddr(COMPONENT_Cr, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cr, uiPartAddr) };
     1097  UInt  uiSrcStrideC    = pInYuv[0]->getStride(COMPONENT_Cb);
     1098  Pel*  piDstU          = pOutYuv->getAddr(COMPONENT_Cb, uiPartAddr);
     1099  Pel*  piDstV          = pOutYuv->getAddr(COMPONENT_Cr, uiPartAddr);
     1100  UInt  uiDstStrideC    = pOutYuv->getStride(COMPONENT_Cb);
    10911101  UInt  uiWidthC        = uiWidth >> 1;
    10921102  UInt  uiHeightC       = uiHeight >> 1;
     
    11341144        if (l!=r)
    11351145        {
    1136           filSrcU = ClipC( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
    1137           filSrcV = ClipC( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));
     1146          filSrcU = ClipBD( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ), bitDepthY);
     1147          filSrcV = ClipBD( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ), bitDepthY);
    11381148        }
    11391149        else
     
    11671177        if (t!=b)
    11681178        {
    1169           filSrcU = ClipC( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));
    1170           filSrcV = ClipC( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));
     1179          filSrcU = ClipBD( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ), bitDepthY);
     1180          filSrcV = ClipBD( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ), bitDepthY);
    11711181        }
    11721182        else
     
    12051215  {
    12061216    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    1207 #if H_3D_VSP
     1217#if NH_3D_VSP
    12081218    if ( pcCU->getVSPFlag(uiPartAddr) == 0)
    12091219    {
    12101220#endif
    1211     if ( eRefPicList != REF_PIC_LIST_X )
    1212     {
    1213       if( pcCU->getSlice()->getPPS()->getUseWP())
    1214       {
    1215         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true );
     1221      if ( eRefPicList != REF_PIC_LIST_X )
     1222      {
     1223        if( pcCU->getSlice()->getPPS()->getUseWP())
     1224        {
     1225          xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true );
     1226        }
     1227        else
     1228        {
     1229          xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
     1230        }
     1231        if ( pcCU->getSlice()->getPPS()->getUseWP() )
     1232        {
     1233          xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
     1234        }
    12161235      }
    12171236      else
    12181237      {
    1219         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
    1220       }
    1221       if ( pcCU->getSlice()->getPPS()->getUseWP() )
    1222       {
    1223         xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
    1224       }
    1225     }
    1226     else
    1227     {
    1228 #if H_3D_SPIVMP
     1238#if NH_3D_SPIVMP
    12291239        if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    12301240        {
     
    12581268        {
    12591269#endif
     1270          if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
     1271          {
     1272            xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
     1273          }
     1274          else
     1275          {
     1276            xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
     1277          }
     1278#if NH_3D_SPIVMP
     1279        }
     1280#endif
     1281      }
     1282#if NH_3D_VSP
     1283    }
     1284    else
     1285    {
    12601286      if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    12611287      {
    1262         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
     1288        xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
    12631289      }
    12641290      else
    12651291      {
    1266         xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    1267       }
    1268 #if H_3D_SPIVMP
    1269         }
    1270 #endif
    1271     }
    1272 #if H_3D_VSP
     1292        xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
     1293      }
     1294    }
     1295#endif
     1296    return;
     1297  }
     1298
     1299  for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ )
     1300  {
     1301    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
     1302
     1303#if NH_3D_VSP
     1304    if ( pcCU->getVSPFlag(uiPartAddr) == 0 )
     1305    {
     1306#endif
     1307    if ( eRefPicList != REF_PIC_LIST_X )
     1308    {
     1309      if( pcCU->getSlice()->getPPS()->getUseWP())
     1310      {
     1311        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true );
     1312      }
     1313      else
     1314      {
     1315        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
     1316      }
     1317      if ( pcCU->getSlice()->getPPS()->getUseWP() )
     1318      {
     1319        xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
     1320      }
    12731321    }
    12741322    else
    12751323    {
    1276       if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    1277       {
    1278         xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
    1279       }
    1280       else
    1281       {
    1282         xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    1283       }
    1284     }
    1285 #endif
    1286     return;
    1287   }
    1288 
    1289   for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ )
    1290   {
    1291     pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    1292 
    1293 #if H_3D_VSP
    1294     if ( pcCU->getVSPFlag(uiPartAddr) == 0 )
    1295     {
    1296 #endif
    1297     if ( eRefPicList != REF_PIC_LIST_X )
    1298     {
    1299       if( pcCU->getSlice()->getPPS()->getUseWP())
    1300       {
    1301         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true );
    1302       }
    1303       else
    1304       {
    1305         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
    1306       }
    1307       if ( pcCU->getSlice()->getPPS()->getUseWP() )
    1308       {
    1309         xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred );
    1310       }
    1311     }
    1312     else
    1313     {
    1314 #if H_3D_SPIVMP
    1315        if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
     1324#if NH_3D_SPIVMP
     1325      if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    13161326      {
    13171327        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     
    13431353      {
    13441354#endif
    1345       if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    1346       {
    1347         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
    1348       }
    1349       else
    1350       {
    1351         xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    1352       }
    1353 #if H_3D_SPIVMP
    1354        }
    1355 #endif
    1356     }
    1357 #if H_3D_VSP
     1355        if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
     1356        {
     1357          xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
     1358        }
     1359        else
     1360        {
     1361          xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
     1362        }
     1363#if NH_3D_SPIVMP
     1364      }
     1365#endif
     1366    }
     1367#if NH_3D_VSP
    13581368    }
    13591369    else
     
    13811391  pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx );
    13821392#endif
    1383 #if H_3D_ARP
    1384   if(pcCU->getARPW( uiPartAddr ) > 0  && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC())
    1385   {
    1386     xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi );
     1393#if NH_3D_ARP
     1394  if(  pcCU->getARPW( uiPartAddr ) > 0 )
     1395  {
     1396    if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() )
     1397  {
     1398      xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi );
    13871399  }
    13881400  else
    13891401  {
    1390     if(  pcCU->getARPW( uiPartAddr ) > 0
    1391       && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N
    1392       && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()
    1393       )
    1394     {
    1395       xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi );
     1402      xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi );
     1403    }     
    13961404    }
    13971405    else
     
    14041412    Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) );
    14051413      xPredInterBlk(compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID))
    1406 #if H_3D_ARP
     1414#if NH_3D_ARP
    14071415        , false
    14081416#endif
     
    14121420#endif
    14131421  }
    1414 #if H_3D_ARP
    1415     }
    1416   }
    1417 #endif
    1418 }
    1419 
    1420 #if H_3D_VSP
     1422#if NH_3D_ARP
     1423  }
     1424#endif
     1425}
     1426
     1427#if NH_3D_VSP
    14211428Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    14221429{
     
    14391446Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU )
    14401447{
    1441   UInt numPartsInLine       = pcCU->getPic()->getNumPartInWidth();
     1448  UInt numPartsInLine       = pcCU->getPic()->getNumPartInCtuWidth();
    14421449  UInt horiNumPartsInSubPU  = widthSubPU >> 2;
    14431450  UInt vertNumPartsInSubPU  = (heightSubPU >> 2) * numPartsInLine;
     
    14551462      pcCU->clipMv(cMv);
    14561463
    1457       xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi );
    1458       xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi );
    1459 
    1460     }
    1461   }
    1462 }
    1463 
    1464 #endif
    1465 
    1466 #if H_3D_ARP
    1467 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
    1468 {
    1469   Int         iRefIdx      = pNewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
    1470   TComMv      cMv          = pNewMvFiled ? pNewMvFiled->getMv()     : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
     1464      xPredInterBlk( COMPONENT_Y,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
     1465      xPredInterBlk( COMPONENT_Cb, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) );
     1466      xPredInterBlk( COMPONENT_Cr, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) );
     1467    }
     1468  }
     1469}
     1470#endif
     1471
     1472#if NH_3D_ARP
     1473//temporal ARP
     1474Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
     1475{
     1476  Int         iRefIdx      = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
     1477  TComMv      cMv          = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
    14711478  Bool        bTobeScaled  = false;
    14721479  TComPic* pcPicYuvBaseCol = NULL;
    14731480  TComPic* pcPicYuvBaseRef = NULL;
    14741481
    1475 #if H_3D_NBDV
     1482#if NH_3D_NBDV
    14761483  DisInfo cDistparity;
    14771484  cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV;
     
    14821489  UChar dW = pcCU->getARPW ( uiPartAddr );
    14831490
    1484   {
    14851491    Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList);
    1486     if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() )
    1487     {
    1488       bTobeScaled = true;
    1489     }
    1490 
    1491     pcPicYuvBaseCol =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(),                              cDistparity.m_aVIdxCan );
    1492 
    1493     pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan );
    1494 
    1495     if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan))
     1492  if (arpRefIdx < 0 || !pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan))
    14961493    {
    14971494      dW = 0;
     
    15001497    else
    15011498    {
    1502       assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() );
     1499    if( arpRefIdx != iRefIdx )
     1500    {
     1501      bTobeScaled = true;
     1502    }
     1503    pcPicYuvBaseCol =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(),                              cDistparity.m_aVIdxCan );
     1504    pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan );
    15031505    }
    15041506
     
    15071509      Int iCurrPOC    = pcCU->getSlice()->getPOC();
    15081510      Int iColRefPOC  = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx );
    1509       Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList,  0);
     1511    Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx );
    15101512      Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC);
    15111513      if ( iScale != 4096 )
     
    15131515        cMv = cMv.scaleMv( iScale );
    15141516      }
    1515       iRefIdx = 0;
    1516     }
     1517    iRefIdx = arpRefIdx;
    15171518  }
    15181519
    15191520  pcCU->clipMv(cMv);
    15201521  TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec();
    1521   xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
    1522   xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
     1522
     1523  for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++)
     1524  {
     1525    const ComponentID compID=ComponentID(comp);
     1526    xPredInterBlk  ( compID,  pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1527  }
    15231528
    15241529  if( dW > 0 )
     
    15361541    pcCU->clipMv( cNBDV );
    15371542   
    1538     pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
    1539     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
    1540     if (iWidth > 8)
    1541       xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
     1543    TComPicYuv* pcPicYuvBaseColRec = pcPicYuvBaseCol->getPicYuvRec();
     1544    TComPicYuv* pcPicYuvBaseRefRec = pcPicYuvBaseRef->getPicYuvRec();
    15421545   
    1543     pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
    1544     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
    1545  
    1546     if (iWidth > 8)
    1547       xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
     1546    UInt uiCompNum = ( iWidth > 8 ) ? 3: 1;
     1547    for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++)
     1548    {
     1549      const ComponentID compID=ComponentID(comp);
     1550      xPredInterBlk  ( compID,  pcCU, pcPicYuvBaseColRec, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1551      xPredInterBlk  ( compID,  pcCU, pcPicYuvBaseRefRec, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1552    }   
    15481553   
    15491554    pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight );
     
    15531558      pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
    15541559    }
    1555     rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi );
     1560    rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() );
    15561561  }
    15571562}
     
    15621567  TComMv      cDMv          = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr );
    15631568  TComPic* pcPicYuvBaseCol  = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 
    1564   TComPicYuv* pcYuvBaseCol  = pcPicYuvBaseCol->getPicYuvRec();
    1565   Int uiLCUAddr,uiAbsPartAddr;
    15661569  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
    15671570  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     
    15691572  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
    15701573  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 
    1571   pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
    1572   TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
     1574
     1575  Int uiLCUAddr,uiAbsPartAddr;
     1576  pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
     1577  TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr );
    15731578
    15741579  TComPic* pcPicYuvBaseTRef = NULL;
     
    16221627}
    16231628
    1624 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
     1629//inter-view ARP
     1630Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    16251631{
    16261632  Int         iRefIdx       = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
     
    16351641  Bool bTMVAvai = false;     
    16361642  TComMv cBaseTMV;
    1637   if( pNewMvFiled )
    1638   {
    1639     iRefIdx = pNewMvFiled->getRefIdx();
    1640     cDMv = pNewMvFiled->getMv();
    1641   }
     1643
    16421644  pcCU->clipMv(cTempDMv);
    16431645
    1644   assert(dW > 0);
    1645   if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))
    1646   {
    1647     dW = 0;
    1648   }
    1649   Int uiLCUAddr,uiAbsPartAddr;
    16501646  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
    16511647  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     
    16531649  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
    16541650  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 
    1655   pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
    1656   TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
     1651 
     1652  Int uiLCUAddr,uiAbsPartAddr;
     1653  pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
     1654  TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr );
    16571655  if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
    16581656  {
     
    17251723      RefPicList eRefPicListCurr = RefPicList(iList);
    17261724      Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr);
    1727       if( iRef != -1)
     1725      if( iRef != -1 && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex()))
    17281726      {
    17291727        pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 
     
    17591757  }
    17601758
    1761   xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
    1762   xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
    1763 
    1764   if( dW > 0 && bTMVAvai )
    1765   {
     1759  for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++)
     1760  {
     1761    const ComponentID compID=ComponentID(comp);
     1762    xPredInterBlk  ( compID,  pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), bTMVAvai );
     1763  }
     1764
     1765  if( dW > 0 )
     1766  {
     1767    assert ( bTMVAvai );
    17661768    TComYuv*    pYuvCurrTRef    = &m_acYuvPredBase[0];
    17671769    TComYuv*    pYuvBaseTRef    = &m_acYuvPredBase[1];
     
    17771779      pYuvCurrTRef->clear(); pYuvBaseTRef->clear();
    17781780    }
    1779     xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
    1780 
    1781     if (iWidth > 8)
    1782       xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
    1783 
    1784     xPredInterLumaBlk  ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true);
    1785 
    1786     if (iWidth > 8)
    1787       xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true);
     1781
     1782    UInt uiCompNum = ( iWidth > 8 ) ? 3: 1;
     1783    for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++)
     1784    {
     1785      const ComponentID compID=ComponentID(comp);
     1786      xPredInterBlk  ( compID,  pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1787      xPredInterBlk  ( compID,  pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1788    }
    17881789
    17891790    pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); 
     
    17921793      pYuvCurrTRef->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
    17931794    }
    1794     rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi );
     1795    rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() );
    17951796  }
    17961797}
     
    18471848}
    18481849
    1849 #if H_3D_VSP
    1850 
     1850#if NH_3D_VSP
    18511851Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred )
    18521852{
     
    18701870  }
    18711871
    1872   xWeightedAverage( &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
    1873 }
    1874 
     1872  xWeightedAverage( &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, pcCU->getSlice()->getSPS()->getBitDepths() );
     1873}
    18751874#endif
    18761875
     
    18921891
    18931892Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth
    1894 #if H_3D_ARP
     1893#if NH_3D_ARP
    18951894    , Bool filterType
    18961895#endif
     
    19141913  Int     yFrac  = mv->getVer() & ((1<<shiftVer)-1);
    19151914
    1916 #if NH_3D_FULL_PEL_DEPTH_MAP_MV_ACC
     1915#if NH_3D_INTEGER_MV_DEPTH
    19171916  if( cu->getSlice()->getIsDepth() )
    19181917  {
    19191918    refOffset = mv->getHor() + mv->getVer() * refStride;
    19201919    ref       = refPic->getAddr(compID, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refOffset;
    1921 
    19221920    xFrac     = 0;
    19231921    yFrac     = 0;
     
    19371935    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth
    19381936#endif
    1939 #if H_3D_ARP
     1937#if NH_3D_ARP
    19401938    , filterType
    19411939#endif
     
    19491947    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth
    19501948#endif
    1951 #if H_3D_ARP
     1949#if NH_3D_ARP
    19521950    , filterType
    19531951#endif
     
    19621960
    19631961    m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false,      chFmt, bitDepth
    1964 #if H_3D_ARP
     1962#if NH_3D_ARP
    19651963    , filterType
    19661964#endif
     
    19711969    m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight,               yFrac, false, !bi, chFmt, bitDepth
    19721970#endif
    1973 #if H_3D_ARP
     1971#if NH_3D_ARP
    19741972    , filterType
    19751973#endif
     
    22082206
    22092207  // LLS parameters estimation
     2208
    22102209  Int x = 0, y = 0, xx = 0, xy = 0;
    22112210  Int precShift = std::max(0, bitDepth - 12);
     
    22642263  else
    22652264  {
    2266     xy += xx >> IC_REG_COST_SHIFT;
    2267     xx += xx >> IC_REG_COST_SHIFT;
    2268     Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift);
    2269     Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift);
    2270     const Int iShift = IC_CONST_SHIFT;
    2271     const Int iShiftA2 = 6;
    2272     const Int iAccuracyShift = 15;
    2273     Int iScaleShiftA2 = 0;
    2274     Int iScaleShiftA1 = 0;
     2265  xy += xx >> IC_REG_COST_SHIFT;
     2266  xx += xx >> IC_REG_COST_SHIFT;
     2267  Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift);
     2268  Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift);
     2269  const Int iShift = IC_CONST_SHIFT;
     2270      const Int iShiftA2 = 6;
     2271      const Int iAccuracyShift = 15;
     2272
     2273      Int iScaleShiftA2 = 0;
     2274      Int iScaleShiftA1 = 0;
    22752275    Int a1s;
    22762276    Int a2s;
    2277    
    2278     a1 = Clip3(0, 2*a2, a1);
    2279     iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
    2280     iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
    2281    
    2282     if( iScaleShiftA1 < 0 )
    2283     {
    2284       iScaleShiftA1 = 0;
    2285     }
    2286     if( iScaleShiftA2 < 0 )
    2287     {
    2288       iScaleShiftA2 = 0;
    2289     }
    2290    
    2291     Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
    2292 
    2293     a2s = a2 >> iScaleShiftA2;
    2294     a1s = a1 >> iScaleShiftA1;
    2295    
    2296     a = a1s * m_uiaShift[ a2s ];
    2297     a = a >> iScaleShiftA;
    2298     b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
    2299   }
    2300 }
     2277
     2278      a1 = Clip3(0, 2*a2, a1);
     2279      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
     2280      iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
     2281
     2282      if( iScaleShiftA1 < 0 )
     2283      {
     2284        iScaleShiftA1 = 0;
     2285      }
     2286
     2287      if( iScaleShiftA2 < 0 )
     2288      {
     2289        iScaleShiftA2 = 0;
     2290      }
     2291
     2292      Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
     2293
     2294
     2295      a2s = a2 >> iScaleShiftA2;
     2296
     2297      a1s = a1 >> iScaleShiftA1;
     2298
     2299      a = a1s * m_uiaShift[ a2s ];
     2300      a = a >> iScaleShiftA;
     2301      b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
     2302    }
     2303  }   
    23012304#endif
    23022305
Note: See TracChangeset for help on using the changeset viewer.