Changeset 833 in 3DVCSoftware for trunk/source/Lib/TLibDecoder


Ignore:
Timestamp:
7 Feb 2014, 20:31:12 (11 years ago)
Author:
tech
Message:

Merged 9.3-dev0@831.

Location:
trunk/source/Lib/TLibDecoder
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r773 r833  
    16971697        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
    16981698#if H_3D_SPIVMP
     1699#if SEC_SPIVMP_MCP_SIZE_G0077
     1700        READ_UVLC (uiCode, "log2_sub_PU_size_minus3");     pcVPS->setSubPULog2Size(i, uiCode+3);
     1701#else
    16991702        READ_UVLC (uiCode, "log2_sub_PU_size_minus2");     pcVPS->setSubPULog2Size(i, uiCode+2);
     1703#endif
    17001704#endif
    17011705#endif
     
    17101714        READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false );
    17111715#endif
     1716#if H_3D_DBBP
     1717          READ_FLAG( uiCode, "use_dbbp_flag[i]" ); pcVPS->setUseDBBP( i, uiCode == 1 ? true : false );
     1718#endif
    17121719      }
    17131720      else
     
    17221729        if (i!=1)
    17231730        {
     1731#if SEC_SPIVMP_MCP_SIZE_G0077
     1732          READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3);
     1733#else
    17241734          READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]");     pcVPS->setSubPULog2Size(i, uiCode+2);
     1735#endif
    17251736        }
    17261737#endif
     
    17621773    }
    17631774  }
    1764 
     1775#if QC_SPIVMP_MPI_G0119
     1776  READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3");              pcVPS->setSubPUMPILog2Size( uiCode + 3 );
     1777#endif
    17651778  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    17661779}
     
    27742787#endif
    27752788#if H_3D_INTER_SDC
     2789#if QC_SDC_UNIFY_G0130
     2790Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     2791{
     2792  assert(0);
     2793}
     2794
     2795Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2796{
     2797  assert(0);
     2798}
     2799#else
    27762800Void TDecCavlc::parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    27772801{
     
    27832807  assert(0);
    27842808}
     2809#endif
     2810#endif
     2811#if H_3D_DBBP
     2812  Void TDecCavlc::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2813  {
     2814    assert(0);
     2815  }
    27852816#endif
    27862817// ====================================================================================================================
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r773 r833  
    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
     133#endif
     134#if H_3D_DBBP
     135  Void  parseDBBPFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    128136#endif
    129137  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r773 r833  
    5050  m_ppcYuvReco = NULL;
    5151  m_ppcCU      = NULL;
     52#if H_3D_DBBP
     53  m_ppcYuvRecoDBBP = NULL;
     54#endif
    5255}
    5356
     
    7578  m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
    7679  m_ppcCU      = new TComDataCU*[m_uiMaxDepth-1];
     80#if H_3D_DBBP
     81  m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1];
     82#endif
    7783 
    7884  UInt uiNumPartitions;
     
    8692    m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight );
    8793    m_ppcCU     [ui] = new TComDataCU; m_ppcCU     [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) );
     94#if H_3D_DBBP
     95    m_ppcYuvRecoDBBP[ui] = new TComYuv;    m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight );
     96#endif
    8897  }
    8998 
     
    106115    m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
    107116    m_ppcCU     [ui]->destroy(); delete m_ppcCU     [ui]; m_ppcCU     [ui] = NULL;
     117#if H_3D_DBBP
     118    m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL;
     119#endif
    108120  }
    109121 
     
    111123  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
    112124  delete [] m_ppcCU     ; m_ppcCU      = NULL;
     125#if H_3D_DBBP
     126  delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL;
     127#endif
    113128}
    114129
     
    213228  DTRACE_CU("cqtDepth"  , uiDepth)
    214229#endif
     230
    215231  TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx());
    216232  Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr();
     
    276292#endif
    277293
     294
     295#if MTK_DDD_G0063
     296      pcCU->setUseDDD( false, uiAbsPartIdx, uiDepth );
     297#endif
     298
    278299  if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
    279300  {
     
    318339      if( pcCU->getSlice()->getIsDepth())
    319340      {
     341#if SEC_DEPTH_DV_DERIVAITON_G0074
     342        DvInfo.bDV = m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo);
     343#else
    320344        DvInfo.bDV = m_ppcCU[uiDepth]->getDispNeighBlocks(0, 0, &DvInfo);
     345#endif
    321346      }
    322347      else
     
    390415    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    391416
     417#if !SEC_IC_ARP_SIG_G0072
    392418#if H_3D_IC
    393419    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    394420#endif
     421#endif
    395422#if H_3D_ARP
    396423    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
     424#endif
     425#if SEC_IC_ARP_SIG_G0072
     426#if H_3D_IC
     427    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     428#endif
    397429#endif
    398430
     
    434466    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    435467
     468#if MTK_DDD_G0063
     469    if( uiMergeIndex == m_ppcCU[uiDepth]->getUseDDDCandIdx() )
     470    {
     471        assert( pcCU->getSlice()->getViewIndex() != 0 );
     472        pcCU->setUseDDD( true, uiAbsPartIdx, 0, uiDepth );
     473        pcCU->setDDDepthSubParts( m_ppcCU[uiDepth]->getDDTmpDepth(),uiAbsPartIdx, 0, uiDepth );
     474    }
     475#endif
     476
    436477    TComMv cTmpMv( 0, 0 );
    437478    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    443484        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    444485        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     486#if NTT_STORE_SPDV_VSP_G0148
     487        if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
     488        {
     489          if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )
     490          {
     491            UInt dummy;
     492            Int vspSize;
     493            Int width, height;
     494            m_ppcCU[uiDepth]->getPartIndexAndSize( uiAbsPartIdx, dummy, width, height );
     495            m_ppcCU[uiDepth]->setMvFieldPUForVSP( pcCU, uiAbsPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );
     496            pcCU->setVSPFlag( uiAbsPartIdx, vspSize );
     497          }
     498        }
     499#endif
    445500#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC   
    446501        if ( g_decTraceMvFromMerge )
     
    496551  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
    497552
     553#if QC_SDC_UNIFY_G0130
     554  m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     555#endif
    498556  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    499557  {
     
    515573  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
    516574  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
    517 #if H_3D_INTER_SDC
     575#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    518576  m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    519577#endif
     
    585643  {
    586644    case MODE_INTER:
     645#if H_3D_DBBP
     646      if( m_ppcCU[uiDepth]->getDBBPFlag(0) )
     647      {
     648        xReconInterDBBP( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     649      }
     650      else
     651      {
     652#endif
    587653#if H_3D_INTER_SDC
     654#if QC_SDC_UNIFY_G0130
     655      if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) )
     656#else
    588657      if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )
     658#endif
    589659      {
    590660        xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     
    595665      xReconInter( m_ppcCU[uiDepth], uiDepth );
    596666#if H_3D_INTER_SDC
     667      }
     668#endif
     669#if H_3D_DBBP
    597670      }
    598671#endif
     
    646719  UInt  uiWidth      = pcCU->getWidth ( 0 );
    647720  UInt  uiHeight     = pcCU->getHeight( 0 );
     721#if !SEC_INTER_SDC_G0101
    648722  UChar* pMask       = pcCU->getInterSDCMask();
    649723
    650724  memset( pMask, 0, uiWidth*uiHeight );
    651725  pcCU->xSetInterSDCCUMask( pcCU, pMask );
     726#endif
    652727
    653728  Pel  *pResi;
     
    660735    for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
    661736    {
     737#if SEC_INTER_SDC_G0101
     738      pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 );
     739#else
    662740      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
    663 
    664       pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );;
     741#if QC_SDC_UNIFY_G0130
     742      pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 );
     743#else
     744      pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );
     745#endif
     746#endif
    665747    }
    666748    pResi += uiResiStride;
     
    684766    pRecCb += uiStrideC;
    685767    pRecCr += uiStrideC;
     768  }
     769}
     770#endif
     771
     772#if H_3D_DBBP
     773Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     774{
     775  AOF(!pcCU->getSlice()->getIsDepth());
     776  AOF(!pcCU->getSlice()->isIntra());
     777  PartSize ePartSize = pcCU->getPartitionSize( 0 );
     778 
     779  // get collocated depth block
     780  UInt uiDepthStride = 0;
     781  Pel* pDepthPels = pcCU->getVirtualDepthBlock(0, pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride);
     782  AOF( pDepthPels != NULL );
     783  AOF( uiDepthStride != 0 );
     784 
     785  // compute mask by segmenting depth block
     786  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
     787  Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask);
     788  AOF(bValidMask);
     789 
     790  DBBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData();
     791  TComYuv* apSegPredYuv[2] = { m_ppcYuvReco[uiDepth], m_ppcYuvRecoDBBP[uiDepth] };
     792 
     793  // first, extract the two sets of motion parameters
     794  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
     795  for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ )
     796  {
     797    UInt uiPartAddr = uiSegment*uiPUOffset;
     798   
     799    pDBBPTmpData->auhInterDir[uiSegment] = pcCU->getInterDir(uiPartAddr);
     800   
     801    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     802    {
     803      RefPicList eRefList = (RefPicList)uiRefListIdx;
     804      pcCU->getMvField(pcCU, uiPartAddr, eRefList, pDBBPTmpData->acMvField[uiSegment][eRefList]);
     805    }
     806   
     807    pDBBPTmpData->ahVSPFlag[uiSegment] = pcCU->getVSPFlag( uiPartAddr );
     808    pDBBPTmpData->acDvInfo[uiSegment] = pcCU->getDvInfo( uiPartAddr );
     809  }
     810 
     811  // do motion compensation for each segment as 2Nx2N
     812  pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     813  pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth );
     814  for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ )
     815  {
     816    pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth );
     817   
     818    pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], 0, 0, uiDepth );
     819    pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], 0, 0, uiDepth );
     820   
     821    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     822    {
     823      RefPicList eRefList = (RefPicList)uiRefListIdx;
     824
     825      pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], SIZE_2Nx2N, 0, 0 );
     826    }
     827   
     828    // inter prediction
     829    m_pcPrediction->motionCompensation( pcCU, apSegPredYuv[uiSegment] );
     830  }
     831 
     832  // restore motion information in both segments again
     833  pcCU->setPartSizeSubParts( ePartSize,  0, uiDepth );
     834  pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth );
     835  for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ )
     836  {
     837    UInt uiPartAddr = uiSegment*uiPUOffset;
     838   
     839    pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth);
     840   
     841    pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uiDepth );
     842    pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uiDepth );
     843   
     844    pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level
     845   
     846    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     847    {
     848      RefPicList eRefList = (RefPicList)uiRefListIdx;
     849
     850      pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], ePartSize, uiPartAddr, 0, uiSegment ); // interprets depth relative to rpcTempCU level
     851    }
     852  }
     853 
     854  // reconstruct final prediction signal by combining both segments
     855  m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0));
     856 
     857  // inter recon
     858  xDecodeInterTexture( pcCU, 0, uiDepth );
     859 
     860  // clip for only non-zero cbp case
     861  if  ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) )
     862  {
     863    m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );
     864  }
     865  else
     866  {
     867    m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 ));
    686868  }
    687869}
     
    9061088  UInt uiWidth        = pcCU->getWidth  ( 0 );
    9071089  UInt uiHeight       = pcCU->getHeight ( 0 );
    908  
     1090#if QC_PKU_SDC_SPLIT_G0123
     1091#if HS_TSINGHUA_SDC_SPLIT_G0111
     1092#if QC_GENERIC_SDC_G0122
     1093  TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
     1094#endif
     1095#else
     1096#if QC_GENERIC_SDC_G0122
     1097  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1098#endif
     1099#endif
     1100#endif
     1101#if QC_PKU_SDC_SPLIT_G0123
     1102  UInt numParts = 1;
     1103  UInt i = 0;
     1104  UInt sdcDepth    = 0;
     1105  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     1106  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     1107  TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
     1108
     1109  UInt    uiStride = 0;
     1110  Pel*    piReco;
     1111  Pel*    piPred;
     1112  Pel*    piResi;
     1113
     1114  UInt    uiZOrder;       
     1115  Pel*    piRecIPred;     
     1116  UInt    uiRecIPredStride;
     1117
     1118  UInt    uiLumaPredMode = 0; 
     1119
     1120#if HS_TSINGHUA_SDC_SPLIT_G0111
     1121  if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1)
     1122  {
     1123    numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
     1124    sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
     1125    uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
     1126  }
     1127#else
     1128  if (uiWidth == 64)
     1129  {
     1130    numParts = 4;
     1131    sdcDepth = 1;
     1132    uiWidth = uiHeight = 32;
     1133  }
     1134#endif
     1135
     1136  for ( i = 0; i < numParts; i++ )
     1137  {
     1138    uiStride    = pcRecoYuv->getStride  ();
     1139    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     1140    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1141    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
     1142 
     1143    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1144    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     1145    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     1146
     1147    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
     1148
     1149    AOF( uiWidth == uiHeight );
     1150#else
    9091151  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
    9101152  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     
    9261168  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
    9271169  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     1170#endif
    9281171 
    9291172  //===== init availability pattern =====
    9301173  Bool  bAboveAvail = false;
    9311174  Bool  bLeftAvail  = false;
     1175#if QC_PKU_SDC_SPLIT_G0123
     1176  pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
     1177  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
     1178#else
    9321179  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
    9331180  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
    934  
     1181#endif
     1182#if !QC_PKU_SDC_SPLIT_G0123
     1183#if QC_GENERIC_SDC_G0122
     1184  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1185#endif
     1186#endif
     1187#if HS_TSINGHUA_SDC_SPLIT_G0111
     1188  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1189#endif
    9351190  //===== get prediction signal =====
    9361191#if H_3D_DIM
    9371192  if( isDimMode( uiLumaPredMode ) )
    9381193  {
    939     m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight );
     1194    m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight
     1195#if QC_GENERIC_SDC_G0122
     1196      , false, dmm4Segmentation
     1197#endif
     1198      );
     1199#if HS_TSINGHUA_SDC_SPLIT_G0111
     1200    Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
     1201    Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
     1202    for( UInt k = 0; k < (uiWidth*uiHeight); k++ )
     1203    {
     1204      dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
     1205    }
     1206#endif
    9401207  }
    9411208  else
     
    9461213  }
    9471214#endif
    948  
     1215#if QC_PKU_SDC_SPLIT_G0123
     1216    if ( numParts > 1 )
     1217    {
     1218      for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1219      {
     1220        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1221        {
     1222          piReco        [ uiX ] = ClipY( piPred[ uiX ] );
     1223          piRecIPred    [ uiX ] = piReco[ uiX ];
     1224        }
     1225        piPred     += uiStride;
     1226        piReco     += uiStride;
     1227        piRecIPred += uiRecIPredStride;
     1228      }
     1229    }
     1230    uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 );
     1231#if HS_TSINGHUA_SDC_SPLIT_G0111
     1232    dmm4Segmentation->destroy(); delete dmm4Segmentation;
     1233#endif
     1234  }
     1235  uiAbsPartIdx = 0;
     1236 
     1237  if ( numParts > 1 )
     1238  {
     1239    uiWidth = pcCU->getWidth( 0 );
     1240    uiHeight = pcCU->getHeight( 0 );
     1241  }
     1242  piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     1243  piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1244  piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
     1245  uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1246  piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     1247  uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     1248#endif
    9491249  // number of segments depends on prediction mode
    9501250  UInt uiNumSegments = 1;
     
    9631263    uiMaskStride = pcWedgelet->getStride();
    9641264  }
    965  
     1265#if QC_GENERIC_SDC_G0122
     1266  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
     1267  {
     1268    uiNumSegments = 2;
     1269#if HS_TSINGHUA_SDC_SPLIT_G0111
     1270    pbMask  = dmm4SegmentationOrg->getPattern();
     1271    uiMaskStride = dmm4SegmentationOrg->getStride();
     1272#else
     1273    pbMask  = dmm4Segmentation->getPattern();
     1274    uiMaskStride = dmm4Segmentation->getStride();
     1275#endif
     1276  }
     1277#endif
    9661278  // get DC prediction for each segment
    9671279  Pel apDCPredValues[2];
     
    10251337    pRecCr += uiStrideC;
    10261338  }
     1339#if QC_GENERIC_SDC_G0122
     1340#if HS_TSINGHUA_SDC_SPLIT_G0111
     1341  dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
     1342#else
     1343  dmm4Segmentation->destroy(); delete dmm4Segmentation;
     1344#endif
     1345#endif
    10271346}
    10281347#endif
  • trunk/source/Lib/TLibDecoder/TDecCu.h

    r655 r833  
    6363  TComDataCU**        m_ppcCU;            ///< CU data array
    6464 
     65#if H_3D_DBBP
     66  TComYuv**           m_ppcYuvRecoDBBP;
     67#endif
     68 
    6569  // access channel
    6670  TComTrQuant*        m_pcTrQuant;
     
    98102  Void xReconInter              ( TComDataCU* pcCU, UInt uiDepth );
    99103 
     104#if H_3D_DBBP
     105  Void xReconInterDBBP          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     106#endif
     107 
    100108  Void  xReconIntraQT           ( TComDataCU* pcCU, UInt uiDepth );
    101109  Void  xIntraRecLumaBlk        ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv );
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r773 r833  
    111111  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
    112112
     113#if SEC_IC_ARP_SIG_G0072
     114  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
     115#else
    113116  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
     117#endif
    114118  {
    115119    return;
     
    137141{
    138142  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
     143 
     144#if H_3D_DBBP
     145  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
     146  {
     147    decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
     148   
     149    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
     150    {
     151      AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
     152     
     153      // get collocated depth block
     154      UInt uiDepthStride = 0;
     155      Pel* pDepthPels = NULL;
     156      pDepthPels = pcCU->getVirtualDepthBlock(uiAbsPartIdx, pcCU->getWidth(uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), uiDepthStride);
     157     
     158      AOF( pDepthPels != NULL );
     159      AOF( uiDepthStride != 0 );
     160     
     161      // derive true partitioning for this CU based on depth
     162      // (needs to be done in parsing process as motion vector predictors are also derived during parsing)
     163      PartSize eVirtualPartSize = m_pcPrediction->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(uiAbsPartIdx));
     164      AOF( eVirtualPartSize != SIZE_NONE );
     165     
     166      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
     167    }
     168  }
     169#endif
    139170}
    140171
     
    241272      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    242273      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
     274#if !SEC_IC_ARP_SIG_G0072
    243275#if H_3D_IC
    244276      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    245277#endif
     278#endif
    246279#if H_3D_ARP
    247280      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    248281#endif
     282#if SEC_IC_ARP_SIG_G0072
     283#if H_3D_IC
     284      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     285#endif
     286#endif
     287#if H_3D_DBBP
     288      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false )
     289#else
    249290      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )
     291#endif
    250292      {
    251293        pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     
    320362      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    321363
     364#if MTK_DDD_G0063
     365      if( uiMergeIndex == pcSubCU->getUseDDDCandIdx() )
     366      {
     367          assert( pcCU->getSlice()->getViewIndex() != 0 );
     368          pcCU->setUseDDD( true, uiSubPartIdx, uiPartIdx, uiDepth );
     369          pcCU->setDDDepthSubParts( pcSubCU->getDDTmpDepth(),uiSubPartIdx, uiPartIdx, uiDepth );
     370      }
     371      else
     372      {
     373          pcCU->setUseDDD( false, uiSubPartIdx, uiPartIdx, uiDepth );
     374      }
     375#endif
     376
    322377      TComMv cTmpMv( 0, 0 );
    323378      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    329384          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    330385          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
     386#if NTT_STORE_SPDV_VSP_G0148
     387#if H_3D_DBBP
     388          if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
     389#else
     390          if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )
     391#endif
     392          {
     393            if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )
     394            {
     395              UInt dummy;
     396              Int vspSize;
     397              Int width, height;
     398              pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 );
     399              pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );
     400              pcCU->setVSPFlag( uiSubPartIdx, vspSize );
     401            }
     402          }
     403#endif
    331404        }
    332405      }
     
    367440        }
    368441      }
     442#if !SEC_IC_ARP_SIG_G0072
    369443#if H_3D_IC
    370444      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    371445#endif
     446#endif
    372447#if H_3D_ARP
    373448      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    374449#endif
     450#if SEC_IC_ARP_SIG_G0072
     451#if H_3D_IC
     452      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     453#endif
     454#endif
    375455    }
    376456#if H_3D_VSP
     457#if NTT_STORE_SPDV_VSP_G0148
     458    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
     459#else
    377460    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
     461#endif
    378462#else
    379463    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
     
    713797  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    714798  UInt uiChromaOffset = uiLumaOffset>>2;
    715  
     799#if QC_SDC_UNIFY_G0130
    716800#if H_3D_DIM_SDC
    717   if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     801  if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )
    718802  {
    719803    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     
    722806    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    723807    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     808  }
     809#endif
     810
     811#if H_3D_INTER_SDC
     812  if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) )
     813  {
     814    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
     815    assert( !pcCU->isIntra( uiAbsPartIdx) );
     816    assert( pcCU->getSlice()->getIsDepth() );
     817  }
     818#endif
     819#if QC_SDC_UNIFY_G0130_FIX
     820  if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) )
     821#else
     822  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
     823#endif
     824  {
     825    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
     826    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
     827 
     828    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
     829    {
     830      for( Int iPart = 0; iPart < iPartNum; iPart++ )
     831      {
     832        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE )
     833        {
     834          m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) );
     835        }
     836      }
     837    }
     838    else
     839    {
     840      m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth );
     841      return;
     842    }
     843  }
     844#else
     845#if H_3D_DIM_SDC
     846  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     847  {
     848    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     849    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     850    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     851    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     852    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    724853    return;
    725854  }
     
    737866  }
    738867#endif
     868#endif
    739869
    740870  if( pcCU->isIntra(uiAbsPartIdx) )
     
    760890
    761891#if H_3D_INTER_SDC
     892#if QC_SDC_UNIFY_G0130
     893Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     894{
     895  pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );
     896
     897  if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ||
     898    ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) )
     899  {
     900    return;
     901  }
     902
     903#if SEC_INTER_SDC_G0101
     904  if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )
     905#else
     906  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
     907#endif
     908  {
     909    return;
     910  }
     911
     912#if SEC_INTER_SDC_G0101
     913  assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
     914#else
     915  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
     916#endif
     917
     918  m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     919}
     920
     921#else
    762922Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    763923{
     
    798958}
    799959#endif
     960#endif
     961#if H_3D_DBBP
     962Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     963{
     964  m_pcEntropyDecoderIf->parseDBBPFlag( pcCU, uiAbsPartIdx, uiDepth );
     965}
     966#endif
    800967
    801968//! \}
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r773 r833  
    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
     105#endif
     106#if H_3D_DBBP
     107  virtual Void parseDBBPFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    100108#endif
    101109  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    179187#endif
    180188#if H_3D_INTER_SDC
     189#if QC_SDC_UNIFY_G0130
     190  Void decodeSDCFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     191#else
    181192  Void decodeInterSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    182193  Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    183194#endif
     195#endif
     196#if H_3D_DBBP
     197  Void decodeDBBPFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     198#endif
    184199  Void decodeIPCMInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    185200
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r773 r833  
    8787, m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    8888, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     89#if QC_GENERIC_SDC_G0122
     90, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
     91#if !QC_SDC_UNIFY_G0130
     92, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     93#endif
     94#endif
    8995#if H_3D_DIM_DMM
    9096, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    95101#endif
    96102#endif
    97 #if H_3D_INTER_SDC
     103#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    98104, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
    99105, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
    100106, 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)
     110#endif
     111#if H_3D_DBBP
     112, m_cDBBPFlagSCModel             ( 1,             1,                 DBBP_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
    101113#endif
    102114{
     
    170182  m_cDdcFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_FLAG );
    171183  m_cDdcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_DATA );
     184#if QC_GENERIC_SDC_G0122
     185  m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
     186#if !QC_SDC_UNIFY_G0130
     187  m_cIntraSdcFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG );
     188#endif
     189#endif
    172190#if H_3D_DIM_DMM
    173191  m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
     
    178196#endif
    179197#endif
    180 #if H_3D_INTER_SDC
     198#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    181199  m_cInterSDCFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
    182200  m_cInterSDCResidualSCModel.initBuffer   ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    183201  m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     202#endif
     203#if QC_SDC_UNIFY_G0130
     204  m_cSDCFlagSCModel.initBuffer            ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
     205#endif
     206#if H_3D_DBBP
     207  m_cDBBPFlagSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_DBBP_FLAG );
    184208#endif
    185209  m_uiLastDQpNonZero  = 0;
     
    239263  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    240264  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
     265#if QC_GENERIC_SDC_G0122
     266  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     267#if !QC_SDC_UNIFY_G0130
     268  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     269#endif
     270#endif
    241271#if H_3D_DIM_DMM
    242272  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    247277#endif
    248278#endif
    249 #if H_3D_INTER_SDC
     279#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    250280  m_cInterSDCFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
    251281  m_cInterSDCResidualSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
    252282  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     283#endif
     284#if QC_SDC_UNIFY_G0130
     285  m_cSDCFlagSCModel.initBuffer            ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
     286#endif
     287#if H_3D_DBBP
     288  m_cDBBPFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG );
    253289#endif
    254290  m_pcTDecBinIf->start();
     
    784820  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    785821
     822#if MTK_TEX_DEP_PAR_G0055
     823  Bool depthDependent = false;
     824  UInt uiTexturePart = uiMode;
     825#endif
    786826  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
    787827  {
    788828    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
    789829    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
     830#if !MTK_TEX_DEP_PAR_G0055
    790831    if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN)
     832#else
     833    if(pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth )
     834    {
     835      depthDependent = true;
     836      uiTexturePart = pcTextureCU->getPartitionSize( uiAbsPartIdx );
     837    }
     838    if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N)
     839#endif
    791840    {
    792841      bParsePartSize = false;
     
    833882    if(bParsePartSize)
    834883    {
     884#endif
     885#if MTK_TEX_DEP_PAR_G0055
     886      if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)
     887      {
    835888#endif
    836889      UInt uiMaxNumBits = 2;
     
    870923        }
    871924      }
     925#if MTK_TEX_DEP_PAR_G0055
     926      }
     927      else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD)
     928      {
     929        UInt uiMaxNumBits = 1;
     930        if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     931        {
     932          uiMaxNumBits ++;
     933        }
     934        for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
     935        {
     936          m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
     937          if ( uiSymbol )
     938          {
     939            break;
     940          }
     941          uiMode++;
     942        }
     943        eMode = (PartSize) uiMode;
     944        if(uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==1 )
     945        {
     946          eMode = SIZE_2NxN;
     947        }
     948        else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth )==0  && uiSymbol==0)
     949        {
     950          eMode = SIZE_2NxN;
     951        }
     952        else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==0)
     953        {
     954          m_pcTDecBinIf->decodeBinEP(uiSymbol);
     955          eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
     956        }
     957      }
     958      else if(uiTexturePart == SIZE_Nx2N|| uiTexturePart==SIZE_nLx2N || uiTexturePart==SIZE_nRx2N)
     959      {
     960        UInt uiMaxNumBits = 1;
     961        if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     962        {
     963          uiMaxNumBits ++;
     964        }
     965        for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
     966        {
     967          m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
     968          if ( uiSymbol )
     969          {
     970            break;
     971          }
     972          uiMode++;
     973        }
     974        eMode = (PartSize) uiMode;
     975        if(uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==1 )
     976        {
     977          eMode = SIZE_Nx2N;
     978        }
     979        else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth )==0  && uiSymbol==0)
     980        {
     981          eMode = SIZE_Nx2N;
     982        }
     983        else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==0)
     984        {
     985          m_pcTDecBinIf->decodeBinEP(uiSymbol);
     986          eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
     987        }
     988      }
     989      else
     990        assert(0);
     991#endif
    872992#if H_MV_ENC_DEC_TRAC         
    873993      DTRACE_CU("part_mode", eMode )
     
    9251045    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    9261046#if H_3D_DIM_SDC
     1047#if QC_GENERIC_SDC_G0122
     1048      if( 1 ) // This should be cleaned up.
     1049#else
    9271050      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     1051#endif
    9281052#endif
    9291053    {
     
    9431067    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    9441068#if H_3D_DIM_SDC
     1069#if QC_GENERIC_SDC_G0122
     1070      if( 1 )  // This should be cleaned up.
     1071#else
    9451072      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     1073#endif
    9461074#endif
    9471075    {
     
    10461174  }
    10471175
     1176#if !QC_SDC_UNIFY_G0130
    10481177  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
    10491178  {
    10501179    UInt symbol;
     1180#if QC_GENERIC_SDC_G0122
     1181    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
     1182#else
    10511183    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1184#endif
    10521185
    10531186    if( pcCU->getSDCFlag( absPartIdx ) )
     
    10851218    }
    10861219  }
    1087 
     1220#endif
    10881221  pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
    10891222}
    10901223
     1224#if QC_GENERIC_SDC_G0122
     1225Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
     1226{
     1227  UInt uiSymbol, uiIsDimMode;
     1228
     1229  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
     1230  {
     1231    m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
     1232  }
     1233  else
     1234  {
     1235    uiSymbol = 1;
     1236  }
     1237  uiIsDimMode = uiSymbol ? 0 : 1;
     1238  pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth );
     1239#if !QC_SDC_UNIFY_G0130
     1240  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
     1241  {
     1242    m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
     1243  }
     1244  else
     1245  {
     1246    uiSymbol = 0;
     1247  }
     1248
     1249  pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth );
     1250#endif
     1251  //decode DMM index
     1252  if( uiIsDimMode )
     1253  {
     1254    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1255    if( !uiSymbol )
     1256    {
     1257      pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
     1258    }
     1259    else
     1260    {
     1261      pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
     1262    }
     1263  }
     1264}
     1265#else
    10911266Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
    10921267{
     
    11511326#endif
    11521327}
     1328#endif
    11531329#endif
    11541330
     
    20582234  if( 1 == uiW )   
    20592235  {
     2236#if MTK_ARP_FLAG_CABAC_SIMP_G0061
     2237    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) );
     2238#else
    20602239    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 3 ) );
     2240#endif
    20612241    uiW += ( 1 == uiCode ? 1 : 0 );
    20622242  }
     
    20782258{
    20792259  UInt uiSymbol = 0;
     2260#if MTK_IC_FLAG_CABAC_SIMP_G0061
     2261  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );
     2262#else
    20802263  UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx );
    20812264  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
     2265#endif
    20822266#if !H_MV_ENC_DEC_TRAC
    20832267  DTRACE_CABAC_VL( g_nSymbolCounter++ );
     
    20972281
    20982282#if H_3D_INTER_SDC
     2283#if QC_SDC_UNIFY_G0130
     2284Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
     2285{
     2286  if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) )
     2287  {
     2288    assert( 0 );
     2289  }
     2290
     2291  UInt symbol = 0;
     2292  UInt uiNumSegments = 0;
     2293
     2294  if( pcCU->isIntra( absPartIdx ) )
     2295  {
     2296    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     2297    uiNumSegments = isDimMode( dir ) ? 2 : 1;
     2298
     2299    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
     2300
     2301    if( pcCU->getSDCFlag( absPartIdx ) )
     2302    {
     2303      assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );
     2304      pcCU->setTrIdxSubParts( 0, absPartIdx, depth );
     2305      pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth );
     2306    }
     2307    else
     2308    {
     2309      pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth );
     2310    }
     2311  }
     2312  else
     2313  {
     2314#if SEC_INTER_SDC_G0101
     2315    uiNumSegments = 1;
     2316#else
     2317    PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );
     2318    uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );
     2319#endif
     2320    symbol = 1;
     2321  }
     2322
     2323
     2324  for( UInt segment = 0; segment < uiNumSegments; segment++ )
     2325  {
     2326    Pel valDeltaDC = 0;
     2327    if( symbol )
     2328    {
     2329      xParseDimDeltaDC( valDeltaDC, uiNumSegments );
     2330    }
     2331
     2332    if( pcCU->isIntra( absPartIdx ) )
     2333    {
     2334      UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     2335
     2336      if( pcCU->getSDCFlag( absPartIdx ) )
     2337      {
     2338        pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
     2339      }
     2340      else
     2341      {
     2342        pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC );
     2343      }
     2344    }
     2345    else
     2346    {
     2347      pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
     2348    }
     2349  }
     2350}
     2351
     2352Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2353{
     2354  UInt uiSymbol = 0;
     2355  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
     2356
     2357  m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2358
     2359  if( uiSymbol )
     2360  {
     2361    pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth );
     2362    pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
     2363    pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );
     2364  }
     2365  else
     2366  {
     2367    pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );
     2368  }
     2369}
     2370#else
    20992371Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    21002372{
     
    21312403}
    21322404#endif
     2405#endif
     2406
     2407#if H_3D_DBBP
     2408Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2409{
     2410  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
     2411  AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
     2412  AOF( !pcCU->getSlice()->getIsDepth() );
     2413  AOF( ePartSize == RWTH_DBBP_PACK_MODE );
     2414 
     2415  UInt uiSymbol = 0;
     2416 
     2417  m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
     2418 
     2419  if( uiSymbol )
     2420  {
     2421    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
     2422  }
     2423}
     2424#endif
    21332425
    21342426//! \}
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r773 r833  
    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
     121#endif
     122#if H_3D_DBBP
     123  Void parseDBBPFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    116124#endif
    117125private:
     
    211219  ContextModel3DBuffer m_cDdcFlagSCModel;
    212220  ContextModel3DBuffer m_cDdcDataSCModel;
     221#if QC_GENERIC_SDC_G0122
     222  ContextModel3DBuffer m_cAngleFlagSCModel;
     223#if !QC_SDC_UNIFY_G0130
     224  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
     225#endif
     226#endif
    213227#if H_3D_DIM_DMM
    214228  ContextModel3DBuffer m_cDmm1DataSCModel;
     
    219233#endif
    220234#endif
    221 #if H_3D_INTER_SDC
     235#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    222236  ContextModel3DBuffer m_cInterSDCFlagSCModel;
    223237  ContextModel3DBuffer m_cInterSDCResidualSCModel;
    224238  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
    225239#endif
     240#if QC_SDC_UNIFY_G0130
     241  ContextModel3DBuffer m_cSDCFlagSCModel;
     242#endif
     243#if H_3D_DBBP
     244  ContextModel3DBuffer m_cDBBPFlagSCModel;
     245#endif
    226246};
    227247
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r773 r833  
    8282#endif
    8383
     84#if MTK_DDD_G0063
     85  Int getCodedScale( Int iBaseView, Int iCureView){ return m_aaiCodedScale[ iBaseView ][ iCureView ];}
     86  Int getCodedOffset( Int iBaseView, Int iCureView){ return m_aaiCodedOffset[ iBaseView ][ iCureView ];}
     87  UInt getCamParsCodedPrecision(){ return m_uiCamParsCodedPrecision; }
     88#endif
     89
    8490private:
    8591  Bool  xIsComplete ();
Note: See TracChangeset for help on using the changeset viewer.