Ignore:
Timestamp:
20 Jan 2014, 04:34:18 (10 years ago)
Author:
qualcomm
Message:

integration of JCT3V-G0122 (generalize SDC to all depth intra modes) by Qualcomm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp

    r773 r781  
    9393, m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9494, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     95#if QC_GENERIC_SDC_G0122
     96, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
     97, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     98#endif
    9599#if H_3D_DIM_DMM
    96100, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    168172  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    169173  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
     174#if QC_GENERIC_SDC_G0122
     175  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     176  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     177#endif
    170178#if H_3D_DIM_DMM
    171179  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    252260      curCost += m_cDdcFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );
    253261      curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
     262#if QC_GENERIC_SDC_G0122
     263      curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
     264      curCost += m_cIntraSdcFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 
     265#endif
    254266#if H_3D_DIM_DMM
    255267      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
     
    317329  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    318330  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
     331#if QC_GENERIC_SDC_G0122
     332  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     333  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     334#endif
    319335#if H_3D_DIM_DMM
    320336  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    629645  this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel );
    630646  this->m_cDdcFlagSCModel        .copyFrom( &pSrc->m_cDdcFlagSCModel );
     647#if QC_GENERIC_SDC_G0122
     648  this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
     649  this->m_cIntraSdcFlagSCModel   .copyFrom( &pSrc->m_cIntraSdcFlagSCModel );
     650#endif
    631651}
    632652#endif
     
    10161036    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    10171037#if H_3D_DIM_SDC
     1038#if QC_GENERIC_SDC_G0122
     1039      if( 1 )
     1040#else
    10181041      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     1042#endif
    10191043#endif
    10201044    {
     
    10421066    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    10431067#if H_3D_DIM_SDC
     1068#if QC_GENERIC_SDC_G0122
     1069      if( 1 )
     1070#else
    10441071      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     1072#endif
    10451073#endif
    10461074    {
     
    11461174    UInt dimDeltaDC;
    11471175    Pel  deltaDC;
     1176#if QC_GENERIC_SDC_G0122
     1177    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
     1178#else
    11481179    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1180#endif
    11491181    if( pcCU->getSDCFlag( absPartIdx ) )
    11501182    {
     
    11761208}
    11771209
     1210#if QC_GENERIC_SDC_G0122
     1211Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
     1212{
     1213  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
     1214
     1215  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
     1216  {
     1217    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
     1218  }
     1219
     1220  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
     1221  {
     1222    m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
     1223  }
     1224
     1225  if( isDimMode( dir ) )
     1226  {
     1227    UInt uiCodeIdx = 0;
     1228
     1229    switch( getDimType( dir ) )
     1230    {
     1231    case DMM1_IDX: uiCodeIdx = 0; break;
     1232    case DMM4_IDX: uiCodeIdx = 1; break;
     1233    default:                      break;
     1234    }
     1235    //mode coding
     1236    m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1237  }
     1238}
     1239#else
    11781240Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    11791241{
     
    12161278  }
    12171279}
     1280#endif
    12181281#endif
    12191282
Note: See TracChangeset for help on using the changeset viewer.