Ignore:
Timestamp:
20 Jan 2014, 05:01:03 (11 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/source/Lib/TLibDecoder
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.