Changeset 20 in 3DVCSoftware


Ignore:
Timestamp:
15 Feb 2012, 18:58:36 (13 years ago)
Author:
hschwarz
Message:

HHI+Sony modifications

Location:
branches/0.2-HHI/source
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • branches/0.2-HHI/source/App/TAppCommon/TAppComCamPara.cpp

    r5 r20  
    984984  xGetCameraShifts( 0, iMinAbsVOIId, m_uiFirstFrameId, dCamPosShift, dPicPosShift );
    985985  Double  dCamPosShiftVOI01     = dCamPosShift / Double( iMinVOI );
    986   Double  dAbsCamPosShiftVOI01  = ( dCamPosShiftVOI01 < 0.0 ? -dCamPosShiftVOI01 : dCamPosShiftVOI01 );
    987986
    988987  //--- determine maximum absolute camera position shift, precision, and base scale ---
     
    997996    }
    998997  }
     998  Int     iPrecision  = 0; 
     999#if 0 // enabling this lines might be reasonable, but produces different results for the 2 view and 3 view test cases
    9991000  Double  dEpsilon    = 1e-15;
     1001  Double  dAbsCamPosShiftVOI01  = ( dCamPosShiftVOI01 < 0.0 ? -dCamPosShiftVOI01 : dCamPosShiftVOI01 );
    10001002  Double  dShiftRatio = dMaxAbsCamPosShift / dAbsCamPosShiftVOI01 - dEpsilon;
    1001   Int     iPrecision  = 0;  for( ; (Double)( 1 << iPrecision ) < dShiftRatio; iPrecision++ );
     1003  for( ; (Double)( 1 << iPrecision ) < dShiftRatio; iPrecision++ );
     1004#endif
    10021005  Int     iPrecShift  = iPrecision + PDM_INTER_CALC_SHIFT + PDM_VIRT_DEPTH_PRECISION - 2;
    10031006  AOF(    iPrecShift  < PDM_INTERNAL_CALC_BIT_DEPTH );
  • branches/0.2-HHI/source/App/TAppDecoder/TAppDecTop.cpp

    r5 r20  
    352352  m_acTDecTopList[0]->setPictureDigestEnabled(m_pictureDigestEnabled);
    353353  m_acTDecTopList[0]->setCamParsCollector( &m_cCamParsCollector );
     354#if SONY_COLPIC_AVAILABILITY
     355  m_acTDecTopList[0]->setViewOrderIdx(0);
     356#endif
    354357}
    355358
  • branches/0.2-HHI/source/App/TAppDecoder/TAppDecTop.h

    r5 r20  
    105105  TComSPSAccess*    getSPSAccess  () { return &m_cSPSAccess;   }
    106106  TComAUPicAccess*  getAUPicAccess() { return &m_cAUPicAccess; }
     107  TDecTop*          getDecTop0    () { return m_acTDecTopList[0]; }
    107108#endif
    108109
  • branches/0.2-HHI/source/App/TAppEncoder/TAppEncCfg.cpp

    r5 r20  
    268268    // GT: For development, will be removed later
    269269  ("VSOMode",                         m_uiVSOMode               , (UInt)   4    , "VSO Mode")
     270#if HHI_VSO_LS_TABLE
     271  ("LambdaScaleVSO",                  m_dLambdaScaleVSO         , (Double) 1  , "Lambda Scaling for VSO")
     272#else
    270273  ("LambdaScaleVSO",                  m_dLambdaScaleVSO         , (Double) 0.5  , "Lambda Scaling for VSO")
     274#endif
    271275    ("ForceLambdaScaleVSO",             m_bForceLambdaScaleVSO    , false         , "Force using Lambda Scale VSO also in non-VSO-Mode")
    272276#if HHI_VSO_DIST_INT
     
    479483    }
    480484  }
     485
     486#if HHI_VSO_LS_TABLE
     487  // Q&D
     488  Double adLambdaScaleTable[] =
     489  {  0.031250, 0.031639, 0.032029, 0.032418, 0.032808, 0.033197, 0.033586, 0.033976, 0.034365, 0.034755,
     490     0.035144, 0.035533, 0.035923, 0.036312, 0.036702, 0.037091, 0.037480, 0.037870, 0.038259, 0.038648,
     491     0.039038, 0.039427, 0.039817, 0.040206, 0.040595, 0.040985, 0.041374, 0.041764, 0.042153, 0.042542,
     492     0.042932, 0.043321, 0.043711, 0.044100, 0.044194, 0.053033, 0.061872, 0.070711, 0.079550, 0.088388,
     493     0.117851, 0.147314, 0.176777, 0.235702, 0.294628, 0.353553, 0.471405, 0.589256, 0.707107, 0.707100,
     494     0.753550, 0.800000 
     495  };
     496  AOT( (m_aiQP[1] < 0) || (m_aiQP[1] > 51));
     497  m_dLambdaScaleVSO *= adLambdaScaleTable[m_aiQP[1]];
     498#endif
    481499#endif
    482500
     
    629647  xConfirmPara    ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5,       "CodedCamParsPrecision must be in range of 0..5" );
    630648#if DEPTH_MAP_GENERATION
    631   xConfirmPara    ( m_uiPredDepthMapGeneration > 3,                                   "PredDepthMapGen must be less than or equal to 3" );
     649  xConfirmPara    ( m_uiPredDepthMapGeneration > 2,                                   "PredDepthMapGen must be less than or equal to 2" );
    632650  xConfirmPara    ( m_uiPredDepthMapGeneration >= 2 && !m_bUsingDepthMaps,            "PredDepthMapGen >= 2 requires CodeDepthMaps = 1" );
    633651#endif
     
    783801  g_uiBitIncrement = m_uiInternalBitDepth - g_uiBitDepth;
    784802#endif
     803#endif
     804#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     805  g_dDeltaDCsQuantOffset = Double(g_uiBitIncrement) -  2.0;
    785806#endif
    786807
  • branches/0.2-HHI/source/App/TAppEncoder/TAppEncTop.cpp

    r5 r20  
    583583  //GT: setup and init Bools for Eos and Continue Reading
    584584  Bool  bAllEos = false;
    585   Bool  bAllContinueReadingPics;
     585  Bool  bAllContinueReadingPics = false;
    586586  std::vector<Bool>  bEos ;
    587587  std::vector<Bool>  bContinueReadingPics ;
    588588
    589589  Bool  bAllDepthEos = false;
    590   Bool  bAllContinueReadingDepthPics;
     590  Bool  bAllContinueReadingDepthPics = false;
    591591  std::vector<Bool>  bDepthEos ;
    592592  std::vector<Bool>  bContinueReadingDepthPics ;
  • branches/0.2-HHI/source/Lib/TLibCommon/CommonDef.h

    r8 r20  
    5858
    5959#define HM_VERSION        "3.0rc2"                 ///< Current software version
    60 #define NV_VERSION        "0.2"                   ///< Current software version
     60#define NV_VERSION        "0.2r1-HHI"              ///< Current software version
    6161
    6262// ====================================================================================================================
     
    145145
    146146//>>>>> generation and usage of virtual prediction depth maps >>>>>
    147 #define PDM_DEPTH_MAP_MCP_FILTER          2         // 0: standard filter, 1:bilinear, 2:nearest neighbour
    148147#define PDM_ONE_DEPTH_PER_PU              1         // use only a single depth for a prediction unit (in update)
    149 #define PDM_NO_INTER_UPDATE               0         // no update for inter (but not inter-view) predicted blocks
     148#define PDM_NO_INTER_UPDATE               1         // no update for inter (but not inter-view) predicted blocks
    150149#define PDM_MERGE_POS                     0         // position of pdm in merge list (0..5)
    151150#define PDM_AMVP_POS                      2         // position of pdm in amvp list  (0..3)
     
    167166#define PDM_USE_FOR_INTER                 2
    168167#define PDM_USE_FOR_MERGE                 4
     168
     169#define PDM_SUBSAMPLING_EXP               2         // subsampling factor is 2^PDM_SUBSAMPLING_EXP
     170#define PDM_SUB_SAMP_EXP_X(Pdm)           ((Pdm)==1?PDM_SUBSAMPLING_EXP:0)
     171#define PDM_SUB_SAMP_EXP_Y(Pdm)           ((Pdm)==1?PDM_SUBSAMPLING_EXP:0)
    169172//<<<<< generation and usage of virtual prediction depth maps <<<<<
    170173
  • branches/0.2-HHI/source/Lib/TLibCommon/TComDataCU.cpp

    r5 r20  
    42134213  RefPicList  eColRefPicList;
    42144214  Int iColPOC, iColRefPOC, iCurrPOC, iCurrRefPOC, iScale;
     4215#if SONY_COLPIC_AVAILABILITY
     4216        Int iColViewOrderIdx, iColRefViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;
     4217#endif
    42154218  TComMv cColMv;
    42164219
    42174220  iCurrPOC = m_pcSlice->getPOC();   
    42184221  iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
    4219 
     4222#if SONY_COLPIC_AVAILABILITY
     4223        iCurrViewOrderIdx    = m_pcSlice->getViewOrderIdx();
     4224        iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
     4225#endif
    42204226  // use coldir.
    42214227  TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0), 0);
    42224228  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    42234229  iColPOC = pColCU->getSlice()->getPOC(); 
     4230#if SONY_COLPIC_AVAILABILITY
     4231        iColViewOrderIdx = pColCU->getSlice()->getViewOrderIdx();
     4232#endif
    42244233
    42254234  if (pColCU->isIntra(uiAbsPartAddr))
     
    42274236    return false;
    42284237  }
    4229 
     4238#if !SONY_COLPIC_AVAILABILITY
    42304239  if( m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() )
    42314240    return false;
     4241#endif
    42324242
    42334243  // Prefer a vector crossing us.  Prefer shortest.
     
    42454255    }
    42464256    iColRefPOC = pColCU->getSlice()->getRefPOC(RefPicList(l), iColRefIdx);
     4257#if SONY_COLPIC_AVAILABILITY
     4258                iColRefViewOrderIdx = pColCU->getSlice()->getRefPic(RefPicList(l), iColRefIdx)->getViewOrderIdx();
     4259                bool bCrosses;
     4260                int iColDist;
     4261                if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC)){
     4262                        iColDist = abs(iColRefPOC - iColPOC);
     4263                        bCrosses = iColPOC < iCurrPOC ? iColRefPOC > iCurrPOC : iColRefPOC < iCurrPOC;
     4264                }else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)){
     4265                        iColDist = abs(iColRefViewOrderIdx - iColViewOrderIdx);
     4266                        bCrosses = iColViewOrderIdx < iCurrViewOrderIdx ? iColRefViewOrderIdx > iCurrViewOrderIdx : iColRefViewOrderIdx < iCurrViewOrderIdx;
     4267                }else{
     4268                  continue;
     4269                }
     4270#else
    42474271    if( pColCU->getSlice()->getRefViewIdx(RefPicList(l), iColRefIdx) != pColCU->getSlice()->getViewIdx() )
    42484272      continue;
    42494273    int iColDist = abs(iColRefPOC - iColPOC);
    42504274    bool bCrosses = iColPOC < iCurrPOC ? iColRefPOC > iCurrPOC : iColRefPOC < iCurrPOC;
     4275#endif
     4276
    42514277    if (iFirstColDist < 0)
    42524278    {
     
    42774303  iColRefPOC = pColCU->getSlice()->getRefPOC(eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr));
    42784304  cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
     4305#if SONY_COLPIC_AVAILABILITY
     4306        iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
     4307#endif
    42794308
    42804309  iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
     4310#if SONY_COLPIC_AVAILABILITY
     4311        iScale = 0;
     4312        iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
     4313        if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))
    42814314  iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     4315        else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC))
     4316                iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
     4317#else
     4318  iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     4319#endif
    42824320  if (iScale == 1024)
    42834321  {
  • branches/0.2-HHI/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r5 r20  
    5757  m_uiMaxDepth          = 0;
    5858  m_uiOrgDepthBitDepth  = 0;
     59  m_uiSubSampExpX       = 0;
     60  m_uiSubSampExpY       = 0;
    5961  m_ppcYuv              = 0;
    6062  m_ppcCU               = 0;
     
    6870
    6971Void
    70 TComDepthMapGenerator::create( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth )
     72TComDepthMapGenerator::create( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth, UInt uiSubSampExpX, UInt uiSubSampExpY )
    7173{
    7274  destroy();
     
    7476  m_uiMaxDepth          = uiMaxCUDepth;
    7577  m_uiOrgDepthBitDepth  = uiOrgBitDepth;
     78  m_uiSubSampExpX       = uiSubSampExpX;
     79  m_uiSubSampExpY       = uiSubSampExpY;
    7680  m_ppcYuv              = new TComYuv*    [ m_uiMaxDepth ];
    7781  m_ppcCU               = new TComDataCU* [ m_uiMaxDepth ];
     
    8286    UInt  uiHeight  = uiMaxCUHeight >> uiDepth;
    8387
    84     m_ppcYuv[ uiDepth ] = new TComYuv;    m_ppcYuv[ uiDepth ]->create(            uiWidth, uiHeight      );
     88    m_ppcYuv[ uiDepth ] = new TComYuv;    m_ppcYuv[ uiDepth ]->create( uiWidth >> m_uiSubSampExpX, uiHeight >> m_uiSubSampExpY );
    8589    m_ppcCU [ uiDepth ] = new TComDataCU; m_ppcCU [ uiDepth ]->create( uiNumPart, uiWidth, uiHeight, true );
    8690  }
    87   m_cTmpPic.create( uiPicWidth, uiPicHeight, uiMaxCUWidth, uiMaxCUHeight, uiMaxCUDepth );
     91  m_cTmpPic.create( uiPicWidth >> m_uiSubSampExpX, uiPicHeight >> m_uiSubSampExpY, uiMaxCUWidth >> m_uiSubSampExpX, uiMaxCUHeight >> m_uiSubSampExpY, uiMaxCUDepth );
    8892  xSetChroma( &m_cTmpPic, ( 1 << uiOrgBitDepth ) >> 1 );
    8993  m_bCreated    = true;
     
    106110    m_uiMaxDepth          = 0;
    107111    m_uiOrgDepthBitDepth  = 0;
     112    m_uiSubSampExpX       = 0;
     113    m_uiSubSampExpY       = 0;
    108114    m_bDecoder            = false;
    109115  }
     
    372378      if( pcBasePic->getPOC() == 0 )
    373379      {
     380        pcBasePic->removePrdDepthMapBuffer();
     381        pcBasePic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_pcSPSAccess->getPdm()), PDM_SUB_SAMP_EXP_Y(m_pcSPSAccess->getPdm()) );
    374382        xClearDepthMap( pcBasePic );
    375383      }
     
    643651    TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
    644652    Int         iDisparity  = xGetDisparityFromVirtDepth( uiBaseId, iPrdDepth );
    645     Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + 2 ) >> 2 ) );
     653    Int         iShiftX     = m_uiSubSampExpX + 2;
     654    Int         iAddX       = ( 1 << iShiftX ) >> 1;
     655    Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) );
    646656    Int         iBasePosY   = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY                               );
    647657    Int         iBaseCUAddr;
    648658    Int         iBaseAbsPartIdx;
    649     pcBaseRec->getCUAddrAndPartIdx( iBasePosX, iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
     659    pcBaseRec->getCUAddrAndPartIdx( iBasePosX << m_uiSubSampExpX, iBasePosY << m_uiSubSampExpY, iBaseCUAddr, iBaseAbsPartIdx );
    650660    TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    651661    if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP )
     
    744754  Pel*        pRefSamples   =  pcRefDepthMap->getLumaAddr( 0 );
    745755  Int         iRefViewIdx   =  pcRef->getViewIdx();
     756  Int         iShiftX       = m_uiSubSampExpX + 2;
     757  Int         iAddX         = ( 1 << iShiftX ) >> 1;
    746758  for( Int iY = 0; iY < iHeight; iY++, pCurSamples += iCurStride, pRefSamples += iRefStride )
    747759  {
     
    750762      Int iDepth = pCurSamples[ iXCur ];
    751763      Int iDisp  = xGetDisparityFromVirtDepth( iRefViewIdx, iDepth );
    752       Int iXRef  = iXCur + ( ( iDisp + 2 ) >> 2 );
     764      Int iXRef  = iXCur + ( ( iDisp + iAddX ) >> iShiftX );
    753765      if( iXRef >= 0 && iXRef < iWidth && iDepth > pRefSamples[ iXRef ] )
    754766      {
     
    784796  Pel*        pCurSamples   =  pcCurDepthMap->getLumaAddr( 0 );
    785797  Int         iRefViewIdx   =  pcRef->getViewIdx();
     798  Int         iShiftX       = m_uiSubSampExpX + 2;
     799  Int         iAddX         = ( 1 << iShiftX ) >> 1;
    786800  for( Int iY = 0; iY < iHeight; iY++, pRefSamples += iRefStride, pCurSamples += iCurStride )
    787801  {
     
    790804      Int iDepth = pRefSamples[ iXRef ];
    791805      Int iDisp  = xGetDisparityFromVirtDepth( iRefViewIdx, iDepth );
    792       Int iXCur  = iXRef - ( ( iDisp + 2 ) >> 2 );
     806      Int iXCur  = iXRef - ( ( iDisp + iAddX ) >> iShiftX );
    793807      if( iXCur >= 0 && iXCur < iWidth && iDepth > pCurSamples[ iXCur ] )
    794808      {
     
    10221036  if( uiTrMode == uiTrDepth )
    10231037  {
    1024     UInt  uiWidth         = pcCU->getWidth ( 0 ) >> uiTrDepth;
    1025     UInt  uiHeight        = pcCU->getHeight( 0 ) >> uiTrDepth;
     1038    UInt  uiWidth         = pcCU->getWidth ( 0 ) >> ( uiTrDepth + m_uiSubSampExpX );
     1039    UInt  uiHeight        = pcCU->getHeight( 0 ) >> ( uiTrDepth + m_uiSubSampExpY );
    10261040    UInt  uiStride        = pcCUDepthMap->getStride  ();
    1027     Pel*  pDepthMap       = pcCUDepthMap->getLumaAddr( uiAbsPartIdx );
     1041    UInt  uiBlkX          = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpX;
     1042    UInt  uiBlkY          = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpY;
     1043    Pel*  pDepthMap       = pcCUDepthMap->getLumaAddr() + uiBlkY * pcCUDepthMap->getStride() + uiBlkX;
    10281044    UInt  uiLumaPredMode  = pcCU->getLumaIntraDir    ( uiAbsPartIdx );
    10291045    Bool  bAboveAvail     = false;
     
    10341050                                        m_pcPrediction->getPredicBufWidth  (),
    10351051                                        m_pcPrediction->getPredicBufHeight (),
    1036                                         bAboveAvail, bLeftAvail, true );
     1052                                        bAboveAvail, bLeftAvail, true, m_uiSubSampExpX, m_uiSubSampExpY );
    10371053    m_pcPrediction->predIntraDepthAng ( pcCU->getPattern(), uiLumaPredMode, pDepthMap, uiStride, uiWidth, uiHeight ); // could be replaced with directional intra prediction
    10381054                                                                                                                      // using "predIntraLumaAng", but note:
     
    11061122  UInt  uiAbsPartIdx;
    11071123  pcCU->getPartIndexAndSize( uiPartIdx, uiAbsPartIdx, iWidth, iHeight );
     1124  iWidth  >>= m_uiSubSampExpX;
     1125  iHeight >>= m_uiSubSampExpY;
    11081126
    11091127  // get depth values
     
    11251143  if( aiPrdDepth[ 0 ] != PDM_UNDEFINED_DEPTH && aiPrdDepth[ 1 ] != PDM_UNDEFINED_DEPTH )
    11261144  {
    1127     iDepthValue = ( aiPrdDepth[ 0 ] + aiPrdDepth[ 1 ] + 1 ) >> 2;
     1145    iDepthValue = ( aiPrdDepth[ 0 ] + aiPrdDepth[ 1 ] + 1 ) >> 1;
    11281146  }
    11291147  else
     
    11351153
    11361154  // set depth map for PU
    1137   Pel*  pDMSamples  = pcCUDepthMap->getLumaAddr( uiAbsPartIdx );
     1155  UInt  uiBlkX      = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpX;
     1156  UInt  uiBlkY      = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpY;
     1157  Pel*  pDMSamples  = pcCUDepthMap->getLumaAddr() + uiBlkY * pcCUDepthMap->getStride() + uiBlkX;
    11381158  Int   iStride     = pcCUDepthMap->getStride  ();
    11391159  for( Int iY = 0; iY < iHeight; iY++, pDMSamples += iStride )
     
    11601180  Int             iNum4x4BlksY      = iHeight >> 2;
    11611181  Int             iNum4x4BlksX      = iWidth  >> 2;
     1182  iWidth  >>= m_uiSubSampExpX;
     1183  iHeight >>= m_uiSubSampExpY;
     1184
    11621185  TComPicYuv*     pcCurrDepthMap    = pcCU->getPic()->getPredDepthMap();
    11631186  Pel*            piCurrDepthMap    = pcCurrDepthMap->getLumaAddr();
     
    11841207  Pel*            piBaseDepthMap    = pcBaseDepthMap->getLumaAddr();
    11851208  Int             iBaseStride       = pcBaseDepthMap->getStride();
     1209  Int             iShiftX           = m_uiSubSampExpX + 2;
     1210  Int             iShiftY           = m_uiSubSampExpY + 2;
     1211  Int             iAddX             = ( 1 << iShiftX ) >> 1;
     1212  Int             iAddY             = ( 1 << iShiftY ) >> 1;
    11861213
    11871214  //===== initialize 4x4 block arrays =====
     
    12021229    {
    12031230      // position parameters
    1204       Int               iCurrBlkPosX        = iCurrPUPosX + ( i4x4BlkX << 2 );
    1205       Int               iCurrBlkPosY        = iCurrPUPosY + ( i4x4BlkY << 2 );
    1206       Int               iCurrSamplePosX     = iCurrBlkPosX + 1;
    1207       Int               iCurrSamplePosY     = iCurrBlkPosY + 1;
     1231      Int               iCurrBlkPosX        = iCurrPUPosX + ( ( i4x4BlkX << 2 ) >> m_uiSubSampExpX );
     1232      Int               iCurrBlkPosY        = iCurrPUPosY + ( ( i4x4BlkY << 2 ) >> m_uiSubSampExpY );
     1233      Int               iCurrSamplePosX     = iCurrBlkPosX + ( 1 >> m_uiSubSampExpX );
     1234      Int               iCurrSamplePosY     = iCurrBlkPosY + ( 1 >> m_uiSubSampExpY );
    12081235      Int               iCurrPredDepth      = piCurrDepthMap[ iCurrSamplePosY * iCurrStride + iCurrSamplePosX ];
    12091236      Int               iCurrPredDisp       = xGetDisparityFromVirtDepth( uiBaseId, iCurrPredDepth );
    1210       Int               iBaseSamplePosX     = iCurrSamplePosX + ( ( iCurrPredDisp + 2 ) >> 2 );
     1237      Int               iBaseSamplePosX     = iCurrSamplePosX + ( ( iCurrPredDisp + iAddX ) >> iShiftX );
    12111238      Int               iBaseSamplePosY     = iCurrSamplePosY;
    12121239      iBaseSamplePosX                       = Clip3( 0, pcBaseDepthMap->getWidth () - 1, iBaseSamplePosX );
     
    12221249      Int               iBaseCUAddr;
    12231250      Int               iBaseAbsPartIdx;
    1224       pcBaseRecPic->getCUAddrAndPartIdx( iBaseSamplePosX, iBaseSamplePosY, iBaseCUAddr, iBaseAbsPartIdx );
     1251      pcBaseRecPic->getCUAddrAndPartIdx( iBaseSamplePosX << m_uiSubSampExpX, iBaseSamplePosY << m_uiSubSampExpY, iBaseCUAddr, iBaseAbsPartIdx );
    12251252      TComDataCU*       pcBaseCU            = pcBasePic->getCU( iBaseCUAddr );
    12261253      if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP )
     
    12561283        Int             iCurrRefStride      = pcCurrRefDMap->getStride();
    12571284        TComMv&         rcCurrMv            = aiCurrMvField[ iCurrRefListId ]->getMv( uiAbsPartIdx );
    1258         Int             iCurrRefSamplePosX  = iCurrSamplePosX + ( ( rcCurrMv.getHor() + 2 ) >> 2 );
    1259         Int             iCurrRefSamplePosY  = iCurrSamplePosY + ( ( rcCurrMv.getVer() + 2 ) >> 2 );
     1285        Int             iCurrRefSamplePosX  = iCurrSamplePosX + ( ( rcCurrMv.getHor() + iAddX ) >> iShiftX );
     1286        Int             iCurrRefSamplePosY  = iCurrSamplePosY + ( ( rcCurrMv.getVer() + iAddY ) >> iShiftY );
    12601287        Int             iCurrRefSamplePosXC = Clip3( 0, pcCurrRefDMap->getWidth () - 1, iCurrRefSamplePosX );
    12611288        Int             iCurrRefSamplePosYC = Clip3( 0, pcCurrRefDMap->getHeight() - 1, iCurrRefSamplePosY );
     
    12711298            // location and depth for path currView/currAU -> currView/refAU -> baseView/refAU
    12721299            Int         iCurrRefDisp        = xGetDisparityFromVirtDepth( uiBaseId, iCurrRefDepth );
    1273             Int         iBaseRefSamplePosX  = iCurrRefSamplePosX + ( ( iCurrRefDisp + 2 ) >> 2 );
     1300            Int         iBaseRefSamplePosX  = iCurrRefSamplePosX + ( ( iCurrRefDisp + iAddX ) >> iShiftX );
    12741301            Int         iBaseRefSamplePosY  = iCurrRefSamplePosY;
    12751302            TComPic*    pcBaseRefPic        = pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, aiBaseRefIdx[ iBaseRefListId ] );
     
    13281355      for( Int i4x4BlkX = 0; i4x4BlkX < iNum4x4BlksX; i4x4BlkX++ )
    13291356      {
    1330         Int             iCurrSamplePosX     = iCurrPUPosX + ( i4x4BlkX << 2 ) + 1;
    1331         Int             iCurrSamplePosY     = iCurrPUPosY + ( i4x4BlkY << 2 ) + 1;
     1357        Int             iCurrSamplePosX     = iCurrPUPosX + ( ( ( i4x4BlkX << 2 ) + 1 ) >> m_uiSubSampExpX );
     1358        Int             iCurrSamplePosY     = iCurrPUPosY + ( ( ( i4x4BlkY << 2 ) + 1 ) >> m_uiSubSampExpY );
    13321359        m_aai4x4Depth[i4x4BlkY][i4x4BlkX]   = piCurrDepthMap[ iCurrSamplePosY * iCurrStride + iCurrSamplePosX ];
    13331360        m_aabDepthSet[i4x4BlkY][i4x4BlkX]   = true;
     
    13891416
    13901417  //===== set depth values =====
    1391   Pel* piDepthMap = pcCUDepthMap->getLumaAddr( uiAbsPartIdx );
     1418  UInt uiBlkX     = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpX;
     1419  UInt uiBlkY     = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpY;
     1420  Pel* piDepthMap = pcCUDepthMap->getLumaAddr() + uiBlkY * pcCUDepthMap->getStride() + uiBlkX;
    13921421  Int  iCUStride  = pcCUDepthMap->getStride  ();
    13931422  for( Int iRow = 0; iRow < iHeight; iRow++, piDepthMap += iCUStride )
     
    13951424    for( Int iCol = 0; iCol < iWidth; iCol++ )
    13961425    {
    1397       piDepthMap[ iCol ] = m_aai4x4Depth[ iRow >> 2 ][ iCol >> 2 ];
     1426      piDepthMap[ iCol ] = m_aai4x4Depth[ (iRow << m_uiSubSampExpY) >> 2  ][ (iCol << m_uiSubSampExpX) >> 2 ];
    13981427    }
    13991428  }
     
    14041433TComDepthMapGenerator::xInterPUDepthMapPrediction( TComDataCU* pcCU, TComYuv* pcCUDepthMap, UInt uiPartIdx )
    14051434{
    1406   m_pcPrediction->motionCompensation( pcCU, pcCUDepthMap, REF_PIC_LIST_X, (Int)uiPartIdx, true ); 
     1435  m_pcPrediction->motionCompensation( pcCU, pcCUDepthMap, REF_PIC_LIST_X, (Int)uiPartIdx, true, m_uiSubSampExpX, m_uiSubSampExpY ); 
    14071436}
    14081437
     
    14321461  Int           iCurrPosY;
    14331462  pcPredDepthMap->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
    1434   iCurrPosX  += ( iWidth - 1 ) >> 1;
    1435   iCurrPosY  += ( iHeight - 1 ) >> 1;
     1463  iCurrPosX  += ( ( iWidth  >> m_uiSubSampExpX ) - 1 ) >> 1;
     1464  iCurrPosY  += ( ( iHeight >> m_uiSubSampExpY ) - 1 ) >> 1;
    14361465  riPrdDepth  = piPredDepthMap[ iCurrPosX + iCurrPosY * iCurrStride ];
    14371466  if( piPosX )
  • branches/0.2-HHI/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r5 r20  
    110110  ~TComDepthMapGenerator();
    111111
    112   Void  create                ( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth );
     112  Void  create                ( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth, UInt uiSubSampExpX, UInt uiSubSampExpY );
    113113  Void  destroy               ();
    114114
     
    126126
    127127  UInt  getBaseViewId         ( UInt          uiIdx ) { AOF( uiIdx < m_auiBaseIdList.size() );  return m_auiBaseIdList[uiIdx]; }
     128  UInt  getSubSampExpX        ()                      { return m_uiSubSampExpX; }
     129  UInt  getSubSampExpY        ()                      { return m_uiSubSampExpY; }
    128130  Int   getDisparity          ( TComPic*      pcPic, Int iPosX, Int iPosY, UInt uiRefViewId );
    129131#if HHI_INTER_VIEW_MOTION_PRED
     
    200202  UInt              m_uiMaxDepth;
    201203  UInt              m_uiOrgDepthBitDepth;
     204  UInt              m_uiSubSampExpX;
     205  UInt              m_uiSubSampExpY;
    202206  TComYuv**         m_ppcYuv;
    203207  TComDataCU**      m_ppcCU;
  • branches/0.2-HHI/source/Lib/TLibCommon/TComPattern.cpp

    r5 r20  
    147147  if ( iComp == 0 )
    148148  {
     149#if DEPTH_MAP_GENERATION
     150    m_iPatternStride  = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getStride() : pcCU->getPic()->getStride() );
     151#else
    149152    m_iPatternStride  = pcCU->getPic()->getStride();
     153#endif
    150154    m_piPatternOrigin = pcPic->getLumaAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft;
    151155  }
    152156  else
    153157  {
     158#if DEPTH_MAP_GENERATION
     159    m_iPatternStride  = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getCStride() : pcCU->getPic()->getCStride() );
     160#else
    154161    m_iPatternStride = pcCU->getPic()->getCStride();
     162#endif
    155163    if ( iComp == 1 )
    156164      m_piPatternOrigin = pcPic->getCbAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft;
     
    242250Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft
    243251#if DEPTH_MAP_GENERATION
    244                                 , Bool bPrdDepthMap 
     252                                , Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY
    245253#endif
    246254                                )
     
    254262  UInt  uiWidth;
    255263  UInt  uiHeight;
     264
     265#if DEPTH_MAP_GENERATION
     266  Int   iPicStride = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getStride() : pcCU->getPic()->getStride() );
     267#else
    256268  Int   iPicStride = pcCU->getPic()->getStride();
     269#endif
     270
    257271  Int   iCuAddr;
    258272#if REFERENCE_SAMPLE_PADDING
     
    375389#endif // REFERENCE_SAMPLE_PADDING
    376390 
     391#if DEPTH_MAP_GENERATION
     392  if ( bPrdDepthMap )
     393  {
     394    uiWidth  = ( uiCuWidth2  >> uiSubSampExpX ) + 1;
     395    uiHeight = ( uiCuHeight2 >> uiSubSampExpY ) + 1;
     396  }
     397  else
     398  {
    377399  uiWidth=uiCuWidth2+1;
    378400  uiHeight=uiCuHeight2+1;
     401  }
     402#else
     403  uiWidth=uiCuWidth2+1;
     404  uiHeight=uiCuHeight2+1;
     405#endif
    379406 
    380407  if (((uiWidth<<2)>iOrgBufStride)||((uiHeight<<2)>iOrgBufHeight))
     
    398425#if REFERENCE_SAMPLE_PADDING
    399426#if DEPTH_MAP_GENERATION
     427  if ( bPrdDepthMap )
     428    fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize >> uiSubSampExpX, iNumUnitsInCu, iTotalUnits, uiCuWidth >> uiSubSampExpX, uiCuHeight >> uiSubSampExpY, uiWidth, uiHeight, iPicStride, bPrdDepthMap );
     429  else
    400430  fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bPrdDepthMap );
    401431#else
  • branches/0.2-HHI/source/Lib/TLibCommon/TComPattern.h

    r5 r20  
    174174                                Bool&       bLeft
    175175#if DEPTH_MAP_GENERATION
    176                                ,Bool        bPrdDepthMap = false
     176                               ,
     177                               Bool         bPrdDepthMap = false,
     178                               UInt         uiSubSampExpX = 0,
     179                               UInt         uiSubSampExpY = 0
    177180#endif
    178181                               );
  • branches/0.2-HHI/source/Lib/TLibCommon/TComPic.cpp

    r5 r20  
    7373  m_aiNumRefIdx[0]    = 0;
    7474  m_aiNumRefIdx[1]    = 0;
    75 
     75#if SONY_COLPIC_AVAILABILITY
     76  m_iViewOrderIdx     = 0;
     77#endif
    7678  m_iViewIdx          = 0;
    7779  m_aaiCodedScale     = 0;
     
    211213#if DEPTH_MAP_GENERATION
    212214Void
    213 TComPic::addPrdDepthMapBuffer()
     215TComPic::addPrdDepthMapBuffer( UInt uiSubSampExpX, UInt uiSubSampExpY )
    214216{
    215217  AOT( m_pcPredDepthMap );
     
    221223  UInt  uiMaxCuDepth  = m_apcPicYuv[1]->getMaxCuDepth ();
    222224  m_pcPredDepthMap    = new TComPicYuv;
    223   m_pcPredDepthMap    ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
     225  m_pcPredDepthMap    ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth );
    224226}
    225227#endif
  • branches/0.2-HHI/source/Lib/TLibCommon/TComPic.h

    r5 r20  
    9090
    9191  Int                   m_iViewIdx;
     92#if SONY_COLPIC_AVAILABILITY
     93  Int                   m_iViewOrderIdx;
     94#endif
    9295  Int**                 m_aaiCodedScale;
    9396  Int**                 m_aaiCodedOffset;
     
    159162  Void          setViewIdx( Int i )                           { m_iViewIdx = i; }
    160163  Int           getViewIdx()                                  { return m_iViewIdx; }
     164#if SONY_COLPIC_AVAILABILITY
     165  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
     166  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
     167#endif
    161168
    162169  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
     
    200207#endif
    201208#if DEPTH_MAP_GENERATION
    202   Void          addPrdDepthMapBuffer    ();
     209  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
    203210#endif
    204211#if HHI_INTER_VIEW_MOTION_PRED
  • branches/0.2-HHI/source/Lib/TLibCommon/TComPrediction.cpp

    r5 r20  
    15071507#endif
    15081508
    1509 Void TComPrediction::motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap )
     1509#if DEPTH_MAP_GENERATION
     1510Void TComPrediction::motionCompensation( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY )
     1511#else
     1512Void TComPrediction::motionCompensation( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx )
     1513#endif
    15101514{
    15111515  Int         iWidth;
     
    15161520  {
    15171521    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
     1522
     1523#if DEPTH_MAP_GENERATION
     1524    if( bPrdDepthMap )
     1525    {
     1526      iWidth  >>= uiSubSampExpX;
     1527      iHeight >>= uiSubSampExpY;
     1528    }
     1529#endif
     1530
    15181531    if ( eRefPicList != REF_PIC_LIST_X )
    15191532    {
    1520       xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap );
     1533#if DEPTH_MAP_GENERATION
     1534      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY );
     1535#else
     1536      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx );
     1537#endif
    15211538#ifdef WEIGHT_PRED
    15221539      if ( pcCU->getSlice()->getPPS()->getUseWP() )
     
    15281545    else
    15291546    {
    1530       xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx, bPrdDepthMap );
    1531 
     1547#if DEPTH_MAP_GENERATION
     1548      xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
     1549#else
     1550      xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
     1551#endif
    15321552    }
    15331553    return;
     
    15381558    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    15391559
     1560#if DEPTH_MAP_GENERATION
     1561    if( bPrdDepthMap )
     1562    {
     1563      iWidth  >>= uiSubSampExpX;
     1564      iHeight >>= uiSubSampExpY;
     1565    }
     1566#endif
     1567
    15401568    if ( eRefPicList != REF_PIC_LIST_X )
    15411569    {
    1542       xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap );
     1570#if DEPTH_MAP_GENERATION
     1571      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY );
     1572#else
     1573      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx );
     1574#endif
    15431575#ifdef WEIGHT_PRED
    15441576      if ( pcCU->getSlice()->getPPS()->getUseWP() )
     
    15501582    else
    15511583    {
    1552       xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx, bPrdDepthMap );
     1584#if DEPTH_MAP_GENERATION
     1585      xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
     1586#else
     1587      xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
     1588#endif
    15531589    }
    15541590  }
     
    15581594#if HIGH_ACCURACY_BI
    15591595#if DEPTH_MAP_GENERATION
    1560 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi )
     1596Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi )
    15611597#else
    15621598Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi )
     
    15641600#else
    15651601#if DEPTH_MAP_GENERATION
    1566 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
     1602Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY )
    15671603#else
    15681604Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx )
     
    15761612#if DEPTH_MAP_GENERATION
    15771613  if( bPrdDepthMap )
     1614  {
     1615    UInt uiRShift = 0;
     1616    xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift );
     1617    return;
     1618  }
     1619#endif
     1620
     1621#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     1622  if( pcCU->getSlice()->getSPS()->isDepth() )
    15781623  {
    15791624#if HIGH_ACCURACY_BI
     
    15821627    UInt uiRShift = 0;
    15831628#endif
    1584     xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, PDM_DEPTH_MAP_MCP_FILTER );
    1585     return;
    1586   }
    1587 #endif
    1588 
    1589 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    1590   if( pcCU->getSlice()->getSPS()->isDepth() )
    1591   {
    1592 #if HIGH_ACCURACY_BI
    1593     UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 );
     1629#if DEPTH_MAP_GENERATION
     1630    xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, 0, 0, rpcYuvPred, uiRShift );
    15941631#else
    1595     UInt uiRShift = 0;
    1596 #endif
    1597     xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, 2 );
     1632    xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift );
     1633#endif
    15981634  }
    15991635  else
     
    16301666}
    16311667
    1632 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
     1668#if DEPTH_MAP_GENERATION
     1669Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
     1670#else
     1671Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx )
     1672#endif
    16331673{
    16341674  TComYuv* pcMbYuv;
     
    16511691    if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 )
    16521692#if DEPTH_MAP_GENERATION
    1653       xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, true );
     1693      xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
    16541694#else
    16551695      xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
     
    16571697    else
    16581698#if DEPTH_MAP_GENERATION
    1659      xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap );
     1699     xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY );
    16601700#else
    16611701     xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx );
     
    16631703#else
    16641704#if DEPTH_MAP_GENERATION
    1665     xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap );
     1705    xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY );
    16661706#else
    16671707    xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx );
     
    16771717  else
    16781718#endif
     1719
     1720#if DEPTH_MAP_GENERATION
     1721  if ( bPrdDepthMap )
     1722  {
     1723    xWeightedAveragePdm( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, uiSubSampExpX, uiSubSampExpY );
     1724  }
     1725  else
     1726  {
     1727    xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
     1728  }
     1729#else
    16791730  xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
     1731#endif
     1732
    16801733}
    16811734
    16821735
    16831736Void
    1684 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiFilterMode ) // 0:std, 1:bilin, 2:nearest neighbour
    1685 {
    1686   AOF( uiFilterMode <= 2 );
    1687 
     1737#if DEPTH_MAP_GENERATION
     1738TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift )
     1739#else
     1740TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift )
     1741#endif
     1742{
     1743#if DEPTH_MAP_GENERATION
     1744  Int     iShiftX     = 2 + uiSubSampExpX;
     1745  Int     iShiftY     = 2 + uiSubSampExpY;
     1746  Int     iAddX       = ( 1 << iShiftX ) >> 1;
     1747  Int     iAddY       = ( 1 << iShiftY ) >> 1;
     1748  Int     iHor        = ( pcMv->getHor() + iAddX ) >> iShiftX;
     1749  Int     iVer        = ( pcMv->getVer() + iAddY ) >> iShiftY;
     1750#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     1751  if( pcCU->getSlice()->getSPS()->isDepth() )
     1752{
     1753    iHor = pcMv->getHor();
     1754    iVer = pcMv->getVer();
     1755  }
     1756#endif
     1757  Int     iRefStride  = pcPicYuvRef->getStride();
     1758  Int     iDstStride  = rpcYuv->getStride();
     1759  Int     iRefOffset  = iHor + iVer * iRefStride;
     1760#else
    16881761  Int     iFPelMask   = ~3;
    16891762  Int     iRefStride  = pcPicYuvRef->getStride();
    16901763  Int     iDstStride  = rpcYuv->getStride();
    1691   Int     iHor        = ( uiFilterMode == 2 ? ( pcMv->getHor() + 2 ) & iFPelMask : pcMv->getHor() );
    1692   Int     iVer        = ( uiFilterMode == 2 ? ( pcMv->getVer() + 2 ) & iFPelMask : pcMv->getVer() );
     1764  Int     iHor        = ( pcMv->getHor() + 2 ) & iFPelMask;
     1765  Int     iVer        = ( pcMv->getVer() + 2 ) & iFPelMask;
    16931766#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    16941767  if( pcCU->getSlice()->getSPS()->isDepth() )
    16951768  {
    1696     assert( uiFilterMode == 2 );
    16971769    iHor = pcMv->getHor() * 4;
    16981770    iVer = pcMv->getVer() * 4;
    16991771  }
    17001772#endif
    1701   Int     iRefOffset  = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;
    17021773  Int     ixFrac      = iHor & 0x3;
    17031774  Int     iyFrac      = iVer & 0x3;
     1775  Int     iRefOffset  = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;
     1776#endif
     1777
    17041778  Pel*    piRefY      = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
    17051779  Pel*    piDstY      = rpcYuv->getLumaAddr( uiPartAddr );
    17061780
    1707   //  Integer position
    1708   if( ixFrac == 0 && iyFrac == 0 )
    1709   {
    17101781    for( Int y = 0; y < iHeight; y++, piDstY += iDstStride, piRefY += iRefStride )
    17111782    {
     
    17151786      }
    17161787    }
    1717     return;
    1718   }
    1719 
    1720   // bi-linear interpolation
    1721   if( uiFilterMode == 1 )
    1722   {
    1723     Int   iW00    = ( 4 - ixFrac ) * ( 4 - iyFrac );
    1724     Int   iW01    = (     ixFrac ) * ( 4 - iyFrac );
    1725     Int   iW10    = ( 4 - ixFrac ) * (     iyFrac );
    1726     Int   iW11    = (     ixFrac ) * (     iyFrac );
    1727     Pel*  piRefY1 = piRefY + iRefStride;
    1728     for( Int y = 0; y < iHeight; y++, piDstY += iDstStride, piRefY += iRefStride, piRefY1 += iRefStride )
    1729     {
    1730       for( Int x = 0; x < iWidth; x++ )
    1731       {
    1732         Int iSV     = iW00 * piRefY [ x ] + iW01 * piRefY [ x + 1 ]
    1733                     + iW10 * piRefY1[ x ] + iW11 * piRefY1[ x + 1 ];
    1734         iSV       <<= uiRShift;
    1735         piDstY[ x ] = ( iSV + 8 ) >> 4;
    1736       }
    1737     }
    1738     return;
    1739   }
    1740 
    1741   xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, pcMv, iWidth, iHeight, rpcYuv );
    1742   return;
    17431788}
    17441789
     
    21672212}
    21682213
     2214#endif
     2215
     2216#if DEPTH_MAP_GENERATION
     2217Void TComPrediction::xWeightedAveragePdm( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY )
     2218{
     2219  if( iRefIdx0 >= 0 && iRefIdx1 >= 0 )
     2220  {
     2221    rpcYuvDst->addAvgPdm( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY );
     2222  }
     2223  else if ( iRefIdx0 >= 0 && iRefIdx1 <  0 )
     2224  {
     2225    pcYuvSrc0->copyPartToPartYuvPdm( rpcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY );
     2226  }
     2227  else if ( iRefIdx0 <  0 && iRefIdx1 >= 0 )
     2228  {
     2229    pcYuvSrc1->copyPartToPartYuvPdm( rpcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY );
     2230  }
     2231  else
     2232  {
     2233    assert (0);
     2234  }
     2235}
    21692236#endif
    21702237
  • branches/0.2-HHI/source/Lib/TLibCommon/TComPrediction.h

    r5 r20  
    8989#if HIGH_ACCURACY_BI
    9090#if DEPTH_MAP_GENERATION
    91   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi=false );
     91  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false );
    9292#else
    9393  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false );
     
    9595#else
    9696#if DEPTH_MAP_GENERATION
    97   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );
     97  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 );
    9898#else
    9999  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx );
    100100#endif
    101101#endif
    102   Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );
    103   Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv, UInt uiRShift, UInt uiFilterMode ); // 0:std, 1:bilin, 2:nearest neighbour
     102#if DEPTH_MAP_GENERATION
     103  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );
     104  Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift );
     105#else
     106  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx );
     107  Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv, UInt uiRShift );
     108#endif
    104109  Void xPredInterLumaBlk        ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv );
    105110  Void xPredInterChromaBlk      ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv                            );
     111 
     112#if DEPTH_MAP_GENERATION
     113  Void xWeightedAveragePdm      ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY );
     114#endif
    106115  Void xWeightedAverage         ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst );
     116
     117
    107118  Void xDCTIF_FilterC ( Pel*  piRefC, Int iRefStride,Pel*  piDstC,Int iDstStride,Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac);
    108119
     
    145156 
    146157  // inter
    147   Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false );
     158#if DEPTH_MAP_GENERATION
     159  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 );
     160#else
     161  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
     162#endif
    148163 
    149164  // motion vector prediction
  • branches/0.2-HHI/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r5 r20  
    432432
    433433  //===== get disparity =====
    434   Int           iMidPosX    = Int( uiXPos + ( ( uiBlkWidth  - 1 ) >> 1 ) );
    435   Int           iMidPosY    = Int( uiYPos + ( ( uiBlkHeight - 1 ) >> 1 ) );
     434  Int           iMidPosX    = Int( uiXPos + ( ( uiBlkWidth  - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpX();
     435  Int           iMidPosY    = Int( uiYPos + ( ( uiBlkHeight - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpY();
    436436  Int           iDisparity  = m_pcDepthMapGenerator->getDisparity( pcPic, iMidPosX, iMidPosY, uiBaseViewId );
    437437
  • branches/0.2-HHI/source/Lib/TLibCommon/TComRom.cpp

    r5 r20  
    28152815  assert( uiWidth == uiHeight );
    28162816
    2817   UChar uhStartX, uhStartY, uhEndX, uhEndY;
    2818   Int    iStepStartX, iStepStartY, iStepEndX, iStepEndY;
    2819 
     2817  UChar  uhStartX = 0, uhStartY = 0, uhEndX = 0, uhEndY = 0;
     2818  Int    iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0;
    28202819  UInt uiBlockSize = 0;
    28212820  switch( eWedgeRes )
  • branches/0.2-HHI/source/Lib/TLibCommon/TComSlice.cpp

    r5 r20  
    6666  m_iViewIdx = 0 ;
    6767
     68#if SONY_COLPIC_AVAILABILITY
     69  m_iViewOrderIdx = 0;
     70#endif
     71
    6872  initEqualRef();
    6973  m_bNoBackPredFlag = false;
     
    440444  m_iPOC                 = pSrc->m_iPOC;
    441445  m_iViewIdx             = pSrc->m_iViewIdx;
     446#if SONY_COLPIC_AVAILABILITY
     447  m_iViewOrderIdx        = pSrc->m_iViewOrderIdx;
     448#endif
    442449#if DCM_DECODING_REFRESH
    443450  m_eNalUnitType         = pSrc->m_eNalUnitType;
     
    676683  // AMVP parameter
    677684  ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) );
     685
     686#if ( HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX )
    678687  m_bUseDMM = false;
     688#endif
    679689}
    680690
  • branches/0.2-HHI/source/Lib/TLibCommon/TComSlice.h

    r5 r20  
    370370  UInt        m_uiPPSId;
    371371  Int         m_iPOC;
     372#if SONY_COLPIC_AVAILABILITY
     373  Int         m_iViewOrderIdx;
     374#endif
    372375#if DCM_DECODING_REFRESH
    373376  NalUnitType m_eNalUnitType;         ///< Nal unit type for the slice
     
    460463  SliceType getSliceType    ()                          { return  m_eSliceType;         }
    461464  Int       getPOC          ()                          { return  m_iPOC;           }
     465#if SONY_COLPIC_AVAILABILITY
     466  Int       getViewOrderIdx ()                          { return  m_iViewOrderIdx;  }
     467#endif
    462468  Int       getSliceQp      ()                          { return  m_iSliceQp;           }
    463469  Int       getSliceQpDelta ()                          { return  m_iSliceQpDelta;      }
     
    495501  Void      setPPSId            ( UInt u )                      { m_uiPPSId           = u;      }
    496502  Void      setPOC              ( Int i )                       { m_iPOC              = i;      }
     503#if SONY_COLPIC_AVAILABILITY
     504  Void      setViewOrderIdx     ( Int i )                       { m_iViewOrderIdx     = i;      }
     505#endif
    497506#if DCM_DECODING_REFRESH
    498507  Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
  • branches/0.2-HHI/source/Lib/TLibCommon/TComYuv.cpp

    r5 r20  
    300300}
    301301
     302#if DEPTH_MAP_GENERATION
     303Void TComYuv::copyPartToPartYuvPdm   ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY )
     304{
     305  copyPartToPartLumaPdm   (pcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY );
     306}
     307#endif
     308   
    302309Void TComYuv::copyPartToPartYuv   ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight )
    303310{
     
    305312  copyPartToPartChroma (pcYuvDst, uiPartIdx, iWidth>>1, iHeight>>1 );
    306313}
     314
     315#if DEPTH_MAP_GENERATION
     316Void TComYuv::copyPartToPartLumaPdm  ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY )
     317{
     318  UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpX;
     319  UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpY;
     320  Pel* pSrc   = getLumaAddr(uiPartIdx);
     321  Pel* pDst   = pcYuvDst->getLumaAddr() + uiBlkY * pcYuvDst->getStride() + uiBlkX;
     322 
     323  if( pSrc == pDst )
     324  {
     325    //th not a good idea
     326    //th best would be to fix the caller
     327    return ;
     328  }
     329 
     330  UInt  iSrcStride = getStride();
     331  UInt  iDstStride = pcYuvDst->getStride();
     332  for ( UInt y = iHeight; y != 0; y-- )
     333  {
     334    ::memcpy( pDst, pSrc, iWidth * sizeof(Pel) );
     335    pSrc += iSrcStride;
     336    pDst += iDstStride;
     337  }
     338}
     339#endif
    307340
    308341Void TComYuv::copyPartToPartLuma  ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight )
     
    801834}
    802835
     836#if DEPTH_MAP_GENERATION
     837Void TComYuv::addAvgPdm( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY )
     838{
     839  Int x, y;
     840
     841  UInt uiBlkX  = g_auiRasterToPelX[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpX;
     842  UInt uiBlkY  = g_auiRasterToPelY[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpY;
     843  Pel* pSrcY0  = pcYuvSrc0->getLumaAddr( iPartUnitIdx );
     844  Pel* pSrcY1  = pcYuvSrc1->getLumaAddr( iPartUnitIdx );
     845  Pel* pDstY   = getLumaAddr() + uiBlkY * getStride() + uiBlkX;
     846 
     847  UInt  iSrc0Stride = pcYuvSrc0->getStride();
     848  UInt  iSrc1Stride = pcYuvSrc1->getStride();
     849  UInt  iDstStride  = getStride();
     850
     851  for ( y = iHeight-1; y >= 0; y-- )
     852  {
     853    for ( x = iWidth-1; x >= 0; x-- )
     854    {
     855      pDstY[x] = (pSrcY0[x] + pSrcY1[x] + 1) >> 1;
     856    }
     857    pSrcY0 += iSrc0Stride;
     858    pSrcY1 += iSrc1Stride;
     859    pDstY  += iDstStride;
     860  }
     861}
     862#endif
     863
     864
    803865Void TComYuv::removeHighFreq( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight )
    804866{
  • branches/0.2-HHI/source/Lib/TLibCommon/TComYuv.h

    r5 r20  
    113113  Void    copyPartToPartLuma    ( TComYuv*    pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight );
    114114  Void    copyPartToPartChroma  ( TComYuv*    pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight );
     115#if DEPTH_MAP_GENERATION
     116  Void    copyPartToPartYuvPdm  ( TComYuv*    pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight, UInt uiSubSampExpX, UInt uiSubSampExpY );
     117  Void    copyPartToPartLumaPdm ( TComYuv*    pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight, UInt uiSubSampExpX, UInt uiSubSampExpY );
     118#endif
    115119 
    116120  // ------------------------------------------------------------------------------------------------------------------
     
    135139#endif
    136140  Void    addAvg            ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight );
     141#if DEPTH_MAP_GENERATION
     142  Void    addAvgPdm         ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY );
     143#endif
    137144
    138145  //   Remove High frequency
  • branches/0.2-HHI/source/Lib/TLibCommon/TypeDef.h

    r5 r20  
    4040
    4141
     42
     43#define SONY_COLPIC_AVAILABILITY                  1
     44
    4245//>>>>> HHI 3DV tools >>>>>
    4346#define HHI_INTER_VIEW_MOTION_PRED      1   // inter-view motion parameter prediction
     
    5053#define HHI_VSO_COLOR_PLANES            1   // view synthesis optimization in color planes
    5154#define HHI_VSO_DIST_INT                1   // view synthesis optimization integer distorition in rdo process
     55#define HHI_VSO_LS_TABLE                1   // table based lambda scaling
    5256
    5357#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE && !HHI_INTERVIEW_SKIP
     
    6064#define HHI_NO_LowDelayCoding           0   // old-fashioned encoder control, should be adapted to hm5.0
    6165//<<<<< HHI 3DV tools <<<<<
     66
    6267
    6368
  • branches/0.2-HHI/source/Lib/TLibDecoder/TDecTop.cpp

    r5 r20  
    250250  m_bIsDepth = false ;
    251251  m_iViewIdx = 0 ;
     252#if SONY_COLPIC_AVAILABILITY
     253  m_iViewOrderIdx = 0;
     254#endif
    252255#if ENC_DEC_TRACE
    253256  g_hTrace = fopen( "TraceDec.txt", "wb" );
     
    382385
    383386#if DEPTH_MAP_GENERATION
    384   Bool bNeedPrdDepthMapBuffer = ( !pcSlice->getSPS()->isDepth() && ( pcSlice->getSPS()->getViewId() == 0 || pcSlice->getSPS()->getPredDepthMapGeneration() > 0 ) );
     387  UInt uiPdm                  = ( pcSlice->getSPS()->getViewId() ? pcSlice->getSPS()->getPredDepthMapGeneration() : m_pcTAppDecTop->getSPSAccess()->getPdm() );
     388  Bool bNeedPrdDepthMapBuffer = ( !pcSlice->getSPS()->isDepth() && uiPdm > 0 );
    385389#endif
    386390
     
    392396    if( bNeedPrdDepthMapBuffer )
    393397    {
    394       rpcPic->addPrdDepthMapBuffer();
     398      rpcPic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) );
    395399    }
    396400#endif
     
    426430  if( bNeedPrdDepthMapBuffer && !rpcPic->getPredDepthMap() )
    427431  {
    428     rpcPic->addPrdDepthMapBuffer();
     432    rpcPic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) );
    429433  }
    430434#endif
     
    593597      m_apcSlicePilot->setSliceIdx(m_uiSliceIdx);
    594598      m_apcSlicePilot->setViewIdx( m_cSPS.getViewId() );
     599#if SONY_COLPIC_AVAILABILITY
     600      m_apcSlicePilot->setViewOrderIdx( m_cSPS.getViewOrderIdx());
     601#endif
    595602      if (!m_bFirstSliceInPicture)
    596603      {
     
    633640        pcPic->setViewIdx( m_cSPS.getViewId() );
    634641
     642#if SONY_COLPIC_AVAILABILITY
     643        pcPic->setViewOrderIdx( m_cSPS.getViewOrderIdx() );
     644#endif
     645
    635646        /* transfer any SEI messages that have been received to the picture */
    636647        pcPic->setSEIs(m_SEIs);
     
    645656
    646657#if DEPTH_MAP_GENERATION
    647         m_cDepthMapGenerator.create( true, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
     658        UInt uiPdm = ( m_cSPS.getViewId() ? m_cSPS.getPredDepthMapGeneration() : getDecTop()->getSPSAccess()->getPdm() );
     659        m_cDepthMapGenerator.create( true, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) );
     660        TComDepthMapGenerator* pcDMG0 = getDecTop()->getDecTop0()->getDepthMapGenerator();
     661        if( m_cSPS.getViewId() == 1 && ( pcDMG0->getSubSampExpX() != PDM_SUB_SAMP_EXP_X(uiPdm) || pcDMG0->getSubSampExpY() != PDM_SUB_SAMP_EXP_Y(uiPdm) ) )
     662        {
     663          pcDMG0->create( true, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) );
     664        }
    648665#endif
    649666#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    683700        pcSlice->setTexturePic( pcTexturePic );
    684701        pcSlice->setViewIdx( pcPic->getViewIdx() );
     702#if SONY_COLPIC_AVAILABILITY
     703        pcSlice->setViewOrderIdx( pcPic->getViewOrderIdx() );
     704#endif
    685705        pcSlice->setRefPicListExplicitlyDecoderSided(m_cListPic, apcSpatRefPics) ;// temporary solution
    686706
  • branches/0.2-HHI/source/Lib/TLibDecoder/TDecTop.h

    r5 r20  
    140140  Bool                    m_bIsDepth;
    141141  Int                     m_iViewIdx;
     142#if SONY_COLPIC_AVAILABILITY
     143  Int                     m_iViewOrderIdx;
     144#endif
    142145  TAppDecTop*             m_pcTAppDecTop;
    143146  CamParsCollector*       m_pcCamParsCollector;
     
    180183  Void setViewIdx(Int i)                                        { m_iViewIdx = i ;}
    181184  Int  getViewIdx()                                                             { return m_iViewIdx ; }
     185#if SONY_COLPIC_AVAILABILITY
     186  Void setViewOrderIdx(Int i)                                   { m_iViewOrderIdx = i ;}
     187  Int  getViewOrderIdx()                                                        { return m_iViewOrderIdx ; }
     188#endif
    182189
    183190  Void setToDepth(Bool b)         { m_bIsDepth = b ;}
     
    187194
    188195  TComList<TComPic*>*     getListPic            () { return  &m_cListPic;             }
    189   TAppDecTop*             getDecTop           ( ){ return  m_pcTAppDecTop ;};
     196  TAppDecTop*             getDecTop           ( ){ return  m_pcTAppDecTop ;}
     197#if DEPTH_MAP_GENERATION
     198  TComDepthMapGenerator*  getDepthMapGenerator  () { return &m_cDepthMapGenerator; }
     199#endif
    190200
    191201  Void                    setSPS                (TComSPS cSPS );
  • branches/0.2-HHI/source/Lib/TLibEncoder/TEncCfg.h

    r5 r20  
    355355#endif
    356356
     357#if SONY_COLPIC_AVAILABILITY
     358  Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }
     359#endif
     360
    357361#if HHI_VSO
    358362  //==== VSO  ==========
  • branches/0.2-HHI/source/Lib/TLibEncoder/TEncSlice.cpp

    r5 r20  
    149149  rpcSlice->initSlice();
    150150  rpcSlice->setPOC( pcPic->getPOC() );
     151#if SONY_COLPIC_AVAILABILITY
     152  rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx());
     153#endif
    151154
    152155  // slice type
  • branches/0.2-HHI/source/Lib/TLibEncoder/TEncTop.cpp

    r5 r20  
    9292  m_cLoopFilter.        create( g_uiMaxCUDepth );
    9393#if DEPTH_MAP_GENERATION
    94   m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
     94  m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
    9595#endif
    9696#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    304304      if( bNeedPrdDepthMapBuf && !pcPic->getPredDepthMap() )
    305305      {
    306         pcPic->addPrdDepthMapBuffer();
     306        pcPic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
    307307      }
    308308#endif
     
    798798  pcPic->setQP(max(MIN_QP,min(MAX_QP, m_iQP+ m_aiTLayerQPOffset[m_cSeqIter.getFrameDescriptor().getTEncSeqStructureLayer(m_uiViewId)] + iQpChangeOffset )) );
    799799  pcPic->setViewIdx( m_uiViewId );
     800#if SONY_COLPIC_AVAILABILITY
     801  pcPic->setViewOrderIdx(m_iViewOrderIdx);
     802#endif
    800803#if 0
    801804  pcPic->setNumRefs(0, REF_PIC_LIST_0);
Note: See TracChangeset for help on using the changeset viewer.