Changeset 976 in 3DVCSoftware for trunk/source/Lib/TLibCommon


Ignore:
Timestamp:
7 Jul 2014, 17:27:51 (10 years ago)
Author:
tech
Message:
  • Merged 11.1-dev0@975. (Clean ups)
  • Added coding results.
  • Changed version number.
Location:
trunk/source/Lib/TLibCommon
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/CommonDef.h

    r964 r976  
    6060
    6161#if H_MV
    62 #define NV_VERSION        "11.1"                ///< Current software version
     62#define NV_VERSION        "11.2"                ///< Current software version
    6363#define HM_VERSION        "14.0"                ///<
    6464#else
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r950 r976  
    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
    113112#define NUM_ANGLE_FLAG_CTX            1
    114 #else
    115 #define NUM_ANGLE_FLAG_CTX            3
    116 #endif
    117113#endif
    118114
     
    372368};
    373369
    374 #if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
    375370static const UChar
    376371INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
     
    380375  { 155 },
    381376};
    382 #else
    383 static const UChar
    384 INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
    385 {
    386   { 154, 155, 156 },
    387   { 141, 185, 214 },
    388   { 155, 170, 157 },
    389 };
    390 #endif
    391377
    392378static const UChar
     
    444430
    445431#if H_3D_DBBP
    446 #if MTK_DBBP_SIGNALING_H0094
    447432static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
    448433{
     
    451436  { 161 },
    452437};
    453 #else
    454 static 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
     438#endif
     439
     440#endif
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r964 r976  
    610610    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    611611#endif
    612 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    613612    m_apDmmPredictor[0] = 0;
    614613    m_apDmmPredictor[1] = 0;
    615 #endif
    616614#endif
    617615#if H_3D_DBBP
     
    788786      m_apSegmentDCOffset[1][ui] = 0;
    789787#endif
    790 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    791788      m_apDmmPredictor[0] = 0;
    792789      m_apDmmPredictor[1] = 0;
    793 #endif
    794790#endif
    795791#if H_3D_DBBP
     
    907903  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
    908904#endif
    909 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    910905  m_apDmmPredictor[0] = 0;
    911906  m_apDmmPredictor[1] = 0;
    912 #endif
    913907#endif
    914908#if H_3D_DBBP
     
    23642358   
    23652359    TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV;
    2366 #if SEC_VER_DONBDV_H0103
    23672360    if( depthRefineFlag )
    23682361    {
    23692362      cDv.setVer(0);
    23702363    }
    2371 #endif
    23722364   
    23732365    Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
     
    23992391}
    24002392
    2401 UInt TComDataCU::getCtxAngleFlag( UInt uiAbsPartIdx )
    2402 {
    2403 #if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
    2404   return 0;
    2405 #else
    2406   TComDataCU* pcTempCU;
    2407   UInt        uiTempPartIdx;
    2408   UInt        uiCtx = 0;
    2409 
    2410   // Get BCBP of left PU
    2411   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2412   uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0;
    2413 
    2414   // Get BCBP of above PU
    2415   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2416   uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0;
    2417 
    2418   return uiCtx;
    2419 #endif
    2420 }
    24212393#endif
    24222394
     
    32803252 *   false: otherwise
    32813253 */
    3282 #if ETRIKHU_CLEANUP_H0083
    32833254inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount)
    3284 #else
    3285 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    3286   Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3287 #endif
    32883255{
    32893256  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
     
    33013268  }
    33023269
    3303 #if ETRIKHU_CLEANUP_H0083
    33043270  TComMvField mvVSP[2];
    33053271  UChar dirVSP;
    3306 #else
    3307   rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3308 #endif
    3309 
    33103272  Bool  refViewAvailFlag = false;
    33113273  UChar predFlag[2]      = {0, 0};
     
    33213283        refViewAvailFlag      = true;
    33223284        predFlag[iRefListIdX] = 1;
    3323 #if ETRIKHU_CLEANUP_H0083
    33243285        mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    33253286#if H_3D_NBDV
    33263287        mvVSP[0+iRefListIdX].getMv().setIDVFlag (false);
    33273288#endif
    3328 #else
    3329         pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    3330 #if H_3D_NBDV
    3331         pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].getMv().setIDVFlag (false);
    3332 #endif
    3333 #endif
    3334       }
    3335     }
    3336   }
    3337 
    3338 #if ETRIKHU_CLEANUP_H0083
     3289      }
     3290    }
     3291  }
     3292
    33393293  dirVSP = (predFlag[0] | (predFlag[1] << 1));
    33403294  m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true, false);
    3341 #else
    3342   // Set values to be returned
    3343   abCandIsInter        [iCount] = true;
    3344   puhInterDirNeighbours[iCount] = (predFlag[0] | (predFlag[1] << 1));
    3345   vspFlag              [iCount] = 1;
    3346 #endif
    3347 
    33483295  if ( mrgCandIdx == iCount )
    33493296  {
     
    33593306
    33603307#if H_3D_IV_MERGE
    3361 #if ETRIKHU_CLEANUP_H0083
    33623308inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx )
    3363 #else
    3364 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,
    3365   Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3366 #endif
    33673309{
    33683310  for(Int iLoop = 0; iLoop < 2; iLoop ++ )
     
    33723314    {
    33733315      Int iFirDispCand = -1;
    3374 #if ETRIKHU_CLEANUP_H0083
    33753316      TComMvField mvIvDcShift[2];
    33763317      UChar dirIvDcShift;
    33773318
    33783319      if (xGetPosFirstAvailDmvCand(MRG_IVSHIFT, iFirDispCand))
    3379 #else
    3380       if (xGetPosFirstAvailDmvCand(iCount, pcMvFieldNeighbours, ivCandDir, iPosIvDC, vspFlag, iFirDispCand))
    3381 #endif
    33823320      {
    33833321        TComMv cMv;
    3384 #if ETRIKHU_CLEANUP_H0083
    33853322        cMv = m_mergCands[iFirDispCand].m_cMvField[0].getMv();
    3386 #else
    3387         cMv = pcMvFieldNeighbours[(iFirDispCand<<1)].getMv();
    3388 #endif
    33893323        cMv.setHor(cMv.getHor()+4);
    33903324        if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps()))
     
    33963330#endif
    33973331
    3398 #if ETRIKHU_CLEANUP_H0083
    33993332        dirIvDcShift = m_mergCands[iFirDispCand].m_uDir;
    34003333        mvIvDcShift[0].setMvField(cMv, m_mergCands[iFirDispCand].m_cMvField[0].getRefIdx() );
    34013334        mvIvDcShift[1].setMvField(m_mergCands[iFirDispCand].m_cMvField[1].getMv(), m_mergCands[iFirDispCand].m_cMvField[1].getRefIdx() );
    34023335        m_mergCands[MRG_IVSHIFT].setCand(mvIvDcShift, dirIvDcShift, false, false);
    3403 #else
    3404         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3405 
    3406         abCandIsInter        [ iCount ] = true;
    3407         puhInterDirNeighbours[ iCount ] = puhInterDirNeighbours[iFirDispCand];
    3408         pcMvFieldNeighbours  [ iCount << 1      ].setMvField(cMv, pcMvFieldNeighbours[( iFirDispCand << 1)].getRefIdx() );
    3409         pcMvFieldNeighbours  [(iCount << 1) + 1 ].setMvField(pcMvFieldNeighbours[(iFirDispCand << 1) + 1].getMv(), pcMvFieldNeighbours[( iFirDispCand << 1) + 1].getRefIdx() );
    3410 #endif
    34113336       
    34123337        if( mrgCandIdx == iCount )
     
    34143339          return true;
    34153340        }
    3416 
    34173341        iCount++;
    34183342        break;
     
    34393363      if( !iLoop && ivCandDir[0] > 0)
    34403364      {
    3441 #if ETRIKHU_CLEANUP_H0083
    34423365        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
    3444         if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1])
    3445 #endif
    34463366        {
    34473367            bRemove                         = true;
     
    34503370      if(!bRemove)
    34513371      {
    3452 #if ETRIKHU_CLEANUP_H0083
    34533372#if H_3D_NBDV
    34543373        if(iLoop) // For IvMcShift candidate
     
    34593378#endif
    34603379        m_mergCands[MRG_IVSHIFT].setCand(tmpMV, tmpDir, false, false);
    3461 #else
    3462         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3463 
    3464         abCandIsInter[ iCount ] = true;
    3465         puhInterDirNeighbours[ iCount ] = ivCandDir[iLoop + 2];
    3466         if( ( ivCandDir[iLoop + 2] & 1 ) == 1 )
    3467         {
    3468           pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] );
    3469         }
    3470         if( ( ivCandDir[iLoop + 2] & 2 ) == 2 )
    3471         {
    3472           pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
    3473         }
    3474 #if H_3D_NBDV
    3475         if(iLoop) // For IvMcShift candidate
    3476         {
    3477           pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    3478           pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    3479         }
    3480 #endif
    3481 #endif
    34823380        if( mrgCandIdx == iCount )
    34833381        {
     
    34923390}
    34933391
    3494 #if ETRIKHU_CLEANUP_H0083
    34953392inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
    34963393{
     
    35093406  return false; 
    35103407}
    3511 #else
    3512 inline Bool TComDataCU::xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& posFirstAvailDmvCand )
    3513 {
    3514   // ivCandDir[0] == true --> IvMC is available and excluded in loop over merge list.
    3515   for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
    3516   {
    3517     if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
    3518     {
    3519       continue;
    3520     }
    3521     else if((pcMvFieldNeighbours[currListPos<<1].getRefIdx() != -1 ) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), pcMvFieldNeighbours[currListPos<<1].getRefIdx())->getViewIndex()))
    3522     {
    3523       posFirstAvailDmvCand = currListPos;
    3524       return true;
    3525     }
    3526   }
    3527  return false; 
    3528 }
    3529 #endif
    35303408                                     
    35313409#endif
    35323410
    35333411#if H_3D
    3534 #if ETRIKHU_CLEANUP_H0083
    3535 
    35363412Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    35373413#if H_3D_VSP
     
    36063482  assert(iCount == getSlice()->getMaxNumMergeCand());
    36073483}
    3608 #else
    3609 Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV)
    3610 {
    3611   iCount3DV++;
    3612   for (int i=num; i>0; i--)
    3613   {
    3614     pcMvFieldNeighbours[(start+i)<<1].setMvField(pcMvFieldNeighbours[(start+i-1)<<1].getMv(), pcMvFieldNeighbours[(start+i-1)<<1].getRefIdx());
    3615     pcMvFieldNeighbours[((start+i)<<1)+1].setMvField(pcMvFieldNeighbours[((start+i-1)<<1)+1].getMv(), pcMvFieldNeighbours[((start+i-1)<<1)+1].getRefIdx());
    3616     puhInterDirNeighbours[start+i] = puhInterDirNeighbours[start+i-1];
    3617     iVSPIndexTrue[start+i] = iVSPIndexTrue[start+i-1];
    3618     inheritedVSPDisInfo[start+i].m_acDvInfo   = inheritedVSPDisInfo[start+i-1].m_acDvInfo;
    3619   }
    3620   TComMv  cZeroMv;
    3621   pcMvFieldNeighbours[start<<1].setMvField( cZeroMv, NOT_VALID );
    3622   pcMvFieldNeighbours[(start<<1)+1].setMvField( cZeroMv, NOT_VALID );
    3623   puhInterDirNeighbours[start] = 0;
    3624   iVSPIndexTrue[start] = 0;
    3625   inheritedVSPDisInfo[start].m_acDvInfo = m_cDefaultDisInfo;
    3626 
    3627   return;
    3628 }
    3629 #endif
    36303484
    36313485/** Constructs a list of merging candidates
     
    40013855#endif
    40023856#if H_3D_VSP
    4003 #if !ETRIKHU_CLEANUP_H0083
    4004       , Int* vspFlag
    4005 #endif
    40063857      , InheritedVSPDisInfo*  inheritedVSPDisInfo
    40073858#endif
    40083859#if H_3D_SPIVMP
    4009 #if ETRIKHU_CLEANUP_H0083
    40103860      , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    4011 #else
    4012       , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    4013 #endif
    40143861#endif
    40153862      , Int& numValidMergeCand, Int mrgCandIdx
     
    40223869  ////////////////////////////
    40233870  TComMv cZeroMv;
    4024 #if !ETRIKHU_CLEANUP_H0083
    4025   Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
    4026 #endif
    40273871#else
    40283872  Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
     
    40903934#if H_3D_DBBP
    40913935  Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx);
    4092 #if MTK_DIS_SPBIP8X4_H0205
    40933936  assert(bDBBPFlag == getDBBPFlag(0)); 
    40943937#endif
    4095 #endif
    40963938
    40973939#if H_3D
    4098 #if !ETRIKHU_CLEANUP_H0083
    4099   Int  iPosLeftAbove[2] = {-1, -1};
    4100 
    4101   Int iCountHEVC = 0;
    4102   Int iCount3DV = 0;
    4103   Int numA1B1B0 = 0;
    4104   Int numA0B2 = 0;
    4105 #endif
    41063940#if H_3D_NBDV
    41073941  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 
     
    41113945  }
    41123946#endif
    4113 
    4114 
    4115 #if ETRIKHU_CLEANUP_H0083
    4116 
    4117 
    41183947  // Clean version for MCL construction align with WD
    41193948  // init mergCands list
     
    41423971      && !bARPFlag
    41433972#endif
    4144 #if RWTH_DBBP_NO_SPU_H0057
     3973#if H_3D_DBBP
    41453974      && !bDBBPFlag
    41463975#endif
     
    41693998      && !bARPFlag
    41703999#endif
    4171 #if RWTH_DBBP_NO_SPU_H0057
     4000#if H_3D_DBBP
    41724001      && !bDBBPFlag
    41734002#endif
     
    41964025      && !bARPFlag
    41974026#endif
    4198 #if RWTH_DBBP_NO_SPU_H0057
     4027#if H_3D_DBBP
    41994028      && !bDBBPFlag
    42004029#endif
     
    42224051      && !bARPFlag
    42234052#endif
    4224 #if RWTH_DBBP_NO_SPU_H0057
     4053#if H_3D_DBBP
    42254054      && !bDBBPFlag
    42264055#endif
     
    42494078      && !bARPFlag
    42504079#endif
    4251 #if RWTH_DBBP_NO_SPU_H0057
     4080#if H_3D_DBBP
    42524081      && !bDBBPFlag
    42534082#endif
     
    42594088  }
    42604089
    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
    4269   //left
    4270   UInt uiLeftPartIdx = 0;
    4271   TComDataCU* pcCULeft = 0;
    4272   pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 
    4273   if (getAvailableFlagA1())
    4274   {
    4275     iPosLeftAbove[0] = numA1B1B0;
    4276 #if H_3D_VSP
    4277     if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    4278 #if H_3D_IC
    4279       && !bICFlag
    4280 #endif
    4281 #if H_3D_ARP
    4282       && !bARPFlag
    4283 #endif
    4284 #if RWTH_DBBP_NO_SPU_H0057
    4285       && !bDBBPFlag
    4286 #endif
    4287       )
    4288     {
    4289       vspFlag[numA1B1B0] = 1;
    4290     }
    4291 #endif
    4292     numA1B1B0++;
    4293   }
    4294 
    4295   // above
    4296   UInt uiAbovePartIdx = 0;
    4297   TComDataCU* pcCUAbove = 0;
    4298   pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
    4299   if ( getAvailableFlagB1())
    4300   {
    4301     iPosLeftAbove[1] = numA1B1B0;
    4302 #if H_3D_VSP
    4303     if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
    4304 #if H_3D_IC
    4305       && !bICFlag
    4306 #endif
    4307 #if H_3D_ARP
    4308       && !bARPFlag
    4309 #endif
    4310 #if RWTH_DBBP_NO_SPU_H0057
    4311       && !bDBBPFlag
    4312 #endif
    4313       )
    4314     {
    4315       vspFlag[numA1B1B0] = 1;
    4316     }
    4317 #endif
    4318 
    4319     numA1B1B0++;
    4320   }
    4321 
    4322   // above right
    4323   UInt uiAboveRightPartIdx = 0;
    4324   TComDataCU* pcCUAboveRight = 0;
    4325   pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
    4326   if ( getAvailableFlagB0())
    4327   {
    4328 #if H_3D_VSP
    4329     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
    4330 #if H_3D_IC
    4331       && !bICFlag
    4332 #endif
    4333 #if H_3D_ARP
    4334       && !bARPFlag
    4335 #endif
    4336 #if RWTH_DBBP_NO_SPU_H0057
    4337       && !bDBBPFlag
    4338 #endif
    4339       )
    4340     {
    4341       vspFlag[numA1B1B0] = 1;
    4342     }
    4343 #endif
    4344     numA1B1B0++;
    4345   }
    4346  
    4347   // left bottom
    4348   UInt uiLeftBottomPartIdx = 0;
    4349   TComDataCU* pcCULeftBottom = getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
    4350   if ( getAvailableFlagA0())
    4351   {
    4352 #if H_3D_VSP
    4353     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
    4354 #if H_3D_IC
    4355       && !bICFlag
    4356 #endif
    4357 #if H_3D_ARP
    4358       && !bARPFlag
    4359 #endif
    4360 #if RWTH_DBBP_NO_SPU_H0057
    4361       && !bDBBPFlag
    4362 #endif
    4363       )
    4364     {
    4365       vspFlag[numA1B1B0] = 1;
    4366     }
    4367 #endif
    4368     iCountHEVC++;
    4369     numA0B2++;
    4370   }
    4371  
    4372   // above left
    4373   UInt uiAboveLeftPartIdx = 0;
    4374   TComDataCU* pcCUAboveLeft = 0;
    4375   pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
    4376   if (getAvailableFlagB2())
    4377   {
    4378 #if H_3D_VSP
    4379     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
    4380 #if H_3D_IC
    4381       && !bICFlag
    4382 #endif
    4383 #if H_3D_ARP
    4384       && !bARPFlag
    4385 #endif
    4386 #if RWTH_DBBP_NO_SPU_H0057
    4387       && !bDBBPFlag
    4388 #endif
    4389       )
    4390     {
    4391       vspFlag[numA1B1B0+iCountHEVC] = 1;
    4392     }
    4393 #endif
    4394     iCountHEVC++;
    4395     numA0B2++;
    4396   }
    4397 
    4398   iCountHEVC = numValidMergeCand;
    4399 #endif
    44004090#endif
    44014091
     
    44074097  /////////////////////////////////////////////
    44084098
    4409 #if SHARP_SIMPLE_MERGE_H0062
    44104099  bMPIFlag &= (nPSW + nPSH > 12);
    4411 #endif
    44124100  if( bMPIFlag)
    44134101  {
     
    44164104    tmpDir        =  0;
    44174105
    4418 #if ETRIKHU_CLEANUP_H0083
    44194106    Bool bSPIVMPFlag = false;
    4420 #endif
    44214107
    44224108    TComPic * pcTexPic = m_pcSlice->getTexturePic();
     
    44574143      Int         iTexPosX, iTexPosY;
    44584144      const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4459 #if MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    44604145     
    44614146      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iPUWidth ) >> 1 )  * iPUWidth + ( iPUWidth >> 1 );
     
    44764161      if( pcDefaultCU->getPredictionMode( iTexCenterAbsPartIdx ) != MODE_INTRA )
    44774162      {
    4478           for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4163        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4164        {
     4165          RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4166
     4167          TComMvField cDefaultMvField;
     4168          pcDefaultCU->getMvField( pcDefaultCU, iTexCenterAbsPartIdx, eCurrRefPicList, cDefaultMvField );
     4169          Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     4170          if (iDefaultRefIdx >= 0)
    44794171          {
    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)
     4172            Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eCurrRefPicList, iDefaultRefIdx);
     4173            for (Int iRefPicList = 0; iRefPicList < m_pcSlice->getNumRefIdx( eCurrRefPicList ); iRefPicList++)
     4174            {
     4175              if (iDefaultRefPOC == m_pcSlice->getRefPOC(eCurrRefPicList, iRefPicList))
    44864176              {
    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                   }
     4177                bSPIVMPFlag = true;
     4178                TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
     4179                cMv >>= 2;
     4180                clipMv( cMv );
     4181                cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
     4182                break;
    45044183              }
     4184            }
    45054185          }
    4506       }
    4507 #if ETRIKHU_CLEANUP_H0083
     4186        }
     4187      }
    45084188      if ( bSPIVMPFlag == true )
    4509 #else
    4510       if ( pbSPIVMPFlag[iCount] == true )
    4511 #endif
    45124189      {   
    45134190          iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
     
    45194196      if ( iInterDirSaved != 0 )
    45204197      {
    4521 #endif
    4522       for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight)
    4523       {
    4524         for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iPUWidth)
     4198        for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight)
    45254199        {
    4526           iTexPosX     = j + iOffsetX;
    4527           iTexPosY     = i + iOffsetY;
    4528           pcTexRec->getCUAddrAndPartIdx( iTexPosX, iTexPosY, iTexCUAddr, iTexAbsPartIdx );
    4529           pcTexCU  = pcTexPic->getCU( iTexCUAddr );
    4530 
    4531           if( pcTexCU && !pcTexCU->isIntra(iTexAbsPartIdx) )
     4200          for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iPUWidth)
    45324201          {
    4533             for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4202            iTexPosX     = j + iOffsetX;
     4203            iTexPosY     = i + iOffsetY;
     4204            pcTexRec->getCUAddrAndPartIdx( iTexPosX, iTexPosY, iTexCUAddr, iTexAbsPartIdx );
     4205            pcTexCU  = pcTexPic->getCU( iTexCUAddr );
     4206
     4207            if( pcTexCU && !pcTexCU->isIntra(iTexAbsPartIdx) )
    45344208            {
    4535               RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    4536               TComMvField cTexMvField;
    4537               pcTexCU->getMvField( pcTexCU, iTexAbsPartIdx, eCurrRefPicList, cTexMvField );
    4538               Int iValidDepRef = getPic()->isTextRefValid( eCurrRefPicList, cTexMvField.getRefIdx() );
    4539               if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
     4209              for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
    45404210              {
    4541                 TComMv cMv = cTexMvField.getMv() + cMvRounding;
    4542                 cMv >>=2;         
     4211                RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4212                TComMvField cTexMvField;
     4213                pcTexCU->getMvField( pcTexCU, iTexAbsPartIdx, eCurrRefPicList, cTexMvField );
     4214                Int iValidDepRef = getPic()->isTextRefValid( eCurrRefPicList, cTexMvField.getRefIdx() );
     4215                if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
     4216                {
     4217                  TComMv cMv = cTexMvField.getMv() + cMvRounding;
     4218                  cMv >>=2;         
    45434219#if !(NTT_BUG_FIX_TK54)
    4544                 this->clipMv( cMv );
    4545 #endif
    4546                 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
    4547               }
    4548             }
    4549           }
    4550           puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
    4551           if (puhInterDirSP[iPartition] == 0)
    4552           {
    4553             if (iInterDirSaved != 0)
    4554             {
    4555               puhInterDirSP[iPartition] = iInterDirSaved;
    4556               pcMvFieldSP[2*iPartition] = cMvFieldSaved[0];
    4557               pcMvFieldSP[2*iPartition + 1] = cMvFieldSaved[1];
    4558             }
    4559           }
    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
    4571           else
    4572           {
    4573             if (iInterDirSaved ==0)
    4574             {
    4575 #if ETRIKHU_CLEANUP_H0083
    4576                   bSPIVMPFlag = true;
    4577 #else
    4578               pbSPIVMPFlag[iCount] = true;
    4579 #endif
    4580               tmpDir = puhInterDirSP[iPartition];
    4581               tmpMV[0] = pcMvFieldSP[2*iPartition];
    4582               tmpMV[1] = pcMvFieldSP[2*iPartition+1];
    4583 
    4584               if (iPartition != 0)
    4585               {
    4586                 for (Int iPart = iPartition-1; iPart >= 0; iPart--)
    4587                 {
    4588                   puhInterDirSP[iPart] = puhInterDirSP[iPartition];
    4589                   pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
    4590                   pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
     4220                  this->clipMv( cMv );
     4221#endif
     4222                  pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
    45914223                }
    45924224              }
    45934225            }
    4594             iInterDirSaved = puhInterDirSP[iPartition];
    4595             cMvFieldSaved[0] = pcMvFieldSP[2*iPartition];
    4596             cMvFieldSaved[1] = pcMvFieldSP[2*iPartition + 1];
     4226            puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
     4227            if (puhInterDirSP[iPartition] == 0)
     4228            {
     4229              if (iInterDirSaved != 0)
     4230              {
     4231                puhInterDirSP[iPartition] = iInterDirSaved;
     4232                pcMvFieldSP[2*iPartition] = cMvFieldSaved[0];
     4233                pcMvFieldSP[2*iPartition + 1] = cMvFieldSaved[1];
     4234              }
     4235            }
     4236            if (iPUHeight + iPUWidth == 12)
     4237            {
     4238              if (puhInterDirSP[iPartition] == 3)
     4239              {
     4240                puhInterDirSP[iPartition] = 1;
     4241                pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     4242              }
     4243            }
     4244
     4245            iPartition ++;
    45974246          }
    4598 #endif
    4599           iPartition ++;
    46004247        }
    4601       }
    4602 #if MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
     4248#if H_3D
    46034249      }
    46044250#endif
     
    46094255    {
    46104256      Int iCnloop = 0;
    4611 #if ETRIKHU_CLEANUP_H0083
    46124257      for(iCnloop = 0; iCnloop < 2; iCnloop ++)
    46134258      {
     
    46244269      m_mergCands[MRG_T].setCand( tmpMV, tmpDir, false, bSPIVMPFlag);
    46254270
    4626 #else
    4627       Bool bRemoveSpa = false; //pruning
    4628 
    4629       for(Int i = 0; i < 2; i ++)
    4630       {
    4631         iCnloop = iPosLeftAbove[i];
    4632         if ( iCnloop == -1 )
    4633         {
    4634           continue;
    4635         }
    4636         if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
    4637         {
    4638           bRemoveSpa                      = true;
    4639           break;
    4640         }     
    4641       }
    4642 
    4643       if (!bRemoveSpa)
    4644       {
    4645         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4646       }
    4647       else
    4648       {
    4649         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
    4650         if (iCnloop<numA1B1B0)
    4651         {
    4652           numA1B1B0--;
    4653         }
    4654         iCountHEVC--;
    4655 
    4656         if (iPosLeftAbove[0] != -1)
    4657         {
    4658           if (iCnloop == iPosLeftAbove[0])
    4659           {
    4660             iPosLeftAbove[0] = -1;
    4661           }
    4662           else
    4663           {
    4664             iPosLeftAbove[0]++;
    4665           }
    4666         }
    4667         if (iPosLeftAbove[1] != -1)
    4668         {
    4669           if (iCnloop == iPosLeftAbove[1])
    4670           {
    4671             iPosLeftAbove[1] = -1;
    4672           }
    4673           else
    4674           {
    4675             if (iCnloop > iPosLeftAbove[1])
    4676             {
    4677               iPosLeftAbove[1]++;
    4678             }
    4679           }
    4680         }
    4681       }
    4682       pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
    4683       pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
    4684 
    4685       puhInterDirNeighbours[iCount] = tmpDir;
    4686 #endif
    46874271      if ( mrgCandIdx == iCount )
    46884272      {
     
    47634347      if( tmpDir != 0 )
    47644348      {
    4765 #if !ETRIKHU_CLEANUP_H0083
    4766         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4767 #endif
    47684349        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    47694350        m_iUseDDDCandIdx = iCount;
    47704351
    4771 #if ETRIKHU_CLEANUP_H0083
    47724352        m_mergCands[MRG_D].setCand( tmpMV, tmpDir, false, false);
    47734353        if ( mrgCandIdx == iCount )
     
    47764356        }
    47774357        iCount ++;
    4778 #else
    4779         if( tmpDir == 1 )
    4780         {
    4781           pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
    4782         }
    4783         else if( tmpDir == 2  )
    4784         {
    4785           pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
    4786         }
    4787 
    4788         abCandIsInter        [ iCount ] = true;
    4789         puhInterDirNeighbours[ iCount ] = tmpDir;
    4790 
    4791         if ( mrgCandIdx == iCount )
    4792         {
    4793           return;
    4794         }
    4795         iCount ++;
    4796 
    4797         Int iLeftAboveAvail = 0;
    4798         if( iPosLeftAbove[ 0 ] != -1 )
    4799         {
    4800           iPosLeftAbove[ 0 ] = iCount;
    4801           iLeftAboveAvail = 1;
    4802         }
    4803         if( iPosLeftAbove[ 1 ] != -1 )
    4804         {
    4805           iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    4806         }
    4807 #endif
    48084358      }
    48094359    }
     
    48134363  //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC  Candidates /////
    48144364  /////////////////////////////////////////////////////////////////
    4815 
    4816 #if !ETRIKHU_CLEANUP_H0083
    4817   Int  posIvDC          = -1;
    4818 #endif
    48194365
    48204366  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
     
    48284374  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    48294375
    4830 #if SHARP_SIMPLE_MERGE_H0062
    48314376  ivMvPredFlag &= (nPSW + nPSH > 12);
    4832 #endif
    48334377  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    48344378  {
    4835 #if SEC_ADAPT_DISABLE_IVMP
    48364379    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag );
    4837 #else
    4838     getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
    4839 #endif
    48404380  } 
    48414381
     
    48634403
    48644404    Bool bRemoveSpa = false; //pruning
    4865 #if !ETRIKHU_CLEANUP_H0083
    4866     Bool bIvMC = false;
    4867     Int iCnloop=0;
    4868 #endif
    48694405
    48704406    if (!bIsDepth)
     
    48724408      for(Int i = 0; i < 2; i ++)
    48734409      {
    4874 #if ETRIKHU_CLEANUP_H0083
    48754410        if ( !m_mergCands[MRG_A1 + i].m_bAvailable ) // prunning to A1, B1
    48764411        {
     
    48824417          break;
    48834418        }     
    4884 #else
    4885         iCnloop = iPosLeftAbove[i];
    4886         if ( iCnloop == -1 )
    4887         {
    4888           continue;
    4889         }
    4890         if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
    4891         {
    4892           bRemoveSpa                      = true;
    4893           break;
    4894         }     
    4895 #endif
    48964419      }
    48974420    }
    48984421    if (bIsDepth)
    48994422    {
    4900 #if ETRIKHU_CLEANUP_H0083
    49014423      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])
    49024424      {
    49034425        bRemoveSpa                      = true;
    49044426      }
    4905 #else
    4906       iCnloop = iCount-1;
    4907       for(; iCnloop >= 0; iCnloop --)
    4908       {
    4909 #if H_3D_DDD
    4910           if( iCnloop == m_iUseDDDCandIdx )
    4911           {
    4912               continue;
    4913           }
    4914 #endif
    4915         if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1])  // F0125 compatible with F0093
    4916         {
    4917           bRemoveSpa                      = true;
    4918           break;
    4919         }
    4920       }
    4921 #endif
    4922     }
    4923 
     4427    }
    49244428    if (!bRemoveSpa)
    49254429    {
    4926 #if !ETRIKHU_CLEANUP_H0083
    4927       bIvMC = true;
    4928       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    4929 
    4930       if (iPosLeftAbove[0] != -1)
    4931       {
    4932         iPosLeftAbove[0]++;
    4933       }
    4934       if (iPosLeftAbove[1] != -1)
    4935       {
    4936         iPosLeftAbove[1]++;
    4937       }
    4938     }
    4939     else if (bRemoveSpa && !bIsDepth)
    4940     {
    4941       bIvMC = true;
    4942       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
    4943 
    4944       if (iCnloop<numA1B1B0)
    4945       {
    4946         numA1B1B0--;
    4947       }
    4948       iCountHEVC--;
    4949 
    4950       if (iPosLeftAbove[0] != -1)
    4951       {
    4952         if (iCnloop == iPosLeftAbove[0])
    4953         {
    4954           iPosLeftAbove[0] = -1;
    4955         }
    4956         else
    4957         {
    4958           iPosLeftAbove[0]++;
    4959         }
    4960       }
    4961       if (iPosLeftAbove[1] != -1)
    4962       {
    4963         if (iCnloop == iPosLeftAbove[1])
    4964         {
    4965           iPosLeftAbove[1] = -1;
    4966         }
    4967         else
    4968         {
    4969           if (iCnloop > iPosLeftAbove[1])
    4970           {
    4971             iPosLeftAbove[1]++;
    4972           }
    4973         }
    4974       }
    4975     }
    4976 
    4977     if (bIvMC)
    4978     {
    4979 #endif
    4980 #if ETRIKHU_CLEANUP_H0083
    49814430      Bool SPIVMPFlag = false;
    4982 #if MTK_DIS_SPBIP8X4_H0205
    49834431      if(!m_pcSlice->getIsDepth())
    4984 #else
    4985       if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    4986 #endif
    49874432      {
    49884433        SPIVMPFlag = true;
     
    49914436      SPIVMPFlag &= !bDBBPFlag;
    49924437#endif
    4993 #else
    4994       if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    4995       {
    4996           pbSPIVMPFlag[iCount] = true;
    4997       }
    4998 #if H_3D_DBBP
    4999       pbSPIVMPFlag[iCount] &= !bDBBPFlag;
    5000 #endif
    5001 #endif
    5002 #if ETRIKHU_CLEANUP_H0083
     4438
    50034439      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);
    5004 #else
    5005       if( ( ivCandDir[0] & 1 ) == 1 )
    5006       {
    5007         pcMvFieldNeighbours[iCount<<1].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );
    5008       }
    5009       if( ( ivCandDir[0] & 2 ) == 2 )
    5010       {
    5011         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );
    5012       }
    5013 
    5014       puhInterDirNeighbours[ iCount ] = ivCandDir[0];
    5015 #endif
    50164440
    50174441      if ( mrgCandIdx == iCount )
     
    50314455
    50324456#if H_3D
    5033 #if ETRIKHU_CLEANUP_H0083
    50344457  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable + m_mergCands[MRG_B0].m_bAvailable;
    5035 #else
    5036   iCount += numA1B1B0;
    5037 #endif
    50384458#else
    50394459  //left
     
    51644584    for(Int i = 0; i < 2; i ++)
    51654585    {
    5166 #if ETRIKHU_CLEANUP_H0083
    51674586      if ( !m_mergCands[MRG_A1+i].m_bAvailable )
    5168 #else
    5169       Int iCnloop = iPosLeftAbove[i];
    5170       if ( iCnloop == -1 )
    5171 #endif
    51724587      {
    51734588        continue;
    51744589      }
    5175 #if ETRIKHU_CLEANUP_H0083
    5176 #if ETRIKHU_BUGFIX_H0083
    51774590      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
    5186       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    5187 #endif
    51884591      {
    51894592        bRemoveSpa                      = true;
     
    51934596    if(!bRemoveSpa)
    51944597    {
    5195 #if ETRIKHU_CLEANUP_H0083
    51964598#if H_3D_NBDV
    51974599      tmpMV[0].getMv().setIDVFlag (false);
     
    51994601#endif
    52004602      m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false);
    5201 #else
    5202       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    5203       puhInterDirNeighbours[ iCount ] = ivCandDir[1];
    5204       if( ( ivCandDir[1] & 1 ) == 1 )
    5205       {
    5206         pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );
    5207       }
    5208       if( ( ivCandDir[1] & 2 ) == 2 )
    5209       {
    5210         pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
    5211       }
    5212 #if H_3D_NBDV
    5213       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5214       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5215 #endif
    5216       posIvDC  = iCount;
    5217 #endif
     4603
    52184604      if ( mrgCandIdx == iCount )
    52194605        return;
     
    52434629      !bARPFlag &&
    52444630#endif
    5245 #if SHARP_SIMPLE_MERGE_H0062
     4631#if H_3D
    52464632      (nPSW + nPSH > 12) &&
    52474633#endif
    5248 #if RWTH_DBBP_NO_SPU_H0057
     4634#if H_3D_DBBP
    52494635      !bDBBPFlag &&
    52504636#endif
    5251 #if ETRIKHU_CLEANUP_H0083
    52524637      xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) )
    5253 #else
    5254       xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
    5255 #endif
    52564638  {
    52574639    return;
     
    52694651
    52704652#if H_3D
    5271 #if ETRIKHU_CLEANUP_H0083
    52724653  iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable;
    5273 #else
    5274   iCount += numA0B2;
    5275 #endif
    52764654#else
    52774655  //left bottom
     
    53474725  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    53484726  {
    5349 #if ETRIKHU_CLEANUP_H0083
    53504727    if(xAddIvMRGCand( mrgCandIdx,  iCount, ivCandDir, ivCandMv, ivCandRefIdx ) )
    5351 #else
    5352     if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
    5353 #endif
    53544728    {
    53554729      return;
     
    53624736  }
    53634737#endif
    5364 
    5365 #if H_3D
    5366 #if !ETRIKHU_CLEANUP_H0083
    5367   if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
    5368   {
    5369     iCount = getSlice()->getMaxNumMergeCand();
    5370   }
    5371   else
    5372   {
    5373     iCount = iCountHEVC + iCount3DV;
    5374   }
    5375   numValidMergeCand = iCount;
    5376 #endif
    5377 #else
     4738#if !H_3D
    53784739  if ( getSlice()->getEnableTMVPFlag())
    53794740  {
     
    54634824    }
    54644825  }
    5465   // early termination
     4826  // early termination 
    54664827  if (iCount == getSlice()->getMaxNumMergeCand())
    54674828  {
     
    72326593
    72336594  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7234 #if SEC_VER_DONBDV_H0103
    72356595  if( depthRefineFlag )
    72366596  {
    72376597    cDv.setVer(0);
    72386598  }
    7239 #endif
    72406599
    72416600  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     
    73466705, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    73476706#endif
    7348 #if SEC_ADAPT_DISABLE_IVMP
    73496707, Bool bICFlag
    7350 #endif
    73516708)
    73526709{
     
    73776734
    73786735  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7379 #if SEC_VER_DONBDV_H0103
    73806736  if( depthRefineFlag )
    73816737  {
    73826738    cDv.setVer(0);
    73836739  }
    7384 #endif
    73856740
    73866741  Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
     
    73926747#endif
    73936748
    7394 #if SEC_ADAPT_DISABLE_IVMP
    73956749  if(!bICFlag)
    73966750  {
    7397 #endif
    73986751
    73996752#if H_3D_SPIVMP
    7400   ////////////////////////////////
    7401   //////////sub-PU IvMC///////////
    7402   ////////////////////////////////
    7403   if(!m_pcSlice->getIsDepth())
    7404   {
    7405 #if MTK_DIS_SPBIP8X4_H0205
    7406     if (!getDBBPFlag(0))
     6753    ////////////////////////////////
     6754    //////////sub-PU IvMC///////////
     6755    ////////////////////////////////
     6756    if(!m_pcSlice->getIsDepth())
     6757    {
     6758      if (!getDBBPFlag(0))
     6759      {
     6760        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     6761        getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
     6762
     6763        for (Int i=0; i<iNumSP; i++)
     6764        {
     6765          puhInterDirSP[i] = 0;
     6766          pcMvFieldSP[2*i].getMv().set(0, 0);
     6767          pcMvFieldSP[2*i+1].getMv().set(0,0);
     6768          pcMvFieldSP[2*i].setRefIdx(-1);
     6769          pcMvFieldSP[2*i+1].setRefIdx(-1);
     6770        }
     6771
     6772        Int         iBaseCUAddr;
     6773        Int         iBaseAbsPartIdx;
     6774        TComDataCU* pcBaseCU;
     6775        Int iPartition = 0;
     6776
     6777        Int iDelX = iSPWidth/2;
     6778        Int iDelY = iSPHeight/2;
     6779
     6780        Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
     6781        Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
     6782        Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
     6783
     6784        if(iWidth == iSPWidth && iHeight == iSPHeight)
     6785        {
     6786          iCenterPosX = iCurrPosX + (iWidth >> 1);
     6787          iCenterPosY = iCurrPosY + (iHeight >> 1);
     6788        }
     6789
     6790        Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     6791        Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );
     6792
     6793        pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
     6794        TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
     6795        if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
     6796        {
     6797          for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
     6798          {
     6799            RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     6800            Bool stopLoop = false;
     6801            for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
     6802            {
     6803              RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     6804              TComMvField cDefaultMvField;
     6805              pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
     6806              Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     6807              if (iDefaultRefIdx >= 0)
     6808              {
     6809                Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
     6810                if (iDefaultRefPOC != pcSlice->getPOC())   
     6811                {
     6812                  for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
     6813                  {
     6814                    if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     6815                    {
     6816                      abPdmAvailable[ uiCurrRefListId ] = true;
     6817                      TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
     6818#if H_3D_NBDV
     6819#if H_3D_IV_MERGE
     6820                      if( !bIsDepth )
     6821                      {
     6822#endif
     6823                        cMv.setIDVFlag   (true);
     6824                        cMv.setIDVHor    (cDv.getHor());                 
     6825                        cMv.setIDVVer    (cDv.getVer()); 
     6826                        cMv.setIDVVId    (iViewIndex);
     6827#if H_3D_IV_MERGE
     6828                      }
     6829#endif
     6830#endif
     6831#if !(NTT_BUG_FIX_TK54)
     6832                      clipMv( cMv );
     6833#endif
     6834                      paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
     6835                      pacPdmMv      [ uiCurrRefListId ] = cMv;
     6836                      stopLoop = true;
     6837                      break;
     6838                    }
     6839                  }
     6840                }
     6841              }
     6842            }
     6843          }
     6844        }
     6845        availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
     6846
     6847        if(availableMcDc[0])
     6848        {
     6849
     6850          Int         iBasePosX, iBasePosY;
     6851          for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
     6852          {
     6853            for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
     6854            {
     6855              iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
     6856              iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));
     6857
     6858              pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
     6859              pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     6860              if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
     6861              {
     6862                for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     6863                {
     6864                  RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     6865                  Bool bLoop_stop = false;
     6866                  for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     6867                  {
     6868                    RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     6869                    TComMvField cBaseMvField;
     6870                    pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
     6871                    Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
     6872                    if (iBaseRefIdx >= 0)
     6873                    {
     6874                      Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
     6875                      if (iBaseRefPOC != pcSlice->getPOC())   
     6876                      {
     6877                        for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
     6878                        {
     6879                          if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     6880                          {
     6881                            abPdmAvailable[ uiCurrRefListId ] = true;
     6882                            TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
     6883
     6884                            if( !bIsDepth )
     6885                            {
     6886                              cMv.setIDVFlag   (true);
     6887                              cMv.setIDVHor    (cDv.getHor());                 
     6888                              cMv.setIDVVer    (cDv.getVer()); 
     6889                              cMv.setIDVVId    (iViewIndex);
     6890                            }
     6891
     6892#if !(NTT_BUG_FIX_TK54)
     6893                            clipMv( cMv );
     6894#endif
     6895                            bLoop_stop = true;
     6896
     6897                            pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
     6898                            break;
     6899                          }
     6900                        }
     6901                      }
     6902                    }
     6903                  }
     6904                }
     6905              }
     6906
     6907              puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
     6908              if (puhInterDirSP[iPartition] == 0)
     6909              {
     6910                puhInterDirSP[iPartition] = availableMcDc[0];
     6911                pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
     6912                pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
     6913
     6914              }
     6915              if (iSPHeight + iSPWidth == 12)
     6916              {
     6917                if (puhInterDirSP[iPartition] == 3)
     6918                {
     6919                  puhInterDirSP[iPartition] = 1;
     6920                  pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     6921                }
     6922              }
     6923              iPartition ++;
     6924            }
     6925          }
     6926        }
     6927      }
     6928
     6929      iCurrPosX  += ( iWidth  >> 1 );
     6930      iCurrPosY  += ( iHeight >> 1 );
     6931    }
     6932#endif
     6933
     6934    ////////////////////////////////
     6935    /////// IvMC + IvMCShift ///////
     6936    ////////////////////////////////
     6937
     6938#if H_3D_SPIVMP
     6939    if(m_pcSlice->getIsDepth())
     6940    {
     6941      iCurrPosX  += ( iWidth  >> 1 );
     6942      iCurrPosY  += ( iHeight >> 1 );
     6943    }
     6944    for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    74076945#else
    7408     if( getPartitionSize(0) == SIZE_2Nx2N )
    7409 #endif
    7410     {
    7411       Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
    7412       getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
    7413 
    7414       for (Int i=0; i<iNumSP; i++)
    7415       {
    7416         puhInterDirSP[i] = 0;
    7417         pcMvFieldSP[2*i].getMv().set(0, 0);
    7418         pcMvFieldSP[2*i+1].getMv().set(0,0);
    7419         pcMvFieldSP[2*i].setRefIdx(-1);
    7420         pcMvFieldSP[2*i+1].setRefIdx(-1);
    7421       }
     6946    for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     6947#endif
     6948    {
     6949      // iLoopCan == 0 --> IvMC
     6950      // iLoopCan == 1 --> IvMCShift
    74226951
    74236952      Int         iBaseCUAddr;
    74246953      Int         iBaseAbsPartIdx;
    7425       TComDataCU* pcBaseCU;
    7426       Int iPartition = 0;
    7427 
    7428       Int iDelX = iSPWidth/2;
    7429       Int iDelY = iSPHeight/2;
    7430 
    7431       Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
    7432       Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
    7433       Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
    7434 
    7435       if(iWidth == iSPWidth && iHeight == iSPHeight)
    7436       {
    7437         iCenterPosX = iCurrPosX + (iWidth >> 1);
    7438         iCenterPosY = iCurrPosY + (iHeight >> 1);
    7439       }
    7440 
    7441       Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
    7442       Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );
    7443 
    7444       pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
    7445       TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
    7446       if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
    7447       {
     6954
     6955      Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 );
     6956      Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
     6957
     6958      Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
     6959      Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
     6960      pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
     6961
     6962      TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     6963      if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
     6964      {
     6965        // Loop reference picture list of current slice (X in spec).
    74486966        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
    74496967        {
    74506968          RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     6969
    74516970          Bool stopLoop = false;
     6971          // Loop reference picture list of candidate slice (Y in spec)
    74526972          for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
    74536973          {
    7454             RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7455             TComMvField cDefaultMvField;
    7456             pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
    7457             Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
    7458             if (iDefaultRefIdx >= 0)
     6974            RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     6975            TComMvField cBaseMvField;
     6976            pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
     6977            Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
     6978            if (iBaseRefIdx >= 0)
    74596979            {
    7460               Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
    7461               if (iDefaultRefPOC != pcSlice->getPOC())   
     6980              Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
     6981              if (iBaseRefPOC != pcSlice->getPOC())   
    74626982              {
    74636983                for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    74646984                {
    7465                   if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     6985                  if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    74666986                  {
    7467                     abPdmAvailable[ uiCurrRefListId ] = true;
    7468                     TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
     6987                    abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true;
     6988                    TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    74696989#if H_3D_NBDV
    74706990#if H_3D_IV_MERGE
     
    74837003                    clipMv( cMv );
    74847004#endif
    7485                     paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
    7486                     pacPdmMv      [ uiCurrRefListId ] = cMv;
     7005                    paiPdmRefIdx  [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx;
     7006                    pacPdmMv      [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv;
    74877007                    stopLoop = true;
    74887008                    break;
     
    74947014        }
    74957015      }
    7496       availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
    7497 
    7498       if(availableMcDc[0])
    7499       {
    7500 
    7501         Int         iBasePosX, iBasePosY;
    7502         for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
    7503         {
    7504           for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
    7505           {
    7506             iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
    7507             iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));
    7508 
    7509             pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
    7510             pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7511             if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    7512             {
    7513               for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
    7514               {
    7515                 RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    7516                 Bool bLoop_stop = false;
    7517                 for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
    7518                 {
    7519                   RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7520                   TComMvField cBaseMvField;
    7521                   pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    7522                   Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    7523                   if (iBaseRefIdx >= 0)
    7524                   {
    7525                     Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
    7526                     if (iBaseRefPOC != pcSlice->getPOC())   
    7527                     {
    7528                       for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    7529                       {
    7530                         if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    7531                         {
    7532                           abPdmAvailable[ uiCurrRefListId ] = true;
    7533                           TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    7534 
    7535                           if( !bIsDepth )
    7536                           {
    7537                             cMv.setIDVFlag   (true);
    7538                             cMv.setIDVHor    (cDv.getHor());                 
    7539                             cMv.setIDVVer    (cDv.getVer()); 
    7540                             cMv.setIDVVId    (iViewIndex);
    7541                           }
    7542                          
    7543 #if !(NTT_BUG_FIX_TK54)
    7544                           clipMv( cMv );
    7545 #endif
    7546                           bLoop_stop = true;
    7547 
    7548                           pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
    7549                           break;
    7550                         }
    7551                       }
    7552                     }
    7553                   }
    7554                 }
    7555               }
    7556             }
    7557 
    7558             puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
    7559             if (puhInterDirSP[iPartition] == 0)
    7560             {
    7561               puhInterDirSP[iPartition] = availableMcDc[0];
    7562               pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
    7563               pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
    7564 
    7565             }
    7566 #if MTK_DIS_SPBIP8X4_H0205
    7567             if (iSPHeight + iSPWidth == 12)
    7568             {
    7569               if (puhInterDirSP[iPartition] == 3)
    7570               {
    7571                 puhInterDirSP[iPartition] = 1;
    7572                 pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
    7573               }
    7574             }
    7575 #endif
    7576             iPartition ++;
    7577           }
    7578         }
    7579       }
    7580     }
    7581 
    7582     iCurrPosX  += ( iWidth  >> 1 );
    7583     iCurrPosY  += ( iHeight >> 1 );
    7584   }
    7585 #endif
    7586 
    7587   ////////////////////////////////
    7588   /////// IvMC + IvMCShift ///////
    7589   ////////////////////////////////
    7590 
     7016    }
    75917017#if H_3D_SPIVMP
    7592   if(m_pcSlice->getIsDepth())
    7593   {
    7594     iCurrPosX  += ( iWidth  >> 1 );
    7595     iCurrPosY  += ( iHeight >> 1 );
    7596   }
    7597 #if MTK_DIS_SPBIP8X4_H0205
    7598   for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7018    for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    75997019#else
    7600   for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7601 #endif
    7602 #else
    7603   for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    7604 #endif
    7605   {
    7606     // iLoopCan == 0 --> IvMC
    7607     // iLoopCan == 1 --> IvMCShift
    7608 
    7609     Int         iBaseCUAddr;
    7610     Int         iBaseAbsPartIdx;
    7611 
    7612     Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 );
    7613     Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
    7614 
    7615     Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
    7616     Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
    7617     pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
    7618 
    7619     TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7620     if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    7621     {
    7622       // Loop reference picture list of current slice (X in spec).
    7623       for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
    7624       {
    7625         RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    7626 
    7627         Bool stopLoop = false;
    7628         // Loop reference picture list of candidate slice (Y in spec)
    7629         for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
    7630         {
    7631           RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7632           TComMvField cBaseMvField;
    7633           pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    7634           Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    7635           if (iBaseRefIdx >= 0)
    7636           {
    7637             Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
    7638             if (iBaseRefPOC != pcSlice->getPOC())   
    7639             {
    7640               for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    7641               {
    7642                 if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    7643                 {
    7644                   abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true;
    7645                   TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    7646 #if H_3D_NBDV
    7647 #if H_3D_IV_MERGE
    7648                   if( !bIsDepth )
    7649                   {
    7650 #endif
    7651                     cMv.setIDVFlag   (true);
    7652                     cMv.setIDVHor    (cDv.getHor());                 
    7653                     cMv.setIDVVer    (cDv.getVer()); 
    7654                     cMv.setIDVVId    (iViewIndex);
    7655 #if H_3D_IV_MERGE
    7656                   }
    7657 #endif
    7658 #endif
    7659 #if !(NTT_BUG_FIX_TK54)
    7660                   clipMv( cMv );
    7661 #endif
    7662                   paiPdmRefIdx  [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx;
    7663                   pacPdmMv      [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv;
    7664                   stopLoop = true;
    7665                   break;
    7666                 }
    7667               }
    7668             }
    7669           }
    7670         }
    7671       }
    7672     }
    7673   }
    7674 #if H_3D_SPIVMP
    7675 #if H_3D_FIX_DBBP_IVMP
    7676   for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7677 #else
    7678   for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7679 #endif
    7680 #else
    7681   for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    7682 #endif
    7683   {
    7684     availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0);
    7685   }
    7686 
    7687 #if SEC_ADAPT_DISABLE_IVMP
    7688   }
    7689 #endif
     7020    for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7021#endif
     7022    {
     7023      availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0);
     7024    }
     7025
     7026  }
    76907027
    76917028  ////////////////////////////////
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r964 r976  
    7070  Bool        abMergeFlag[2];       // for two segments
    7171  UChar       auhMergeIndex[2];     // for two segments
    72 #if !RWTH_DBBP_NO_SPU_H0057
    73   Char        ahVSPFlag[2];         // for two segments
    74   DisInfo     acDvInfo[2];          // for two segments
    75 #endif
    76  
    7772  PartSize    eVirtualPartSize;
    7873  UInt        uiVirtualPartIndex;
     
    195190  Bool*         m_pbSDCFlag;
    196191  Pel*          m_apSegmentDCOffset[2];
    197 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    198192  Pel          m_apDmmPredictor[2];
    199 #endif
    200193#endif
    201194#endif
     
    238231#endif
    239232
    240 #if ETRIKHU_CLEANUP_H0083
     233#if H_3D_IV_MERGE
    241234  TComMotionCand  m_mergCands[MRG_IVSHIFT+1];
    242235  Int           m_baseListidc;
     
    249242  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    250243#if H_3D_VSP
    251 #if ETRIKHU_CLEANUP_H0083
    252244  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount);
    253 #else
    254   Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    255                              Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo);
    256 #endif
    257245#endif
    258246#if H_3D_IV_MERGE
    259 #if ETRIKHU_CLEANUP_H0083
    260247  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
    261 #else
    262   Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv,
    263                                Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo   );
    264 #endif
    265 #if ETRIKHU_CLEANUP_H0083
    266248  Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
    267 #else
    268   Bool          xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int*  ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand );
    269 #endif
    270249#endif
    271250
     
    507486   
    508487#if H_3D
    509 #if !ETRIKHU_CLEANUP_H0083
    510   Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
    511 #endif
    512488  Bool          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    513489  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
     
    532508#if H_3D_SPIVMP
    533509    , TComMvField* pcMFieldSP, UChar* puhInterDirSP
    534 #endif
    535 #if SEC_ADAPT_DISABLE_IVMP
     510#endif   
    536511    , Bool bICFlag
    537 #endif
    538512    );   
    539513#endif
     
    583557  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    584558  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
    585 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    586559  Void          setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; }
    587560  Pel           getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; }
    588 #endif
    589561  UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
    590   UInt          getCtxAngleFlag        ( UInt   uiAbsPartIdx );
    591562#endif
    592563#endif
     
    666637  Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;}
    667638  Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;}
    668 #if ETRIKHU_CLEANUP_H0083
    669639  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
    670640  Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     
    677647    , Int& numValidMergeCand
    678648    );
    679 #else
    680   Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
    681 #endif
    682649  Void          getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1);
    683650  Void          xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     
    686653#endif
    687654#if H_3D_VSP
    688 #if !ETRIKHU_CLEANUP_H0083
    689                                             , Int* vspFlag
    690 #endif
    691655                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
    692656#endif
    693657#if H_3D_SPIVMP
    694 #if ETRIKHU_CLEANUP_H0083
    695658                                            , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    696 #else
    697                                             , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    698 #endif
    699659#endif
    700660                                            , Int& numValidMergeCand, Int mrgCandIdx = -1
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r950 r976  
    198198//! \}
    199199
    200 #if ETRIKHU_CLEANUP_H0083
     200#if H_3D_IV_MERGE
    201201class TComMotionCand
    202202{
  • trunk/source/Lib/TLibCommon/TComPic.cpp

    r964 r976  
    5555, m_bReconstructed                        (false)
    5656, m_bNeededForOutput                      (false)
    57 #if H_MV_HLS_7_VPS_P0300_27
     57#if H_MV
    5858, m_bPicOutputFlag                        (false)
    5959#endif
  • trunk/source/Lib/TLibCommon/TComPic.h

    r964 r976  
    6969  Bool                  m_bReconstructed;
    7070  Bool                  m_bNeededForOutput;
    71 #if H_MV_HLS_7_VPS_P0300_27
     71#if H_MV
    7272  Bool                  m_bPicOutputFlag;         // Semantics variable
    7373#endif
     
    178178  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
    179179  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
    180  #if H_MV_HLS_7_VPS_P0300_27
     180 #if H_MV
    181181  Void          setPicOutputFlag(Bool b) { m_bPicOutputFlag = b;      }
    182182  Bool          getPicOutputFlag()       { return m_bPicOutputFlag ;  }
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r964 r976  
    500500  Pel* pDst = piPred;
    501501  xAssignBiSegDCs( pDst, uiStride, biSegPattern, patternStride, segDC1, segDC2 );
    502 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    503502  pcCU->setDmmPredictor(segDC1, 0);
    504503  pcCU->setDmmPredictor(segDC2, 1);
    505 #endif
    506504
    507505#if H_3D_DIM_DMM
     
    523521      Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC();
    524522      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
     523#if H_3D_ARP
    526524      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
    527525#else
     
    647645 
    648646  // start mapping process
    649 #if !MTK_DBBP_AMP_REM_H0072
    650   Bool bAMPAvail = uiSize > 8;
    651   Int matchedPartSum[6][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}}; // counter for each part size and boolean option
    652   PartSize virtualPartSizes[6] = { SIZE_Nx2N, SIZE_2NxN, SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N };
    653 #else
    654647  Int matchedPartSum[2][2] = {{0,0},{0,0}}; // counter for each part size and boolean option
    655648  PartSize virtualPartSizes[2] = { SIZE_Nx2N, SIZE_2NxN};
    656 #endif
    657649 
    658650  UInt uiHalfSize = uiSize>>1;
    659 #if !MTK_DBBP_AMP_REM_H0072
    660   UInt uiQuarterSize = uiSize>>2;
    661 #endif
    662  
    663651  for (Int y=0; y<uiSize; y+=iSubSample)
    664652  {
     
    691679        matchedPartSum[1][1-ucSegment]++;
    692680      }
    693      
    694 #if !MTK_DBBP_AMP_REM_H0072
    695       if( bAMPAvail )
    696       {
    697         // SIZE_2NxnU
    698         if(y<uiQuarterSize)  // top (1/4)
    699         {
    700           matchedPartSum[2][ucSegment]++;
    701         }
    702         else  // bottom (3/4)
    703         {
    704           matchedPartSum[2][1-ucSegment]++;
    705         }
    706        
    707         // SIZE_2NxnD
    708         if(y<(uiQuarterSize*3))  // top (3/4)
    709         {
    710           matchedPartSum[3][ucSegment]++;
    711         }
    712         else  // bottom (1/4)
    713         {
    714           matchedPartSum[3][1-ucSegment]++;
    715         }
    716        
    717         // SIZE_nLx2N
    718         if(x<uiQuarterSize)  // left (1/4)
    719         {
    720           matchedPartSum[4][ucSegment]++;
    721         }
    722         else  // right (3/4)
    723         {
    724           matchedPartSum[4][1-ucSegment]++;
    725         }
    726        
    727         // SIZE_nRx2N
    728         if(x<(uiQuarterSize*3))  // left (3/4)
    729         {
    730           matchedPartSum[5][ucSegment]++;
    731         }
    732         else  // right (1/4)
    733         {
    734           matchedPartSum[5][1-ucSegment]++;
    735         }
    736       }
    737 #endif
    738681    }
    739682   
     
    745688 
    746689  Int iMaxMatchSum = 0;
    747 #if !MTK_DBBP_AMP_REM_H0072
    748   for(Int p=0; p<6; p++)  // loop over partition
    749 #else
    750690  for(Int p=0; p<2; p++)  // loop over partition
    751 #endif
    752691  {
    753692    for( Int b=0; b<=1; b++ ) // loop over boolean options
     
    859798 
    860799  UInt  uiMaskStride= MAX_CU_SIZE;
    861 #if SEC_DBBP_FILTERING_H0104
    862800  Pel  filSrc = 0;
    863801  Pel* tmpTar = 0;
    864802  tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight);
    865 #endif
    866803 
    867804  // backup pointer
     
    877814     
    878815      // filtering
    879 #if SEC_DBBP_FILTERING_H0104
    880816      tmpTar[y*uiWidth+x] = piSrc[ucSegment][x];
    881 #else
    882       Bool t = (y==0)?pMaskStart[(y+1)*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];
    883       Bool l = (x==0)?pMaskStart[y*uiMaskStride+x+1]:pMaskStart[y*uiMaskStride+x-1];
    884       Bool b = (y==uiHeight-1)?pMaskStart[(y-1)*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x];
    885       Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x-1]:pMaskStart[y*uiMaskStride+x+1];
    886      
    887       Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r));
    888       piDst[x] = bBlend?((piSrc[0][x]+piSrc[1][x]+1)>>1):piSrc[ucSegment][x];
    889 #endif
    890817    }
    891818   
    892819    piSrc[0]  += uiSrcStride;
    893820    piSrc[1]  += uiSrcStride;
    894 #if !SEC_DBBP_FILTERING_H0104
    895     piDst     += uiDstStride;
    896 #endif
    897821    pMask     += uiMaskStride;
    898822  }
    899823 
    900 #if SEC_DBBP_FILTERING_H0104
    901824  for (Int y=0; y<uiHeight; y++)
    902825  {
     
    933856  }
    934857  if ( tmpTar    ) { xFree(tmpTar);             tmpTar        = NULL; }
    935 #endif
    936858 
    937859  // now combine chroma
     
    944866  UInt  uiWidthC        = uiWidth >> 1;
    945867  UInt  uiHeightC       = uiHeight >> 1;
    946 #if SEC_DBBP_FILTERING_H0104
    947868  Pel  filSrcU = 0, filSrcV = 0;
    948869  Pel* tmpTarU = 0, *tmpTarV = 0;
    949870  tmpTarU = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC);
    950871  tmpTarV = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC);
    951 #endif
    952872  pMask = pMaskStart;
    953873 
     
    960880     
    961881      // filtering
    962 #if SEC_DBBP_FILTERING_H0104
    963882      tmpTarU[y*uiWidthC+x] = piSrcU[ucSegment][x];
    964883      tmpTarV[y*uiWidthC+x] = piSrcV[ucSegment][x];
    965 #else
    966       Bool t = (y==0)?pMaskStart[(y+1)*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];
    967       Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+(x+1)*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];
    968       Bool b = (y==uiHeightC-1)?pMaskStart[(y-1)*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2];
    969       Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+(x-1)*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2];
    970      
    971       Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r));
    972      
    973       piDstU[x] = bBlend?((piSrcU[0][x]+piSrcU[1][x]+1)>>1):piSrcU[ucSegment][x];
    974       piDstV[x] = bBlend?((piSrcV[0][x]+piSrcV[1][x]+1)>>1):piSrcV[ucSegment][x];
    975 #endif
    976884    }
    977885   
     
    980888    piSrcV[0]   += uiSrcStrideC;
    981889    piSrcV[1]   += uiSrcStrideC;
    982 #if !SEC_DBBP_FILTERING_H0104
    983     piDstU      += uiDstStrideC;
    984     piDstV      += uiDstStrideC;
    985 #endif
    986890    pMask       += 2*uiMaskStride;
    987891  }
    988892
    989 #if SEC_DBBP_FILTERING_H0104
    990893  for (Int y=0; y<uiHeightC; y++)
    991894  {
     
    1035938  if ( tmpTarU    ) { xFree(tmpTarU);             tmpTarU        = NULL; }
    1036939  if ( tmpTarV    ) { xFree(tmpTarV);             tmpTarV        = NULL; }
    1037 #endif
    1038940}
    1039941#endif
     
    23282230  if (orgDC == false)
    23292231  {
    2330 #if !HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    2331     if ( getDimType(uiIntraMode) == DMM1_IDX )
    2332     {
    2333       UChar ucSegmentLT = pMask[0];
    2334       UChar ucSegmentRT = pMask[uiSize-1];
    2335       UChar ucSegmentLB = pMask[uiMaskStride * (uiSize-1)];
    2336       UChar ucSegmentRB = pMask[uiMaskStride * (uiSize-1) + (uiSize-1)];
    2337 
    2338       rpSegMeans[ucSegmentLT] = pOrig[0];
    2339       rpSegMeans[ucSegmentRT] = pOrig[uiSize-1];
    2340       rpSegMeans[ucSegmentLB] = pOrig[uiStride * (uiSize-1) ];
    2341       rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ];
    2342     }
    2343     else if( getDimType( uiIntraMode ) == DMM4_IDX )
    2344     {
    2345       Pel *ptmpOrig = pOrig;
    2346       Bool *ptmpMask = pMask, bBreak = false;
    2347       UChar ucSegment = ptmpMask? (UChar) ptmpMask[0] : 0;
    2348       UChar bFirstSeg = ucSegment;
    2349 
    2350       rpSegMeans[ucSegment] = ptmpOrig[0];
    2351       for ( Int y = 0; y < uiSize; y++ )
    2352       {
    2353         for ( Int x = 0; x < uiSize; x++ )
    2354         {
    2355           ucSegment = ptmpMask[x];
    2356           assert( ucSegment < uiNumSegments );
    2357 
    2358           if( bFirstSeg != ucSegment )
    2359           {
    2360             rpSegMeans[ucSegment] = ptmpOrig[x];
    2361             bBreak = true;
    2362             break;
    2363           }
    2364         }
    2365 
    2366         if( bBreak )
    2367         {
    2368           break;
    2369         }
    2370 
    2371         ptmpOrig  += uiStride;
    2372         ptmpMask  += uiMaskStride;
    2373       }
    2374     }
    2375     else
    2376 #endif
    2377     {
    2378       Pel* pLeftTop = pOrig;
    2379       Pel* pRightTop = pOrig + (uiSize-1);
    2380       Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1)));
    2381       Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1));
    2382 
    2383       rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2;
    2384     }
     2232    Pel* pLeftTop = pOrig;
     2233    Pel* pRightTop = pOrig + (uiSize-1);
     2234    Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1)));
     2235    Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1));
     2236
     2237    rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2;
    23852238    return;
    23862239  }
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r964 r976  
    360360Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
    361361
    362 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
     362#if H_3D_IC
    363363UInt g_aICEnableCANDIDATE[10] = { 0, };
    364364UInt g_aICEnableNUM[ 10 ] = { 0, };
  • trunk/source/Lib/TLibCommon/TComRom.h

    r964 r976  
    189189extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
    190190
    191 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
     191#if H_3D_IC
    192192extern UInt g_aICEnableCANDIDATE[10];
    193193extern UInt g_aICEnableNUM[ 10 ]; //10 layers
    194 extern Int g_lastlayer;
     194extern Int  g_lastlayer;
    195195#endif
    196196
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r964 r976  
    4848TComSlice::TComSlice()
    4949: m_iPPSId                        ( -1 )
    50 #if H_MV_HLS_8_POC_Q0142_32
     50#if H_MV
    5151, m_slicePicOrderCntLsb           ( 0 )
    5252#endif
     
    18631863#endif
    18641864{
    1865 #if H_MV_HLS_8_SYN_Q0041_03
     1865#if H_MV
    18661866  m_vpsBaseLayerInternalFlag = true;
    18671867#endif
     
    18831883  m_vpsNumProfileTierLevelMinus1 = -1;
    18841884   
    1885 #if H_MV_HLS_8_SYN_39_19
    18861885  m_numAddLayerSets              = 0;   
    18871886  m_numAddOlss                   = 0;
    1888 #else
    1889   m_numAddLayerSets              = -1;   
    1890 #endif
    18911887  m_defaultOutputLayerIdc     = 0;
    18921888 
     
    19021898  }
    19031899
    1904 #if H_MV_HLS_8_PMS_Q0195_20
    19051900  m_repFormatIdxPresentFlag = false;
    1906 #endif
    19071901  m_maxOneActiveRefLayerFlag = false;
    19081902  m_directDepTypeLenMinus2   = 0;         
    19091903 
    19101904
    1911 #if H_MV_HLS_8_RPS_Q0100_36
    19121905  m_vpsExtensionFlag = true;
    1913 #endif
    1914   m_avcBaseLayerFlag = false;
    19151906  m_vpsNonVuiExtensionLength = 0;
    19161907  m_splittingFlag    = false;
     
    20322023  }
    20332024
    2034 
    2035 #if H_MV_HLS_8_PMS_Q0195_20
    20362025  //The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive.
    20372026  assert( getVpsNumRepFormatsMinus1() >= 0 );
    20382027  assert( getVpsNumRepFormatsMinus1() <= 255 );
    2039 #endif
    20402028
    20412029  return true;
     
    20832071  }
    20842072
    2085 #if H_MV_HLS_8
    20862073  for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ )
    20872074  {
     
    20962083    }
    20972084  }
    2098 
    20992085
    21002086  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
     
    21072093    }
    21082094  }
    2109 
    21102095
    21112096  for( Int i = 0; i <= getMaxLayersMinus1(); i++ )  // Bug in spec "<" instead of "<="
     
    21492134    m_numIndependentLayers = k;
    21502135  }
    2151 #endif
    21522136}
    21532137
     
    23142298Int    TComVPS::getNumOutputLayerSets()
    23152299{
    2316 #if H_MV_HLS_8_SYN_39_19
    23172300  return getNumAddOlss() + getNumLayerSets();
    2318 #else
    2319   return getNumAddLayerSets() + getVpsNumLayerSetsMinus1() + 1;
    2320 #endif
    23212301}
    23222302
     
    23842364    }
    23852365  } 
    2386 #if H_MV_HLS_8_PMS_Q0165_18
    23872366  assert( getNumOutputLayersInOutputLayerSet( i ) > 0 );
    2388 #endif
    23892367}
    23902368
     
    24202398{
    24212399  Int maxSLMinus1 = 0;
    2422 #if H_MV_HLS_8_MIS_Q0102_30
    24232400  for( Int k = 0; k < getNumLayersInIdList( i ); k++ )
    24242401  {
    24252402    Int lId = m_layerSetLayerIdList[i][k];
    2426 #else 
    2427   Int optLsIdx    = olsIdxToLsIdx( i );
    2428 
    2429   for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
    2430   {
    2431     Int lId = m_layerSetLayerIdList[optLsIdx][k];
    2432 #endif
    24332403    maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
    24342404  }
    24352405  return maxSLMinus1;
    24362406}
    2437 #if H_MV_HLS_8_RPS_Q0100_36
     2407
    24382408Void TComVPS::inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder )
    24392409{
     
    24582428  }
    24592429}
    2460 #endif
     2430
     2431Bool TComVPS::getAltOutputLayerFlagVar( Int i )
     2432{
     2433  // Semantics variable not syntax element !
     2434
     2435  Bool altOptLayerFlag = false;     
     2436  if ( i > 0 && getNumOutputLayersInOutputLayerSet( i ) == 1 &&
     2437    getNumDirectRefLayers( getOlsHighestOutputLayerId( i ) ) > 0 )
     2438  {
     2439    altOptLayerFlag = getAltOutputLayerFlag( i );
     2440  }
     2441  return altOptLayerFlag;
     2442}
     2443
     2444Int TComVPS::getMaxNumPics( Int layerId )
     2445{
     2446  Int maxNumPics = MAX_INT;
     2447  for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++)
     2448  {
     2449    Int lsIdx = olsIdxToLsIdx( olsIdx );
     2450    for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
     2451    {
     2452      if( getLayerSetLayerIdList(lsIdx, j ) ==  layerId )
     2453      {
     2454        Int maxSL = getMaxSubLayersInLayerSetMinus1( lsIdx );
     2455        maxNumPics = std::min( maxNumPics, getDpbSize()->getMaxVpsDecPicBufferingMinus1( olsIdx , j,  maxSL ) );
     2456      }
     2457    }
     2458  }
     2459  assert( maxNumPics != MAX_INT );
     2460  return maxNumPics;
     2461}
     2462
     2463Void TComVPS::xSetRefLayerFlags( Int currLayerId )
     2464{
     2465  for( Int j = 0; j < getNumDirectRefLayers( currLayerId ); j++ )
     2466  {
     2467    Int refLayerId = m_refLayerId[ currLayerId ][ j ];
     2468    m_recursiveRefLayerFlag[ currLayerId ][ refLayerId ] = 1;
     2469    for( Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
     2470    {
     2471      m_recursiveRefLayerFlag[ currLayerId ][ k ] = m_recursiveRefLayerFlag[ currLayerId ][ k ]  ||  m_recursiveRefLayerFlag[ refLayerId ][ k ];
     2472    }
     2473  }
     2474}
     2475
    24612476#endif // H_MV
    24622477
     
    25302545  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
    25312546#if H_MV
    2532 #if !H_MV_HLS_8_SPS_NODOC_48
    2533   m_spsExtensionPresentFlag = false;
    2534   for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
    2535   {
    2536     m_spsExtensionTypeFlag[ i ] = false;
    2537   }
    2538 #else
    25392547  m_spsRangeExtensionsFlag     = false;
    25402548  m_spsMultilayerExtensionFlag = false;
     
    25442552#else
    25452553  m_spsExtension6bits          = 0;
    2546 #endif
    25472554#endif
    25482555
     
    27262733
    27272734#if H_MV
    2728 #if H_MV_HLS_8_SPS_NODOC_48
    27292735  m_ppsRangeExtensionsFlag     = false;
    27302736  m_ppsMultilayerExtensionFlag = false;
     
    27342740  m_pps3dExtensionFlag         = false;
    27352741  m_ppsExtension5bits          = 0;
    2736 #endif
    2737 #else
    2738   for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
    2739   {
    2740     m_ppsExtensionTypeFlag[ i ] = false;
    2741   }
    27422742#endif
    27432743#endif
     
    29842984  }
    29852985}
     2986
     2987Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
     2988{
     2989  const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
     2990
     2991  if (getLayerId() > 0 )
     2992  {
     2993    Int layerIdx = 0;         
     2994    while (layerIdx < (Int) targetDecLayerIdList.size() )
     2995    {
     2996      if ( targetDecLayerIdList[layerIdx] == currLayerId )
     2997      {
     2998        break;
     2999      }
     3000      layerIdx++;
     3001    }
     3002
     3003    assert( layerIdx < (Int) targetDecLayerIdList.size() );
     3004
     3005    for (Int i = 0; i <= getSpsMaxSubLayersMinus1(); i++ )
     3006    {
     3007      Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ;
     3008
     3009      if ( encoder )
     3010      {
     3011        assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 );
     3012      }
     3013      else
     3014      {
     3015        setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 );
     3016      }
     3017    }
     3018  }
     3019}
     3020
     3021Void TComSPS::checkRpsMaxNumPics( TComVPS* vps, Int currLayerId )
     3022{
     3023  // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead
     3024  // of nuh_layer_id of slice (currLayerId), this seems to be a bug.
     3025
     3026  for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
     3027  {
     3028    TComReferencePictureSet* rps = getRPSList()->getReferencePictureSet( i );
     3029    if ( !rps->getInterRPSPrediction() )
     3030    {
     3031      rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ),
     3032        getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 ); 
     3033    }
     3034  }
     3035}
     3036
    29863037#endif
    29873038
     
    31333184  printf("}\n");
    31343185}
     3186#if H_MV
     3187Void TComReferencePictureSet::checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 )
     3188{
     3189  assert( getNumberOfPictures() >= 0 );
     3190  if ( nuhLayerId == 0 )
     3191  {
     3192    assert( getNumberOfPictures() <= spsMaxDecPicBufferingMinus1 );
     3193  }
     3194
     3195  if ( vpsExtensionFlag )
     3196  {
     3197    assert( getNumberOfPictures() <= maxNumPics );
     3198  }
     3199}
     3200#endif
    31353201
    31363202TComRPSList::TComRPSList()
     
    32793345}
    32803346
    3281 #if !H_MV_HLS_8_DBP_NODOC_42
    3282 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
    3283 {
    3284   // Fill targetDecLayerIdSet with all layers if empty (at encoder side)
    3285   if (targetDecLayerIdSet.size() == 0 )   
    3286   {
    3287     for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ )
    3288     {
    3289       targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) );
    3290     }
    3291   }     
    3292 
    3293   Int numTargetDecLayers = (Int) targetDecLayerIdSet.size();
    3294   Int latestDecIdx;
    3295   for ( latestDecIdx = 0; latestDecIdx < numTargetDecLayers; latestDecIdx++)
    3296   {
    3297     if ( targetDecLayerIdSet[ latestDecIdx ] == curLayerId )
    3298     {
    3299       break;
    3300     }       
    3301   }       
    3302 
    3303   for( Int i = 0; i <= latestDecIdx; i++ )
    3304   {
    3305     if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ i ] ) )
    3306     {
    3307       TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc );
    3308       if ( pcPic )
    3309       {
    3310         if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    3311         {
    3312           Bool remainingInterLayerReferencesFlag = false;
    3313           for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
    3314           {
    3315             TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();
    3316             if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
    3317             {
    3318               for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
    3319               {
    3320                 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
    3321                 {
    3322                   remainingInterLayerReferencesFlag = true;
    3323                 }
    3324               }
    3325             }
    3326           }
    3327           if( !remainingInterLayerReferencesFlag )
    3328           {
    3329             pcPic->getSlice(0)->setReferenced( false );                   
    3330           }
    3331         }
    3332       }
    3333     }
    3334   }
    3335 }
    3336 #endif
    33373347Void TComSlice::printRefPicList()
    33383348
     
    33513361Void TComSlice::markCurrPic( TComPic* currPic )
    33523362{
    3353 
    3354 #if !H_MV_HLS_8_DBP_NODOC_42
    3355   if ( !currPic->getSlice(0)->getDiscardableFlag() )
    3356   {
    3357 #endif
    3358     currPic->getSlice(0)->setReferenced( true ) ;
    3359     currPic->setIsLongTerm( false );
    3360 #if !H_MV_HLS_8_DBP_NODOC_42
    3361   }
    3362   else
    3363   {
    3364     currPic->getSlice(0)->setReferenced( false ) ;
    3365   }
    3366 #endif
    3367 
    3368 #if H_MV_HLS_7_VPS_P0300_27
     3363  currPic->getSlice(0)->setReferenced( true ) ;
     3364  currPic->setIsLongTerm( false );
     3365
    33693366  currPic->setReconMark( true );
    33703367  currPic->setPicOutputFlag( currPic->getSlice(0)->getPicOutputFlag() );
    3371 #endif
    33723368}
    33733369
     
    34033399  Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) );
    34043400
    3405 #if H_MV_HLS_8_RPS_Q0060_17
    34063401  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  && ( getTLayer() == 0  ) &&
    34073402    ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );
    3408 #else
    3409   Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  &&
    3410     ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );
    3411 #endif
    34123403
    34133404  return refLayerPicFlag;       
     
    35413532#endif
    35423533#if H_3D_IC
    3543 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    35443534Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc)
    3545 #else
    3546 Void TComSlice::xSetApplyIC()
    3547 #endif
    3548 {
    3549 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
     3535{
    35503536  if(bUseLowLatencyICEnc)
    35513537  {
     
    35923578        Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]);
    35933579
    3594         if( ratio > MTK_LOW_LATENCY_IC_ENCODING_THRESHOLD_H0086)
     3580        if( ratio > IC_LOW_LATENCY_ENCODING_THRESHOLD)
    35953581{
    35963582          m_bApplyIC=true;
     
    36083594  else
    36093595  {
    3610 #endif
    36113596  Int iMaxPelValue = ( 1 << g_bitDepthY );
    36123597  Int *aiRefOrgHist;
     
    36823667  aiCurrHist = NULL;
    36833668  aiRefOrgHist = NULL;
    3684 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    36853669  }//if(bUseLowLatencyICEnc)
    3686 #endif
    36873670}
    36883671#endif
     
    37743757
    37753758#if H_3D_DDD
    3776     InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
     3759    initializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
    37773760#endif
    37783761  }
     
    37823765
    37833766#if H_3D_DDD
    3784 Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
     3767Void TComSlice::initializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
    37853768{
    37863769    UInt uiViewId     = getViewIndex();
     
    38393822
    38403823    return;
     3824}
     3825
     3826
     3827#endif
     3828
     3829#if H_MV
     3830Void TComSlice::checkCrossLayerBlaFlag()
     3831{
     3832  // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0.
     3833  if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
     3834  {
     3835    assert( m_crossLayerBlaFlag == 0 );
     3836  }
     3837}
     3838
     3839Bool TComSlice::inferPocMsbValPresentFlag()
     3840{
     3841  Bool pocMsbValPresentFlag;
     3842  if( getSliceSegmentHeaderExtensionLength() == 0 )
     3843  {
     3844    pocMsbValPresentFlag = false;
     3845  }
     3846  else if ( getPocMsbValRequiredFlag() )
     3847  {
     3848    pocMsbValPresentFlag = true;
     3849  }
     3850  else
     3851  {
     3852    pocMsbValPresentFlag = false;
     3853  }
     3854
     3855  return pocMsbValPresentFlag;
     3856}
     3857
     3858
     3859#endif
     3860
     3861#if H_3D_DBBP
     3862Int TComSlice::getDepthFromDV( Int iDV, Int iBaseViewIdx )
     3863{
     3864  return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]);
    38413865}
    38423866#endif
     
    43314355}
    43324356
     4357Void TComVpsVuiBspHrdParameters::checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j )
     4358{
     4359  // bsp_comb_hrd_idx
     4360  assert( getBspCombSchedIdx(h, i, j ) >= 0 );
     4361  assert( getBspCombSchedIdx(h, i, j ) <= getVpsNumBspHrdParametersMinus1() );
     4362
     4363  // bsp_comb_sched_idx
     4364  assert( getBspCombSchedIdx(h, i, j ) >= 0 );
     4365
     4366  //* This check needs to activated,  when HighestTid is available here   
     4367  //  assert(  getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) );
     4368}
     4369
    43334370Void TComVUI::inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr )
    43344371{
     
    43704407  }
    43714408}
    4372 #endif
     4409
     4410Void Window::scaleOffsets( Int scal )
     4411{
     4412  if (! m_scaledFlag )
     4413  {
     4414    m_scaledFlag         = true;
     4415    m_winLeftOffset     *= scal;
     4416    m_winRightOffset    *= scal;
     4417    m_winTopOffset      *= scal;
     4418    m_winBottomOffset   *= scal;
     4419  }
     4420}
     4421#endif
     4422
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r964 r976  
    5454class TComPicLists;
    5555class TComVPS;
    56 #if H_MV_HLS_8_RPS_Q0100_36
    5756class TComSPS;
    58 #endif
    5957#endif
    6058// ====================================================================================================================
     
    130128  Void printDeltaPOC();
    131129
    132 #if H_MV_HLS_8_RPS_Q0100_36
    133   Void checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 )
    134   {
    135     assert( getNumberOfPictures() >= 0 );
    136     if ( nuhLayerId == 0 )
    137     {
    138       assert( getNumberOfPictures() <= spsMaxDecPicBufferingMinus1 );
    139     }
    140 
    141     if ( vpsExtensionFlag )
    142     {
    143       assert( getNumberOfPictures() <= maxNumPics );
    144     }
    145   }
     130#if H_MV
     131  Void checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 );
    146132#endif
    147133};
     
    479465  Void setBspCombHrdIdx( Int h, Int i, Int j, Int  val ) { m_bspCombHrdIdx[h][i][j] = val; }
    480466  Int  getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; }
    481 #if H_MV_HLS_8_HRD_Q0101_04
    482467  Int  getBspCombHrdIdxLen() { return gCeilLog2( getVpsNumBspHrdParametersMinus1() + 1);  };
    483   Void checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j ) 
    484   {
    485     // bsp_comb_hrd_idx
    486     assert( getBspCombSchedIdx(h, i, j ) >= 0 );
    487     assert( getBspCombSchedIdx(h, i, j ) <= getVpsNumBspHrdParametersMinus1() );
    488 
    489     // bsp_comb_sched_idx
    490     assert( getBspCombSchedIdx(h, i, j ) >= 0 );
    491 
    492     //* This check needs to activated,  when HighestTid is available here   
    493     //  assert(  getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) );
    494   }
    495 #endif
     468
    496469
    497470  Void setBspCombSchedIdx( Int h, Int i, Int j, Int  val ) { m_bspCombSchedIdx[h][i][j] = val; }
    498471  Int  getBspCombSchedIdx( Int h, Int i, Int j ) { return m_bspCombSchedIdx[h][i][j]; }
     472
     473  Void checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j );
    499474
    500475  Void setHrdParametermeters( Int k, TComHRD* val  ) {  m_hrdParameters[k] = val; };
     
    695670private:
    696671  Int         m_VPSId;
    697 #if H_MV_HLS_8_SYN_Q0041_03
     672#if H_MV
    698673  Bool        m_vpsBaseLayerInternalFlag;
    699674#endif
     
    736711  TimingInfo  m_timingInfo;
    737712#if H_MV
    738   #if H_MV_HLS_8_RPS_Q0100_36
    739713  Bool        m_vpsExtensionFlag;
    740 #endif
     714
    741715  /// VPS EXTENSION SYNTAX ELEMENTS
    742   Bool        m_avcBaseLayerFlag;
    743716  Int         m_vpsNonVuiExtensionLength;
    744717  Bool        m_splittingFlag;
     
    761734
    762735  Int         m_numAddLayerSets;   
    763 #if H_MV_HLS_8_SYN_39_19
    764736  Int         m_highestLayerIdxPlus1     [MAX_VPS_ADD_OUTPUT_LAYER_SETS][MAX_NUM_LAYERS];
    765737  Int         m_numAddOlss;
    766 #endif
     738
    767739  Int         m_defaultOutputLayerIdc;
    768740
     
    802774  Int         m_refLayerId               [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
    803775
    804 #if H_MV_HLS_8
    805776  Int         m_numRefLayers             [MAX_NUM_LAYER_IDS];
    806777  Int         m_numPredictedLayers       [MAX_NUM_LAYERS];
     
    810781  Int         m_treePartitionLayerIdList [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
    811782  Bool        m_recursiveRefLayerFlag    [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
    812 #else
    813 
    814   Int         m_numSamplePredRefLayers   [MAX_NUM_LAYERS];
    815   Bool        m_samplePredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    816   Int         m_samplePredRefLayerId     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    817 
    818   Int         m_numMotionPredRefLayers   [MAX_NUM_LAYERS];
    819   Bool        m_motionPredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    820   Int         m_motionPredRefLayerId     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    821 #endif
     783
    822784  Int         m_viewIndex                [MAX_NUM_LAYERS   ];
    823785 
     
    828790
    829791  Int         xGetDimBitOffset( Int j );
    830 
    831 #if H_MV_HLS_8
    832   Void xSetRefLayerFlags( Int currLayerId )
    833   {
    834     for( Int j = 0; j < getNumDirectRefLayers( currLayerId ); j++ )
    835     {
    836       Int refLayerId = m_refLayerId[ currLayerId ][ j ];
    837       m_recursiveRefLayerFlag[ currLayerId ][ refLayerId ] = 1;
    838       for( Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
    839       {
    840         m_recursiveRefLayerFlag[ currLayerId ][ k ] = m_recursiveRefLayerFlag[ currLayerId ][ k ]  ||  m_recursiveRefLayerFlag[ refLayerId ][ k ];
    841       }
    842     }
    843   }
    844 #endif
     792  Void        xSetRefLayerFlags( Int currLayerId );
    845793  // VPS EXTENSION 2 SYNTAX ELEMENTS
    846794#if H_3D_ARP
     
    902850  Void    setVPSId       (Int i)              { m_VPSId = i;             }
    903851
    904 #if H_MV_HLS_8_SYN_Q0041_03
     852#if H_MV
    905853  Void    setVpsBaseLayerInternalFlag( Bool flag ) { m_vpsBaseLayerInternalFlag = flag; }
    906854  Bool    getVpsBaseLayerInternalFlag(  )          { return m_vpsBaseLayerInternalFlag; }
     
    957905  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    958906#if H_MV
    959 
    960 #if H_MV_HLS_8_RPS_Q0100_36
    961907  Void    setVpsExtensionFlag( Bool flag )                                 { m_vpsExtensionFlag = flag; }
    962908  Bool    getVpsExtensionFlag(  )                                          { return m_vpsExtensionFlag; }
    963 #endif
    964 #if !H_MV_HLS_8_SYN_Q0041_03
    965   Void    setAvcBaseLayerFlag( Bool val )                                  { m_avcBaseLayerFlag = val;  }
    966   Bool    getAvcBaseLayerFlag()                                            { return m_avcBaseLayerFlag; }
    967 #endif
     909
    968910  Void    setVpsNonVuiExtensionLength( Int  val )                          { m_vpsNonVuiExtensionLength = val; }
    969911  Int     getVpsNonVuiExtensionLength(  )                                  { return m_vpsNonVuiExtensionLength; }
     
    1026968  Int     getNumAddLayerSets( )                                            { return m_numAddLayerSets; }
    1027969 
    1028 #if H_MV_HLS_8_SYN_39_19
    1029970  Void    setHighestLayerIdxPlus1( Int i, Int j, Int  val )                { m_highestLayerIdxPlus1[i][j] = val; }
    1030971  Int     getHighestLayerIdxPlus1( Int i, Int j )                          { return m_highestLayerIdxPlus1[i][j]; }
     
    1032973  Void    setNumAddOlss( Int  val )                                        { m_numAddOlss = val; }
    1033974  Int     getNumAddOlss(  )                                                { return m_numAddOlss; }
    1034 #endif
    1035975
    1036976  Void    setDefaultOutputLayerIdc( Int  val )                             { m_defaultOutputLayerIdc = val; }
     
    10601000  Int     getVpsRepFormatIdx( Int i )                                      { return m_vpsRepFormatIdx[i]; }
    10611001
    1062 #if H_MV_HLS_8_PMS_Q0195_20
    10631002  Int     inferVpsRepFormatIdx( Int i )                                    { return std::min( i, getVpsNumRepFormatsMinus1()  );  }
    1064 #endif
    10651003
    10661004  Void    setRepFormat( Int i, TComRepFormat* val )                        { m_repFormat[i] = val;  }
     
    10771015  Void    setDpbSize( TComDpbSize* val )                                   { assert( m_dpbSize != 0 ); m_dpbSize = val; }
    10781016  TComDpbSize* getDpbSize( )                                               { return m_dpbSize;}
    1079 #if H_MV_HLS_8_RPS_Q0100_36
     1017 
    10801018  Void    inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder );
    1081 #endif
    1082 
    1083 
     1019 
    10841020  Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; }
    10851021  Bool    getPocLsbNotPresentFlag( Int i )                                 { return m_pocLsbNotPresentFlag[i]; }
     
    11161052  Int     getRefLayerId        ( Int layerIdInNuh, Int idx );;
    11171053
    1118 #if H_MV_HLS_8
    11191054  Int     getNumRefLayers            ( Int i )        { return m_numRefLayers[i]; }
    11201055  Int     getNumPredictedLayers      ( Int i )        { return m_numPredictedLayers[i]; }
     
    11241059  Int     getTreePartitionLayerIdList( Int i, Int j ) { return m_treePartitionLayerIdList[i][j]; }
    11251060  Bool    getRecursiveRefLayerFlag   ( Int i, Int j ) { return m_recursiveRefLayerFlag[i][j]; }
    1126 
    1127 #endif
    1128 
    1129 #if H_MV_HLS_8_SYN_39_19
    11301061  Int     getNumLayerSets( )                                               { return getVpsNumLayerSetsMinus1() + 1 + getNumAddLayerSets();  }; 
    1131 #endif
     1062 
    11321063  Bool    checkVPSExtensionSyntax();
    11331064  Int     scalTypeToScalIdx   ( ScalabilityType scalType );
     
    11371068
    11381069  Int     getNumLayersInIdList ( Int lsIdx );
    1139 #if H_MV_HLS_8_RPS_Q0100_36
    11401070  Int     getLayerSetLayerIdList(Int lsIdx, Int j )                       { return m_layerSetLayerIdList[ lsIdx ][ j ]; };
    1141 #endif
    11421071
    11431072  Int     getNumOutputLayerSets() ;   
    1144 #if !H_MV_HLS_8_DBP_NODOC_42
    1145   Int     getNumSubDpbs( Int i )                                           { return getNumLayersInIdList( i ); }; 
    1146 #endif
     1073
    11471074  Bool    isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh );   
    11481075  Void    deriveLayerSetLayerIdList();
     
    11601087
    11611088  Int     getMaxSubLayersInLayerSetMinus1( Int i );
    1162 
    1163 #if H_MV_HLS_8_SYN_39_19
    11641089  Int     getHighestLayerIdxPlus1Len( Int j )                                   { return gCeilLog2( getNumLayersInTreePartition( j ) + 1 );   };
    1165 #endif
    1166 
    1167  
    1168 #if H_MV_HLS_7_VPS_P0300_27
    1169   Bool     getAltOutputLayerFlagVar( Int i )
    1170   {  // Semantics variable not syntax element !
    1171 
    1172     Bool altOptLayerFlag = false;     
    1173     if ( i > 0 && getNumOutputLayersInOutputLayerSet( i ) == 1 &&
    1174       getNumDirectRefLayers( getOlsHighestOutputLayerId( i ) ) > 0 )
    1175     {
    1176       altOptLayerFlag = getAltOutputLayerFlag( i );
    1177     }
    1178     return altOptLayerFlag;
    1179   };
    1180 #endif
     1090
     1091  Bool     getAltOutputLayerFlagVar( Int i );;
    11811092
    11821093  // inference
     
    11861097  // helpers
    11871098  Bool    getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 );
    1188 #if H_MV_HLS_8_RPS_Q0100_36
    1189   Int     getMaxNumPics( Int layerId )
    1190   {   
    1191     Int maxNumPics = MAX_INT;
    1192     for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++)
    1193     {
    1194       Int lsIdx = olsIdxToLsIdx( olsIdx );
    1195       for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
    1196       {
    1197         if( getLayerSetLayerIdList(lsIdx, j ) ==  layerId )
    1198         {
    1199           Int maxSL = getMaxSubLayersInLayerSetMinus1( lsIdx );
    1200           maxNumPics = std::min( maxNumPics, getDpbSize()->getMaxVpsDecPicBufferingMinus1( olsIdx , j,  maxSL ) );
    1201         }
    1202       }
    1203     }
    1204     assert( maxNumPics != MAX_INT );
    1205     return maxNumPics;
    1206   }
    1207 #endif
     1099  Int     getMaxNumPics( Int layerId );
    12081100
    12091101  /// VPS EXTENSION 2 SYNTAX ELEMENTS
     
    13561248  Void          setScaledFlag(Bool flag)          { m_scaledFlag = flag;  }
    13571249  Bool          getScaledFlag() const             { return m_scaledFlag;  }
    1358   Void          scaleOffsets( Int scal )         
    1359   {
    1360     if (! m_scaledFlag )
    1361     {
    1362       m_scaledFlag         = true;
    1363       m_winLeftOffset     *= scal;
    1364       m_winRightOffset    *= scal;
    1365       m_winTopOffset      *= scal;
    1366       m_winBottomOffset   *= scal;
    1367     }
    1368   }
     1250  Void          scaleOffsets( Int scal );
    13691251#endif
    13701252  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
     
    16301512  // SPS
    16311513  Bool        m_spsExtensionPresentFlag;
    1632 #if H_MV_HLS_8_SPS_NODOC_48
     1514
    16331515  Bool        m_spsRangeExtensionsFlag;
    16341516  Bool        m_spsMultilayerExtensionFlag;
     
    16391521  Int         m_spsExtension6bits;
    16401522#endif
    1641 #else
    1642   Bool        m_spsExtensionTypeFlag     [PS_EX_T_MAX_NUM];
    1643 #endif
     1523
    16441524  Bool        m_spsInferScalingListFlag;
    16451525  Int         m_spsScalingListRefLayerId;
     
    17551635  UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
    17561636  Void      setMaxTLayers( UInt uiMaxTLayers )        { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
    1757 #if H_MV_HLS_8
     1637#if H_MV
    17581638  UInt      getSpsMaxSubLayersMinus1()                { return ( m_uiMaxTLayers - 1); }
    17591639#endif
     
    17891669  TComPTL* getPTL()     { return &m_pcPTL; }
    17901670#if H_MV
    1791 
    1792 #if H_MV_HLS_8_HRD_Q0102_08
    1793   Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
    1794   {
    1795     const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
    1796 
    1797     if (getLayerId() > 0 )
    1798     {
    1799       Int layerIdx = 0;         
    1800       while (layerIdx < (Int) targetDecLayerIdList.size() )
    1801       {
    1802         if ( targetDecLayerIdList[layerIdx] == currLayerId )
    1803         {
    1804           break;
    1805         }
    1806         layerIdx++;
    1807       }
    1808 
    1809       assert( layerIdx < (Int) targetDecLayerIdList.size() );
    1810 
    1811       for (Int i = 0; i <= getSpsMaxSubLayersMinus1(); i++ )
    1812       {
    1813         Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ;
    1814 
    1815         if ( encoder )
    1816         {
    1817           assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 );
    1818         }
    1819         else
    1820         {
    1821           setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 );
    1822         }
    1823       }
    1824     }   
    1825   }
    1826 #endif
     1671  Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder );
    18271672
    18281673  Void setSpsExtensionPresentFlag( Bool flag ) { m_spsExtensionPresentFlag = flag; }
    18291674  Bool getSpsExtensionPresentFlag( )           { return m_spsExtensionPresentFlag; }
    18301675
    1831 #if H_MV_HLS_8_SPS_NODOC_48
    18321676  Void setSpsRangeExtensionsFlag( Bool flag )            { m_spsRangeExtensionsFlag = flag; }
    18331677  Bool getSpsRangeExtensionsFlag(  )                     { return m_spsRangeExtensionsFlag; }
     
    18441688  Void setSpsExtension6bits( Int  val )                  { m_spsExtension6bits = val; }
    18451689  Int  getSpsExtension6bits(  )                          { return m_spsExtension6bits; }
    1846 #endif
    1847 #else
    1848   Void setSpsExtensionTypeFlag( Int i, Bool flag )       { m_spsExtensionTypeFlag[i] = flag; }
    1849   Bool getSpsExtensionTypeFlag( Int i )                  { return m_spsExtensionTypeFlag[i]; }
    18501690#endif
    18511691 
     
    18861726  // Inference
    18871727  Void inferRepFormat( TComVPS* vps, Int layerIdCurr );
    1888 
    18891728  Void inferScalingList( TComSPS* spsSrc );
    18901729
    1891 #if H_MV_HLS_8_RPS_Q0100_36
    18921730  // others
    1893   Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId )
    1894   {
    1895     // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead
    1896     // of nuh_layer_id of slice (currLayerId), this seems to be a bug.
    1897 
    1898     for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
    1899     {
    1900       TComReferencePictureSet* rps = getRPSList()->getReferencePictureSet( i );
    1901       if ( !rps->getInterRPSPrediction() )
    1902       {
    1903         rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ),
    1904           getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 ); 
    1905       }
    1906     }
    1907   }
    1908 #endif
     1731  Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId );
    19091732
    19101733#endif
     
    20191842  Int  m_ppsScalingListRefLayerId;
    20201843
    2021 #if H_MV_HLS_8_SPS_NODOC_48
    20221844  Bool m_ppsRangeExtensionsFlag;
    20231845  Bool m_ppsMultilayerExtensionFlag;
     
    20291851#endif
    20301852
    2031 #else
    2032   Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM];
    2033 #endif
    20341853  Bool m_pocResetInfoPresentFlag;
    20351854#endif
     
    21751994  Int  getPpsScalingListRefLayerId(  ) { return m_ppsScalingListRefLayerId; }
    21761995
    2177 #if H_MV_HLS_8_SPS_NODOC_48
    21781996  Void setPpsRangeExtensionsFlag( Bool flag ) { m_ppsRangeExtensionsFlag = flag; }
    21791997  Bool getPpsRangeExtensionsFlag(  ) { return m_ppsRangeExtensionsFlag; }
     
    21912009  Void setPpsExtension5bits( Int  val ) { m_ppsExtension5bits = val; }
    21922010  Int  getPpsExtension5bits(  ) { return m_ppsExtension5bits; }
    2193 #endif
    2194 #else
    2195   Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; }
    2196   Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; }
    21972011#endif
    21982012
     
    22312045  Int         m_iPPSId;               ///< picture parameter set ID
    22322046  Bool        m_PicOutputFlag;        ///< pic_output_flag
    2233 #if H_MV_HLS_8_POC_Q0142_32
     2047#if H_MV
    22342048  Int         m_slicePicOrderCntLsb;   
    22352049#endif 
     
    24142228  Void      setPicOutputFlag( Bool b )         { m_PicOutputFlag = b;    }
    24152229  Bool      getPicOutputFlag()                 { return m_PicOutputFlag; }
    2416 #if H_MV_HLS_8_POC_Q0142_32
     2230#if H_MV
    24172231  Void      setSlicePicOrderCntLsb( Int i ) { m_slicePicOrderCntLsb = i; };
    24182232  Int       getSlicePicOrderCntLsb(  )      { return m_slicePicOrderCntLsb; };
     
    24662280  Bool      getApplyIC()                                        { return m_bApplyIC; }
    24672281  Void      xSetApplyIC();
    2468 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    24692282  Void      xSetApplyIC(Bool bUseLowLatencyICEnc);
    2470 #endif
    24712283  Void      setIcSkipParseFlag( Bool b )                        { m_icSkipParseFlag = b; }
    24722284  Bool      getIcSkipParseFlag()                                { return m_icSkipParseFlag; }
     
    25692381  static Void markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 );
    25702382  static Void markCurrPic                 ( TComPic* currPic );
    2571 #if !H_MV_HLS_8_DBP_NODOC_42
    2572   static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc  );
    2573 #endif
    25742383  Void        printRefPicList();
    25752384#endif
     
    27072516  Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; }
    27082517  Bool getCrossLayerBlaFlag(  ) { return m_crossLayerBlaFlag; }
    2709   Void checkCrossLayerBlaFlag ( )
    2710   {
    2711     // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0.
    2712     if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
    2713     {
    2714       assert( m_crossLayerBlaFlag == 0 );
    2715     }
    2716   }
     2518  Void checkCrossLayerBlaFlag ( );
    27172519
    27182520#if !H_MV_HLS7_GEN
     
    27382540  Void setPocResetIdc( Int  val ) { m_pocResetIdc = val; }
    27392541  Int  getPocResetIdc(  ) { return m_pocResetIdc; }
    2740 #if H_MV_HLS_8_POC_Q0142_32
    27412542  Void checkPocResetIdc( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !(getSlicePicOrderCntLsb() > 0 ) || !( getPocResetIdc() == 2) ); } 
    2742 #endif
     2543
    27432544  Void setPocResetPeriodId( Int  val ) { m_pocResetPeriodId = val; }
    27442545  Int  getPocResetPeriodId(  ) { return m_pocResetPeriodId; }
     
    27492550  Void setPocLsbVal( Int  val ) { m_pocLsbVal = val; }
    27502551  Int  getPocLsbVal(  ) { return m_pocLsbVal; }
    2751 #if H_MV_HLS_8_POC_Q0142_32
    27522552  Void checkPocLsbVal( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !getFullPocResetFlag() || ( getPocLsbVal() == 0 ) ); } 
    2753 #endif
    27542553
    27552554  Void setPocMsbValPresentFlag( Bool flag ) { m_pocMsbValPresentFlag = flag; }
     
    27942593  TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId );
    27952594
    2796 
    2797 #if H_MV_HLS_8_POC_Q0146_15
    2798 // Inference
    2799   Bool inferPocMsbValPresentFlag()
    2800   {
    2801     Bool pocMsbValPresentFlag;
    2802     if( getSliceSegmentHeaderExtensionLength() == 0 )
    2803     {
    2804       pocMsbValPresentFlag = false;
    2805     }
    2806     else if ( getPocMsbValRequiredFlag() )
    2807     {
    2808       pocMsbValPresentFlag = true;
    2809     }
    2810     else
    2811     {
    2812       pocMsbValPresentFlag = false;
    2813     }
    2814 
    2815     return pocMsbValPresentFlag;
    2816   } 
    2817 #endif
     2595  // Inference
     2596  Bool inferPocMsbValPresentFlag(); 
    28182597#endif
    28192598#if H_3D_DDD
    2820   Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
    2821   Int  getDepthFromDV( Int iDV, Int iBaseViewIdx )
    2822   {
    2823       return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]);
    2824   }
     2599  Void initializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
     2600  Int  getDepthFromDV( Int iDV, Int iBaseViewIdx );
    28252601#endif
    28262602
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r964 r976  
    102102                                              // MTK_NBDV_TN_FIX_E0172     fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172
    103103                                              // MTK_TEXTURE_MRGCAND_BUGFIX_E0182  Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
     104
    104105#define H_3D_ARP                          1   // Advanced residual prediction (ARP), JCT3V-D0177
    105106                                              // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
     
    108109                                              // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
    109110                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
     111                                              // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085  Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
    110112
    111113
     
    119121                                              // MTK_IC_FLAG_CABAC_SIMP_G0061
    120122                                              // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
     123                                              // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
    121124
    122125
     
    128131                                              // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV
    129132                                              // NTT_DoNBDV_VECTOR_CLIP_E0141 disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209
     133                                              // SEC_VER_DONBDV_H0103          Vertical DV Restriction for DoNBDV
    130134#endif
    131135
     
    161165                                              // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074
    162166                                              // QC_DEPTH_MERGE_SIMP_G0127 Remove DV candidate and shifting candidate for depth coding
    163 
     167                                              // QC_IV_PRED_CONSTRAINT_H0137   Constraint on inter-view (motion) prediction tools
     168                                              // ETRIKHU_BUGFIX_H0083          bug-fix for DV candidate pruning
     169                                              // ETRIKHU_CLEANUP_H0083         cleaned-up source code for constructing merging candidate list
     170                                              // ETRIKHU_CLEANUP_H0083_MISSING missing guard macros added by GT
     171                                              // SHARP_SIMPLE_MERGE_H0062      Restrict 3D-HEVC merge cand in small PUs
     172                                              // MTK_DIS_SPBIP8X4_H0205        Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
     173                                              // SEC_ADAPT_DISABLE_IVMP        Disalbing IVMP merge candidates when IC is enabled, JCT3V-H0070
    164174
    165175#define H_3D_TMVP                         1   // QC_TMVP_C0047
     
    196206                                              // HS_TSINGHUA_SDC_SPLIT_G0111
    197207                                              // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split
     208                                              // HS_DMM_SDC_PREDICTOR_UNIFY_H0108  Unification of DMM and SDC predictor derivation
     209                                              // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135  Use only one context for CABAC of dim_not_present_flag
     210                                              // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding
     211                                              // MTK_DMM_SIMP_CODE_H0092        Remove CABAC context for DMM1 mode coding
     212                                              // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113
     213                                              // MTK_SDC_FLAG_FIX_H0095                          Remove conditional check of PCM flag based on SDC flag, JCTVC-H0095
     214                                              // SEC_NO_RESI_DLT_H0105   
     215                                              // MTK_DLT_CODING_FIX_H0091
     216
    198217
    199218#define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
     
    205224                                              // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate
    206225                                              // Simplification on Sub-PU level temporal interview motion prediction
    207 
     226                                              // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    208227
    209228#define H_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
     229                                              // MTK_DBBP_AMP_REM_H0072   
     230                                              // RWTH_DBBP_NO_SPU_H0057   
     231                                              // SEC_DBBP_FILTERING_H0104
     232                                              // MTK_DBBP_SIGNALING_H0094   
     233                                              // H_3D_FIX_DBBP_IVMP        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.
     234
    210235
    211236#define H_3D_DDD                          1   // Disparity derived depth coding
     
    289314#define IC_CONST_SHIFT                    5
    290315#define IC_SHIFT_DIFF                     12
     316#define IC_LOW_LATENCY_ENCODING_THRESHOLD 0.1 // Threshold for low-latency IC encoding in JCT3V-H0086
    291317#endif
    292318
     
    310336#endif
    311337
    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
    361 
    362 #if H_MV
    363 #define H0044_POC_LSB_NOT_PRESENT        1      ///< JCT3V-H0044: Add constraint checking on the value of poc_reset_idc and poc_lsb_val
    364 #define H0056_EOS_CHECKS                 1      ///< JCT3V-H0056: Put checks on handling EOS
    365 #endif
    366 /////////////////////////////////////////////////////////////////////////////////////////
    367 ///////////////////////////////////   TBD                  //////////////////////////////
    368 /////////////////////////////////////////////////////////////////////////////////////////
    369 
    370 
    371 #define H_MV_HLS_8                           1 // General changes
    372 #define H_MV_HLS_7_VPS_P0300_27              1 // Output part only. (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt.
    373 #define MV_FIX_DEP_TYPES                     1
    374 
    375 
     338/////////////////////////////////////////////////////////////////////////////////
     339///////////////////////////////////   MV_HEVC HLS  //////////////////////////////
     340/////////////////////////////////////////////////////////////////////////////////
     341// TBD: Check if integration is necessary.
    376342#define H_MV_HLS7_GEN                        0  // General changes (not tested)
    377343
     
    380346// #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.
    381347// #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).
    382 
    383 
    384 // OTHERS
    385 // #define H_MV_HLS_7_HRD_P0138_6            0 // (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections.
    386348
    387349// SEI related
     
    400362//#define H_MV_HLS_7_SEI_P0123_25  0 // (SEI/P0123/Alpha channel info) #25 Add alpha channel information SEI message Decision: Adopt. Constrain the bit depth indicated to be equal to the coded bit depth of the aux picture.
    401363
    402 
    403364// Auxiliary picture related
    404365//#define H_MV_HLS_8_AUX_NODOC_40  0 // #40 (AUX    /NODOC/primary pic) Clarify that an auxiliary picture can be associated with more than one primary picture. Consider if the language associating an alpha auxiliary picture with a primary picture in the semantics of dimension_id[ ][ ] near the AuxId derivation could be moved to the alpha SEI message.
     
    419380//#define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    420381
    421 // Others
     382// OTHERS
    422383//#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows
    423384:// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    424385//#define H_MV_HLS_8_MIS_Q0078_24  0 // #24 (MISC   /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.
    425 
    426 
    427 #define H_MV_HLS_8_SYN_Q0041_03    1   // #3  Syntax only (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows
    428 :// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    429 #define H_MV_HLS_8_SYN_39_19       1   // #39 Syntax only + (PS/Q0165,Q0078/presence of num_add_output_layer_sets) proposal 2. change condition for presence of num_add_output_layer_sets to avoid sending it when there is only one layer set.
    430 #define H_MV_HLS_8_HRD_Q0101_04    1   // #4  (HRD    /Q0101/Bitstream part buffer) On Bitstream Partition Buffer. Decision (BF/Cleanup): Adopt (sub-proposals 1–11, refined as described).
    431 #define H_MV_HLS_8_PPS_NODOC_NN    1   // #NN (PPS    /NODOC/reserved flag): Add a flag in PPS for SHVC color gamut scalability
    432 #define H_MV_HLS_8_MIS_Q0177_47    1   // #47 (MISC   /Q0177/EOS NAL) proposal 2: clarification of description of end of sequence NAL unit
    433 #define H_MV_HLS_8_HRD_Q0182_05    1   // #5  (HRD    /Q0182/Bitstream part buffer) Decision (BF/Cleanup/Ed): Adopted (such that we use the main proposal for sub-proposal 1, and alternative 1 for sub-proposal 2). + #define H_MV_HLS_8_HRD_Q0182_06  0 // #6  (HRD    /Q0182/hrd_parameters) Sub-proposal 2 Alternative 1: Clarify that the VPS hrd_parameters( ) syntax structure that applies to the layer set which is associated with the bitstream partition initial arrival time SEI message is used to determine the lengths of the nal_initial_arrival_delay[ i ] and vcl_initial_arrival_delay[ i ] syntax elements. Decision (BF/Cleanup/Ed): Adopted alternative 1 for sub-proposal 2
    434 #define H_MV_HLS_8_SPS_NODOC_48    1   // #48 (SPS    /NODOC/PPS extension cleanups) Alignment with RExt
    435 #define H_MV_HLS_8_DBP_NODOC_42    1   // #42 (DBP    /NODOC/sharing) Remove sub-DPB sharing and processes that mark inter-layer reference pictures as "unused for reference"
    436 #define H_MV_HLS_8_RPS_Q0100_36    1   // #36 (RPS    /Q0100/constraint to semantics) v3, add constraint to RPS semantics
    437 #define H_MV_HLS_8_POC_Q0142_32    1   // #32 (POC    /Q0142/poc_lsb_not_present_flag) v2: Add semantic constraints to poc_lsb_not_present_flag.
    438 #define H_MV_HLS_8_HRD_Q0102_08    1   // #8  (HRD    /Q0102/sps_max_dec_pic_buffering_minus1) Sub-proposal 2: A semantics bug fix is proposed for sps_max_dec_pic_buffering_minus1 as a bug-fix. In discussion, the first option was preferred. Decision (BF/Cleanup/Ed.): Adopt.
    439 #define H_MV_HLS_8_MIS_Q0102_30    1   // #30 (MISC   /Q0102/loop index) proposal 3, change the max loop index for signaling bit rate and pic rate info to MaxSubLayersInLayerSetMinus1
    440 #define H_MV_HLS_8_GEN_Q0108_13    1   // #13 (GEN    /Q0108/STSA TemporalId) Agreed to remove restriction from proposal 2, to allow STSA pics of non-base layers to have TemporalId equal to 0.
    441 #define H_MV_HLS_8_PMS_Q0195_21    1   // #21 (PS     /Q0195/constraint update_ref_format_flag) proposal 2: add a semantic constraint on the value of update_ref_format_flag
    442 #define H_MV_HLS_8_PMS_Q0195_20    1   // #20 (PS     /Q0195/syntax table rep format) proposal 1: restructure syntax table for sending of rep_format_idx_present_flag and vps_num_ref_formats_minus1
    443 #define H_MV_HLS_8_MIS_Q0177_22    1   // #22 (MISC   /Q0177/inference sps_temporal_id_nesting_flag) proposal 1: modify inference rule for sps_temporal_id_nesting_flag when it is not present
    444 #define H_MV_HLS_8_PMS_Q0165_18    1   // #18 (PS     /Q0165/disallow an empty layer set) proposal 1.a), add a constraint to disallow an empty layer set
    445 #define H_MV_HLS_8_RPS_Q0060_17    1   // #17 (RPS    /Q0060/condition refLayerPicIdc) Proposal 2: Add a condition to the derivation of refLayerPicIdc of (TemporalId == 0)
    446 #define H_MV_HLS_8_POC_Q0146_15    1   // #15 (POC    /Q0146/inference of poc_msb_val_present_flag) Proposal 1.1: Change inference rule in semantics of poc_msb_val_present_flag
    447 
    448 
     386//#define H_MV_HLS_7_HRD_P0138_6   0 //     (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections.
    449387
    450388/////////////////////////////////////////////////////////////////////////////////////////
     
    938876
    939877/// merging candidates
    940 #if ETRIKHU_CLEANUP_H0083
     878#if H_3D
    941879enum DefaultMergCandOrder
    942880{
     
    1012950#if H_MV
    1013951
    1014 #if !H_MV_HLS_8_SPS_NODOC_48
    1015 enum PpsExtensionTypes
    1016 {
    1017   PPS_EX_T_MV      = 0,
    1018 #if H_3D
    1019   PPS_EX_T_3D      = 3,
    1020 #endif
    1021   PPS_EX_T_ESC     = 7,
    1022   PPS_EX_T_MAX_NUM = 8
    1023 };
    1024 
    1025 //Below for sps, would be good if this could be aligned
    1026 
    1027   enum PsExtensionTypes
    1028   {
    1029     PS_EX_T_MV   = 1,
    1030 #if H_3D
    1031     PS_EX_T_3D   = 3,
    1032 #endif
    1033     PS_EX_T_ESC  = 7,
    1034     PS_EX_T_MAX_NUM = 8
    1035   };
    1036 #endif
    1037952/// scalability types
    1038953  enum ScalabilityType
Note: See TracChangeset for help on using the changeset viewer.