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


Ignore:
Timestamp:
26 May 2013, 15:41:34 (12 years ago)
Author:
tech
Message:
  • Reintegrated branch 6.2-dev0 rev. 442.
  • Changed version number.
  • Added coding results.
Location:
trunk/source/Lib/TLibDecoder
Files:
13 edited

Legend:

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

    r332 r443  
    265265    xParseDblParam( aps );   
    266266  }
     267#if !LGE_SAO_MIGRATION_D0091
    267268  READ_FLAG(uiCode, "aps_sao_interleaving_flag");      aps->setSaoInterleavingFlag( (uiCode==1)?true:false );
    268269  if(!aps->getSaoInterleavingFlag())
     
    275276  }
    276277  }
     278#endif
    277279  READ_FLAG(uiCode, "aps_adaptive_loop_filter_flag");      aps->setAlfEnabled( (uiCode==1)?true:false );
    278280  if(aps->getAlfEnabled())
     
    307309  }
    308310}
     311#if !LGE_SAO_MIGRATION_D0091
    309312/** parse SAO parameters
    310313 * \param pSaoParam
     
    532535  }
    533536}
    534 
     537#endif
    535538
    536539Void TDecCavlc::xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS, Int firstLCUAddr, Bool acrossSlice, Int numLCUInWidth, Int numLCUInHeight)
     
    14931496#endif
    14941497#if H3D_IVRP
    1495     pcSPS->setMultiviewResPredMode  ( 0 );
    1496 #endif
     1498#if QC_ARP_D0177
     1499     pcSPS->setUseAdvRP  ( 0 );
     1500     pcSPS->setARPStepNum( 1 );
     1501#else
     1502     pcSPS->setMultiviewResPredMode  ( 0 );
     1503#endif
     1504#endif
     1505
    14971506    }
    14981507    else
     
    15441553#endif
    15451554#if H3D_IVRP
     1555#if QC_ARP_D0177
     1556      pcSPS->setUseAdvRP  ( 0 );
     1557      pcSPS->setARPStepNum( 1 );
     1558#else
    15461559      pcSPS->setMultiviewResPredMode  ( 0 );
    15471560#endif
     1561#endif
     1562
    15481563      }
    15491564      else
     
    15731588        UInt uiMultiviewMvPredMode = 0;
    15741589#endif
    1575 #if H3D_IVRP
     1590#if H3D_IVRP & !QC_ARP_D0177
    15761591      UInt uiMultiviewResPredMode = 0;
    15771592#endif
     
    15881603          READ_UVLC( uiMultiviewMvPredMode, "multi_view_mv_pred_mode" );
    15891604#endif
    1590 #if H3D_IVRP
     1605#if H3D_IVRP & !QC_ARP_D0177
    15911606          READ_FLAG( uiMultiviewResPredMode, "multi_view_residual_pred_mode" );
    15921607#endif
     
    15991614#endif
    16001615#if H3D_IVRP
     1616#if QC_ARP_D0177
     1617      READ_FLAG( uiCode , "advanced_residual_pred_flag" );           pcSPS->setUseAdvRP( uiCode );
     1618      if( pcSPS->getUseAdvRP()  )
     1619          pcSPS->setARPStepNum( QC_ARP_WFNR );
     1620      else
     1621       pcSPS->setARPStepNum( 1 );
     1622#else
    16011623      pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
    16021624#endif
    1603       }
     1625#endif
     1626
     1627      }
     1628
     1629#if MTK_D0156
     1630
     1631      pcSPS->setUseVSPCompensation( false );
     1632      pcSPS->setUseDVPRefine( false );
     1633
     1634      //Comments: Currently, BVSP and DoNBDV are not used for depth coding
     1635#if MERL_VSP_COMPENSATION_C0152
     1636      READ_FLAG( uiCode, "view_synthesis_pred_flag" );pcSPS->setUseVSPCompensation( uiCode ? true : false );
     1637#endif
     1638      READ_FLAG( uiCode, "dv_refine_flag" );          pcSPS->setUseDVPRefine( uiCode ? true : false );
     1639#endif
    16041640    }
    16051641    READ_FLAG( uiCode, "sps_extension2_flag");
     
    16651701    }
    16661702    rpcSlice->setApplyIC(uiCodeTmp);
     1703#if SHARP_ILLUCOMP_PARSE_D0060
     1704    if (rpcSlice->getApplyIC())
     1705    {
     1706      READ_FLAG (uiCodeTmp, "ic_skip_mergeidx0");
     1707      rpcSlice->setIcSkipParseFlag(uiCodeTmp);
     1708    }
     1709#endif
    16671710  }
    16681711#endif
     
    18471890      if (sps->getUseSAO())
    18481891      {
     1892#if LGE_SAO_MIGRATION_D0091
     1893        READ_FLAG(uiCode, "slice_sao_luma_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
     1894        READ_FLAG(uiCode, "slice_sao_chroma_flag");  rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);
     1895#else
    18491896        READ_FLAG(uiCode, "slice_sao_interleaving_flag");        rpcSlice->setSaoInterleavingFlag(uiCode);
    18501897        READ_FLAG(uiCode, "slice_sample_adaptive_offset_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
     
    18591906          rpcSlice->setSaoEnabledFlagCr(0);
    18601907        }
     1908#endif
    18611909      }
    18621910      READ_UVLC (    uiCode, "aps_id" );  rpcSlice->setAPSId(uiCode);
     
    24242472}
    24252473#endif
    2426 
     2474#if QC_ARP_D0177
     2475Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2476{
     2477  assert( false );
     2478}
     2479#endif
    24272480#if RWTH_SDC_DLT_B0036
     2481#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    24282482Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24292483{
     
    24342488  assert(0);
    24352489}
     2490#endif
    24362491Void TDecCavlc::parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
    24372492{
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r332 r443  
    144144  Void parseResPredFlag     ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
    145145#endif
     146#if QC_ARP_D0177
     147  Void parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx,UInt uiDepth );
     148#endif
    146149  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    147150  Void parsePartSize        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    171174  Void parseDFSvlc         ( Int&  riVal,  const Char *pSymbolName  );
    172175#if RWTH_SDC_DLT_B0036
     176#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    173177  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    174178  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     179#endif
    175180  Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
    176181#endif
    177182protected:
    178183  Void  xParseDblParam       ( TComAPS* aps );
     184#if !LGE_SAO_MIGRATION_D0091
    179185  Void  xParseSaoParam       ( SAOParam* pSaoParam );
    180186  Void  xParseSaoOffset      (SaoLcuParam* saoLcuParam);
    181187  Void  xParseSaoUnit        (Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool& repeatedRow );
     188#endif
    182189  Void  xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool acrossSlice = true, Int numLCUInWidth= -1, Int numLCUInHeight= -1);
    183190  Void  parseAlfParamSet(AlfParamSet* pAlfParamSet, Int firstLCUAddr, Bool alfAcrossSlice);
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r332 r443  
    5454  m_ppcYuvResi = NULL;
    5555  m_ppcYuvReco = NULL;
    56 #if H3D_IVRP
     56#if H3D_IVRP & !QC_ARP_D0177
    5757  m_ppcYuvResPred = NULL;
    5858#endif
     
    8282  m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1];
    8383  m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
    84 #if H3D_IVRP
     84#if H3D_IVRP & !QC_ARP_D0177
    8585  m_ppcYuvResPred = new TComYuv*   [m_uiMaxDepth-1];
    8686#endif
     
    9696    m_ppcYuvResi[ui] = new TComYuv;    m_ppcYuvResi[ui]->create( uiWidth, uiHeight );
    9797    m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight );
    98 #if H3D_IVRP
     98#if H3D_IVRP & !QC_ARP_D0177
    9999    m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
    100100#endif
     
    120120    m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL;
    121121    m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
    122 #if H3D_IVRP
     122#if H3D_IVRP & !QC_ARP_D0177
    123123    m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
    124124#endif
     
    128128  delete [] m_ppcYuvResi; m_ppcYuvResi = NULL;
    129129  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
    130 #if H3D_IVRP
     130#if H3D_IVRP & !QC_ARP_D0177
    131131  delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
    132132#endif
     
    312312    pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
    313313  }
    314 
     314#if QC_CU_NBDV_D0181
     315      DisInfo DvInfo;
     316      DvInfo.bDV = false;
     317      if(!pcCU->getSlice()->isIntra())
     318      {
     319#if QC_ARP_D0177
     320        if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getUseAdvRP())             && pcCU->getSlice()->getViewId())
     321#else
     322        if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getMultiviewResPredMode()) && pcCU->getSlice()->getViewId())
     323#endif
     324        { 
     325          m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true );
     326          m_ppcCU[uiDepth]->copyDVInfoFrom( pcCU, uiAbsPartIdx);
     327          PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0);
     328          UChar cWidTemp     = m_ppcCU[uiDepth]->getWidth(0);
     329          UChar cHeightTemp  = m_ppcCU[uiDepth]->getHeight(0);
     330          m_ppcCU[uiDepth]->setWidth  ( 0, pcCU->getSlice()->getSPS()->getMaxCUWidth ()/(1<<uiDepth)  );
     331          m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth)  );
     332          m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );     
     333  #if MERL_VSP_C0152
     334          DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(0, 0, &DvInfo, false, true);
     335  #else
     336          DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(0, 0, &DvInfo, false);
     337  #endif
     338          pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth);
     339          m_ppcCU[uiDepth]->setPartSizeSubParts( ePartTemp, 0, uiDepth );
     340          m_ppcCU[uiDepth]->setWidth  ( 0, cWidTemp );
     341          m_ppcCU[uiDepth]->setHeight ( 0, cHeightTemp );
     342        }
     343        if(DvInfo.bDV==false)
     344        {
     345          DvInfo.iN=1;
     346#if !SEC_DEFAULT_DV_D0112
     347          DvInfo.m_acMvCand[0].setHor(0);
     348          DvInfo.m_acMvCand[0].setVer(0);
     349          DvInfo.m_aVIdxCan[0] = 0;
     350#endif
     351          pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth);
     352        }
     353      }
     354#endif
    315355  // decode CU mode and the partition size
    316356  if( !pcCU->getSlice()->isIntra() && pcCU->getNumSucIPCM() == 0 )
     
    353393        const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) );
    354394#if MERL_VSP_C0152
    355         Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui);
    356         pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
     395        Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui );
     396        pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx );
     397#endif
     398#if MERL_VSP_NBDV_RefVId_Fix_D0166
     399        Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui );
     400        pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir );
    357401#endif
    358402        pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP );
     
    371415    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    372416#if MERL_VSP_C0152
     417#if LGE_VSP_INHERIT_D0092
     418    Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];
     419    for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
     420    {
     421        iVSPIndexTrue[i] = 0;
     422    }
     423#else
    373424    Int iVSPIndexTrue[3] = {-1, -1, -1};
     425#endif
     426#if MERL_VSP_NBDV_RefVId_Fix_D0166
     427    Int iVSPDirTrue[3]   = {-1, -1, -1};
     428    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex );
     429#else
    374430    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
     431#endif
     432#if MTK_D0156
     433    if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
     434    {
     435        pcCU->setVSPIndexSubParts( 0, uiAbsPartIdx, 0, uiDepth );
     436    }
     437    else
     438#endif
    375439    {
    376440      Int iVSPIdx = 0;
     441#if LGE_VSP_INHERIT_D0092
     442      if (iVSPIndexTrue[uiMergeIndex] == 1)
     443      {
     444          iVSPIdx = 1;
     445      }
     446#else
    377447      Int numVspIdx;
    378448      numVspIdx = 3;
     
    385455          }
    386456      }
    387       pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth );  //Initialize the VSP, may change later in get InterMergeCandidates()
     457#endif
     458      pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth );  // Initialize
     459#if MERL_VSP_NBDV_RefVId_Fix_D0166
     460      pcCU->setVSPDirSubParts( 0, uiAbsPartIdx, 0, uiDepth );
     461#endif
     462#if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
     463      if(iVSPIdx != 0)
     464      {
     465        Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
     466       cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx);
     467      }
     468#endif
    388469    }
    389470#else
     
    409490    }
    410491#endif
     492#if QC_ARP_D0177
     493    if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
     494    {
     495      pcCU->setResPredAvailSubParts ( false, uiAbsPartIdx, 0, uiDepth );
     496      pcCU->setResPredFlagSubParts  ( false, uiAbsPartIdx, 0, uiDepth );
     497      m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth, m_ppcCU[uiDepth], 0 );
     498    }
     499#endif
    411500    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    412501    return;
     
    460549  }
    461550#endif
    462 
     551#if QC_ARP_D0177
     552  if (pcCU->getSlice()->getSPS()->getUseAdvRP() && pcCU->isIntra( uiAbsPartIdx ) )
     553  {
     554    pcCU->setResPredAvailSubParts ( 0, uiAbsPartIdx, 0, uiDepth );
     555    pcCU->setResPredFlagSubParts  ( 0, uiAbsPartIdx, 0, uiDepth );
     556  }
     557#endif
    463558#if HHI_MPI
    464559    if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth )
     
    476571        Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui);
    477572        pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
     573#endif
     574#if MERL_VSP_NBDV_RefVId_Fix_D0166
     575        if (pcCU->getSlice()->getIsDepth()) {
     576          pcCU->setVSPDir( uiAbsPartIdx + ui, 0);
     577        }
     578        else {
     579          Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui);
     580          pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir);
     581        }
    478582#endif
    479583        pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER );
     
    670774  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    671775#endif
    672 #if H3D_IVRP
     776#if H3D_IVRP & !QC_ARP_D0177
    673777  if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
    674778  {
     
    10321136  // reconstruct residual based on mask + DC residuals
    10331137  Pel apDCResiValues[2];
     1138#if !MERL_General_Fix
    10341139  Pel apDCRecoValues[2];
     1140#endif
    10351141  for( UInt ui = 0; ui < uiNumSegments; ui++ )
    10361142  {
     
    10391145    Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
    10401146   
     1147#if !MERL_General_Fix
    10411148    apDCRecoValues[ui]  = pRecoValue;
     1149#endif
    10421150    apDCResiValues[ui]  = pRecoValue - apDCPredValues[ui];
    10431151  }
     
    10561164      UChar ucSegment = pMask?(UChar)pMask[uiX]:0;
    10571165      assert( ucSegment < uiNumSegments );
     1166#if MTK_SAMPLE_BASED_SDC_D0110     
     1167      Pel pResiDC = apDCResiValues[ucSegment];
    10581168     
     1169      pReco    [ uiX ] = Clip( pPred[ uiX ] + pResiDC );
     1170#else
    10591171      Pel pPredVal= apDCPredValues[ucSegment];
    10601172      Pel pResiDC = apDCResiValues[ucSegment];
    10611173     
    10621174      pReco    [ uiX ] = Clip( pPredVal + pResiDC );
     1175#endif
    10631176      pRecIPred[ uiX ] = pReco[ uiX ];
    10641177    }
  • trunk/source/Lib/TLibDecoder/TDecCu.h

    r296 r443  
    6161  TComYuv**           m_ppcYuvResi;       ///< array of residual buffer
    6262  TComYuv**           m_ppcYuvReco;       ///< array of prediction & reconstruction buffer
    63 #if H3D_IVRP
     63#if H3D_IVRP & !QC_ARP_D0177
    6464  TComYuv**           m_ppcYuvResPred;    ///< residual prediction buffer
    6565#endif
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r332 r443  
    108108}
    109109
     110#if QC_ARP_D0177
     111Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
     112{
     113  if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() )
     114    return;
     115  assert( !pcCU->isIntra( uiAbsPartIdx ) );
     116  Bool bResPredAvailable = !pcCU->getSlice()->getARPStepNum() ? false: ((pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)) ? true: false);
     117  if(!bResPredAvailable)
     118    pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 
     119  else
     120    m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth );
     121}
     122#endif
    110123Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    111124{
     
    117130  m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
    118131 
     132#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    119133#if RWTH_SDC_DLT_B0036
    120134  // if B-Slice, code SDC flag later
     
    125139  }
    126140#endif
     141#endif
    127142}
    128143
    129144Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    130145{
     146#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    131147#if RWTH_SDC_DLT_B0036
    132148  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
     
    137153  }
    138154#endif
     155#endif
    139156 
    140157  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
    141158 
     159#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    142160#if RWTH_SDC_DLT_B0036
    143161  if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
     
    154172  }
    155173#endif
     174#endif
    156175}
    157176
    158177Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
    159178{
     179#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    160180#if RWTH_SDC_DLT_B0036
    161181  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     
    164184    return;
    165185  }
     186#endif
    166187#endif
    167188 
     
    178199      decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 );
    179200      decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 );
     201#if PKU_QC_DEPTH_INTRA_UNI_D0195
     202      if(!pcCU->getSDCFlag(uiAbsPartIdx))
     203#endif
    180204      decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
    181205    }
     
    183207    {
    184208      decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
     209#if PKU_QC_DEPTH_INTRA_UNI_D0195
     210      if(!pcCU->getSDCFlag(uiAbsPartIdx))
     211#endif
    185212      decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
    186213    }
     
    189216  {
    190217    decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU );
     218#if QC_ARP_D0177
     219    if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
     220    {
     221      decodeARPW( pcCU , uiAbsPartIdx , uiDepth, pcSubCU, 0  );
     222    }
     223#endif
    191224  }
    192225}
     
    301334      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    302335#if MERL_VSP_C0152
     336#if LGE_VSP_INHERIT_D0092
     337      Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];
     338      for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
     339      {
     340          iVSPIndexTrue[i] = 0;
     341      }
     342#else
    303343      Int iVSPIndexTrue[3] = {-1, -1, -1};
     344#endif
     345#if MERL_VSP_NBDV_RefVId_Fix_D0166
     346      Int iVSPDirTrue[3]   = {-1, -1, -1};
     347      pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex );
     348#else
    304349      pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
    305 
     350#endif
    306351#if HHI_MPI
    307352      if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used
     
    311356        for( UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    312357        {
    313           Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui);
     358          Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui );
    314359          pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
     360#if MERL_VSP_NBDV_RefVId_Fix_D0166
     361          Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui );
     362          pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir);
     363#endif
    315364        }
    316365      }
    317366      else // MPI not used
    318367#endif
     368#if MTK_D0156
     369          if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
     370          {
     371              pcCU->setVSPIndexSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth );
     372          }
     373          else
     374#endif
    319375      {
    320376        Int iVSPIdx = 0;
     377#if LGE_VSP_INHERIT_D0092
     378        if (iVSPIndexTrue[uiMergeIndex] == 1)
     379        {
     380            iVSPIdx = 1;
     381        }
     382#else
    321383        Int numVspIdx;
    322384        numVspIdx = 3;
     
    329391            }
    330392        }
    331         pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth );  //Initialize the VSP, may change later in get InterMergeCandidates()
     393#endif
     394        pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth );               // Initialize
     395#if MERL_VSP_NBDV_RefVId_Fix_D0166
     396        pcCU->setVSPDirSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth );  // Initialize
     397#endif
     398#if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
     399       if(iVSPIdx != 0)
     400       {
     401         Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
     402         cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx);
     403       }
     404#endif
    332405      }
    333406
     
    479552  {
    480553#if H3D_IVMP
     554#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     555    const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
     556#else
    481557    const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     558#endif
    482559    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands );
    483560#else
     
    789866    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    790867    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    791    
     868#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    792869    decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
     870#endif
    793871    return;
    794872  }
     
    847925
    848926#if RWTH_SDC_DLT_B0036
     927#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    849928Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    850929{
     
    861940  m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
    862941}
    863 
     942#endif
    864943Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    865944{
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r332 r443  
    106106  virtual Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    107107#endif
     108#if QC_ARP_D0177
     109  virtual Void parseARPW         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     110#endif
    108111  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    109112  virtual Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    137140 
    138141#if RWTH_SDC_DLT_B0036
     142#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    139143  virtual Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    140144  virtual Void parseSDCPredMode     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     145#endif
    141146  virtual Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
    142147#endif
     
    198203  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    199204  Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
     205#if QC_ARP_D0177
     206  Void decodeARPW              ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
     207#endif
    200208  Void decodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    201209  Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    225233  Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyDecoderIf->setSliceGranularity(iSliceGranularity);}
    226234
     235#if !LGE_SAO_MIGRATION_D0091
    227236  Void decodeSaoParam         (SAOParam* saoParam);
    228237  void decodeSaoLcu(Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool &repeatedRow );
    229238  Void decodeSaoOneLcu(SaoLcuParam* saoLcuParam);
     239#endif
    230240
    231241  Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); }
    232242 
    233243#if RWTH_SDC_DLT_B0036
     244#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    234245  Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    235246  Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     247#endif
    236248  Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    237249#endif
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r296 r443  
    9393                   ,TComDepthMapGenerator*  pcDepthMapGenerator
    9494#endif
    95 #if H3D_IVRP
     95#if H3D_IVRP & !QC_ARP_D0177
    9696                  ,TComResidualGenerator*  pcResidualGenerator
    9797#endif
     
    109109  m_pcDepthMapGenerator   = pcDepthMapGenerator;
    110110#endif
    111 #if H3D_IVRP
     111#if H3D_IVRP & !QC_ARP_D0177
    112112  m_pcResidualGenerator   = pcResidualGenerator;
    113113#endif
     
    298298      m_pcDepthMapGenerator->predictDepthMap  ( rpcPic );
    299299#endif
    300 #if H3D_IVRP
     300#if H3D_IVRP & !QC_ARP_D0177
    301301      m_pcResidualGenerator->initViewComponent( rpcPic );
    302302#endif
     
    331331  else
    332332  {
    333 #if H3D_IVRP
     333#if H3D_IVRP & !QC_ARP_D0177
    334334    // set residual picture
    335335    m_pcResidualGenerator->setRecResidualPic( rpcPic );
     
    372372    if( pcSlice->getSPS()->getUseSAO() )
    373373    {
     374#if LGE_SAO_MIGRATION_D0091
     375        if(pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma())
     376        {
     377            SAOParam *saoParam = pcSlice->getAPS()->getSaoParam();
     378            saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
     379            saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
     380            m_pcSAO->setSaoLcuBasedOptimization(1);
     381            m_pcSAO->createPicSaoInfo(rpcPic, m_uiILSliceCount);
     382            m_pcSAO->SAOProcess(rpcPic, saoParam);
     383            m_pcSAO->PCMLFDisableProcess(rpcPic);
     384            m_pcSAO->destroyPicSaoInfo();
     385        }
     386#else
    374387      if(pcSlice->getSaoEnabledFlag())
    375388      {
     
    388401        m_pcSAO->destroyPicSaoInfo();
    389402      }
     403#endif
    390404    }
    391405
  • trunk/source/Lib/TLibDecoder/TDecGop.h

    r296 r443  
    9090  TComDepthMapGenerator*  m_pcDepthMapGenerator;
    9191#endif
    92 #if H3D_IVRP
     92#if H3D_IVRP & !QC_ARP_D0177
    9393  TComResidualGenerator*  m_pcResidualGenerator;
    9494#endif
     
    118118                 ,TComDepthMapGenerator*  pcDepthMapGenerator
    119119#endif
    120 #if H3D_IVRP
     120#if H3D_IVRP & !QC_ARP_D0177
    121121                ,TComResidualGenerator*  pcResidualGenerator
    122122#endif
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r332 r443  
    3838#include "TDecSbac.h"
    3939
    40 #if RWTH_SDC_DLT_B0036
    41 #define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
    42 #define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
    43 #endif
    44 
    4540//! \ingroup TLibDecoder
    4641//! \{
     
    6459#if H3D_IVRP
    6560, m_cResPredFlagSCModel       ( 1,             1,               NUM_RES_PRED_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     61#endif
     62#if QC_ARP_D0177
     63, m_cCUPUARPW                 ( 1,             1,               NUM_ARPW_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
    6664#endif
    6765, m_cCUPartSizeSCModel        ( 1,             1,               NUM_PART_SIZE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    8886, m_cALFSvlcSCModel           ( 1,             1,               NUM_ALF_SVLC_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    8987, m_cCUAMPSCModel             ( 1,             1,               NUM_CU_AMP_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
     88#if LGE_SAO_MIGRATION_D0091
     89, m_cSaoMergeSCModel          ( 1,             1,               NUM_SAO_MERGE_FLAG_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
     90, m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
     91#else
    9092, m_cSaoFlagSCModel           ( 1,             1,               NUM_SAO_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9193, m_cSaoUvlcSCModel           ( 1,             1,               NUM_SAO_UVLC_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     
    9496, m_cSaoMergeUpSCModel        ( 1,             1,               NUM_SAO_MERGE_UP_FLAG_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
    9597, m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
     98#endif
    9699#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     100#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    97101, m_cDmmFlagSCModel           ( 1,             1,               NUM_DMM_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    98102, m_cDmmModeSCModel           ( 1,             1,               NUM_DMM_MODE_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     103#endif
    99104, m_cDmmDataSCModel           ( 1,             1,               NUM_DMM_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    100105#endif
     
    106111#endif
    107112#if RWTH_SDC_DLT_B0036
     113#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    108114, m_cSDCFlagSCModel             ( 1,             1,                 SDC_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     115#else
     116, m_cDepthModeModel             ( 1,             1,                 DEPTH_MODE_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     117, m_cDmmDeltaFlagModel             ( 1,             1,                 DMM_DELTA_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     118#endif
     119#if RWTH_SDC_CTX_SIMPL_D0032
     120, m_cSDCResidualFlagSCModel     ( 1,             1,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
     121, m_cSDCResidualSCModel         ( 1,             1,  SDC_NUM_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     122, m_cSDCPredModeSCModel             ( 1,             3,                 SDC_NUM_PRED_MODE_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
     123#else
    109124, m_cSDCResidualFlagSCModel     ( 1,             2,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
    110125, m_cSDCResidualSignFlagSCModel ( 1,             2,  SDC_NUM_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
    111126, m_cSDCResidualSCModel         ( 1,             2,  SDC_NUM_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
    112127, m_cSDCPredModeSCModel             ( 1,             3,                 SDC_NUM_PRED_MODE_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
     128#endif
    113129#endif
    114130{
     
    161177#if H3D_IVRP
    162178  m_cResPredFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_RES_PRED_FLAG );
     179#endif
     180#if QC_ARP_D0177
     181  m_cCUPUARPW.initBuffer                ( sliceType, qp, (UChar*)INIT_ARPW );
    163182#endif
    164183  m_cCUAlfCtrlFlagSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG );
     
    184203  m_cALFUvlcSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_ALF_UVLC );
    185204  m_cALFSvlcSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_ALF_SVLC );
     205#if LGE_SAO_MIGRATION_D0091
     206  m_cSaoMergeSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_SAO_MERGE_FLAG );
     207  m_cSaoTypeIdxSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX );
     208#else
    186209  m_cSaoFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_SAO_FLAG );
    187210  m_cSaoUvlcSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_SAO_UVLC );
     
    190213  m_cSaoMergeUpSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SAO_MERGE_UP_FLAG );
    191214  m_cSaoTypeIdxSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX );
     215#endif
    192216
    193217  m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
     
    200224  m_uiLastDQpNonZero  = 0;
    201225#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     226#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    202227  m_cDmmFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_FLAG );
    203228  m_cDmmModeSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_MODE );
     229#endif
    204230  m_cDmmDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_DATA );
    205231#endif
    206232#if RWTH_SDC_DLT_B0036
     233#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    207234  m_cSDCFlagSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
     235#else
     236  m_cDepthModeModel.initBuffer              ( sliceType, qp, (UChar*)INIT_DEPTHMODE_FLAG );
     237  m_cDmmDeltaFlagModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMMDELTA_FLAG );
     238#endif
    208239  m_cSDCResidualFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
    209240  m_cSDCResidualSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );
     241#if !RWTH_SDC_CTX_SIMPL_D0032
    210242  m_cSDCResidualSignFlagSCModel.initBuffer  ( sliceType, qp, (UChar*)INIT_SDC_SIGN_FLAG );
     243#endif
    211244  m_cSDCPredModeSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_PRED_MODE );
    212245#endif
     
    248281#if H3D_IVRP
    249282  m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
     283#endif
     284#if QC_ARP_D0177
     285  m_cCUPUARPW.initBuffer                 ( eSliceType, iQp, (UChar*)INIT_ARPW );
    250286#endif
    251287  m_cCUAlfCtrlFlagSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );
     
    271307  m_cALFUvlcSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_ALF_UVLC );
    272308  m_cALFSvlcSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_ALF_SVLC );
     309#if LGE_SAO_MIGRATION_D0091
     310  m_cSaoMergeSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_FLAG );
     311  m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
     312#else
    273313  m_cSaoFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_SAO_FLAG );
    274314  m_cSaoUvlcSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_SAO_UVLC );
     
    277317  m_cSaoMergeUpSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_UP_FLAG );
    278318  m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
     319#endif
    279320  m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
    280321#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     322#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    281323  m_cDmmFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG );
    282324  m_cDmmModeSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_MODE );
     325#endif
    283326  m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
    284327#endif
    285328#if RWTH_SDC_DLT_B0036
     329#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    286330  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
     331#else
     332  m_cDepthModeModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG );
     333  m_cDmmDeltaFlagModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG );
     334#endif
    287335  m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
    288336  m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
     337#if !RWTH_SDC_CTX_SIMPL_D0032
    289338  m_cSDCResidualSignFlagSCModel.initBuffer  ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG );
     339#endif
    290340  m_cSDCPredModeSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE );
    291341#endif
     
    869919  pcCU->setPredModeSubParts( (PredMode)iPredMode, uiAbsPartIdx, uiDepth );
    870920}
    871  
     921#if PKU_QC_DEPTH_INTRA_UNI_D0195
     922Void TDecSbac::parseDepthIntraMode  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     923{
     924  UInt uiPuIdx = ( pcCU->getWidth(uiAbsPartIdx) == 64 )? 2 : ( ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && pcCU->getWidth(uiAbsPartIdx) == 8 )? 0 : 1);
     925  UInt uiDir = 0;
     926  Bool bSDCFlag = 0;
     927  UInt uiSymbol = 1;
     928  UInt uiCode = 0 ;
     929  UInt uiBinNum = 0;
     930  UInt uiCtxDepthMode = 0;
     931  if ( uiPuIdx ==2 )
     932  {
     933    while(uiBinNum<2 && uiSymbol)
     934    {
     935      uiCtxDepthMode = uiPuIdx*3 + uiBinNum;
     936      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     937      uiCode = (uiCode<<1)+uiSymbol;
     938      uiBinNum++;
     939    }
     940    if (uiCode == 0)      { uiDir = PLANAR_IDX; bSDCFlag = 1;}
     941    else if (uiCode == 2) { uiDir = 0;          bSDCFlag = 0;}
     942    else if (uiCode == 3) { uiDir = DC_IDX;     bSDCFlag = 1;}
     943  }
     944  else if ( uiPuIdx ==0 )
     945  {
     946    while(uiBinNum<3 && uiSymbol)
     947    {
     948      uiCtxDepthMode = uiPuIdx*3 + ( uiBinNum >= 2? 2 : uiBinNum );
     949      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     950      uiCode = (uiCode<<1)+uiSymbol;
     951      uiBinNum++;
     952    }
     953    if (uiCode == 0)      { uiDir = 0;                     bSDCFlag = 0;}
     954    else if (uiCode == 2) { uiDir = DMM_WEDGE_FULL_IDX;    bSDCFlag = 0;}
     955    else if (uiCode == 6) { uiDir = DMM_WEDGE_PREDTEX_IDX; bSDCFlag = 0;}
     956    else if (uiCode == 7) { uiDir = EDGE_INTRA_IDX;        bSDCFlag = 0;}
     957  }
     958  else
     959  {
     960    uiCtxDepthMode = uiPuIdx*3 ;
     961    m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     962    uiCode = (uiCode<<1)+uiSymbol;
     963    if (!uiSymbol)
     964    {
     965      uiCtxDepthMode = uiPuIdx*3 + 1;
     966      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     967      uiCode = (uiCode<<1)+uiSymbol;
     968      if (uiSymbol)
     969      {
     970        uiCtxDepthMode = uiPuIdx*3 + 2;
     971        m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     972        uiCode = (uiCode<<1)+uiSymbol;
     973      }
     974    }
     975    else
     976    {
     977      uiCtxDepthMode = uiPuIdx*3 + 1;
     978      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     979      uiCode = (uiCode<<1)+uiSymbol;
     980      if (!uiSymbol)
     981      {
     982        uiCtxDepthMode = uiPuIdx*3 + 2;
     983        m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     984        uiCode = (uiCode<<1)+uiSymbol;
     985      }
     986      else
     987      {
     988        uiBinNum = 0;
     989        while( uiSymbol && uiBinNum<3 )
     990        {
     991          uiCtxDepthMode = uiPuIdx*3 + 2;
     992          m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
     993          uiCode = (uiCode<<1)+uiSymbol;
     994          uiBinNum++;
     995        }
     996      }
     997    }
     998    if (uiCode == 0)       { uiDir = PLANAR_IDX;              bSDCFlag = 1;}
     999    else if (uiCode == 2)  { uiDir = 5;                       bSDCFlag = 0;}
     1000    else if (uiCode == 3)  { uiDir = DMM_WEDGE_FULL_IDX;      bSDCFlag = 1;}
     1001    else if (uiCode == 4)  { uiDir = DMM_WEDGE_FULL_IDX;      bSDCFlag = 0;}
     1002    else if (uiCode == 5)  { uiDir = DMM_CONTOUR_PREDTEX_IDX; bSDCFlag = 0;}
     1003    else if (uiCode == 6)  { uiDir = DMM_WEDGE_PREDTEX_IDX;   bSDCFlag = 0;}
     1004    else if (uiCode == 14) { uiDir = DC_IDX;                  bSDCFlag = 1;}
     1005    else if (uiCode == 31) { uiDir = DMM_WEDGE_PREDDIR_IDX;   bSDCFlag = 0;}
     1006    else if (uiCode == 30) { uiDir = EDGE_INTRA_IDX;          bSDCFlag = 0;}
     1007  }
     1008  pcCU->setLumaIntraDirSubParts( (UChar)uiDir, uiAbsPartIdx, uiDepth );
     1009  pcCU->setSDCFlagSubParts(bSDCFlag, uiAbsPartIdx, 0, uiDepth);
     1010}
     1011Void TDecSbac::parseDepthModelingTable  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1012{
     1013  parseDepthIntraMode(pcCU,uiAbsPartIdx,uiDepth);
     1014 
     1015  UInt uiDir = pcCU->getLumaIntraDir(uiAbsPartIdx);
     1016  Bool bSdcFlag =  pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx);
     1017  Bool bDmmFlag = (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX &&(!bSdcFlag))? 1:0;
     1018  if (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX)//DMM modes and SDC DMM1
     1019  {
     1020    if( uiDir == DMM_WEDGE_FULL_IDX )          { xParseWedgeFullInfo          ( pcCU, uiAbsPartIdx, uiDepth ); }
     1021    else if( uiDir == DMM_WEDGE_PREDTEX_IDX )  { xParseWedgePredTexInfo       ( pcCU, uiAbsPartIdx, uiDepth ); }
     1022    else if( uiDir == DMM_WEDGE_PREDDIR_IDX )  { xParseWedgePredDirInfo       ( pcCU, uiAbsPartIdx, uiDepth ); }
     1023  }
     1024  else if(uiDir >= EDGE_INTRA_IDX)//CCM mode
     1025  {
     1026    xParseEdgeIntraInfo( pcCU, uiAbsPartIdx, uiDepth );
     1027  }
     1028 
     1029  UInt uiSymbol;
     1030  if (bDmmFlag)
     1031  {
     1032    if (bDmmFlag)
     1033    {
     1034      m_pcTDecBinIf->decodeBin( uiSymbol , m_cDmmDeltaFlagModel.get(0, 0, 0) );
     1035      uiDir += uiSymbol;
     1036    }
     1037    if (uiSymbol)
     1038    {
     1039      UInt uiDC;
     1040      Int iDC = 0,iDC1 = 0,iDC2 = 0;
     1041      for ( Int i = 0; i  <2; i++ )
     1042      {
     1043        xReadExGolombLevel( uiDC, m_cDmmDataSCModel.get(0, 0, 1) );
     1044        iDC = uiDC;
     1045        if ( uiDC )
     1046        {
     1047          UInt uiSign;
     1048          m_pcTDecBinIf->decodeBinEP( uiSign );
     1049          if ( uiSign )
     1050          {
     1051            iDC = -iDC;
     1052          }
     1053        }
     1054        if ( i == 0 ) { iDC1 = iDC; }
     1055        else          { iDC2 = iDC; }
     1056      }
     1057
     1058      if( uiDir == DMM_WEDGE_FULL_D_IDX )   
     1059      {
     1060        pcCU->setWedgeFullDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
     1061        pcCU->setWedgeFullDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
     1062      }
     1063      else if( uiDir == DMM_WEDGE_PREDDIR_D_IDX )
     1064      {
     1065        pcCU->setWedgePredDirDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
     1066        pcCU->setWedgePredDirDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
     1067      }
     1068      else if( uiDir == DMM_WEDGE_PREDTEX_D_IDX) 
     1069      {
     1070        pcCU->setWedgePredTexDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
     1071        pcCU->setWedgePredTexDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
     1072      }
     1073      else if (uiDir== DMM_CONTOUR_PREDTEX_D_IDX )
     1074      {
     1075        pcCU->setContourPredTexDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
     1076        pcCU->setContourPredTexDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
     1077      }
     1078    }
     1079  }
     1080  else if (uiDir >= EDGE_INTRA_IDX)
     1081  {
     1082    m_pcTDecBinIf->decodeBin( uiSymbol, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) );
     1083    if( uiSymbol )
     1084    {
     1085      uiDir = EDGE_INTRA_DELTA_IDX;
     1086      Int iDeltaDC = 0,iDeltaDC0 = 0,iDeltaDC1 = 0;
     1087      for (Int i = 0; i<2; i++)
     1088      {
     1089        xReadExGolombLevel( (UInt &) iDeltaDC, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) );
     1090        if( iDeltaDC != 0 )
     1091        {
     1092          UInt uiSign;
     1093          m_pcTDecBinIf->decodeBinEP( uiSign );
     1094          if ( uiSign )
     1095          {
     1096            iDeltaDC = -iDeltaDC;
     1097          }
     1098        }
     1099        if ( i == 0 ) { iDeltaDC0 = iDeltaDC; }
     1100        else          { iDeltaDC1 = iDeltaDC; }
     1101      }
     1102
     1103      pcCU->setEdgeDeltaDC0( uiAbsPartIdx, iDeltaDC0 );
     1104      pcCU->setEdgeDeltaDC1( uiAbsPartIdx, iDeltaDC1 );
     1105    }
     1106  }
     1107  else if(bSdcFlag)//SDC mode
     1108  {
     1109    assert(pcCU->getPartitionSize(uiAbsPartIdx)!=SIZE_NxN);
     1110    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
     1111    pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth);
     1112
     1113    UInt uiNumSegments = ( uiDir == DC_IDX || uiDir == PLANAR_IDX )? 1 : 2;
     1114    for (int uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
     1115    {
     1116      parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
     1117    }
     1118  }
     1119
     1120  pcCU->setLumaIntraDirSubParts( (UChar)uiDir, uiAbsPartIdx, uiDepth );
     1121}
     1122#endif
    8721123Void TDecSbac::parseIntraDirLumaAng  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    8731124{
    8741125  UInt uiSymbol;
    8751126  Int  intraPredMode;
    876 
     1127#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1128  if (pcCU->getSlice()->getSPS()->isDepth())
     1129  {
     1130    parseDepthModelingTable(pcCU, uiAbsPartIdx, uiDepth);
     1131  }
     1132  if (pcCU->getLumaIntraDir(uiAbsPartIdx)<NUM_INTRA_MODE && !pcCU->getSDCFlag(uiAbsPartIdx))
     1133  {
     1134#else
    8771135#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    8781136  UInt uiFlag = 0;
     
    9281186    }
    9291187#endif
    930 
     1188#endif
    9311189    Int uiPreds[3] = {-1, -1, -1};
    9321190    Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 
     1191#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    9331192#if LGE_EDGE_INTRA_A0070
    9341193    UInt uiCheckBit = 0;
    9351194#endif
     1195#endif
    9361196
    9371197    m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUIntraPredSCModel.get( 0, 0, 0) );
     
    9531213
    9541214      m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 );
     1215#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    9551216#if LGE_EDGE_INTRA_A0070
    9561217      if (bCodeEdgeIntra)
     
    9631224        }
    9641225      }
     1226#endif
    9651227#endif
    9661228      intraPredMode = uiSymbol;
     
    9791241        std::swap(uiPreds[1], uiPreds[2]);
    9801242      }
     1243#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    9811244#if LGE_EDGE_INTRA_A0070
    9821245      if ( intraPredMode != EDGE_INTRA_IDX)
    9831246      {
    9841247#endif
     1248#endif
    9851249        for ( Int i = 0; i < uiPredNum; i++ )
    9861250        {
    9871251          intraPredMode += ( intraPredMode >= uiPreds[i] );
    9881252        }
     1253#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    9891254#if LGE_EDGE_INTRA_A0070
    9901255      }
    9911256#endif
    992     }
    993 
     1257#endif
     1258    }
     1259
     1260#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    9941261#if LGE_EDGE_INTRA_A0070
    9951262    if( intraPredMode == EDGE_INTRA_IDX )
     
    10351302  }
    10361303#endif
    1037 
    10381304  pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth );
     1305#else
     1306  pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth );
     1307}
     1308#endif
    10391309}
    10401310
     
    16721942}
    16731943
    1674 
     1944#if LGE_SAO_MIGRATION_D0091
     1945Void TDecSbac::parseSaoMaxUvlc ( UInt& val, UInt maxSymbol )
     1946{
     1947    if (maxSymbol == 0)
     1948    {
     1949        val = 0;
     1950        return;
     1951    }
     1952
     1953    UInt code;
     1954    Int  i;
     1955    m_pcTDecBinIf->decodeBinEP( code );
     1956    if ( code == 0 )
     1957    {
     1958        val = 0;
     1959        return;
     1960    }
     1961
     1962    i=1;
     1963    while (1)
     1964    {
     1965        m_pcTDecBinIf->decodeBinEP( code );
     1966        if ( code == 0 )
     1967        {
     1968            break;
     1969        }
     1970        i++;
     1971        if (i == maxSymbol)
     1972        {
     1973            break;
     1974        }
     1975    }   
     1976
     1977    val = i;
     1978}
     1979
     1980Void TDecSbac::parseSaoUflc (UInt uiLength, UInt&  riVal)
     1981{
     1982    m_pcTDecBinIf->decodeBinsEP ( riVal, uiLength );
     1983}
     1984
     1985Void TDecSbac::parseSaoMerge (UInt&  ruiVal)
     1986{
     1987    UInt uiCode;
     1988    m_pcTDecBinIf->decodeBin( uiCode, m_cSaoMergeSCModel.get( 0, 0, 0 ) );
     1989    ruiVal = (Int)uiCode;
     1990}
     1991
     1992Void TDecSbac::parseSaoTypeIdx (UInt&  ruiVal)
     1993{
     1994    UInt uiCode;
     1995    m_pcTDecBinIf->decodeBin( uiCode, m_cSaoTypeIdxSCModel.get( 0, 0, 0 ) );
     1996    if (uiCode == 0)
     1997    {
     1998        ruiVal = 0;
     1999    }
     2000    else
     2001    {
     2002        m_pcTDecBinIf->decodeBinEP( uiCode );
     2003        if (uiCode == 0)
     2004        {
     2005            ruiVal = 5;
     2006        }
     2007        else
     2008        {
     2009            ruiVal = 1;
     2010        }
     2011    }
     2012}
     2013
     2014inline Void copySaoOneLcuParam(SaoLcuParam* psDst,  SaoLcuParam* psSrc)
     2015{
     2016    Int i;
     2017    psDst->partIdx = psSrc->partIdx;
     2018    psDst->typeIdx = psSrc->typeIdx;
     2019    if (psDst->typeIdx != -1)
     2020    {
     2021        psDst->subTypeIdx = psSrc->subTypeIdx ;
     2022        psDst->length  = psSrc->length;
     2023        for (i=0;i<psDst->length;i++)
     2024        {
     2025            psDst->offset[i] = psSrc->offset[i];
     2026        }
     2027    }
     2028    else
     2029    {
     2030        psDst->length  = 0;
     2031        for (i=0;i<SAO_BO_LEN;i++)
     2032        {
     2033            psDst->offset[i] = 0;
     2034        }
     2035    }
     2036}
     2037
     2038Void TDecSbac::parseSaoOffset(SaoLcuParam* psSaoLcuParam, UInt compIdx)
     2039{
     2040    UInt uiSymbol;
     2041    static Int iTypeLength[MAX_NUM_SAO_TYPE] =
     2042    {
     2043        SAO_EO_LEN,
     2044        SAO_EO_LEN,
     2045        SAO_EO_LEN,
     2046        SAO_EO_LEN,
     2047        SAO_BO_LEN
     2048    };
     2049
     2050    if (compIdx==2)
     2051    {
     2052        uiSymbol = (UInt)( psSaoLcuParam->typeIdx + 1);
     2053    }
     2054    else
     2055    {
     2056        parseSaoTypeIdx(uiSymbol);
     2057    }
     2058    psSaoLcuParam->typeIdx = (Int)uiSymbol - 1;
     2059
     2060    if (uiSymbol)
     2061    {
     2062        psSaoLcuParam->length = iTypeLength[psSaoLcuParam->typeIdx];
     2063#if FULL_NBIT
     2064        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + (g_uiBitDepth-8)-5),5) );
     2065#else
     2066        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + g_uiBitIncrement-5),5) );
     2067#endif
     2068
     2069        if( psSaoLcuParam->typeIdx == SAO_BO )
     2070        {
     2071            for(Int i=0; i< psSaoLcuParam->length; i++)
     2072            {
     2073                parseSaoMaxUvlc(uiSymbol, offsetTh -1 );
     2074                psSaoLcuParam->offset[i] = uiSymbol;
     2075            }   
     2076            for(Int i=0; i< psSaoLcuParam->length; i++)
     2077            {
     2078                if (psSaoLcuParam->offset[i] != 0)
     2079                {
     2080                    m_pcTDecBinIf->decodeBinEP ( uiSymbol);
     2081                    if (uiSymbol)
     2082                    {
     2083                        psSaoLcuParam->offset[i] = -psSaoLcuParam->offset[i] ;
     2084                    }
     2085                }
     2086            }
     2087            parseSaoUflc(5, uiSymbol );
     2088            psSaoLcuParam->subTypeIdx = uiSymbol;
     2089        }
     2090        else if( psSaoLcuParam->typeIdx < 4 )
     2091        {
     2092            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[0] = uiSymbol;   
     2093            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[1] = uiSymbol;
     2094            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[2] = -(Int)uiSymbol;
     2095            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[3] = -(Int)uiSymbol;
     2096            if (compIdx != 2)
     2097            {
     2098                parseSaoUflc(2, uiSymbol );
     2099                psSaoLcuParam->subTypeIdx = uiSymbol;
     2100                psSaoLcuParam->typeIdx += psSaoLcuParam->subTypeIdx;
     2101            }
     2102        }
     2103    }
     2104    else
     2105    {
     2106        psSaoLcuParam->length = 0;
     2107    }
     2108}
     2109
     2110Void TDecSbac::parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp)
     2111{
     2112    Int iAddr = pcCU->getAddr();
     2113    UInt uiSymbol;
     2114
     2115    for (Int iCompIdx=0; iCompIdx<3; iCompIdx++)
     2116    {
     2117        pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag    = 0;
     2118        pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag  = 0;
     2119        pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx     = 0;
     2120        pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx        =-1;
     2121        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[0]      = 0;
     2122        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[1]      = 0;
     2123        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[2]      = 0;
     2124        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[3]      = 0;
     2125    }
     2126    if (pSaoParam->bSaoFlag[0] || pSaoParam->bSaoFlag[1] )
     2127    {
     2128        if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft)
     2129        {
     2130            parseSaoMerge(uiSymbol);
     2131            pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag = (Bool)uiSymbol; 
     2132        }
     2133        if (pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag==0)
     2134        {
     2135            if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp)
     2136            {
     2137                parseSaoMerge(uiSymbol);
     2138                pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag = (Bool)uiSymbol;
     2139            }
     2140        }
     2141    }
     2142
     2143    for (Int iCompIdx=0; iCompIdx<3; iCompIdx++)
     2144    {
     2145        if ((iCompIdx == 0  && pSaoParam->bSaoFlag[0]) || (iCompIdx > 0  && pSaoParam->bSaoFlag[1]) )
     2146        {
     2147            if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft)
     2148            {
     2149                pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag;
     2150            }
     2151            else
     2152            {
     2153                pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0;
     2154            }
     2155
     2156            if (pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag==0)
     2157            {
     2158                if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp)
     2159                {
     2160                    pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag;
     2161                }
     2162                else
     2163                {
     2164                    pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0;
     2165                }
     2166   
     2167                if (!pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag)
     2168                {
     2169                    pSaoParam->saoLcuParam[2][iAddr].typeIdx = pSaoParam->saoLcuParam[1][iAddr].typeIdx;
     2170                    parseSaoOffset(&(pSaoParam->saoLcuParam[iCompIdx][iAddr]), iCompIdx);
     2171                }
     2172                else
     2173                {
     2174                    copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr], &pSaoParam->saoLcuParam[iCompIdx][iAddr-pSaoParam->numCuInWidth]);
     2175                }
     2176            }
     2177            else
     2178            {
     2179                copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr],  &pSaoParam->saoLcuParam[iCompIdx][iAddr-1]);
     2180            }
     2181        }
     2182        else
     2183        {
     2184            pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx    = -1;
     2185            pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0;
     2186        }
     2187    }
     2188}
     2189#else
    16752190Void TDecSbac::parseSaoUvlc (UInt& ruiVal)
    16762191{
     
    19092424  }
    19102425}
    1911 
     2426#endif
    19122427/**
    19132428 - Initialize our contexts from the nominated source.
     
    22352750}
    22362751#endif
    2237 
     2752#if QC_ARP_D0177
     2753Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2754{
     2755  UInt nMaxW = pcCU->getSlice()->getARPStepNum() - 1;
     2756#if !QC_ARP_WARNING_FIX
     2757  assert (nMaxW >= 0);
     2758#endif
     2759  UInt nW = 0;
     2760  if( nMaxW > 0 )
     2761  {
     2762    UInt nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
     2763#if !QC_ARP_WARNING_FIX
     2764    assert( 0 <= nOffset && nOffset <= 2 );
     2765#endif
     2766    UInt uiCode = 0;
     2767    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 0 + nOffset ) );
     2768    nW = uiCode;
     2769    if( nW == 1 )   
     2770    {
     2771      m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 3 ) );
     2772      nW += ( uiCode == 1 );
     2773    }
     2774  }
     2775  pcCU->setARPWSubParts( ( UChar )( nW ) , uiAbsPartIdx, uiDepth ); 
     2776}
     2777#endif
    22382778#if LGE_EDGE_INTRA_A0070
    22392779Void TDecSbac::xParseEdgeIntraInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    23352875 
    23362876#if RWTH_SDC_DLT_B0036
     2877#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    23372878Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    23382879{
     
    23672908  {
    23682909    UInt uiIsMostProb = 0;
     2910#if INTEL_SDC64_D0193
     2911    if( !(pcCU->getWidth(uiAbsPartIdx) == 64 && i == 1))
     2912#endif
    23692913    m_pcTDecBinIf->decodeBin( uiIsMostProb, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) );
    23702914   
     
    23852929  pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth);
    23862930}
     2931#endif
    23872932
    23882933Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
     
    23982943  Int  iIdx       = 0;
    23992944 
    2400   UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     2945  UInt uiMaxResidualBits  = pcCU->getSlice()->getSPS()->getBitsPerDepthValue();
    24012946  assert( uiMaxResidualBits <= g_uiBitDepth );
    24022947 
     2948#if RWTH_SDC_CTX_SIMPL_D0032
     2949  m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) );
     2950#else
    24032951  m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) );
     2952#endif
    24042953 
    24052954  if (uiResidual)
    24062955  {
    24072956    // decode residual sign bit
     2957#if RWTH_SDC_CTX_SIMPL_D0032
     2958    m_pcTDecBinIf->decodeBinEP(uiSign);
     2959#else
    24082960    m_pcTDecBinIf->decodeBin(uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) );
     2961#endif
    24092962   
    24102963    // decode residual magnitude
     2964#if LGE_CONCATENATE_D0141
     2965    //prefix part
     2966    UInt uiCount = 0;
     2967    UInt uiNumDepthValues = pcCU->getSlice()->getSPS()->getNumDepthValues();
     2968    UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2);
     2969    for ( UInt ui = 0; ui < uiPrefixThreshold; ui++)
     2970    {
     2971        m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) );
     2972        if ( uiBit == 0 )
     2973            break;
     2974        else
     2975            uiCount++;
     2976    }
     2977    //suffix part
     2978    if ( uiCount == uiPrefixThreshold )
     2979    {
     2980        for ( UInt ui = 0; ui < ( (UInt)ceil( Log2(uiNumDepthValues - uiPrefixThreshold) ) ); ui++ )
     2981        {
     2982            m_pcTDecBinIf->decodeBinEP( uiBit );
     2983            uiAbsIdx |= uiBit << ui;
     2984        }
     2985        uiAbsIdx += uiCount;
     2986    }
     2987    else
     2988        uiAbsIdx = uiCount;
     2989#else
    24112990    for (Int i=0; i<uiMaxResidualBits; i++)
    24122991    {
     2992#if RWTH_SDC_CTX_SIMPL_D0032
     2993      m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, 0, i ) );
     2994#else
    24132995      m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) );
     2996#endif
    24142997      uiAbsIdx |= uiBit << i;
    24152998    }
     2999#endif
    24163000   
    24173001    uiAbsIdx += 1;
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r332 r443  
    110110#endif
    111111 
     112#if LGE_SAO_MIGRATION_D0091
     113  Void  parseSaoMaxUvlc           ( UInt& val, UInt maxSymbol );
     114  Void  parseSaoMerge             ( UInt&  ruiVal   );
     115  Void  parseSaoTypeIdx           ( UInt&  ruiVal  );
     116  Void  parseSaoUflc              ( UInt uiLength, UInt& ruiVal     );
     117  Void  parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp);
     118  Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam, UInt compIdx);
     119#else
    112120  Void  parseSaoUvlc              ( UInt& ruiVal           );
    113121  Void  parseSaoSvlc              ( Int&  riVal            );
     
    118126  Void  parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Bool bLFCrossSliceBoundaryFlag);
    119127  Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam);
     128#endif
    120129 
    121130#if RWTH_SDC_DLT_B0036
     131#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    122132  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    123133  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     134#endif
    124135  Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
    125136#endif
     
    176187  Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
    177188#endif
     189#if QC_ARP_D0177
     190  Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     191#endif
    178192  Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    179193  Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    180  
     194#if PKU_QC_DEPTH_INTRA_UNI_D0195
     195  Void parseDepthIntraMode  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     196  Void parseDepthModelingTable( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     197#endif
    181198  Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    182199 
     
    218235#if H3D_IVRP
    219236  ContextModel3DBuffer m_cResPredFlagSCModel;
     237#endif
     238#if QC_ARP_D0177
     239  ContextModel3DBuffer m_cCUPUARPW;
    220240#endif
    221241  ContextModel3DBuffer m_cCUPartSizeSCModel;
     
    245265  ContextModel3DBuffer m_cALFSvlcSCModel;
    246266  ContextModel3DBuffer m_cCUAMPSCModel;
     267#if LGE_SAO_MIGRATION_D0091
     268  ContextModel3DBuffer m_cSaoMergeSCModel;
     269  ContextModel3DBuffer m_cSaoTypeIdxSCModel;
     270#else
    247271  ContextModel3DBuffer m_cSaoFlagSCModel;
    248272  ContextModel3DBuffer m_cSaoUvlcSCModel;
     
    251275  ContextModel3DBuffer m_cSaoMergeUpSCModel;
    252276  ContextModel3DBuffer m_cSaoTypeIdxSCModel;
     277#endif
    253278
    254279#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     280#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    255281  ContextModel3DBuffer m_cDmmFlagSCModel;
    256282  ContextModel3DBuffer m_cDmmModeSCModel;
     283#endif
    257284  ContextModel3DBuffer m_cDmmDataSCModel;
    258285#endif
     
    265292 
    266293#if RWTH_SDC_DLT_B0036
     294#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    267295  ContextModel3DBuffer m_cSDCFlagSCModel;
     296#else
     297  ContextModel3DBuffer m_cDepthModeModel;
     298  ContextModel3DBuffer m_cDmmDeltaFlagModel;
     299#endif
    268300 
    269301  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
     302#if !RWTH_SDC_CTX_SIMPL_D0032
    270303  ContextModel3DBuffer m_cSDCResidualSignFlagSCModel;
     304#endif
    271305  ContextModel3DBuffer m_cSDCResidualSCModel;
    272306 
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r296 r443  
    286286    g_bJustDoIt = g_bEncDecTraceEnable;
    287287#endif
     288#if LGE_SAO_MIGRATION_D0091
     289    if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) )
     290    {
     291        SAOParam *saoParam =  pcSlice->getAPS()->getSaoParam();
     292        saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
     293    if (iCUAddr == iStartCUAddr)
     294    {
     295        saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
     296    }
     297    Int numCuInWidth     = saoParam->numCuInWidth;
     298    Int cuAddrInSlice = iCUAddr - rpcPic->getPicSym()->getCUOrderMap(pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU());
     299    Int cuAddrUpInSlice  = cuAddrInSlice - numCuInWidth;
     300    Int rx = iCUAddr % numCuInWidth;
     301    Int ry = iCUAddr / numCuInWidth;
     302    Int allowMergeLeft = 1;
     303    Int allowMergeUp   = 1;
     304    if (rx!=0)
     305    {
     306        if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-1) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
     307        {
     308            allowMergeLeft = 0;
     309        }
     310    }
     311    if (ry!=0)
     312    {
     313        if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-numCuInWidth) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
     314        {
     315        allowMergeUp = 0;
     316        }
     317    }
     318    pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp);
     319    }
     320#else
    288321    if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() )
    289322    {
     
    301334      pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() );
    302335    }
     336#endif
    303337
    304338    m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r332 r443  
    403403  m_cDepthMapGenerator.destroy();
    404404#endif
    405 #if H3D_IVRP
     405#if H3D_IVRP & !QC_ARP_D0177
    406406  m_cResidualGenerator.destroy();
    407407#endif
     
    420420                    , &m_cDepthMapGenerator
    421421#endif
    422 #if H3D_IVRP
     422#if H3D_IVRP & !QC_ARP_D0177
    423423                    , &m_cResidualGenerator
    424424#endif
     
    434434#endif
    435435#endif
    436 #if H3D_IVRP
     436#if H3D_IVRP & !QC_ARP_D0177
    437437  m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
    438438#endif
     
    860860    }
    861861#endif
    862 #if H3D_IVRP
     862#if H3D_IVRP & !QC_ARP_D0177
    863863    m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
    864864#endif
     
    10831083    std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
    10841084    pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics );
    1085 
     1085#if QC_ARP_D0177
     1086    //pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop( 0 , false )->getListPic() );
     1087    pcSlice->setARPStepNum();
     1088    if(pcSlice->getARPStepNum() > 1)
     1089    {
     1090      for(Int iViewIdx = 0; iViewIdx < pcSlice->getViewId(); iViewIdx ++ )
     1091        pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop( iViewIdx, false )->getListPic(), iViewIdx );
     1092    }
     1093#endif
    10861094    // For generalized B
    10871095    // note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
     
    12141222     pcSlice->setRefPicBaseDepth(pcBaseDepthPic);
    12151223  }
     1224#if !MERL_VSP_NBDV_RefVId_Fix_D0166
    12161225  getTAppDecTop()->setBWVSPLUT( pcSlice, pcSlice->getViewId(),  pcSlice->getPOC() ); // get the LUT for backward warping
     1226#else
     1227  if (pcSlice->getViewId() != 0)
     1228  {
     1229    Bool isDepth = true;
     1230    for(Int refviewId = 0; refviewId < (pcSlice->getViewId()); refviewId++)
     1231    {
     1232      if (m_tAppDecTop->getTDecTop( refviewId, isDepth ))
     1233      {
     1234        pcSlice->setListDepthPic(m_tAppDecTop->getTDecTop( refviewId, isDepth )->getListPic(), refviewId); // The list will store only the depth pictures
     1235      }
     1236      getTAppDecTop()->setBWVSPLUT( refviewId, pcSlice, pcSlice->getViewId(),  pcSlice->getPOC() ); // get the LUT for backward warping
     1237    }
     1238  }
     1239#endif
    12171240#endif
    12181241
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r296 r443  
    213213  TComDepthMapGenerator   m_cDepthMapGenerator;
    214214#endif
    215 #if H3D_IVRP
     215#if H3D_IVRP & !QC_ARP_D0177
    216216  TComResidualGenerator   m_cResidualGenerator;
    217217#endif
Note: See TracChangeset for help on using the changeset viewer.