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


Ignore:
Timestamp:
30 Nov 2013, 12:29:49 (10 years ago)
Author:
tech
Message:

Merged HTM-8.2-dev0@723.

File:
1 edited

Legend:

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

    r655 r724  
    9595#if H_3D_DIM_DMM
    9696, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     97#if !SEC_DMM3_RBC_F0147
    9798, m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     99#endif
    98100#endif
    99101#if H_3D_DIM_RBC
     
    174176#if H_3D_DIM_DMM
    175177  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     178#if !SEC_DMM3_RBC_F0147
    176179  m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
     180#endif
    177181#endif
    178182#if H_3D_DIM_RBC
     
    262266#if H_3D_DIM_DMM
    263267      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
     268#if !SEC_DMM3_RBC_F0147
    264269      curCost += m_cDmm3DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM3_DATA );
     270#endif
    265271#endif
    266272#if H_3D_DIM_RBC
     
    331337#if H_3D_DIM_DMM
    332338  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     339#if !SEC_DMM3_RBC_F0147
    333340  m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
     341#endif
    334342#endif
    335343#if H_3D_DIM_RBC
     
    518526}
    519527
     528#if QC_DIM_DELTADC_UNIFY_F0132
     529Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
     530{
     531  xWriteExGolombLevel( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ), m_cDdcDataSCModel.get(0, 0, 0) );
     532  if( valDeltaDC != 0 )
     533  {
     534    UInt uiSign = valDeltaDC > 0 ? 0 : 1;
     535    m_pcBinIf->encodeBinEP( uiSign );
     536  }
     537}
     538#else
    520539Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt dimType )
    521540{
     
    527546  }
    528547}
     548#endif
    529549
    530550#if H_3D_DIM_DMM
     
    537557}
    538558
     559#if !SEC_DMM3_RBC_F0147
    539560Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit )
    540561{
     
    544565  }
    545566}
     567#endif
    546568#endif
    547569#if H_3D_DIM_RBC
     
    12091231      xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    12101232    } break;
     1233#if !SEC_DMM3_RBC_F0147
    12111234  case( DMM3_IDX ):
    12121235    {
    12131236      xCodeDmm3WedgeIdx( pcCU->getDmm3IntraTabIdx( absPartIdx ), g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    12141237    } break;
     1238#endif
    12151239  case( DMM4_IDX ): break;
    12161240#endif
     
    12251249  }
    12261250
    1227 #if H_3D_DIM_SDC
     1251#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    12281252  if( pcCU->getSDCFlag( absPartIdx ) )
    12291253  {
     
    12381262  {
    12391263#endif
     1264#if QC_DIM_DELTADC_UNIFY_F0132
     1265    if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
     1266#else
    12401267    if( dimType < DIM_NUM_TYPE )
    1241     {
     1268#endif
     1269    {
     1270#if QC_DIM_DELTADC_UNIFY_F0132
     1271      UInt dimDeltaDC;
     1272      Pel  deltaDC;
     1273      UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1274      if( pcCU->getSDCFlag( absPartIdx ) )
     1275    {
     1276        if( uiNumSegments==1 )
     1277        {
     1278          dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
     1279        }
     1280        else
     1281        {
     1282          dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
     1283        }
     1284      }
     1285      else
     1286      {
     1287        dimDeltaDC = isDimDeltaDC( dir );
     1288      }
     1289
     1290      m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
     1291
     1292      if( dimDeltaDC )
     1293      {
     1294        for( UInt segment = 0; segment < uiNumSegments; segment++ )
     1295        {
     1296          deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
     1297          xCodeDimDeltaDC( deltaDC, uiNumSegments );
     1298        }
     1299      }
     1300#else
    12421301      UInt dimDeltaDC = isDimDeltaDC( dir );
    12431302      m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
     
    12491308        }
    12501309      }
    1251     }
    1252 #if H_3D_DIM_SDC
     1310#endif
     1311    }
     1312#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    12531313  }
    12541314#endif
     
    12571317Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    12581318{
     1319#if SEC_DMM3_RBC_F0147
     1320  UInt codeWordTable[3][7] =    {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};
     1321  UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3,  4,  4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};
     1322#else
    12591323    UInt codeWordTable[3][7] =    {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}};
    12601324    UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}};
     1325#endif
    12611326  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
    12621327  UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
     
    12731338    case DMM1_IDX: codeIdx = 3; break;
    12741339    case DMM4_IDX: codeIdx = 4; break;
     1340#if !SEC_DMM3_RBC_F0147
    12751341    case DMM3_IDX: codeIdx = 5; break;
    12761342    case  RBC_IDX: codeIdx = 6; break;
     1343#endif
    12771344    default:                    break;
    12781345    }
     
    12891356  }
    12901357#endif
     1358#if !SEC_DMM3_RBC_F0147
    12911359  if( puIdx==1 )
    12921360  {
     
    13001368      }
    13011369  }
     1370#endif
    13021371  //mode coding
    13031372  for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ )
Note: See TracChangeset for help on using the changeset viewer.