Ignore:
Timestamp:
10 Nov 2012, 19:05:41 (12 years ago)
Author:
rwth
Message:
  • added RWTH_B0036 (SDC+DLT)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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//! \}
Note: See TracChangeset for help on using the changeset viewer.