Changeset 782 in 3DVCSoftware


Ignore:
Timestamp:
20 Jan 2014, 05:01:03 (10 years ago)
Author:
qualcomm
Message:

integration of JCT3V-G0130 (unify signaling and delta DC coding in intra SDC and inter SDC) by Qualcomm

Location:
branches/HTM-9.3-dev3-Qualcomm
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h

    r781 r782  
    119119#if QC_GENERIC_SDC_G0122
    120120#define NUM_ANGLE_FLAG_CTX            3
     121#if !QC_SDC_UNIFY_G0130
    121122#define NUM_INTRASDC_FLAG_CTX         3
     123#endif
    122124#endif
    123125#endif
     
    128130#endif
    129131
    130 #if H_3D_INTER_SDC
     132#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    131133#define NUM_INTER_SDC_FLAG_CTX        1      ///< number of context models for inter SDC flag
    132134#define NUM_INTER_SDC_SIGN_FLAG_CTX   1      ///< number of context models for sign of inter SDC residual
    133135#define NUM_INTER_SDC_RESIDUAL_CTX    1      ///< number of context models for abs of inter SDC residual
     136#endif
     137#if QC_SDC_UNIFY_G0130
     138#define NUM_SDC_FLAG_CTX              1      ///< number of context models for inter SDC flag
    134139#endif
    135140// ====================================================================================================================
     
    417422  { 155, 170, 157 },
    418423};
     424#if !QC_SDC_UNIFY_G0130
    419425static const UChar
    420426INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =
     
    425431};
    426432#endif
     433#endif
    427434
    428435static const UChar
     
    467474#endif
    468475
    469 #if H_3D_INTER_SDC
     476#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    470477static const UChar
    471478INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] =
     
    493500#endif
    494501//! \}
    495 
    496 
    497 #endif
     502#if QC_SDC_UNIFY_G0130
     503static const UChar
     504INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] =
     505{
     506  { 154 }, 
     507  { 154 },
     508  { 154 },
     509};
     510#endif
     511
     512#endif
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp

    r781 r782  
    123123#if H_3D_DIM_SDC
    124124  m_pbSDCFlag             = NULL;
     125#if QC_SDC_UNIFY_G0130
     126  for( Int i = 0; i < 4; i++ )
     127  {
     128    m_apSegmentDCOffset[i]  = NULL;
     129  }
     130#else
    125131  m_apSegmentDCOffset[0]  = NULL;
    126132  m_apSegmentDCOffset[1]  = NULL;
     133#endif
    127134#endif
    128135#endif
     
    146153#endif
    147154#if H_3D_INTER_SDC
     155#if !QC_SDC_UNIFY_G0130
    148156  m_pbInterSDCFlag       = NULL;
    149157  for( Int i = 0; i < 4; i++ )
     
    151159    m_apSegmentInterDCOffset[i] = NULL;
    152160  }
     161#endif
    153162  m_pucInterSDCMask       = NULL;
    154163#endif
     
    272281#if H_3D_DIM_SDC
    273282    m_pbSDCFlag             = (Bool*)xMalloc(Bool, uiNumPartition);
     283#if QC_SDC_UNIFY_G0130
     284    for( Int i = 0; i < 4; i++ )
     285    {
     286      m_apSegmentDCOffset[i]  = (Pel*)xMalloc(Pel, uiNumPartition);
     287    }
     288#else
    274289    m_apSegmentDCOffset[0]  = (Pel*)xMalloc(Pel, uiNumPartition);
    275290    m_apSegmentDCOffset[1]  = (Pel*)xMalloc(Pel, uiNumPartition);
    276291#endif
    277292#endif
    278 #if H_3D_INTER_SDC
     293#endif
     294#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    279295    m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
    280296    for( Int i = 0; i < 4; i++ )
     
    400416#if H_3D_DIM_SDC
    401417    if ( m_pbSDCFlag            ) { xFree(m_pbSDCFlag);             m_pbSDCFlag             = NULL; }
     418#if QC_SDC_UNIFY_G0130
     419    for( Int i = 0; i < 4; i++ )
     420    {
     421      if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]);  m_apSegmentDCOffset[i]  = NULL; }
     422    }
     423#else
    402424    if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]);  m_apSegmentDCOffset[0]  = NULL; }
    403425    if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]);  m_apSegmentDCOffset[1]  = NULL; }
    404426#endif
     427#endif
    405428#endif   
    406 #if H_3D_INTER_SDC
     429#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    407430    if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
    408431    for(Int i = 0; i < 4; i++ )
     
    554577    m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
    555578#endif
    556 #if H_3D_INTER_SDC
     579#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    557580    m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
    558581#endif
     
    616639#if H_3D_DIM_SDC
    617640    memset( m_pbSDCFlag             + firstElement,     0,                numElements * sizeof( *m_pbSDCFlag            ) );
     641#if QC_SDC_UNIFY_G0130
     642    for( Int i = 0; i < 4; i++ )
     643    {
     644      memset( m_apSegmentDCOffset[i]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[i] ) );
     645    }
     646#else
    618647    memset( m_apSegmentDCOffset[0]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[0] ) );
    619648    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    620649#endif
    621650#endif
    622 #if H_3D_INTER_SDC
     651#endif
     652#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    623653    memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
    624654    for( Int i = 0; i < 4; i++ )
     
    788818#if H_3D_DIM_SDC
    789819      m_pbSDCFlag           [ui] = false;
     820#if QC_SDC_UNIFY_G0130
     821      for( Int i = 0; i < 4; i++ )
     822      {
     823        m_apSegmentDCOffset[i][ui] = 0;
     824      }
     825#else
    790826      m_apSegmentDCOffset[0][ui] = 0;
    791827      m_apSegmentDCOffset[1][ui] = 0;
    792828#endif
    793829#endif
    794 #if H_3D_INTER_SDC
     830#endif
     831#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    795832      m_pbInterSDCFlag[ui] = false;
    796833      for( Int i = 0; i < 4; i++ )
     
    901938#if H_3D_DIM_SDC
    902939  memset( m_pbSDCFlag,            0, sizeof(Bool) * m_uiNumPartition  );
     940#if QC_SDC_UNIFY_G0130
     941  for( Int i = 0; i < 4; i++ )
     942  {
     943    memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition   );
     944  }
     945#else
    903946  memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
    904947  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
    905948#endif
    906949#endif
    907 #if H_3D_INTER_SDC
     950#endif
     951#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    908952  memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
    909953  for( Int i = 0; i < 4; i++ )
     
    9781022#if H_3D_DIM_SDC
    9791023      m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
     1024#if QC_SDC_UNIFY_G0130
     1025      for( Int i = 0; i < 4; i++ )
     1026      {
     1027        m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ];
     1028      }
     1029#else
    9801030      m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
    9811031      m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
    9821032#endif
    9831033#endif
    984 #if H_3D_INTER_SDC
     1034#endif
     1035#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    9851036      m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
    9861037      for( Int i = 0; i < 4; i++ )
     
    11341185#if H_3D_DIM_SDC
    11351186  m_pbSDCFlag               = pcCU->getSDCFlag()              + uiPart;
     1187#if QC_SDC_UNIFY_G0130
     1188  for( Int i = 0; i < 4; i++ )
     1189  {
     1190    m_apSegmentDCOffset[i]    = pcCU->getSDCSegmentDCOffset(i)  + uiPart;
     1191  }
     1192#else
    11361193  m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0)  + uiPart;
    11371194  m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1)  + uiPart;
    11381195#endif
     1196#endif
    11391197#endif 
    1140 #if H_3D_INTER_SDC
     1198#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    11411199  m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
    11421200  for( Int i = 0; i < 4; i++ )
     
    13281386#if H_3D_DIM_SDC
    13291387  memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(),             iSizeInBool  );
     1388#if QC_SDC_UNIFY_G0130
     1389  for( Int i = 0; i < 4; i++ )
     1390  {
     1391    memcpy( m_apSegmentDCOffset[i]  + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition);
     1392  }
     1393#else
    13301394  memcpy( m_apSegmentDCOffset[0]  + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
    13311395  memcpy( m_apSegmentDCOffset[1]  + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
    13321396#endif
    13331397#endif
    1334 #if H_3D_INTER_SDC
     1398#endif
     1399#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    13351400  memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
    13361401  for( Int i = 0; i < 4; i++ )
     
    14501515#if H_3D_DIM_SDC
    14511516  memcpy( rpcCU->getSDCFlag()             + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
     1517#if QC_SDC_UNIFY_G0130
     1518  for( Int i = 0; i < 4; i++ )
     1519  {
     1520    memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition);
     1521  }
     1522#else
    14521523  memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
    14531524  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
    14541525#endif
    14551526#endif
    1456 #if H_3D_INTER_SDC
     1527#endif
     1528#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    14571529  memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
    14581530  for( Int i = 0;i < 4; i++ )
     
    15581630#if H_3D_DIM_SDC
    15591631  memcpy( rpcCU->getSDCFlag()             + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
     1632#if QC_SDC_UNIFY_G0130
     1633  for( Int i = 0; i < 4; i++ )
     1634  {
     1635    memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart);
     1636  }
     1637#else
    15601638  memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
    15611639  memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
    15621640#endif
    15631641#endif
    1564 #if H_3D_INTER_SDC
     1642#endif
     1643#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    15651644  memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
    15661645  for( Int i = 0; i < 4; i++ )
     
    22932372
    22942373#if H_3D_INTER_SDC
     2374#if !QC_SDC_UNIFY_G0130
    22952375Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    22962376{
     
    23022382  return 0;
    23032383}
     2384#endif
    23042385
    23052386Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )
     
    24042485UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
    24052486{
     2487#if QC_SDC_UNIFY_G0130
     2488  return 0;
     2489#else
    24062490  TComDataCU* pcTempCU;
    24072491  UInt        uiTempPartIdx;
     
    24172501
    24182502  return uiCtx;
     2503#endif
    24192504}
    24202505
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h

    r781 r782  
    215215#if H_3D_DIM_SDC
    216216  Bool*         m_pbSDCFlag;
     217#if QC_SDC_UNIFY_G0130
     218  Pel*          m_apSegmentDCOffset[4];
     219#else
    217220  Pel*          m_apSegmentDCOffset[2];
    218221#endif
    219222#endif
     223#endif
    220224#if H_3D_INTER_SDC
     225#if !QC_SDC_UNIFY_G0130
    221226  Bool*         m_pbInterSDCFlag;
    222227  Int*          m_apSegmentInterDCOffset[4];
     228#endif
    223229  UChar*        m_pucInterSDCMask;
    224230#endif
     
    578584#endif
    579585#if H_3D_INTER_SDC
     586#if !QC_SDC_UNIFY_G0130
    580587  Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
    581588  Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
     
    585592  Int           getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }
    586593  Void          setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }
    587 
     594#endif
    588595  Void          xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );
    589596
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r781 r782  
    236236#endif
    237237#define QC_GENERIC_SDC_G0122              1  // Generalize SDC to all depth intra modes
    238 
     238#if H_3D_DIM_SDC && H_3D_INTER_SDC
     239#define QC_SDC_UNIFY_G0130                1  // Unify intra SDC and inter SDC
     240#endif
    239241#define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
    240242                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r773 r782  
    27742774#endif
    27752775#if H_3D_INTER_SDC
     2776#if QC_SDC_UNIFY_G0130
     2777Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     2778{
     2779  assert(0);
     2780}
     2781
     2782Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2783{
     2784  assert(0);
     2785}
     2786#else
    27762787Void TDecCavlc::parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    27772788{
     
    27832794  assert(0);
    27842795}
     2796#endif
    27852797#endif
    27862798// ====================================================================================================================
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h

    r773 r782  
    124124#endif
    125125#if H_3D_INTER_SDC
     126#if QC_SDC_UNIFY_G0130
     127  Void  parseDeltaDC        ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
     128  Void  parseSDCFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     129#else
    126130  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    127131  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     132#endif
    128133#endif
    129134  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp

    r781 r782  
    495495  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
    496496  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
    497 
     497#if QC_SDC_UNIFY_G0130
     498  m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     499#endif
    498500  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    499501  {
     
    515517  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
    516518  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
    517 #if H_3D_INTER_SDC
     519#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    518520  m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    519521#endif
     
    586588    case MODE_INTER:
    587589#if H_3D_INTER_SDC
     590#if QC_SDC_UNIFY_G0130
     591      if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) )
     592#else
    588593      if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )
     594#endif
    589595      {
    590596        xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     
    661667    {
    662668      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
    663 
    664       pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );;
     669#if QC_SDC_UNIFY_G0130
     670      pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 );
     671#else
     672      pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );
     673#endif
    665674    }
    666675    pResi += uiResiStride;
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp

    r773 r782  
    713713  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    714714  UInt uiChromaOffset = uiLumaOffset>>2;
    715  
     715#if QC_SDC_UNIFY_G0130
    716716#if H_3D_DIM_SDC
    717   if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     717  if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )
    718718  {
    719719    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     
    722722    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    723723    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     724  }
     725#endif
     726
     727#if H_3D_INTER_SDC
     728  if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) )
     729  {
     730    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
     731    assert( !pcCU->isIntra( uiAbsPartIdx) );
     732    assert( pcCU->getSlice()->getIsDepth() );
     733  }
     734#endif
     735
     736  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
     737  {
     738    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
     739    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
     740
     741    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
     742    {
     743      for( Int iPart = 0; iPart < iPartNum; iPart++ )
     744      {
     745        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE )
     746        {
     747          m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) );
     748        }
     749      }
     750    }
     751    else
     752    {
     753      m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth );
     754      return;
     755    }
     756  }
     757#else
     758#if H_3D_DIM_SDC
     759  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     760  {
     761    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     762    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     763    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     764    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     765    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    724766    return;
    725767  }
     
    737779  }
    738780#endif
     781#endif
    739782
    740783  if( pcCU->isIntra(uiAbsPartIdx) )
     
    760803
    761804#if H_3D_INTER_SDC
     805#if QC_SDC_UNIFY_G0130
     806Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     807{
     808  pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );
     809
     810  if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ||
     811    ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) )
     812  {
     813    return;
     814  }
     815
     816  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
     817  {
     818    return;
     819  }
     820
     821  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
     822
     823  m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     824}
     825
     826#else
    762827Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    763828{
     
    798863}
    799864#endif
     865#endif
    800866
    801867//! \}
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h

    r773 r782  
    9696#endif
    9797#if H_3D_INTER_SDC
     98#if QC_SDC_UNIFY_G0130
     99  virtual Void parseDeltaDC       ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;
     100  virtual Void parseSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     101#else
    98102  virtual Void parseInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    99103  virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
     104#endif
    100105#endif
    101106  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    179184#endif
    180185#if H_3D_INTER_SDC
     186#if QC_SDC_UNIFY_G0130
     187  Void decodeSDCFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     188#else
    181189  Void decodeInterSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    182190  Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    183191#endif
     192#endif
    184193  Void decodeIPCMInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    185194
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp

    r781 r782  
    8989#if QC_GENERIC_SDC_G0122
    9090, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
     91#if !QC_SDC_UNIFY_G0130
    9192, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     93#endif
    9294#endif
    9395#if H_3D_DIM_DMM
     
    99101#endif
    100102#endif
    101 #if H_3D_INTER_SDC
     103#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    102104, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
    103105, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
    104106, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     107#endif
     108#if QC_SDC_UNIFY_G0130
     109, m_cSDCFlagSCModel                  ( 1,             1,  NUM_SDC_FLAG_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
    105110#endif
    106111{
     
    176181#if QC_GENERIC_SDC_G0122
    177182  m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
     183#if !QC_SDC_UNIFY_G0130
    178184  m_cIntraSdcFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG );
     185#endif
    179186#endif
    180187#if H_3D_DIM_DMM
     
    186193#endif
    187194#endif
    188 #if H_3D_INTER_SDC
     195#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    189196  m_cInterSDCFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
    190197  m_cInterSDCResidualSCModel.initBuffer   ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    191198  m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     199#endif
     200#if QC_SDC_UNIFY_G0130
     201  m_cSDCFlagSCModel.initBuffer            ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
    192202#endif
    193203  m_uiLastDQpNonZero  = 0;
     
    249259#if QC_GENERIC_SDC_G0122
    250260  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     261#if !QC_SDC_UNIFY_G0130
    251262  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     263#endif
    252264#endif
    253265#if H_3D_DIM_DMM
     
    259271#endif
    260272#endif
    261 #if H_3D_INTER_SDC
     273#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    262274  m_cInterSDCFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
    263275  m_cInterSDCResidualSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    264276  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     277#endif
     278#if QC_SDC_UNIFY_G0130
     279  m_cSDCFlagSCModel.initBuffer            ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
    265280#endif
    266281  m_pcTDecBinIf->start();
     
    10651080  default: break;
    10661081  }
    1067 
     1082#if !QC_SDC_UNIFY_G0130
    10681083  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
    10691084  {
     
    11091124    }
    11101125  }
    1111 
     1126#endif
    11121127  pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
    11131128}
     
    11281143  uiIsDimMode = uiSymbol ? 0 : 1;
    11291144  pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth );
    1130 
     1145#if !QC_SDC_UNIFY_G0130
    11311146  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
    11321147  {
     
    11391154
    11401155  pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth );
    1141 
     1156#endif
    11421157  //decode DMM index
    11431158  if( uiIsDimMode )
     
    21642179
    21652180#if H_3D_INTER_SDC
     2181#if QC_SDC_UNIFY_G0130
     2182Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
     2183{
     2184  if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) )
     2185  {
     2186    assert( 0 );
     2187  }
     2188
     2189  UInt symbol = 0;
     2190  UInt uiNumSegments = 0;
     2191
     2192  if( pcCU->isIntra( absPartIdx ) )
     2193  {
     2194    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     2195    uiNumSegments = isDimMode( dir ) ? 2 : 1;
     2196
     2197    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
     2198
     2199    if( pcCU->getSDCFlag( absPartIdx ) )
     2200    {
     2201      assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );
     2202      pcCU->setTrIdxSubParts( 0, absPartIdx, depth );
     2203      pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth );
     2204    }
     2205    else
     2206    {
     2207      pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth );
     2208    }
     2209  }
     2210  else
     2211  {
     2212    PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );
     2213
     2214    uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );
     2215    symbol = 1;
     2216  }
     2217
     2218
     2219  for( UInt segment = 0; segment < uiNumSegments; segment++ )
     2220  {
     2221    Pel valDeltaDC = 0;
     2222    if( symbol )
     2223    {
     2224      xParseDimDeltaDC( valDeltaDC, uiNumSegments );
     2225    }
     2226
     2227    if( pcCU->isIntra( absPartIdx ) )
     2228    {
     2229      UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     2230
     2231      if( pcCU->getSDCFlag( absPartIdx ) )
     2232      {
     2233        pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
     2234      }
     2235      else
     2236      {
     2237        pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC );
     2238      }
     2239    }
     2240    else
     2241    {
     2242      pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
     2243    }
     2244  }
     2245}
     2246
     2247Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2248{
     2249  UInt uiSymbol = 0;
     2250  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
     2251
     2252  m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2253
     2254  if( uiSymbol )
     2255  {
     2256    pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth );
     2257    pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
     2258    pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );
     2259  }
     2260  else
     2261  {
     2262    pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );
     2263  }
     2264}
     2265#else
    21662266Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    21672267{
     
    21982298}
    21992299#endif
     2300#endif
    22002301
    22012302//! \}
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h

    r781 r782  
    112112#endif
    113113#if H_3D_INTER_SDC
     114#if QC_SDC_UNIFY_G0130
     115  Void  parseDeltaDC         ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
     116  Void  parseSDCFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     117#else
    114118  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    115119  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     120#endif
    116121#endif
    117122private:
     
    213218#if QC_GENERIC_SDC_G0122
    214219  ContextModel3DBuffer m_cAngleFlagSCModel;
     220#if !QC_SDC_UNIFY_G0130
    215221  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
     222#endif
    216223#endif
    217224#if H_3D_DIM_DMM
     
    223230#endif
    224231#endif
    225 #if H_3D_INTER_SDC
     232#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    226233  ContextModel3DBuffer m_cInterSDCFlagSCModel;
    227234  ContextModel3DBuffer m_cInterSDCResidualSCModel;
    228235  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
    229236#endif
     237#if QC_SDC_UNIFY_G0130
     238  ContextModel3DBuffer m_cSDCFlagSCModel;
     239#endif
    230240};
    231241
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp

    r773 r782  
    25132513
    25142514#if H_3D_INTER_SDC
     2515#if QC_SDC_UNIFY_G0130
     2516Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2517{
     2518  assert(0);
     2519}
     2520
     2521Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2522{
     2523  assert(0);
     2524}
     2525#else
    25152526Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
    25162527{
     
    25232534}
    25242535#endif
     2536#endif
    25252537//! \}
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h

    r773 r782  
    138138#endif
    139139#if H_3D_INTER_SDC
     140#if QC_SDC_UNIFY_G0130
     141  Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     142  Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     143#else
    140144  Void codeInterSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    141145  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     146#endif
    142147#endif
    143148
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCu.cpp

    r773 r782  
    15881588 
    15891589  m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth );
    1590  
     1590#if QC_SDC_UNIFY_G0130
     1591  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
     1592#endif
    15911593  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    15921594  {
     
    16091611  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    16101612#endif
    1611 #if H_3D_INTER_SDC
     1613#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    16121614  m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false );
    16131615#endif
     
    22852287  m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
    22862288  m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
     2289#if QC_SDC_UNIFY_G0130
     2290  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
     2291#endif
    22872292  m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0,          true );
    22882293  m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true );
     
    23742379  m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
    23752380  m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
     2381#if QC_SDC_UNIFY_G0130
     2382  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
     2383#endif
    23762384  m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true );
    23772385
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp

    r773 r782  
    649649  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    650650  UInt uiChromaOffset = uiLumaOffset>>2;
    651    
     651#if QC_SDC_UNIFY_G0130
    652652#if H_3D_DIM_SDC
    653   if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     653  if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) )
    654654  {
    655655    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     
    658658    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    659659    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    660     return;
    661660  }
    662661#endif
    663662
    664663#if H_3D_INTER_SDC
    665   if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
     664  if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
    666665  {
    667666    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
    668667    assert( !pcCU->isIntra( uiAbsPartIdx) );
    669668    assert( pcCU->getSlice()->getIsDepth() );
     669  }
     670#endif
     671
     672  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
     673  {
     674    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
     675    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
     676
     677    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
     678    {
     679      for( Int iPart = 0; iPart < iPartNum; iPart++ )
     680      {
     681        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE )
     682        {
     683          m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart );
     684        }
     685      }
     686    }
     687    else
     688    {
     689      m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx );
     690      return;
     691    }
     692  }
     693#else
     694#if H_3D_DIM_SDC
     695  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     696  {
     697    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     698    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     699    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     700    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     701    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     702    return;
     703  }
     704#endif
     705
     706#if H_3D_INTER_SDC
     707  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
     708  {
     709    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
     710    assert( !pcCU->isIntra( uiAbsPartIdx) );
     711    assert( pcCU->getSlice()->getIsDepth() );
    670712
    671713    encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false );
    672714    return;
    673715  }
     716#endif
    674717#endif
    675718
     
    825868
    826869#if H_3D_INTER_SDC
     870#if QC_SDC_UNIFY_G0130
     871Void TEncEntropy::encodeDeltaDC  ( TComDataCU* pcCU, UInt absPartIdx )
     872{
     873  m_pcEntropyCoderIf->codeDeltaDC( pcCU, absPartIdx );
     874}
     875
     876Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     877{
     878  if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ||
     879    ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) )
     880  {
     881    return;
     882  }
     883
     884  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
     885  {
     886    return;
     887  }
     888
     889  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
     890
     891  if( bRD )
     892  {
     893    uiAbsPartIdx = 0;
     894  }
     895
     896  m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx );
     897}
     898#else
    827899Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    828900{
     
    872944}
    873945#endif
     946#endif
    874947
    875948//! \}
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h

    r655 r782  
    9595#endif
    9696#if H_3D_INTER_SDC
     97#if QC_SDC_UNIFY_G0130
     98  virtual Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     99  virtual Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     100#else
    97101  virtual Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    98102  virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;
     103#endif
    99104#endif
    100105  virtual Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    186191#endif
    187192#if H_3D_INTER_SDC
     193#if QC_SDC_UNIFY_G0130
     194  Void encodeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
     195  Void encodeSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     196#else
    188197  Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    189198  Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD );
     199#endif
    190200#endif
    191201  Void encodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp

    r781 r782  
    9595#if QC_GENERIC_SDC_G0122
    9696, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
     97#if !QC_SDC_UNIFY_G0130
    9798, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     99#endif
    98100#endif
    99101#if H_3D_DIM_DMM
     
    105107#endif
    106108#endif
    107 #if H_3D_INTER_SDC
     109#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    108110, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
    109111, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
    110112, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     113#endif
     114#if QC_SDC_UNIFY_G0130
     115, m_cSDCFlagSCModel                  ( 1,             1,  NUM_SDC_FLAG_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
    111116#endif
    112117{
     
    174179#if QC_GENERIC_SDC_G0122
    175180  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     181#if !QC_SDC_UNIFY_G0130
    176182  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     183#endif
    177184#endif
    178185#if H_3D_DIM_DMM
     
    184191#endif
    185192#endif
    186 #if H_3D_INTER_SDC
     193#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    187194  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
    188195  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    189196  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     197#endif
     198#if QC_SDC_UNIFY_G0130
     199  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
    190200#endif
    191201  // new structure
     
    226236      curCost += m_cCUICFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
    227237#endif
    228 #if H_3D_INTER_SDC
     238#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    229239      curCost += m_cInterSDCFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
    230240      curCost += m_cInterSDCResidualSCModel.calcCost  ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    231241      curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     242#endif
     243#if QC_SDC_UNIFY_G0130
     244      curCost += m_cSDCFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_SDC_FLAG );
    232245#endif
    233246      curCost += m_cCUPartSizeSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_PART_SIZE );
     
    262275#if QC_GENERIC_SDC_G0122
    263276      curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
     277#if !QC_SDC_UNIFY_G0130
    264278      curCost += m_cIntraSdcFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 
     279#endif
    265280#endif
    266281#if H_3D_DIM_DMM
     
    331346#if QC_GENERIC_SDC_G0122
    332347  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     348#if !QC_SDC_UNIFY_G0130
    333349  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     350#endif
    334351#endif
    335352#if H_3D_DIM_DMM
     
    341358#endif
    342359#endif
    343 #if H_3D_INTER_SDC
     360#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    344361  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
    345362  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    346363  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     364#endif
     365#if QC_SDC_UNIFY_G0130
     366  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
    347367#endif
    348368  m_pcBinIf->start();
     
    647667#if QC_GENERIC_SDC_G0122
    648668  this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
     669#if !QC_SDC_UNIFY_G0130
    649670  this->m_cIntraSdcFlagSCModel   .copyFrom( &pSrc->m_cIntraSdcFlagSCModel );
     671#endif
    650672#endif
    651673}
     
    11691191  default: break;
    11701192  }
    1171 
     1193#if !QC_SDC_UNIFY_G0130
    11721194  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
    11731195  {
     
    12061228    }
    12071229  }
     1230#endif
    12081231}
    12091232
     
    12171240    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
    12181241  }
    1219 
     1242#if !QC_SDC_UNIFY_G0130
    12201243  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
    12211244  {
    12221245    m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
    12231246  }
    1224 
     1247#endif
    12251248  if( isDimMode( dir ) )
    12261249  {
     
    22002223
    22012224#if H_3D_INTER_SDC
     2225#if QC_SDC_UNIFY_G0130
     2226Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )
     2227{
     2228  if( !( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) )
     2229  {
     2230    assert( 0 );
     2231  }
     2232
     2233  UInt uiNumSegments = 0;
     2234  UInt dimDeltaDC = 0;
     2235
     2236  if( pcCU->isIntra( absPartIdx ) )
     2237  {
     2238    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     2239    uiNumSegments = isDimMode( dir ) ? 2 : 1;
     2240
     2241    if( pcCU->getSDCFlag( absPartIdx ) )
     2242    {
     2243      if( uiNumSegments == 1 )
     2244      {
     2245        dimDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0;
     2246      }
     2247      else
     2248      {
     2249        dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0;
     2250      }
     2251    }
     2252    else
     2253    {
     2254      dimDeltaDC = isDimDeltaDC( dir );
     2255    }
     2256
     2257    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
     2258  }
     2259  else //all-zero inter SDC is not allowed
     2260  {
     2261    PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );
     2262
     2263    uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );
     2264    dimDeltaDC = 1;
     2265  }
     2266
     2267  if( dimDeltaDC )
     2268  {
     2269    for( UInt segment = 0; segment < uiNumSegments; segment++ )
     2270    {
     2271      Pel deltaDC = 0;
     2272
     2273      if( pcCU->isIntra( absPartIdx ) )
     2274      {
     2275        UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     2276        deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset( segment, absPartIdx ) : pcCU->getDimDeltaDC( getDimType( dir ), segment, absPartIdx );
     2277      }
     2278      else
     2279      {
     2280        deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx );
     2281      }
     2282
     2283      xCodeDimDeltaDC( deltaDC, uiNumSegments );
     2284    }
     2285  }
     2286}
     2287
     2288Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2289{
     2290  UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
     2291  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
     2292
     2293  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2294}
     2295#else
    22022296Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    22032297{
     
    22212315}
    22222316#endif
     2317#endif
    22232318//! \}
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h

    r781 r782  
    154154#endif
    155155#if H_3D_INTER_SDC
     156#if QC_SDC_UNIFY_G0130
     157  Void codeDeltaDC       ( TComDataCU* pcCU, UInt absPartIdx );
     158  Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     159#else
    156160  Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    157161  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     162#endif
    158163#endif
    159164  Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    249254#if QC_GENERIC_SDC_G0122
    250255  ContextModel3DBuffer m_cAngleFlagSCModel;
     256#if !QC_SDC_UNIFY_G0130
    251257  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
     258#endif
    252259#endif
    253260#if H_3D_DIM_DMM
     
    259266#endif
    260267#endif
    261 #if H_3D_INTER_SDC
     268#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    262269  ContextModel3DBuffer m_cInterSDCFlagSCModel;
    263270  ContextModel3DBuffer m_cInterSDCResidualSCModel;
    264271  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
    265272#endif
     273#if QC_SDC_UNIFY_G0130
     274  ContextModel3DBuffer m_cSDCFlagSCModel;
     275#endif
    266276};
    267277
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp

    r781 r782  
    921921     
    922922      m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    923 
     923#if QC_SDC_UNIFY_G0130
     924      m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     925#endif
    924926      if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N )
    925927      {
     
    956958      }
    957959    }
     960#if QC_SDC_UNIFY_G0130
     961    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
     962    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
     963
     964    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
     965    {
     966      for( Int iPart = 0; iPart < iPartNum; iPart++ )
     967      {
     968        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE )
     969        {
     970          m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart );
     971        }
     972      }
     973    }
     974#endif
    958975  }
    959976  if( bChroma )
     
    20472064 
    20482065  // encode reduced intra header
     2066#if QC_SDC_UNIFY_G0130
     2067  if( !pcCU->getSlice()->isIntra() )
     2068  {
     2069    if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     2070    {
     2071      m_pcEntropyCoder->encodeCUTransquantBypassFlag( pcCU, 0, true );
     2072    }
     2073    m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     2074    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     2075  }
     2076
     2077  m_pcEntropyCoder->encodePartSize( pcCU, 0, true );
     2078  m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     2079#else
    20492080  m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     2081#endif
    20502082 
    20512083  // encode pred direction + DC residual data
    20522084  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     2085#if QC_SDC_UNIFY_G0130
     2086  Bool bDummy = false;
     2087  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
     2088#endif
    20532089  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    20542090 
     
    56035639    return;
    56045640  }
    5605 
     5641#if QC_SDC_UNIFY_G0130
     5642  pcCU->setSDCFlagSubParts( true, 0, uiDepth );
     5643#else
    56065644  pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth );
     5645#endif
    56075646
    56085647  UInt  uiWidth      = pcCU->getWidth ( 0 );
     
    56425681    Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) );
    56435682    pResDC [uiSeg]  = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg];
    5644 
     5683#if QC_SDC_UNIFY_G0130
     5684    pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
     5685#else
    56455686    pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
     5687#endif
    56465688  }
    56475689
     
    56985740#endif
    56995741
     5742#if QC_SDC_UNIFY_G0130
     5743  Bool bNonSkip = false;
     5744#else
    57005745  Bool bNonSkip = true;
     5746#endif
    57015747  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
    57025748  {
     5749#if QC_SDC_UNIFY_G0130
     5750    bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
     5751#else
    57035752    bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
     5753#endif
    57045754  }
    57055755
     
    69126962    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    69136963    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
     6964#if QC_SDC_UNIFY_G0130
     6965    m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     6966#endif
    69146967    m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
    69156968#if H_3D_IC
     
    69196972    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
    69206973#endif
    6921 #if H_3D_INTER_SDC
     6974#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    69226975    m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true );
    69236976#endif
Note: See TracChangeset for help on using the changeset viewer.