Ignore:
Timestamp:
10 Nov 2012, 19:05:41 (12 years ago)
Author:
rwth
Message:
  • added RWTH_B0036 (SDC+DLT)
Location:
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r152 r177  
    16741674    }
    16751675#endif
    1676 
    1677     READ_FLAG( uiCode, "base_view_flag" );
     1676   
     1677#if RWTH_SDC_DLT_B0036
     1678    if( bIsDepth )
     1679    {
     1680      READ_FLAG( uiCode, "use_dlt_flag" );
     1681      pcSPS->setUseDLT( uiCode );
     1682      if( pcSPS->getUseDLT() )
     1683      {
     1684        // decode mapping
     1685        UInt uiNumDepthValues;
     1686        // parse number of values in DLT
     1687        xReadUvlc( uiNumDepthValues );
     1688       
     1689        // parse actual DLT values
     1690        UInt* auiIdx2DepthValue = (UInt*) calloc(uiNumDepthValues, sizeof(UInt));
     1691        for(UInt d=0; d<uiNumDepthValues; d++)
     1692        {
     1693          xReadUvlc( uiCode );
     1694          auiIdx2DepthValue[d] = uiCode;
     1695        }
     1696       
     1697        pcSPS->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues);
     1698       
     1699        // clean memory
     1700        free(auiIdx2DepthValue);
     1701      }
     1702      else
     1703        pcSPS->setDepthLUTs();
     1704    }
     1705#endif
     1706
     1707    READ_FLAG( uiCode, "base_view_flag" );
    16781708    if( uiCode )
    16791709    { // baseview SPS -> set standard values
     
    28272857#endif
    28282858
     2859#if RWTH_SDC_DLT_B0036
     2860Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2861{
     2862  assert(0);
     2863}
     2864Void TDecCavlc::parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2865{
     2866  assert(0);
     2867}
     2868Void TDecCavlc::parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
     2869{
     2870  assert(0);
     2871}
     2872#endif
     2873
    28292874// ====================================================================================================================
    28302875// Protected member functions
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCAVLC.h

    r152 r177  
    178178  Void parseDFFlag         ( UInt& ruiVal, const Char *pSymbolName );
    179179  Void parseDFSvlc         ( Int&  riVal,  const Char *pSymbolName  );
     180#if RWTH_SDC_DLT_B0036
     181  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     182  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     183  Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     184#endif
    180185protected:
    181186#if DBL_CONTROL
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCu.cpp

    r156 r177  
    3737
    3838#include "TDecCu.h"
     39
     40#if RWTH_SDC_DLT_B0036
     41#define GetDepthValue2Idx(val)     (pcCU->getSlice()->getSPS()->depthValue2idx(val))
     42#define GetIdx2DepthValue(val)     (pcCU->getSlice()->getSPS()->idx2DepthValue(val))
     43#endif
    3944
    4045//! \ingroup TLibDecoder
     
    608613      break;
    609614    case MODE_INTRA:
     615#if RWTH_SDC_DLT_B0036
     616      if( m_ppcCU[uiDepth]->getSDCFlag(0) )
     617        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
     618      else
     619#endif
    610620      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    611621      break;
     
    951961
    952962}
     963
     964#if RWTH_SDC_DLT_B0036
     965Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     966{
     967  UInt uiWidth        = pcCU->getWidth  ( 0 );
     968  UInt uiHeight       = pcCU->getHeight ( 0 );
     969 
     970  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     971  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     972  TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
     973 
     974  UInt    uiStride    = pcRecoYuv->getStride  ();
     975  Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     976  Pel*    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     977  Pel*    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
     978 
     979  UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     980  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     981  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     982 
     983  UInt    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
     984 
     985  AOF( uiWidth == uiHeight );
     986  AOF( uiAbsPartIdx == 0 );
     987  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
     988  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     989 
     990  //===== init availability pattern =====
     991  Bool  bAboveAvail = false;
     992  Bool  bLeftAvail  = false;
     993  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
     994  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
     995 
     996  //===== get prediction signal =====
     997#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     998  if( uiLumaPredMode >= NUM_INTRA_MODE )
     999  {
     1000    m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false );
     1001  }
     1002  else
     1003  {
     1004#endif
     1005    m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail );
     1006#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1007  }
     1008#endif
     1009 
     1010  // number of segments depends on prediction mode
     1011  UInt uiNumSegments = 1; 
     1012  Bool* pbMask = NULL;
     1013  UInt uiMaskStride = 0;
     1014 
     1015  //if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX )
     1016  if( 0 )
     1017  {
     1018    Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx);
     1019   
     1020    WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     1021    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
     1022   
     1023    uiNumSegments = 2;
     1024    pbMask = pcWedgelet->getPattern();
     1025    uiMaskStride = pcWedgelet->getStride();
     1026  }
     1027 
     1028  // get DC prediction for each segment
     1029  Pel apDCPredValues[2];
     1030  xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride);
     1031 
     1032  // reconstruct residual based on mask + DC residuals
     1033  Pel apDCResiValues[2];
     1034  Pel apDCRecoValues[2];
     1035  for( UInt ui = 0; ui < uiNumSegments; ui++ )
     1036  {
     1037    Pel   pPredIdx    = GetDepthValue2Idx( apDCPredValues[ui] );
     1038    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx);
     1039    Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
     1040   
     1041    apDCRecoValues[ui]  = pRecoValue;
     1042    apDCResiValues[ui]  = pRecoValue - apDCPredValues[ui];
     1043  }
     1044 
     1045  //===== reconstruction =====
     1046  Bool*pMask      = pbMask;
     1047  Pel* pPred      = piPred;
     1048  Pel* pResi      = piResi;
     1049  Pel* pReco      = piReco;
     1050  Pel* pRecIPred  = piRecIPred;
     1051 
     1052  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1053  {
     1054    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1055    {
     1056      UChar ucSegment = pMask?(UChar)pMask[uiX]:0;
     1057      assert( ucSegment < uiNumSegments );
     1058     
     1059      Pel pPredVal= apDCPredValues[ucSegment];
     1060      Pel pResiDC = apDCResiValues[ucSegment];
     1061     
     1062      pReco    [ uiX ] = Clip( pPredVal + pResiDC );
     1063      pRecIPred[ uiX ] = pReco[ uiX ];
     1064    }
     1065    pPred     += uiStride;
     1066    pResi     += uiStride;
     1067    pReco     += uiStride;
     1068    pRecIPred += uiRecIPredStride;
     1069    pMask     += uiMaskStride;
     1070  }
     1071 
     1072  // clear UV
     1073  UInt  uiStrideC     = pcPredYuv->getCStride();
     1074  Pel   *pRecCb       = pcPredYuv->getCbAddr();
     1075  Pel   *pRecCr       = pcPredYuv->getCrAddr();
     1076 
     1077  for (Int y=0; y<uiHeight/2; y++)
     1078  {
     1079    for (Int x=0; x<uiWidth/2; x++)
     1080    {
     1081      pRecCb[x] = (Pel)(128<<g_uiBitIncrement);
     1082      pRecCr[x] = (Pel)(128<<g_uiBitIncrement);
     1083    }
     1084   
     1085    pRecCb += uiStrideC;
     1086    pRecCr += uiStrideC;
     1087  }
     1088}
     1089#endif
    9531090
    9541091/** Function for deriving recontructed PU/CU Luma sample with QTree structure
     
    12161353#endif
    12171354
     1355#if RWTH_SDC_DLT_B0036
     1356Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride )
     1357{
     1358  Int iSumDepth[uiNumSegments];
     1359  memset(iSumDepth, 0, sizeof(Int)*uiNumSegments);
     1360  Int iSumPix[uiNumSegments];
     1361  memset(iSumPix, 0, sizeof(Int)*uiNumSegments);
     1362 
     1363  for (Int y=0; y<uiSize; y++)
     1364  {
     1365    for (Int x=0; x<uiSize; x++)
     1366    {
     1367      UChar ucSegment = pMask?(UChar)pMask[x]:0;
     1368      assert( ucSegment < uiNumSegments );
     1369     
     1370      iSumDepth[ucSegment] += pOrig[x];
     1371      iSumPix[ucSegment]   += 1;
     1372    }
     1373   
     1374    pOrig  += uiStride;
     1375    pMask  += uiMaskStride;
     1376  }
     1377 
     1378  // compute mean for each segment
     1379  for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )
     1380  {
     1381    if( iSumPix[ucSeg] > 0 )
     1382      rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg];
     1383    else
     1384      rpSegMeans[ucSeg] = 0;  // this happens for zero-segments
     1385  }
     1386}
     1387#endif
     1388
    12181389//! \}
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCu.h

    r56 r177  
    121121  Void xFillPCMBuffer           (TComDataCU* pCU, UInt absPartIdx, UInt depth);
    122122#endif
     123#if RWTH_SDC_DLT_B0036
     124  Void  xAnalyzeSegmentsSDC       ( Pel* pOrig,
     125                                   UInt uiStride,
     126                                   UInt uiSize,
     127                                   Pel* rpSegMeans,
     128                                   UInt uiNumSegments,
     129                                   Bool* pMask,
     130                                   UInt uiMaskStride );
     131 
     132  Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     133#endif
    123134};
    124135
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecEntropy.cpp

    r152 r177  
    147147{
    148148  m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
     149 
     150#if RWTH_SDC_DLT_B0036
     151  // if B-Slice, code SDC flag later
     152  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )
     153  {
     154    // decode SDC flag
     155    decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
     156  }
     157#endif
    149158}
    150159
    151160Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    152161{
     162#if RWTH_SDC_DLT_B0036
     163  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
     164  {
     165    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     166    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     167    return;
     168  }
     169#endif
     170 
    153171  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
     172 
     173#if RWTH_SDC_DLT_B0036
     174  if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
     175  {
     176    // decode SDC flag
     177    decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
     178   
     179    if( pcCU->getSDCFlag(uiAbsPartIdx) )
     180    {
     181      // part size is also known for SDC intra
     182      pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     183      pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     184    }
     185  }
     186#endif
    154187}
    155188
    156189Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
    157190{
     191#if RWTH_SDC_DLT_B0036
     192  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     193  {
     194    decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth);
     195    return;
     196  }
     197#endif
     198 
    158199  PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx );
    159200 
     
    196237    return;
    197238  }
     239 
     240#if RWTH_SDC_DLT_B0036
     241  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     242  {
     243    return;
     244  }
     245#endif
    198246 
    199247  m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
     
    912960#endif
    913961 
     962#if RWTH_SDC_DLT_B0036
     963  if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) )
     964  {
     965    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     966    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     967    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     968    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     969    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     970   
     971    decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
     972    return;
     973  }
     974#endif
     975 
    914976  if( pcCU->isIntra(uiAbsPartIdx) )
    915977  {
     
    9541016}
    9551017
     1018#if RWTH_SDC_DLT_B0036
     1019Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1020{
     1021  assert( pcCU->getSlice()->getSPS()->isDepth() );
     1022  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     1023 
     1024  m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth );
     1025}
     1026
     1027Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1028{
     1029  assert( pcCU->getSlice()->getSPS()->isDepth() );
     1030 
     1031  m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
     1032}
     1033
     1034Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1035{
     1036  assert( pcCU->getSlice()->getSPS()->isDepth() );
     1037  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     1038 
     1039  // number of segments depends on prediction mode for INTRA
     1040  UInt uiNumSegments = 2;
     1041  UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
     1042  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) )
     1043    uiNumSegments = 1;
     1044 
     1045  // decode residual data for each segment
     1046  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
     1047    m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
     1048}
     1049#endif
     1050
    9561051//! \}
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecEntropy.h

    r152 r177  
    142142  virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
    143143 
     144#if RWTH_SDC_DLT_B0036
     145  virtual Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     146  virtual Void parseSDCPredMode     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     147  virtual Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
     148#endif
     149 
    144150  virtual ~TDecEntropyIf() {}
    145151};
     
    256262  Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); }
    257263#endif
     264 
     265#if RWTH_SDC_DLT_B0036
     266  Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     267  Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     268  Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     269#endif
    258270
    259271};// END CLASS DEFINITION TDecEntropy
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecSbac.cpp

    r152 r177  
    3838#include "TDecSbac.h"
    3939
     40#if RWTH_SDC_DLT_B0036
     41#define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
     42#define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
     43#endif
     44
    4045//! \ingroup TLibDecoder
    4146//! \{
     
    106111, m_cEdgeIntraDeltaDCSCModel  ( 1,             1,               NUM_EDGE_INTRA_DELTA_DC_CTX   , m_contextModels + m_numContextModels, m_numContextModels)
    107112#endif
     113#endif
     114#if RWTH_SDC_DLT_B0036
     115, m_cSDCFlagSCModel             ( 1,             1,                 SDC_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     116, m_cSDCResidualFlagSCModel     ( 1,             2,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
     117, m_cSDCResidualSignFlagSCModel ( 1,             2,  SDC_NUM_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     118, m_cSDCResidualSCModel         ( 1,             2,  SDC_NUM_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     119, m_cSDCPredModeSCModel             ( 1,             3,                 SDC_NUM_PRED_MODE_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
    108120#endif
    109121{
     
    206218  m_cDmmDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_DATA );
    207219#endif
     220#if RWTH_SDC_DLT_B0036
     221  m_cSDCFlagSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
     222  m_cSDCResidualFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     223  m_cSDCResidualSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );
     224  m_cSDCResidualSignFlagSCModel.initBuffer  ( sliceType, qp, (UChar*)INIT_SDC_SIGN_FLAG );
     225  m_cSDCPredModeSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_PRED_MODE );
     226#endif
    208227 
    209228  // new structure
     
    285304  m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
    286305#endif
     306#if RWTH_SDC_DLT_B0036
     307  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
     308  m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     309  m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
     310  m_cSDCResidualSignFlagSCModel.initBuffer  ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG );
     311  m_cSDCPredModeSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE );
     312#endif
    287313
    288314  m_pcTDecBinIf->start();
     
    24862512}
    24872513#endif
     2514 
     2515#if RWTH_SDC_DLT_B0036
     2516Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2517{
     2518  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2519 
     2520  UInt uiSymbol = 0;
     2521  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
     2522  m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2523 
     2524  if( uiSymbol == 1 )
     2525  {
     2526    pcCU->setPartSizeSubParts(SIZE_2Nx2N, uiAbsPartIdx, uiDepth);
     2527   
     2528    pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth);
     2529    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
     2530    pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth);
     2531  }
     2532}
     2533
     2534Void TDecSbac::parseSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2535{
     2536  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2537  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     2538 
     2539  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     2540 
     2541  UInt uiCtx            = 0;
     2542 
     2543  UInt uiMPModeIdx      = 0;
     2544 
     2545  for(Int i=0; i<RWTH_SDC_NUM_PRED_MODES-1; i++)
     2546  {
     2547    UInt uiIsMostProb = 0;
     2548    m_pcTDecBinIf->decodeBin( uiIsMostProb, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) );
     2549   
     2550    if ( uiIsMostProb == 1 )
     2551      break;
     2552   
     2553    // else: get next most probable pred mode
     2554    uiMPModeIdx = (uiMPModeIdx+1)%RWTH_SDC_NUM_PRED_MODES;
     2555  }
     2556 
     2557  Int intraPredMode = g_auiSDCPredModes[uiMPModeIdx];
     2558 
     2559#if HHI_DMM_WEDGE_INTRA
     2560  if( intraPredMode == DMM_WEDGE_FULL_IDX )          { xParseWedgeFullInfo          ( pcCU, uiAbsPartIdx, uiDepth ); }
     2561  if( intraPredMode == DMM_WEDGE_PREDDIR_IDX )       { xParseWedgePredDirInfo       ( pcCU, uiAbsPartIdx, uiDepth ); }
     2562#endif
     2563 
     2564  pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth);
     2565}
     2566
     2567Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
     2568{
     2569  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2570  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     2571  assert( uiSegment < 2 );
     2572 
     2573  UInt uiResidual = 0;
     2574  UInt uiBit      = 0;
     2575  UInt uiAbsIdx   = 0;
     2576  UInt uiSign     = 0;
     2577  Int  iIdx       = 0;
     2578 
     2579  UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     2580  assert( uiMaxResidualBits <= g_uiBitDepth );
     2581 
     2582  m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) );
     2583 
     2584  if (uiResidual)
     2585  {
     2586    // decode residual sign bit
     2587    m_pcTDecBinIf->decodeBin(uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) );
     2588   
     2589    // decode residual magnitude
     2590    for (Int i=0; i<uiMaxResidualBits; i++)
     2591    {
     2592      m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) );
     2593      uiAbsIdx |= uiBit << i;
     2594    }
     2595   
     2596    uiAbsIdx += 1;
     2597    iIdx =(Int)(uiSign ? -1 : 1)*uiAbsIdx;
     2598  }
     2599 
     2600  pcCU->setSDCSegmentDCOffset(iIdx, uiSegment, uiAbsPartIdx);
     2601}
     2602#endif
    24882603
    24892604//! \}
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecSbac.h

    r152 r177  
    126126  Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam);
    127127#endif
     128 
     129#if RWTH_SDC_DLT_B0036
     130  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     131  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     132  Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     133#endif
    128134private:
    129135  Void  xReadUnarySymbol    ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset );
     
    269275#endif
    270276#endif
     277 
     278#if RWTH_SDC_DLT_B0036
     279  ContextModel3DBuffer m_cSDCFlagSCModel;
     280 
     281  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
     282  ContextModel3DBuffer m_cSDCResidualSignFlagSCModel;
     283  ContextModel3DBuffer m_cSDCResidualSCModel;
     284 
     285  ContextModel3DBuffer m_cSDCPredModeSCModel;
     286#endif
    271287};
    272288
Note: See TracChangeset for help on using the changeset viewer.