Changeset 950 in 3DVCSoftware


Ignore:
Timestamp:
25 Apr 2014, 12:38:00 (11 years ago)
Author:
tech
Message:

Merged 10.2-dev0@949.

Location:
trunk
Files:
2 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/cfg/3D-HEVC/baseCfg_2view+depth.cfg

    r872 r950  
    198198AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
    199199IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on )   (v/d)
     200IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
    200201ViewSynthesisPred                   : 1                # View synthesis prediction
    201202DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
  • trunk/cfg/3D-HEVC/baseCfg_2view.cfg

    r872 r950  
    173173AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
    174174IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on ) (v/d)
     175IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
    175176ViewSynthesisPred                   : 1                # View synthesis prediction
    176177DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
  • trunk/cfg/3D-HEVC/baseCfg_3view+depth.cfg

    r872 r950  
    229229AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
    230230IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on )  (v/d)
     231IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
    231232ViewSynthesisPred                   : 1                # View synthesis prediction
    232233DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
  • trunk/cfg/3D-HEVC/baseCfg_3view.cfg

    r872 r950  
    188188AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
    189189IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on )   (v/d)
     190IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
    190191ViewSynthesisPred                   : 0                # View synthesis prediction
    191192DepthRefinement                     : 0                # Dispary refined by depth DoNBDV
  • trunk/cfg/3D-HEVC/fullCfg.cfg

    r872 r950  
    253253AdvMultiviewResPred                 : 1                # Advanced inter-view residual prediction (0:off, 1:on)
    254254IlluCompEnable                      : 1                # Enable Illumination compensation ( 0: off, 1: on ) (v/d)
     255IlluCompLowLatencyEnc               : 0                # Enable low-latency Illumination compensation encoding( 0: off, 1: on )
    255256ViewSynthesisPred                   : 1                # View synthesis prediction
    256257DepthRefinement                     : 1                # Dispary refined by depth DoNBDV
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r884 r950  
    517517#if H_3D_IC
    518518  ("IlluCompEnable",           m_abUseIC, true, "Enable illumination compensation")
     519#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     520  ("IlluCompLowLatencyEnc",    m_bUseLowLatencyICEnc, false, "Enable low-latency illumination compensation encoding")
     521#endif
    519522#endif
    520523#if H_3D_INTER_SDC
     
    24792482#if H_3D_IC
    24802483  printf( "IlluCompEnable:%d ", m_abUseIC);
     2484#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     2485  printf ("IlluCompLowLatencyEnc:%d ",  m_bUseLowLatencyICEnc);
     2486#endif
    24812487#endif
    24822488#if H_3D_NBDV_REF
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r884 r950  
    137137#if H_3D_IC
    138138  Bool   m_abUseIC;
     139#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     140  Bool  m_bUseLowLatencyICEnc;
     141#endif
    139142#endif
    140143#if H_3D_NBDV_REF
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r884 r950  
    178178    m_cTEncTop.setDWeight                      ( isDepth ? m_iDWeight             : 0     );
    179179#endif // H_3D_VSO
    180 #if H_3D_ARP
     180#if H_3D_ARP && !QC_IV_PRED_CONSTRAINT_H0137
    181181    //====== Advanced Inter-view Residual Prediction =========
    182182    m_cTEncTop.setUseAdvRP                     ( ( isDepth || 0==layerIdInVps ) ? 0 : m_uiUseAdvResPred );
     
    189189#if H_3D_IC
    190190    m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
     191#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     192    m_cTEncTop.setUseICLowLatencyEnc           ( m_bUseLowLatencyICEnc );
     193#endif
    191194#endif
    192195  //========== Depth intra modes ==========
     
    17931796
    17941797#if H_3D_ARP
     1798#if QC_IV_PRED_CONSTRAINT_H0137
     1799    vps.setUseAdvRP        ( layer, ( isDepth || isLayerZero || !vps.getNumDirectRefLayers(layer) ) ? 0 : m_uiUseAdvResPred );
     1800    vps.setARPStepNum      ( layer, ( isDepth || isLayerZero || !vps.getNumDirectRefLayers(layer) ) ? 1 : H_3D_ARP_WFNR     );
     1801#else
    17951802    vps.setUseAdvRP        ( layer, ( isDepth || isLayerZero ) ? 0 : m_uiUseAdvResPred );
    17961803    vps.setARPStepNum      ( layer, ( isDepth || isLayerZero ) ? 1 : H_3D_ARP_WFNR     );
    17971804#endif 
     1805#endif 
    17981806#if H_3D_SPIVMP
    17991807    if( isDepth )
     
    18121820
    18131821#if H_3D_IV_MERGE
     1822#if QC_IV_PRED_CONSTRAINT_H0137
     1823    if( !vps.getNumDirectRefLayers(layer) )
     1824    {
     1825      vps.setIvMvPredFlag    (layer, false);
     1826    }
     1827    else
     1828    {
     1829#endif
    18141830    if( isDepth )
    18151831    {
     
    18201836      vps.setIvMvPredFlag         ( layer, !isLayerZero && m_ivMvPredFlag[0] );
    18211837    }
     1838#if QC_IV_PRED_CONSTRAINT_H0137
     1839    }
     1840#endif
    18221841#endif
    18231842#if H_3D_NBDV_REF
     
    18251844#endif
    18261845#if H_3D_VSP
     1846#if QC_IV_PRED_CONSTRAINT_H0137
     1847    vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && vps.getNumDirectRefLayers(layer) && m_viewSynthesisPredFlag );         
     1848#else
    18271849    vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && m_viewSynthesisPredFlag );         
     1850#endif
    18281851#endif
    18291852#if H_3D_DBBP
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r884 r950  
    110110#define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
    111111#endif
     112#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
     113#define NUM_ANGLE_FLAG_CTX            1
     114#else
    112115#define NUM_ANGLE_FLAG_CTX            3
     116#endif
    113117#endif
    114118
     
    368372};
    369373
     374#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
     375static const UChar
     376INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
     377{
     378  { 154 },
     379  { 141 },
     380  { 155 },
     381};
     382#else
    370383static const UChar
    371384INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
     
    375388  { 155, 170, 157 },
    376389};
     390#endif
    377391
    378392static const UChar
     
    430444
    431445#if H_3D_DBBP
     446#if MTK_DBBP_SIGNALING_H0094
    432447static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
    433448{
    434   { CNU },
    435   { CNU },
    436   { CNU },
    437 };
    438 #endif
    439 
    440 #endif
     449  { 161 },
     450  { 161 },
     451  { 161 },
     452};
     453#else
     454static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
     455{
     456  { CNU },
     457  { CNU },
     458  { CNU },
     459};
     460#endif
     461#endif
     462
     463#endif
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r884 r950  
    610610    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    611611#endif
     612#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     613    m_apDmmPredictor[0] = 0;
     614    m_apDmmPredictor[1] = 0;
     615#endif
    612616#endif
    613617#if H_3D_DBBP
     
    784788      m_apSegmentDCOffset[1][ui] = 0;
    785789#endif
     790#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     791      m_apDmmPredictor[0] = 0;
     792      m_apDmmPredictor[1] = 0;
     793#endif
    786794#endif
    787795#if H_3D_DBBP
     
    898906  memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
    899907  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
     908#endif
     909#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     910  m_apDmmPredictor[0] = 0;
     911  m_apDmmPredictor[1] = 0;
    900912#endif
    901913#endif
     
    23522364   
    23532365    TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV;
     2366#if SEC_VER_DONBDV_H0103
     2367    if( depthRefineFlag )
     2368    {
     2369      cDv.setVer(0);
     2370    }
     2371#endif
    23542372   
    23552373    Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
     
    23832401UInt TComDataCU::getCtxAngleFlag( UInt uiAbsPartIdx )
    23842402{
     2403#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
     2404  return 0;
     2405#else
    23852406  TComDataCU* pcTempCU;
    23862407  UInt        uiTempPartIdx;
     
    23962417
    23972418  return uiCtx;
     2419#endif
    23982420}
    23992421#endif
     
    32583280 *   false: otherwise
    32593281 */
     3282#if ETRIKHU_CLEANUP_H0083
     3283inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount)
     3284#else
    32603285inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    32613286  Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
     3287#endif
    32623288{
    32633289  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
     
    32753301  }
    32763302
     3303#if ETRIKHU_CLEANUP_H0083
     3304  TComMvField mvVSP[2];
     3305  UChar dirVSP;
     3306#else
    32773307  rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
     3308#endif
    32783309
    32793310  Bool  refViewAvailFlag = false;
     
    32903321        refViewAvailFlag      = true;
    32913322        predFlag[iRefListIdX] = 1;
     3323#if ETRIKHU_CLEANUP_H0083
     3324        mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
     3325#if H_3D_NBDV
     3326        mvVSP[0+iRefListIdX].getMv().setIDVFlag (false);
     3327#endif
     3328#else
    32923329        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    32933330#if H_3D_NBDV
    32943331        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].getMv().setIDVFlag (false);
    32953332#endif
    3296       }
    3297     }
    3298   }
    3299 
     3333#endif
     3334      }
     3335    }
     3336  }
     3337
     3338#if ETRIKHU_CLEANUP_H0083
     3339  dirVSP = (predFlag[0] | (predFlag[1] << 1));
     3340  m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true, false);
     3341#else
    33003342  // Set values to be returned
    33013343  abCandIsInter        [iCount] = true;
    33023344  puhInterDirNeighbours[iCount] = (predFlag[0] | (predFlag[1] << 1));
    33033345  vspFlag              [iCount] = 1;
     3346#endif
    33043347
    33053348  if ( mrgCandIdx == iCount )
     
    33163359
    33173360#if H_3D_IV_MERGE
     3361#if ETRIKHU_CLEANUP_H0083
     3362inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx )
     3363#else
    33183364inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,
    33193365  Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
     3366#endif
    33203367{
    33213368  for(Int iLoop = 0; iLoop < 2; iLoop ++ )
     
    33253372    {
    33263373      Int iFirDispCand = -1;
     3374#if ETRIKHU_CLEANUP_H0083
     3375      TComMvField mvIvDcShift[2];
     3376      UChar dirIvDcShift;
     3377
     3378      if (xGetPosFirstAvailDmvCand(MRG_IVSHIFT, iFirDispCand))
     3379#else
    33273380      if (xGetPosFirstAvailDmvCand(iCount, pcMvFieldNeighbours, ivCandDir, iPosIvDC, vspFlag, iFirDispCand))
     3381#endif
    33283382      {
    33293383        TComMv cMv;
     3384#if ETRIKHU_CLEANUP_H0083
     3385        cMv = m_mergCands[iFirDispCand].m_cMvField[0].getMv();
     3386#else
    33303387        cMv = pcMvFieldNeighbours[(iFirDispCand<<1)].getMv();
     3388#endif
    33313389        cMv.setHor(cMv.getHor()+4);
    33323390        if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps()))
     
    33343392          cMv.setVer(0);
    33353393        }
     3394#if !(NTT_BUG_FIX_TK54)
    33363395        clipMv( cMv );
    3337 
     3396#endif
     3397
     3398#if ETRIKHU_CLEANUP_H0083
     3399        dirIvDcShift = m_mergCands[iFirDispCand].m_uDir;
     3400        mvIvDcShift[0].setMvField(cMv, m_mergCands[iFirDispCand].m_cMvField[0].getRefIdx() );
     3401        mvIvDcShift[1].setMvField(m_mergCands[iFirDispCand].m_cMvField[1].getMv(), m_mergCands[iFirDispCand].m_cMvField[1].getRefIdx() );
     3402        m_mergCands[MRG_IVSHIFT].setCand(mvIvDcShift, dirIvDcShift, false, false);
     3403#else
    33383404        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    33393405
     
    33423408        pcMvFieldNeighbours  [ iCount << 1      ].setMvField(cMv, pcMvFieldNeighbours[( iFirDispCand << 1)].getRefIdx() );
    33433409        pcMvFieldNeighbours  [(iCount << 1) + 1 ].setMvField(pcMvFieldNeighbours[(iFirDispCand << 1) + 1].getMv(), pcMvFieldNeighbours[( iFirDispCand << 1) + 1].getRefIdx() );
     3410#endif
    33443411       
    33453412        if( mrgCandIdx == iCount )
     
    33723439      if( !iLoop && ivCandDir[0] > 0)
    33733440      {
     3441#if ETRIKHU_CLEANUP_H0083
     3442        if(tmpDir == m_mergCands[MRG_IVMC].m_uDir && m_mergCands[MRG_IVMC].m_cMvField[0]==tmpMV[0] && m_mergCands[MRG_IVMC].m_cMvField[1]==tmpMV[1])
     3443#else
    33743444        if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1])
     3445#endif
    33753446        {
    33763447            bRemove                         = true;
     
    33793450      if(!bRemove)
    33803451      {
     3452#if ETRIKHU_CLEANUP_H0083
     3453#if H_3D_NBDV
     3454        if(iLoop) // For IvMcShift candidate
     3455        {
     3456          tmpMV[0].getMv().setIDVFlag (false);
     3457          tmpMV[1].getMv().setIDVFlag (false);
     3458        }
     3459#endif
     3460        m_mergCands[MRG_IVSHIFT].setCand(tmpMV, tmpDir, false, false);
     3461#else
    33813462        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    33823463
     
    33983479        }
    33993480#endif
     3481#endif
    34003482        if( mrgCandIdx == iCount )
    34013483        {
     
    34103492}
    34113493
     3494#if ETRIKHU_CLEANUP_H0083
     3495inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
     3496{
     3497  for ( Int currListPos = 0; currListPos < iCount; currListPos++ )
     3498  {
     3499    if ( !m_mergCands[currListPos].m_bAvailable || ( currListPos == MRG_IVMC ) || ( currListPos == MRG_IVDC ) || ( m_mergCands[currListPos].m_iVspFlag != 0 ))
     3500    {
     3501      continue;
     3502    }
     3503    else if((m_mergCands[currListPos].m_bAvailable) && (m_mergCands[currListPos].m_cMvField[0].getRefIdx() != -1 ) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), m_mergCands[currListPos].m_cMvField[0].getRefIdx())->getViewIndex()))
     3504    {
     3505      posFirstAvailDmvCand = currListPos;
     3506      return true;
     3507    }
     3508  }
     3509  return false; 
     3510}
     3511#else
    34123512inline Bool TComDataCU::xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& posFirstAvailDmvCand )
    34133513{
     
    34273527 return false; 
    34283528}
     3529#endif
    34293530                                     
    34303531#endif
    34313532
    34323533#if H_3D
     3534#if ETRIKHU_CLEANUP_H0083
     3535
     3536Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
     3537#if H_3D_VSP
     3538  , Int* vspFlag
     3539#endif
     3540#if H_3D_SPIVMP
     3541  , Bool* pbSPIVMPFlag
     3542#endif
     3543  , Int& numValidMergeCand
     3544  )
     3545{
     3546  if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0))  // for only dependent texture
     3547  {
     3548    return;
     3549  }
     3550
     3551  Int iCount = 0;
     3552  TComMv cZeroMv;
     3553
     3554  // init temporal list
     3555  TComMvField extMergeCandList[MRG_MAX_NUM_CANDS_MEM << 1];
     3556  UChar uhInterDirNeighboursExt[MRG_MAX_NUM_CANDS_MEM];
     3557  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui )
     3558  {
     3559    uhInterDirNeighboursExt[ui] = puhInterDirNeighbours[ui];
     3560    extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID);
     3561    extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
     3562    vspFlag[ui] = 0;
     3563  }
     3564
     3565  // add candidates to temporal list
     3566  // insert MPI ... IvShift candidate
     3567  for (Int i=0; i<=MRG_IVSHIFT; i++)
     3568  {
     3569    if (m_mergCands[i].m_bAvailable)
     3570    {
     3571      m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt, vspFlag, pbSPIVMPFlag);
     3572      iCount++;
     3573      if (iCount >= getSlice()->getMaxNumMergeCand())
     3574        break;
     3575    }
     3576  }
     3577
     3578  // insert remaining base candidates
     3579  while (iCount < getSlice()->getMaxNumMergeCand() && m_baseListidc < getSlice()->getMaxNumMergeCand())
     3580  {
     3581    uhInterDirNeighboursExt[iCount] = puhInterDirNeighbours[m_baseListidc];
     3582    extMergeCandList[iCount<<1].setMvField(pcMvFieldNeighbours[m_baseListidc<<1].getMv(), pcMvFieldNeighbours[m_baseListidc<<1].getRefIdx());
     3583    if ( getSlice()->isInterB() )
     3584    {
     3585      extMergeCandList[(iCount<<1)+1].setMvField(pcMvFieldNeighbours[(m_baseListidc<<1)+1].getMv(), pcMvFieldNeighbours[(m_baseListidc<<1)+1].getRefIdx());
     3586    }
     3587    m_baseListidc++;
     3588    iCount++;
     3589  }
     3590
     3591  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ )
     3592  {
     3593    puhInterDirNeighbours[ui] = 0;
     3594    pcMvFieldNeighbours[ui<<1].setMvField(cZeroMv, NOT_VALID);
     3595    pcMvFieldNeighbours[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
     3596  }
     3597  // copy extMergeCandList to output
     3598  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ )
     3599  {
     3600    puhInterDirNeighbours[ui] = uhInterDirNeighboursExt[ui];
     3601    pcMvFieldNeighbours[ui<<1].setMvField(extMergeCandList[ui<<1].getMv(), extMergeCandList[ui<<1].getRefIdx());
     3602    if ( getSlice()->isInterB() )
     3603      pcMvFieldNeighbours[(ui<<1)+1].setMvField(extMergeCandList[(ui<<1)+1].getMv(), extMergeCandList[(ui<<1)+1].getRefIdx());
     3604  }
     3605  numValidMergeCand = iCount;
     3606  assert(iCount == getSlice()->getMaxNumMergeCand());
     3607}
     3608#else
    34333609Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV)
    34343610{
     
    34513627  return;
    34523628}
     3629#endif
    34533630
    34543631/** Constructs a list of merging candidates
     
    38244001#endif
    38254002#if H_3D_VSP
     4003#if !ETRIKHU_CLEANUP_H0083
    38264004      , Int* vspFlag
     4005#endif
    38274006      , InheritedVSPDisInfo*  inheritedVSPDisInfo
    38284007#endif
    38294008#if H_3D_SPIVMP
     4009#if ETRIKHU_CLEANUP_H0083
     4010      , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     4011#else
    38304012      , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     4013#endif
    38314014#endif
    38324015      , Int& numValidMergeCand, Int mrgCandIdx
     
    38394022  ////////////////////////////
    38404023  TComMv cZeroMv;
     4024#if !ETRIKHU_CLEANUP_H0083
    38414025  Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
     4026#endif
    38424027#else
    38434028  Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
     
    39054090#if H_3D_DBBP
    39064091  Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx);
     4092#if MTK_DIS_SPBIP8X4_H0205
     4093  assert(bDBBPFlag == getDBBPFlag(0)); 
     4094#endif
    39074095#endif
    39084096
    39094097#if H_3D
     4098#if !ETRIKHU_CLEANUP_H0083
    39104099  Int  iPosLeftAbove[2] = {-1, -1};
    39114100
     
    39144103  Int numA1B1B0 = 0;
    39154104  Int numA0B2 = 0;
    3916 
     4105#endif
    39174106#if H_3D_NBDV
    39184107  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 
     
    39234112#endif
    39244113
     4114
     4115#if ETRIKHU_CLEANUP_H0083
     4116
     4117
     4118  // Clean version for MCL construction align with WD
     4119  // init mergCands list
     4120  for (Int i = 0; i<MRG_IVSHIFT+1; i++)
     4121  {
     4122    m_mergCands[i].init();
     4123  }
     4124
     4125  m_baseListidc = 0;
     4126
     4127  //left
     4128  UInt uiLeftPartIdx = 0;
     4129  TComDataCU* pcCULeft = 0;
     4130  pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 
     4131
     4132  if (getAvailableFlagA1())
     4133  {
     4134    m_mergCands[MRG_A1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4135#if H_3D_VSP
     4136    ,
     4137      (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
     4138#if H_3D_IC
     4139      && !bICFlag
     4140#endif
     4141#if H_3D_ARP
     4142      && !bARPFlag
     4143#endif
     4144#if RWTH_DBBP_NO_SPU_H0057
     4145      && !bDBBPFlag
     4146#endif
     4147      )
     4148#endif
     4149      , false
     4150      );
     4151    m_baseListidc++;
     4152  }
     4153
     4154  // above
     4155  UInt uiAbovePartIdx = 0;
     4156  TComDataCU* pcCUAbove = 0;
     4157  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
     4158
     4159  if (getAvailableFlagB1())
     4160  {
     4161    m_mergCands[MRG_B1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4162#if H_3D_VSP
     4163    ,
     4164      ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
     4165#if H_3D_IC
     4166      && !bICFlag
     4167#endif
     4168#if H_3D_ARP
     4169      && !bARPFlag
     4170#endif
     4171#if RWTH_DBBP_NO_SPU_H0057
     4172      && !bDBBPFlag
     4173#endif
     4174      )
     4175#endif
     4176      , false
     4177      );
     4178    m_baseListidc++;
     4179  }
     4180
     4181  // above right
     4182  UInt uiAboveRightPartIdx = 0;
     4183  TComDataCU* pcCUAboveRight = 0;
     4184  pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
     4185
     4186  if (getAvailableFlagB0())
     4187  {
     4188    m_mergCands[MRG_B0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4189#if H_3D_VSP
     4190    ,
     4191      ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
     4192#if H_3D_IC
     4193      && !bICFlag
     4194#endif
     4195#if H_3D_ARP
     4196      && !bARPFlag
     4197#endif
     4198#if RWTH_DBBP_NO_SPU_H0057
     4199      && !bDBBPFlag
     4200#endif
     4201      )
     4202#endif
     4203      , false
     4204      );
     4205    m_baseListidc++;
     4206  }
     4207
     4208  // left bottom
     4209  UInt uiLeftBottomPartIdx = 0;
     4210  TComDataCU* pcCULeftBottom = getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
     4211
     4212  if (getAvailableFlagA0())
     4213  {
     4214    m_mergCands[MRG_A0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4215#if H_3D_VSP
     4216    ,
     4217      (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
     4218#if H_3D_IC
     4219      && !bICFlag
     4220#endif
     4221#if H_3D_ARP
     4222      && !bARPFlag
     4223#endif
     4224#if RWTH_DBBP_NO_SPU_H0057
     4225      && !bDBBPFlag
     4226#endif
     4227      )
     4228#endif
     4229      , false
     4230      );
     4231    m_baseListidc++;
     4232  }
     4233
     4234  // above left
     4235  UInt uiAboveLeftPartIdx = 0;
     4236  TComDataCU* pcCUAboveLeft = 0;
     4237  pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
     4238
     4239  if (getAvailableFlagB2())
     4240  {
     4241    m_mergCands[MRG_B2].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4242#if H_3D_VSP
     4243    ,
     4244      ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
     4245#if H_3D_IC
     4246      && !bICFlag
     4247#endif
     4248#if H_3D_ARP
     4249      && !bARPFlag
     4250#endif
     4251#if RWTH_DBBP_NO_SPU_H0057
     4252      && !bDBBPFlag
     4253#endif
     4254      )
     4255#endif
     4256      , false
     4257      );
     4258    m_baseListidc++;
     4259  }
     4260
     4261
     4262#if !ETRIKHU_BUGFIX_H0083
     4263  Bool A1_was_available = m_mergCands[MRG_A1].m_bAvailable;
     4264  Bool B1_was_available = m_mergCands[MRG_B1].m_bAvailable;
     4265#endif
     4266
     4267
     4268#else
    39254269  //left
    39264270  UInt uiLeftPartIdx = 0;
     
    39384282      && !bARPFlag
    39394283#endif
     4284#if RWTH_DBBP_NO_SPU_H0057
     4285      && !bDBBPFlag
     4286#endif
    39404287      )
    39414288    {
     
    39614308      && !bARPFlag
    39624309#endif
     4310#if RWTH_DBBP_NO_SPU_H0057
     4311      && !bDBBPFlag
     4312#endif
    39634313      )
    39644314    {
     
    39844334      && !bARPFlag
    39854335#endif
     4336#if RWTH_DBBP_NO_SPU_H0057
     4337      && !bDBBPFlag
     4338#endif
    39864339      )
    39874340    {
     
    40044357#if H_3D_ARP
    40054358      && !bARPFlag
     4359#endif
     4360#if RWTH_DBBP_NO_SPU_H0057
     4361      && !bDBBPFlag
    40064362#endif
    40074363      )
     
    40284384      && !bARPFlag
    40294385#endif
     4386#if RWTH_DBBP_NO_SPU_H0057
     4387      && !bDBBPFlag
     4388#endif
    40304389      )
    40314390    {
     
    40384397
    40394398  iCountHEVC = numValidMergeCand;
     4399#endif
    40404400#endif
    40414401
     
    40474407  /////////////////////////////////////////////
    40484408
     4409#if SHARP_SIMPLE_MERGE_H0062
     4410  bMPIFlag &= (nPSW + nPSH > 12);
     4411#endif
    40494412  if( bMPIFlag)
    40504413  {
     
    40524415    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    40534416    tmpDir        =  0;
     4417
     4418#if ETRIKHU_CLEANUP_H0083
     4419    Bool bSPIVMPFlag = false;
     4420#endif
    40544421
    40554422    TComPic * pcTexPic = m_pcSlice->getTexturePic();
     
    40904457      Int         iTexPosX, iTexPosY;
    40914458      const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
     4459#if MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
     4460     
     4461      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iPUWidth ) >> 1 )  * iPUWidth + ( iPUWidth >> 1 );
     4462      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iPUHeight ) >> 1 )  * iPUHeight + (iPUHeight >> 1);
     4463      Int         iTexCenterCUAddr, iTexCenterAbsPartIdx;
     4464
     4465      if(iWidth == iPUWidth && iHeight == iPUHeight)
     4466      {
     4467          iCenterPosX = iCurrPosX + (iWidth >> 1);
     4468          iCenterPosY = iCurrPosY + (iHeight >> 1);
     4469      }
     4470
     4471      // derivation of center motion parameters from the collocated texture CU
     4472
     4473      pcTexRec->getCUAddrAndPartIdx( iCenterPosX , iCenterPosY , iTexCenterCUAddr, iTexCenterAbsPartIdx );
     4474      TComDataCU* pcDefaultCU    = pcTexPic->getCU( iTexCenterCUAddr );
     4475
     4476      if( pcDefaultCU->getPredictionMode( iTexCenterAbsPartIdx ) != MODE_INTRA )
     4477      {
     4478          for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4479          {
     4480              RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4481
     4482              TComMvField cDefaultMvField;
     4483              pcDefaultCU->getMvField( pcDefaultCU, iTexCenterAbsPartIdx, eCurrRefPicList, cDefaultMvField );
     4484              Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     4485              if (iDefaultRefIdx >= 0)
     4486              {
     4487                  Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eCurrRefPicList, iDefaultRefIdx);
     4488                  for (Int iRefPicList = 0; iRefPicList < m_pcSlice->getNumRefIdx( eCurrRefPicList ); iRefPicList++)
     4489                  {
     4490                      if (iDefaultRefPOC == m_pcSlice->getRefPOC(eCurrRefPicList, iRefPicList))
     4491                      {
     4492#if ETRIKHU_CLEANUP_H0083
     4493                        bSPIVMPFlag = true;
     4494#else
     4495                          pbSPIVMPFlag[iCount] = true;
     4496#endif
     4497                          TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
     4498                          cMv >>= 2;
     4499                          clipMv( cMv );
     4500                          cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
     4501                          break;
     4502                      }
     4503                  }
     4504              }
     4505          }
     4506      }
     4507#if ETRIKHU_CLEANUP_H0083
     4508      if ( bSPIVMPFlag == true )
     4509#else
     4510      if ( pbSPIVMPFlag[iCount] == true )
     4511#endif
     4512      {   
     4513          iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
     4514          tmpDir = iInterDirSaved;
     4515          tmpMV[0] = cMvFieldSaved[0];
     4516          tmpMV[1] = cMvFieldSaved[1];
     4517      }
     4518
     4519      if ( iInterDirSaved != 0 )
     4520      {
     4521#endif
    40924522      for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight)
    40934523      {
     
    41104540              {
    41114541                TComMv cMv = cTexMvField.getMv() + cMvRounding;
    4112                 cMv >>=2;
     4542                cMv >>=2;         
     4543#if !(NTT_BUG_FIX_TK54)
    41134544                this->clipMv( cMv );
     4545#endif
    41144546                pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
    41154547              }
     
    41264558            }
    41274559          }
     4560#if MTK_DIS_SPBIP8X4_H0205
     4561              if (iPUHeight + iPUWidth == 12)
     4562              {
     4563                if (puhInterDirSP[iPartition] == 3)
     4564                {
     4565                  puhInterDirSP[iPartition] = 1;
     4566                  pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     4567                }
     4568              }
     4569#endif
     4570#if !MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    41284571          else
    41294572          {
    41304573            if (iInterDirSaved ==0)
    41314574            {
     4575#if ETRIKHU_CLEANUP_H0083
     4576                  bSPIVMPFlag = true;
     4577#else
    41324578              pbSPIVMPFlag[iCount] = true;
     4579#endif
    41334580              tmpDir = puhInterDirSP[iPartition];
    41344581              tmpMV[0] = pcMvFieldSP[2*iPartition];
     
    41494596            cMvFieldSaved[1] = pcMvFieldSP[2*iPartition + 1];
    41504597          }
     4598#endif
    41514599          iPartition ++;
    41524600        }
    41534601      }
     4602#if MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
     4603      }
     4604#endif
    41544605#if H_3D_FCO
    41554606    }
     
    41584609    {
    41594610      Int iCnloop = 0;
     4611#if ETRIKHU_CLEANUP_H0083
     4612      for(iCnloop = 0; iCnloop < 2; iCnloop ++)
     4613      {
     4614        if ( !m_mergCands[MRG_A1+iCnloop].m_bAvailable )  // prunning to A1, B1
     4615        {
     4616          continue;
     4617        }
     4618        if (tmpDir == m_mergCands[MRG_A1+iCnloop].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+iCnloop].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+iCnloop].m_cMvField[1])
     4619        {
     4620          m_mergCands[MRG_A1+iCnloop].m_bAvailable = false;
     4621          break;
     4622        }     
     4623      }
     4624      m_mergCands[MRG_T].setCand( tmpMV, tmpDir, false, bSPIVMPFlag);
     4625
     4626#else
    41604627      Bool bRemoveSpa = false; //pruning
    41614628
     
    42174684
    42184685      puhInterDirNeighbours[iCount] = tmpDir;
    4219 
     4686#endif
    42204687      if ( mrgCandIdx == iCount )
    42214688      {
     
    42614728            cMVField.getMv() += cAdd;
    42624729            cMVField.getMv() >>= 2;
     4730#if !(NTT_BUG_FIX_TK54)
    42634731            clipMv( cMVField.getMv() );
     4732#endif
    42644733            tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
    42654734            tmpDir = 1;
     
    42844753            cMVField.getMv() += cAdd;
    42854754            cMVField.getMv() >>= 2;
     4755#if !(NTT_BUG_FIX_TK54)
    42864756            clipMv( cMVField.getMv() );
     4757#endif
    42874758            tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
    42884759            tmpDir = 2;
     
    42924763      if( tmpDir != 0 )
    42934764      {
     4765#if !ETRIKHU_CLEANUP_H0083
    42944766        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4767#endif
    42954768        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    42964769        m_iUseDDDCandIdx = iCount;
    42974770
     4771#if ETRIKHU_CLEANUP_H0083
     4772        m_mergCands[MRG_D].setCand( tmpMV, tmpDir, false, false);
     4773        if ( mrgCandIdx == iCount )
     4774        {
     4775          return;
     4776        }
     4777        iCount ++;
     4778#else
    42984779        if( tmpDir == 1 )
    42994780        {
     
    43244805          iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    43254806        }
     4807#endif
    43264808      }
    43274809    }
     
    43324814  /////////////////////////////////////////////////////////////////
    43334815
     4816#if !ETRIKHU_CLEANUP_H0083
    43344817  Int  posIvDC          = -1;
     4818#endif
    43354819
    43364820  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
     
    43444828  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    43454829
     4830#if SHARP_SIMPLE_MERGE_H0062
     4831  ivMvPredFlag &= (nPSW + nPSH > 12);
     4832#endif
    43464833  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    43474834  {
     4835#if SEC_ADAPT_DISABLE_IVMP
     4836    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag );
     4837#else
    43484838    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
     4839#endif
    43494840  } 
    43504841
     
    43724863
    43734864    Bool bRemoveSpa = false; //pruning
     4865#if !ETRIKHU_CLEANUP_H0083
    43744866    Bool bIvMC = false;
    43754867    Int iCnloop=0;
     4868#endif
    43764869
    43774870    if (!bIsDepth)
     
    43794872      for(Int i = 0; i < 2; i ++)
    43804873      {
     4874#if ETRIKHU_CLEANUP_H0083
     4875        if ( !m_mergCands[MRG_A1 + i].m_bAvailable ) // prunning to A1, B1
     4876        {
     4877          continue;
     4878        }
     4879        if (ivCandDir[0] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])
     4880        {
     4881          m_mergCands[MRG_A1+i].m_bAvailable = false;
     4882          break;
     4883        }     
     4884#else
    43814885        iCnloop = iPosLeftAbove[i];
    43824886        if ( iCnloop == -1 )
     
    43894893          break;
    43904894        }     
     4895#endif
    43914896      }
    43924897    }
    43934898    if (bIsDepth)
    43944899    {
     4900#if ETRIKHU_CLEANUP_H0083
     4901      if (m_mergCands[MRG_T].m_bAvailable && ivCandDir[0] == m_mergCands[MRG_T].m_uDir && tmpMV[0]==m_mergCands[MRG_T].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_T].m_cMvField[1])
     4902      {
     4903        bRemoveSpa                      = true;
     4904      }
     4905#else
    43954906      iCnloop = iCount-1;
    43964907      for(; iCnloop >= 0; iCnloop --)
     
    44084919        }
    44094920      }
     4921#endif
    44104922    }
    44114923
    44124924    if (!bRemoveSpa)
    44134925    {
     4926#if !ETRIKHU_CLEANUP_H0083
    44144927      bIvMC = true;
    44154928      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
     
    44644977    if (bIvMC)
    44654978    {
     4979#endif
     4980#if ETRIKHU_CLEANUP_H0083
     4981      Bool SPIVMPFlag = false;
     4982#if MTK_DIS_SPBIP8X4_H0205
     4983      if(!m_pcSlice->getIsDepth())
     4984#else
     4985      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
     4986#endif
     4987      {
     4988        SPIVMPFlag = true;
     4989      }
     4990#if H_3D_DBBP
     4991      SPIVMPFlag &= !bDBBPFlag;
     4992#endif
     4993#else
    44664994      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    44674995      {
     
    44714999      pbSPIVMPFlag[iCount] &= !bDBBPFlag;
    44725000#endif
     5001#endif
     5002#if ETRIKHU_CLEANUP_H0083
     5003      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);
     5004#else
    44735005      if( ( ivCandDir[0] & 1 ) == 1 )
    44745006      {
     
    44815013
    44825014      puhInterDirNeighbours[ iCount ] = ivCandDir[0];
     5015#endif
    44835016
    44845017      if ( mrgCandIdx == iCount )
     
    44985031
    44995032#if H_3D
     5033#if ETRIKHU_CLEANUP_H0083
     5034  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable + m_mergCands[MRG_B0].m_bAvailable;
     5035#else
    45005036  iCount += numA1B1B0;
     5037#endif
    45015038#else
    45025039  //left
     
    46275164    for(Int i = 0; i < 2; i ++)
    46285165    {
     5166#if ETRIKHU_CLEANUP_H0083
     5167      if ( !m_mergCands[MRG_A1+i].m_bAvailable )
     5168#else
    46295169      Int iCnloop = iPosLeftAbove[i];
    46305170      if ( iCnloop == -1 )
     5171#endif
    46315172      {
    46325173        continue;
    46335174      }
     5175#if ETRIKHU_CLEANUP_H0083
     5176#if ETRIKHU_BUGFIX_H0083
     5177      if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])
     5178#else
     5179      Int offset = 0;
     5180      offset += A1_was_available;
     5181      offset += B1_was_available;
     5182      offset += m_mergCands[MRG_B0].m_bAvailable;
     5183      if (puhInterDirNeighbours[offset] == m_mergCands[MRG_A1+i].m_uDir && pcMvFieldNeighbours[(offset<<1)]==m_mergCands[MRG_A1+i].m_cMvField[0] && pcMvFieldNeighbours[(offset<<1)+1]==m_mergCands[MRG_A1+i].m_cMvField[1])
     5184#endif
     5185#else
    46345186      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
     5187#endif
    46355188      {
    46365189        bRemoveSpa                      = true;
     
    46405193    if(!bRemoveSpa)
    46415194    {
     5195#if ETRIKHU_CLEANUP_H0083
     5196#if H_3D_NBDV
     5197      tmpMV[0].getMv().setIDVFlag (false);
     5198      tmpMV[1].getMv().setIDVFlag (false);
     5199#endif
     5200      m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false);
     5201#else
    46425202      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    46435203      puhInterDirNeighbours[ iCount ] = ivCandDir[1];
     
    46555215#endif
    46565216      posIvDC  = iCount;
     5217#endif
    46575218      if ( mrgCandIdx == iCount )
    46585219        return;
     
    46825243      !bARPFlag &&
    46835244#endif
     5245#if SHARP_SIMPLE_MERGE_H0062
     5246      (nPSW + nPSH > 12) &&
     5247#endif
     5248#if RWTH_DBBP_NO_SPU_H0057
     5249      !bDBBPFlag &&
     5250#endif
     5251#if ETRIKHU_CLEANUP_H0083
     5252      xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) )
     5253#else
    46845254      xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     5255#endif
    46855256  {
    46865257    return;
     
    46985269
    46995270#if H_3D
     5271#if ETRIKHU_CLEANUP_H0083
     5272  iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable;
     5273#else
    47005274  iCount += numA0B2;
     5275#endif
    47015276#else
    47025277  //left bottom
     
    47725347  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    47735348  {
     5349#if ETRIKHU_CLEANUP_H0083
     5350    if(xAddIvMRGCand( mrgCandIdx,  iCount, ivCandDir, ivCandMv, ivCandRefIdx ) )
     5351#else
    47745352    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     5353#endif
    47755354    {
    47765355      return;
     
    47855364
    47865365#if H_3D
     5366#if !ETRIKHU_CLEANUP_H0083
    47875367  if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
    47885368  {
     
    47945374  }
    47955375  numValidMergeCand = iCount;
     5376#endif
    47965377#else
    47975378  if ( getSlice()->getEnableTMVPFlag())
     
    62276808      if( bCheck )
    62286809      {
     6810#if !(NTT_BUG_FIX_TK54)
    62296811        clipMv(cColMv);
     6812#endif
    62306813        pDInfo->m_acNBDV = cColMv;
    62316814        pDInfo->m_aVIdxCan  = iTargetViewIdx;
     
    62966879        {
    62976880          TComMv cDispVec = cIDVInfo.m_acMvCand[iList][ curPos ];
     6881#if !(NTT_BUG_FIX_TK54)
    62986882          clipMv( cDispVec );
     6883#endif
    62996884          pDInfo->m_acNBDV = cDispVec;
    63006885          pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ];
     
    64267011    Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT );
    64277012    cMvPred->setHor( iDisp );
     7013#if !(NTT_BUG_FIX_TK54)
    64287014    clipMv(*cMvPred);
     7015#endif
    64297016  }
    64307017}
     
    64527039        if (refViewIdx != m_pcSlice->getViewIndex())
    64537040        {
     7041#if !(NTT_BUG_FIX_TK54)
    64547042          clipMv(cMvPred);
     7043#endif
    64557044          pNbDvInfo->m_acNBDV = cMvPred;
    64567045          pNbDvInfo->m_aVIdxCan = refViewIdx;
     
    66357224
    66367225  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     7226#if SEC_VER_DONBDV_H0103
     7227  if( depthRefineFlag )
     7228  {
     7229    cDv.setVer(0);
     7230  }
     7231#endif
    66377232
    66387233  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     
    67437338, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    67447339#endif
     7340#if SEC_ADAPT_DISABLE_IVMP
     7341, Bool bICFlag
     7342#endif
    67457343)
    67467344{
     
    67717369
    67727370  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     7371#if SEC_VER_DONBDV_H0103
     7372  if( depthRefineFlag )
     7373  {
     7374    cDv.setVer(0);
     7375  }
     7376#endif
    67737377
    67747378  Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
     
    67787382    pacPdmMv[i].setIDVFlag   (false);
    67797383  }
     7384#endif
     7385
     7386#if SEC_ADAPT_DISABLE_IVMP
     7387  if(!bICFlag)
     7388  {
    67807389#endif
    67817390
     
    67867395  if(!m_pcSlice->getIsDepth())
    67877396  {
     7397#if MTK_DIS_SPBIP8X4_H0205
     7398    if (!getDBBPFlag(0))
     7399#else
    67887400    if( getPartitionSize(0) == SIZE_2Nx2N )
     7401#endif
    67897402    {
    67907403      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     
    68597472#endif
    68607473#endif
     7474#if !(NTT_BUG_FIX_TK54)
    68617475                    clipMv( cMv );
     7476#endif
    68627477                    paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
    68637478                    pacPdmMv      [ uiCurrRefListId ] = cMv;
     
    69177532                            cMv.setIDVVId    (iViewIndex);
    69187533                          }
    6919 
     7534                         
     7535#if !(NTT_BUG_FIX_TK54)
    69207536                          clipMv( cMv );
     7537#endif
    69217538                          bLoop_stop = true;
    69227539
     
    69397556
    69407557            }
     7558#if MTK_DIS_SPBIP8X4_H0205
     7559            if (iSPHeight + iSPWidth == 12)
     7560            {
     7561              if (puhInterDirSP[iPartition] == 3)
     7562              {
     7563                puhInterDirSP[iPartition] = 1;
     7564                pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     7565              }
     7566            }
     7567#endif
    69417568            iPartition ++;
    69427569          }
     
    69607587    iCurrPosY  += ( iHeight >> 1 );
    69617588  }
     7589#if MTK_DIS_SPBIP8X4_H0205
     7590  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7591#else
    69627592  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7593#endif
    69637594#else
    69647595  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     
    70187649#endif
    70197650#endif
     7651#if !(NTT_BUG_FIX_TK54)
    70207652                  clipMv( cMv );
     7653#endif
    70217654                  paiPdmRefIdx  [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx;
    70227655                  pacPdmMv      [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv;
     
    70327665  }
    70337666#if H_3D_SPIVMP
     7667#if H_3D_FIX_DBBP_IVMP
     7668  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7669#else
    70347670  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7671#endif
    70357672#else
    70367673  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     
    70407677  }
    70417678
     7679#if SEC_ADAPT_DISABLE_IVMP
     7680  }
     7681#endif
    70427682
    70437683  ////////////////////////////////
     
    70717711#endif
    70727712            cMv.setVer( 0 );
     7713#if !(NTT_BUG_FIX_TK54)
    70737714            clipMv( cMv );
     7715#endif
    70747716            pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
    70757717          }
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r884 r950  
    7070  Bool        abMergeFlag[2];       // for two segments
    7171  UChar       auhMergeIndex[2];     // for two segments
     72#if !RWTH_DBBP_NO_SPU_H0057
    7273  Char        ahVSPFlag[2];         // for two segments
    7374  DisInfo     acDvInfo[2];          // for two segments
     75#endif
    7476 
    7577  PartSize    eVirtualPartSize;
     
    193195  Bool*         m_pbSDCFlag;
    194196  Pel*          m_apSegmentDCOffset[2];
     197#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     198  Pel          m_apDmmPredictor[2];
     199#endif
    195200#endif
    196201#endif
     
    233238#endif
    234239
     240#if ETRIKHU_CLEANUP_H0083
     241  TComMotionCand  m_mergCands[MRG_IVSHIFT+1];
     242  Int           m_baseListidc;
     243#endif
     244
    235245protected:
    236246 
     
    239249  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    240250#if H_3D_VSP
     251#if ETRIKHU_CLEANUP_H0083
     252  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount);
     253#else
    241254  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    242255                             Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo);
    243256#endif
     257#endif
    244258#if H_3D_IV_MERGE
     259#if ETRIKHU_CLEANUP_H0083
     260  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
     261#else
    245262  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv,
    246263                               Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo   );
     264#endif
     265#if ETRIKHU_CLEANUP_H0083
     266  Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
     267#else
    247268  Bool          xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int*  ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand );
     269#endif
    248270#endif
    249271
     
    485507   
    486508#if H_3D
     509#if !ETRIKHU_CLEANUP_H0083
    487510  Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
     511#endif
    488512  Bool          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    489513  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
     
    508532#if H_3D_SPIVMP
    509533    , TComMvField* pcMFieldSP, UChar* puhInterDirSP
     534#endif
     535#if SEC_ADAPT_DISABLE_IVMP
     536    , Bool bICFlag
    510537#endif
    511538    );   
     
    556583  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    557584  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
     585#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     586  Void          setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; }
     587  Pel           getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; }
     588#endif
    558589  UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
    559590  UInt          getCtxAngleFlag        ( UInt   uiAbsPartIdx );
     
    635666  Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;}
    636667  Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;}
     668#if ETRIKHU_CLEANUP_H0083
    637669  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
     670  Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     671#if H_3D_VSP
     672    , Int* vspFlag
     673#endif
     674#if H_3D_SPIVMP
     675    , Bool* pbSPIVMPFlag
     676#endif
     677    , Int& numValidMergeCand
     678    );
     679#else
     680  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
     681#endif
    638682  Void          getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1);
    639683  Void          xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     
    642686#endif
    643687#if H_3D_VSP
     688#if !ETRIKHU_CLEANUP_H0083
    644689                                            , Int* vspFlag
     690#endif
    645691                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
    646692#endif
    647693#if H_3D_SPIVMP
     694#if ETRIKHU_CLEANUP_H0083
     695                                            , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     696#else
    648697                                            , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     698#endif
    649699#endif
    650700                                            , Int& numValidMergeCand, Int mrgCandIdx = -1
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r884 r950  
    198198//! \}
    199199
     200#if ETRIKHU_CLEANUP_H0083
     201class TComMotionCand
     202{
     203public:
     204  Bool                  m_bAvailable;
     205  TComMvField           m_cMvField[2];
     206  UChar                 m_uDir;
     207#if H_3D_VSP
     208  Int                   m_iVspFlag;
     209#endif 
     210  Bool                  m_bSPIVMPFlag;
     211
     212public:
     213  TComMotionCand()
     214  {
     215    m_bAvailable = false;
     216    m_uDir = 0;
     217#if H_3D_VSP
     218    m_iVspFlag = 0;
     219#endif
     220    m_bSPIVMPFlag = false;
     221  }
     222
     223  ~TComMotionCand()
     224  {
     225
     226  }
     227
     228  Void init()
     229  {
     230    TComMv cZeroMv;
     231
     232    m_bAvailable = false;
     233    m_uDir = 0;
     234#if H_3D_VSP
     235    m_iVspFlag = 0;
     236#endif
     237    m_bSPIVMPFlag = false;
     238    m_cMvField[0].setMvField(cZeroMv, NOT_VALID);
     239    m_cMvField[1].setMvField(cZeroMv, NOT_VALID);
     240  }
     241
     242  Void setCand(TComMvField* pcMvFieldNeighbours, UChar uhInterDirNeighbours
     243#if H_3D_VSP
     244    , Int vspFlag
     245#endif
     246    , Bool bSPIVMPFlag
     247    )
     248  {
     249    m_bAvailable = true;
     250    m_cMvField[0] = pcMvFieldNeighbours[0];
     251    m_cMvField[1] = pcMvFieldNeighbours[1];
     252    m_uDir = uhInterDirNeighbours;
     253#if H_3D_VSP
     254    m_iVspFlag = vspFlag;
     255#endif
     256    m_bSPIVMPFlag = bSPIVMPFlag;
     257  }
     258
     259
     260  Void getCand(Int iCount, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
     261#if H_3D_VSP
     262    , Int* vspFlag
     263#endif
     264    , Bool* pbSPIVMPFlag
     265    )
     266  {
     267    pcMvFieldNeighbours[iCount<<1] = m_cMvField[0];
     268    pcMvFieldNeighbours[(iCount<<1) + 1] = m_cMvField[1];
     269    puhInterDirNeighbours[iCount] = m_uDir;
     270#if H_3D_VSP
     271    vspFlag[iCount] = m_iVspFlag;
     272#endif
     273    pbSPIVMPFlag[iCount] = m_bSPIVMPFlag;
     274  }
     275};
     276#endif
     277
     278
    200279#endif // __TCOMMOTIONINFO__
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r884 r950  
    500500  Pel* pDst = piPred;
    501501  xAssignBiSegDCs( pDst, uiStride, biSegPattern, patternStride, segDC1, segDC2 );
     502#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     503  pcCU->setDmmPredictor(segDC1, 0);
     504  pcCU->setDmmPredictor(segDC2, 1);
     505#endif
    502506
    503507#if H_3D_DIM_DMM
     
    519523      Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC();
    520524      Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC();
     525#if MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085
     526      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
     527#else
    521528      if(RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
     529#endif
    522530      {
    523531        return true;
     
    639647 
    640648  // start mapping process
     649#if !MTK_DBBP_AMP_REM_H0072
    641650  Bool bAMPAvail = uiSize > 8;
    642651  Int matchedPartSum[6][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}}; // counter for each part size and boolean option
    643652  PartSize virtualPartSizes[6] = { SIZE_Nx2N, SIZE_2NxN, SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N };
     653#else
     654  Int matchedPartSum[2][2] = {{0,0},{0,0}}; // counter for each part size and boolean option
     655  PartSize virtualPartSizes[2] = { SIZE_Nx2N, SIZE_2NxN};
     656#endif
    644657 
    645658  UInt uiHalfSize = uiSize>>1;
     659#if !MTK_DBBP_AMP_REM_H0072
    646660  UInt uiQuarterSize = uiSize>>2;
     661#endif
    647662 
    648663  for (Int y=0; y<uiSize; y+=iSubSample)
     
    677692      }
    678693     
     694#if !MTK_DBBP_AMP_REM_H0072
    679695      if( bAMPAvail )
    680696      {
     
    719735        }
    720736      }
     737#endif
    721738    }
    722739   
     
    728745 
    729746  Int iMaxMatchSum = 0;
    730   for(Int p=0; p<6; p++)  // loop over partition sizes
     747#if !MTK_DBBP_AMP_REM_H0072
     748  for(Int p=0; p<6; p++)  // loop over partition
     749#else
     750  for(Int p=0; p<2; p++)  // loop over partition
     751#endif
    731752  {
    732753    for( Int b=0; b<=1; b++ ) // loop over boolean options
     
    838859 
    839860  UInt  uiMaskStride= MAX_CU_SIZE;
     861#if SEC_DBBP_FILTERING_H0104
     862  Pel  filSrc = 0;
     863  Pel* tmpTar = 0;
     864  tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight);
     865#endif
    840866 
    841867  // backup pointer
     
    851877     
    852878      // filtering
     879#if SEC_DBBP_FILTERING_H0104
     880      tmpTar[y*uiWidth+x] = piSrc[ucSegment][x];
     881#else
    853882      Bool t = (y==0)?pMaskStart[(y+1)*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];
    854883      Bool l = (x==0)?pMaskStart[y*uiMaskStride+x+1]:pMaskStart[y*uiMaskStride+x-1];
     
    858887      Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r));
    859888      piDst[x] = bBlend?((piSrc[0][x]+piSrc[1][x]+1)>>1):piSrc[ucSegment][x];
     889#endif
    860890    }
    861891   
    862892    piSrc[0]  += uiSrcStride;
    863893    piSrc[1]  += uiSrcStride;
     894#if !SEC_DBBP_FILTERING_H0104
    864895    piDst     += uiDstStride;
     896#endif
    865897    pMask     += uiMaskStride;
    866898  }
     899 
     900#if SEC_DBBP_FILTERING_H0104
     901  for (Int y=0; y<uiHeight; y++)
     902  {
     903    for (Int x=0; x<uiWidth; x++)
     904    {
     905      Bool t = (y==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];
     906      Bool l = (x==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x-1];
     907      Bool b = (y==uiHeight-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x];
     908      Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x+1];
     909      Bool c =pMaskStart[y*uiMaskStride+x];
     910
     911      Pel left, right, top, bottom;
     912      left   = (x==0)          ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x-1];
     913      right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
     914      top    = (y==0)          ? tmpTar[y*uiWidth+x] : tmpTar[(y-1)*uiWidth+x];
     915      bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
     916
     917      if(!((l&&r&&c) || (!l&&!r&&!c)))
     918      {
     919        filSrc = Clip3( Pel( 0 ), Pel( 255 ), Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ));
     920      }
     921      else
     922      {
     923        filSrc = tmpTar[y*uiWidth+x];
     924      }
     925
     926      if(!((t&&b&&c) || (!t&&!b&&!c)))
     927      {
     928        filSrc = Clip3( Pel( 0 ), Pel( 255 ), Pel(( top + (filSrc << 1) + bottom ) >> 2 ));
     929      }
     930      piDst[x] = filSrc;
     931    }
     932    piDst     += uiDstStride;
     933  }
     934  if ( tmpTar    ) { xFree(tmpTar);             tmpTar        = NULL; }
     935#endif
    867936 
    868937  // now combine chroma
     
    875944  UInt  uiWidthC        = uiWidth >> 1;
    876945  UInt  uiHeightC       = uiHeight >> 1;
     946#if SEC_DBBP_FILTERING_H0104
     947  Pel  filSrcU = 0, filSrcV = 0;
     948  Pel* tmpTarU = 0, *tmpTarV = 0;
     949  tmpTarU = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC);
     950  tmpTarV = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC);
     951#endif
    877952  pMask = pMaskStart;
    878953 
     
    885960     
    886961      // filtering
     962#if SEC_DBBP_FILTERING_H0104
     963      tmpTarU[y*uiWidthC+x] = piSrcU[ucSegment][x];
     964      tmpTarV[y*uiWidthC+x] = piSrcV[ucSegment][x];
     965#else
    887966      Bool t = (y==0)?pMaskStart[(y+1)*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];
    888967      Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+(x+1)*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];
     
    894973      piDstU[x] = bBlend?((piSrcU[0][x]+piSrcU[1][x]+1)>>1):piSrcU[ucSegment][x];
    895974      piDstV[x] = bBlend?((piSrcV[0][x]+piSrcV[1][x]+1)>>1):piSrcV[ucSegment][x];
     975#endif
    896976    }
    897977   
     
    900980    piSrcV[0]   += uiSrcStrideC;
    901981    piSrcV[1]   += uiSrcStrideC;
     982#if !SEC_DBBP_FILTERING_H0104
    902983    piDstU      += uiDstStrideC;
    903984    piDstV      += uiDstStrideC;
     985#endif
    904986    pMask       += 2*uiMaskStride;
    905987  }
     988
     989#if SEC_DBBP_FILTERING_H0104
     990  for (Int y=0; y<uiHeightC; y++)
     991  {
     992    for (Int x=0; x<uiWidthC; x++)
     993    {
     994      Bool t = (y==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];
     995      Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];
     996      Bool b = (y==uiHeightC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2];
     997      Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2];
     998      Bool c =pMaskStart[y*2*uiMaskStride+x*2];
     999
     1000      Pel leftU, rightU, topU, bottomU;
     1001      leftU   = (x==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x-1];
     1002      rightU  = (x==uiWidthC-1)  ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x+1];
     1003      topU    = (y==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y-1)*uiWidthC+x];
     1004      bottomU = (y==uiHeightC-1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y+1)*uiWidthC+x];
     1005
     1006      Pel leftV, rightV, topV, bottomV;
     1007      leftV   = (x==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x-1];
     1008      rightV  = (x==uiWidthC-1)  ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x+1];
     1009      topV    = (y==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y-1)*uiWidthC+x];
     1010      bottomV = (y==uiHeightC-1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y+1)*uiWidthC+x];
     1011
     1012      if(!((l&&r&&c) || (!l&&!r&&!c)))
     1013      {
     1014        filSrcU = Clip3( Pel( 0 ), Pel( 255 ), Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
     1015        filSrcV = Clip3( Pel( 0 ), Pel( 255 ), Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));
     1016      }
     1017      else
     1018      {
     1019        filSrcU = tmpTarU[y*uiWidthC+x];
     1020        filSrcV = tmpTarV[y*uiWidthC+x];
     1021      }
     1022
     1023      if(!((t&&b&&c) || (!t&&!b&&!c)))
     1024      {
     1025        filSrcU = Clip3( Pel( 0 ), Pel( 255 ), Pel(( topU + (filSrcU << 1) + bottomU ) >> 2 ));
     1026        filSrcV = Clip3( Pel( 0 ), Pel( 255 ), Pel(( topV + (filSrcV << 1) + bottomV ) >> 2 ));
     1027      }
     1028
     1029      piDstU[x] = filSrcU;
     1030      piDstV[x] = filSrcV;
     1031    }
     1032    piDstU      += uiDstStrideC;
     1033    piDstV      += uiDstStrideC;
     1034  }
     1035  if ( tmpTarU    ) { xFree(tmpTarU);             tmpTarU        = NULL; }
     1036  if ( tmpTarV    ) { xFree(tmpTarV);             tmpTarV        = NULL; }
     1037#endif
    9061038}
    9071039#endif
     
    12861418
    12871419    assert ( cDistparity.bDV );
    1288 
     1420   
     1421#if NTT_BUG_FIX_TK54
     1422    TComMv cNBDV = cDistparity.m_acNBDV;
     1423    pcCU->clipMv( cNBDV );
     1424   
     1425    pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
     1426    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
     1427    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
     1428#else
    12891429    pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
    12901430    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true );
    12911431    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true );
     1432#endif
    12921433   
    12931434    pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
     
    21872328  if (orgDC == false)
    21882329  {
     2330#if !HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    21892331    if ( getDimType(uiIntraMode) == DMM1_IDX )
    21902332    {
     
    22322374    }
    22332375    else
     2376#endif
    22342377    {
    22352378      Pel* pLeftTop = pOrig;
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r872 r950  
    360360Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
    361361
     362#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     363UInt g_aICEnableCANDIDATE[10] = { 0, };
     364UInt g_aICEnableNUM[ 10 ] = { 0, };
     365Int g_lastlayer=0;
     366#endif
    362367#if ENC_DEC_TRACE
    363368FILE*  g_hTrace = NULL;
  • trunk/source/Lib/TLibCommon/TComRom.h

    r872 r950  
    189189extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
    190190
     191#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     192extern UInt g_aICEnableCANDIDATE[10];
     193extern UInt g_aICEnableNUM[ 10 ]; //10 layers
     194extern Int g_lastlayer;
     195#endif
     196
    191197#ifndef ENC_DEC_TRACE
    192198#define ENC_DEC_TRACE   0
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r884 r950  
    32203220#endif
    32213221#if H_3D_IC
     3222#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     3223Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc)
     3224#else
    32223225Void TComSlice::xSetApplyIC()
    3223 {
     3226#endif
     3227{
     3228#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     3229  if(bUseLowLatencyICEnc)
     3230  {
     3231    Bool existInterViewRef=false;
     3232    TComPic* pcCurrPic = getPic();
     3233    TComPic* pcRefPic = NULL;
     3234    for ( Int i = 0; (i < getNumRefIdx( REF_PIC_LIST_0 )) && !existInterViewRef; i++ )
     3235    {
     3236      pcRefPic = getRefPic( REF_PIC_LIST_0, i );
     3237      if ( pcRefPic != NULL )
     3238      {
     3239        if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
     3240        {
     3241          existInterViewRef = true;       
     3242        }
     3243      }
     3244    }
     3245
     3246    for ( Int i = 0; (i < getNumRefIdx( REF_PIC_LIST_1 )) && !existInterViewRef; i++ )
     3247    {
     3248      pcRefPic = getRefPic( REF_PIC_LIST_1, i );
     3249      if ( pcRefPic != NULL )
     3250      {
     3251        if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
     3252        {
     3253          existInterViewRef = true;       
     3254        }
     3255      }
     3256    }
     3257
     3258    if(!existInterViewRef)
     3259    {
     3260      m_bApplyIC = false;
     3261    }
     3262    else
     3263    {
     3264      Int curLayer=getDepth();
     3265      if( curLayer>9) curLayer=9; // Max layer is 10
     3266
     3267      m_bApplyIC = true;
     3268      Int refLayer = curLayer-1;
     3269      if( (refLayer>=0) && (g_aICEnableCANDIDATE[refLayer]>0) )
     3270      {   
     3271        Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]);
     3272
     3273        if( ratio > MTK_LOW_LATENCY_IC_ENCODING_THRESHOLD_H0086)
     3274{
     3275          m_bApplyIC=true;
     3276        }
     3277        else
     3278        {
     3279          m_bApplyIC=false;
     3280        }
     3281      }
     3282      g_aICEnableNUM[curLayer]=0;
     3283      g_aICEnableCANDIDATE[curLayer]=0;
     3284      g_lastlayer=getDepth();
     3285    }
     3286  }
     3287  else
     3288  {
     3289#endif
    32243290  Int iMaxPelValue = ( 1 << g_bitDepthY );
    32253291  Int *aiRefOrgHist;
     
    32953361  aiCurrHist = NULL;
    32963362  aiRefOrgHist = NULL;
     3363#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     3364  }//if(bUseLowLatencyICEnc)
     3365#endif
    32973366}
    32983367#endif
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r884 r950  
    21792179  Bool      getApplyIC()                                        { return m_bApplyIC; }
    21802180  Void      xSetApplyIC();
     2181#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     2182  Void      xSetApplyIC(Bool bUseLowLatencyICEnc);
     2183#endif
    21812184  Void      setIcSkipParseFlag( Bool b )                        { m_icSkipParseFlag = b; }
    21822185  Bool      getIcSkipParseFlag()                                { return m_icSkipParseFlag; }
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r884 r950  
    6565#define H_3D          ( HEVC_EXT == 2)
    6666
     67#define NTT_BUG_FIX_TK54    1
     68
    6769
    6870/////////////////////////////////////////////////////////////////////////////////////////
     
    107109                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
    108110
     111
    109112#define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    110113                                              // Unifying rounding offset, for IC part, JCT3V-D0135
     
    116119                                              // MTK_IC_FLAG_CABAC_SIMP_G0061
    117120                                              // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
     121
    118122
    119123#if H_3D_NBDV
     
    157161                                              // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074
    158162                                              // QC_DEPTH_MERGE_SIMP_G0127 Remove DV candidate and shifting candidate for depth coding
     163
    159164
    160165#define H_3D_TMVP                         1   // QC_TMVP_C0047
     
    192197                                              // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split
    193198
    194 
    195 
    196199#define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
    197200                                              // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding
     
    307310#endif
    308311
     312
     313/////////////////////////////////////////////////////////////////////////////////////////
     314///////////////////////////////////   HTM-11.0 Integrations                  //////////////////////////////
     315/////////////////////////////////////////////////////////////////////////////////////////
     316#if H_3D
     317#define  H_3D_FIX_DBBP_IVMP                1  // Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself.
     318
     319#define MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 1   // Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
     320#define MTK_LOW_LATENCY_IC_ENCODING_H0086   1 // Low-latency IC encoding in JCT3V-H0086
     321#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     322#define MTK_LOW_LATENCY_IC_ENCODING_THRESHOLD_H0086    0.1 // Threshold for low-latency IC encoding in JCT3V-H0086
     323#endif
     324#define SEC_ADAPT_DISABLE_IVMP            1   // Disalbing IVMP merge candidates when IC is enabled, JCT3V-H0070
     325
     326#define MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113     1 // Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113
     327#define MTK_SDC_FLAG_FIX_H0095            1   // Remove conditional check of PCM flag based on SDC flag, JCTVC-H0095
     328#define MTK_DMM_SIMP_CODE_H0092           1   // Remove CABAC context for DMM1 mode coding
     329
     330
     331#define QC_IV_PRED_CONSTRAINT_H0137       1   // Constraint on inter-view (motion) prediction tools
     332#define ETRIKHU_BUGFIX_H0083              1   // bug-fix for DV candidate pruning
     333#define ETRIKHU_CLEANUP_H0083             1   // cleaned-up source code for constructing merging candidate list
     334#define ETRIKHU_CLEANUP_H0083_MISSING     1   // missing guard macros added by GT
     335#define SHARP_SIMPLE_MERGE_H0062          1   // Restrict 3D-HEVC merge cand in small PUs
     336#define MTK_DIS_SPBIP8X4_H0205            1   // Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
     337
     338#if H_3D_NBDV
     339#define SEC_VER_DONBDV_H0103              1   // Vertical DV Restriction for DoNBDV
     340#endif
     341
     342#if H_3D_DIM
     343#define HS_DMM_SDC_PREDICTOR_UNIFY_H0108  1   // Unification of DMM and SDC predictor derivation
     344#define LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135  1 // Use only one context for CABAC of dim_not_present_flag
     345#define QC_SIMP_DELTADC_CODING_H0131      1   // Simplify detaDC entropy coding
     346
     347#if H_3D_DIM_DLT
     348#define SEC_NO_RESI_DLT_H0105             1
     349#define MTK_DLT_CODING_FIX_H0091          1
     350#endif
     351#endif
     352#if H_3D_DBBP
     353#define MTK_DBBP_AMP_REM_H0072                 1
     354#define RWTH_DBBP_NO_SPU_H0057                 1
     355#define SEC_DBBP_FILTERING_H0104               1
     356#define MTK_DBBP_SIGNALING_H0094               1   
     357#endif
     358
     359#define MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133    1
     360#endif
    309361/////////////////////////////////////////////////////////////////////////////////////////
    310362///////////////////////////////////   TBD                  //////////////////////////////
     
    313365// #define H_MV_HLS_7_POC_P0041_3            0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above)
    314366// #define H_MV_HLS_7_POC_P0041_FIXES        0 // (POC/P0041/Fixes) For each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture.
    315 // #define H_MV_HLS_7_POC_P0056_4            0 // (POC/P0056/layer tree poc) #4 Proposal 1: If the POC reset approach is adopted as the basis for multi-layer POC derivation, it is proposed to derive the POC anchor picture from the previous TID0 picture (that is not a RASL picture, a RADL picture or a sub-layer non-reference picture and not with discardable_flag equal to 1) of  the current layer or any of its reference layer. This is asserted to improve loss resilience and reduce bit rate overhead. Decision: Adopt Proposal 1 (with the suggested modifications – with text provided as P0297).
     367// #define H_MV_HLS_7_POC_P0056_4            0 // (POC/P0056/layer tree poc) #4 Proposal 1: If the POC reset approach is adopted as the basis for multi-layer POC derivation, it is proposed to derive the POC anchor picture from the previous TID0 picture (that is not a RASL picture, a RADL picture or a sub-layer non-reference picture and not with discardable_flag equal to 1) of  the current layer or any of its reference layer. This is asserted to improve loss resilience and reduce bit rate overhead. Decision: Adopt Proposal 1 (with the suggested modifications Ewith text provided as P0297).
    316368
    317369// #define H_MV_HLS_7_SEI_P0133_28           0 // (SEI/P0133/Recovery point SEI) #28 Decision: Adopt change to recover point semantics only (-v3)
     
    323375
    324376#define H_MV_HLS7_GEN                        0  // General changes (not tested)
    325 
    326377
    327378
     
    797848};
    798849
     850/// merging candidates
     851#if ETRIKHU_CLEANUP_H0083
     852enum DefaultMergCandOrder
     853{
     854  MRG_T = 0,            ///< MPI
     855  MRG_D,                ///< DDD
     856  MRG_IVMC,             ///< Temporal inter-view
     857  MRG_A1,               ///< Left
     858  MRG_B1,               ///< Above
     859  MRG_B0,               ///< Above right
     860  MRG_IVDC,             ///< Disparity inter-view
     861  MRG_VSP,              ///< VSP
     862  MRG_A0,               ///< Left bottom
     863  MRG_B2,               ///< Above left
     864  MRG_IVSHIFT,          ///< Shifted IVMC of Shifted IVDC. (These are mutually exclusive)
     865  MRG_COL               ///< Temporal co-located
     866};
     867#endif
     868
    799869/// coefficient scanning type used in ACS
    800870enum COEFF_SCAN_TYPE
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r884 r950  
    440440
    441441            READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]");
     442
     443#if  MTK_DLT_CODING_FIX_H0091
     444            if( uiCode )
     445            {
     446                assert( pcDLT->getUseDLTFlag( 1 ));
     447            }
     448#endif
     449
    442450            pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false );
    443451
     
    17511759#if H_3D_IV_MERGE
    17521760        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
     1761#if QC_IV_PRED_CONSTRAINT_H0137
     1762        if( !pcVPS->getNumDirectRefLayers(i) )
     1763        {
     1764          assert( !uiCode );         
     1765        }
     1766#endif
    17531767#if H_3D_SPIVMP
    17541768        READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3);
     
    17571771#if H_3D_ARP
    17581772        READ_FLAG( uiCode, "iv_res_pred_flag[i]"  );       pcVPS->setUseAdvRP  ( i, uiCode ); pcVPS->setARPStepNum( i, uiCode ? H_3D_ARP_WFNR : 1 );
    1759 
     1773#if QC_IV_PRED_CONSTRAINT_H0137
     1774        if( !pcVPS->getNumDirectRefLayers(i) )
     1775        {
     1776          assert( !uiCode );         
     1777        }
     1778#endif
    17601779#endif
    17611780#if H_3D_NBDV_REF
     
    17641783#if H_3D_VSP
    17651784        READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false );
     1785#if QC_IV_PRED_CONSTRAINT_H0137
     1786        if( !pcVPS->getNumDirectRefLayers(i) )
     1787        {
     1788          assert( !uiCode );         
     1789        }
     1790#endif
    17661791#endif
    17671792#if H_3D_DBBP
     
    17751800        {
    17761801          READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
     1802#if QC_IV_PRED_CONSTRAINT_H0137
     1803          if( !pcVPS->getNumDirectRefLayers(i) )
     1804          {
     1805            assert( !uiCode );         
     1806          }
     1807#endif
    17771808        }
    17781809#endif
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r884 r950  
    431431    m_ppcCU[uiDepth]->initAvailableFlags();
    432432    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    433     m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
     433    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
     434#if !ETRIKHU_CLEANUP_H0083
     435      ,vspFlag
     436#endif
     437      , inheritedVSPDisInfo
    434438#if H_3D_SPIVMP
    435       , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     439#if !ETRIKHU_CLEANUP_H0083_MISSING
     440      , bSPIVMPFlag
     441#endif
     442      , pcMvFieldSP, puhInterDirSP
    436443#endif
    437444      , numValidMergeCand, uiMergeIndex );
     445
     446#if ETRIKHU_CLEANUP_H0083
     447    m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
     448#if H_3D_SPIVMP
     449      , bSPIVMPFlag
     450#endif
     451      , numValidMergeCand );
     452#endif
    438453    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    439454#else
     
    782797    }
    783798   
     799#if RWTH_DBBP_NO_SPU_H0057
     800    AOF( pcCU->getARPW(uiPartAddr) == 0 );
     801    AOF( pcCU->getICFlag(uiPartAddr) == false );
     802    AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false );
     803    AOF( pcCU->getVSPFlag(uiPartAddr) == 0 );
     804#else
    784805    pDBBPTmpData->ahVSPFlag[uiSegment] = pcCU->getVSPFlag( uiPartAddr );
    785806    pDBBPTmpData->acDvInfo[uiSegment] = pcCU->getDvInfo( uiPartAddr );
     807#endif
    786808  }
    787809 
     
    793815    pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth );
    794816   
     817#if !RWTH_DBBP_NO_SPU_H0057
    795818    pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], 0, 0, uiDepth );
    796819    pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], 0, 0, uiDepth );
     820#endif
    797821   
    798822    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    816840    pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth);
    817841   
     842#if !RWTH_DBBP_NO_SPU_H0057
    818843    pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uiDepth );
    819844    pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uiDepth );
     845#endif
    820846   
    821847    pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level
     
    920946    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    921947    {
    922 #if H_3D
     948#if H_3D && !SEC_NO_RESI_DLT_H0105
    923949      if ( useDltFlag )
    924950      {
     
    12311257  // get DC prediction for each segment
    12321258  Pel apDCPredValues[2];
     1259#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     1260  if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )
     1261  {
     1262    apDCPredValues[0] = pcCU->getDmmPredictor( 0 );
     1263    apDCPredValues[1] = pcCU->getDmmPredictor( 1 );
     1264  }
     1265  else
     1266#endif
    12331267  m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
    12341268 
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r884 r950  
    139139 
    140140#if H_3D_DBBP
     141
     142#if MTK_DBBP_SIGNALING_H0094
     143  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
     144#else
    141145  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
     146#endif
    142147  {
    143148    decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
     
    145150    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
    146151    {
     152#if !MTK_DBBP_SIGNALING_H0094
    147153      AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
     154#endif
    148155     
    149156      // get collocated depth block
     
    161168     
    162169      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
     170     
     171#if RWTH_DBBP_NO_SPU_H0057
     172      // make sure that DBBP flag is set for both segments
     173      UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
     174      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
     175      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
     176#endif
    163177    }
    164178  }
     
    196210    return;
    197211  }
     212#if !MTK_SDC_FLAG_FIX_H0095
    198213#if H_3D_DIM_SDC
    199214  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     
    201216    return;
    202217  }
     218#endif
    203219#endif
    204220 
     
    292308          pcSubCU->initAvailableFlags();
    293309          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    294           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
     310          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
     311#if !ETRIKHU_CLEANUP_H0083
     312            ,vspFlag
     313#endif
     314            , inheritedVSPDisInfo
    295315#if H_3D_SPIVMP
    296             , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     316#if !ETRIKHU_CLEANUP_H0083_MISSING
     317            , bSPIVMPFlag
     318#endif
     319            , pcMvFieldSP, puhInterDirSP
    297320#endif
    298321            , numValidMergeCand );
     322
     323#if ETRIKHU_CLEANUP_H0083
     324          pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
     325#if H_3D_SPIVMP
     326            , bSPIVMPFlag
     327#endif
     328            , numValidMergeCand );
     329#endif
    299330          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    300331
     
    329360        pcSubCU->initAvailableFlags();
    330361        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    331         pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
     362        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
     363#if !ETRIKHU_CLEANUP_H0083
     364          , vspFlag
     365#endif
     366          , inheritedVSPDisInfo
    332367#if H_3D_SPIVMP
    333           , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     368#if !ETRIKHU_CLEANUP_H0083_MISSING
     369            , bSPIVMPFlag
     370#endif
     371          , pcMvFieldSP, puhInterDirSP
    334372#endif
    335373          ,numValidMergeCand, uiMergeIndex );
     374
     375#if ETRIKHU_CLEANUP_H0083
     376        pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
     377#if H_3D_SPIVMP
     378          , bSPIVMPFlag
     379#endif
     380          ,numValidMergeCand );
     381#endif
    336382        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    337383        if(vspFlag[uiMergeIndex])
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r884 r950  
    8787, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    8888, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    89 #if H_3D_DIM_DMM
     89#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    9090, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    9191#endif
     
    171171  m_cDdcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_DATA );
    172172  m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
    173 #if H_3D_DIM_DMM
     173#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    174174  m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
    175175#endif
     
    241241  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    242242  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    243 #if H_3D_DIM_DMM
     243#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    244244  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    245245#endif
     
    386386    uiCount++;
    387387  }
     388#if QC_SIMP_DELTADC_CODING_H0131
     389  while( uiSymbol && ( uiCount != 3 ) );
     390#else
    388391  while( uiSymbol && ( uiCount != 13 ) );
    389 
     392#endif
    390393  ruiSymbol = uiCount - 1;
    391394
     
    423426  for( Int i = 0; i < iNumBit; i++ )
    424427  {
     428#if MTK_DMM_SIMP_CODE_H0092
     429      m_pcTDecBinIf->decodeBinEP( uiSymbol );
     430#else
    425431    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm1DataSCModel.get(0, 0, 0) );
     432#endif
    426433    uiIdx += uiSymbol << i;
    427434  }
     
    11281135  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
    11291136  {
     1137#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
     1138    m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
     1139#else
    11301140    m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
     1141#endif
    11311142  }
    11321143  else
     
    20682079    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
    20692080    uiNumSegments = isDimMode( dir ) ? 2 : 1;
    2070 
     2081#if MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113
     2082    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
     2083#else
    20712084    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
    2072 
     2085#endif
    20732086    if( pcCU->getSDCFlag( absPartIdx ) )
    20742087    {
     
    21412154Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    21422155{
     2156#if !MTK_DBBP_SIGNALING_H0094
    21432157  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
     2158#endif
    21442159  AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
    21452160  AOF( !pcCU->getSlice()->getIsDepth() );
     2161#if !MTK_DBBP_SIGNALING_H0094
    21462162  AOF( ePartSize == RWTH_DBBP_PACK_MODE );
     2163#endif
    21472164 
    21482165  UInt uiSymbol = 0;
     
    21532170  {
    21542171    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
     2172#if MTK_DIS_SPBIP8X4_H0205
     2173    UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;
     2174    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
     2175#endif
    21552176  }
    21562177}
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r884 r950  
    214214  ContextModel3DBuffer m_cDdcDataSCModel;
    215215  ContextModel3DBuffer m_cAngleFlagSCModel;
    216 #if H_3D_DIM_DMM
     216#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    217217  ContextModel3DBuffer m_cDmm1DataSCModel;
    218218#endif
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r872 r950  
    221221    }
    222222  }
     223#if  MTK_DLT_CODING_FIX_H0091
     224  if( pcSlice->getPPS()->getDLT() != NULL )
     225  {
     226      assert( pcSlice->getSPS()->getBitDepthY() == pcSlice->getPPS()->getDLT()->getDepthViewBitDepth() );
     227  }
     228#endif
    223229  for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr = rpcPic->getPicSym()->xCalculateNxtCUAddr(iCUAddr) )
    224230  {
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r884 r950  
    272272  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
    273273
     274  #if MTK_DLT_CODING_FIX_H0091
     275    if(( !pcPPS->getSPS()->getVPS()->getDepthId( pcPPS->getSPS()->getLayerId() ) )||
     276        pcPPS->getLayerId() != 1  )
     277    {
     278        pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false );
     279    }
     280  #endif
     281
    274282#if !H_MV
    275283  WRITE_FLAG( 0, "pps_extension_flag" );
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r884 r950  
    401401#if H_3D_IC
    402402  Bool      m_bUseIC;
     403#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     404  Bool      m_bUseICLowLatencyEnc;
     405#endif
    403406#endif
    404407#if H_3D_INTER_SDC
     
    511514  Void       setUseIC                       ( Bool bVal )    { m_bUseIC = bVal; }
    512515  Bool       getUseIC                       ()               { return m_bUseIC; }
     516#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     517  Void       setUseICLowLatencyEnc          ( Bool bVal )    { m_bUseICLowLatencyEnc = bVal; }
     518  Bool       getUseICLowLatencyEnc          ()               { return m_bUseICLowLatencyEnc; }
     519#endif
    513520#endif
    514521#if H_3D_INTER_SDC
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r884 r950  
    18141814    rpcTempCU->initAvailableFlags();
    18151815    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    1816     rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo
     1816    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1817#if !ETRIKHU_CLEANUP_H0083
     1818      , vspFlag
     1819#endif
     1820      , inheritedVSPDisInfo
    18171821#if H_3D_SPIVMP
    1818       , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     1822#if !ETRIKHU_CLEANUP_H0083_MISSING
     1823      , bSPIVMPFlag
     1824#endif
     1825      , pcMvFieldSP, puhInterDirSP
    18191826#endif
    18201827      , numValidMergeCand
    18211828      );
     1829
     1830#if ETRIKHU_CLEANUP_H0083
     1831    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
     1832#if H_3D_SPIVMP
     1833      , bSPIVMPFlag
     1834#endif
     1835      , numValidMergeCand
     1836      );
     1837#endif
     1838
    18221839#else
    18231840    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
     
    23832400    pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0);
    23842401   
     2402#if RWTH_DBBP_NO_SPU_H0057
     2403    AOF( rpcTempCU->getSPIVMPFlag(0) == false );
     2404    AOF( rpcTempCU->getVSPFlag(0) == 0 );
     2405#else
    23852406    pDBBPTmpData->ahVSPFlag[uiSegment] = rpcTempCU->getVSPFlag(0);
    23862407    pDBBPTmpData->acDvInfo[uiSegment] = rpcTempCU->getDvInfo(0);
     2408#endif
    23872409   
    23882410    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    24162438    rpcTempCU->setMergeIndexSubParts(pDBBPTmpData->auhMergeIndex[uiSegment], uiPartAddr, uiSegment, uhDepth);
    24172439   
     2440#if !RWTH_DBBP_NO_SPU_H0057
    24182441    rpcTempCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uhDepth);
    24192442    rpcTempCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uhDepth);
     2443#endif
    24202444   
    24212445    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r884 r950  
    163163    uiAbsPartIdx = 0;
    164164  }
    165 
     165#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     166  else
     167  {
     168    g_aICEnableCANDIDATE[pcCU->getSlice()->getDepth()]++;
     169    if(pcCU->getICFlag(uiAbsPartIdx))
     170    {
     171      g_aICEnableNUM[pcCU->getSlice()->getDepth()]++;
     172    }
     173  }
     174#endif
    166175  if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
    167176    m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
     
    246255 
    247256#if H_3D_DBBP
     257
     258#if MTK_DBBP_SIGNALING_H0094
     259  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
     260#else
    248261  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
     262#endif
    249263  {
    250264    encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
     
    252266    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
    253267    {
     268#if !MTK_DBBP_SIGNALING_H0094
    254269      AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
     270#endif
    255271      // restore virtual partition size for DBBP blocks
    256272      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
     
    274290    return;
    275291  }
     292#if !MTK_SDC_FLAG_FIX_H0095
    276293#if H_3D_DIM_SDC
    277294  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     
    279296    return;
    280297  }
     298#endif
    281299#endif
    282300 
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r884 r950  
    9393, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9494, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    95 #if H_3D_DIM_DMM
     95#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    9696, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    9797#endif
     
    169169  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    170170  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    171 #if H_3D_DIM_DMM
     171#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    172172  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    173173#endif
     
    255255      curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
    256256      curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
    257 #if H_3D_DIM_DMM
     257#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    258258      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
    259259#endif
     
    319319  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    320320  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    321 #if H_3D_DIM_DMM
     321#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    322322  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    323323#endif
     
    482482    m_pcBinIf->encodeBin( 1, rcSCModel );
    483483    UInt uiCount = 0;
     484#if QC_SIMP_DELTADC_CODING_H0131
     485    Bool bNoExGo = ( uiSymbol < 3 );
     486
     487    while( --uiSymbol && ++uiCount < 3 )
     488#else
    484489    Bool bNoExGo = (uiSymbol < 13);
    485490
    486491    while( --uiSymbol && ++uiCount < 13 )
     492#endif
    487493    {
    488494      m_pcBinIf->encodeBin( 1, rcSCModel );
     
    520526  for ( Int i = 0; i < iNumBit; i++ )
    521527  {
     528#if MTK_DMM_SIMP_CODE_H0092
     529      m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 );
     530#else
    522531    m_pcBinIf->encodeBin( ( uiTabIdx >> i ) & 1, m_cDmm1DataSCModel.get(0, 0, 0) );
     532#endif
    523533  }
    524534}
     
    12331243  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
    12341244  {
     1245#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
     1246    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
     1247#else
    12351248    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
     1249#endif
    12361250  }
    12371251  if( isDimMode( dir ) )
     
    23132327      dimDeltaDC = isDimDeltaDC( dir );
    23142328    }
    2315 
     2329#if MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113
     2330    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
     2331#else
    23162332    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
     2333#endif
    23172334  }
    23182335  else //all-zero inter SDC is not allowed
     
    23562373Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    23572374{
     2375#if !MTK_DBBP_SIGNALING_H0094
    23582376  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    23592377  AOF( ePartSize == RWTH_DBBP_PACK_MODE );
     2378#endif
    23602379  AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
    23612380  AOF( !pcCU->getSlice()->getIsDepth() );
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r884 r950  
    258258  ContextModel3DBuffer m_cDdcDataSCModel;
    259259  ContextModel3DBuffer m_cAngleFlagSCModel;
    260 #if H_3D_DIM_DMM
     260#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    261261  ContextModel3DBuffer m_cDmm1DataSCModel;
    262262#endif
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r884 r950  
    11461146        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    11471147        {
    1148 #if H_3D_DIM
     1148#if H_3D_DIM && !SEC_NO_RESI_DLT_H0105
    11491149          if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    11501150          {
     
    12211221      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    12221222      {
    1223 #if H_3D_DIM
     1223#if H_3D_DIM && !SEC_NO_RESI_DLT_H0105
    12241224        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    12251225        {
     
    19891989  // get DC prediction for each segment
    19901990  Pel apDCPredValues[2];
     1991#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
     1992  if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )
     1993  {
     1994    apDCPredValues[0] = pcCU->getDmmPredictor( 0 );
     1995    apDCPredValues[1] = pcCU->getDmmPredictor( 1 );
     1996  }
     1997  else
     1998#endif
    19911999  analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
    19922000
     
    36663674      pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[0], 0, 0, pcCU->getDepth(0)); // interprets depth relative to LCU level
    36673675     
     3676#if !RWTH_DBBP_NO_SPU_H0057
    36683677      pcCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[0], 0, 0, pcCU->getDepth(0));
    36693678      pcCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[0], 0, 0, pcCU->getDepth(0));
     3679#endif
    36703680     
    36713681      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    36973707      pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    36983708#if H_3D_VSP
     3709#if !ETRIKHU_CLEANUP_H0083
    36993710                                        , vspFlag
     3711#endif
    37003712                                        , inheritedVSPDisInfo
    37013713#endif
    37023714#if H_3D_SPIVMP
    3703                                         , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     3715#if !ETRIKHU_CLEANUP_H0083_MISSING
     3716        , pbSPIVMPFlag
     3717#endif
     3718        , pcMvFieldSP, puhInterDirSP
     3719#endif
     3720        , numValidMergeCand
     3721        );
     3722
     3723#if ETRIKHU_CLEANUP_H0083
     3724      pcCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
     3725#if H_3D_VSP
     3726        , vspFlag
     3727#endif
     3728#if H_3D_SPIVMP
     3729        , pbSPIVMPFlag
    37043730#endif
    37053731                                        , numValidMergeCand
    37063732        );
     3733#endif
    37073734#else
    37083735      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     
    37183745    pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    37193746#if H_3D_VSP
     3747#if !ETRIKHU_CLEANUP_H0083
    37203748                                      , vspFlag
     3749#endif
    37213750                                      , inheritedVSPDisInfo
    37223751#endif
    37233752#if H_3D_SPIVMP
    3724                                       , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     3753#if !ETRIKHU_CLEANUP_H0083_MISSING
     3754      , pbSPIVMPFlag
     3755#endif
     3756      , pcMvFieldSP, puhInterDirSP
     3757#endif
     3758      , numValidMergeCand
     3759      );
     3760
     3761#if ETRIKHU_CLEANUP_H0083
     3762    pcCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
     3763#if H_3D_VSP
     3764      , vspFlag
     3765#endif
     3766#if H_3D_SPIVMP
     3767      , pbSPIVMPFlag
    37253768#endif
    37263769                                      , numValidMergeCand
    37273770      );
     3771#endif
    37283772#else
    37293773    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r872 r950  
    866866     )
    867867  {
     868#if MTK_LOW_LATENCY_IC_ENCODING_H0086
     869    pcSlice ->xSetApplyIC(pcEncTop->getUseICLowLatencyEnc());
     870#else
    868871    pcSlice ->xSetApplyIC();
     872#endif
    869873    if ( pcSlice->getApplyIC() )
    870874    {
Note: See TracChangeset for help on using the changeset viewer.