Ignore:
Timestamp:
28 Jul 2015, 03:59:07 (9 years ago)
Author:
lg
Message:

Integration of inter SDC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1-LG/source/Lib/TLibEncoder/TEncSearch.cpp

    r1287 r1303  
    4444#include <math.h>
    4545#include <limits>
    46 #if H_3D_INTER_SDC
    47 #include <memory.h>
    48 #endif
    49 
    5046
    5147//! \ingroup TLibEncoder
     
    372368  m_cDistParam.bUseIC = pcPatternKey->getICFlag();
    373369#endif
    374 #if H_3D_INTER_SDC
     370#if NH_3D_SDC_INTER
    375371  m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag();
    376372#endif
     
    883879    m_cDistParam.bUseIC = pcPatternKey->getICFlag();
    884880#endif
    885 #if H_3D_INTER_SDC
     881#if NH_3D_SDC_INTER
    886882    m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag();
    887883#endif
     
    29072903      distParam.bUseIC = false;
    29082904#endif
    2909 #if H_3D_INTER_SDC_FIX
     2905#if NH_3D_SDC_INTER
    29102906      distParam.bUseSDCMRSAD = false;
    29112907#endif
     
    38473843  cDistParam.bUseIC = false;
    38483844#endif
    3849 #if H_3D_INTER_SDC
     3845#if NH_3D_SDC_INTER
    38503846  cDistParam.bUseSDCMRSAD = false;
    38513847#endif
     
    50575053  pcPatternKey->setICFlag( bICFlag );
    50585054#endif
    5059 #if H_3D_INTER_SDC
     5055#if NH_3D_SDC_INTER
    50605056   pcPatternKey->setSDCMRSADFlag( pcCU->getSlice()->getInterSdcFlag() );
    50615057#endif
     
    52465242      m_cDistParam.bUseIC = pcPatternKey->getICFlag();
    52475243#endif
    5248 #if H_3D_INTER_SDC
     5244#if NH_3D_SDC_INTER
    52495245      m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag();
    52505246#endif
     
    59645960}
    59655961
    5966 #if H_3D_INTER_SDC
     5962#if NH_3D_SDC_INTER
    59675963Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth )
    59685964{
     
    59785974
    59795975  Pel *pPred, *pOrg;
    5980   UInt uiPredStride = pcPred->getStride();
    5981   UInt uiOrgStride  = pcOrg->getStride();
     5976  UInt uiPredStride = pcPred->getStride( COMPONENT_Y );
     5977  UInt uiOrgStride  = pcOrg->getStride( COMPONENT_Y );
    59825978  UInt uiPelX, uiPelY;
    59835979
    5984   pPred = pcPred->getLumaAddr( 0 );
    5985   pOrg  = pcOrg->getLumaAddr( 0 );
     5980  pPred = pcPred->getAddr( COMPONENT_Y );
     5981  pOrg  = pcOrg->getAddr( COMPONENT_Y );
    59865982  Int pResDC = 0;
     5983  Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     5984  Int bitDepthC = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    59875985
    59885986  //calculate dc value for prediction and original signal, and calculate residual and reconstruction
     
    60056003
    60066004  Pel *pRec;
    6007   UInt uiRecStride  = pcRec->getStride();
    6008   pPred = pcPred->getLumaAddr( 0 );
    6009   pRec  = pcRec->getLumaAddr( 0 );
     6005  UInt uiRecStride  = pcRec->getStride( COMPONENT_Y );
     6006  pPred = pcPred->getAddr( COMPONENT_Y );
     6007  pRec  = pcRec->getAddr( COMPONENT_Y );
    60106008
    60116009  for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
     
    60136011    for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
    60146012    {
    6015       pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) );
     6013      pRec[ uiPelX ] = Clip3( 0, (1 << bitDepthY) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) );
    60166014    }
    60176015    pPred     += uiPredStride;
     
    60206018
    60216019  // clear UV
    6022   UInt  uiStrideC     = pcRec->getCStride();
    6023   Pel   *pRecCb       = pcRec->getCbAddr();
    6024   Pel   *pRecCr       = pcRec->getCrAddr();
     6020  UInt  uiStrideC     = pcRec->getStride( COMPONENT_Cb );
     6021  Pel   *pRecCb       = pcRec->getAddr( COMPONENT_Cb );
     6022  Pel   *pRecCr       = pcRec->getAddr( COMPONENT_Cr );
    60256023
    60266024  for (Int y=0; y < uiHeight/2; y++)
     
    60286026    for (Int x=0; x < uiWidth/2; x++)
    60296027    {
    6030       pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) );
    6031       pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) );
     6028      pRecCb[x] = (Pel)( 1 << ( bitDepthC - 1 ) );
     6029      pRecCr[x] = (Pel)( 1 << ( bitDepthC - 1 ) );
    60326030    }
    60336031
     
    60386036  Dist ruiDist;
    60396037  Double rdCost;
    6040 #if H_3D_VSO // M13
     6038#if NH_3D_VSO // M13
    60416039  if ( m_pcRdCost->getUseVSO() )
    60426040  {
    6043     ruiDist = m_pcRdCost->getDistPartVSO( pcCU, 0, pcRec->getLumaAddr(), pcRec->getStride(),  pcOrg->getLumaAddr(), pcOrg->getStride(),  uiWidth,      uiHeight     , false );
     6041    ruiDist = m_pcRdCost->getDistPartVSO( pcCU, 0, bitDepthY, pcRec->getAddr( COMPONENT_Y ), pcRec->getStride( COMPONENT_Y ),  pcOrg->getAddr( COMPONENT_Y ), pcOrg->getStride( COMPONENT_Y ),  uiWidth,      uiHeight     , false );
    60446042  }
    60456043  else   
     
    60476045#endif
    60486046    {
    6049       ruiDist = m_pcRdCost->getDistPart( g_bitDepthY, pcRec->getLumaAddr( 0 ), uiRecStride, pcOrg->getLumaAddr( 0 ), uiOrgStride, uiWidth, uiHeight );
    6050     }
    6051 #if H_3D_VSO
    6052   }
    6053 #endif
    6054 
    6055 #if NH_3D_SDC_INTRA
     6047      ruiDist = m_pcRdCost->getDistPart( bitDepthY, pcRec->getAddr( COMPONENT_Y ), uiRecStride, pcOrg->getAddr( COMPONENT_Y ), uiOrgStride, uiWidth, uiHeight, COMPONENT_Y );
     6048    }
     6049#if NH_3D_VSO
     6050  }
     6051#endif
     6052
    60566053  Bool bNonSkip = false;
    6057 #else
    6058   Bool bNonSkip = true;
    6059 #endif
    60606054  bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0;
    60616055  if( !bNonSkip )
     
    60696063    //----- determine rate and r-d cost -----
    60706064    UInt uiBits = 0;
    6071     TComYuv *pDummy = NULL;
    60726065    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] );
    60736066
    6074     xAddSymbolBitsInter( pcCU, 0, 0, uiBits, pDummy, NULL, pDummy );
    6075 
    6076 #if H_3D_VSO //M 14
     6067    xAddSymbolBitsInter( pcCU, uiBits );
     6068
     6069#if NH_3D_VSO //M 14
    60776070    if ( m_pcRdCost->getUseLambdaScaleVSO() )   
    60786071    {
     
    60926085  }
    60936086
    6094 #if H_3D_VSO // necessary? // M15
     6087#if NH_3D_VSO // necessary? // M15
    60956088  // set Model
    60966089  if( !m_pcRdCost->getUseEstimatedVSD() && m_pcRdCost->getUseRenModel() )
    60976090  {
    6098     Pel*  piSrc       = pcRec->getLumaAddr();
    6099     UInt  uiSrcStride = pcRec->getStride();
     6091    Pel*  piSrc       = pcRec->getAddr( COMPONENT_Y );
     6092    UInt  uiSrcStride = pcRec->getStride( COMPONENT_Y );
    61006093    m_pcRdCost->setRenModelData( pcCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    61016094  }
Note: See TracChangeset for help on using the changeset viewer.