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/TLibEncoder
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1133 r1145  
    889889      WRITE_FLAG( sps3dExt->getQtPredFlag( d ) ? 1 : 0 , "qt_pred_flag" );
    890890      WRITE_FLAG( sps3dExt->getInterSdcFlag( d ) ? 1 : 0 , "inter_sdc_flag" );
     891#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     892      WRITE_FLAG( sps3dExt->getDepthIntraSkipFlag( d ) ? 1 : 0 , "depth_intra_skip_flag" );
     893#else
    891894      WRITE_FLAG( sps3dExt->getIntraSingleFlag( d ) ? 1 : 0 , "intra_single_flag" );
     895#endif
    892896    }
    893897  }
     
    24352439  assert(0);
    24362440}
     2441
     2442#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2443Void TEncCavlc::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2444{
     2445  assert(0);
     2446}
     2447#else
    24372448#if H_3D_SINGLE_DEPTH
    24382449Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    24412452}
    24422453#endif
     2454#endif
     2455
    24432456Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24442457{
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncCavlc.h

    r1133 r1145  
    127127  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    128128  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     129#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     130  Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     131#else
    129132#if H_3D_SINGLE_DEPTH
    130133  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     134#endif
    131135#endif
    132136  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncCu.cpp

    r1133 r1145  
    712712    }
    713713#endif
     714#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     715    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     716    if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() )
     717    {
     718      xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     719      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     720    }
     721#else
    714722#if H_3D_SINGLE_DEPTH
    715723    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     
    719727      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
    720728    }
     729#endif
    721730#endif
    722731    if(!earlyDetectionSkipMode)
     
    15771586    return;
    15781587  }
     1588#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1589  m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx );
     1590  if(!pcCU->getDISFlag(uiAbsPartIdx))
     1591  {
     1592#else
    15791593#if H_3D_SINGLE_DEPTH
    15801594  m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx );
    15811595  if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    15821596  {
     1597#endif
    15831598#endif
    15841599  m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
     
    16141629  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
    16151630  setdQPFlag( bCodeDQP );
     1631#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1632  }
     1633#else
    16161634#if H_3D_SINGLE_DEPTH
    16171635  }
     1636#endif
    16181637#endif
    16191638  // --- write terminating bit ---
     
    20002019
    20012020          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
     2021#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2022          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2023#else
    20022024#if H_3D_SINGLE_DEPTH
    20032025          rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2026#endif
    20042027#endif
    20052028#if H_3D_VSP // possible bug fix
     
    20422065              }
    20432066              rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2067#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2068              rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2069#else
    20442070#if H_3D_SINGLE_DEPTH
    20452071              rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2072#endif
    20462073#endif
    20472074              rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
     
    21932220 
    21942221  rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2222#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2223  rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2224#else
    21952225#if H_3D_SINGLE_DEPTH
    21962226  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2227#endif
    21972228#endif
    21982229  rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
     
    23032334      }
    23042335      rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2336#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2337      rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2338#else
    23052339#if H_3D_SINGLE_DEPTH
    23062340      rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2341#endif
    23072342#endif
    23082343      rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
     
    24132448  }
    24142449}
     2450
     2451#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2452Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     2453{
     2454  UInt uiDepth = rpcTempCU->getDepth( 0 );
     2455  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
     2456  {
     2457    return;
     2458  }
     2459
     2460#if H_3D_VSO // M5
     2461  if( m_pcRdCost->getUseRenModel() )
     2462  {
     2463    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ();
     2464    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ();
     2465    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getLumaAddr();
     2466    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ();
     2467    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     2468  }
     2469#endif
     2470
     2471  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2472  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     2473  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     2474  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
     2475
     2476  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
     2477  rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
     2478  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
     2479  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
     2480#if H_3D_DIM_SDC
     2481  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
     2482#endif
     2483
     2484  UInt uiPreCalcDistC;
     2485  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
     2486
     2487
     2488  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
     2489
     2490
     2491  m_pcEntropyCoder->resetBits();
     2492  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     2493  {
     2494    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
     2495  }
     2496  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2497  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2498
     2499
     2500  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
     2501
     2502  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
     2503  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     2504
     2505
     2506#if H_3D_VSO // M6
     2507  if( m_pcRdCost->getUseLambdaScaleVSO()) 
     2508    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 
     2509  else
     2510#endif
     2511    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     2512
     2513
     2514  xCheckDQP( rpcTempCU );
     2515  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
     2516}
     2517#else
    24152518#if H_3D_SINGLE_DEPTH
    24162519Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     
    24792582  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
    24802583}
     2584#endif
    24812585#endif
    24822586
     
    26362740
    26372741  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2742#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2743  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
     2744#else
    26382745#if H_3D_SINGLE_DEPTH
    26392746  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2747#endif
    26402748#endif
    26412749  rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth );
     
    26662774  }
    26672775  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2776#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2777  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2778  if(!rpcTempCU->getDISFlag(0))
     2779  {
     2780#else
    26682781#if H_3D_SINGLE_DEPTH
    26692782  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
    26702783  if(!rpcTempCU->getSingleDepthFlag(0))
    26712784  {
     2785#endif
    26722786#endif
    26732787  m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
     
    26832797  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
    26842798  setdQPFlag( bCodeDQP );
     2799#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2800  }
     2801#else
    26852802#if H_3D_SINGLE_DEPTH
    26862803  }
    2687 #endif       
     2804#endif
     2805#endif
    26882806  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    26892807 
     
    27132831
    27142832  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2833#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2834  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
     2835#else
    27152836#if H_3D_SINGLE_DEPTH
    27162837  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2838#endif
    27172839#endif
    27182840  rpcTempCU->setIPCMFlag(0, true);
     
    27322854  }
    27332855  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2856#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2857  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2858#else
    27342859#if H_3D_SINGLE_DEPTH
    27352860  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2861#endif
    27362862#endif
    27372863  m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncCu.h

    r1084 r1145  
    159159  Void  xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false );
    160160#endif
     161#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     162  Void  xCheckRDCostDIS   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
     163#else
    161164#if H_3D_SINGLE_DEPTH
    162165  Void  xCheckRDCostSingleDepth   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
     166#endif
    163167#endif
    164168#if H_3D_DIM
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1133 r1145  
    111111  m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
    112112}
     113
     114#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     115Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     116{
     117  if ( !pcCU->getSlice()->getIsDepth() )
     118  {
     119    return;
     120  }
     121  if( bRD )
     122  {
     123    uiAbsPartIdx = 0;
     124  }
     125  m_pcEntropyCoderIf->codeDIS( pcCU, uiAbsPartIdx );
     126}
     127#else
    113128#if H_3D_SINGLE_DEPTH
    114129Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     
    125140}
    126141#endif
     142#endif
     143
    127144/** encode merge flag
    128145 * \param pcCU
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncEntropy.h

    r1133 r1145  
    8282  virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8383  virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     84#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     85  virtual Void codeDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     86#else
    8487#if H_3D_SINGLE_DEPTH
    8588  virtual Void codeSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     89#endif
    8690#endif
    8791  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     
    166170  Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    167171  Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     172#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     173  Void encodeDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
     174#else
    168175#if H_3D_SINGLE_DEPTH
    169176  Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
     177#endif
    170178#endif
    171179  Void encodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncSbac.cpp

    r1133 r1145  
    5858, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    5959, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     60#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     61, m_cCUDISFlagSCModel         ( 1,             1,               NUM_DIS_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     62, m_cCUDISTypeSCModel         ( 1,             1,               NUM_DIS_TYPE_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     63#else
    6064#if H_3D_SINGLE_DEPTH
    6165, m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    6266, m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     67#endif
    6368#endif
    6469, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
     
    134139 
    135140  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     141#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     142  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
     143  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
     144#else
    136145#if H_3D_SINGLE_DEPTH
    137146  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    138147  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     148#endif
    139149#endif
    140150  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    214224      curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    215225      curCost += m_cCUSkipFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
     226#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     227      curCost += m_cCUDISFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_DIS_FLAG );
     228      curCost += m_cCUDISTypeSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_DIS_TYPE );
     229#else
    216230#if H_3D_SINGLE_DEPTH
    217231      curCost += m_cCUSingleDepthFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    218232      curCost += m_cSingleDepthValueSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     233#endif
    219234#endif
    220235      curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    287302 
    288303  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     304#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     305  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
     306  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
     307#else
    289308#if H_3D_SINGLE_DEPTH
    290309  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    291310  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
    292 #endif 
     311#endif
     312#endif
    293313  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    294314  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
     
    446466  m_pcBinIf->encodeBinsEP( bins, numBins );
    447467}
     468
     469#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     470Void TEncSbac::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
     471{
     472  UInt uiSymbol = pcCU->getDISFlag(uiAbsPartIdx ) ? 1 : 0;
     473  m_pcBinIf->encodeBin( uiSymbol, m_cCUDISFlagSCModel.get( 0, 0, 0 ) );
     474  if(uiSymbol)
     475  {
     476    UInt uiUnaryIdx = (UInt) pcCU->getDISType(uiAbsPartIdx);
     477    UInt uiNumCand  = 4;
     478
     479    if ( uiNumCand > 1 )
     480    {
     481      for( UInt ui = 0; ui < uiNumCand - 1; ++ui )
     482      {
     483        const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1;
     484        if ( ui == 0 )
     485        {
     486          m_pcBinIf->encodeBin( uiSymbol2, m_cCUDISTypeSCModel.get( 0, 0, 0 ) );
     487        }
     488        else
     489        {
     490          m_pcBinIf->encodeBinEP( uiSymbol2 );
     491        }
     492        if( uiSymbol2 == 0 )
     493        {
     494          break;
     495        }
     496      }
     497    }
     498  }
     499}
     500#else
    448501#if H_3D_SINGLE_DEPTH
    449502Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    477530}
    478531#endif
     532#endif
     533
    479534/** Coding of coeff_abs_level_minus3
    480535 * \param uiSymbol value of coeff_abs_level_minus3
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncSbac.h

    r1133 r1145  
    146146  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    147147  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     148#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     149  Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     150#else
    148151#if H_3D_SINGLE_DEPTH
    149152  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     153#endif
    150154#endif
    151155  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    215219  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    216220  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     221#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     222  ContextModel3DBuffer m_cCUDISFlagSCModel;
     223  ContextModel3DBuffer m_cCUDISTypeSCModel;
     224#else
    217225#if H_3D_SINGLE_DEPTH
    218226  ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
    219227  ContextModel3DBuffer m_cSingleDepthValueSCModel;
     228#endif
    220229#endif
    221230  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncSearch.cpp

    r1133 r1145  
    915915        }
    916916        m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     917#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     918        m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
     919        if(!pcCU->getDISFlag(uiAbsPartIdx))
     920#else
    917921#if H_3D_SINGLE_DEPTH
    918922        m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
    919923        if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    920924#endif
     925#endif
    921926        m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    922927      }
     928#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     929      else
     930      {
     931        m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
     932      }
     933#else
    923934#if H_3D_SINGLE_DEPTH
    924935      else
     
    926937        m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
    927938      }
    928 #endif     
     939#endif
     940#endif
     941#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     942      if(!pcCU->getDISFlag(uiAbsPartIdx))
     943      {
     944#else
    929945#if H_3D_SINGLE_DEPTH
    930946      if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    931947      {
    932948#endif
     949#endif
    933950      m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    934951
     
    945962        }
    946963      }
     964#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     965      }
     966#else
    947967#if H_3D_SINGLE_DEPTH
    948968    }
    949969#endif
    950     }
     970#endif
     971    }
     972#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     973    if(!pcCU->getDISFlag(uiAbsPartIdx))
     974    {
     975#else
    951976#if H_3D_SINGLE_DEPTH
    952977      if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    953978      {
     979#endif
    954980#endif
    955981    // luma prediction mode
     
    9951021    }
    9961022  }
     1023#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1024 }
     1025#else
    9971026#if H_3D_SINGLE_DEPTH
    9981027    }
     1028#endif
    9991029#endif
    10001030  }
     
    18591889  dRDCost  += dSingleCost;
    18601890}
     1891
     1892#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1893Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode )
     1894{
     1895  UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
     1896  UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
     1897  UInt    uiStride          = pcOrgYuv ->getStride  ();
     1898  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     1899  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1900
     1901  AOF( uiWidth == uiHeight );
     1902  AOF( uiAbsPartIdx == 0 );
     1903  pcCU->setDISTypeSubParts(uiPredMode, uiAbsPartIdx, 0, pcCU->getDepth(0)); 
     1904  //===== reconstruction =====
     1905
     1906  Bool bAboveAvail = false;
     1907  Bool bLeftAvail  = false;
     1908  pcCU->getPattern()->initPattern   ( pcCU, 0, 0 );
     1909  pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
     1910
     1911  if ( uiPredMode == 0 )
     1912  {
     1913    predIntraLumaAng( pcCU->getPattern(), VER_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     1914  }
     1915  else if ( uiPredMode == 1 )
     1916  {
     1917    predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     1918  }
     1919  else if ( uiPredMode == 2 )
     1920  {
     1921    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
     1922    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 );
     1923    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1924    {
     1925      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1926      {
     1927        piPred[ uiX ] = pSingleDepth;
     1928      }
     1929      piPred+= uiStride;
     1930    }
     1931  }
     1932  else if ( uiPredMode == 3 )
     1933  {
     1934    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
     1935    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 );
     1936    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1937    {
     1938      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1939      {
     1940        piPred[ uiX ] = pSingleDepth;
     1941      }
     1942      piPred+= uiStride;
     1943    }
     1944  }
     1945
     1946  // clear UV
     1947  UInt  uiStrideC     = pcPredYuv->getCStride();
     1948  Pel   *pRecCb       = pcPredYuv->getCbAddr();
     1949  Pel   *pRecCr       = pcPredYuv->getCrAddr();
     1950
     1951  for (Int y=0; y<uiHeight/2; y++)
     1952  {
     1953    for (Int x=0; x<uiWidth/2; x++)
     1954    {
     1955      pRecCb[x] = 1<<(g_bitDepthC-1);
     1956      pRecCr[x] = 1<<(g_bitDepthC-1);
     1957    }
     1958
     1959    pRecCb += uiStrideC;
     1960    pRecCr += uiStrideC;
     1961  }
     1962
     1963  piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1964  //===== determine distortion =====
     1965#if H_3D_VSO
     1966  if ( m_pcRdCost->getUseVSO() )
     1967    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
     1968  else
     1969#endif
     1970    ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight );
     1971
     1972  //===== determine rate and r-d cost =====
     1973  m_pcEntropyCoder->resetBits();
     1974  m_pcEntropyCoder->encodeDIS( pcCU, 0, true );
     1975  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
     1976
     1977#if H_3D_VSO
     1978  if ( m_pcRdCost->getUseLambdaScaleVSO())
     1979    dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
     1980  else
     1981#endif
     1982    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
     1983}
     1984#else
    18611985#if H_3D_SINGLE_DEPTH
    18621986Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor )
     
    19212045}
    19222046#endif
     2047#endif
     2048
    19232049#if H_3D_DIM_SDC
    19242050Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
     
    28612987  pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) );
    28622988}
     2989
     2990#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2991Void TEncSearch::estIntraPredDIS( TComDataCU* pcCU,
     2992                                  TComYuv*    pcOrgYuv,
     2993                                  TComYuv*    pcPredYuv,
     2994                                  TComYuv*    pcResiYuv,
     2995                                  TComYuv*    pcRecoYuv,
     2996                                  UInt&       ruiDistC,
     2997                                  Bool        bLumaOnly )
     2998{
     2999  UInt    uiDepth        = pcCU->getDepth(0);
     3000  UInt    uiWidth        = pcCU->getWidth (0);
     3001  UInt    uiHeight       = pcCU->getHeight(0);
     3002
     3003
     3004  Pel* piOrg         = pcOrgYuv ->getLumaAddr( 0, uiWidth );
     3005  UInt uiStride      = pcPredYuv->getStride();
     3006
     3007  Dist   uiDist = 0;
     3008  Double dCost   = 0.0;
     3009  Dist    uiBestDist = 0;
     3010  Double  dBestCost   = MAX_DOUBLE;
     3011  UInt     uiBestDISType = 0;
     3012
     3013  for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ )
     3014  {
     3015    // set context models
     3016    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     3017
     3018    // determine residual for partition
     3019    uiDist = 0;
     3020    dCost   = 0.0;
     3021#if H_3D_VSO // M36
     3022    if( m_pcRdCost->getUseRenModel() )
     3023    {
     3024      m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight );
     3025    }
     3026#endif
     3027    xIntraCodingDIS(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, uiPredMode);
     3028    // check r-d cost
     3029    if( dCost < dBestCost )
     3030    {
     3031      uiBestDist = uiDist;
     3032      dBestCost   = dCost;
     3033      uiBestDISType = pcCU->getDISType(0);
     3034      // copy reconstruction
     3035      pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
     3036    }
     3037  }
     3038
     3039
     3040  pcCU->setDISTypeSubParts(uiBestDISType, 0, 0, uiDepth); 
     3041  assert(uiBestDISType >= 0);
     3042
     3043  //===== reset context models =====
     3044  m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
     3045
     3046  //===== set distortion (rate and r-d costs are determined later) =====
     3047  pcCU->getTotalDistortion() = uiBestDist;
     3048}
     3049#else
    28633050#if H_3D_SINGLE_DEPTH
    28643051Void
     
    29503137
    29513138#endif
     3139#endif
     3140
    29523141Void
    29533142TEncSearch::estIntraPredQT( TComDataCU* pcCU,
     
    72617450    }
    72627451    m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
     7452#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     7453    m_pcEntropyCoder->encodeDIS ( pcCU, 0, true );
     7454#else
    72637455#if H_3D_SINGLE_DEPTH
    72647456    m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true );
     7457#endif
    72657458#endif
    72667459    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
  • branches/HTM-13.1-dev1-Samsung/source/Lib/TLibEncoder/TEncSearch.h

    r1084 r1145  
    191191                                  TComYuv*    pcRecoYuv,
    192192                                  UInt        uiPreCalcDistC );
     193#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     194  Void  estIntraPredDIS        ( TComDataCU* pcCU,
     195                                 TComYuv*    pcOrgYuv,
     196                                 TComYuv*    pcPredYuv,
     197                                 TComYuv*    pcResiYuv,
     198                                 TComYuv*    pcRecoYuv,
     199                                 UInt&       ruiDistC,
     200                                 Bool        bLumaOnly );
     201#else
    193202#if H_3D_SINGLE_DEPTH
    194203  Void  estIntraPredSingleDepth  ( TComDataCU* pcCU,
     
    199208                                  UInt&       ruiDistC,
    200209                                  Bool        bLumaOnly );
    201 #endif   
     210#endif
     211#endif
    202212 
    203213  /// encoder estimation - inter prediction (non-skip)
     
    354364                                    UInt         uiAbsPartIdx,
    355365                                    UInt         stateU0V1Both2 );
     366#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     367  Void xIntraCodingDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode );
     368#else
    356369#if H_3D_SINGLE_DEPTH
    357370  Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor );
     371#endif
    358372#endif
    359373#if H_3D_DIM
Note: See TracChangeset for help on using the changeset viewer.