Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSbac.cpp


Ignore:
Timestamp:
7 Apr 2015, 17:05:30 (9 years ago)
Author:
tech
Message:

Merged branch 13.1-dev0@1178.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    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
     
    10401095  DTRACE_CABAC_V( uiCtx )
    10411096  DTRACE_CABAC_T( "\n" )
    1042 #endif
     1097#else
     1098  DTRACE_TU("split_transform_flag", uiSymbol )
     1099#endif
     1100
    10431101}
    10441102
     
    13711429  DTRACE_CABAC_V( uiAbsPartIdx )
    13721430  DTRACE_CABAC_T( "\n" )
     1431#else
     1432  if ( eType == TEXT_CHROMA_U )
     1433  {
     1434    DTRACE_TU("cbf_cb", uiCbf )
     1435  }
     1436  else if ( eType == TEXT_CHROMA_V )
     1437  {
     1438    DTRACE_TU("cbf_cr", uiCbf )
     1439  }
     1440  else
     1441  {
     1442    DTRACE_TU("cbf_luma", uiCbf )
     1443  }
    13731444#endif
    13741445}
     
    14461517    }
    14471518
     1519#if H_3D_DISABLE_CHROMA
     1520    if( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
     1521    {   
     1522#endif
    14481523    piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
    14491524    uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
     
    14771552      piPCMSample += uiWidth;
    14781553    }
     1554#if H_3D_DISABLE_CHROMA
     1555    }
     1556#endif
    14791557    m_pcBinIf->resetBac();
    14801558  }
     
    22892367  UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
    22902368  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
    2291 
     2369  DTRACE_CU("dc_only_flag", uiSymbol)
    22922370  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
    22932371}
     
    23052383  UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0;
    23062384  m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
     2385  DTRACE_CU("dbbp_flag", uiSymbol)
    23072386}
    23082387#endif
Note: See TracChangeset for help on using the changeset viewer.