Ignore:
Timestamp:
21 May 2015, 14:39:30 (10 years ago)
Author:
rwth
Message:
  • initial implementation of INTRA SDC (still not fully functional)
Location:
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder
Files:
9 edited

Legend:

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

    r1219 r1221  
    28432843   assert(0);
    28442844 }
    2845 #if H_3D_INTER_SDC
     2845#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    28462846Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
    28472847{
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.h

    r1209 r1221  
    126126  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    127127  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    128 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     128#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    129129  Void  codeDeltaDC      ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/ ) { assert(0); };
    130130#endif
     
    136136#endif
    137137
    138 #if H_3D_INTER_SDC
     138#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    139139  Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    140140#endif
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCu.cpp

    r1209 r1221  
    15971597    if(pcCU->getIPCMFlag(uiAbsPartIdx))
    15981598    {
    1599 #if H_3D_DIM_SDC
    1600       m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
     1599#if NH_3D_INTRA_SDC
     1600      m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx );
    16011601#endif 
    16021602
     
    16121612  m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx );
    16131613#endif
    1614 #if H_3D_DIM_SDC
    1615   m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
     1614#if NH_3D_INTRA_SDC
     1615  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx );
    16161616#endif 
    16171617#if H_3D_ARP
     
    24702470  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
    24712471  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
    2472 #if H_3D_DIM_SDC
     2472#if NH_3D_INTRA_SDC
    24732473  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
    24742474#endif
     
    27002700    m_pcPredSearch->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], resiLuma DEBUG_STRING_PASS_INTO(sTest) );
    27012701  }
    2702 #if H_3D_DIM_SDC
    2703   if( !rpcTempCU->getSDCFlag( 0 ) )
     2702 
     2703#if NH_3D_INTRA_SDC
     2704  if( rpcTempCU->getSDCFlag( 0 ) )
     2705  {
     2706    assert( rpcTempCU->getTransformIdx(0) == 0 );
     2707    assert( rpcTempCU->getCbf(0, COMPONENT_Y) == 1 );
     2708  }
    27042709#endif
    27052710
     
    27202725  m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0 );
    27212726  m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true );
    2722 #if H_3D_DIM_SDC
     2727#if NH_3D_INTRA_SDC
    27232728    m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
    27242729#endif
     
    28052810  m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
    28062811  m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true );
    2807 #if H_3D_DIM_SDC
     2812#if NH_3D_INTRA_SDC
    28082813  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
    28092814#endif
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1209 r1221  
    514514  {
    515515    encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx,true );
    516 #if H_3D_DIM_SDC
    517     if(!pcCU->getSDCFlag(uiAbsPartIdx))
    518 #endif
     516   
    519517    if (pcCU->getPic()->getChromaFormat()!=CHROMA_400)
    520518    {
     
    713711#endif
    714712
    715 #if H_3D_DIM_SDC
     713#if NH_3D_INTRA_SDC
    716714  if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) )
    717715  {
    718716    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
    719717    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
    720     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
    721     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    722     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     718    assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 );
    723719  }
    724720#endif
     
    734730  if( pcCU->getSlice()->getIsDepth() )
    735731  {
    736 #if H_3D_DIM_SDC || H_3D_INTER_SDC
     732#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    737733    if( pcCU->getSDCFlag( uiAbsPartIdx ) )
    738734    {
     
    843839}
    844840
    845 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     841#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    846842Void TEncEntropy::encodeDeltaDC  ( TComDataCU* pcCU, UInt absPartIdx )
    847843{
     
    849845}
    850846#endif
    851 #if H_3D_INTER_SDC
     847#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    852848Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    853849{
     850  if( bRD )
     851  {
     852    uiAbsPartIdx = 0;
     853  }
     854 
    854855  if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getInterSdcFlag() ) ||
    855856    ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getIntraSdcWedgeFlag() ) )
     
    863864  }
    864865
    865   assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
    866 
    867   if( bRD )
    868   {
    869     uiAbsPartIdx = 0;
    870   }
     866  assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N );
    871867
    872868  m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx );
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.h

    r1209 r1221  
    8484  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8585  virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    86 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     86#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    8787  virtual Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8888#endif
     
    9393  virtual Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    9494#endif
    95 #if H_3D_INTER_SDC
     95#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    9696  virtual Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    9797#endif
     
    181181  Void encodeICFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    182182#endif
    183 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     183#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    184184  Void encodeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
    185185#endif
    186 #if H_3D_INTER_SDC
     186#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    187187  Void encodeSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    188188#endif
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.cpp

    r1209 r1221  
    106106, m_cDmmModeSCModel                    ( 1,             1,                      NUM_DMM_MODE_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
    107107#endif
    108 #if NH_3D_DMM || NH_3D_SDC
     108#if NH_3D_DMM || NH_3D_INTRA_SDC
    109109, m_cDdcDataSCModel                    ( 1,             1,                      NUM_DDC_DATA_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
    110110#endif
    111 #if H_3D_DIM_SDC                                                                                                     
     111#if NH_3D_INTRA_SDC
    112112, m_cSDCResidualFlagSCModel            ( 1,             1,                      SDC_NUM_RESIDUAL_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    113113, m_cSDCResidualSCModel                ( 1,             1,                      SDC_NUM_RESIDUAL_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
     
    187187  m_cDmmModeSCModel.initBuffer                    ( eSliceType, iQp, (UChar*)INIT_DMM_MODE );
    188188#endif
    189 #if NH_3D_DMM || NH_3D_SDC
     189#if NH_3D_DMM || NH_3D_INTRA_SDC
    190190  m_cDdcDataSCModel.initBuffer                    ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    191191#endif
    192 #if H_3D_DIM_SDC                                 
     192#if NH_3D_INTRA_SDC
    193193  m_cSDCResidualFlagSCModel.initBuffer            ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
    194194  m_cSDCResidualSCModel.initBuffer                ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
     
    243243      curCost += m_cCUICFlagSCModel.calcCost                   ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
    244244#endif                                                     
    245 #if H_3D_DIM_SDC                                           
     245#if NH_3D_INTRA_SDC
    246246      curCost += m_cSDCFlagSCModel.calcCost                    ( curSliceType, qp, (UChar*)INIT_SDC_FLAG );
    247247#endif                                                     
     
    280280      curCost += m_cDmmModeSCModel.calcCost                    ( curSliceType, qp, (UChar*)INIT_DMM_MODE );
    281281#endif
    282 #if NH_3D_DMM || NH_3D_SDC
     282#if NH_3D_DMM || NH_3D_INTRA_SDC
    283283      curCost += m_cDdcDataSCModel.calcCost                    ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
    284284#endif
     
    307307#if H_3D_IC
    308308  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
    309 #endif
    310 #if H_3D_DIM_SDC
    311   m_cSDCResidualFlagSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
    312   m_cSDCResidualSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
    313   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
    314   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    315309#endif
    316310#if H_3D_DBBP
     
    799793Void TEncSbac::codePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
    800794{
    801 #if H_3D_DIM_SDC
    802   if ( pcCU->getSlice()->isIntra() )
    803   {
    804     assert( pcCU->isIntra(uiAbsPartIdx) );
    805     return;
    806   }
    807 #endif
    808  
    809795  // get context function is here
    810796  m_pcBinIf->encodeBin( pcCU->isIntra( uiAbsPartIdx ) ? 1 : 0, m_cCUPredModeSCModel.get( 0, 0, 0 ) );
     
    24872473}
    24882474
    2489 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     2475#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    24902476Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )
    24912477{
    2492 #if H_3D_DIM_SDC || H_3D_INTER_SDC
     2478#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    24932479  if( !(pcCU->getSDCFlag( absPartIdx )) )
    24942480#endif
     
    25042490
    25052491  UInt hasDeltaDC = 1;
    2506 #if H_3D_DIM_SDC
     2492#if NH_3D_INTRA_SDC
    25072493  if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
    25082494  {
     
    25262512      if( pcCU->isIntra( absPartIdx ) )
    25272513      {
    2528 #if H_3D_DIM_SDC
     2514#if NH_3D_INTRA_SDC
    25292515        if( pcCU->getSDCFlag( absPartIdx ) )
    25302516        {
     
    25372523        deltaDC = pcCU->getDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx );
    25382524#endif
    2539 #if H_3D_DIM_SDC
     2525#if NH_3D_INTRA_SDC
    25402526        }
    25412527#endif
     
    25542540Void TEncSbac::xCodeDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
    25552541{
     2542  DTRACE_CU("delta_dc", valDeltaDC);
    25562543  xWriteExGolombLevelDdc( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ) );
    25572544  if( valDeltaDC != 0 )
     
    26392626#endif
    26402627
    2641 #if H_3D_INTER_SDC
     2628#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    26422629Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    26432630{
    26442631  UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
    2645   UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
    26462632  DTRACE_CU("dc_only_flag", uiSymbol)
    2647   m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2633  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, 0 ) );
    26482634}
    26492635
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.h

    r1209 r1221  
    115115  Void  xWriteEpExGolomb     ( UInt uiSymbol, UInt uiCount );
    116116  Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange );
    117 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     117#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    118118  Void  xWriteExGolombLevelDdc( UInt uiSymbol );
    119119  Void  xCodeDeltaDC         ( Pel valDeltaDC, UInt uiNumSeg );
     
    149149  Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    150150#endif
    151 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
     151#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    152152  Void  codeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
    153153#endif
    154 #if H_3D_INTER_SDC
     154#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
    155155  Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    156156#endif
     
    252252  ContextModel3DBuffer m_cDmmModeSCModel;
    253253#endif
    254 #if NH_3D_DMM || NH_3D_SDC
     254#if NH_3D_DMM || NH_3D_INTRA_SDC
    255255  ContextModel3DBuffer m_cDdcDataSCModel;
    256256#endif
    257 #if H_3D_DIM_SDC 
     257#if NH_3D_INTRA_SDC 
    258258  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
    259259  ContextModel3DBuffer m_cSDCResidualSCModel;
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp

    r1219 r1221  
    10311031        if ( pcCU->getIPCMFlag (0))
    10321032        {
    1033 #if H_3D_DIM_SDC
     1033#if NH_3D_INTRA_SDC
    10341034            m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    10351035#endif
     
    10511051      {
    10521052        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
    1053 #if H_3D_DIM_SDC
     1053#if NH_3D_INTRA_SDC
    10541054          m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    1055           if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) ) 
     1055          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) )
    10561056          {
    10571057            m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 );
     
    10661066      {
    10671067        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
    1068 #if H_3D_DIM_SDC
     1068#if NH_3D_INTRA_SDC
    10691069          }
    10701070          m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     
    10761076            }
    10771077#endif
    1078 #if H_3D_DIM_SDC
     1078#if NH_3D_INTRA_SDC
    10791079          if( uiAbsPartIdx == 0 ) 
    10801080          {
     
    19741974}
    19751975#endif
    1976 #if H_3D_DIM_SDC
     1976#if NH_3D_INTRA_SDC
    19771977Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
    19781978{
    19791979#if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC
    1980   Bool bAboveAvail    = false;
    1981   Bool bLeftAvail     = false;
    19821980  UInt uiWidth        = pcCU->getWidth ( 0 );
    19831981  UInt uiHeight       = pcCU->getHeight( 0 );
    19841982  UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx );
     1983  const Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     1984  const TComSPS     &sps    = *(pcCU->getSlice()->getSPS());
     1985  const ChromaFormat chFmt  = pcCU->getPic()->getChromaFormat();
    19851986
    19861987  UInt sdcDepth = 0;
     
    19901991  Pel* piReco;       
    19911992
    1992   UInt uiZOrder;         
    1993   Pel* piRecIPred;       
     1993  Pel* piRecIPred;
    19941994  UInt uiRecIPredStride;
    19951995
     
    20012001  UInt uiMaskStride = 0;
    20022002#if NH_3D_DMM
    2003   TComWedgelet* dmm4Segmentation = NULL;
    20042003  if( isDmmMode( uiLumaPredMode ) )
    20052004  {
     
    20512050#endif
    20522051    uiNumSegments = 1;
    2053 
    2054     UInt numParts = 1;
    2055     UInt uiSubPartIdx = uiAbsPartIdx;
    2056 
     2052   
    20572053    if( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )
    20582054    {
    2059       numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
    20602055      sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
    2061       uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
    2062     }
    2063 
    2064     for ( Int i = 0; i < numParts; i++ )
    2065     {
    2066       uiStride          = pcOrgYuv ->getStride  ();
    2067       piOrg             = pcOrgYuv ->getLumaAddr( uiSubPartIdx );
    2068       piPred            = pcPredYuv->getLumaAddr( uiSubPartIdx );
    2069       piReco            = pcPredYuv->getLumaAddr( uiSubPartIdx );
    2070 
    2071       uiZOrder          = pcCU->getZorderIdxInCU() + uiSubPartIdx;
    2072       piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    2073       uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    2074 
    2075       AOF( uiWidth == uiHeight );
    2076 
    2077       //===== init availability pattern =====
    2078       pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiSubPartIdx );
    2079       pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
    2080 
    2081       predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
    2082 
    2083       if ( numParts > 1 )
    2084       {
    2085         for( UInt uiY = 0; uiY < uiHeight; uiY++ )
    2086         {
    2087           for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    2088           {
    2089             piPred        [ uiX ] = ClipY( piPred[ uiX ] );
    2090             piRecIPred    [ uiX ] = piPred[ uiX ];
    2091           }
    2092           piPred     += uiStride;
    2093           piRecIPred += uiRecIPredStride;
    2094         }
    2095       }
    2096 
    2097       uiSubPartIdx += ( ( uiWidth * uiWidth ) >> 4 );
    2098     }
     2056    }
     2057   
     2058    //===== loop over partitions =====
     2059    TComTURecurse tuRecurseCU(pcCU, 0);
     2060    TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (sdcDepth==0)?TComTU::DONT_SPLIT:TComTU::QUAD_SPLIT);
     2061   
     2062    do
     2063    {
     2064      const TComRectangle &puRect = tuRecurseWithPU.getRect(COMPONENT_Y);
     2065      const UInt uiAbsPartIdxTU = tuRecurseWithPU.GetAbsPartIdxTU();
     2066     
     2067      Pel* piOrgTU         = pcOrgYuv ->getAddr   ( COMPONENT_Y, uiAbsPartIdxTU );
     2068      Pel* piPredTU        = pcPredYuv->getAddr   ( COMPONENT_Y, uiAbsPartIdxTU );
     2069      UInt uiStrideTU      = pcPredYuv->getStride ( COMPONENT_Y );
     2070     
     2071      //===== init pattern for luma prediction =====
     2072      Bool bAboveAvail = false;
     2073      Bool bLeftAvail  = false;
     2074     
     2075      if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
     2076      {
     2077        initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
     2078      }
     2079     
     2080      const Bool bUseFilter = TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiLumaPredMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
     2081     
     2082      predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiLumaPredMode) );
     2083     
     2084    } while (tuRecurseWithPU.nextSection(tuRecurseCU));
    20992085
    21002086    // reset to full block
     
    21022088    uiHeight = pcCU->getHeight( 0 );
    21032089
    2104     uiStride          = pcOrgYuv ->getStride  ();
    2105     piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
    2106     piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    2107     piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    2108 
    2109     uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    2110     piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    2111     uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     2090    uiStride          = pcOrgYuv ->getStride( COMPONENT_Y );
     2091    piOrg             = pcOrgYuv ->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
     2092    piPred            = pcPredYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
     2093    piReco            = pcPredYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
     2094   
     2095    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getAddr  ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx );
     2096    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y );
    21122097
    21132098    // get predicted and original DC
     
    22732258    if( !bZeroResidual )
    22742259    {
     2260#if NH_3D_DLT
    22752261      Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    22762262      Int   pTestIdx    = pPredIdx + pResidualIdx + iSDCDeltaResi;
     
    22792265        pResidualIdx += iSDCDeltaResi;
    22802266      }
     2267#else
     2268      pResidualIdx += iSDCDeltaResi;
     2269#endif
    22812270    }
    22822271    // save SDC DC offset
     
    23142303      Pel pResiDC = apDCResiValues[ucSegment];
    23152304
    2316       pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResiDC );
     2305      pReco    [ uiX ] = ClipBD( pPred[ uiX ] + pResiDC, bitDepthY);
    23172306      pRecIPred[ uiX ] = pReco[ uiX ];
    23182307    }
     
    23232312  }
    23242313
    2325   // clear UV
    2326   UInt  uiStrideC     = pcPredYuv->getCStride();
    2327   Pel   *pRecCb       = pcPredYuv->getCbAddr();
    2328   Pel   *pRecCr       = pcPredYuv->getCrAddr();
     2314  // clear chroma
     2315  UInt  uiStrideC     = pcPredYuv->getStride( COMPONENT_Cb );
     2316  Pel   *pRecCb       = pcPredYuv->getAddr  ( COMPONENT_Cb, uiAbsPartIdx );
     2317  Pel   *pRecCr       = pcPredYuv->getAddr  ( COMPONENT_Cr, uiAbsPartIdx );
    23292318
    23302319  for (Int y=0; y<uiHeight/2; y++)
     
    23462335#endif
    23472336
    2348   //===== determine distortion =====
    2349 #if H_3D_VSO
    2350   if ( m_pcRdCost->getUseVSO() )
    2351     ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
     2337  //===== determine distortion ===== 
     2338#if NH_3D_VSO
     2339  if( m_pcRdCost->getUseVSO() )
     2340  {
     2341    if( m_pcRdCost->getUseEstimatedVSD() )
     2342    {
     2343      ruiDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
     2344    }
     2345    else
     2346    {
     2347      ruiDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
     2348    }
     2349  }
    23522350  else
    23532351#endif
    2354     ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
     2352  {
     2353    ruiDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, COMPONENT_Y, DF_SAD );
     2354  }
    23552355
    23562356  //===== determine rate and r-d cost =====
     
    23712371
    23722372  // encode pred direction + DC residual data
    2373   m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     2373  m_pcEntropyCoder->encodePredInfo( pcCU, 0 );
    23742374  m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    23752375
    23762376  Bool bDummy = false;
    2377   m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
     2377  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), bDummy, bDummy );
    23782378  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    23792379
    2380 #if H_3D_VSO
     2380#if NH_3D_VSO
    23812381  if ( m_pcRdCost->getUseLambdaScaleVSO())
    23822382    dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
     
    32393239    UInt rdSDC = m_pcEncCfg->getIsDepth() ? numModesForFullRD : 0;
    32403240#endif
    3241 #if H_3D_DIM_SDC
     3241#if NH_3D_INTRA_SDC
    32423242    Bool    bBestUseSDC   = false;
    32433243    Pel     apBestDCOffsets[2] = {0,0};
     
    32903290      pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
    32913291
    3292 #if H_3D_DIM_SDC
     3292#if NH_3D_INTRA_SDC
    32933293#if H_3D_FAST_INTRA_SDC
    32943294      Bool bTestSDC = ( ( m_pcEncCfg->getUseSDC() &&  pcCU->getSlice()->getIntraSdcWedgeFlag() ) && pcCU->getSDCAvailable(uiPartOffset) && uiMode >= numModesForFullRD);
     
    33373337#if NH_3D_ENC_DEPTH
    33383338          UInt zeroResiTest = (pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP()) ? 1 : 0;
    3339 #if H_3D_DIM_SDC
    3340           bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);
     3339#if NH_3D_INTRA_SDC
     3340          zeroResiTest |= pcCU->getSDCFlag(uiPartOffset);
    33413341          if( uiSDC != 0 && iSDCDeltaResi != 0 )
    33423342          {
    3343             bTestZeroResi = false;
     3343            zeroResiTest = 0;
    33443344          }
    33453345#endif
     
    33643364      }
    33653365#endif
    3366 #if H_3D_DIM_SDC
     3366#if NH_3D_INTRA_SDC
    33673367            if( pcCU->getSDCFlag(uiPartOffset) )
    33683368            {
    33693369              pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);
    3370               pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);
     3370              pcCU->setCbfSubParts(1, COMPONENT_Y, uiPartOffset, uiDepth + uiInitTrDepth);
    33713371
    33723372              // start encoding with SDC
    3373               xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
    3374               if ( testZeroResi == 0 && iOffset <= 3 )
     3373              xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( zeroResi != 0 ), iSDCDeltaResi );
     3374              if ( zeroResi == 0 && iOffset <= 3 )
    33753375              {
    33763376                dOffsetCost [iOffset -1] = dPUCost;
     
    34033403#endif
    34043404#endif
    3405 #if H_3D_DIM_SDC
     3405#if NH_3D_INTRA_SDC
    34063406            }
    34073407#endif
     
    34243424        dBestPUCost   = dPUCost;
    34253425
    3426 #if H_3D_DIM_SDC
     3426#if NH_3D_INTRA_SDC
    34273427              if( pcCU->getSDCFlag(uiPartOffset) )
    34283428              {
     
    34303430
    34313431                // copy reconstruction
    3432                 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight);
     3432                UInt uiWidthPU  = tuRecurseWithPU.getRect( COMPONENT_Y ).width;
     3433                UInt uiHeightPU = tuRecurseWithPU.getRect( COMPONENT_Y ).height;
     3434                UInt    uiWidth        = pcCU->getWidth (0) >> uiInitTrDepth;
     3435                UInt    uiHeight       = pcCU->getHeight(0) >> uiInitTrDepth;
     3436                AOF(uiWidth==uiWidthPU);
     3437                AOF(uiHeight==uiHeightPU);
     3438                pcPredYuv->copyPartToPartComponent(COMPONENT_Y, pcRecoYuv, uiPartOffset, uiWidth, uiHeight);
    34333439
    34343440                // copy DC values
     
    34633469          ::memcpy( m_puhQTTempCbf[compID], pcCU->getCbf( compID  ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
    34643470          ::memcpy( m_puhQTTempTransformSkipFlag[compID],  pcCU->getTransformSkip(compID)  + uiPartOffset, uiQPartNum * sizeof( UChar ) );
    3465 #if H_3D_DIM_SDC
    3466               }
    3467 #endif
    3468 
    3469         }
     3471        }
     3472#if NH_3D_INTRA_SDC
     3473        }
     3474#endif
    34703475      }
    34713476#if HHI_RQT_INTRA_SPEEDUP_MOD
     
    34793484          }
    34803485#endif
    3481 #if H_3D_DIM_SDC
     3486#if NH_3D_INTRA_SDC
    34823487        } // SDC residual loop
    34833488      } // SDC loop
     
    35103515
    35113516      pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
    3512 #if H_3D_DIM_SDC
     3517#if NH_3D_INTRA_SDC
    35133518      pcCU->setSDCFlagSubParts(false, uiPartOffset, uiDepth + uiInitTrDepth);
    35143519#endif
     
    35433548        uiBestPUDistY = uiPUDistY;
    35443549        dBestPUCost   = dPUCost;
    3545 #if H_3D_DIM_SDC
     3550#if NH_3D_INTRA_SDC
    35463551        bBestUseSDC   = false;
    35473552#endif
     
    35803585    //--- update overall distortion ---
    35813586    uiOverallDistY += uiBestPUDistY;
    3582 #if H_3D_DIM_SDC
     3587#if NH_3D_INTRA_SDC
    35833588    if( bBestUseSDC )
    35843589    {
    35853590      pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);
    3586       pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);
     3591      pcCU->setCbfSubParts(1, COMPONENT_Y, uiPartOffset, uiDepth + uiInitTrDepth);
    35873592
    35883593      //=== copy best DC segment values back to CU ====
     
    36023607      ::memcpy( pcCU->getCbf( compID  ) + uiPartOffset, m_puhQTTempCbf[compID], uiQPartNum * sizeof( UChar ) );
    36033608      ::memcpy( pcCU->getTransformSkip( compID  ) + uiPartOffset, m_puhQTTempTransformSkipFlag[compID ], uiQPartNum * sizeof( UChar ) );
    3604 #if H_3D_DIM_SDC
     3609#if NH_3D_INTRA_SDC
    36053610    }
    36063611#endif
     
    36393644    //=== update PU data ====
    36403645    pcCU->setIntraDirSubParts     ( CHANNEL_TYPE_LUMA, uiBestPUMode, uiPartOffset, uiDepth + uiInitTrDepth );
    3641 #if H_3D_DIM_SDC
     3646#if NH_3D_INTRA_SDC
    36423647    pcCU->setSDCFlagSubParts          ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth );
    36433648#endif
     
    61626167#endif
    61636168
    6164 #if H_3D_DIM_SDC
     6169#if NH_3D_INTRA_SDC
    61656170  Bool bNonSkip = false;
    61666171#else
     
    72267231    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    72277232    m_pcEntropyCoder->encodePredInfo( pcCU, 0 );
    7228 #if H_3D_DIM_SDC
     7233#if NH_3D_INTRA_SDC
    72297234    m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    72307235#endif
     
    77697774#endif
    77707775#if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
    7771 #if NH_3D_SDC
     7776#if NH_3D_INTRA_SDC
    77727777Void TEncSearch::xCalcConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC )
    77737778{
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.h

    r1209 r1221  
    356356  Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
    357357#endif
    358 #if H_3D_DIM_SDC
     358#if NH_3D_INTRA_SDC
    359359  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi    );
    360360#endif
    361361#if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
    362 #if NH_3D_SDC
     362#if NH_3D_INTRA_SDC
    363363  Void xCalcConstantSDC           ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC );
    364364#endif
Note: See TracChangeset for help on using the changeset viewer.