Ignore:
Timestamp:
25 Feb 2015, 10:53:42 (10 years ago)
Author:
samsung-htm
Message:

Integration of K0033: Depth intra skip (DIS) mode

Location:
branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1133 r1145  
    10401040      READ_FLAG( uiCode, "qt_pred_flag" ); sps3dExt->setQtPredFlag( d, uiCode == 1 );
    10411041      READ_FLAG( uiCode, "inter_sdc_flag" ); sps3dExt->setInterSdcFlag( d, uiCode == 1 );
     1042#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1043      READ_FLAG( uiCode, "intra_skip_flag" ); sps3dExt->setDepthIntraSkipFlag( d, uiCode == 1 );
     1044#else
    10421045      READ_FLAG( uiCode, "intra_single_flag" ); sps3dExt->setIntraSingleFlag( d, uiCode == 1 );
     1046#endif
    10431047    }
    10441048  }
     
    29842988  assert(0);
    29852989}
     2990
     2991#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2992Void TDecCavlc::parseDIS( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     2993{
     2994  assert(0);
     2995}
     2996#else
    29862997#if H_3D_SINGLE_DEPTH
    29872998Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     
    29903001}
    29913002#endif
     3003#endif
     3004
    29923005Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    29933006{
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecCAVLC.h

    r1133 r1145  
    124124 
    125125  Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     126#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     127  Void  parseDIS            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     128#else
    126129#if H_3D_SINGLE_DEPTH
    127130  Void  parseSingleDepthMode        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    128 #endif 
     131#endif
     132#endif
    129133  Void  parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    130134  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecCu.cpp

    r1133 r1145  
    520520    return;
    521521  }
     522#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     523  m_pcEntropyDecoder->decodeDIS( pcCU, uiAbsPartIdx, uiDepth );
     524  if(!pcCU->getDISFlag(uiAbsPartIdx))
     525  {
     526#else
    522527#if H_3D_SINGLE_DEPTH
    523528  m_pcEntropyDecoder->decodeSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth );
    524529  if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    525530  {
     531#endif
    526532#endif
    527533  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
     
    554560  m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP );
    555561  setdQPFlag( bCodeDQP );
     562#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     563  }
     564#else
    556565#if H_3D_SINGLE_DEPTH
    557566  }
     567#endif
    558568#endif
    559569  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
     
    656666      break;
    657667    case MODE_INTRA:
     668#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     669      if( m_ppcCU[uiDepth]->getDISFlag(0) )
     670      {
     671        xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );
     672      }
     673#if H_3D_DIM_SDC
     674      else if( m_ppcCU[uiDepth]->getSDCFlag(0) )
     675      {
     676        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
     677      }
     678#endif
     679      else
     680#else
    658681#if H_3D_SINGLE_DEPTH
    659682      if( m_ppcCU[uiDepth]->getSingleDepthFlag(0) )
     
    671694#endif
    672695#endif
     696#endif
    673697      xReconIntraQT( m_ppcCU[uiDepth], uiDepth );
    674698      break;
     
    704728  }
    705729}
     730
     731#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     732Void TDecCu::xReconDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     733{
     734  UInt uiWidth        = pcCU->getWidth  ( 0 );
     735  UInt uiHeight       = pcCU->getHeight ( 0 );
     736
     737  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     738
     739  UInt    uiStride    = pcRecoYuv->getStride  ();
     740  Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     741
     742
     743  AOF( uiWidth == uiHeight );
     744  AOF( uiAbsPartIdx == 0 );
     745
     746  Bool  bAboveAvail = false;
     747  Bool  bLeftAvail  = false;
     748  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
     749  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0,
     750    m_pcPrediction->getPredicBuf       (),
     751    m_pcPrediction->getPredicBufWidth  (),
     752    m_pcPrediction->getPredicBufHeight (),
     753    bAboveAvail, bLeftAvail
     754    );
     755
     756  if ( pcCU->getDISType(uiAbsPartIdx) == 0 )
     757  {
     758    m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), VER_IDX, piReco, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     759  }
     760  else if ( pcCU->getDISType(uiAbsPartIdx) == 1 )
     761  {
     762    m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piReco, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     763  }
     764  else if ( pcCU->getDISType(uiAbsPartIdx) == 2 )
     765  {
     766    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
     767    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 );
     768    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     769    {
     770      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     771      {
     772        piReco[ uiX ] = pSingleDepth;
     773      }
     774      piReco+= uiStride;
     775    }
     776  }
     777  else if ( pcCU->getDISType(uiAbsPartIdx) == 3 )
     778  {
     779    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
     780    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 );
     781    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     782    {
     783      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     784      {
     785        piReco[ uiX ] = pSingleDepth;
     786      }
     787      piReco+= uiStride;
     788    }
     789  }
     790
     791  // clear UV
     792  UInt  uiStrideC     = pcRecoYuv->getCStride();
     793  Pel   *pRecCb       = pcRecoYuv->getCbAddr();
     794  Pel   *pRecCr       = pcRecoYuv->getCrAddr();
     795
     796  for (Int y=0; y<uiHeight/2; y++)
     797  {
     798    for (Int x=0; x<uiWidth/2; x++)
     799    {
     800      pRecCb[x] = 1<<(g_bitDepthC-1);
     801      pRecCr[x] = 1<<(g_bitDepthC-1);
     802    }
     803
     804    pRecCb += uiStrideC;
     805    pRecCr += uiStrideC;
     806  }
     807}
     808#else
    706809#if H_3D_SINGLE_DEPTH
    707810Void TDecCu::xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    772875}
    773876#endif
     877#endif
     878
    774879#if H_3D_INTER_SDC
    775880Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecCu.h

    r1084 r1145  
    123123  Void setdQPFlag               ( Bool b )                { m_bDecodeDQP = b;           }
    124124  Void xFillPCMBuffer           (TComDataCU* pCU, UInt depth);
     125#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     126  Void xReconDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     127#else
    125128#if H_3D_SINGLE_DEPTH
    126129  Void xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     130#endif
    127131#endif
    128132#if H_3D_DIM_SDC
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1133 r1145  
    5252  m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
    5353}
     54
     55#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     56Void TDecEntropy::decodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     57{
     58  if( !pcCU->getSlice()->getDepthIntraSkipFlag() )
     59  {
     60    return;
     61  } 
     62
     63  m_pcEntropyDecoderIf->parseDIS( pcCU, uiAbsPartIdx, uiDepth );
     64}
     65#else
    5466#if H_3D_SINGLE_DEPTH
    5567Void TDecEntropy::decodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    6375}
    6476#endif
     77#endif
     78
    6579Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    6680{
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecEntropy.h

    r1133 r1145  
    8585public:
    8686  virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     87#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     88  virtual Void parseDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     89#else
    8790#if H_3D_SINGLE_DEPTH
    8891  virtual Void parseSingleDepthMode       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     92#endif
    8993#endif
    9094  virtual Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    171175  Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    172176  Void decodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     177#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     178  Void decodeDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ;
     179#else
    173180#if H_3D_SINGLE_DEPTH
    174181  Void decodeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ;
     182#endif
    175183#endif
    176184  Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecSbac.cpp

    r1133 r1145  
    5252, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    5353, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     54#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     55, m_cCUDISFlagSCModel         ( 1,             1,               NUM_DIS_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     56, m_cCUDISTypeSCModel         ( 1,             1,               NUM_DIS_TYPE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     57#else
    5458#if H_3D_SINGLE_DEPTH
    5559, m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    5660, m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     61#endif
    5762#endif
    5863, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
     
    136141  m_cCUSplitFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    137142  m_cCUSkipFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SKIP_FLAG );
     143#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     144  m_cCUDISFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_DIS_FLAG );
     145  m_cCUDISTypeSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_DIS_TYPE );
     146#else
    138147#if H_3D_SINGLE_DEPTH
    139148  m_cCUSingleDepthFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    140149  m_cSingleDepthValueSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     150#endif
    141151#endif
    142152  m_cCUMergeFlagExtSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT );
     
    207217  m_cCUSplitFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG );
    208218  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     219#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     220  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
     221  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
     222#else
    209223#if H_3D_SINGLE_DEPTH
    210224  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    211225  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     226#endif
    212227#endif
    213228  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT );
     
    570585#endif
    571586}
     587
     588#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     589Void TDecSbac::parseDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     590{
     591  pcCU->setDISFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     592  UInt uiSymbol = 0;
     593  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUDISFlagSCModel.get( 0, 0, 0 ) );
     594  if( uiSymbol )
     595  {
     596    pcCU->setDISFlagSubParts( true,        uiAbsPartIdx, uiDepth );
     597    pcCU->setSkipFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     598    pcCU->setSDCFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     599    pcCU->setPredModeSubParts( MODE_INTRA,  uiAbsPartIdx, uiDepth );
     600    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     601    pcCU->setLumaIntraDirSubParts (DC_IDX, uiAbsPartIdx, uiDepth );
     602    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     603    pcCU->setMergeFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
     604    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
     605    pcCU->setCbfSubParts(0, 1, 1, uiAbsPartIdx, uiDepth);
     606
     607    UInt uiUnaryIdx = 0;
     608    UInt uiNumCand  = 4;
     609
     610    if ( uiNumCand > 1 )
     611    {
     612      for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx )
     613      {
     614        UInt uiSymbol2 = 0;
     615        if ( uiUnaryIdx==0 )
     616        {
     617          m_pcTDecBinIf->decodeBin( uiSymbol2, m_cCUDISTypeSCModel.get( 0, 0, 0 ) );
     618        }
     619        else
     620        {
     621          m_pcTDecBinIf->decodeBinEP( uiSymbol2);
     622        }
     623        if( uiSymbol2 == 0 )
     624        {
     625          break;
     626        }
     627      }
     628    }
     629    pcCU->setDISTypeSubParts(uiUnaryIdx, uiAbsPartIdx, 0, uiDepth);
     630  }
     631}
     632#else
    572633#if H_3D_SINGLE_DEPTH
    573634Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    616677  }
    617678}
    618 
    619 #endif
     679#endif
     680#endif
     681
    620682/** parse merge flag
    621683 * \param pcCU
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibDecoder/TDecSbac.h

    r1133 r1145  
    125125 
    126126  Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     127#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     128  Void parseDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     129#else
    127130#if H_3D_SINGLE_DEPTH 
    128131  Void parseSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    129 #endif 
     132#endif
     133#endif
    130134  Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    131135  Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    178182  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    179183  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     184#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     185  ContextModel3DBuffer m_cCUDISFlagSCModel;
     186  ContextModel3DBuffer m_cCUDISTypeSCModel;
     187#else
    180188#if H_3D_SINGLE_DEPTH
    181189  ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
    182190  ContextModel3DBuffer m_cSingleDepthValueSCModel;
     191#endif
    183192#endif
    184193  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
Note: See TracChangeset for help on using the changeset viewer.