Changeset 976 in 3DVCSoftware


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
Files:
2 added
2 deleted
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r964 r976  
    7171#endif
    7272
    73 #if H_MV_HLS_7_VPS_P0300_27
     73#if H_MV
    7474    m_markedForOutput = false;
    7575#endif
     
    161161  Int  pocLastPic        = -MAX_INT;   
    162162
    163 #if H_MV_HLS_7_VPS_P0300_27
    164163  Int  layerIdLastPic    = -MAX_INT;
    165 #endif
    166164  Int  layerIdCurrPic    = 0;
    167165
     
    216214          || (nalu.m_nalUnitType == NAL_UNIT_VPS && nalu.m_layerId > 0)           
    217215          || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0)   
    218 #if H_MV_HLS_8_MIS_Q0177_47
    219216          || (nalu.m_nalUnitType == NAL_UNIT_EOS && nalu.m_layerId > 0)   
    220 #endif
    221217         )
    222218      {
     
    237233        // - nalu.isSlice() == true     
    238234
    239 #if H_MV_HLS_7_VPS_P0300_27
    240235        if ( nalu.m_nalUnitType == NAL_UNIT_VPS )
    241236        {
     
    244239          {
    245240            TComVPS* vps = m_vps;
    246 #else
    247         // Update TargetDecLayerIdList only when not specified by layer id file, specification by file might actually out of conformance.
    248         if (nalu.m_nalUnitType == NAL_UNIT_VPS && m_targetDecLayerIdSetFileEmpty )
    249         {
    250           TComVPS* vps = m_tDecTop[decIdx]->getPrefetchedVPS();
    251 #endif
    252241          if ( m_targetOptLayerSetIdx == -1 )
    253242          {
     
    255244            m_targetOptLayerSetIdx = vps->getVpsNumLayerSetsMinus1();
    256245          }
    257 #if H_MV_HLS_8_HRD_Q0102_08
     246
    258247          for (Int dI = 0; dI < m_numDecoders; dI++ )
    259248          {
    260249            m_tDecTop[decIdx]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );
    261250          }
    262 #endif
    263251
    264252          if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
     
    269257          m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx );
    270258        }
    271 #if H_MV_HLS_7_VPS_P0300_27
    272       }
    273 #endif
     259      }
    274260#if H_3D
    275261        if (nalu.m_nalUnitType == NAL_UNIT_VPS )
     
    289275        if ( bNewPicture || !bitstreamFile )
    290276        {
    291 #if H_MV_HLS_7_VPS_P0300_27
    292277          layerIdLastPic    = layerIdCurrPic;
    293 #endif
    294278          layerIdCurrPic    = nalu.m_layerId;
    295279          pocLastPic        = pocCurrPic;
     
    340324        assert( decIdxLastPic != -1 );
    341325        m_tDecTop[decIdxLastPic]->endPicDecoding(poc, pcListPic, m_targetDecLayerIdSet );
    342 #if H_MV_HLS_7_VPS_P0300_27
    343326        xMarkForOutput( allLayersDecoded, poc, layerIdLastPic );
    344 #endif
    345327#else
    346328        m_cTDecTop.executeLoopFilters(poc, pcListPic);
     
    664646          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    665647
     648          const Bool isTff = pcPicTop->isTopField();
     649#if H_MV
     650        assert( conf   .getScaledFlag() );
     651        assert( defDisp.getScaledFlag() );
     652#if ENC_DEC_TRACE
     653        g_bJustDoIt = true; 
     654        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
     655        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
     656        g_bJustDoIt = false; 
     657#endif
     658        m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     659#else
     660          m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     661#endif
     662                                        conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     663                                        conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     664                                        conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
     665                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
     666        }
     667       
     668        // update POC of display order
     669#if H_MV
     670        m_pocLastDisplay[decIdx] = pcPic->getPOC();
     671#else
     672        m_iPOCLastDisplay = pcPicBottom->getPOC();
     673#endif
     674       
     675        // erase non-referenced picture in the reference picture list after display
     676        if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
     677        {
     678#if !DYN_REF_FREE
     679          pcPicTop->setReconMark(false);
     680         
     681          // mark it should be extended later
     682          pcPicTop->getPicYuvRec()->setBorderExtension( false );
     683         
     684#else
     685          pcPicTop->destroy();
     686          pcListPic->erase( iterPic );
     687          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
     688          continue;
     689#endif
     690        }
     691        if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true )
     692        {
     693#if !DYN_REF_FREE
     694          pcPicBottom->setReconMark(false);
     695         
     696          // mark it should be extended later
     697          pcPicBottom->getPicYuvRec()->setBorderExtension( false );
     698         
     699#else
     700          pcPicBottom->destroy();
     701          pcListPic->erase( iterPic );
     702          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
     703          continue;
     704#endif
     705        }
     706        pcPicTop->setOutputMark(false);
     707        pcPicBottom->setOutputMark(false);
     708      }
     709    }
     710  }
     711  else if (!pcPic->isField()) //Frame Decoding
     712  {
     713    iterPic = pcListPic->begin();
     714    while (iterPic != pcListPic->end())
     715    {
     716      pcPic = *(iterPic);
     717
     718#if H_MV
     719      if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx] &&
     720        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
     721#else     
     722      if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
     723        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
     724#endif
     725      {
     726        // write to file
     727        numPicsNotYetDisplayed--;
     728        if(pcPic->getSlice(0)->isReferenced() == false)
     729        {
     730          dpbFullness--;
     731        }
     732#if H_MV
     733      if ( m_pchReconFiles[decIdx] )
     734#else
     735        if ( m_pchReconFile )
     736#endif
     737        {
     738          const Window &conf = pcPic->getConformanceWindow();
     739          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
     740#if H_MV
     741        assert( conf   .getScaledFlag() );
     742        assert( defDisp.getScaledFlag() );
     743#if ENC_DEC_TRACE
     744        g_bJustDoIt = true; 
     745        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
     746        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
     747        g_bJustDoIt = false;
     748#endif
     749        m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
     750#else
     751          m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
     752#endif
     753                                        conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     754                                        conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     755                                        conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
     756                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
     757        }
     758       
     759        // update POC of display order
     760#if H_MV
     761        m_pocLastDisplay[decIdx] = pcPic->getPOC();
     762#else
     763        m_iPOCLastDisplay = pcPic->getPOC();
     764#endif
     765       
     766        // erase non-referenced picture in the reference picture list after display
     767        if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )
     768        {
     769#if !DYN_REF_FREE
     770          pcPic->setReconMark(false);
     771         
     772          // mark it should be extended later
     773          pcPic->getPicYuvRec()->setBorderExtension( false );
     774         
     775#else
     776          pcPic->destroy();
     777          pcListPic->erase( iterPic );
     778          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
     779          continue;
     780#endif
     781        }
     782        pcPic->setOutputMark(false);
     783#if H_MV
     784        pcPic->setPicOutputFlag(false);
     785#endif
     786      }
     787     
     788      iterPic++;
     789    }
     790  }
     791}
     792/** \param pcListPic list of pictures to be written to file
     793    \todo            DYN_REF_FREE should be revised
     794 */
     795#if H_MV
     796Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int decIdx )
     797#else
     798Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic )
     799#endif
     800{
     801  if(!pcListPic || pcListPic->empty())
     802  {
     803    return;
     804  }
     805  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
     806 
     807  iterPic   = pcListPic->begin();
     808  TComPic* pcPic = *(iterPic);
     809 
     810  if (pcPic->isField()) //Field Decoding
     811  {
     812    TComList<TComPic*>::iterator endPic   = pcListPic->end();
     813    endPic--;
     814    TComPic *pcPicTop, *pcPicBottom = NULL;
     815    while (iterPic != endPic)
     816    {
     817      pcPicTop = *(iterPic);
     818      iterPic++;
     819      pcPicBottom = *(iterPic);
     820     
     821      if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) )
     822      {
     823        // write to file
     824#if H_MV
     825      if ( m_pchReconFiles[decIdx] )
     826#else
     827        if ( m_pchReconFile )
     828#endif
     829        {
     830          const Window &conf = pcPicTop->getConformanceWindow();
     831          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    666832          const Bool isTff = pcPicTop->isTopField();
    667833#if H_MV
     
    686852        // update POC of display order
    687853#if H_MV
    688         m_pocLastDisplay[decIdx] = pcPic->getPOC();
    689 #else
    690         m_iPOCLastDisplay = pcPicBottom->getPOC();
    691 #endif
    692        
     854      m_pocLastDisplay[decIdx] = pcPic->getPOC();
     855#else
     856      m_iPOCLastDisplay = pcPicBottom->getPOC();
     857#endif       
    693858        // erase non-referenced picture in the reference picture list after display
    694859        if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
     
    724889        pcPicTop->setOutputMark(false);
    725890        pcPicBottom->setOutputMark(false);
    726       }
    727     }
    728   }
    729   else if (!pcPic->isField()) //Frame Decoding
    730   {
    731     iterPic = pcListPic->begin();
     891       
     892#if !DYN_REF_FREE
     893        if(pcPicTop)
     894        {
     895          pcPicTop->destroy();
     896          delete pcPicTop;
     897          pcPicTop = NULL;
     898        }
     899#endif
     900      }
     901    }
     902    if(pcPicBottom)
     903    {
     904      pcPicBottom->destroy();
     905      delete pcPicBottom;
     906      pcPicBottom = NULL;
     907    }
     908  }
     909  else //Frame decoding
     910  {
    732911    while (iterPic != pcListPic->end())
    733912    {
    734913      pcPic = *(iterPic);
    735 
    736 #if H_MV
    737       if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx] &&
    738         (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
    739 #else     
    740       if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
    741         (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
    742 #endif
     914     
     915      if ( pcPic->getOutputMark() )
    743916      {
    744917        // write to file
    745         numPicsNotYetDisplayed--;
    746         if(pcPic->getSlice(0)->isReferenced() == false)
    747         {
    748           dpbFullness--;
    749         }
    750918#if H_MV
    751919      if ( m_pchReconFiles[decIdx] )
     
    756924          const Window &conf = pcPic->getConformanceWindow();
    757925          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    758 #if H_MV
    759         assert( conf   .getScaledFlag() );
    760         assert( defDisp.getScaledFlag() );
    761 #if ENC_DEC_TRACE
    762         g_bJustDoIt = true; 
    763         writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
    764         writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
    765         g_bJustDoIt = false;
    766 #endif
    767         m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
    768 #else
    769           m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
    770 #endif
    771                                         conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    772                                         conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
    773                                         conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    774                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
    775         }
    776        
    777         // update POC of display order
    778 #if H_MV
    779         m_pocLastDisplay[decIdx] = pcPic->getPOC();
    780 #else
    781         m_iPOCLastDisplay = pcPic->getPOC();
    782 #endif
    783        
    784         // erase non-referenced picture in the reference picture list after display
    785         if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )
    786         {
    787 #if !DYN_REF_FREE
    788           pcPic->setReconMark(false);
    789          
    790           // mark it should be extended later
    791           pcPic->getPicYuvRec()->setBorderExtension( false );
    792          
    793 #else
    794           pcPic->destroy();
    795           pcListPic->erase( iterPic );
    796           iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
    797           continue;
    798 #endif
    799         }
    800         pcPic->setOutputMark(false);
    801 #if H_MV_HLS_7_VPS_P0300_27
    802         pcPic->setPicOutputFlag(false);
    803 #endif
    804       }
    805      
    806       iterPic++;
    807     }
    808   }
    809 }
    810 /** \param pcListPic list of pictures to be written to file
    811     \todo            DYN_REF_FREE should be revised
    812  */
    813 #if H_MV
    814 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int decIdx )
    815 #else
    816 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic )
    817 #endif
    818 {
    819   if(!pcListPic || pcListPic->empty())
    820   {
    821     return;
    822   }
    823   TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    824  
    825   iterPic   = pcListPic->begin();
    826   TComPic* pcPic = *(iterPic);
    827  
    828   if (pcPic->isField()) //Field Decoding
    829   {
    830     TComList<TComPic*>::iterator endPic   = pcListPic->end();
    831     endPic--;
    832     TComPic *pcPicTop, *pcPicBottom = NULL;
    833     while (iterPic != endPic)
    834     {
    835       pcPicTop = *(iterPic);
    836       iterPic++;
    837       pcPicBottom = *(iterPic);
    838      
    839       if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) )
    840       {
    841         // write to file
    842 #if H_MV
    843       if ( m_pchReconFiles[decIdx] )
    844 #else
    845         if ( m_pchReconFile )
    846 #endif
    847         {
    848           const Window &conf = pcPicTop->getConformanceWindow();
    849           const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    850           const Bool isTff = pcPicTop->isTopField();
    851926#if H_MV
    852927        assert( conf   .getScaledFlag() );
     
    858933        g_bJustDoIt = false; 
    859934#endif
    860         m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
    861 #else
    862           m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
    863 #endif
    864                                         conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    865                                         conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
    866                                         conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    867                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
    868         }
    869        
    870         // update POC of display order
    871 #if H_MV
    872       m_pocLastDisplay[decIdx] = pcPic->getPOC();
    873 #else
    874       m_iPOCLastDisplay = pcPicBottom->getPOC();
    875 #endif       
    876         // erase non-referenced picture in the reference picture list after display
    877         if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
    878         {
    879 #if !DYN_REF_FREE
    880           pcPicTop->setReconMark(false);
    881          
    882           // mark it should be extended later
    883           pcPicTop->getPicYuvRec()->setBorderExtension( false );
    884          
    885 #else
    886           pcPicTop->destroy();
    887           pcListPic->erase( iterPic );
    888           iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
    889           continue;
    890 #endif
    891         }
    892         if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true )
    893         {
    894 #if !DYN_REF_FREE
    895           pcPicBottom->setReconMark(false);
    896          
    897           // mark it should be extended later
    898           pcPicBottom->getPicYuvRec()->setBorderExtension( false );
    899          
    900 #else
    901           pcPicBottom->destroy();
    902           pcListPic->erase( iterPic );
    903           iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
    904           continue;
    905 #endif
    906         }
    907         pcPicTop->setOutputMark(false);
    908         pcPicBottom->setOutputMark(false);
    909        
    910 #if !DYN_REF_FREE
    911         if(pcPicTop)
    912         {
    913           pcPicTop->destroy();
    914           delete pcPicTop;
    915           pcPicTop = NULL;
    916         }
    917 #endif
    918       }
    919     }
    920     if(pcPicBottom)
    921     {
    922       pcPicBottom->destroy();
    923       delete pcPicBottom;
    924       pcPicBottom = NULL;
    925     }
    926   }
    927   else //Frame decoding
    928   {
    929     while (iterPic != pcListPic->end())
    930     {
    931       pcPic = *(iterPic);
    932      
    933       if ( pcPic->getOutputMark() )
    934       {
    935         // write to file
    936 #if H_MV
    937       if ( m_pchReconFiles[decIdx] )
    938 #else
    939         if ( m_pchReconFile )
    940 #endif
    941         {
    942           const Window &conf = pcPic->getConformanceWindow();
    943           const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    944 #if H_MV
    945         assert( conf   .getScaledFlag() );
    946         assert( defDisp.getScaledFlag() );
    947 #if ENC_DEC_TRACE
    948         g_bJustDoIt = true; 
    949         writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
    950         writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
    951         g_bJustDoIt = false; 
    952 #endif
    953935        m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
    954936#else
     
    985967        }
    986968        pcPic->setOutputMark(false);
    987 #if H_MV_HLS_7_VPS_P0300_27
     969#if H_MV
    988970        pcPic->setPicOutputFlag(false);
    989971#endif
     
    10611043    m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists );
    10621044    m_tDecTop[ decIdx ]->setLayerInitilizedFlags( m_layerInitilizedFlags );
    1063 #if    H_MV_HLS_8_HRD_Q0102_08
    10641045    m_tDecTop[ decIdx ]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );   
    1065 #endif
    10661046
    10671047#if H_3D
     
    10991079}
    11001080
    1101 
    1102 #if H_MV_HLS_7_VPS_P0300_27
    11031081Void TAppDecTop::xMarkForOutput( Bool allLayersDecoded, Int pocLastPic, Int layerIdLastPic )
    11041082
     
    11521130  }
    11531131}
    1154 #endif
     1132
     1133Void TAppDecTop::xMarkAltOutPic( Int targetOutputLayer, Int pocLastPic )
     1134{
     1135  Int optLayerIdxInVps = m_vps->getLayerIdInNuh( targetOutputLayer );
     1136  Int highestNuhLayerId = -1;
     1137  TComPic* picWithHighestNuhLayerId = NULL;
     1138  for (Int dIdx = 0; dIdx < m_numDecoders; dIdx++)
     1139  {
     1140    Int curLayerId = m_tDecTop[dIdx]->getLayerId();
     1141    Int curLayerIdxInVps = m_vps->getLayerIdInNuh( curLayerId  );
     1142    if ( m_vps->getInDirectDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) )
     1143    {
     1144      TComPic* curPic = m_ivPicLists.getPic( curLayerId, pocLastPic );
     1145      if (curPic != NULL)
     1146      {
     1147        if (curPic->getReconMark() && curPic->getPicOutputFlag() )
     1148        {
     1149          curPic->setOutputMark   ( false );
     1150          curPic->setPicOutputFlag( false );
     1151          if ( curLayerId > highestNuhLayerId)
     1152          {
     1153            highestNuhLayerId = curLayerId ;
     1154            picWithHighestNuhLayerId = curPic;
     1155          }           
     1156        }
     1157      }
     1158    }
     1159  }
     1160  if ( picWithHighestNuhLayerId != NULL )
     1161  {
     1162    picWithHighestNuhLayerId->setPicOutputFlag(true);
     1163    picWithHighestNuhLayerId->setOutputMark   (true);
     1164  }
     1165}
     1166
    11551167#endif
    11561168//! \}
  • trunk/source/App/TAppDecoder/TAppDecTop.h

    r964 r976  
    6868  TComPicLists                    m_ivPicLists;                                ///< picture buffers of decoder instances
    6969  Bool                            m_layerInitilizedFlags[ MAX_NUM_LAYER_IDS ]; ///< for layerwise startup
    70 #if H_MV_HLS_7_VPS_P0300_27
    7170  TComVPS*                        m_vps;                                ///< active VPS
    72 #endif
    7371#else
    7472  TDecTop                         m_cTDecTop;                     ///< decoder class
     
    7977  Int                             m_pocLastDisplay      [ MAX_NUM_LAYERS ]; ///< last POC in display order
    8078  Bool                            m_reconOpen           [ MAX_NUM_LAYERS ]; ///< reconstruction file opened
     79  Bool                            m_markedForOutput;
    8180#else
    8281  Int                             m_iPOCLastDisplay;              ///< last POC in display order
    8382#endif
    84 #if H_MV_HLS_7_VPS_P0300_27
    85   Bool                            m_markedForOutput;
    86 #endif
    87 
    8883
    8984#if H_3D
     
    107102  Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file
    108103
    109 #if H_MV_HLS_7_VPS_P0300_27
    110104  Void  xMarkForOutput   ( Bool allLayersDecoded, Int pocLastPic, Int layerIdLastPic );         
    111   Void  xMarkAltOutPic    ( Int targetOutputLayer, Int pocLastPic )
    112   {
    113     Int optLayerIdxInVps = m_vps->getLayerIdInNuh( targetOutputLayer );
    114     Int highestNuhLayerId = -1;
    115     TComPic* picWithHighestNuhLayerId = NULL;
    116     for (Int dIdx = 0; dIdx < m_numDecoders; dIdx++)
    117     {
    118       Int curLayerId = m_tDecTop[dIdx]->getLayerId();
    119       Int curLayerIdxInVps = m_vps->getLayerIdInNuh( curLayerId  );
    120       if ( m_vps->getInDirectDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) )
    121       {
    122         TComPic* curPic = m_ivPicLists.getPic( curLayerId, pocLastPic );
    123         if (curPic != NULL)
    124         {
    125           if (curPic->getReconMark() && curPic->getPicOutputFlag() )
    126           {
    127             curPic->setOutputMark   ( false );
    128             curPic->setPicOutputFlag( false );
    129             if ( curLayerId > highestNuhLayerId)
    130             {
    131               highestNuhLayerId = curLayerId ;
    132               picWithHighestNuhLayerId = curPic;
    133             }           
    134           }
    135         }
    136       }
    137     }
    138     if ( picWithHighestNuhLayerId != NULL )
    139     {
    140       picWithHighestNuhLayerId->setPicOutputFlag(true);
    141       picWithHighestNuhLayerId->setOutputMark   (true);
    142     }
    143   }
    144 #endif
     105  Void  xMarkAltOutPic    ( Int targetOutputLayer, Int pocLastPic );
    145106
    146107  Void  xFlushOutput      ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r964 r976  
    393393  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set") 
    394394  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 
    395 #if H_MV_HLS_7_VPS_P0300_27
    396395  ("AltOutputLayerFlag",    m_altOutputLayerFlag , std::vector<Bool>(1,0), "Alt output layer flag")
    397 #endif
    398396  ("ProfileLevelTierIdx",   m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier")
    399397 
     
    523521#if H_3D_IC
    524522  ("IlluCompEnable",           m_abUseIC, true, "Enable illumination compensation")
    525 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    526523  ("IlluCompLowLatencyEnc",    m_bUseLowLatencyICEnc, false, "Enable low-latency illumination compensation encoding")
    527 #endif
    528524#endif
    529525#if H_3D_INTER_SDC
     
    10581054  xResizeVector( m_wppInUseFlag );
    10591055
    1060 #if H_MV_HLS_7_VPS_P0300_27
    10611056  for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + (Int) m_outputLayerSetIdx.size(); olsIdx++)
    10621057  {   
    10631058    m_altOutputLayerFlag.push_back( false );     
    10641059  }
    1065 #endif
    10661060#else
    10671061  m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
     
    14651459  }
    14661460
    1467 #if H_MV_HLS_7_VPS_P0300_27
    14681461  xConfirmPara( m_altOutputLayerFlag.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
    1469 #endif
    14701462  xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
    14711463
     
    25152507#if H_3D_IC
    25162508  printf( "IlluCompEnable:%d ", m_abUseIC);
    2517 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    25182509  printf ("IlluCompLowLatencyEnc:%d ",  m_bUseLowLatencyICEnc);
    2519 #endif
    25202510#endif
    25212511#if H_3D_NBDV_REF
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r964 r976  
    9494  std::vector< std::vector<Int> > m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
    9595  std::vector<Int>       m_profileLevelTierIdx;               ///< Indices of of profile level tier
    96   #if H_MV_HLS_7_VPS_P0300_27
    9796  std::vector<Bool>      m_altOutputLayerFlag;                ///< Alt output layer flag
    98 #endif
    9997
    10098  // Dependencies
     
    140138#if H_3D_IC
    141139  Bool   m_abUseIC;
    142 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    143   Bool  m_bUseLowLatencyICEnc;
    144 #endif
     140  Bool   m_bUseLowLatencyICEnc;
    145141#endif
    146142#if H_3D_NBDV_REF
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r964 r976  
    5858{
    5959
    60 #if H_MV_HLS_8
     60#if H_MV
    6161  m_vps = new TComVPS;
    62 #endif
    63 #if !H_MV
     62#else
    6463  m_iFrameRcvd = 0;
    6564#endif
     
    7069TAppEncTop::~TAppEncTop()
    7170{
    72 #if H_MV_HLS_8
     71#if H_MV
    7372  if (m_vps)
    7473  {
     
    8281{
    8382#if H_MV
    84 #if H_MV_HLS_8
    8583  TComVPS& vps = (*m_vps);   
    86 #else
    87   TComVPS& vps = m_vps;   
    88 #endif
    8984#else
    9085  TComVPS vps;
     
    193188    m_cTEncTop.setDWeight                      ( isDepth ? m_iDWeight             : 0     );
    194189#endif // H_3D_VSO
    195 #if H_3D_ARP && !QC_IV_PRED_CONSTRAINT_H0137
    196     //====== Advanced Inter-view Residual Prediction =========
    197     m_cTEncTop.setUseAdvRP                     ( ( isDepth || 0==layerIdInVps ) ? 0 : m_uiUseAdvResPred );
    198     m_cTEncTop.setARPStepNum                   ( ( isDepth || 0==layerIdInVps ) ? 1 : H_3D_ARP_WFNR     );
    199 #endif
    200190#if H_3D_SPIVMP
    201191    m_cTEncTop.setSubPULog2Size                 (( isDepth || 0==layerIdInVps ) ? 0 : m_iSubPULog2Size   );
     
    204194#if H_3D_IC
    205195    m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
    206 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    207196    m_cTEncTop.setUseICLowLatencyEnc           ( m_bUseLowLatencyICEnc );
    208 #endif
    209197#endif
    210198  //========== Depth intra modes ==========
     
    708696{
    709697#if H_3D
    710 #if H_MV_HLS_8
    711698  for ( Int viewIndex = 0; viewIndex < m_vps->getNumViews(); viewIndex++ )
    712699  {
    713700    m_vps->initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(),
    714701      m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
    715 #else
    716   for ( Int viewIndex = 0; viewIndex < m_vps.getNumViews(); viewIndex++ )
    717   {
    718   m_vps.initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(),
    719       m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
    720 #endif
    721702  }
    722703#endif
     
    12991280
    13001281  Int  defaultDirectDependencyType = -1;
    1301 #if MV_FIX_DEP_TYPES
    13021282  Bool defaultDirectDependencyFlag = false;
    1303 #else
    1304   Bool defaultDirectDependencyFlag = true;
    1305 #endif
    13061283
    13071284  for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ )
     
    13221299      {
    13231300        defaultDirectDependencyType = curDirectDependencyType;
    1324 #if MV_FIX_DEP_TYPES
    13251301        defaultDirectDependencyFlag = true;
    1326 #endif
    13271302      }
    13281303     
     
    15141489Void TAppEncTop::xSetRepFormat( TComVPS& vps )
    15151490{
    1516 #if H_MV_HLS_8_PMS_Q0195_20
    15171491  vps.setRepFormatIdxPresentFlag( false );
    1518 #else
    1519   vps.setRepFormatIdxPresentFlag( true );
    1520 #endif
    15211492  vps.setVpsNumRepFormatsMinus1 ( 0    );
    15221493
     
    15341505  assert( vps.getRepFormat( 0 ) == NULL );
    15351506  vps.setRepFormat( 0 , repFormat );
    1536 
    1537 #if !H_MV_HLS_8_PMS_Q0195_20
    1538   for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ )
    1539   {
    1540     vps.setVpsRepFormatIdx( i , 0 );
    1541   }
    1542 #endif
    15431507}
    15441508
     
    15511515  assert ( dpbSize != 0 );
    15521516
    1553 #if H_MV_HLS_8_HRD_Q0102_08
    15541517  for( Int i = 0; i < vps.getNumOutputLayerSets(); i++ )
    1555 #else
    1556   for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ )
    1557 #endif
    15581518  { 
    1559 #if H_MV_HLS_8_MIS_Q0102_30
    15601519    Int currLsIdx = vps.olsIdxToLsIdx( i );
    1561 #endif
    15621520    std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i );
    15631521    Bool subLayerFlagInfoPresentFlag = false;
    15641522
    1565 #if H_MV_HLS_8_MIS_Q0102_30
    15661523    for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
    1567 #else
    1568     for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1569 #endif
    15701524    {   
    15711525      Bool subLayerDpbInfoPresentFlag = false;
    1572 #if H_MV_HLS_8_MIS_Q0102_30 || H_MV_HLS_8_DBP_NODOC_42
    15731526      assert( vps.getNumLayersInIdList( currLsIdx ) == targetDecLayerIdList.size() );
    15741527      for( Int k = 0; k < vps.getNumLayersInIdList( currLsIdx ); k++ )   
    1575 #else
    1576       assert( vps.getNumSubDpbs( vps.olsIdxToLsIdx( i ) ) == targetDecLayerIdList.size() );
    1577       for( Int k = 0; k < vps.getNumSubDpbs( vps.olsIdxToLsIdx( i )); k++ )   
    1578 #endif
    15791528      {
    15801529        Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
    1581 #if H_MV_HLS7_GEN
    1582         // TBD. Some derivation based on output layer set might be added here.
    1583 #endif
    15841530        dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 );
    15851531        if ( j > 0 )
     
    16421588  // Additional output layer sets + profileLevelTierIdx
    16431589  vps.setDefaultOutputLayerIdc      ( m_defaultOutputLayerIdc );   
    1644 #if H_MV_HLS_8_SYN_39_19
    16451590  vps.setNumAddLayerSets            ( 0                             ); 
    16461591  vps.setNumAddOlss                 ( numAddOuputLayerSets          );
    1647 #else
    1648   vps.setNumAddLayerSets            ( numAddOuputLayerSets          );
    1649 #endif
    16501592  vps.initTargetLayerIdLists();
    16511593
     
    16961638      vps.setProfileLevelTierIdx( olsIdx, m_profileLevelTierIdx[ olsIdx ] );
    16971639    }
    1698 #if H_MV_HLS_7_VPS_P0300_27
     1640   
    16991641    if ( vps.getNumOutputLayersInOutputLayerSet( olsIdx ) == 1 &&
    17001642        vps.getNumDirectRefLayers( vps.getOlsHighestOutputLayerId( olsIdx ) ) )
     
    17101652      }
    17111653    }
    1712 #else
    1713     vps.setAltOutputLayerFlag( olsIdx , false);     
    1714 #endif
    17151654  }
    17161655}
     
    18691808
    18701809#if H_3D_ARP
    1871 #if QC_IV_PRED_CONSTRAINT_H0137
    18721810    vps.setUseAdvRP        ( layer, ( isDepth || isLayerZero || !vps.getNumDirectRefLayers(layer) ) ? 0 : m_uiUseAdvResPred );
    18731811    vps.setARPStepNum      ( layer, ( isDepth || isLayerZero || !vps.getNumDirectRefLayers(layer) ) ? 1 : H_3D_ARP_WFNR     );
    1874 #else
    1875     vps.setUseAdvRP        ( layer, ( isDepth || isLayerZero ) ? 0 : m_uiUseAdvResPred );
    1876     vps.setARPStepNum      ( layer, ( isDepth || isLayerZero ) ? 1 : H_3D_ARP_WFNR     );
    1877 #endif 
    18781812#endif 
    18791813#if H_3D_SPIVMP
     
    18931827
    18941828#if H_3D_IV_MERGE
    1895 #if QC_IV_PRED_CONSTRAINT_H0137
    18961829    if( !vps.getNumDirectRefLayers(layer) )
    18971830    {
     
    19001833    else
    19011834    {
    1902 #endif
    1903     if( isDepth )
    1904     {
    1905       vps.setIvMvPredFlag         ( layer, (layer != 1) && m_ivMvPredFlag[1] );
    1906     }
    1907     else
    1908     {
    1909       vps.setIvMvPredFlag         ( layer, !isLayerZero && m_ivMvPredFlag[0] );
    1910     }
    1911 #if QC_IV_PRED_CONSTRAINT_H0137
    1912     }
    1913 #endif
     1835      if( isDepth )
     1836      {
     1837        vps.setIvMvPredFlag         ( layer, (layer != 1) && m_ivMvPredFlag[1] );
     1838      }
     1839      else
     1840      {
     1841        vps.setIvMvPredFlag         ( layer, !isLayerZero && m_ivMvPredFlag[0] );
     1842      }
     1843    }
    19141844#endif
    19151845#if H_3D_NBDV_REF
     
    19171847#endif
    19181848#if H_3D_VSP
    1919 #if QC_IV_PRED_CONSTRAINT_H0137
    19201849    vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && vps.getNumDirectRefLayers(layer) && m_viewSynthesisPredFlag );         
    1921 #else
    1922     vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && m_viewSynthesisPredFlag );         
    1923 #endif
    19241850#endif
    19251851#if H_3D_DBBP
  • trunk/source/App/TAppEncoder/TAppEncTop.h

    r964 r976  
    7575
    7676  TComPicLists               m_ivPicLists;                  ///< picture buffers of encoder instances
    77 #if H_MV_HLS_8
     77#if H_MV
    7878  TComVPS*                   m_vps;                         ///< vps
    7979#else
  • 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
  • trunk/source/Lib/TLibDecoder/NALread.cpp

    r964 r976  
    127127  else
    128128  {
    129 #if H_MV_HLS_8_GEN_Q0108_13
     129#if H_MV
    130130
    131131    // If nal_unit_type is in the range of BLA_W_LP to RSV_IRAP_VCL23, inclusive, i.e. the coded
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r964 r976  
    374374
    375375#if H_MV
    376 #if H_MV_HLS_8_SPS_NODOC_48
    377376    READ_FLAG( uiCode, "pps_range_extensions_flag" ); pcPPS->setPpsRangeExtensionsFlag( uiCode == 1 );
    378377    READ_FLAG( uiCode, "pps_multilayer_extension_flag" ); pcPPS->setPpsMultilayerExtensionFlag( uiCode == 1 );
     
    390389    if ( pcPPS->getPpsMultilayerExtensionFlag() )
    391390    {
    392         READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
    393 #if H_MV_HLS_8_PPS_NODOC_NN
    394         READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
    395 #endif
     391      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
     392      READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
    396393    }
    397394#if !H_3D
     
    406403    {
    407404#endif
    408 #else
    409     for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
    410     {
    411       READ_FLAG( uiCode, "pps_extension_type_flag" ); pcPPS->setPpsExtensionTypeFlag( i, uiCode == 1 );
    412 #if H_3D
    413       assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_3D || i == PPS_EX_T_ESC );
    414 #else
    415       assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_ESC );
    416 #endif
    417     }
    418    
    419 
    420     if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
    421     {
    422       READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
    423     }
    424 
    425 #if H_3D
    426     if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC
    427     {
    428       parsePPSExtension( pcPPS, pcVPS );
    429     }
    430 #endif
    431 
    432     if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_ESC ) )
    433     {
    434 #endif
     405
    435406#endif
    436407
     
    481452            READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]");
    482453
    483 #if  MTK_DLT_CODING_FIX_H0091
    484454            if( uiCode )
    485455            {
    486456                assert( pcDLT->getUseDLTFlag( 1 ));
    487457            }
    488 #endif
    489 
    490458            pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false );
    491459
     
    795763  {
    796764#endif
    797   READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
    798   assert(uiCode <= 6);
    799  
    800   READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
    801   if ( pcSPS->getMaxTLayers() == 1 )
    802   {
    803     // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
    804     assert( uiCode == 1 );
    805   }
    806  
    807   parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     765    READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
     766    assert(uiCode <= 6);
     767
     768    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
     769    if ( pcSPS->getMaxTLayers() == 1 )
     770    {
     771      // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
     772      assert( uiCode == 1 );
     773    }
     774
     775    parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
    808776#if H_MV
    809777  }
     
    823791  {
    824792#endif
    825   READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
    826   assert(uiCode <= 3);
    827   // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
    828   assert (uiCode == 1);
    829   if( uiCode == 3 )
    830   {
    831     READ_FLAG(     uiCode, "separate_colour_plane_flag");        assert(uiCode == 0);
    832   }
    833 
    834   READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
    835   READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
     793    READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     794    assert(uiCode <= 3);
     795    // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
     796    assert (uiCode == 1);
     797    if( uiCode == 3 )
     798    {
     799      READ_FLAG(     uiCode, "separate_colour_plane_flag");        assert(uiCode == 0);
     800    }
     801
     802    READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
     803    READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
    836804#if H_MV
    837805  }
     
    860828  {
    861829#endif
    862   READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
    863   assert(uiCode <= 6);
    864   pcSPS->setBitDepthY( uiCode + 8 );
    865   pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
    866 
    867   READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
    868   assert(uiCode <= 6);
    869   pcSPS->setBitDepthC( uiCode + 8 );
    870   pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
     830    READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
     831    assert(uiCode <= 6);
     832    pcSPS->setBitDepthY( uiCode + 8 );
     833    pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
     834
     835    READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
     836    assert(uiCode <= 6);
     837    pcSPS->setBitDepthC( uiCode + 8 );
     838    pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
    871839#if H_MV
    872840  }
     
    880848  { 
    881849#endif
    882   UInt subLayerOrderingInfoPresentFlag;
    883   READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
    884  
    885   for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    886   {
    887     READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    888     pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    889     READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
    890     pcSPS->setNumReorderPics(uiCode, i);
    891     READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    892     pcSPS->setMaxLatencyIncrease( uiCode, i );
    893 
    894     if (!subLayerOrderingInfoPresentFlag)
    895     {
    896       for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
    897       {
    898         pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
    899         pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
    900         pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
    901       }
    902       break;
    903     }
    904   }
     850    UInt subLayerOrderingInfoPresentFlag;
     851    READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
     852
     853    for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
     854    {
     855      READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
     856      pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
     857      READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
     858      pcSPS->setNumReorderPics(uiCode, i);
     859      READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
     860      pcSPS->setMaxLatencyIncrease( uiCode, i );
     861
     862      if (!subLayerOrderingInfoPresentFlag)
     863      {
     864        for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
     865        {
     866          pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
     867          pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
     868          pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
     869        }
     870        break;
     871      }
     872    }
    905873#if H_MV
    906874  }
     
    912880  READ_UVLC( uiCode, "log2_diff_max_min_coding_block_size" );
    913881  pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode);
    914  
     882
    915883  if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
    916884  {
    917885    assert(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() >= 5);
    918886  }
    919  
     887
    920888  Int maxCUDepthDelta = uiCode;
    921889  pcSPS->setMaxCUWidth  ( 1<<(log2MinCUSize + maxCUDepthDelta) );
     
    948916    {   
    949917#endif
    950     READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
    951     if(pcSPS->getScalingListPresentFlag ())
    952     {
    953       parseScalingList( pcSPS->getScalingList() );
    954     }
     918      READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
     919      if(pcSPS->getScalingListPresentFlag ())
     920      {
     921        parseScalingList( pcSPS->getScalingList() );
     922      }
    955923#if H_MV
    956924    }
     
    1017985  {
    1018986#if H_MV
    1019 #if H_MV_HLS_8_SPS_NODOC_48
    1020987    READ_FLAG( uiCode, "sps_range_extensions_flag" ); pcSPS->setSpsRangeExtensionsFlag( uiCode == 1 );
    1021988    READ_FLAG( uiCode, "sps_multilayer_extension_flag" ); pcSPS->setSpsMultilayerExtensionFlag( uiCode == 1 );
     
    10501017  {
    10511018#endif
    1052 #else
    1053     for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
    1054     {
    1055       READ_FLAG( uiCode, "sps_extension_type_flag" ); pcSPS->setSpsExtensionTypeFlag( i, uiCode );
    1056 #if H_3D
    1057       assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D || i == PS_EX_T_ESC );
    1058 #else
    1059       assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_ESC );
    1060 #endif
    1061     } 
    1062 
    1063     if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
    1064     {
    1065       parseSPSExtension( pcSPS );
    1066     }
    1067 
    1068 #if H_3D
    1069     if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
    1070     {
    1071       parseSPSExtension2( pcSPS, viewIndex, depthFlag  );
    1072     }
    1073 #endif
    1074 
    1075     if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC ))
    1076     {   
    1077 #endif
    1078 #endif
    1079         while ( xMoreRbspData() )
    1080         {
    1081           READ_FLAG( uiCode, "sps_extension_data_flag");
    1082         }
    1083 #if H_MV && !H_MV_HLS_8_SPS_NODOC_48
    1084     }
    1085 #endif
     1019
     1020#endif
     1021    while ( xMoreRbspData() )
     1022    {
     1023      READ_FLAG( uiCode, "sps_extension_data_flag");
     1024    }
    10861025  }
    10871026}
     
    11321071 
    11331072  READ_CODE( 4,  uiCode,  "vps_video_parameter_set_id" );         pcVPS->setVPSId( uiCode );
    1134 #if H_MV_HLS_8_SYN_Q0041_03
     1073#if H_MV
    11351074  READ_FLAG( uiCode, "vps_base_layer_internal_flag" );            pcVPS->setVpsBaseLayerInternalFlag( uiCode == 1 );
    11361075  READ_FLAG( uiCode, "vps_reserved_one_bit" );                    assert( uiCode == 1 );
     
    12211160    }
    12221161  }
    1223 #if H_MV_HLS_8_RPS_Q0100_36
     1162#if H_MV
    12241163  READ_FLAG( uiCode,  "vps_extension_flag" );                      pcVPS->setVpsExtensionFlag( uiCode == 1 ? true : false );
    12251164  if ( pcVPS->getVpsExtensionFlag() )
     
    12621201{
    12631202  UInt uiCode;
    1264 #if !H_MV_HLS_8_SYN_Q0041_03
    1265   READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
    1266 #endif
    12671203
    12681204  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
     
    13841320  }
    13851321
    1386 #if H_MV_HLS_8_SYN_39_19
    13871322  if ( pcVPS->getNumIndependentLayers() > 1 )
    13881323  {
     
    14041339  pcVPS->initTargetLayerIdLists( );
    14051340
    1406 #else
    1407   READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
    1408   pcVPS->initTargetLayerIdLists( );
    1409   if( pcVPS->getNumOutputLayerSets() > 1)
    1410   {
    1411     READ_CODE( 2, uiCode, "default_output_layer_idc" ); pcVPS->setDefaultOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
    1412   } 
    1413 #endif
    14141341
    14151342  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
     
    14201347  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
    14211348  {
    1422 #if H_MV_HLS_8_SYN_39_19
    14231349    if( i >= pcVPS->getNumLayerSets( ) )   
    1424 #else
    1425     if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
    1426 #endif
    14271350    {       
    14281351      READ_UVLC( uiCode,      "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode );
     
    14551378  }
    14561379
    1457 #if !H_MV_HLS_8_PMS_Q0195_20
    1458   READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    1459   if ( pcVPS->getRepFormatIdxPresentFlag() )
    1460   {
    1461     READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
    1462   }
    1463 #else
    14641380  READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
    1465 #endif
    14661381
    14671382  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
     
    14741389  }
    14751390
    1476 #if H_MV_HLS_8_PMS_Q0195_20
    14771391  if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    14781392  {
    14791393    READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    14801394  }
    1481 #endif
    14821395  if( pcVPS->getRepFormatIdxPresentFlag() )
    14831396  {
    1484 #if H_MV_HLS_8_SYN_Q0041_03
    14851397    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1486 #else
    1487     for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1488 #endif
    1489     {
    1490 #if !H_MV_HLS_8_PMS_Q0195_20
    1491       if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    1492       {
    1493 #endif
     1398    {
    14941399        READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1495 #if !H_MV_HLS_8_PMS_Q0195_20
    1496       }
    1497 #endif
    1498     }
    1499   }
    1500 #if H_MV_HLS_8_PMS_Q0195_20
     1400    }
     1401  }
    15011402  else
    15021403  {
    1503 #if H_MV_HLS_8_SYN_Q0041_03
    15041404    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1505 #else
    1506     for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1507 #endif
    15081405    {
    15091406      pcVPS->setVpsRepFormatIdx( i, pcVPS->inferVpsRepFormatIdx( i ) );
    15101407    }
    15111408  }
    1512 #endif
    15131409
    15141410  READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 );
     
    15351431  }
    15361432
    1537 #if H_MV_HLS_8_SYN_Q0041_03
    15381433  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ?  1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ )
    15391434  {
    15401435    for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ?  0 : 1; j < i; j++ )
    1541 #else
    1542   for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    1543   {
    1544     for( Int j = 0; j < i; j++ )
    1545 #endif
    15461436    {
    15471437      if (pcVPS->getDirectDependencyFlag( i, j) )
     
    16291519  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    16301520  {
    1631 #if H_MV_HLS_8_SYN_Q0041_03
    16321521    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1633 #else
    1634     for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1635 #endif
    1636     {
    1637 #if H_MV_HLS_8_MIS_Q0102_30
     1522    {
    16381523      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1639 #else       
    1640       for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
    1641 #endif
    16421524      {
    16431525        if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
     
    16991581  if( !pcVPSVUI->getTilesNotInUseFlag() )
    17001582  {     
    1701 #if H_MV_HLS_8_SYN_Q0041_03
    17021583    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1703 #else
    1704     for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1705 #endif
    17061584    {
    17071585      READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 );
     
    17111589      }
    17121590    } 
    1713 #if H_MV_HLS_8_SYN_Q0041_03
    17141591    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
    1715 #else
    1716     for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )     
    1717 #endif
    17181592    {
    17191593      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     
    17461620      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    17471621      {
    1748 #if H_MV_HLS_8_SYN_Q0041_03
    17491622        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
    17501623        {       
    1751 #endif
    17521624          READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
    17531625          if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
     
    17591631            }
    17601632          }
    1761 #if H_MV_HLS_8_SYN_Q0041_03
    1762         }
    1763 #endif
     1633        }
    17641634      }
    17651635    }
     
    18081678    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
    18091679    {
    1810 #if H_MV_HLS_8_HRD_Q0101_04
    18111680      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ ) 
    18121681      {
    18131682        READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
    1814 #else
    1815       for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
    1816       {
    1817         if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
    1818         {
    1819           READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
    1820         }
    1821         else
    1822         {
    1823           vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
    1824         }
    1825 #endif
    18261683      }
    18271684    }
     
    18311688    { 
    18321689      READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1" ); vpsVuiBspHrdP->setNumBspSchedCombinationsMinus1( h, uiCode );
    1833 #if H_MV_HLS_8_HRD_Q0182_05
    18341690      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
    1835 #else
    1836       for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
    1837 #endif
    18381691      {
    18391692        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
    18401693        { 
    1841 #if H_MV_HLS_8_HRD_Q0101_04
    18421694          READ_CODE( vpsVuiBspHrdP->getBspCombHrdIdxLen(), uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
    1843 #else
    1844           READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
    1845 #endif
    18461695          READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode );
    1847 #if H_MV_HLS_8_HRD_Q0101_04
    18481696          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j );
    1849 #endif
    18501697        } 
    18511698      }
     
    18721719  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
    18731720  { 
    1874 #if H_MV_HLS_8_MIS_Q0102_30
    18751721    Int currLsIdx = vps->olsIdxToLsIdx( i );
    1876 #endif
    18771722    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
    1878 #if H_MV_HLS_8_MIS_Q0102_30
    18791723    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
    1880 #else
    1881     for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1882 #endif
    18831724    { 
    18841725      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    18881729      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    18891730      { 
    1890 #if H_MV_HLS_8_MIS_Q0102_30
    18911731        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
    1892 #else
    1893         for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ )   
    1894 #endif
    18951732        {
    18961733          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     
    19031740        if ( j > 0 )
    19041741        {
    1905 #if H_MV_HLS_8_DBP_NODOC_42
    19061742          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
    1907 #else
    1908           for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ )   
    1909 #endif
    19101743          {
    19111744            dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     
    19181751  } 
    19191752}
    1920 #endif
    19211753
    19221754#if H_3D
     
    19391771#if H_3D_IV_MERGE
    19401772        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
    1941 #if QC_IV_PRED_CONSTRAINT_H0137
    19421773        if( !pcVPS->getNumDirectRefLayers(i) )
    19431774        {
    19441775          assert( !uiCode );         
    19451776        }
    1946 #endif
    19471777#if H_3D_SPIVMP
    19481778        READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3);
     
    19511781#if H_3D_ARP
    19521782        READ_FLAG( uiCode, "iv_res_pred_flag[i]"  );       pcVPS->setUseAdvRP  ( i, uiCode ); pcVPS->setARPStepNum( i, uiCode ? H_3D_ARP_WFNR : 1 );
    1953 #if QC_IV_PRED_CONSTRAINT_H0137
    19541783        if( !pcVPS->getNumDirectRefLayers(i) )
    19551784        {
    19561785          assert( !uiCode );         
    19571786        }
    1958 #endif
    19591787#endif
    19601788#if H_3D_NBDV_REF
     
    19631791#if H_3D_VSP
    19641792        READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false );
    1965 #if QC_IV_PRED_CONSTRAINT_H0137
    19661793        if( !pcVPS->getNumDirectRefLayers(i) )
    19671794        {
    19681795          assert( !uiCode );         
    19691796        }
    1970 #endif
    19711797#endif
    19721798#if H_3D_DBBP
     
    19801806        {
    19811807          READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
    1982 #if QC_IV_PRED_CONSTRAINT_H0137
    19831808          if( !pcVPS->getNumDirectRefLayers(i) )
    19841809          {
    19851810            assert( !uiCode );         
    19861811          }
    1987 #endif
    19881812        }
    19891813#endif
     
    20371861}
    20381862#endif
    2039 
    2040 #if H_MV_HLS_8_HRD_Q0102_08
     1863#endif
     1864#if H_MV
    20411865Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)
    20421866#else
     
    20811905  sps->inferRepFormat  ( vps , rpcSlice->getLayerId() );
    20821906  sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
    2083 #if H_MV_HLS_8_HRD_Q0102_08
    20841907  sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false );
    2085 #endif
    2086 #if H_MV_HLS_8_RPS_Q0100_36
    20871908  vps->inferDbpSizeLayerSetZero( sps, false );
    2088 #endif
    20891909
    20901910  if ( sps->getVuiParametersPresentFlag() )
     
    21411961  }
    21421962 
    2143 #if H0044_POC_LSB_NOT_PRESENT
     1963#if H_MV
    21441964    UInt slicePicOrderCntLsb = 0;
    21451965#endif
     
    21952015
    21962016#if H_MV
    2197 #if !H0044_POC_LSB_NOT_PRESENT
    2198     UInt slicePicOrderCntLsb = 0;
    2199 #endif
    22002017    Int iPOClsb = slicePicOrderCntLsb;  // Needed later
    22012018    if ( (rpcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( rpcSlice->getLayerIdInVps())) || !rpcSlice->getIdrPicFlag() )
     
    22032020      READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb");       
    22042021    }   
    2205 #if H_MV_HLS_8_POC_Q0142_32
    22062022    rpcSlice->setSlicePicOrderCntLsb( slicePicOrderCntLsb );
    2207 #endif
    22082023
    22092024    Bool picOrderCntMSBZeroFlag = false;     
     
    23012116      {       
    23022117        parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
    2303 #if H_MV_HLS_8_RPS_Q0100_36
     2118#if H_MV
    23042119        if ( !rps->getInterRPSPrediction( ) )
    23052120        { // check sum of num_positive_pics and num_negative_pics
     
    24142229        rps->setNumberOfPictures(offset);       
    24152230      } 
    2416 #if H_MV_HLS_8_RPS_Q0100_36
     2231#if H_MV
    24172232      if ( !rps->getInterRPSPrediction( ) )
    24182233      { // check sum of NumPositivePics, NumNegativePics, num_long_term_sps and num_long_term_pics
     
    28042619      rpcSlice->setPocResetIdc( 0 );
    28052620    }
    2806 #if H_MV_HLS_8_POC_Q0142_32
    28072621    rpcSlice->checkPocResetIdc();
    2808 #endif
    2809 
    2810 #if H0044_POC_LSB_NOT_PRESENT
     2622
    28112623    if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && slicePicOrderCntLsb > 0 )
    28122624    {
    28132625      assert( rpcSlice->getPocResetIdc() != 2 );
    28142626    }
    2815 #endif
     2627
    28162628    if( rpcSlice->getPocResetIdc() !=  0 )
    28172629    {
     
    28282640      READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 );
    28292641      READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode );
    2830 #if !H_MV_HLS_8_POC_Q0142_32
    2831 #if H0044_POC_LSB_NOT_PRESENT
    2832       if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() )
    2833       {
    2834         assert( rpcSlice->getPocLsbVal() == 0 );
    2835       }
    2836 #endif
    2837 #endif
    28382642    }         
    2839 #if H_MV_HLS_8_POC_Q0142_32
    28402643    rpcSlice->checkPocLsbVal();
    2841 #endif
    28422644
    28432645    // Derive the value of PocMs8bValRequiredFlag
     
    28522654    else
    28532655    {
    2854 #if H_MV_HLS_8_POC_Q0146_15
    28552656      rpcSlice->setPocMsbValPresentFlag( rpcSlice->inferPocMsbValPresentFlag( ) );
    2856 #else
    2857       if( rpcSlice->getPocMsbValRequiredFlag() )
    2858       {
    2859         rpcSlice->setPocMsbValPresentFlag( true );
    2860       }
    2861       else
    2862       {
    2863         rpcSlice->setPocMsbValPresentFlag( false );
    2864       }
    2865 #endif
    28662657    }
    28672658
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r964 r976  
    109109  Void  parseProfileTier    (ProfileTierLevel *ptl);
    110110  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
    111 #if H_MV_HLS_8_HRD_Q0102_08
     111#if H_MV
    112112  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx);
    113113#else
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r964 r976  
    432432    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    433433    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    434 #if !ETRIKHU_CLEANUP_H0083
    435       ,vspFlag
    436 #endif
    437434      , inheritedVSPDisInfo
    438435#if H_3D_SPIVMP
    439 #if !ETRIKHU_CLEANUP_H0083_MISSING
    440       , bSPIVMPFlag
    441 #endif
    442436      , pcMvFieldSP, puhInterDirSP
    443437#endif
    444438      , numValidMergeCand, uiMergeIndex );
    445439
    446 #if ETRIKHU_CLEANUP_H0083
    447440    m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    448441#if H_3D_SPIVMP
     
    450443#endif
    451444      , numValidMergeCand );
    452 #endif
    453445    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    454446#else
     
    797789    }
    798790   
    799 #if RWTH_DBBP_NO_SPU_H0057
    800791    AOF( pcCU->getARPW(uiPartAddr) == 0 );
    801792    AOF( pcCU->getICFlag(uiPartAddr) == false );
    802793    AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false );
    803794    AOF( pcCU->getVSPFlag(uiPartAddr) == 0 );
    804 #else
    805     pDBBPTmpData->ahVSPFlag[uiSegment] = pcCU->getVSPFlag( uiPartAddr );
    806     pDBBPTmpData->acDvInfo[uiSegment] = pcCU->getDvInfo( uiPartAddr );
    807 #endif
    808795  }
    809796 
     
    814801  {
    815802    pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth );
    816    
    817 #if !RWTH_DBBP_NO_SPU_H0057
    818     pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], 0, 0, uiDepth );
    819     pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], 0, 0, uiDepth );
    820 #endif
    821    
     803 
    822804    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    823805    {
     
    839821   
    840822    pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth);
    841    
    842 #if !RWTH_DBBP_NO_SPU_H0057
    843     pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uiDepth );
    844     pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uiDepth );
    845 #endif
    846    
    847823    pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level
    848824   
     
    946922    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    947923    {
    948 #if H_3D && !SEC_NO_RESI_DLT_H0105
    949       if ( useDltFlag )
    950       {
    951         pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    952       }
    953       else
    954       {
    955         pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    956       }
    957 #else
    958924      pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    959 #endif
    960925      pRecIPred[ uiX ] = pReco[ uiX ];
    961926    }
     
    12571222  // get DC prediction for each segment
    12581223  Pel apDCPredValues[2];
    1259 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    12601224  if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )
    12611225  {
     
    12641228  }
    12651229  else
    1266 #endif
    1267   m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
     1230  {
     1231    m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
     1232  }
    12681233 
    12691234  // reconstruct residual based on mask + DC residuals
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r950 r976  
    140140#if H_3D_DBBP
    141141
    142 #if MTK_DBBP_SIGNALING_H0094
    143142  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
    144 #else
    145   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
    146 #endif
    147143  {
    148144    decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
     
    150146    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
    151147    {
    152 #if !MTK_DBBP_SIGNALING_H0094
    153       AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
    154 #endif
    155148     
    156149      // get collocated depth block
     
    169162      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
    170163     
    171 #if RWTH_DBBP_NO_SPU_H0057
    172164      // make sure that DBBP flag is set for both segments
    173165      UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
    174166      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
    175167      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
    176 #endif
    177168    }
    178169  }
     
    210201    return;
    211202  }
    212 #if !MTK_SDC_FLAG_FIX_H0095
    213 #if H_3D_DIM_SDC
    214   if( pcCU->getSDCFlag(uiAbsPartIdx) )
    215   {
    216     return;
    217   }
    218 #endif
    219 #endif
    220203 
    221204  m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
     
    309292          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    310293          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    311 #if !ETRIKHU_CLEANUP_H0083
    312             ,vspFlag
    313 #endif
    314294            , inheritedVSPDisInfo
    315295#if H_3D_SPIVMP
    316 #if !ETRIKHU_CLEANUP_H0083_MISSING
    317             , bSPIVMPFlag
    318 #endif
    319296            , pcMvFieldSP, puhInterDirSP
    320297#endif
    321298            , numValidMergeCand );
    322 
    323 #if ETRIKHU_CLEANUP_H0083
    324299          pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    325300#if H_3D_SPIVMP
     
    327302#endif
    328303            , numValidMergeCand );
    329 #endif
    330304          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    331305
     
    361335        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    362336        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
    363 #if !ETRIKHU_CLEANUP_H0083
    364           , vspFlag
    365 #endif
    366337          , inheritedVSPDisInfo
    367338#if H_3D_SPIVMP
    368 #if !ETRIKHU_CLEANUP_H0083_MISSING
    369             , bSPIVMPFlag
    370 #endif
    371339          , pcMvFieldSP, puhInterDirSP
    372340#endif
    373341          ,numValidMergeCand, uiMergeIndex );
    374 
    375 #if ETRIKHU_CLEANUP_H0083
    376342        pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    377343#if H_3D_SPIVMP
     
    379345#endif
    380346          ,numValidMergeCand );
    381 #endif
    382347        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    383348        if(vspFlag[uiMergeIndex])
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r964 r976  
    7777#endif
    7878
    79 #if H_MV_HLS_8_HRD_Q0102_08
     79#if H_MV
    8080  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx )       = 0;
    8181#else
     
    164164  Void    decodePPS                   ( TComPPS* pcPPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS);                    }
    165165#endif
    166 #if H_MV_HLS_8_HRD_Q0102_08
     166#if H_MV
    167167  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, targetOlsIdx );         }
    168168#else
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r964 r976  
    248248    calcAndPrintHashStatus(*rpcPic->getPicYuvRec(), hash);
    249249  }
    250 
    251 #if !H_MV_HLS_7_VPS_P0300_27
    252 #if SETTING_PIC_OUTPUT_MARK
    253   rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false);
    254 #else
    255   rpcPic->setOutputMark(true);
    256 #endif
    257   rpcPic->setReconMark(true);
    258 #endif
    259250}
    260251
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r964 r976  
    8787, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    8888, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    89 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    90 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    91 #endif
    9289#if H_3D_DIM_SDC
    9390, m_cSDCResidualFlagSCModel     ( 1,             1,             SDC_NUM_RESIDUAL_FLAG_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
     
    171168  m_cDdcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_DATA );
    172169  m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
    173 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    174   m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
    175 #endif
    176170#if H_3D_DIM_SDC
    177171  m_cSDCResidualFlagSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     
    241235  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    242236  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    243 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    244   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    245 #endif
    246237#if H_3D_DIM_SDC
    247238  m_cSDCResidualFlagSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     
    386377    uiCount++;
    387378  }
    388 #if QC_SIMP_DELTADC_CODING_H0131
    389379  while( uiSymbol && ( uiCount != 3 ) );
    390 #else
    391   while( uiSymbol && ( uiCount != 13 ) );
    392 #endif
    393380  ruiSymbol = uiCount - 1;
    394381
     
    426413  for( Int i = 0; i < iNumBit; i++ )
    427414  {
    428 #if MTK_DMM_SIMP_CODE_H0092
    429       m_pcTDecBinIf->decodeBinEP( uiSymbol );
    430 #else
    431     m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm1DataSCModel.get(0, 0, 0) );
    432 #endif
     415    m_pcTDecBinIf->decodeBinEP( uiSymbol );
    433416    uiIdx += uiSymbol << i;
    434417  }
     
    11371120  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
    11381121  {
    1139 #if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
    11401122    m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
    1141 #else
    1142     m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
    1143 #endif
    11441123  }
    11451124  else
     
    20812060    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
    20822061    uiNumSegments = isDimMode( dir ) ? 2 : 1;
    2083 #if MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113
    20842062    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
    2085 #else
    2086     m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
    2087 #endif
    20882063    if( pcCU->getSDCFlag( absPartIdx ) )
    20892064    {
     
    21562131Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    21572132{
    2158 #if !MTK_DBBP_SIGNALING_H0094
    2159   PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    2160 #endif
    21612133  AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
    21622134  AOF( !pcCU->getSlice()->getIsDepth() );
    2163 #if !MTK_DBBP_SIGNALING_H0094
    2164   AOF( ePartSize == RWTH_DBBP_PACK_MODE );
    2165 #endif
    21662135 
    21672136  UInt uiSymbol = 0;
     
    21722141  {
    21732142    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
    2174 #if MTK_DIS_SPBIP8X4_H0205
    21752143    UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;
    21762144    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
    2177 #endif
    21782145  }
    21792146}
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r964 r976  
    8787#endif
    8888
    89 #if H_MV_HLS_8_HRD_Q0102_08
     89#if H_MV
    9090  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/, Int targetOlsIdx ) {}
    9191#else
    92   Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
     92  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/ ) {}
    9393#endif
    9494  Void  parseTerminatingBit       ( UInt& ruiBit );
     
    218218  ContextModel3DBuffer m_cDdcDataSCModel;
    219219  ContextModel3DBuffer m_cAngleFlagSCModel;
    220 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    221   ContextModel3DBuffer m_cDmm1DataSCModel;
    222 #endif
    223220#if H_3D_DIM_SDC 
    224221  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r950 r976  
    221221    }
    222222  }
    223 #if  MTK_DLT_CODING_FIX_H0091
     223#if  H_3D
    224224  if( pcSlice->getPPS()->getDLT() != NULL )
    225225  {
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r964 r976  
    371371  m_isNoOutputPriorPics = false;
    372372#endif
    373 #if H0056_EOS_CHECKS
     373#if H_MV
    374374  m_isLastNALWasEos = false;
    375 #endif
    376 #if H_MV
    377375  m_layerId = 0;
    378376  m_viewId = 0;
     
    382380  m_pcCamParsCollector = 0;
    383381#endif
    384 #if H_MV_HLS_8_HRD_Q0102_08
     382#if H_MV
    385383  m_targetOptLayerSetIdx = -1;
    386384#endif
     
    511509    {
    512510      rpcPic->setOutputMark(false);
    513 #if H_MV_HLS_7_VPS_P0300_27
     511#if H_MV
    514512      rpcPic->setPicOutputFlag(false);
    515513#endif
     
    521519    {
    522520      rpcPic->setOutputMark(false);
    523 #if H_MV_HLS_7_VPS_P0300_27
     521#if H_MV
    524522      rpcPic->setPicOutputFlag(false);
    525523#endif
     
    568566  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    569567  TComSlice::markCurrPic( pcPic );
    570 #if !H_MV_HLS_8_DBP_NODOC_42
    571   TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
    572 #endif
    573568#endif
    574569  m_bFirstSliceInPicture  = true;
     
    590585    {
    591586      pcPicTmp->setOutputMark(false);
    592 #if H_MV_HLS_7_VPS_P0300_27
     587#if H_MV
    593588      pcPicTmp->setPicOutputFlag(false);
    594589#endif
     
    670665  }
    671666
    672 #if H_MV_HLS_8_HRD_Q0102_08
     667#if H_MV
    673668  sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false );
    674 #endif
    675 
    676 #if H_MV_HLS_8_RPS_Q0100_36
    677669  vps->inferDbpSizeLayerSetZero( sps, false );
    678 #endif
    679 
    680 #if H_MV_HLS_8_PMS_Q0195_21
    681670  // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
    682671  if ( vps->getVpsNumRepFormatsMinus1() == 0 )
     
    685674    assert( sps->getUpdateRepFormatFlag() == false );
    686675  }
    687 #endif
    688 
    689 #if H_MV_HLS_8_RPS_Q0100_36
    690676  sps->checkRpsMaxNumPics( vps, getLayerId() );
    691 #endif
    692 
    693 #if H_MV_HLS_8_MIS_Q0177_22
    694677  if( m_layerId > 0 )
    695678  {
     
    787770  m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
    788771  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    789 #endif
    790 
    791 #if H_MV_HLS_8_HRD_Q0102_08
    792772  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx );
    793 #else
    794   m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    795773#endif
    796774  // set POC for dependent slices in skipped pictures
     
    13401318    case NAL_UNIT_VPS:
    13411319      xDecodeVPS();
    1342 #if H0056_EOS_CHECKS
     1320#if H_MV
    13431321      m_isLastNALWasEos = false;
    13441322#endif
     
    13551333    case NAL_UNIT_PREFIX_SEI:
    13561334    case NAL_UNIT_SUFFIX_SEI:
    1357 #if H0056_EOS_CHECKS
     1335#if H_MV
    13581336      if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI )
    13591337      {
     
    13801358    case NAL_UNIT_CODED_SLICE_RASL_N:
    13811359    case NAL_UNIT_CODED_SLICE_RASL_R:
    1382 #if H0056_EOS_CHECKS
     1360#if H_MV
    13831361      if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N ||
    13841362          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N ||
     
    13931371        m_isLastNALWasEos = false;
    13941372      }
    1395 #endif
    1396 #if H_MV
     1373
    13971374      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
    13981375#else
     
    14011378      break;
    14021379    case NAL_UNIT_EOS:
    1403 #if H0056_EOS_CHECKS
     1380#if H_MV
    14041381      assert( m_isLastNALWasEos == false );
    14051382      //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything.
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r964 r976  
    195195  Bool*                    m_layerInitilizedFlag; // initialization Layers
    196196  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
    197 #if  H_MV_HLS_8_HRD_Q0102_08
    198197  Int                      m_targetOptLayerSetIdx;
    199 #endif
    200198#else
    201199  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     
    234232  Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
    235233#endif
    236 #if H0056_EOS_CHECKS
     234#if H_MV
    237235  Bool                    m_isLastNALWasEos;
    238236#endif
     
    271269  Void  deletePicBuffer();
    272270#if H_MV
    273 #if H_MV_HLS_7_VPS_P0300_27
    274271  TComVPS* getActiveVPS() { return m_parameterSetManagerDecoder.getActiveVPS( ); }
    275 #endif
    276272  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS( m_layerId ); }
    277273#else
     
    296292  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    297293  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
    298 #if  H_MV_HLS_8_HRD_Q0102_08
    299294  Void                    setTargetOptLayerSetIdx( Int targetOptLayerSetIdx ) { m_targetOptLayerSetIdx = targetOptLayerSetIdx; }   
    300 #endif
    301295  TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
    302296  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r964 r976  
    273273  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
    274274
    275   #if MTK_DLT_CODING_FIX_H0091
     275  #if H_3D
    276276    if(( !pcPPS->getSPS()->getVPS()->getDepthId( pcPPS->getSPS()->getLayerId() ) )||
    277277        pcPPS->getLayerId() != 1  )
    278278    {
    279 #if H_MV_HLS_8_SPS_NODOC_48
    280279      pcPPS->setPps3dExtensionFlag( false );
    281 #else
    282       pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false );
    283 #endif
    284280    }
    285281  #endif
     
    290286  WRITE_FLAG( 1, "pps_extension_present_flag" );
    291287
    292 #if H_MV_HLS_8_SPS_NODOC_48
    293288    WRITE_FLAG( pcPPS->getPpsRangeExtensionsFlag( ) ? 1 : 0 , "pps_range_extensions_flag" );
    294289    WRITE_FLAG( pcPPS->getPpsMultilayerExtensionFlag( ) ? 1 : 0 , "pps_multilayer_extension_flag" );
     
    307302    {
    308303      WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
    309 #if H_MV_HLS_8_PPS_NODOC_NN
    310304      WRITE_FLAG( 0, "pps_extension_reserved_zero_flag" );
    311 #endif
    312305    }
    313306
     
    318311    }
    319312#endif
    320 #else
    321   for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
    322   {
    323     WRITE_FLAG( pcPPS->getPpsExtensionTypeFlag( i ) ? 1 : 0 , "pps_extension_type_flag" );
    324 #if H_3D
    325     assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_3D || i == PPS_EX_T_ESC );
    326 #else
    327     assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_ESC );
    328 #endif
    329   }
    330 
    331   if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
    332   {
    333     WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
    334   }
    335 
    336 #if H_3D
    337   if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC
    338   {
    339     codePPSExtension( pcPPS );
    340   }
    341 #endif
    342 #endif
    343 
    344313#endif
    345314
     
    861830  if ( pcSPS->getSpsExtensionPresentFlag() )
    862831  {
    863 #if H_MV_HLS_8_SPS_NODOC_48
    864832    WRITE_FLAG( pcSPS->getSpsRangeExtensionsFlag( ) ? 1 : 0 , "sps_range_extensions_flag" );
    865833    WRITE_FLAG( pcSPS->getSpsMultilayerExtensionFlag( ) ? 1 : 0 , "sps_multilayer_extension_flag" );
    866834#if !H_3D
    867     WRITE_CODE( pcSPS->getSpsExtension6bits( ), 6, "sps_extension_6bits" );
     835    WRITE_CODE( pcSPS->getSpsExtension6bits( ), 6, "sps_extension_6bits" ); 
    868836#else
    869837    WRITE_FLAG( pcSPS->getSps3dExtensionFlag( ) ? 1 : 0 , "sps_3d_extension_flag" );
    870838    WRITE_CODE( pcSPS->getSpsExtension5bits( ), 5, "sps_extension_5bits" );
    871839#endif
    872  }
     840  }
    873841
    874842  if ( pcSPS->getSpsRangeExtensionsFlag() )
     
    889857
    890858#endif
    891 #else
    892     for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
    893     {
    894       WRITE_FLAG( pcSPS->getSpsExtensionTypeFlag( i ) ? 1 : 0 , "sps_extension_type_flag" );
    895 #if H_3D
    896       assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D );
    897 #else
    898       assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV );
    899 #endif
    900     } 
    901 
    902     if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
    903     {
    904       codeSPSExtension( pcSPS );
    905     }
    906 
    907 #if H_3D
    908     if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
    909     {
    910       codeSPSExtension2( pcSPS, viewIndex, depthFlag );
    911     }
    912 #endif
    913   }
    914 #endif
    915 #endif
     859#endif
     860
    916861}
    917862
     
    955900{
    956901  WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
    957 #if H_MV_HLS_8_SYN_Q0041_03
     902#if H_MV
    958903  WRITE_FLAG( pcVPS->getVpsBaseLayerInternalFlag( ) ? 1 : 0 , "vps_base_layer_internal_flag" );
    959904  WRITE_FLAG( 1                                             , "vps_reserved_one_bit" );
     
    1042987  }
    1043988#if H_MV
    1044 #if H_MV_HLS_8_RPS_Q0100_36
    1045989  WRITE_FLAG( pcVPS->getVpsExtensionFlag(),                     "vps_extension_flag" );
    1046 #else
    1047   WRITE_FLAG( 1,                     "vps_extension_flag" );
    1048 #endif
    1049990  m_pcBitIf->writeAlignOne();
    1050991  codeVPSExtension( pcVPS );                           
     
    10691010#if H_MV
    10701011Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS )
    1071 {
    1072  
    1073 #if !H_MV_HLS_8_SYN_Q0041_03
    1074   WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
    1075 #endif
    1076 
     1012
    10771013  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    10781014
     
    11871123  }
    11881124
    1189 #if H_MV_HLS_8_SYN_39_19
    11901125  if ( pcVPS->getNumIndependentLayers() > 1 )
    11911126  {
     
    12041139    WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" );
    12051140  }
    1206 #else
    1207   WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
    1208 
    1209   if( pcVPS->getNumOutputLayerSets() > 1)
    1210   {
    1211     WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" );
    1212   } 
    1213 #endif
    12141141
    12151142  assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 ));
     
    12211148  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
    12221149  {
    1223 #if H_MV_HLS_8_SYN_39_19
    12241150    if( i >= pcVPS->getNumLayerSets( ) )   
    1225 #else
    1226     if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
    1227 #endif
    12281151    {     
    12291152      WRITE_UVLC( pcVPS->getLayerSetIdxForOlsMinus1( i ),      "layer_set_idx_for_ols_minus1[i]" );
     
    12561179  }
    12571180
    1258 #if !H_MV_HLS_8_PMS_Q0195_20
    1259   WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
    1260   if ( pcVPS->getRepFormatIdxPresentFlag() )
    1261   {
    1262     WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
    1263   }
    1264 #else
    12651181  WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
    1266 #endif
    12671182
    12681183  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
     
    12751190  }
    12761191
    1277 #if H_MV_HLS_8_PMS_Q0195_20
    12781192  if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    12791193  {
    12801194    WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
    12811195  }
    1282 #endif
     1196
    12831197  if( pcVPS->getRepFormatIdxPresentFlag() )
    12841198  {
    1285 #if H_MV_HLS_8_SYN_Q0041_03
    12861199    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1287 #else
    1288     for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1289 #endif
    1290     {
    1291 #if !H_MV_HLS_8_PMS_Q0195_20
    1292       if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    1293       {
    1294 #endif
     1200    {
    12951201        WRITE_CODE( pcVPS->getVpsRepFormatIdx(i), pcVPS->getVpsRepFormatIdxLen(), "vps_rep_format_idx[i]" );
    1296 #if !H_MV_HLS_8_PMS_Q0195_20
    1297       }
    1298 #endif
    1299     }
    1300   }
    1301 #if H_MV_HLS_8_PMS_Q0195_20
     1202    }
     1203  }
    13021204  else
    13031205  {
    1304 #if H_MV_HLS_8_SYN_Q0041_03
    13051206    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1306 #else
    1307     for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1308 #endif
    13091207    {
    13101208      assert( pcVPS->getVpsRepFormatIdx( i ) ==  pcVPS->inferVpsRepFormatIdx( i ) );
    13111209    }
    13121210  }
    1313 #endif
    1314 
    13151211
    13161212  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     
    13371233  }
    13381234
    1339 #if H_MV_HLS_8_SYN_Q0041_03
    13401235  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ?  1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ )
    13411236  {
    13421237    for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ?  0 : 1; j < i; j++ )
    1343 #else
    1344   for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    1345   {
    1346     for( Int j = 0; j < i; j++ )
    1347 #endif
    13481238    {
    13491239      if (pcVPS->getDirectDependencyFlag( i, j) )
     
    13661256
    13671257
    1368 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
     1258  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
    13691259  if( pcVPS->getVpsVuiPresentFlag() )
    13701260  {
     
    13971287  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
    13981288  { 
    1399 #if H_MV_HLS_8_MIS_Q0102_30
    14001289    Int currLsIdx = vps->olsIdxToLsIdx( i );
    1401 #endif
    14021290    WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
    1403 #if H_MV_HLS_8_MIS_Q0102_30
    14041291    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
    1405 #else
    1406     for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1407 #endif
    14081292    { 
    14091293      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    14131297      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    14141298      { 
    1415 #if H_MV_HLS_8_MIS_Q0102_30
    14161299        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
    1417 #else
    1418         for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ )   
    1419 #endif
    14201300        {
    14211301          WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
     
    14281308        if ( j > 0 )
    14291309        {
    1430 #if H_MV_HLS_8_DBP_NODOC_42
    14311310          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
    1432 #else
    1433           for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ )   
    1434 #endif
    14351311          {
    14361312            assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     
    14931369  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    14941370  {
    1495 #if H_MV_HLS_8_SYN_Q0041_03
    14961371    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1497 #else
    1498     for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1499 #endif
    1500     {
    1501 #if H_MV_HLS_8_MIS_Q0102_30
     1372    {
    15021373      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1503 #else         
    1504       for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
    1505 #endif
    15061374      {
    15071375        if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
     
    15631431  if( !pcVPSVUI->getTilesNotInUseFlag() )
    15641432  {     
    1565 #if H_MV_HLS_8_SYN_Q0041_03
    15661433    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1567 #else
    1568     for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1569 #endif
    15701434    {
    15711435      WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" );
     
    15751439      }
    15761440    } 
    1577 #if H_MV_HLS_8_SYN_Q0041_03
    15781441    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
    1579 #else
    1580     for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
    1581 #endif
    15821442    {
    15831443      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     
    16101470      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    16111471      {
    1612 #if H_MV_HLS_8_SYN_Q0041_03
    16131472        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
    16141473        {       
    1615 #endif
    1616         WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
    1617         if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
    1618         {
    1619           WRITE_FLAG( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ? 1 : 0 , "ctu_based_offset_enabled_flag" );
    1620           if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1474          WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
     1475          if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
    16211476          {
    1622             WRITE_UVLC( pcVPSVUI->getMinHorizontalCtuOffsetPlus1( i, j ), "min_horizontal_ctu_offset_plus1" );
     1477            WRITE_FLAG( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ? 1 : 0 , "ctu_based_offset_enabled_flag" );
     1478            if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1479            {
     1480              WRITE_UVLC( pcVPSVUI->getMinHorizontalCtuOffsetPlus1( i, j ), "min_horizontal_ctu_offset_plus1" );
     1481            }
    16231482          }
    16241483        }
    1625 #if H_MV_HLS_8_SYN_Q0041_03
    1626         }
    1627 #endif
    16281484      }
    16291485    }
     
    16731529    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
    16741530    {
    1675 #if H_MV_HLS_8_HRD_Q0101_04
    16761531      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ ) 
    16771532      {
    16781533        WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
    1679 #else
    1680       for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
    1681       {
    1682         if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
    1683         {
    1684           WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
    1685         }
    1686         else
    1687         {
    1688           vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
    1689         }
    1690 #endif
    16911534      }
    16921535    }
     
    16961539    {
    16971540      WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ), "num_bsp_sched_combinations_minus1" );
    1698 #if H_MV_HLS_8_HRD_Q0182_05
    16991541      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
    1700 #else
    1701       for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
    1702 #endif
    17031542      {
    17041543        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
    17051544        { 
    1706 #if H_MV_HLS_8_HRD_Q0101_04
    17071545          WRITE_CODE( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ),  vpsVuiBspHrdP->getBspCombHrdIdxLen(), "bsp_comb_hrd_idx" );
    1708 #else
    1709           WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" );
    1710 #endif
    17111546          WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" );
    17121547
    1713 #if H_MV_HLS_8_HRD_Q0101_04
    17141548          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j );
    1715 #endif
    17161549        } 
    17171550      }
     
    19071740      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    19081741      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb");
    1909 #if H_MV_HLS_8_POC_Q0142_32
    19101742      pcSlice->setSlicePicOrderCntLsb( picOrderCntLSB );
    1911 #endif
    19121743    }
    19131744
     
    23412172    }
    23422173
    2343 #if H_MV_HLS_8_POC_Q0142_32
    23442174    pcSlice->checkPocResetIdc();
    2345 #endif
    23462175
    23472176    if( pcSlice->getPocResetIdc() !=  0 )
     
    23552184      WRITE_CODE( pcSlice->getPocLsbVal( ), pcSlice->getPocLsbValLen() , "poc_lsb_val" );
    23562185    }             
    2357 #if H_MV_HLS_8_POC_Q0142_32
    23582186    pcSlice->checkPocLsbVal();
    2359 #endif
    23602187
    23612188    if( !pcSlice->getPocMsbValRequiredFlag() /* TODO &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
     
    23632190      WRITE_FLAG( pcSlice->getPocMsbValPresentFlag( ) ? 1 : 0 , "poc_msb_val_present_flag" );
    23642191    }
    2365 #if H_MV_HLS_8_POC_Q0146_15
    23662192    else
    23672193    {
    23682194      assert( pcSlice->getPocMsbValPresentFlag() ==  pcSlice->inferPocMsbValPresentFlag( ) );
    23692195    }
    2370 #endif
    23712196   
    23722197    if( pcSlice->getPocMsbValPresentFlag() )
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r964 r976  
    403403#if H_3D_IC
    404404  Bool      m_bUseIC;
    405 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    406405  Bool      m_bUseICLowLatencyEnc;
    407 #endif
    408406#endif
    409407#if H_3D_INTER_SDC
     
    516514  Void       setUseIC                       ( Bool bVal )    { m_bUseIC = bVal; }
    517515  Bool       getUseIC                       ()               { return m_bUseIC; }
    518 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    519516  Void       setUseICLowLatencyEnc          ( Bool bVal )    { m_bUseICLowLatencyEnc = bVal; }
    520517  Bool       getUseICLowLatencyEnc          ()               { return m_bUseICLowLatencyEnc; }
    521 #endif
    522518#endif
    523519#if H_3D_INTER_SDC
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r950 r976  
    18151815    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18161816    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    1817 #if !ETRIKHU_CLEANUP_H0083
    1818       , vspFlag
    1819 #endif
    18201817      , inheritedVSPDisInfo
    18211818#if H_3D_SPIVMP
    1822 #if !ETRIKHU_CLEANUP_H0083_MISSING
    1823       , bSPIVMPFlag
    1824 #endif
    18251819      , pcMvFieldSP, puhInterDirSP
    18261820#endif
     
    18281822      );
    18291823
    1830 #if ETRIKHU_CLEANUP_H0083
    18311824    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
    18321825#if H_3D_SPIVMP
     
    18351828      , numValidMergeCand
    18361829      );
    1837 #endif
    18381830
    18391831#else
     
    24002392    pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0);
    24012393   
    2402 #if RWTH_DBBP_NO_SPU_H0057
    24032394    AOF( rpcTempCU->getSPIVMPFlag(0) == false );
    24042395    AOF( rpcTempCU->getVSPFlag(0) == 0 );
    2405 #else
    2406     pDBBPTmpData->ahVSPFlag[uiSegment] = rpcTempCU->getVSPFlag(0);
    2407     pDBBPTmpData->acDvInfo[uiSegment] = rpcTempCU->getDvInfo(0);
    2408 #endif
    24092396   
    24102397    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    24372424    rpcTempCU->setMergeFlagSubParts(pDBBPTmpData->abMergeFlag[uiSegment], uiPartAddr, uiSegment, uhDepth);
    24382425    rpcTempCU->setMergeIndexSubParts(pDBBPTmpData->auhMergeIndex[uiSegment], uiPartAddr, uiSegment, uhDepth);
    2439    
    2440 #if !RWTH_DBBP_NO_SPU_H0057
    2441     rpcTempCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uhDepth);
    2442     rpcTempCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uhDepth);
    2443 #endif
    2444    
     2426       
    24452427    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    24462428    {
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r950 r976  
    157157
    158158  if( !pcCU->getSlice()->getApplyIC() )
     159  {
    159160    return;
    160 
    161   if( bRD )
    162   {
    163     uiAbsPartIdx = 0;
    164   }
    165 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
     161  }
     162
     163  if( bRD )
     164  {
     165    uiAbsPartIdx = 0;
     166  }
    166167  else
    167168  {
     
    172173    }
    173174  }
    174 #endif
    175175  if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
     176  {
    176177    m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
     178  }
    177179}
    178180#endif
     
    255257 
    256258#if H_3D_DBBP
    257 
    258 #if MTK_DBBP_SIGNALING_H0094
    259259  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
    260 #else
    261   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
    262 #endif
    263260  {
    264261    encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
     
    266263    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
    267264    {
    268 #if !MTK_DBBP_SIGNALING_H0094
    269       AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
    270 #endif
    271265      // restore virtual partition size for DBBP blocks
    272266      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
     
    290284    return;
    291285  }
    292 #if !MTK_SDC_FLAG_FIX_H0095
    293 #if H_3D_DIM_SDC
    294   if( pcCU->getSDCFlag(uiAbsPartIdx) )
    295   {
    296     return;
    297   }
    298 #endif
    299 #endif
    300286 
    301287  if( bRD )
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r964 r976  
    23252325      std::vector<Int> temp;
    23262326      TComSlice::markCurrPic( pcPic );
    2327 #if !H_MV_HLS_8_DBP_NODOC_42
    2328       TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() );
    2329 #endif
    23302327#endif
    23312328      m_bFirst = false;
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r950 r976  
    9393, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9494, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    95 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    96 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    97 #endif
    9895#if H_3D_DIM_SDC
    9996, m_cSDCResidualFlagSCModel   ( 1,             1,               SDC_NUM_RESIDUAL_FLAG_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
     
    169166  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    170167  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    171 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    172   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    173 #endif
    174168#if H_3D_DIM_SDC
    175169  m_cSDCResidualFlagSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     
    255249      curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
    256250      curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
    257 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    258       curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
    259 #endif
    260251    }
    261252#endif
     
    319310  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    320311  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    321 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    322   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    323 #endif
    324312#if H_3D_DIM_SDC
    325313  m_cSDCResidualFlagSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     
    482470    m_pcBinIf->encodeBin( 1, rcSCModel );
    483471    UInt uiCount = 0;
    484 #if QC_SIMP_DELTADC_CODING_H0131
    485472    Bool bNoExGo = ( uiSymbol < 3 );
    486473
    487474    while( --uiSymbol && ++uiCount < 3 )
    488 #else
    489     Bool bNoExGo = (uiSymbol < 13);
    490 
    491     while( --uiSymbol && ++uiCount < 13 )
    492 #endif
    493475    {
    494476      m_pcBinIf->encodeBin( 1, rcSCModel );
     
    526508  for ( Int i = 0; i < iNumBit; i++ )
    527509  {
    528 #if MTK_DMM_SIMP_CODE_H0092
    529       m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 );
    530 #else
    531     m_pcBinIf->encodeBin( ( uiTabIdx >> i ) & 1, m_cDmm1DataSCModel.get(0, 0, 0) );
    532 #endif
     510    m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 );
    533511  }
    534512}
     
    12431221  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
    12441222  {
    1245 #if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
    12461223    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
    1247 #else
    1248     m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
    1249 #endif
    12501224  }
    12511225  if( isDimMode( dir ) )
     
    23272301      dimDeltaDC = isDimDeltaDC( dir );
    23282302    }
    2329 #if MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113
    23302303    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
    2331 #else
    2332     m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
    2333 #endif
    23342304  }
    23352305  else //all-zero inter SDC is not allowed
     
    23732343Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    23742344{
    2375 #if !MTK_DBBP_SIGNALING_H0094
    2376   PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    2377   AOF( ePartSize == RWTH_DBBP_PACK_MODE );
    2378 #endif
    23792345  AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
    23802346  AOF( !pcCU->getSlice()->getIsDepth() );
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r950 r976  
    258258  ContextModel3DBuffer m_cDdcDataSCModel;
    259259  ContextModel3DBuffer m_cAngleFlagSCModel;
    260 #if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
    261   ContextModel3DBuffer m_cDmm1DataSCModel;
    262 #endif
    263260#if H_3D_DIM_SDC 
    264261  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r964 r976  
    11461146        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    11471147        {
    1148 #if H_3D_DIM && !SEC_NO_RESI_DLT_H0105
    1149           if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1150           {
    1151             pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
    1152           }
    1153           else
    1154           {
    1155             pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
    1156           }
    1157 #else
    11581148          pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
    1159 #endif
    11601149        }
    11611150        pOrg  += uiStride;
     
    12211210      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    12221211      {
    1223 #if H_3D_DIM && !SEC_NO_RESI_DLT_H0105
    1224         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1225         {
    1226           pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    1227         }
    1228         else
    1229         {
    1230           pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    1231         }
    1232 #else
    12331212        pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    1234 #endif
    12351213        pRecQt   [ uiX ] = pReco[ uiX ];
    12361214        pRecIPred[ uiX ] = pReco[ uiX ];
     
    19891967  // get DC prediction for each segment
    19901968  Pel apDCPredValues[2];
    1991 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
    19921969  if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )
    19931970  {
     
    19961973  }
    19971974  else
    1998 #endif
    1999   analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
     1975  {
     1976    analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
     1977  }
     1978
    20001979
    20011980  // get original DC for each segment
     
    36743653      pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[0], 0, 0, pcCU->getDepth(0)); // interprets depth relative to LCU level
    36753654     
    3676 #if !RWTH_DBBP_NO_SPU_H0057
    3677       pcCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[0], 0, 0, pcCU->getDepth(0));
    3678       pcCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[0], 0, 0, pcCU->getDepth(0));
    3679 #endif
    3680      
    36813655      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    36823656      {
     
    37073681      pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    37083682#if H_3D_VSP
    3709 #if !ETRIKHU_CLEANUP_H0083
    3710                                         , vspFlag
    3711 #endif
    37123683                                        , inheritedVSPDisInfo
    37133684#endif
    37143685#if H_3D_SPIVMP
    3715 #if !ETRIKHU_CLEANUP_H0083_MISSING
    3716         , pbSPIVMPFlag
    3717 #endif
    37183686        , pcMvFieldSP, puhInterDirSP
    37193687#endif
     
    37213689        );
    37223690
    3723 #if ETRIKHU_CLEANUP_H0083
    37243691      pcCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
    37253692#if H_3D_VSP
     
    37313698                                        , numValidMergeCand
    37323699        );
    3733 #endif
    37343700#else
    37353701      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     
    37453711    pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    37463712#if H_3D_VSP
    3747 #if !ETRIKHU_CLEANUP_H0083
    3748                                       , vspFlag
    3749 #endif
    37503713                                      , inheritedVSPDisInfo
    37513714#endif
    37523715#if H_3D_SPIVMP
    3753 #if !ETRIKHU_CLEANUP_H0083_MISSING
    3754       , pbSPIVMPFlag
    3755 #endif
    37563716      , pcMvFieldSP, puhInterDirSP
    37573717#endif
     
    37593719      );
    37603720
    3761 #if ETRIKHU_CLEANUP_H0083
    37623721    pcCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
    37633722#if H_3D_VSP
     
    37693728                                      , numValidMergeCand
    37703729      );
    3771 #endif
    37723730#else
    37733731    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r964 r976  
    930930     )
    931931  {
    932 #if MTK_LOW_LATENCY_IC_ENCODING_H0086
    933932    pcSlice ->xSetApplyIC(pcEncTop->getUseICLowLatencyEnc());
    934 #else
    935     pcSlice ->xSetApplyIC();
    936 #endif
    937933    if ( pcSlice->getApplyIC() )
    938934    {
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r964 r976  
    698698  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
    699699  m_cSPS.setSpsExtensionPresentFlag              ( true );
    700 #if H_MV_HLS_8_SPS_NODOC_48
    701700  m_cSPS.setSpsMultilayerExtensionFlag    ( true );
    702 #else
    703   m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_MV ,true );
    704 #endif
    705701#if H_3D
    706 #if H_MV_HLS_8_SPS_NODOC_48
    707702  m_cSPS.setSps3dExtensionFlag            ( true );
    708 #else
    709   m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_3D ,true );
    710 #endif
    711703#endif
    712704#endif
     
    777769    m_cSPS.setNumReorderPics(m_numReorderPics[i], i);
    778770  }
    779 #if H_MV_HLS_8_HRD_Q0102_08
     771#if H_MV
    780772  for ( Int ols = 0; ols < m_cVPS->getNumOutputLayerSets(); ols++)
    781773  {
     
    788780  }
    789781
    790 #if H_MV_HLS_8_RPS_Q0100_36
    791782  m_cVPS->inferDbpSizeLayerSetZero( &m_cSPS, true );
    792 #endif
    793 
    794783#endif
    795784  m_cSPS.setPCMBitDepthLuma (g_uiPCMBitDepthLuma);
     
    853842  m_cPPS.setPPSId( getLayerIdInVps() );
    854843  m_cPPS.setSPSId( getLayerIdInVps() );
    855 #if H_MV_HLS_8_SPS_NODOC_48
    856844  m_cPPS.setPpsMultilayerExtensionFlag    ( true );
    857845#if H_3D
    858846  m_cPPS.setPps3dExtensionFlag            ( true );
    859 #endif
    860 #else
    861   m_cPPS.setPpsExtensionTypeFlag          ( PPS_EX_T_MV ,true );
    862 #if H_3D
    863   m_cPPS.setPpsExtensionTypeFlag          ( PPS_EX_T_3D ,true );
    864 #endif
    865847#endif
    866848#endif
Note: See TracChangeset for help on using the changeset viewer.