Changeset 884 in 3DVCSoftware


Ignore:
Timestamp:
29 Mar 2014, 18:55:16 (10 years ago)
Author:
tech
Message:

Merged HTM-10.1-dev0@883. (MV-HEVC 7 HLS)

Location:
trunk/source
Files:
43 edited

Legend:

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

    r872 r884  
    140140    AOF( m_pScaleOffsetFile );
    141141  }
    142 #if !FIX_CAM_PARS_COLLECTOR
    143   m_cCamParsCollector.init( m_pScaleOffsetFile );
    144 #endif
    145142#endif
    146143  InputByteStream bytestream(bitstreamFile);
     
    209206      read(nalu, nalUnit);
    210207#if H_MV     
    211 #if H_MV_FIX_VPS_LAYER_ID_NOT_EQUAL_ZERO
    212208      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer)
    213209          || !isNaluWithinTargetDecLayerIdSet(&nalu)
    214210          || nalu.m_layerId > MAX_NUM_LAYER_IDS-1
    215211          || (nalu.m_nalUnitType == NAL_UNIT_VPS && nalu.m_layerId > 0)           
    216 #if H_MV_HLS_7_MISC_P0130_EOS
    217212          || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0)           
    218 #endif
    219213         )
    220 #else
    221       if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || nalu.m_layerId > MAX_NUM_LAYER_IDS-1 )
    222 #endif
    223214      {
    224215        bNewPicture = false;
     
    248239          }
    249240
    250 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    251241          if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
    252242          {
     
    254244            exit(EXIT_FAILURE);
    255245          }
    256 #endif
    257246          m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx );
    258247        }
    259248
    260 #if FIX_CAM_PARS_COLLECTOR
    261249#if H_3D
    262250        if (nalu.m_nalUnitType == NAL_UNIT_VPS )
    263         {       
    264          
     251        {                 
    265252          m_cCamParsCollector.init( m_pScaleOffsetFile, m_tDecTop[decIdx]->getPrefetchedVPS() );
    266253        }       
    267 #endif
    268254#endif
    269255        bNewPicture       = ( newSliceDiffLayer || newSliceDiffPoc ) && !sliceSkippedFlag;
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r872 r884  
    388388  ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")   
    389389  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 
    390 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    391390  ("DefaultTargetOutputLayerIdc"     , m_defaultTargetOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
    392 #else
    393   ("DefaultOneTargetOutputLayerFlag"  , m_defaultOneTargetOutputLayerIdc  , 0, "Output highest layer of layer sets by default")
    394 #endif
    395391  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 
    396392
    397 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    398393  ("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") 
    399394  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 
    400 #else
    401   ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 
    402 #endif
    403395  ("ProfileLevelTierIdx",   m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier")
    404396 
     
    521513#if H_3D_SPIVMP
    522514  ("SubPULog2Size", m_iSubPULog2Size, (Int)3, "Sub-PU size index: 2^n")
    523 #endif
    524 #if QC_SPIVMP_MPI_G0119
    525515  ("SubPUMPILog2Size", m_iSubPUMPILog2Size, (Int)3, "Sub-PU MPI size index: 2^n")
    526516#endif
     
    613603#if H_MV
    614604
    615   // DBP Size
    616 #if !H_MV_HLS_7_FIX_SET_DPB_SIZE
    617   ("SubLayerFlagInfoPresentFlag",  m_subLayerFlagInfoPresentFlag , false                                           , "SubLayerFlagInfoPresentFlag")
    618 #endif
    619605  // VPS VUI
    620606  ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
    621607  ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false                                           , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
    622608  ("CrossLayerIrapAlignedFlag"   , m_crossLayerIrapAlignedFlag   , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
    623 #if H_MV_HLS_7_MISC_P0068_21
    624609  ("AllLayersIdrAlignedFlag"     , m_allLayersIdrAlignedFlag     , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
    625 #endif
    626610  ("BitRatePresentVpsFlag"       , m_bitRatePresentVpsFlag       , false                                           , "BitRatePresentVpsFlag       ")
    627611  ("PicRatePresentVpsFlag"       , m_picRatePresentVpsFlag       , false                                           , "PicRatePresentVpsFlag       ")
     
    737721  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
    738722  ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
    739 #if H_MV_HLS_7_SEI_P0204_26
    740723  ("SubBitstreamPropSEIEnabled",              m_subBistreamPropSEIEnabled,    false                     ,"Enable signaling of sub-bitstream property SEI message")
    741724  ("SEISubBitstreamNumAdditionalSubStreams",  m_sbPropNumAdditionalSubStreams,0, "Number of substreams for which additional information is signalled")
     
    745728  ("SEISubBitstreamAvgBitRate",               m_sbPropAvgBitRate,             std::vector< Int  >(1,0)  ,"Specifies average bit rate of the i-th sub-bitstream")
    746729  ("SEISubBitstreamMaxBitRate",               m_sbPropMaxBitRate,             std::vector< Int  >(1,0)  ,"Specifies maximum bit rate of the i-th sub-bitstream")
    747 #endif
    748730#if H_3D
    749731  ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
     
    14321414  }
    14331415
    1434 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    14351416  xConfirmPara( m_defaultTargetOutputLayerIdc < 0 || m_defaultTargetOutputLayerIdc > 2, "Default target output layer idc must greater than or equal to 0 and less than or equal to 2." ); 
    14361417
     
    14631444    }
    14641445  }
    1465 #else
    1466   xConfirmPara( m_defaultOneTargetOutputLayerIdc < 0 || m_defaultOneTargetOutputLayerIdc > 1, "Default one target output layer idc must be equal to 0 or equal to 1" );
    1467 #endif
     1446
    14681447  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" );
    14691448
     
    15521531#endif
    15531532#if H_3D_SPIVMP
    1554 #if SEC_SPIVMP_MCP_SIZE_G0077
    15551533  xConfirmPara( m_iSubPULog2Size < 3,                                        "SubPULog2Size must be 3 or greater.");
    1556 #else
    1557   xConfirmPara( m_iSubPULog2Size < 2,                                        "SubPULog2Size must be 2 or greater.");
    1558 #endif
    15591534  xConfirmPara( m_iSubPULog2Size > 6,                                        "SubPULog2Size must be 6 or smaller.");
    15601535  xConfirmPara( (1<<m_iSubPULog2Size) > m_uiMaxCUWidth,                      "SubPULog2Size must be log2(maxCUSize) or smaller.");
    1561 #endif
    1562 #if QC_SPIVMP_MPI_G0119
     1536 
    15631537  xConfirmPara( m_iSubPUMPILog2Size < 3,                                        "SubPUMPILog2Size must be 3 or greater.");
    15641538  xConfirmPara( m_iSubPUMPILog2Size > 6,                                        "SubPUMPILog2Size must be 6 or smaller.");
     
    22522226  }
    22532227  }
    2254 #endif
    2255 #if H_MV_HLS_7_SEI_P0204_26
    22562228  // Check input parameters for Sub-bitstream property SEI message
    22572229  if( m_subBistreamPropSEIEnabled )
     
    24992471#if H_3D_SPIVMP
    25002472  printf(" SubPULog2Size:%d  " , m_iSubPULog2Size  );
    2501 #endif
    2502 #endif
    2503 #if QC_SPIVMP_MPI_G0119
    25042473  printf(" SubPUMPILog2Size:%d  " , m_iSubPUMPILog2Size  );
     2474#endif
    25052475#endif
    25062476#if H_3D_ARP
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r872 r884  
    8989  Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
    9090  std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds in vps of layer set
    91 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    9291  Int                    m_defaultTargetOutputLayerIdc;       ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
    93 #else
    94   Int                    m_defaultOneTargetOutputLayerIdc;    ///< Output highest layer of layer sets by default when equal to 1
    95 #endif
    9692  std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets 
    9793  std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
    98 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    9994  std::vector< std::vector<Int> > m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
    100 #endif
    10195  std::vector<Int>       m_profileLevelTierIdx;               ///< Indices of of profile level tier
    10296 
     
    10498  std::vector< std::vector<Int> > m_directRefLayers;          ///< LayerIds of direct reference layers
    10599  std::vector< std::vector<Int> > m_dependencyTypes;          ///< Dependency types of direct reference layers
    106 
    107   // DBP Size
    108 #if !H_MV_HLS_7_FIX_SET_DPB_SIZE
    109   Bool m_subLayerFlagInfoPresentFlag;
    110 #endif
    111100
    112101  // VPS VUI
     
    114103  Bool m_crossLayerPicTypeAlignedFlag;
    115104  Bool m_crossLayerIrapAlignedFlag;
    116 #if H_MV_HLS_7_MISC_P0068_21
    117105  Bool m_allLayersIdrAlignedFlag;
    118 #endif
    119106  Bool m_bitRatePresentVpsFlag;
    120107  Bool m_picRatePresentVpsFlag;
     
    141128#if H_3D_SPIVMP
    142129  Int                    m_iSubPULog2Size;                   
    143 #endif
    144 #endif
    145 #if QC_SPIVMP_MPI_G0119
    146130  Int                    m_iSubPUMPILog2Size;                   
     131#endif
    147132#endif
    148133#if H_3D_ARP                                                  /// < flag and number of weighting factors in ARP
     
    440425  Int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
    441426  Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
    442 #if H_MV_HLS_7_SEI_P0204_26
     427#if H_MV
    443428  Bool              m_subBistreamPropSEIEnabled;
    444429  Int               m_sbPropNumAdditionalSubStreams;
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r872 r884  
    127127  xSetRepFormat            ( vps );
    128128  xSetLayerSets            ( vps );
    129 #if H_MV_HLS_7_FIX_SET_DPB_SIZE
    130129  xSetDpbSize              ( vps );
    131 #endif
    132130  xSetVPSVUI               ( vps );
    133131#if H_3D
     
    187185#if H_3D_SPIVMP
    188186    m_cTEncTop.setSubPULog2Size                 (( isDepth || 0==layerIdInVps ) ? 0 : m_iSubPULog2Size   );
    189 #endif
    190 #if QC_SPIVMP_MPI_G0119
    191187    m_cTEncTop.setSubPUMPILog2Size              ( !isDepth ? 0 : m_iSubPUMPILog2Size   );
    192188#endif
     
    429425  m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
    430426  m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
    431 #if H_MV_HLS_7_SEI_P0204_26
     427#if H_MV
    432428  m_cTEncTop.setSubBitstreamPropSEIEnabled( m_subBistreamPropSEIEnabled );
    433429  if( m_subBistreamPropSEIEnabled )
     
    826822#endif
    827823
    828 #if MTK_DDD_G0063
     824#if H_3D_DDD
    829825          m_acTEncTopList[ layer ]->getSliceEncoder()->setDDDPar( m_cCameraData.getCodedScale()[0][ m_acTEncTopList[layer]->getViewIndex() ],
    830826              m_cCameraData.getCodedOffset()[0][ m_acTEncTopList[layer]->getViewIndex() ],
     
    15061502}
    15071503
    1508 #if H_MV_HLS_7_FIX_SET_DPB_SIZE
    15091504Void TAppEncTop::xSetDpbSize                ( TComVPS& vps )
    15101505{
     
    15201515    Bool subLayerFlagInfoPresentFlag = false;
    15211516
    1522 #if H_MV_HLS_7_HRD_P0156_7
    15231517    for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1524 #else
    1525     for( Int j = 0; j  <=  vps.getMaxTLayers() - 1 ; j++ )
    1526 #endif
    15271518    {   
    15281519      Bool subLayerDpbInfoPresentFlag = false;
    1529 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    15301520      assert( vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i ) ) == targetDecLayerIdList.size() );
    15311521      for( Int k = 0; k < vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i )); k++ )   
    1532 #else
    1533       assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() );
    1534       for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
    1535 #endif
    15361522      {
    15371523        Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
     
    15761562  } 
    15771563}
    1578 #else
    1579 Void TAppEncTop::xSetDpbSize                ( TComVPS& vps )
    1580 {
    1581   // These settings need to be verified
    1582 
    1583   TComDpbSize* dpbSize = vps.getDpbSize();
    1584 
    1585   assert ( dpbSize != 0 );
    1586 
    1587   for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ )
    1588   { 
    1589     std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i );
    1590     dpbSize->setSubLayerFlagInfoPresentFlag( i, m_subLayerFlagInfoPresentFlag );
    1591     if ( dpbSize->getSubLayerFlagInfoPresentFlag( i ) )
    1592     {
    1593       for( Int j = 0; j  <=  vps.getMaxTLayers() - 1 ; j++ )
    1594       {   
    1595         Int maxNumReorderPics  = MIN_INT;
    1596         Int maxDecPicBuffering = MIN_INT;
    1597         Int maxLatencyIncrease = MIN_INT;
    1598 
    1599         Int prevMaxNumReorderPics  = MIN_INT;
    1600         Int prevMaxDecPicBuffering = MIN_INT;
    1601         Int prevMaxLatencyIncrease = MIN_INT;
    1602 
    1603         assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() );
    1604         for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
    1605         {
    1606           Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
    1607           dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 );
    1608         }       
    1609 
    1610         for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ )
    1611         {
    1612           Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[ idx ] );
    1613           maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] );
    1614         }
    1615         assert( maxNumReorderPics != MIN_INT );
    1616         dpbSize->setMaxVpsNumReorderPics( i, j, maxNumReorderPics );
    1617 
    1618         // To Be Done !
    1619         // dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode );
    1620 
    1621         if( j > 0 ) 
    1622         {
    1623           dpbSize->setSubLayerDpbInfoPresentFlag( i, j, prevMaxDecPicBuffering == maxDecPicBuffering && prevMaxLatencyIncrease == maxLatencyIncrease && prevMaxNumReorderPics == maxNumReorderPics );
    1624         }       
    1625 
    1626         prevMaxNumReorderPics   = maxNumReorderPics;
    1627         prevMaxDecPicBuffering  = maxDecPicBuffering;
    1628         prevMaxLatencyIncrease  = maxLatencyIncrease;
    1629       } 
    1630     } 
    1631   } 
    1632 }
    1633 #endif
     1564
    16341565
    16351566Void TAppEncTop::xSetLayerSets( TComVPS& vps )
     
    16371568  // Layer sets
    16381569  vps.setVpsNumLayerSetsMinus1   ( m_vpsNumLayerSets - 1 );
    1639 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1640   vps.setVpsNumberLayerSetsMinus1( vps.getVpsNumLayerSetsMinus1() );
    1641 #endif
    16421570   
    16431571  for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ )
     
    16561584  Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size();
    16571585  // Additional output layer sets + profileLevelTierIdx
    1658 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    16591586  vps.setDefaultTargetOutputLayerIdc      ( m_defaultTargetOutputLayerIdc );   
    16601587  vps.setNumAddOutputLayerSets            ( numAddOuputLayerSets          );
    16611588  vps.initTargetLayerIdLists();
    1662 #else
    1663   vps.setDefaultOneTargetOutputLayerIdc   ( m_defaultOneTargetOutputLayerIdc );
    1664   vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets       != 0 );   
    1665   vps.setNumAddOutputLayerSetsMinus1       ( numAddOuputLayerSets - 1        );
    1666 #endif
    1667 
    1668 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1589
    16691590  for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + numAddOuputLayerSets; olsIdx++)
    16701591  {
     
    17161637    vps.setAltOutputLayerFlag( olsIdx , false);     
    17171638  }
    1718 #else
    1719   for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++)
    1720   {
    1721     if ( lsIdx > 0 )
    1722     {
    1723       vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] );
    1724     } 
    1725 
    1726     vps.setOutputLayerSetIdxMinus1( lsIdx, lsIdx - 1 );
    1727 
    1728     for (Int i = 0; i < m_layerIdsInSets[ lsIdx ].size(); i++ )
    1729     {
    1730       vps.setOutputLayerFlag( lsIdx, i, vps.inferOutputLayerFlag( lsIdx, i ));       
    1731     }
    1732   }
    1733 
    1734   for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ )
    1735   {
    1736     vps.setProfileLevelTierIdx( m_vpsNumLayerSets + addOutLs, m_profileLevelTierIdx[ addOutLs ] );
    1737 
    1738     Int refLayerSetIdx = m_outputLayerSetIdx[ addOutLs ];     
    1739     vps.setOutputLayerSetIdxMinus1( m_vpsNumLayerSets + addOutLs, refLayerSetIdx - 1 );
    1740 
    1741     for (Int i = 0; i < m_layerIdsInSets[ refLayerSetIdx].size(); i++ )
    1742     {
    1743       Bool outputLayerFlag = false;
    1744       for (Int j = 0; j < m_layerIdsInAddOutputLayerSet[ addOutLs ].size(); j++ )
    1745       {
    1746         if (  m_layerIdsInAddOutputLayerSet[addOutLs][ j ] == m_layerIdsInSets[ refLayerSetIdx][ i ] )
    1747         {
    1748           outputLayerFlag = true;
    1749           break;
    1750         }
    1751       }
    1752       vps.setOutputLayerFlag( m_vpsNumLayerSets + addOutLs, i, outputLayerFlag );       
    1753     }
    1754   }
    1755   vps.deriveTargetLayerIdLists();
    1756 #endif
     1639
    17571640}
    17581641
     
    17611644  vps.setVpsVuiPresentFlag( m_vpsVuiPresentFlag );
    17621645
    1763 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
    17641646  TComVPSVUI* pcVPSVUI = vps.getVPSVUI(  );
    17651647  assert( pcVPSVUI );
    1766 #endif
    17671648
    17681649  if ( m_vpsVuiPresentFlag )
    17691650  {
    1770 #if !H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
    1771     TComVPSVUI* pcVPSVUI = vps.getVPSVUI(  );
    1772 
    1773     assert( pcVPSVUI );
    1774 #endif
    1775 
    17761651    // All this stuff could actually be derived by the encoder,
    17771652    // however preliminary setting it from input parameters
     
    17791654    pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag );
    17801655    pcVPSVUI->setCrossLayerIrapAlignedFlag   ( m_crossLayerIrapAlignedFlag    );
    1781 #if H_MV_HLS_7_MISC_P0068_21
    17821656    pcVPSVUI->setAllLayersIdrAlignedFlag     ( m_allLayersIdrAlignedFlag      );
    1783 #endif
    17841657    pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag );
    17851658    pcVPSVUI->setPicRatePresentVpsFlag( m_picRatePresentVpsFlag );
     
    17871660    if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    17881661    {
    1789 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    17901662      for( Int i = 0; i  <=  vps.getVpsNumLayerSetsMinus1(); i++ )
    1791 #else
    1792       for( Int i = 0; i  <=  vps.getVpsNumberLayerSetsMinus1(); i++ )
    1793 #endif
    17941663      {
    17951664        for( Int j = 0; j  <=  vps.getMaxTLayers(); j++ )
     
    19091778    pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD
    19101779  }
    1911 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
    19121780  else
    19131781  {
    19141782    pcVPSVUI->setCrossLayerIrapAlignedFlag   ( false   );
    19151783  }
    1916 #endif
    19171784}
    19181785#endif
     
    19701837#endif
    19711838  } 
    1972 #if QC_SPIVMP_MPI_G0119
     1839#if H_3D_SPIVMP
    19731840  vps.setSubPUMPILog2Size( m_iSubPUMPILog2Size );
    19741841#endif
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r872 r884  
    9494
    9595#if H_3D_ARP
    96 #if MTK_ARP_FLAG_CABAC_SIMP_G0061
    9796#define NUM_ARPW_CTX                  3       ///< number of context models for weighting factor index used by advanced residual prediction
    98 #else
    99 #define NUM_ARPW_CTX                  4       ///< number of context models for weighting factor index used by advanced residual prediction
    100 #endif
    10197#endif
    10298
    10399#if H_3D_IC
    104 #if MTK_IC_FLAG_CABAC_SIMP_G0061
    105100#define NUM_IC_FLAG_CTX               1       ///< number of context models for illumination compensation flag
    106 #else
    107 #define NUM_IC_FLAG_CTX               3       ///< number of context models for illumination compensation flag
    108 #endif
    109101#endif
    110102
     
    112104
    113105#if H_3D_DIM
    114 #if QC_GENERIC_SDC_G0122
    115106#define NUM_DEPTH_INTRA_MODE_CTX      1       ///< number of context models for depth intra modes
    116 #else
    117 #define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
    118 #endif
    119107#define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
    120108#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
     
    122110#define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
    123111#endif
    124 #if QC_GENERIC_SDC_G0122
    125112#define NUM_ANGLE_FLAG_CTX            3
    126 #if !QC_SDC_UNIFY_G0130
    127 #define NUM_INTRASDC_FLAG_CTX         3
    128 #endif
    129 #endif
    130113#endif
    131114
    132115#if H_3D_DIM_SDC
    133 #define SDC_NUM_RESIDUAL_FLAG_CTX        1
    134 #define SDC_NUM_RESIDUAL_CTX             1
    135 #endif
    136 
    137 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    138 #define NUM_INTER_SDC_FLAG_CTX        1      ///< number of context models for inter SDC flag
    139 #define NUM_INTER_SDC_SIGN_FLAG_CTX   1      ///< number of context models for sign of inter SDC residual
    140 #define NUM_INTER_SDC_RESIDUAL_CTX    1      ///< number of context models for abs of inter SDC residual
    141 #endif
    142 
    143 #if QC_SDC_UNIFY_G0130
     116#define SDC_NUM_RESIDUAL_FLAG_CTX     1
     117#define SDC_NUM_RESIDUAL_CTX          1
    144118#define NUM_SDC_FLAG_CTX              1      ///< number of context
    145119#endif
     
    366340
    367341#if H_3D_ARP
    368 #if MTK_ARP_FLAG_CABAC_SIMP_G0061
    369342static const UChar
    370343INIT_ARPW[3][NUM_ARPW_CTX] =
     
    374347    { 162, 153, 162 },
    375348};
    376 #else
    377 static const UChar
    378 INIT_ARPW[3][NUM_ARPW_CTX] =
    379 {
    380     { 162, 153, 154, 162 },
    381     { 162, 153, 154, 162 },
    382     { 162, 153, 154, 162 },
    383 };
    384 #endif
     349
    385350#endif
    386351#if H_3D_IC
    387 #if MTK_IC_FLAG_CABAC_SIMP_G0061
    388352static const UChar
    389353INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 
     
    393357    { 154 },
    394358};
    395 #else
    396 static const UChar
    397 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 
    398 {
    399     { 154,  154,  154, },
    400     { 154,  154,  154, },
    401     { 154,  154,  154, },
    402 };
    403 #endif
     359
    404360#endif
    405361#if H_3D_DIM
    406 #if QC_GENERIC_SDC_G0122
    407362static const UChar
    408363INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     
    412367  { 154, }
    413368};
    414 #else
    415 static const UChar
    416 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
    417 {
    418     {0,  0,  64, 168, 168, 124, CNU, 0},
    419     {0, 64,   0, 183, CNU, 108,   0, 0},
    420     {64, 0, CNU, CNU, 168, 109,   0, 0}
    421 };
    422 #endif
    423 
    424 #if QC_GENERIC_SDC_G0122
     369
    425370static const UChar
    426371INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
     
    430375  { 155, 170, 157 },
    431376};
    432 #if !QC_SDC_UNIFY_G0130
    433 static const UChar
    434 INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =
    435 {
    436   { 214, 229, 230 },
    437   { 215, 202, 174 },
    438   { 213, 201, 246 },
    439 };
    440 #endif
    441 #endif
    442377
    443378static const UChar
     
    482417#endif
    483418
    484 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    485 static const UChar
    486 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] =
    487 {
    488   { CNU }, 
    489   { 154 },
    490   { 154 },
    491 };
    492 
    493 static const UChar
    494 INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] =
    495 {
    496   { CNU }, 
    497   { 154 },
    498   { 154 },
    499 };
    500 
    501 static const UChar
    502 INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] =
    503 {
    504   { CNU }, 
    505   { 154 },
    506   { 154 },
    507 };
    508 #endif
     419
    509420//! \}
    510 #if QC_SDC_UNIFY_G0130
     421#if H_3D_DIM_SDC
    511422static const UChar
    512423INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] =
  • trunk/source/Lib/TLibCommon/SEI.h

    r872 r884  
    7272    SCALABLE_NESTING                     = 133,
    7373    REGION_REFRESH_INFO                  = 134,
    74 #if H_MV_HLS_7_SEI_P0204_26
     74#if H_MV
    7575    SUB_BITSTREAM_PROPERTY               = 139,    // Final PayloadType to be defined after finalization
    7676#endif
     
    366366};
    367367
    368 #if H_MV_HLS_7_SEI_P0204_26
     368#if H_MV
    369369class SEISubBitstreamProperty : public SEI
    370370{
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r872 r884  
    123123#if H_3D_DIM_SDC
    124124  m_pbSDCFlag             = NULL;
    125 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    126   for( Int i = 0; i < 4; i++ )
    127   {
    128     m_apSegmentDCOffset[i]  = NULL;
    129   }
    130 #else
    131125  m_apSegmentDCOffset[0]  = NULL;
    132126  m_apSegmentDCOffset[1]  = NULL;
    133 #endif
    134127#endif
    135128#endif
     
    153146#endif
    154147#if H_3D_INTER_SDC
    155 #if !QC_SDC_UNIFY_G0130
    156   m_pbInterSDCFlag       = NULL;
    157   for( Int i = 0; i < 4; i++ )
    158   {
    159     m_apSegmentInterDCOffset[i] = NULL;
    160   }
    161 #endif
    162 #if !SEC_INTER_SDC_G0101
    163   m_pucInterSDCMask       = NULL;
    164 #endif
    165148#endif
    166149#if H_3D_DBBP
     
    168151#endif
    169152
    170 #if MTK_DDD_G0063
     153#if H_3D_DDD
    171154  m_pucDisparityDerivedDepth = NULL;
    172155  m_pbUseDDD = NULL;
     
    291274#if H_3D_DIM_SDC
    292275    m_pbSDCFlag             = (Bool*)xMalloc(Bool, uiNumPartition);
    293 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    294     for( Int i = 0; i < 4; i++ )
    295     {
    296       m_apSegmentDCOffset[i]  = (Pel*)xMalloc(Pel, uiNumPartition);
    297     }
    298 #else
    299276    m_apSegmentDCOffset[0]  = (Pel*)xMalloc(Pel, uiNumPartition);
    300277    m_apSegmentDCOffset[1]  = (Pel*)xMalloc(Pel, uiNumPartition);
    301278#endif
    302279#endif
    303 #endif
    304 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    305     m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
    306     for( Int i = 0; i < 4; i++ )
    307     {
    308       m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition);
    309     }
    310 #endif
    311280#if H_3D_DBBP
    312281    m_pbDBBPFlag         = (Bool*  )xMalloc(Bool,   uiNumPartition);
     
    318287    m_acCUMvField[1].setNumPartition(uiNumPartition );
    319288  }
    320 #if !SEC_INTER_SDC_G0101
    321 #if H_3D_INTER_SDC
    322   m_pucInterSDCMask     = (UChar*  )xMalloc(UChar,    g_uiMaxCUHeight*g_uiMaxCUWidth);
    323 #endif
    324 #endif
    325289  m_sliceStartCU        = (UInt*  )xMalloc(UInt, uiNumPartition);
    326290  m_sliceSegmentStartCU = (UInt*  )xMalloc(UInt, uiNumPartition);
     
    329293  m_pcPattern            = (TComPattern*)xMalloc(TComPattern, 1);
    330294 
    331 #if MTK_DDD_G0063
     295#if H_3D_DDD
    332296  m_pucDisparityDerivedDepth         = (UChar*  )xMalloc( UChar,  uiNumPartition);
    333297  m_pbUseDDD                         = (Bool*  ) xMalloc( Bool,   uiNumPartition);
     
    413377#endif
    414378
    415 #if MTK_DDD_G0063
     379#if H_3D_DDD
    416380    if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth);          m_pucDisparityDerivedDepth        = NULL; }
    417381    if ( m_pbUseDDD                 ) { xFree(m_pbUseDDD);                          m_pbUseDDD                        = NULL; }
     
    441405#if H_3D_DIM_SDC
    442406    if ( m_pbSDCFlag            ) { xFree(m_pbSDCFlag);             m_pbSDCFlag             = NULL; }
    443 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    444     for( Int i = 0; i < 4; i++ )
    445     {
    446       if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]);  m_apSegmentDCOffset[i]  = NULL; }
    447     }
    448 #else
    449407    if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]);  m_apSegmentDCOffset[0]  = NULL; }
    450408    if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]);  m_apSegmentDCOffset[1]  = NULL; }
    451 #endif
    452409#endif   
    453410#endif   
    454 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    455     if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
    456     for(Int i = 0; i < 4; i++ )
    457     {
    458       if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }
    459   }
    460 #endif
    461411#if H_3D_DBBP
    462412    if ( m_pbDBBPFlag         ) { xFree(m_pbDBBPFlag);          m_pbDBBPFlag        = NULL; }
    463413#endif
    464414  }
    465 #if !SEC_INTER_SDC_G0101
    466 #if H_3D_INTER_SDC
    467   if ( m_pucInterSDCMask     ) { xFree(m_pucInterSDCMask);      m_pucInterSDCMask    = NULL; }
    468 #endif
    469 #endif
    470415  m_pcCUAboveLeft       = NULL;
    471416  m_pcCUAboveRight      = NULL;
     
    560505#endif
    561506
    562 #if MTK_DDD_G0063
     507#if H_3D_DDD
    563508    m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui];
    564509    m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui];
     
    593538#if H_3D_DIM_SDC
    594539    m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
    595 #endif
    596 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    597     m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
    598540#endif
    599541#if H_3D_DBBP
     
    646588#endif
    647589
    648 #if MTK_DDD_G0063
     590#if H_3D_DDD
    649591    memset( m_pucDisparityDerivedDepth        + firstElement, 0,           numElements * sizeof( *m_pucDisparityDerivedDepth ) );
    650592    memset( m_pbUseDDD                        + firstElement, 0,           numElements * sizeof( *m_pbUseDDD ) );
     
    665607#if H_3D_DIM_SDC
    666608    memset( m_pbSDCFlag             + firstElement,     0,                numElements * sizeof( *m_pbSDCFlag            ) );
    667 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    668     for( Int i = 0; i < 4; i++ )
    669     {
    670       memset( m_apSegmentDCOffset[i]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[i] ) );
    671     }
    672 #else
    673609    memset( m_apSegmentDCOffset[0]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[0] ) );
    674610    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    675611#endif
    676 #endif
    677 #endif
    678 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    679     memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
    680     for( Int i = 0; i < 4; i++ )
    681     {
    682       memset( m_apSegmentInterDCOffset[i] + firstElement,     0,         numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );
    683     }
    684612#endif
    685613#if H_3D_DBBP
     
    834762#endif
    835763
    836 #if MTK_DDD_G0063
     764#if H_3D_DDD
    837765      m_pucDisparityDerivedDepth[ui] = 0;
    838766      m_pbUseDDD[ui] = 0;
     
    853781#if H_3D_DIM_SDC
    854782      m_pbSDCFlag           [ui] = false;
    855 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    856       for( Int i = 0; i < 4; i++ )
    857       {
    858         m_apSegmentDCOffset[i][ui] = 0;
    859       }
    860 #else
    861783      m_apSegmentDCOffset[0][ui] = 0;
    862784      m_apSegmentDCOffset[1][ui] = 0;
    863785#endif
    864 #endif
    865 #endif
    866 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    867       m_pbInterSDCFlag[ui] = false;
    868       for( Int i = 0; i < 4; i++ )
    869       {
    870         m_apSegmentInterDCOffset[i][ui] = 0;
    871       }
    872786#endif
    873787#if H_3D_DBBP
     
    955869#endif
    956870
    957 #if MTK_DDD_G0063
     871#if H_3D_DDD
    958872  memset( m_pucDisparityDerivedDepth,         0, iSizeInUchar );
    959873  memset( m_pbUseDDD,                         0, iSizeInBool );
     
    982896#if H_3D_DIM_SDC
    983897  memset( m_pbSDCFlag,            0, sizeof(Bool) * m_uiNumPartition  );
    984 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    985   for( Int i = 0; i < 4; i++ )
    986   {
    987     memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition   );
    988   }
    989 #else
    990898  memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
    991899  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
    992900#endif
    993 #endif
    994 #endif
    995 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    996   memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
    997   for( Int i = 0; i < 4; i++ )
    998   {
    999     memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );
    1000   }
    1001901#endif
    1002902#if H_3D_DBBP
     
    1056956#endif
    1057957
    1058 #if MTK_DDD_G0063
     958#if H_3D_DDD
    1059959      m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui];
    1060960      m_pbUseDDD[ui]                 = pcCU->m_pbUseDDD[uiPartOffset+ui];
     
    1075975#if H_3D_DIM_SDC
    1076976      m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
    1077 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    1078       for( Int i = 0; i < 4; i++ )
    1079       {
    1080         m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ];
    1081       }
    1082 #else
    1083977      m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
    1084978      m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
    1085979#endif
    1086 #endif
    1087 #endif
    1088 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    1089       m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
    1090       for( Int i = 0; i < 4; i++ )
    1091       {
    1092         m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ];
    1093       }
    1094980#endif
    1095981#if H_3D_DBBP
     
    12161102#endif
    12171103
    1218 #if MTK_DDD_G0063
     1104#if H_3D_DDD
    12191105  m_pucDisparityDerivedDepth          = pcCU->getDDDepth()        + uiPart;
    12201106  m_pbUseDDD                          = pcCU->getUseDDD()         + uiPart;
     
    12461132#if H_3D_DIM_SDC
    12471133  m_pbSDCFlag               = pcCU->getSDCFlag()              + uiPart;
    1248 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    1249   for( Int i = 0; i < 4; i++ )
    1250   {
    1251     m_apSegmentDCOffset[i]    = pcCU->getSDCSegmentDCOffset(i)  + uiPart;
    1252   }
    1253 #else
    12541134  m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0)  + uiPart;
    12551135  m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1)  + uiPart;
    1256 #endif
    12571136#endif 
    12581137#endif 
    1259 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    1260   m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
    1261   for( Int i = 0; i < 4; i++ )
    1262   {
    1263     m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart;
    1264   }
    1265 #endif
    12661138#if H_3D_DBBP
    12671139  m_pbDBBPFlag              = pcCU->getDBBPFlag()         + uiPart;
     
    13801252#endif
    13811253
    1382 #if MTK_DDD_G0063
     1254#if H_3D_DDD
    13831255  m_pucDisparityDerivedDepth         = pcCU->getDDDepth()              + uiAbsPartIdx;
    13841256  m_pbUseDDD                         = pcCU->getUseDDD()              + uiAbsPartIdx;
     
    14451317  memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar );
    14461318 
    1447 #if MTK_DDD_G0063
     1319#if H_3D_DDD
    14481320  memcpy( m_pucDisparityDerivedDepth          + uiOffset, pcCU->getDDDepth(),         iSizeInUchar );
    14491321  memcpy( m_pbUseDDD                          + uiOffset, pcCU->getUseDDD(),          iSizeInBool );
     
    14651337#if H_3D_DIM_SDC
    14661338  memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(),             iSizeInBool  );
    1467 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    1468   for( Int i = 0; i < 4; i++ )
    1469   {
    1470     memcpy( m_apSegmentDCOffset[i]  + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition);
    1471   }
    1472 #else
    14731339  memcpy( m_apSegmentDCOffset[0]  + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
    14741340  memcpy( m_apSegmentDCOffset[1]  + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
    14751341#endif
    1476 #endif
    1477 #endif
    1478 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    1479   memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
    1480   for( Int i = 0; i < 4; i++ )
    1481   {
    1482     memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition);
    1483   }
    14841342#endif
    14851343#if H_3D_DBBP
     
    15591417#endif
    15601418
    1561 #if MTK_DDD_G0063
     1419#if H_3D_DDD
    15621420  memcpy( rpcCU->getDDDepth()          + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth,         iSizeInUchar  );
    15631421  memcpy( rpcCU->getUseDDD()           + m_uiAbsIdxInLCU, m_pbUseDDD,                         iSizeInBool  );
     
    16021460#if H_3D_DIM_SDC
    16031461  memcpy( rpcCU->getSDCFlag()             + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
    1604 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    1605   for( Int i = 0; i < 4; i++ )
    1606   {
    1607     memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition);
    1608   }
    1609 #else
    16101462  memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
    16111463  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
    16121464#endif
    1613 #endif
    1614 #endif
    1615 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    1616   memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
    1617   for( Int i = 0;i < 4; i++ )
    1618   {
    1619     memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition);
    1620   }
    16211465#endif
    16221466#if H_3D_DBBP
     
    17071551  memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar );
    17081552 
    1709 #if MTK_DDD_G0063
     1553#if H_3D_DDD
    17101554  memcpy( rpcCU->getDDDepth()          + uiPartOffset, m_pucDisparityDerivedDepth,         iSizeInUchar );
    17111555  memcpy( rpcCU->getUseDDD()           + uiPartOffset, m_pbUseDDD,                         iSizeInBool );
     
    17261570#if H_3D_DIM_SDC
    17271571  memcpy( rpcCU->getSDCFlag()             + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
    1728 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    1729   for( Int i = 0; i < 4; i++ )
    1730   {
    1731     memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart);
    1732   }
    1733 #else
    17341572  memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
    17351573  memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
    17361574#endif
    1737 #endif
    1738 #endif
    1739 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    1740   memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
    1741   for( Int i = 0; i < 4; i++ )
    1742   {
    1743     memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart);
    1744   }
    17451575#endif
    17461576#if H_3D_DBBP
     
    17911621}
    17921622
    1793 #if MTK_DDD_G0063
     1623#if H_3D_DDD
    17941624Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    17951625{
     
    24632293  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    24642294  uiCtx    = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0;
    2465  
    2466 #if !MTK_ARP_FLAG_CABAC_SIMP_G0061       
    2467   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2468   uiCtx   += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0;
    2469 #endif
    2470   return uiCtx;
    2471 }
    2472 #endif
    2473 #if !MTK_IC_FLAG_CABAC_SIMP_G0061
    2474 #if H_3D_IC
    2475 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx )
    2476 {
    2477   UInt        uiCtx = 0;
    2478 
    2479   TComDataCU* pcTempCU = NULL;
    2480   UInt        uiTempPartIdx = 0;
    2481 
    2482   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2483   uiCtx    = ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
    2484 
    2485   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2486   uiCtx    += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
    2487 
    2488   return uiCtx;
    2489 }
    2490 #endif
     2295    return uiCtx;
     2296}
    24912297#endif
    24922298#if H_3D_DBBP
     
    25692375#endif
    25702376
    2571 #if H_3D_INTER_SDC
    2572 #if !QC_SDC_UNIFY_G0130
    2573 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    2574 {
    2575   setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    2576 }
    2577 
    2578 UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx )
     2377#if H_3D_DIM_SDC
     2378UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
    25792379{
    25802380  return 0;
    2581 }
    2582 #endif
    2583 
    2584 #if !SEC_INTER_SDC_G0101
    2585 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )
    2586 {
    2587   UInt  uiWidth      = pcCU->getWidth ( 0 );
    2588   UInt  uiHeight     = pcCU->getHeight( 0 );
    2589   UInt  uiPartitionSize = pcCU->getPartitionSize( 0 );
    2590   UInt  uiXOffset = 0, uiYOffset = 0;
    2591 
    2592   switch( uiPartitionSize )
    2593   {
    2594   case SIZE_2NxN:
    2595     uiXOffset = uiWidth;      uiYOffset = uiHeight >> 1;   break;
    2596   case SIZE_2NxnU:
    2597     uiXOffset = uiWidth;      uiYOffset = uiHeight >> 2;   break;
    2598   case SIZE_2NxnD:
    2599     uiXOffset = uiWidth;      uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 );   break;
    2600   case SIZE_Nx2N:
    2601     uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break;
    2602   case SIZE_nLx2N:
    2603     uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break;
    2604   case SIZE_nRx2N:
    2605     uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break;
    2606   case SIZE_NxN:
    2607     uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1;  break;
    2608   default:
    2609     assert( uiPartitionSize == SIZE_2Nx2N );
    2610     uiXOffset = uiWidth;     uiYOffset = uiHeight;    break;
    2611   }
    2612 
    2613   UInt uiPelX, uiPelY;
    2614 
    2615   memset( pMask, 0, uiWidth*uiHeight );
    2616 
    2617   //mask
    2618   if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU )
    2619   {
    2620     for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
    2621     {
    2622       for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
    2623       {
    2624         pMask[uiPelX + uiPelY*uiWidth] = 0;
    2625       }
    2626     }
    2627 
    2628     for( ; uiPelY < uiHeight; uiPelY++ )
    2629     {
    2630       for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
    2631       {
    2632         pMask[uiPelX + uiPelY*uiWidth] = 1;
    2633       }
    2634     }
    2635   }
    2636   else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N )
    2637   {
    2638     for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
    2639     {
    2640       for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
    2641       {
    2642         pMask[uiPelX + uiPelY*uiWidth] = 0;
    2643       }
    2644 
    2645       for( ; uiPelX < uiWidth; uiPelX++ )
    2646       {
    2647         pMask[uiPelX + uiPelY*uiWidth] = 1;
    2648       }
    2649     }
    2650   }
    2651   else if( uiPartitionSize == SIZE_NxN )
    2652   {
    2653     for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
    2654     {
    2655       for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
    2656       {
    2657         pMask[uiPelX + uiPelY*uiWidth] = 0;
    2658       }
    2659 
    2660       for( ; uiPelX < uiWidth; uiPelX++ )
    2661       {
    2662         pMask[uiPelX + uiPelY*uiWidth] = 1;
    2663       }
    2664     }
    2665 
    2666     for( ; uiPelY < uiHeight; uiPelY++ )
    2667     {
    2668       for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
    2669       {
    2670         pMask[uiPelX + uiPelY*uiWidth] = 2;
    2671       }
    2672 
    2673       for( ; uiPelX < uiWidth; uiPelX++ )
    2674       {
    2675         pMask[uiPelX + uiPelY*uiWidth] = 3;
    2676       }
    2677     }
    2678   }
    2679 
    2680 }
    2681 #endif
    2682 #endif
    2683 
    2684 #if QC_GENERIC_SDC_G0122
    2685 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
    2686 {
    2687 #if QC_SDC_UNIFY_G0130
    2688   return 0;
    2689 #else
    2690   TComDataCU* pcTempCU;
    2691   UInt        uiTempPartIdx;
    2692   UInt        uiCtx = 0;
    2693 
    2694   // Get BCBP of left PU
    2695   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2696   uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
    2697 
    2698   // Get BCBP of above PU
    2699   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2700   uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
    2701 
    2702   return uiCtx;
    2703 #endif
    27042381}
    27052382
     
    29472624  // check general CU information
    29482625  if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
     2626  {
    29492627    return false;
    2950 #if QC_GENERIC_SDC_G0122
     2628  }
     2629
    29512630  if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) )
    29522631  {
     
    29602639
    29612640  return false;
    2962 #endif
    29632641  // check prediction mode
    29642642  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 
     
    35823260inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    35833261  Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3584   {
    3585 #if MTK_NBDV_IVREF_FIX_G0067
     3262{
    35863263  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
    3587 #else
    3588   if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )
    3589 #endif
    35903264  {
    35913265    return false;
     
    35943268  Int refViewIdx = pDInfo->m_aVIdxCan;
    35953269  TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx );
    3596  
     3270
    35973271  if( picDepth == NULL ) // No depth reference avail
    35983272  {
     
    36023276
    36033277  rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3604  
     3278
    36053279  Bool  refViewAvailFlag = false;
    36063280  UChar predFlag[2]      = {0, 0};
    3607 #if !MTK_RBIP_VSP_G0069
    3608   Int   refListIdY       = 0;   
    3609   Int   viewIdInRefListX = -1;
    3610 #endif
    3611  
     3281
    36123282  for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
    36133283  {
     
    36203290        refViewAvailFlag      = true;
    36213291        predFlag[iRefListIdX] = 1;
    3622 #if !MTK_RBIP_VSP_G0069
    3623         viewIdInRefListX      = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId();
    3624         refListIdY            = 1 - iRefListIdX;
    3625 #endif
    36263292        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    36273293#if H_3D_NBDV
     
    36313297    }
    36323298  }
    3633 
    3634 #if !MTK_RBIP_VSP_G0069
    3635   if (m_pcSlice->isInterB() && refViewAvailFlag)
    3636   {
    3637     RefPicList eRefPicListY = RefPicList( refListIdY );
    3638     refViewAvailFlag = false;
    3639     for ( Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicListY) && !refViewAvailFlag; i++ )
    3640     {
    3641       Int viewIdxRefInListY = m_pcSlice->getRefPic(eRefPicListY, i)->getViewIndex();
    3642       if ( viewIdxRefInListY != refViewIdx && viewIdxRefInListY != m_pcSlice->getViewIndex() )
    3643       {
    3644         refViewAvailFlag = true;
    3645         predFlag[refListIdY] = 1;
    3646         TComMv  cMv = pDInfo->m_acNBDV;
    3647        
    3648         Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId();
    3649         Int currViewId       = m_pcSlice->getViewId();
    3650        
    3651         //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed):
    3652         // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx  );
    3653        
    3654         Int iScale      = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX );
    3655        
    3656         // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX.
    3657         if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() )
    3658         {
    3659           cMv = cMv.scaleMv( iScale );
    3660         }
    3661         else
    3662         {
    3663 
    3664           cMv = cMv;
    3665         }
    3666         clipMv( cMv );
    3667         pcMvFieldNeighbours[(iCount<<1)+refListIdY].setMvField( cMv, i );
    3668 #if H_3D_NBDV
    3669         pcMvFieldNeighbours[(iCount<<1)+refListIdY].getMv().setIDVFlag (false);
    3670 #endif
    3671       }
    3672     }
    3673   }
    3674 #endif
    36753299
    36763300  // Set values to be returned
     
    37913415  for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
    37923416  {
    3793 #if NTT_STORE_SPDV_VSP_G0148
    37943417    if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
    3795 #else
    3796     if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )
    3797 #endif
    37983418    {
    37993419      continue;
     
    42273847  UChar tmpDir;
    42283848
    4229 #if MTK_DDD_G0063
     3849#if H_3D_DDD
    42303850  m_iUseDDDCandIdx = -1;
    42313851#endif
     
    43113931    iPosLeftAbove[0] = numA1B1B0;
    43123932#if H_3D_VSP
    4313 #if NTT_STORE_SPDV_VSP_G0148
    43143933    if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    4315 #else
    4316     if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
    4317 #endif
    43183934#if H_3D_IC
    43193935      && !bICFlag
     
    43383954    iPosLeftAbove[1] = numA1B1B0;
    43393955#if H_3D_VSP
    4340 #if NTT_STORE_SPDV_VSP_G0148
    43413956    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
    4342 #else
    4343     if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
    4344 #endif
    43453957#if H_3D_IC
    43463958      && !bICFlag
     
    43653977  {
    43663978#if H_3D_VSP
    4367 #if NTT_STORE_SPDV_VSP_G0148
    43683979    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
    4369 #else
    4370     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
    4371 #endif
    43723980#if H_3D_IC
    43733981      && !bICFlag
     
    43903998  {
    43913999#if H_3D_VSP
    4392 #if NTT_STORE_SPDV_VSP_G0148
    43934000    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
    4394 #else
    4395     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
    4396 #endif
    43974001#if H_3D_IC
    43984002      && !bICFlag
     
    44174021  {
    44184022#if H_3D_VSP
    4419 #if NTT_STORE_SPDV_VSP_G0148
    44204023    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
    4421 #else
    4422     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
    4423 #endif
    44244024#if H_3D_IC
    44254025      && !bICFlag
     
    44494049  if( bMPIFlag)
    44504050  {
    4451 #if QC_SPIVMP_MPI_G0119
    44524051    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    44534052    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     
    45564155    }
    45574156#endif
    4558 #else
    4559     UInt uiPartIdxCenter;
    4560     xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );   
    4561     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    4562     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    4563     Int tRef[2]={-1, -1};
    4564 
    4565 #if H_3D_FCO
    4566     TComPic * pcTexturePic = m_pcSlice->getTexturePic();
    4567     TComDataCU *pcTextureCU = 0;
    4568     if ( pcTexturePic )
    4569       pcTextureCU = pcTexturePic->getCU( getAddr() );
    4570 #else
    4571     TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
    4572 #endif
    4573 
    4574 #if H_3D_FCO
    4575     if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
    4576 #else
    4577     if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
    4578 #endif
    4579     {
    4580       pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] );
    4581       tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() );
    4582       if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
    4583       {
    4584         TComMv cMvPred = tmpMV[0].getMv();
    4585         const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4586         cMvPred+=cAdd;
    4587         cMvPred>>=2;
    4588         clipMv(cMvPred);
    4589         tmpMV[0].setMvField(cMvPred,tRef[0]);
    4590       }
    4591       if ( getSlice()->isInterB() )
    4592       {
    4593         pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, tmpMV[1] );
    4594         tRef[1] = getPic()->isTextRefValid( REF_PIC_LIST_1, tmpMV[1].getRefIdx() );
    4595         if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
     4157    if( tmpDir != 0 )
     4158    {
     4159      Int iCnloop = 0;
     4160      Bool bRemoveSpa = false; //pruning
     4161
     4162      for(Int i = 0; i < 2; i ++)
     4163      {
     4164        iCnloop = iPosLeftAbove[i];
     4165        if ( iCnloop == -1 )
    45964166        {
    4597           TComMv cMvPred = tmpMV[1].getMv();
    4598           const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4599           cMvPred+=cAdd;
    4600           cMvPred>>=2;
    4601           clipMv(cMvPred);
    4602           tmpMV[1].setMvField(cMvPred,tRef[1]);
     4167          continue;
    46034168        }
    4604       }
    4605 
    4606       tmpDir = 0;
    4607       if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
    4608       {
    4609         tmpDir += ((tmpMV[0].getRefIdx()>=0)?1:0);
    4610       }
    4611       if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
    4612       {
    4613         tmpDir += ((tmpMV[1].getRefIdx()>=0)?2:0);
    4614       }
    4615 #endif
    4616       if( tmpDir != 0 )
    4617       {
    4618         Int iCnloop = 0;
    4619         Bool bRemoveSpa = false; //pruning
    4620 
    4621         for(Int i = 0; i < 2; i ++)
     4169        if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
    46224170        {
    4623           iCnloop = iPosLeftAbove[i];
    4624           if ( iCnloop == -1 )
     4171          bRemoveSpa                      = true;
     4172          break;
     4173        }     
     4174      }
     4175
     4176      if (!bRemoveSpa)
     4177      {
     4178        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4179      }
     4180      else
     4181      {
     4182        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
     4183        if (iCnloop<numA1B1B0)
     4184        {
     4185          numA1B1B0--;
     4186        }
     4187        iCountHEVC--;
     4188
     4189        if (iPosLeftAbove[0] != -1)
     4190        {
     4191          if (iCnloop == iPosLeftAbove[0])
    46254192          {
    4626             continue;
     4193            iPosLeftAbove[0] = -1;
    46274194          }
    4628           if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
     4195          else
    46294196          {
    4630             bRemoveSpa                      = true;
    4631             break;
    4632           }     
     4197            iPosLeftAbove[0]++;
     4198          }
    46334199        }
    4634 
    4635         if (!bRemoveSpa)
     4200        if (iPosLeftAbove[1] != -1)
    46364201        {
    4637           rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4638         }
    4639         else
    4640         {
    4641           rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
    4642           if (iCnloop<numA1B1B0)
     4202          if (iCnloop == iPosLeftAbove[1])
    46434203          {
    4644             numA1B1B0--;
     4204            iPosLeftAbove[1] = -1;
    46454205          }
    4646           iCountHEVC--;
    4647 
    4648           if (iPosLeftAbove[0] != -1)
     4206          else
    46494207          {
    4650             if (iCnloop == iPosLeftAbove[0])
     4208            if (iCnloop > iPosLeftAbove[1])
    46514209            {
    4652               iPosLeftAbove[0] = -1;
    4653             }
    4654             else
    4655             {
    4656               iPosLeftAbove[0]++;
    4657             }
    4658           }
    4659           if (iPosLeftAbove[1] != -1)
    4660           {
    4661             if (iCnloop == iPosLeftAbove[1])
    4662             {
    4663               iPosLeftAbove[1] = -1;
    4664             }
    4665             else
    4666             {
    4667               if (iCnloop > iPosLeftAbove[1])
    4668               {
    4669                 iPosLeftAbove[1]++;
    4670               }
     4210              iPosLeftAbove[1]++;
    46714211            }
    46724212          }
    46734213        }
    4674 #if QC_SPIVMP_MPI_G0119
    4675         pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
    4676         pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
    4677 #else
    4678         if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
     4214      }
     4215      pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
     4216      pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
     4217
     4218      puhInterDirNeighbours[iCount] = tmpDir;
     4219
     4220      if ( mrgCandIdx == iCount )
     4221      {
     4222        return;
     4223      }
     4224      iCount ++;
     4225    }
     4226  }
     4227#if H_3D_DDD
     4228  if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0  && bMPIFlag )
     4229  {
     4230    UInt uiPartIdx;
     4231    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
     4232    TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 
     4233
     4234
     4235    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     4236    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     4237    tmpDir = 0;
     4238
     4239    xDeriveCenterIdx( uiPUIdx, uiPartIdx);
     4240
     4241    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
     4242    {
     4243
     4244      TComMvField cMVField;
     4245      Int iDV = 0;
     4246      Int iViewIdx = 0;
     4247      pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
     4248      if( cMVField.getRefIdx() >= 0 )
     4249      {
     4250        if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
    46794251        {
    4680           pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tRef[0]);
    4681         }
    4682         if ( getSlice()->isInterB())
    4683         {
    4684           if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
     4252          iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
     4253          iDV = cMVField.getHor();
     4254
     4255
     4256          Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
     4257
     4258          if( iValidDepRef >= 0 )
    46854259          {
    4686             pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tRef[1]);
     4260            const TComMv cAdd( 2, 2 );
     4261            cMVField.getMv() += cAdd;
     4262            cMVField.getMv() >>= 2;
     4263            clipMv( cMVField.getMv() );
     4264            tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
     4265            tmpDir = 1;
    46874266          }
    46884267        }
    4689 #endif
    4690         puhInterDirNeighbours[iCount] = tmpDir;
     4268      }
     4269
     4270      pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
     4271
     4272      if( !tmpDir && cMVField.getRefIdx() >= 0 )
     4273      {
     4274        if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
     4275        {
     4276          iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
     4277          iDV = cMVField.getHor();
     4278
     4279          Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
     4280
     4281          if( iValidDepRef >= 0 )
     4282          {
     4283            const TComMv cAdd( 2, 2 );
     4284            cMVField.getMv() += cAdd;
     4285            cMVField.getMv() >>= 2;
     4286            clipMv( cMVField.getMv() );
     4287            tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
     4288            tmpDir = 2;
     4289          }
     4290        }
     4291      }
     4292      if( tmpDir != 0 )
     4293      {
     4294        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4295        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
     4296        m_iUseDDDCandIdx = iCount;
     4297
     4298        if( tmpDir == 1 )
     4299        {
     4300          pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
     4301        }
     4302        else if( tmpDir == 2  )
     4303        {
     4304          pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
     4305        }
     4306
     4307        abCandIsInter        [ iCount ] = true;
     4308        puhInterDirNeighbours[ iCount ] = tmpDir;
    46914309
    46924310        if ( mrgCandIdx == iCount )
     
    46954313        }
    46964314        iCount ++;
    4697       }
    4698 #if !QC_SPIVMP_MPI_G0119
    4699     }
    4700 #endif
    4701   }
    4702 #if MTK_DDD_G0063
    4703   if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0  && bMPIFlag )
    4704   {
    4705       UInt uiPartIdx;
    4706       TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
    4707       TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 
    4708 
    4709 
    4710       tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    4711       tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    4712       tmpDir = 0;
    4713 
    4714       xDeriveCenterIdx( uiPUIdx, uiPartIdx);
    4715 
    4716       if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
    4717       {
    4718 
    4719           TComMvField cMVField;
    4720 #if !HTM10RC1_FIX
    4721           UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx );
    4722 #endif
    4723           Int iDV = 0;
    4724           Int iViewIdx = 0;
    4725 #if !HTM10RC1_FIX
    4726           if( ucInterDir & 1 )
    4727           {
    4728 #endif
    4729               pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
    4730 #if HTM10RC1_FIX
    4731               if( cMVField.getRefIdx() >= 0 )
    4732               {
    4733 #endif
    4734               if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
    4735               {
    4736                   iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
    4737                   iDV = cMVField.getHor();
    4738 
    4739 
    4740                   Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
    4741 
    4742                   if( iValidDepRef >= 0 )
    4743                   {
    4744                       const TComMv cAdd( 2, 2 );
    4745                       cMVField.getMv() += cAdd;
    4746                       cMVField.getMv() >>= 2;
    4747                       clipMv( cMVField.getMv() );
    4748                       tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
    4749                       tmpDir = 1;
    4750                   }
    4751               }
    4752           }
    4753 
    4754 #if !HTM10RC1_FIX
    4755           if( !tmpDir && ( ucInterDir & 2 ))
    4756           {
    4757 #endif
    4758               pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
    4759 
    4760 #if HTM10RC1_FIX
    4761               if( !tmpDir && cMVField.getRefIdx() >= 0 )
    4762               {
    4763 #endif
    4764               if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
    4765               {
    4766                   iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
    4767                   iDV = cMVField.getHor();
    4768 
    4769                   Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
    4770 
    4771                   if( iValidDepRef >= 0 )
    4772                   {
    4773                       const TComMv cAdd( 2, 2 );
    4774                       cMVField.getMv() += cAdd;
    4775                       cMVField.getMv() >>= 2;
    4776                       clipMv( cMVField.getMv() );
    4777                       tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
    4778                       tmpDir = 2;
    4779                   }
    4780               }
    4781           }
    4782           if( tmpDir != 0 )
    4783           {
    4784               rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4785               m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    4786               m_iUseDDDCandIdx = iCount;
    4787 
    4788               if( tmpDir == 1 )
    4789               {
    4790                   pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
    4791               }
    4792               else if( tmpDir == 2  )
    4793               {
    4794                   pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
    4795               }
    4796 
    4797               abCandIsInter        [ iCount ] = true;
    4798               puhInterDirNeighbours[ iCount ] = tmpDir;
    4799 
    4800               if ( mrgCandIdx == iCount )
    4801               {
    4802                   return;
    4803               }
    4804               iCount ++;
    4805 
    4806               Int iLeftAboveAvail = 0;
    4807               if( iPosLeftAbove[ 0 ] != -1 )
    4808               {
    4809                   iPosLeftAbove[ 0 ] = iCount;
    4810                   iLeftAboveAvail = 1;
    4811               }
    4812               if( iPosLeftAbove[ 1 ] != -1 )
    4813               {
    4814                   iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    4815               }
    4816 
    4817           }
    4818       }     
    4819 
     4315
     4316        Int iLeftAboveAvail = 0;
     4317        if( iPosLeftAbove[ 0 ] != -1 )
     4318        {
     4319          iPosLeftAbove[ 0 ] = iCount;
     4320          iLeftAboveAvail = 1;
     4321        }
     4322        if( iPosLeftAbove[ 1 ] != -1 )
     4323        {
     4324          iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
     4325        }
     4326      }
     4327    }
    48204328  }
    48214329#endif
     
    48364344  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    48374345
    4838 #if MTK_NBDV_IVREF_FIX_G0067
    48394346  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    4840 #else
    4841   if ( ivMvPredFlag )
    4842 #endif
    48434347  {
    48444348    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
     
    48484352  //////// INTER VIEW MOTION COMP(IvMC) /////////
    48494353  ///////////////////////////////////////////////
    4850 #if QC_DEPTH_MERGE_SIMP_G0127
    48514354  if( getSlice()->getIsDepth() )
    48524355  {
    48534356    ivCandDir[1] = ivCandDir[2] = ivCandDir[3] = 0;
    48544357  }
    4855 #endif
     4358
    48564359  if( ivCandDir[0] )
    48574360  {
     
    48934396      for(; iCnloop >= 0; iCnloop --)
    48944397      {
    4895 #if MTK_DDD_G0063
     4398#if H_3D_DDD
    48964399          if( iCnloop == m_iUseDDDCandIdx )
    48974400          {
     
    49614464    if (bIvMC)
    49624465    {
    4963 #if QC_SPIVMP_MPI_G0119
    4964       if(!m_pcSlice->getIsDepth())
    4965 #endif
    4966 #if SEC_SPIVMP_MCP_SIZE_G0077
    4967         if(getPartitionSize(0) == SIZE_2Nx2N)
     4466      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
     4467      {
    49684468          pbSPIVMPFlag[iCount] = true;
    4969 #else
    4970       pbSPIVMPFlag[iCount] = true;
    4971 #endif
     4469      }
    49724470#if H_3D_DBBP
    49734471      pbSPIVMPFlag[iCount] &= !bDBBPFlag;
     
    50994597#endif
    51004598
    5101 #if MTK_DDD_G0063
     4599#if H_3D_DDD
    51024600  // early termination
    51034601  if ( iCount >= getSlice()->getMaxNumMergeCand())
     
    51114609  //////// INTER VIEW DISP COMP (IvDC) ////////
    51124610  /////////////////////////////////////////////
    5113 #if QC_DEPTH_MERGE_SIMP_G0127
    51144611  if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    5115 #else
    5116   if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())
    5117 #endif
    51184612  {
    51194613    assert(iCount < getSlice()->getMaxNumMergeCand());
     
    52764770  //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
    52774771  ////////////////////////////////////////////////////
    5278 #if QC_DEPTH_MERGE_SIMP_G0127
    52794772  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    5280 #else
    5281   if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() )
    5282 #endif
    52834773  {
    52844774    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     
    66456135#endif
    66466136#if H_3D_IV_MERGE
    6647 #if SEC_DEPTH_DV_DERIVAITON_G0074
    66486137Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    6649 #else
    6650 Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    6651 #endif
    6652 {
    6653 #if SEC_DEPTH_DV_DERIVAITON_G0074
     6138{
     6139
    66546140  assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
    66556141
     
    66626148
    66636149  return true;
    6664 #else
    6665   Pel pDepPos[3] = {0, 0, 0};
    6666   assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
    6667   Bool bDepAvail = false;
    6668   Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
    6669   Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
    6670   TComMv cMv;
    6671 
    6672   Int xP, yP, nPSW, nPSH;
    6673   this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
    6674 
    6675   if(xP != 0 && yP != 0)
    6676   {
    6677     pDepPos[0] = pDepth[ (yP-1) * iDepStride + (xP-1) ];
    6678     bDepAvail = true;
    6679   }
    6680 
    6681   if(xP != 0)
    6682   {
    6683     pDepPos[1] = pDepth[ (yP+nPSH-1) * iDepStride + (xP-1) ];
    6684     bDepAvail = true;
    6685   }
    6686 
    6687   if(yP != 0)
    6688   {
    6689     pDepPos[2] = pDepth[ (yP-1) * iDepStride + (xP+nPSW-1) ];
    6690     bDepAvail = true;
    6691   }
    6692 
    6693   if (bDepAvail)
    6694   {
    6695     Pel pAvgDepth = (xP != 0 && yP != 0) ? ((5*pDepPos[0] + 5*pDepPos[1] + 6*pDepPos[2] + 8)>>4) : (xP == 0) ? pDepPos[2] : pDepPos[1];
    6696     Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ pAvgDepth ];
    6697     cMv.setHor(iDisp);
    6698     cMv.setVer(0);
    6699     pDisp->m_acNBDV = cMv;
    6700     pDisp->m_aVIdxCan = 0;
    6701     return true;
    6702   }
    6703   else
    6704   { 
    6705     cMv.setZero();
    6706     pDisp->m_acNBDV = cMv;
    6707     pDisp->m_aVIdxCan = 0;
    6708     return false;
    6709   }
    6710 #endif
    67116150}
    67126151#endif
     
    67256164  // Init disparity struct for results
    67266165  pDInfo->bDV = false;   
    6727 #if MTK_NBDV_IVREF_FIX_G0067
    67286166  pDInfo->m_aVIdxCan = -1;
    6729 #endif
     6167
    67306168  // Init struct for disparities from MCP neighboring blocks
    67316169  IDVInfo cIDVInfo;
     
    72486686{
    72496687  Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId());
    7250 #if QC_SPIVMP_MPI_G0119
    72516688  if( getSlice()->getIsDepth() )
    72526689  {
    72536690    iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size();
    72546691  }
    7255 #endif
     6692
    72566693  iNumSPInOneLine = iPUWidth/iSubPUSize;
    72576694  iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine;
     
    73106747  TComSlice*    pcSlice = getSlice (); 
    73116748  Int iViewIndex        = pDInfo->m_aVIdxCan;
    7312  
     6749
    73136750  //--- get base CU/PU and check prediction mode ---
    73146751  TComPic*    pcBasePic   = pcSlice->getIvPic( bIsDepth, iViewIndex );
     
    73346771
    73356772  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7336  
     6773
    73376774  Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
    73386775#if H_3D_NBDV
     
    73476784  //////////sub-PU IvMC///////////
    73486785  ////////////////////////////////
    7349 #if QC_SPIVMP_MPI_G0119
    73506786  if(!m_pcSlice->getIsDepth())
    73516787  {
    7352 #endif 
    7353 #if SEC_SPIVMP_MCP_SIZE_G0077
    7354   if( getPartitionSize(0) == SIZE_2Nx2N )
    7355   {
    7356 #endif
    7357   Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
    7358   getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
    7359 
    7360   for (Int i=0; i<iNumSP; i++)
    7361   {
    7362     puhInterDirSP[i] = 0;
    7363     pcMvFieldSP[2*i].getMv().set(0, 0);
    7364     pcMvFieldSP[2*i+1].getMv().set(0,0);
    7365     pcMvFieldSP[2*i].setRefIdx(-1);
    7366     pcMvFieldSP[2*i+1].setRefIdx(-1);
    7367   }
    7368 
    7369   Int         iBaseCUAddr;
    7370   Int         iBaseAbsPartIdx;
    7371   TComDataCU* pcBaseCU;
    7372   Int iPartition = 0;
    7373 #if !KHU_SIMP_SPIVMP_G0147
    7374   Int iInterDirLast = 0;
    7375   TComMvField cMvFieldLast[2];
    7376 #endif
    7377 
    7378   Int iDelX = iSPWidth/2;
    7379   Int iDelY = iSPHeight/2;
    7380 
    7381 #if KHU_SIMP_SPIVMP_G0147
    7382   Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
    7383   Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
    7384   Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
    7385 
    7386   if(iWidth == iSPWidth && iHeight == iSPHeight)
    7387   {
    7388     iCenterPosX = iCurrPosX + (iWidth >> 1);
    7389     iCenterPosY = iCurrPosY + (iHeight >> 1);
    7390   }
    7391 
    7392   Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
    7393   Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );
    7394 
    7395   pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
    7396   TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
    7397   if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
    7398   {
    7399     for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
    7400     {
    7401       RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    7402       Bool stopLoop = false;
    7403       for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
    7404       {
    7405         RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7406         TComMvField cDefaultMvField;
    7407         pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
    7408         Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
    7409         if (iDefaultRefIdx >= 0)
    7410         {
    7411           Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
    7412           if (iDefaultRefPOC != pcSlice->getPOC())   
    7413           {
    7414             for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    7415             {
    7416               if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    7417               {
    7418                 abPdmAvailable[ uiCurrRefListId ] = true;
    7419                 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
    7420 #if H_3D_NBDV
    7421 #if H_3D_IV_MERGE
    7422                 if( !bIsDepth )
    7423                 {
    7424 #endif
    7425                   cMv.setIDVFlag   (true);
    7426                   cMv.setIDVHor    (cDv.getHor());                 
    7427                   cMv.setIDVVer    (cDv.getVer()); 
    7428                   cMv.setIDVVId    (iViewIndex);
    7429 #if H_3D_IV_MERGE
    7430                 }
    7431 #endif
    7432 #endif
    7433                 clipMv( cMv );
    7434                 paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
    7435                 pacPdmMv      [ uiCurrRefListId ] = cMv;
    7436                 stopLoop = true;
    7437                 break;
    7438               }
    7439             }
    7440           }
    7441         }
    7442       }
    7443     }
    7444   }
    7445   availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
    7446 
    7447   if(availableMcDc[0])
    7448   {
    7449 #endif
    7450   Int         iBasePosX, iBasePosY;
    7451   for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
    7452   {
    7453     for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
    7454     {
    7455       iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
    7456       iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));
    7457 
    7458       pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
    7459       pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7460       if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    7461       {
    7462         for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     6788    if( getPartitionSize(0) == SIZE_2Nx2N )
     6789    {
     6790      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     6791      getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
     6792
     6793      for (Int i=0; i<iNumSP; i++)
     6794      {
     6795        puhInterDirSP[i] = 0;
     6796        pcMvFieldSP[2*i].getMv().set(0, 0);
     6797        pcMvFieldSP[2*i+1].getMv().set(0,0);
     6798        pcMvFieldSP[2*i].setRefIdx(-1);
     6799        pcMvFieldSP[2*i+1].setRefIdx(-1);
     6800      }
     6801
     6802      Int         iBaseCUAddr;
     6803      Int         iBaseAbsPartIdx;
     6804      TComDataCU* pcBaseCU;
     6805      Int iPartition = 0;
     6806
     6807      Int iDelX = iSPWidth/2;
     6808      Int iDelY = iSPHeight/2;
     6809
     6810      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
     6811      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
     6812      Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
     6813
     6814      if(iWidth == iSPWidth && iHeight == iSPHeight)
     6815      {
     6816        iCenterPosX = iCurrPosX + (iWidth >> 1);
     6817        iCenterPosY = iCurrPosY + (iHeight >> 1);
     6818      }
     6819
     6820      Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     6821      Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );
     6822
     6823      pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
     6824      TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
     6825      if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
     6826      {
     6827        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
    74636828        {
    74646829          RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    7465           Bool bLoop_stop = false;
    7466           for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     6830          Bool stopLoop = false;
     6831          for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
    74676832          {
    7468             RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7469             TComMvField cBaseMvField;
    7470             pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    7471             Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    7472             if (iBaseRefIdx >= 0)
     6833            RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     6834            TComMvField cDefaultMvField;
     6835            pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
     6836            Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     6837            if (iDefaultRefIdx >= 0)
    74736838            {
    7474               Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
    7475               if (iBaseRefPOC != pcSlice->getPOC())   
     6839              Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
     6840              if (iDefaultRefPOC != pcSlice->getPOC())   
    74766841              {
    74776842                for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    74786843                {
    7479                   if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     6844                  if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    74806845                  {
    74816846                    abPdmAvailable[ uiCurrRefListId ] = true;
    7482                     TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    7483 
     6847                    TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
     6848#if H_3D_NBDV
     6849#if H_3D_IV_MERGE
    74846850                    if( !bIsDepth )
    74856851                    {
     6852#endif
    74866853                      cMv.setIDVFlag   (true);
    74876854                      cMv.setIDVHor    (cDv.getHor());                 
    74886855                      cMv.setIDVVer    (cDv.getVer()); 
    74896856                      cMv.setIDVVId    (iViewIndex);
     6857#if H_3D_IV_MERGE
    74906858                    }
    7491 
     6859#endif
     6860#endif
    74926861                    clipMv( cMv );
    7493                     bLoop_stop = true;
    7494 
    7495                     pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
     6862                    paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
     6863                    pacPdmMv      [ uiCurrRefListId ] = cMv;
     6864                    stopLoop = true;
    74966865                    break;
    74976866                  }
     
    75026871        }
    75036872      }
    7504 
    7505       puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
    7506       if (puhInterDirSP[iPartition] == 0)
    7507       {
    7508 #if KHU_SIMP_SPIVMP_G0147
    7509         puhInterDirSP[iPartition] = availableMcDc[0];
    7510         pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
    7511         pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
    7512 #else
    7513         if (iInterDirLast != 0)
     6873      availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
     6874
     6875      if(availableMcDc[0])
     6876      {
     6877
     6878        Int         iBasePosX, iBasePosY;
     6879        for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
    75146880        {
    7515           puhInterDirSP[iPartition] = iInterDirLast;
    7516           pcMvFieldSP[2*iPartition] = cMvFieldLast[0];
    7517           pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1];
    7518         }
    7519 #endif
    7520       }
    7521 #if !KHU_SIMP_SPIVMP_G0147
    7522       else
    7523       {
    7524         if (iInterDirLast ==0)
    7525         {
    7526           availableMcDc[0] = puhInterDirSP[iPartition];
    7527           paiPdmRefIdx  [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx();
    7528           pacPdmMv      [ 0 ] = pcMvFieldSP[2*iPartition].getMv();
    7529           paiPdmRefIdx  [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx();
    7530           pacPdmMv      [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv();
    7531 
    7532           if (iPartition != 0)
     6881          for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
    75336882          {
    7534             for (Int iPart = iPartition-1; iPart >= 0; iPart--)
     6883            iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
     6884            iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));
     6885
     6886            pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
     6887            pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     6888            if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    75356889            {
    7536               puhInterDirSP[iPart] = puhInterDirSP[iPartition];
    7537               pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
    7538               pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
     6890              for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     6891              {
     6892                RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     6893                Bool bLoop_stop = false;
     6894                for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     6895                {
     6896                  RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     6897                  TComMvField cBaseMvField;
     6898                  pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
     6899                  Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
     6900                  if (iBaseRefIdx >= 0)
     6901                  {
     6902                    Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
     6903                    if (iBaseRefPOC != pcSlice->getPOC())   
     6904                    {
     6905                      for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
     6906                      {
     6907                        if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     6908                        {
     6909                          abPdmAvailable[ uiCurrRefListId ] = true;
     6910                          TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
     6911
     6912                          if( !bIsDepth )
     6913                          {
     6914                            cMv.setIDVFlag   (true);
     6915                            cMv.setIDVHor    (cDv.getHor());                 
     6916                            cMv.setIDVVer    (cDv.getVer()); 
     6917                            cMv.setIDVVId    (iViewIndex);
     6918                          }
     6919
     6920                          clipMv( cMv );
     6921                          bLoop_stop = true;
     6922
     6923                          pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
     6924                          break;
     6925                        }
     6926                      }
     6927                    }
     6928                  }
     6929                }
     6930              }
    75396931            }
     6932
     6933            puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
     6934            if (puhInterDirSP[iPartition] == 0)
     6935            {
     6936              puhInterDirSP[iPartition] = availableMcDc[0];
     6937              pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
     6938              pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
     6939
     6940            }
     6941            iPartition ++;
    75406942          }
    75416943        }
    7542         iInterDirLast = puhInterDirSP[iPartition];
    7543         cMvFieldLast[0] = pcMvFieldSP[2*iPartition];
    7544         cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];
    7545       }
    7546 #endif
    7547       iPartition ++;
    7548 
    7549     }
    7550   }
    7551 #if KHU_SIMP_SPIVMP_G0147
    7552   }
    7553 #endif
    7554 #if SEC_SPIVMP_MCP_SIZE_G0077
    7555   }
    7556 #endif
    7557 
    7558   iCurrPosX  += ( iWidth  >> 1 );
    7559   iCurrPosY  += ( iHeight >> 1 );
    7560 #if QC_SPIVMP_MPI_G0119
    7561  }
    7562 #endif
     6944      }
     6945    }
     6946
     6947    iCurrPosX  += ( iWidth  >> 1 );
     6948    iCurrPosY  += ( iHeight >> 1 );
     6949  }
    75636950#endif
    75646951
     
    75686955
    75696956#if H_3D_SPIVMP
    7570 #if QC_SPIVMP_MPI_G0119
    7571  if(m_pcSlice->getIsDepth())
    7572  {
    7573    iCurrPosX  += ( iWidth  >> 1 );
    7574    iCurrPosY  += ( iHeight >> 1 );
    7575  }
    7576 #if QC_DEPTH_MERGE_SIMP_G0127
    7577 #if SEC_SPIVMP_MCP_SIZE_G0077
     6957  if(m_pcSlice->getIsDepth())
     6958  {
     6959    iCurrPosX  += ( iWidth  >> 1 );
     6960    iCurrPosY  += ( iHeight >> 1 );
     6961  }
    75786962  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    75796963#else
    7580  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7581 #endif
    7582 #else
    7583 #if SEC_SPIVMP_MCP_SIZE_G0077
    7584  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < 2; iLoopCan ++)
    7585 #else
    7586  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)
    7587 #endif
    7588 #endif
    7589 #else
    7590 #if SEC_SPIVMP_MCP_SIZE_G0077
    7591  for(Int iLoopCan = (getPartitionSize(uiPartAddr) == SIZE_2Nx2N ? 1 : 0); iLoopCan < 2; iLoopCan ++)
    7592 #else
    7593   for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
    7594 #endif
    7595 #endif
    7596 #else
    75976964  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    75986965#endif
     
    76016968    // iLoopCan == 1 --> IvMCShift
    76026969
    7603 #if !H_3D_SPIVMP || QC_SPIVMP_MPI_G0119
    76046970    Int         iBaseCUAddr;
    76056971    Int         iBaseAbsPartIdx;
    7606 #endif
    76076972
    76086973    Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 );
    76096974    Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
    76106975
    7611 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119
    7612     iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
    7613     iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
    7614 #else
    76156976    Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
    76166977    Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
    7617 #endif
    76186978    pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
    76196979
    7620 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119
    7621     pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7622 #else
    76236980    TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7624 #endif
    76256981    if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    76266982    {
     
    76767032  }
    76777033#if H_3D_SPIVMP
    7678 #if QC_SPIVMP_MPI_G0119
    7679 #if QC_DEPTH_MERGE_SIMP_G0127
    76807034  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    76817035#else
    7682   for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)
    7683 #endif
    7684 #else
    7685   for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
    7686 #endif
    7687 #else
    76887036  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    76897037#endif
     
    76917039    availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0);
    76927040  }
    7693  
    7694  
     7041
     7042
    76957043  ////////////////////////////////
    76967044  /////// IvDC + IvDCShift ///////
    76977045  ////////////////////////////////
    7698 #if QC_DEPTH_MERGE_SIMP_G0127
     7046
    76997047  if( !getSlice()->getIsDepth() )
    77007048  {
    7701 #endif
    7702   for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
    7703   {
    7704     RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
    7705     Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
    7706     for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    7707     {
    7708       if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
    7709       {
    7710         for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7049    for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
     7050    {
     7051      RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
     7052      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
     7053      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
     7054      {
     7055        if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
    77117056        {
    7712           Int ioffsetDV = (iLoopCan == 0) ? 0 : 4;
    7713           abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
    7714           paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
     7057          for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7058          {
     7059            Int ioffsetDV = (iLoopCan == 0) ? 0 : 4;
     7060            abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
     7061            paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
    77157062#if H_3D_NBDV_REF
    7716           TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7717 #endif
    7718           cMv.setHor( cMv.getHor() + ioffsetDV );
     7063            TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     7064#endif
     7065            cMv.setHor( cMv.getHor() + ioffsetDV );
    77197066#if H_3D_IV_MERGE
    7720           if( bIsDepth )
    7721             cMv.setHor((cMv.getHor()+2)>>2);
    7722 #endif
    7723           cMv.setVer( 0 );
    7724           clipMv( cMv );
    7725           pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
     7067            if( bIsDepth )
     7068            {
     7069              cMv.setHor((cMv.getHor()+2)>>2);
     7070            }
     7071#endif
     7072            cMv.setVer( 0 );
     7073            clipMv( cMv );
     7074            pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
     7075          }
     7076          break;
    77267077        }
    7727         break;
    7728       }
    7729     }
    7730   }
    7731   for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    7732   {
    7733     availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 );
    7734   }
    7735 #if QC_DEPTH_MERGE_SIMP_G0127
    7736   }
    7737 #endif
     7078      }
     7079    }
     7080    for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7081    {
     7082      availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 );
     7083    }
     7084  }
    77387085  return false;
    77397086}
     
    78097156#endif
    78107157
    7811 #if NTT_STORE_SPDV_VSP_G0148
     7158#if H_3D_VSP
    78127159Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
    78137160{
     
    79437290
    79447291}
    7945 #endif // NTT_STORE_SPDV_VSP_G0148
     7292#endif
    79467293
    79477294//! \}
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r872 r884  
    192192#if H_3D_DIM_SDC
    193193  Bool*         m_pbSDCFlag;
    194 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
    195   Pel*          m_apSegmentDCOffset[4];
    196 #else
    197194  Pel*          m_apSegmentDCOffset[2];
    198 #endif
    199 #endif
    200 #endif
    201 #if H_3D_INTER_SDC
    202 #if !QC_SDC_UNIFY_G0130
    203   Bool*         m_pbInterSDCFlag;
    204   Int*          m_apSegmentInterDCOffset[4];
    205 #endif
    206 #if !SEC_INTER_SDC_G0101
    207   UChar*        m_pucInterSDCMask;
    208195#endif
    209196#endif
     
    239226#endif
    240227
    241 #if MTK_DDD_G0063
     228#if H_3D_DDD
    242229  UChar*        m_pucDisparityDerivedDepth;
    243230  Bool*         m_pbUseDDD;
     
    280267  Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter );
    281268
    282 #if NTT_STORE_SPDV_VSP_G0148
     269#if H_3D_VSP
    283270  Void xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
    284271#endif
     
    499486#if H_3D
    500487  Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
    501 #if SEC_DEPTH_DV_DERIVAITON_G0074
    502488  Bool          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    503 #else
    504   Bool          getDispNeighBlocks  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    505 #endif
    506489  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
    507490#endif
     
    573556  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    574557  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
    575 #if QC_GENERIC_SDC_G0122
    576558  UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
    577559  UInt          getCtxAngleFlag        ( UInt   uiAbsPartIdx );
    578 #endif
    579 #endif
    580 #endif
    581 #if H_3D_INTER_SDC
    582 #if !QC_SDC_UNIFY_G0130
    583   Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
    584   Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
    585   Void          setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    586   UInt          getCtxInterSDCFlag  ( UInt uiAbsPartIdx );
    587   Int*          getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; }
    588   Int           getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }
    589   Void          setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }
    590 
    591 #endif
    592 #if !SEC_INTER_SDC_G0101
    593   Void          xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );
    594 
    595   UChar*        getInterSDCMask     ()                        { return m_pucInterSDCMask;              }
    596560#endif
    597561#endif
     
    701665  Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;      }
    702666  Void          setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    703 #if NTT_STORE_SPDV_VSP_G0148
    704667  Void          setMvFieldPUForVSP    ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize );
    705 #endif
    706668#endif
    707669  Void          deriveLeftRightTopIdxGeneral  ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
     
    743705  UInt          getCTXARPWFlag                  ( UInt   uiAbsPartIdx                                 );
    744706#endif 
    745 #if !MTK_IC_FLAG_CABAC_SIMP_G0061
    746 #if H_3D_IC
    747   UInt          getCtxICFlag                    ( UInt   uiAbsPartIdx                                 );
    748 #endif
    749 #endif
    750707  UInt          getSliceStartCU         ( UInt pos )                  { return m_sliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
    751708  UInt          getSliceSegmentStartCU  ( UInt pos )                  { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
     
    766723  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
    767724
    768 #if MTK_DDD_G0063
     725#if H_3D_DDD
    769726  UChar*       getDDDepth        ()                        { return m_pucDisparityDerivedDepth;        }
    770727  UChar        getDDDepth        ( UInt uiIdx )            { return m_pucDisparityDerivedDepth[uiIdx]; }
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r872 r884  
    176176  Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
    177177#endif
    178 #if NTT_STORE_SPDV_VSP_G0148
     178#if H_3D_VSP
    179179  Void    setMv         ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; }
    180180  Void    setRefIdx     ( Int iIdx, Int iRefIdx )         { m_piRefIdx[iIdx] = iRefIdx; }
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r872 r884  
    416416
    417417#if H_3D_DIM
    418 Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc
    419 #if QC_GENERIC_SDC_G0122
    420   , TComWedgelet* dmm4Segmentation
    421 #endif
    422   )
     418Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc, TComWedgelet* dmm4Segmentation  )
    423419{
    424420  assert( iWidth == iHeight  );
     
    446442    case( DMM4_IDX ):
    447443      {
    448 #if QC_GENERIC_SDC_G0122
    449444        if( dmm4Segmentation == NULL )
    450445        {
     
    457452          dmmSegmentation = dmm4Segmentation;
    458453        }
    459 #else
    460         dmmSegmentation = new TComWedgelet( iWidth, iHeight );
    461         xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );
    462 #endif
    463454      } break;
    464455    default: assert(0);
     
    511502
    512503#if H_3D_DIM_DMM
    513 #if QC_GENERIC_SDC_G0122
    514504  if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
    515 #else
    516   if( dimType == DMM4_IDX ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
    517 #endif
    518505#endif
    519506}
     
    11031090  pcCU->clipMv(cMv);
    11041091
    1105 #if MTK_DDD_G0063
     1092#if H_3D_DDD
    11061093  if( pcCU->getUseDDD( uiPartAddr ) )
    11071094  {
     
    11821169Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    11831170{
    1184 #if NTT_STORE_SPDV_VSP_G0148
    11851171  Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1;
    11861172
     
    11971183  }
    11981184  xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU );
    1199 
    1200 #else // NTT_STORE_SPDV_VSP_G0148
    1201   // Get depth reference
    1202   Int       depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan;
    1203 #if H_3D_FCO_VSP_DONBDV_E0163
    1204   TComPic* pRefPicBaseDepth = 0;
    1205   Bool     bIsCurrDepthCoded = false;
    1206   pRefPicBaseDepth  = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );
    1207   if ( pRefPicBaseDepth->getPicYuvRec() != NULL  )
    1208   {
    1209     bIsCurrDepthCoded = true;
    1210   }
    1211   else
    1212   {
    1213     pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    1214   }
    1215 #else
    1216   TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    1217 #endif
    1218   assert(pRefPicBaseDepth != NULL);
    1219   TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
    1220   assert(pcBaseViewDepthPicYuv != NULL);
    1221 
    1222   // Get texture reference
    1223   Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );
    1224   assert(iRefIdx >= 0);
    1225   TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx );
    1226   TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec();
    1227   assert(pcBaseViewTxtPicYuv != NULL);
    1228 
    1229   // Initialize LUT according to the reference viewIdx
    1230   Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex();
    1231   Int* pShiftLUT    = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx );
    1232   assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() );
    1233 
    1234   // Do compensation
    1235   TComMv cDv  = pcCU->getDvInfo(uiPartAddr).m_acNBDV;
    1236   pcCU->clipMv(cDv);
    1237 
    1238 #if H_3D_FCO_VSP_DONBDV_E0163
    1239   if ( bIsCurrDepthCoded )
    1240   {
    1241       cDv.setZero();
    1242   }
    1243 #endif
    1244   // fetch virtual depth map
    1245   pcBaseViewDepthPicYuv->extendPicBorder();
    1246 
    1247   Int vspSize=0;
    1248   xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize );
    1249   // sub-PU based compensation
    1250   xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    1251   xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    1252 #endif // NTT_STORE_SPDV_VSP_G0148
    1253 }
    1254 
    1255 #if NTT_STORE_SPDV_VSP_G0148
     1185}
     1186
    12561187Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU )
    12571188{
     
    12781209  }
    12791210}
    1280 #endif // NTT_STORE_SPDV_VSP_G0148
    12811211
    12821212#endif
     
    21332063#endif
    21342064
    2135 #if H_3D_VSP
    2136 #if !(NTT_STORE_SPDV_VSP_G0148)
    2137 // not fully support iRatioTxtPerDepth* != 1
    2138 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
    2139 {
    2140   Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
    2141   Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
    2142 
    2143   Int refDepStride = picRefDepth->getStride();
    2144 
    2145   Int refDepOffset  = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride;
    2146   Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2147 
    2148   if( ratioTxtPerDepthX!=1 || ratioTxtPerDepthY!=1 )
    2149   {
    2150     Int posX, posY;
    2151     refDepth    = picRefDepth->getLumaAddr( );
    2152     cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
    2153     posX /= ratioTxtPerDepthX; // texture position -> depth postion
    2154     posY /= ratioTxtPerDepthY;
    2155     refDepOffset += posX + posY * refDepStride;
    2156 
    2157     width  /= ratioTxtPerDepthX; // texture size -> depth size
    2158     height /= ratioTxtPerDepthY;
    2159   }
    2160 
    2161   refDepth += refDepOffset;
    2162 
    2163   Int depStride = yuvDepth->getStride();
    2164   Pel *depth = yuvDepth->getLumaAddr();
    2165 
    2166   if ((height % 8))
    2167   {
    2168     vspSize = 1; // 8x4
    2169   }
    2170   else if ((width % 8))
    2171   {
    2172     vspSize = 0; // 4x8
    2173   }
    2174   else
    2175   {
    2176     Bool ULvsBR, URvsBL;
    2177     ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
    2178     URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
    2179     vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
    2180   }
    2181   Int subBlockW, subBlockH;
    2182   Int depStrideTmp = depStride * nTxtPerDepthY;
    2183   if (vspSize)
    2184   {
    2185     subBlockW = 8;
    2186     subBlockH = 4;
    2187   }
    2188   else
    2189   {
    2190     subBlockW = 4;
    2191     subBlockH = 8;
    2192   }
    2193   for( Int y=0; y<height; y+=subBlockH )
    2194   {
    2195     Pel *refDepthTmp[4];
    2196     refDepthTmp[0] = refDepth + refDepStride * y;
    2197     refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
    2198     refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
    2199     refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
    2200     for( Int x=0; x<width; x+=subBlockW )
    2201     {
    2202       Pel  maxDepthVal;
    2203       maxDepthVal = refDepthTmp[0][x];
    2204       maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
    2205       maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
    2206       maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
    2207       Pel *depthTmp = &depth[x+y*depStride];
    2208       for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
    2209       {
    2210         for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
    2211         {
    2212           depthTmp[sX] = maxDepthVal;
    2213         }
    2214         depthTmp += depStrideTmp;
    2215       }
    2216     }
    2217   }   
    2218 }
    2219 
    2220 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)
    2221 {
    2222   Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
    2223   Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
    2224  
    2225   nTxtPerDepthX = nTxtPerDepthX << vspSize;
    2226   nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2227 
    2228   Int refStride = picRef->getStride();
    2229   Int dstStride = yuvDst->getStride();
    2230   Int depStride = yuvDepth->getStride();
    2231   Int refStrideBlock = refStride  * nTxtPerDepthY;
    2232   Int dstStrideBlock = dstStride * nTxtPerDepthY;
    2233   Int depStrideBlock = depStride * nTxtPerDepthY;
    2234 
    2235   Pel *ref    = picRef->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2236   Pel *dst    = yuvDst->getLumaAddr(partAddr);
    2237   Pel *depth  = yuvDepth->getLumaAddr();
    2238 
    2239 #if H_3D_VSP_BLOCKSIZE == 1
    2240 #if H_3D_VSP_CONSTRAINED
    2241   //get LUT based horizontal reference range
    2242   Int range = xGetConstrainedSize(width, height);
    2243 
    2244   // The minimum depth value
    2245   Int minRelativePos = MAX_INT;
    2246   Int maxRelativePos = MIN_INT;
    2247 
    2248   Pel* depthTemp, *depthInitial=depth;
    2249   for (Int yTxt = 0; yTxt < height; yTxt++)
    2250   {
    2251     for (Int xTxt = 0; xTxt < width; xTxt++)
    2252     {
    2253       if (depthPosX+xTxt < widthDepth)
    2254       {
    2255         depthTemp = depthInitial + xTxt;
    2256       }
    2257       else
    2258       {
    2259         depthTemp = depthInitial + (widthDepth - depthPosX - 1);
    2260       }
    2261 
    2262       Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec;
    2263       Int disparityInt = disparity >> 2;
    2264 
    2265       if( disparity <= 0)
    2266       {
    2267         if (minRelativePos > disparityInt+xTxt)
    2268         {
    2269           minRelativePos = disparityInt+xTxt;
    2270         }
    2271       }
    2272       else
    2273       {
    2274         if (maxRelativePos < disparityInt+xTxt)
    2275         {
    2276           maxRelativePos = disparityInt+xTxt;
    2277         }
    2278       }
    2279     }
    2280     if (depthPosY+yTxt < heightDepth)
    2281     {
    2282       depthInitial = depthInitial + depStride;
    2283     }
    2284   }
    2285 
    2286   Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec;
    2287   if (disparity_tmp <= 0)
    2288   {
    2289     maxRelativePos = minRelativePos + range -1 ;
    2290   }
    2291   else
    2292   {
    2293     minRelativePos = maxRelativePos - range +1 ;
    2294   }
    2295 #endif
    2296 #endif // H_3D_VSP_BLOCKSIZE == 1
    2297 
    2298   TComMv dv(0, 0);
    2299 
    2300   for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
    2301   {
    2302     for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
    2303     {
    2304       Pel repDepth = depth[ xTxt ];
    2305       assert( repDepth >= 0 && repDepth <= 255 );
    2306 
    2307       Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ??
    2308       Int xFrac = disparity & 0x3;
    2309 
    2310       dv.setHor( disparity );
    2311       cu->clipMv( dv );
    2312 
    2313       Int refOffset = xTxt + (dv.getHor() >> 2);
    2314      
    2315 #if H_3D_VSP_CONSTRAINED
    2316       if(refOffset<minRelativePos || refOffset>maxRelativePos)
    2317       {
    2318         xFrac = 0;
    2319       }
    2320       refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
    2321 #endif
    2322 
    2323       assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
    2324       m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
    2325     }
    2326     ref   += refStrideBlock;
    2327     dst   += dstStrideBlock;
    2328     depth += depStrideBlock;
    2329   }
    2330 
    2331 }
    2332 
    2333 Void TComPrediction::xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)
    2334 {
    2335 #if (H_3D_VSP_BLOCKSIZE==1)
    2336   Int nTxtPerDepthX = 1;
    2337   Int nTxtPerDepthY = 1;
    2338 #else
    2339   Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;
    2340   Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;
    2341 #endif
    2342 
    2343   nTxtPerDepthX = nTxtPerDepthX << vspSize;
    2344   nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2345 
    2346   Int refStride = picRef->getCStride();
    2347   Int dstStride = yuvDst->getCStride();
    2348   Int depStride = yuvDepth->getStride();
    2349   Int refStrideBlock = refStride * nTxtPerDepthY;
    2350   Int dstStrideBlock = dstStride * nTxtPerDepthY;
    2351   Int depStrideBlock = depStride * (nTxtPerDepthY<<1);
    2352 
    2353   Pel *refCb  = picRef->getCbAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2354   Pel *refCr  = picRef->getCrAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2355   Pel *dstCb  = yuvDst->getCbAddr(partAddr);
    2356   Pel *dstCr  = yuvDst->getCrAddr(partAddr);
    2357   Pel *depth  = yuvDepth->getLumaAddr();
    2358 
    2359 #if H_3D_VSP_BLOCKSIZE == 1
    2360 #if H_3D_VSP_CONSTRAINED
    2361   //get LUT based horizontal reference range
    2362   Int range = xGetConstrainedSize(width, height, false);
    2363 
    2364   // The minimum depth value
    2365   Int minRelativePos = MAX_INT;
    2366   Int maxRelativePos = MIN_INT;
    2367 
    2368   Int depthTmp;
    2369   for (Int yTxt=0; yTxt<height; yTxt++)
    2370   {
    2371     for (Int xTxt=0; xTxt<width; xTxt++)
    2372     {
    2373       depthTmp = m_pDepthBlock[xTxt+yTxt*width];
    2374       Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec;
    2375       Int disparityInt = disparity >> 3;//in chroma resolution
    2376 
    2377       if (disparityInt < 0)
    2378       {
    2379         if (minRelativePos > disparityInt+xTxt)
    2380         {
    2381           minRelativePos = disparityInt+xTxt;
    2382         }
    2383       }
    2384       else
    2385       {
    2386         if (maxRelativePos < disparityInt+xTxt)
    2387         {
    2388           maxRelativePos = disparityInt+xTxt;
    2389         }
    2390       }
    2391     }
    2392   }
    2393 
    2394   depthTmp = m_pDepthBlock[0];
    2395   Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec;
    2396   if ( disparity_tmp < 0 )
    2397   {
    2398     maxRelativePos = minRelativePos + range - 1;
    2399   }
    2400   else
    2401   {
    2402     minRelativePos = maxRelativePos - range + 1;
    2403   }
    2404 
    2405 #endif // H_3D_VSP_CONSTRAINED
    2406 #endif // H_3D_VSP_BLOCKSIZE == 1
    2407 
    2408   TComMv dv(0, 0);
    2409   // luma size -> chroma size
    2410   height >>= 1;
    2411   width  >>= 1;
    2412 
    2413   for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
    2414   {
    2415     for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
    2416     {
    2417       Pel repDepth = depth[ xTxt<<1 ];
    2418       assert( repDepth >= 0 && repDepth <= 255 );
    2419 
    2420       Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec;
    2421       Int xFrac = disparity & 0x7;
    2422      
    2423       dv.setHor( disparity );
    2424       cu->clipMv( dv );
    2425 
    2426       Int refOffset = xTxt + (dv.getHor() >> 3);
    2427 
    2428 #if H_3D_VSP_CONSTRAINED
    2429       if(refOffset<minRelativePos || refOffset>maxRelativePos)
    2430       {
    2431         xFrac = 0;
    2432       }
    2433       refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
    2434 #endif
    2435 
    2436       assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );
    2437       assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );
    2438 
    2439       m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
    2440       m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
    2441     }
    2442     refCb += refStrideBlock;
    2443     refCr += refStrideBlock;
    2444     dstCb += dstStrideBlock;
    2445     dstCr += dstStrideBlock;
    2446     depth += depStrideBlock;
    2447   }
    2448 }
    2449 #endif
    2450 
    2451 #if H_3D_VSP_CONSTRAINED
    2452 Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma)
    2453 {
    2454   Int iSize = 0;
    2455   if (bLuma)
    2456   {
    2457     Int iArea = (nPbW+7) * (nPbH+7);
    2458     Int iAlpha = iArea / nPbH - nPbW - 7;
    2459     iSize = iAlpha + nPbW;
    2460   }
    2461   else // chroma
    2462   {
    2463     Int iArea = (nPbW+2) * (nPbH+2);
    2464     Int iAlpha = iArea / nPbH - nPbW - 4;
    2465     iSize = iAlpha + nPbW;
    2466   }
    2467   return iSize;
    2468 }
    2469 #endif // H_3D_VSP_CONSTRAINED
    2470 
    2471 #endif // H_3D_VSP
    2472 
    24732065#if H_3D_DIM
    24742066Void TComPrediction::xPredBiSegDCs( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 )
     
    24852077  if( bL == bT )
    24862078  {
    2487 #if SCU_HS_DEPTH_DC_PRED_G0143
    24882079    const Int  iTRR = ( patternStride * 2 - 1  ) - srcStride;
    24892080    const Int  iLBB = ( patternStride * 2 - 1  ) * srcStride - 1;
    24902081    refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : (abs(ptrSrc[iTRR] - ptrSrc[-(Int)srcStride]) > abs(ptrSrc[iLBB] - ptrSrc[ -1]) ? ptrSrc[iTRR] : ptrSrc[iLBB]);
    2491 #else
    2492     refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : 1<<( g_bitDepthY - 1 );
    2493 #endif
    24942082    refDC2 =      ( ptrSrc[ -1] + ptrSrc[-(Int)srcStride] )>>1;
    24952083  }
     
    25932181  Int iSumPix[2];
    25942182  memset(iSumPix, 0, sizeof(Int)*2);
    2595 #if QC_GENERIC_SDC_G0122
    25962183  for( Int i = 0; i < uiNumSegments; i++ )
    25972184  {
    25982185    rpSegMeans[i] = 0;
    25992186  }
    2600 #endif
    26012187  if (orgDC == false)
    26022188  {
     
    26132199      rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ];
    26142200    }
    2615 #if QC_GENERIC_SDC_G0122
    26162201    else if( getDimType( uiIntraMode ) == DMM4_IDX )
    26172202    {
     
    26472232    }
    26482233    else
    2649 #else
    2650     else if (uiIntraMode == PLANAR_IDX)
    2651 #endif
    26522234    {
    26532235      Pel* pLeftTop = pOrig;
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r872 r884  
    8080
    8181#if H_3D_VSP
    82   Int*   m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
    83 #if H_3D_VSP_CONSTRAINED
    84   Int  xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true);
    85 #endif
    86   TComYuv   m_cYuvDepthOnVsp;
     82  Int*    m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
     83  TComYuv m_cYuvDepthOnVsp;
    8784#endif
    8885
     
    121118
    122119#if H_3D_VSP
    123 #if NTT_STORE_SPDV_VSP_G0148
    124120  Void xPredInterUniSubPU        ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 );
    125 #else
    126   Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 );
    127   Void xPredInterLumaBlkFromDM    ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
    128   Void xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
    129 #endif
    130121#endif
    131122
     
    172163  // Depth intra
    173164  Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false
    174 #if QC_GENERIC_SDC_G0122
    175165    , TComWedgelet* dmm4Segmentation = NULL
    176 #endif
    177166    );
    178167#if H_3D_DIM_SDC
  • trunk/source/Lib/TLibCommon/TComRdCost.cpp

    r872 r884  
    599599  cDtParam.uiComp       = 255;    // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed.
    600600
    601 #if SCU_HS_VSD_BUGFIX_IMPROV_G0163
    602601  cDtParam.bitDepth   = g_bitDepthY;
    603 #endif
     602
    604603  Dist dist = cDtParam.DistFunc( &cDtParam );
    605604
     
    29852984  dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff;
    29862985
    2987 #if SCU_HS_VSD_BUGFIX_IMPROV_G0163
    29882986  Double dDepthWeight = ( pOrg[x] >=  ( (1<<(g_bitDepthY - 3)) + (1<<(g_bitDepthY - 2)) ) ? 4 : pOrg[x] > ((1<<g_bitDepthY) >> 4) ? (Float)(pOrg[x] - ((1<<g_bitDepthY) >> 4))/(Float)((1<<g_bitDepthY) >> 3) + 1 : 1.0 );
    29892987  Double dTemp = ( 0.5 * fabs(dD) * dDepthWeight * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) );
    2990 #else
    2991   Double dTemp = ( 0.5 * fabs(dD) * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) );
    2992 #endif 
    29932988  iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5));
    29942989
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r872 r884  
    112112, m_interLayerPredEnabledFlag     (false)
    113113, m_numInterLayerRefPicsMinus1    (0)
    114 #if H_MV_HLS_7_POC_P0041
     114#if H_MV
    115115, m_sliceSegmentHeaderExtensionLength (0)
    116116, m_pocResetIdc                       (0)
     
    12841284
    12851285
    1286 
    12871286/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    12881287*/
     
    13401339
    13411340    }
    1342 #if H_MV_HLS_7_MISC_P0130_20
     1341#if H_MV
    13431342    if( isReference ) // Current picture is in the temporal RPS
    13441343    {
     
    17271726    }
    17281727  }
    1729 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1730   m_vpsNumberLayerSetsMinus1     = -1;
    1731 #endif
    17321728  m_vpsNumProfileTierLevelMinus1 = -1;
    17331729   
    1734 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1735   for ( Int i = 0; i < MAX_VPS_PROFILE_TIER_LEVEL; i++)
    1736   {
    1737 #if !H_MV_HLS_7_VPS_P0048_14
    1738     m_profileRefMinus1[ i ] = -1;
    1739 #endif
    1740   }
    1741    
    1742   m_moreOutputLayerSetsThanDefaultFlag = false;   
    1743   m_numAddOutputLayerSetsMinus1        = -1;   
    1744   m_defaultOneTargetOutputLayerIdc     = 0;
    1745 #else
    17461730  m_numAddOutputLayerSets              = -1;   
    17471731  m_defaultTargetOutputLayerIdc     = 0;
    1748 #endif
    17491732 
    17501733  for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++)
     
    17561739      m_outputLayerFlag[i][j] = false;
    17571740    }
    1758 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    17591741    m_altOutputLayerFlag[ i ]       = false;
    1760 #endif
    1761   }
    1762 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1763   m_altOutputLayerFlag       = false;
    1764 #endif
     1742  }
    17651743  m_maxOneActiveRefLayerFlag = false;
    17661744  m_directDepTypeLenMinus2   = 0;         
     
    17681746
    17691747  m_avcBaseLayerFlag = false;
    1770 #if H_MV_HLS_7_VPS_P0307_23
    17711748  m_vpsNonVuiExtensionLength = 0;
    1772 #else
    1773   m_vpsVuiOffset     = 0;
    1774 #endif
    17751749  m_splittingFlag    = false;
    17761750 
     
    17861760  {
    17871761    m_vpsProfilePresentFlag   [i] = false;
    1788 #if !H_MV_HLS_7_VPS_P0048_14
    1789     m_profileRefMinus1[i] = 0;
    1790 #endif
    17911762    m_outputLayerSetIdxMinus1       [i] = 0;
    17921763    for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ )
     
    20992070Int    TComVPS::getNumOutputLayerSets()
    21002071{
    2101 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    21022072  return getNumAddOutputLayerSets() + getVpsNumLayerSetsMinus1() + 1;
    2103 #else
    2104   Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1;
    2105   if ( getMoreOutputLayerSetsThanDefaultFlag( ) )
    2106   {     
    2107     numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1);
    2108 }
    2109   return numOutputLayerSets;
    2110 #endif
    21112073}
    21122074
     
    21562118}
    21572119
    2158 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    21592120Void TComVPS::initTargetLayerIdLists()
    21602121{
     
    21762137  } 
    21772138}
    2178 #else
    2179 Void TComVPS::deriveTargetLayerIdLists()
    2180 {
    2181   m_targetDecLayerIdLists.resize( getNumOutputLayerSets() );
    2182   m_targetOptLayerIdLists.resize( getNumOutputLayerSets() );
    2183 
    2184   for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ )
    2185   {
    2186     Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1;     
    2187     Int lsIdx                = targetDecLayerSetIdx;
    2188 
    2189     for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
    2190     {
    2191       m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
    2192       if( getOutputLayerFlag( targetOptLayerSetIdx, j  )) // This seems to be wrong in draft text
    2193       {
    2194         m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
    2195       }
    2196     } 
    2197   }
    2198 }
    2199 #endif
     2139
     2140Bool TComVPS::inferOutputLayerFlag( Int i, Int j )
     2141{
     2142  Bool outputLayerFlag;
     2143  switch ( getDefaultTargetOutputLayerIdc( ) )
     2144  {
     2145  case 0:
     2146    outputLayerFlag = true;
     2147    break;
     2148  case 1:
     2149    outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 ); 
     2150    break;
     2151  case 2:
     2152    if ( i == 0 && j == 0)
     2153    {     
     2154      outputLayerFlag = true;  // This is a software only fix for a bug in the spec. In spec outputLayerFlag is neither present nor inferred.
     2155    }
     2156    else
     2157    {
     2158      assert( 0 );
     2159    }
     2160    break;
     2161  default:     
     2162    assert( 0 );
     2163    break;
     2164  }
     2165  return outputLayerFlag;
     2166}
     2167
     2168Int TComVPS::getMaxSubLayersInLayerSetMinus1( Int i )
     2169{
     2170  Int maxSLMinus1 = 0;
     2171  Int optLsIdx    = getLayerSetIdxForOutputLayerSet( i );
     2172  for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
     2173  {
     2174    Int lId = m_layerSetLayerIdList[optLsIdx][k];
     2175    maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
     2176  }
     2177  return maxSLMinus1;
     2178}
    22002179
    22012180#endif // H_MV
     
    24452424, m_ppsInferScalingListFlag(false)
    24462425, m_ppsScalingListRefLayerId(0)
    2447 #if H_MV_HLS_7_POC_P0041
    24482426, m_pocResetInfoPresentFlag(false)
    2449 #endif
    24502427#if H_3D
    24512428, m_pcDLT(NULL)
     
    24552432  m_scalingList = new TComScalingList;
    24562433
    2457 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION 
     2434#if H_MV
    24582435  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
    24592436  {
     
    24612438  }
    24622439#endif
    2463 
    24642440}
    24652441
     
    29802956    // Consider to check here:
    29812957    // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer0 and RefPicSetInterLayer1 that is a RASL picture. "   
    2982 #if H_MV_HLS_7_MISC_P0130_20
    29832958    assert( picRef->getSlice(0)->getDiscardableFlag() == false ); // "There shall be no picture that has discardable_flag equal to 1 in RefPicSetInterLayer0 or RefPicSetInterLayer1".       
    2984 #endif
    29852959  }
    29862960}
     
    30182992    {
    30192993      break;
    3020   }       
     2994    }       
    30212995  }       
    30222996
     
    30283002      if ( pcPic )
    30293003      {
    3030       if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    3031       {
    3032         Bool remainingInterLayerReferencesFlag = false;
    3033         for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
     3004        if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    30343005        {
    3035           TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();
    3036           if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
     3006          Bool remainingInterLayerReferencesFlag = false;
     3007          for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
     3008          {
     3009            TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();
     3010            if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
     3011            {
     3012              for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
     3013              {
     3014                if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
     3015                {
     3016                  remainingInterLayerReferencesFlag = true;
     3017                }
     3018              }
     3019            }
     3020          }
     3021          if( !remainingInterLayerReferencesFlag )
    30373022          {
    3038             for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
    3039             {
    3040               if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
    3041               {
    3042                 remainingInterLayerReferencesFlag = true;
     3023            pcPic->getSlice(0)->setReferenced( false );                   
    30433024          }
    30443025        }
    3045           }
    3046         }
    3047         if( !remainingInterLayerReferencesFlag )
    3048         {
    3049           pcPic->getSlice(0)->setReferenced( false );                   
    3050       }
    3051     }
    3052       }
    3053   }
    3054 }
     3026      }
     3027    }
     3028  }
    30553029}
    30563030
     
    31573131  Int numActiveRefLayerPics;
    31583132
    3159 #if H_MV_HLS_7_MISC_P0079_18
    31603133  if( getLayerId() == 0 || getNumRefLayerPics() ==  0 )
    3161 #else
    3162   if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) ==  0 )
    3163 #endif
    31643134  {
    31653135    numActiveRefLayerPics = 0;
     
    31753145  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
    31763146  {
    3177 #if H_MV_HLS_7_MISC_P0079_18
    31783147    numActiveRefLayerPics = 1;
    3179 #else
    3180     numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0;
    3181 #endif
    31823148  }
    31833149  else
     
    32073173    for ( Int refListIdx = 0; refListIdx < ((m_eSliceType==B_SLICE) ? 2 : 1); refListIdx++ )
    32083174    {
    3209 #if MTK_ARP_REF_SELECTION_G0053
    32103175      Int diffPOC=MAX_INT;
    32113176      Int idx=-1;
    3212 #endif
    32133177      for(Int i = 0; i < getNumRefIdx(RefPicList(refListIdx)); i++ )
    32143178      {
    32153179        if ( getRefPic(RefPicList(refListIdx), i)->getPOC() != getPOC() )
    32163180        {
    3217 #if MTK_ARP_REF_SELECTION_G0053
    32183181          if( abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC()) < diffPOC)
    32193182          {
     
    32213184            idx=i;
    32223185          }
    3223 #else
    3224           setFirstTRefIdx (RefPicList(refListIdx), i);
    3225           break;
    3226 #endif
    32273186        }
    3228 #if MTK_ARP_REF_SELECTION_G0053
    32293187        if(idx>=0)
    32303188        {
    32313189          setFirstTRefIdx (RefPicList(refListIdx), idx);
    32323190        }
    3233 #endif
    32343191      }
    32353192    }
     
    33683325#endif
    33693326
    3370 #if MTK_DDD_G0063
     3327#if H_3D_DDD
    33713328  if( getIsDepth() && getViewIndex() > 0 )
    33723329  {
     
    34263383    }
    34273384
    3428 #if MTK_DDD_G0063
     3385#if H_3D_DDD
    34293386    InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
    34303387#endif
     
    34343391#endif
    34353392
    3436 #if MTK_DDD_G0063
     3393#if H_3D_DDD
    34373394Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
    34383395{
     
    38373794{
    38383795  m_crossLayerIrapAlignedFlag = true;
    3839 #if H_MV_HLS_7_MISC_P0068_21
    38403796  m_allLayersIdrAlignedFlag   = false;
    3841 #endif
    38423797  m_bitRatePresentVpsFlag = false;
    38433798  m_picRatePresentVpsFlag = false;
     
    38663821      m_minHorizontalCtuOffsetPlus1 [i][j] = -1;
    38673822    }
    3868 #if H_MV_HLS_7_MISC_P0182_13
    38693823    m_baseLayerParameterSetCompatibilityFlag[i] = false;
    3870 #endif
    38713824  }
    38723825  for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
     
    38893842  if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters;
    38903843  m_vpsVuiBspHrdParameters = NULL;
     3844}
     3845
     3846Void TComVPSVUI::inferVpsVui( Bool encoderFlag )
     3847{
     3848  // inference of syntax elements that differ from default inference (as done in constructor), when VPS VUI is not present
     3849  if (!encoderFlag )
     3850  {
     3851    setCrossLayerIrapAlignedFlag( false );
     3852  }
     3853  else
     3854  {
     3855    assert( !getCrossLayerIrapAlignedFlag() );
     3856  }
    38913857}
    38923858
     
    39553921  setMatrixCoefficients     ( videoSignalInfo->getMatrixCoeffsVps           () );
    39563922}
    3957 #endif
     3923
     3924TComDpbSize::TComDpbSize()
     3925{
     3926  for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ )
     3927  {     
     3928    m_subLayerFlagInfoPresentFlag[i]  = false;
     3929
     3930    for (Int j = 0; j < MAX_TLAYER; j++  )
     3931    {       
     3932      m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ;
     3933      m_maxVpsNumReorderPics       [i][j] = 0;
     3934      m_maxVpsLatencyIncreasePlus1 [i][j] = 0;
     3935
     3936      for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
     3937      {
     3938        m_maxVpsDecPicBufferingMinus1[i][k][j] = 0;
     3939      }
     3940    }
     3941  }
     3942}
     3943#endif
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r872 r884  
    473473  Bool m_crossLayerPicTypeAlignedFlag;
    474474  Bool m_crossLayerIrapAlignedFlag;
    475 #if H_MV_HLS_7_MISC_P0068_21
    476475  Bool m_allLayersIdrAlignedFlag;
    477 #endif
    478476  Bool m_bitRatePresentVpsFlag;
    479477  Bool m_picRatePresentVpsFlag;
     
    484482  Int  m_constantPicRateIdc          [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER];
    485483  Int  m_avgPicRate                  [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER];
    486 #if H_MV_HLS_7_VPS_P0076_15
    487484  Bool m_videoSignalInfoIdxPresentFlag;
    488485  Int  m_vpsNumVideoSignalInfoMinus1;
    489486  TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO];   
    490487  Int  m_vpsVideoSignalInfoIdx       [MAX_NUM_VIDEO_SIGNAL_INFO];
    491 #endif
    492488  Bool m_tilesNotInUseFlag;
    493489  Bool m_tilesInUseFlag              [MAX_NUM_LAYERS];
     
    500496  Bool m_ctuBasedOffsetEnabledFlag   [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    501497  Int  m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    502 #if !H_MV_HLS_7_VPS_P0076_15
    503   Bool m_videoSignalInfoIdxPresentFlag;
    504   Int  m_vpsNumVideoSignalInfoMinus1;
    505   TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO];   
    506   Int  m_vpsVideoSignalInfoIdx       [MAX_NUM_VIDEO_SIGNAL_INFO];
    507 #endif
    508498  Bool m_vpsVuiBspHrdPresentFlag;
    509499  TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters;
    510 #if H_MV_HLS_7_MISC_P0182_13
    511500  Bool m_baseLayerParameterSetCompatibilityFlag[MAX_NUM_LAYERS];
    512 #endif
    513501
    514502public:
     
    521509  Bool getCrossLayerIrapAlignedFlag(  ) { return m_crossLayerIrapAlignedFlag; }
    522510
    523 #if H_MV_HLS_7_MISC_P0068_21
    524511  Void setAllLayersIdrAlignedFlag( Bool flag ) { m_allLayersIdrAlignedFlag = flag; }
    525512  Bool getAllLayersIdrAlignedFlag(  ) { return m_allLayersIdrAlignedFlag; }
    526 #endif
    527513
    528514  Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; }
     
    550536  Int  getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; }
    551537
    552 #if H_MV_HLS_7_VPS_P0076_15
    553538  Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; }
    554539  Bool getVideoSignalInfoIdxPresentFlag(  ) { return m_videoSignalInfoIdxPresentFlag; }
     
    562547  Void setVpsVideoSignalInfoIdx( Int i, Int  val ) { m_vpsVideoSignalInfoIdx[i] = val; }
    563548  Int  getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; }
    564 #endif
    565549
    566550  Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; }
     
    593577  Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int  val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; }
    594578  Int  getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; }
    595 #if !H_MV_HLS_7_VPS_P0076_15
    596   Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; }
    597   Bool getVideoSignalInfoIdxPresentFlag(  ) { return m_videoSignalInfoIdxPresentFlag; }
    598 
    599   Void    setVideoSignalInfo( Int i, TComVideoSignalInfo* val )                        { m_videoSignalInfo[i] = val;  } 
    600   TComVideoSignalInfo* getVideoSignalInfo( Int i )                                     { return m_videoSignalInfo[i]; }
    601 
    602   Void setVpsNumVideoSignalInfoMinus1( Int  val ) { m_vpsNumVideoSignalInfoMinus1 = val; }
    603   Int  getVpsNumVideoSignalInfoMinus1(  ) { return m_vpsNumVideoSignalInfoMinus1; }
    604 
    605   Void setVpsVideoSignalInfoIdx( Int i, Int  val ) { m_vpsVideoSignalInfoIdx[i] = val; }
    606   Int  getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; }
    607 #endif
     579
    608580  Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; }
    609581  Bool getVpsVuiBspHrdPresentFlag(  ) { return m_vpsVuiBspHrdPresentFlag; }
     
    612584  TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters(  ) { return m_vpsVuiBspHrdParameters; }
    613585
    614 #if H_MV_HLS_7_MISC_P0182_13
    615586  Void setBaseLayerParameterSetCompatibilityFlag( Int i, Bool flag ) { m_baseLayerParameterSetCompatibilityFlag[i] = flag; }
    616587  Bool getBaseLayerParameterSetCompatibilityFlag( Int i ) { return m_baseLayerParameterSetCompatibilityFlag[i]; }
    617 #endif
    618 
    619 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
    620   Void inferVpsVui( Bool encoderFlag )
    621   {
    622     // inference of syntax elements that differ from default inference (as done in constructor), when VPS VUI is not present
    623     if (!encoderFlag )
    624     {
    625       setCrossLayerIrapAlignedFlag( false );
    626     }
    627     else
    628     {
    629       assert( !getCrossLayerIrapAlignedFlag() );
    630     }
    631 
    632   }
    633 #endif
     588
     589  Void inferVpsVui( Bool encoderFlag );
    634590};
    635591
     
    686642
    687643public:
    688   TComDpbSize( )
    689   {
    690     for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ )
    691     {     
    692       m_subLayerFlagInfoPresentFlag[i]  = false;
    693 
    694       for (Int j = 0; j < MAX_TLAYER; j++  )
    695       {       
    696         m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ;
    697         m_maxVpsNumReorderPics       [i][j] = 0;
    698         m_maxVpsLatencyIncreasePlus1 [i][j] = 0;
    699 
    700         for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
    701         {
    702           m_maxVpsDecPicBufferingMinus1[i][k][j] = 0;
    703         }
    704       }
    705     } 
    706   } 
     644  TComDpbSize( ); 
    707645
    708646  Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; }
     
    768706  /// VPS EXTENSION SYNTAX ELEMENTS
    769707  Bool        m_avcBaseLayerFlag;
    770 #if H_MV_HLS_7_VPS_P0307_23
    771708  Int         m_vpsNonVuiExtensionLength;
    772 #else
    773   Int         m_vpsVuiOffset;
    774 #endif
    775709  Bool        m_splittingFlag;
    776710  Bool        m_scalabilityMaskFlag          [MAX_NUM_SCALABILITY_TYPES];
     
    788722  Int         m_maxTidIlRefPicsPlus1     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    789723  Bool        m_allRefLayersActiveFlag;
    790 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    791   Int         m_vpsNumberLayerSetsMinus1;
    792 #endif
    793724  Int         m_vpsNumProfileTierLevelMinus1;   
    794725  Bool        m_vpsProfilePresentFlag    [MAX_VPS_OP_SETS_PLUS1];
    795726
    796 #if !H_MV_HLS_7_VPS_P0048_14
    797   Int         m_profileRefMinus1         [MAX_VPS_PROFILE_TIER_LEVEL];
    798 #endif
    799 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    800727  Int         m_numAddOutputLayerSets;   
    801728  Int         m_defaultTargetOutputLayerIdc;
    802 #else 
    803   Bool        m_moreOutputLayerSetsThanDefaultFlag;
    804   Int         m_numAddOutputLayerSetsMinus1;   
    805   Int         m_defaultOneTargetOutputLayerIdc;
    806 #endif
    807729
    808730  Int         m_outputLayerSetIdxMinus1  [MAX_VPS_OUTPUTLAYER_SETS]; 
    809731  Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
    810732  Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
    811 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    812733  Bool        m_altOutputLayerFlag       [MAX_VPS_OUTPUTLAYER_SETS];
    813 #else
    814   Bool        m_altOutputLayerFlag;
    815 #endif
    816734  Bool        m_repFormatIdxPresentFlag;
    817735  Int         m_vpsNumRepFormatsMinus1;
     
    869787#if H_3D_SPIVMP
    870788  Int         m_iSubPULog2Size           [MAX_NUM_LAYERS   ];
    871 #endif
    872 #endif
    873 #if QC_SPIVMP_MPI_G0119
    874789  Int         m_iSubPUMPILog2Size;
     790#endif
    875791#endif
    876792#if H_3D_VSP
     
    974890  Bool    getAvcBaseLayerFlag()                                            { return m_avcBaseLayerFlag; }
    975891
    976 #if H_MV_HLS_7_VPS_P0307_23
    977892  Void    setVpsNonVuiExtensionLength( Int  val )                          { m_vpsNonVuiExtensionLength = val; }
    978893  Int     getVpsNonVuiExtensionLength(  )                                  { return m_vpsNonVuiExtensionLength; }
    979 #else
    980   Void    setVpsVuiOffset( Int  val )                                      { m_vpsVuiOffset = val; }
    981   Int     getVpsVuiOffset(  )                                              { return m_vpsVuiOffset; }
    982 #endif
    983894
    984895  Void    setSplittingFlag( Bool val )                                     { m_splittingFlag = val;  }
     
    988899  Void    setScalabilityMaskFlag( Int scalType, Bool val )                     { m_scalabilityMaskFlag[scalType] = val;  }
    989900  Bool    getScalabilityMaskFlag( Int scalType )                               { return m_scalabilityMaskFlag[scalType]; }
     901 
    990902  Int     getNumScalabilityTypes( );
    991903
     
    1009921  Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; }
    1010922  Int     getViewIdVal( Int viewOrderIndex )                               { return m_viewIdVal[viewOrderIndex]; }
     923 
    1011924  Void    setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val;  }
    1012925  Bool    getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps )           { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; }
     926 
    1013927  Void    setVpsSubLayersMaxMinus1PresentFlag( Bool flag )                 { m_vpsSubLayersMaxMinus1PresentFlag = flag; }
    1014928  Bool    getVpsSubLayersMaxMinus1PresentFlag(  )                          { return m_vpsSubLayersMaxMinus1PresentFlag; }
     929 
    1015930  Void    setSubLayersVpsMaxMinus1( Int i, Int  val )                      { m_subLayersVpsMaxMinus1[i] = val; }
    1016931  Int     getSubLayersVpsMaxMinus1( Int i )                                { return m_subLayersVpsMaxMinus1[i]; }
    1017932  Void    checkSubLayersVpsMaxMinus1( Int i )                              { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); }
     933
    1018934  Void    setMaxTidRefPresentFlag( Bool flag )                             { m_maxTidRefPresentFlag = flag; }
    1019935  Bool    getMaxTidRefPresentFlag(  )                                      { return m_maxTidRefPresentFlag; }
     936
    1020937  Void    setMaxTidIlRefPicsPlus1( Int i, Int j, Int  val )                { m_maxTidIlRefPicsPlus1[i][j] = val; }
    1021938  Int     getMaxTidIlRefPicsPlus1( Int i, Int j )                          { return m_maxTidIlRefPicsPlus1[i][j]; }
     939 
    1022940  Void    setAllRefLayersActiveFlag( Bool flag )                           { m_allRefLayersActiveFlag = flag; }
    1023941  Bool    getAllRefLayersActiveFlag(  )                                    { return m_allRefLayersActiveFlag; }
    1024942 
    1025 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1026   Void    setVpsNumberLayerSetsMinus1( Int val )                           { m_vpsNumberLayerSetsMinus1 = val;  }
    1027   Int     getVpsNumberLayerSetsMinus1( )                                   { return m_vpsNumberLayerSetsMinus1; }
    1028 #endif
    1029  
    1030943  Void    setVpsNumProfileTierLevelMinus1( Int val )                       { m_vpsNumProfileTierLevelMinus1 = val;  }
    1031944  Int     getVpsNumProfileTierLevelMinus1( )                               { return m_vpsNumProfileTierLevelMinus1; }
     
    1034947  Bool    getVpsProfilePresentFlag( Int idx )                              { return m_vpsProfilePresentFlag[idx]; }
    1035948
    1036 #if !H_MV_HLS_7_VPS_P0048_14
    1037   Void    setProfileRefMinus1( Int profileTierLevelIdx, Int val )          { m_profileRefMinus1[ profileTierLevelIdx ] = val;  }
    1038   Int     getProfileRefMinus1( Int profileTierLevelIdx )                   { return m_profileRefMinus1[ profileTierLevelIdx ]; }
    1039   Void    checkProfileRefMinus1( Int i )                                   { assert( getProfileRefMinus1( i ) + 1 <= i ); };  //  The value of profile_ref_minus1[ i ] + 1 shall be less than or equal to i.
    1040 #endif
    1041 
    1042 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1043   Void    setMoreOutputLayerSetsThanDefaultFlag( Bool flag )               { m_moreOutputLayerSetsThanDefaultFlag = flag; }
    1044   Bool    getMoreOutputLayerSetsThanDefaultFlag()                          { return m_moreOutputLayerSetsThanDefaultFlag; }
    1045 #endif
    1046  
    1047 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1048949  Void    setNumAddOutputLayerSets( Int val )                              { m_numAddOutputLayerSets = val; }
    1049950  Int     getNumAddOutputLayerSets( )                                      { return m_numAddOutputLayerSets; }
    1050 #else
    1051   Void    setNumAddOutputLayerSetsMinus1( Int val )                        { m_numAddOutputLayerSetsMinus1 = val; }
    1052   Int     getNumAddOutputLayerSetsMinus1( )                                { return m_numAddOutputLayerSetsMinus1; }
    1053 #endif
    1054  
    1055 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     951 
    1056952  Void    setDefaultTargetOutputLayerIdc( Int  val )                       { m_defaultTargetOutputLayerIdc = val; }
    1057953  Int     getDefaultTargetOutputLayerIdc(  )                               { return m_defaultTargetOutputLayerIdc; }   
    1058 #else
    1059   Void    setDefaultOneTargetOutputLayerIdc( Int  val )                    { m_defaultOneTargetOutputLayerIdc = val; }
    1060   Int     getDefaultOneTargetOutputLayerIdc(  )                            { return m_defaultOneTargetOutputLayerIdc; }
    1061   Void    checkDefaultOneTargetOutputLayerIdc( )                           { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); }
    1062 #endif
    1063954 
    1064955  Void    setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val )        { m_outputLayerSetIdxMinus1[ outLayerSetIdx ]  = val; }
     
    1067958  Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )       { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; }
    1068959  Bool    getOutputLayerFlag( Int outLayerSetIdx, Int i )                  { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; }
    1069 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1070   Bool    inferOutputLayerFlag( Int i, Int j )                             
    1071   {
    1072     Bool outputLayerFlag;
    1073     switch ( getDefaultTargetOutputLayerIdc( ) )
    1074     {
    1075     case 0:
    1076       outputLayerFlag = true;
    1077       break;
    1078     case 1:
    1079       outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 ); 
    1080       break;
    1081     case 2:
    1082       if ( i == 0 && j == 0)
    1083       {     
    1084         outputLayerFlag = true;  // This is a software only fix for a bug in the spec. In spec outputLayerFlag neither present nor inferred.
    1085       }
    1086       else
    1087       {
    1088         assert( 0 );
    1089       }
    1090       break;
    1091     default:     
    1092       assert( 0 );
    1093       break;
    1094     }
    1095     return outputLayerFlag;
    1096   }
    1097 #else
    1098   Bool    inferOutputLayerFlag( Int layerSetIdx, Int i )                   { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1  ) ));  }
    1099 #endif
     960
     961  Bool    inferOutputLayerFlag( Int i, Int j );
    1100962
    1101963  Void    setProfileLevelTierIdx( Int outLayerSetIdx, Int val )            { m_profileLevelTierIdx[ outLayerSetIdx ] = val; }
    1102964  Int     getProfileLevelTierIdx( Int outLayerSetIdx )                     { return m_profileLevelTierIdx[ outLayerSetIdx ]; }
    1103965 
    1104 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1105966  Void    setAltOutputLayerFlag( Int i, Bool flag )                        { m_altOutputLayerFlag[i] = flag; }
    1106967  Bool    getAltOutputLayerFlag( Int i )                                   { return m_altOutputLayerFlag[i]; }
    1107 #else
    1108   Void    setAltOutputLayerFlag( Bool flag )                               { m_altOutputLayerFlag = flag; }
    1109   Bool    getAltOutputLayerFlag(  )                                        { return m_altOutputLayerFlag; }
    1110 #endif
    1111968
    1112969  Void    setRepFormatIdxPresentFlag( Bool flag )                          { m_repFormatIdxPresentFlag = flag; }
     
    1121978  Void    setRepFormat( Int i, TComRepFormat* val )                        { m_repFormat[i] = val;  }
    1122979  TComRepFormat* getRepFormat( Int i )                                     { return m_repFormat[i]; }
     980 
    1123981  Void    setMaxOneActiveRefLayerFlag( Bool flag)                          { m_maxOneActiveRefLayerFlag = flag; }
    1124982  Bool    getMaxOneActiveRefLayerFlag( )                                   { return m_maxOneActiveRefLayerFlag; }
     
    1134992  Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; }
    1135993  Bool    getPocLsbNotPresentFlag( Int i )                                 { return m_pocLsbNotPresentFlag[i]; }
     994 
    1136995  Void    setDirectDepTypeLenMinus2( Int val)                              { m_directDepTypeLenMinus2 = val; }
    1137996  Int     getDirectDepTypeLenMinus2( )                                     { return m_directDepTypeLenMinus2; }
     
    11421001  Void    setDefaultDirectDependencyType( Int  val )                       { m_defaultDirectDependencyType = val; }
    11431002  Int     getDefaultDirectDependencyType(  )                               { return m_defaultDirectDependencyType; }
     1003 
    11441004  Void    setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; }
    11451005  Int     getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps)   { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; }
     
    11671027
    11681028  Int     getProfileLevelTierIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
    1169 
    1170 #if H_MV_HLS_7_VPS_P0306_22
    11711029  Int     getVpsRepFormatIdxLen()                                          { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); };       
    1172 #endif
     1030
    11731031  Int     getNumLayersInIdList ( Int lsIdx );
    11741032
     
    11781036  Void    deriveLayerSetLayerIdList();
    11791037
    1180 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    11811038  Int     getLayerSetIdxForOutputLayerSet( Int i )                         { return ( i <= getVpsNumLayerSetsMinus1() ) ? i  : getOutputLayerSetIdxMinus1( i ) + 1 ; };
    11821039
     
    11891046  Int     getNumOutputLayersInOutputLayerSet( Int i )                      { return (Int) getTargetOptLayerIdList( i ).size(); };
    11901047  Int     getOlsHighestOutputLayerId( Int i )                              { return getTargetOptLayerIdList( i ).back(); }; 
    1191 #else
    1192   Void    deriveTargetLayerIdLists();
    1193   std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx )     { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; };
    1194   std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx )     { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; };
    1195 #endif
    1196 
    1197 #if H_MV_HLS_7_HRD_P0156_7
    1198   Int     getMaxSubLayersInLayerSetMinus1( Int i )
    1199   {
    1200     Int maxSLMinus1 = 0;
    1201     Int optLsIdx    = getLayerSetIdxForOutputLayerSet( i );
    1202     for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
    1203     {
    1204       Int lId = m_layerSetLayerIdList[optLsIdx][k];
    1205       maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
    1206     }
    1207     return maxSLMinus1;
    1208   }
    1209 #endif
     1048
     1049  Int     getMaxSubLayersInLayerSetMinus1( Int i );
    12101050
    12111051  // inference
     
    12321072  UInt getCamParPrecision    ()  { return m_uiCamParPrecision; }
    12331073  Bool getCamParPresent      ( Int viewIndex )  { return m_bCamParPresent[viewIndex]; }
    1234 #if FIX_CAM_PARS_COLLECTOR
    12351074  Void setCamParPresent      ( Int viewIndex, Bool val )  { m_bCamParPresent[viewIndex] = val; }
    1236 #endif
    12371075  Bool hasCamParInSliceHeader( Int viewIndex )  { return m_bCamParInSliceHeader[viewIndex]; }
    12381076  Void setHasCamParInSliceHeader( Int viewIndex, Bool b )  { m_bCamParInSliceHeader[viewIndex] = b; }
     
    12481086  Int     getSubPULog2Size(Int layerIdInVps)           { return m_iSubPULog2Size[layerIdInVps]; }
    12491087  Void    setSubPULog2Size(Int layerIdInVps, Int u)    { m_iSubPULog2Size[layerIdInVps] = u;}
    1250 #endif
    1251 #endif
    1252 #if QC_SPIVMP_MPI_G0119
    12531088  Int     getSubPUMPILog2Size( )           { return m_iSubPUMPILog2Size; }
    12541089  Void    setSubPUMPILog2Size( Int u )     { m_iSubPUMPILog2Size = u;    }
     1090#endif
    12551091#endif
    12561092#if H_3D_VSP
     
    19401776  Int  m_ppsScalingListRefLayerId;
    19411777
    1942 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
    19431778  Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM];
    1944 #endif
    1945 #if H_MV_HLS_7_POC_P0041
    19461779  Bool m_pocResetInfoPresentFlag;
    1947 #endif
    19481780#endif
    19491781
     
    20881920  Int  getPpsScalingListRefLayerId(  ) { return m_ppsScalingListRefLayerId; }
    20891921
    2090 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
    20911922  Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; }
    20921923  Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; }
    2093 #endif
    2094 
    2095 #if H_MV_HLS_7_POC_P0041
     1924
    20961925  Void setPocResetInfoPresentFlag( Bool flag ) { m_pocResetInfoPresentFlag = flag; }
    20971926  Bool getPocResetInfoPresentFlag(  ) { return m_pocResetInfoPresentFlag; }
    2098 #endif
    2099 
    21001927#endif
    21011928};
     
    22432070  Int        m_interLayerPredLayerIdc       [MAX_NUM_LAYERS];
    22442071
    2245 #if H_MV_HLS_7_POC_P0041
    22462072  Int        m_sliceSegmentHeaderExtensionLength;
    22472073  Int        m_pocResetIdc;
     
    22522078  Int        m_pocMsbVal;
    22532079  Bool       m_pocMsbValRequiredFlag;
    2254 #endif
    22552080
    22562081#if H_3D
     
    22782103#endif
    22792104
    2280 #if MTK_DDD_G0063
     2105#if H_3D_DDD
    22812106  Int          m_aiDDDInvScale [MAX_NUM_LAYERS];
    22822107  Int          m_aiDDDInvOffset[MAX_NUM_LAYERS];
     
    26002425  Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; }
    26012426
    2602 #if H_MV_HLS_7_POC_P0041
    26032427  Void setSliceSegmentHeaderExtensionLength( Int  val ) { m_sliceSegmentHeaderExtensionLength = val; }
    26042428  Int  getSliceSegmentHeaderExtensionLength(  ) { return m_sliceSegmentHeaderExtensionLength; }
     
    26372461    return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
    26382462  }
    2639 #endif
    26402463
    26412464  // Additional variables derived in slice header semantics
     
    26582481
    26592482#endif
    2660 #if MTK_DDD_G0063
     2483#if H_3D_DDD
    26612484  Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
    26622485  Int  getDepthFromDV( Int iDV, Int iBaseViewIdx )
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r872 r884  
    7676#if H_3D
    7777#define H_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
    78                                               // HHI_QTLPC_RAU_OFF_C0160     // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
     78                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
     79                                              // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
    7980
    8081#define H_3D_VSO                          1   // VSO, View synthesis optimization, includes:
     
    8384                                              // SAIT_VSO_EST_A0033, JCT3V-A0033 modification 3
    8485                                              // LGE_WVSO_A0119
     86                                              // SCU_HS_VSD_BUGFIX_IMPROV_G0163
    8587#define H_3D_NBDV                         1   // Neighboring block disparity derivation
    8688                                              // QC_JCT3V-A0097
     
    102104                                              // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
    103105                                              // LGE_ARP_CTX_F0161                JCT3V-F0161
     106                                              // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
     107                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
     108
    104109#define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    105110                                              // Unifying rounding offset, for IC part, JCT3V-D0135
     
    109114                                              // LGE_IC_CTX_F0160 //JCT3V-F0160
    110115                                              // SEC_ONLY_TEXTURE_IC_F0151
     116                                              // MTK_IC_FLAG_CABAC_SIMP_G0061
     117                                              // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
    111118
    112119#if H_3D_NBDV
     
    133140                                              // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
    134141                                              // LGE_SHARP_VSP_INHERIT_F0104
     142                                              // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP
     143                                              // Restricted bi-prediction for VSP
    135144
    136145#define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
     
    145154                                              // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate
    146155                                              // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
     156                                              // MTK_NBDV_IVREF_FIX_G0067      , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
     157                                              // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074
     158                                              // QC_DEPTH_MERGE_SIMP_G0127 Remove DV candidate and shifting candidate for depth coding
     159
    147160#define H_3D_TMVP                         1   // QC_TMVP_C0047
    148161                                              // Sony_M23639
     
    173186                                              // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs
    174187                                              // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
     188                                              // Unify intra SDC and inter SDC
     189                                              // QC_GENERIC_SDC_G0122 Generalize SDC to all depth intra modes
     190                                              // SCU_HS_DEPTH_DC_PRED_G0143
     191                                              // HS_TSINGHUA_SDC_SPLIT_G0111
     192                                              // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split
     193
     194
    175195
    176196#define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
    177                                               // LGE_INTER_SDC_E0156  Enable inter SDC for depth coding
     197                                              // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding
     198                                              // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates
     199
    178200#define H_3D_SPIVMP                       1   // H_3D_SPIVMP    // JCT3V-F0110: Sub-PU level inter-view motion prediction
     201                                              // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077
     202                                              // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate
     203                                              // Simplification on Sub-PU level temporal interview motion prediction
     204
     205
     206#define H_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
     207
     208#define H_3D_DDD                          1   // Disparity derived depth coding
     209
    179210#define H_3D_FCO                          0   // Flexible coding order for 3D
    180211
     
    258289
    259290
     291///// ***** DEPTH BASED BLOCK PARTITIONING *********
     292#if H_3D_DBBP
     293#define DBBP_INVALID_SHORT                (-4)
     294#define RWTH_DBBP_PACK_MODE               SIZE_2NxN
     295#endif
     296
     297
    260298///// ***** FCO *********
    261299#if H_3D_FCO
     
    269307#endif
    270308
    271 
    272309/////////////////////////////////////////////////////////////////////////////////////////
    273 ///////////////////////////////////   HTM-10.0 Integrations //////////////////////////////
     310///////////////////////////////////   TBD                  //////////////////////////////
    274311/////////////////////////////////////////////////////////////////////////////////////////
    275 #if H_3D
    276 #if  H_3D_QTLPC
    277 #define MTK_TEX_DEP_PAR_G0055             1   // Texture-partition-dependent depth partition. JCT3V-G0055
    278 #endif
    279 
    280 #define MTK_DDD_G0063                     1   // Disparity derived depth coding
    281 #define HTM10RC1_FIX                           1   // Fix of DDD
    282 
    283 
    284 #if H_3D_VSP
    285 #define MTK_RBIP_VSP_G0069                1   // Restricted bi-prediction for VSP
    286 #define NTT_STORE_SPDV_VSP_G0148          1   // Storing Sub-PU based DV for VSP
    287 #endif
    288 
    289 #define H_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
    290 
    291 #if H_3D_DBBP
    292 #define DBBP_INVALID_SHORT                (-4)
    293 #define RWTH_DBBP_PACK_MODE               SIZE_2NxN
    294 #endif
    295 
    296 #if H_3D_DIM
    297 #define QC_PKU_SDC_SPLIT_G0123            1   // Intra SDC Split
    298 #if QC_PKU_SDC_SPLIT_G0123
    299 #define HS_TSINGHUA_SDC_SPLIT_G0111       1
    300 #endif
    301 #define SCU_HS_DEPTH_DC_PRED_G0143        1
    302 #define QC_GENERIC_SDC_G0122              1  // Generalize SDC to all depth intra modes
    303 #if H_3D_DIM_SDC && H_3D_INTER_SDC
    304 #define QC_SDC_UNIFY_G0130                1  // Unify intra SDC and inter SDC
    305 #define QC_SDC_UNIFY_G0130_FIX            1  // Fix bug of G0130
    306 #define QC_SDC_UNIFY_G0130_FIX2           1  // Fix bug of G0130
    307 #endif
    308 #define SEC_INTER_SDC_G0101               1  // Improved inter SDC with multiple DC candidates
    309 #endif
    310 
    311 #define KHU_SIMP_SPIVMP_G0147             1  // Simplification on Sub-PU level temporal interview motion prediction
    312 
    313 #if H_3D_SPIVMP
    314 #define QC_SPIVMP_MPI_G0119               1 // Sub-PU level MPI merge candidate
    315 #endif
    316 
    317 #define QC_DEPTH_MERGE_SIMP_G0127         1 // Remove DV candidate and shifting candidate for depth coding
    318 #define SEC_IC_ARP_SIG_G0072              1   // Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
    319 #define SCU_HS_VSD_BUGFIX_IMPROV_G0163    1
    320 #define SEC_SPIVMP_MCP_SIZE_G0077         1  // Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077
    321 #define SEC_DEPTH_DV_DERIVAITON_G0074     1  // Simplification of DV derivation for depth, JCT3V-G0074
    322 #define MTK_ARP_REF_SELECTION_G0053       1   // ARP Reference picture selection in JCT3V-G0053
    323 #define MTK_ARP_FLAG_CABAC_SIMP_G0061     1   // Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
    324 #define MTK_IC_FLAG_CABAC_SIMP_G0061      1   // Use only 1 context for IC flag in JCT3V-G0061
    325 #define MTK_NBDV_IVREF_FIX_G0067          1   // Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
    326 #endif
    327 
    328 /////////////////////////////////////////////////////////////////////////////////////////
    329 ///////////////////////////////////   HTM-10.1 Integrations //////////////////////////////
    330 /////////////////////////////////////////////////////////////////////////////////////////
    331 
    332 
    333 // TBD
     312
    334313// #define H_MV_HLS_7_POC_P0041_3            0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above)
    335314// #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.
     
    343322// #define H_MV_HLS_7_VPS_P0300_27           0 // 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.
    344323
    345 
    346 #define H_MV_HLS_7_VPS_P0306_22                1 // (VPS/P0306/ue(v) coded syntax elements) #22 Several minor modifications to the VPS syntax, consistent with eliminating the previous intention to avoid ue(v) parsing in the VPS
    347 #define H_MV_HLS_7_SEI_P0204_26                1 // (SEI/P0204/sub-bitstream SEI) #26 Add sub-bitstream property SEI message. Decision: Adopt
    348 #define H_MV_HLS_7_MISC_P0130_20               1 // (MISC/P0130/discardable not in inter-layer RPS) #20 Add constraint restricting pictures marked as discardable from being present in the temporal or inter-layer RPS,
    349 #define H_MV_HLS_7_VPS_P0125_24                1 // (VPS/P0125/VPS extension offset ) #24 Decision: Keep it as a reserved FFFF value.
    350 #define H_MV_HLS_7_VPS_P0307_23                1 // (VPS/P0307/VPS VUI extension)  #23 Decision: Adopt modification in P0307.
    351 #define H_MV_HLS_7_POC_P0041                   1 // Syntax related to POC reset
    352 
    353 
    354 #define H_MV_HLS7_GEN                          0  // General changes (not tested)
    355 #define H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27    1  // Output layer sets, various
    356                                                   // (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.
    357                                                   // (VPS/P0156/Num of output_layer_flag) #10 Proposal 3: The output_layer_flag[ i ][ j ] is signalled for j equal to 0 to NumLayersInIdList[ lsIdx ] inclusive. It was remarked that we might be able to just assume that the top layer is always output; however, this was not entirely clear , so the safe thing to do may be to also send the flag for this layer.
    358                                                   // (VPS/P0295/Default output layer sets) #5 Discussion from (P0110). Decision: Three-state approach (text in P0295, decoder shall allow 3 to be present and shall treat 3 the same as the value 2).
    359 
    360 
    361 #define H_MV_HLS_7_HRD_P0156_7                 1  // (HRD/P0156/MaxSubLayersInLayerSetMinus1) #7 Proposal 1: signal, in the VPS extension, the DPB parameters for an output layer set for sub-DPBs only up to the maximum temporal sub-layers in the corresponding layer set
    362 #define H_MV_HLS_7_VPS_P0048_14                1  // (VPS/P0048/profile_ref_minus1 rem) #14 Remove profile_ref_minus1 from the VPS extension, from JCTVC-P0048
    363 #define H_MV_HLS_7_VPS_P0076_15                1  // (VPS/P0076/video signal info move) #15 Move video signal information syntax structure earlier in the VPS VUI.
    364 #define H_MV_HLS_7_SPS_P0155_16_32             1  // (SPS/P0155/sps_sub_layer_ordering_info) #16, #32 Not signal the sps_max_num_reorder_pics[], sps_max_latency_increase_plus1[], and sps_max_dec_pic_buffering_minus1[] syntax elements in the SPS when nuh_layer_id > 0.
    365 #define H_MV_HLS_7_GEN_P0166_PPS_EXTENSION     1  // (GEN/P0166/pps_extension) #17 Add PPS extension type flags for conditional presence of syntax extensions per extension type, aligned with the SPS extension type flags, from JCTVC-P0166. Further align the SPS extension type flags syntax between RExt and MV-HEVC/SHVC
    366 #define H_MV_HLS_7_FIX_SET_DPB_SIZE            1  // Fix derivation dpb size parameters
    367 #define H_MV_HLS_7_RESERVED_FLAGS              1  // Added flags
    368                                                   // (SPS/P0312/SHVC reserved flag) The flag will be used for the syntax vert_phase_position_enable_flag in SHVC draft
    369                                                   // (VPS/O0215/SHVC reserved flag): this flag will be used for the syntax cross_layer_phase_alignment_flag in SHVC draft.
    370                                                   // (VPS VUI/O0199,P0312/SHVC reserved flags) the 3 reserved bits will be used for the syntaxes single_layer_for_non_irap_flag, higher_layer_irap_skip_flag and vert_phase_position_not_in_use_flag in SHVC draft.
    371 #define H_MV_FIX_VPS_LAYER_ID_NOT_EQUAL_ZERO   1  // Discard VPS with nuh_layer_Id > 0
    372 #define H_MV_HLS_7_MISC_P0130_EOS              1  // (MISC/P0130/EOS NAL layer id) #19 Require that end of bitstream NAL unit shall have nuh_layer_id equal to 0, from JCTVC-P0130. Decoders shall allow an end of bitstream NAL unit with nuh_layer_id > 0 to be present, and shall ignore the NAL unit.
    373 #define H_MV_HLS_7_MISC_P0182_13               1  // (MISC/P0182/BL PS Compatibility flag) #13 Define the flag (in VPS VUI) with the proposed semantics, without specifying an associated extraction process. Editors to select the position in the VPS VUI.
    374 #define H_MV_HLS_7_MISC_P0068_21               1  // (MISC/P0068/all irap idr flag) #21 Add flag in VUI to indicate that all IRAP pictures are IDRs and that all layer pictures in an AU are IDR aligned, from JCTVC-P0068 proposal 1.
    375 #define H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG               1  // Fix inference of cross_layer_irap_aligned_flag
    376 #define H_MV_HLS_7_MISC_P0079_18               1  // (MISC/P0079/NumActiveRefLayerPics) #18 Modification of derivation of variable NumActiveRefLayerPics.
    377 #define FIX_CAM_PARS_COLLECTOR                 1
    378 #define UPDATE_HM13                            1  // Only some parts in H_3D parts are marked!
    379 #if H_3D
    380 #define H_3D_FIX_G0148_BRACE                   1
    381 #endif
     324#define H_MV_HLS7_GEN                        0  // General changes (not tested)
     325
     326
     327
    382328/////////////////////////////////////////////////////////////////////////////////////////
    383329///////////////////////////////////   HM RELATED DEFINES ////////////////////////////////
     
    416362#define MAX_NUM_BITSTREAM_PARTITIONS    100 ///< Maximum value is actually not specified
    417363#define MAX_NUM_BSP_SCHED_COMBINATION   100 ///< Maximum value is actually not specified
    418 #if H_MV_HLS_7_SEI_P0204_26
    419364#define MAX_SUB_STREAMS                 1024
    420 #endif
    421365#else
    422366#define MAX_NUM_LAYER_IDS                64
     
    909853#if H_MV
    910854
    911 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
    912855enum PpsExtensionTypes
    913856{
     
    921864
    922865//Below for sps, would be good if this could be aligned
    923 #endif
    924866
    925867  enum PsExtensionTypes
  • trunk/source/Lib/TLibDecoder/SEIread.cpp

    r872 r884  
    9999    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
    100100    break;
    101 #if H_MV_HLS_7_SEI_P0204_26
     101#if H_MV
    102102  case SEI::SUB_BITSTREAM_PROPERTY:
    103103    fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
     
    245245      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);
    246246      break;
    247 #if H_MV_HLS_7_SEI_P0204_26
     247#if H_MV
    248248     case SEI::SUB_BITSTREAM_PROPERTY:
    249249       sei = new SEISubBitstreamProperty;
     
    777777
    778778}
    779 #if H_MV_HLS_7_SEI_P0204_26
     779#if H_MV
    780780Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei)
    781781{
  • trunk/source/Lib/TLibDecoder/SEIread.h

    r872 r884  
    7373  Void xParseSEISOPDescription        (SEISOPDescription &sei, UInt payloadSize);
    7474  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);
    75 #if H_MV_HLS_7_SEI_P0204_26
     75#if H_MV
    7676  Void  xParseSEISubBitstreamProperty   (SEISubBitstreamProperty &sei);
    7777  Void  xResizeSubBitstreamPropertySeiArrays(SEISubBitstreamProperty &sei);
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r872 r884  
    366366
    367367  READ_FLAG( uiCode, "pps_extension_flag");
    368 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
    369368  if (uiCode)
    370369  {
     
    383382    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
    384383    {
    385 #if H_MV_HLS_7_POC_P0041
    386384      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
    387 #endif
    388385    }
    389386
     
    406403#endif
    407404  }
    408 #else
    409   if (uiCode)
    410   {
    411 #if H_3D
    412     parsePPSExtension( pcPPS, pcVPS );
    413     READ_FLAG( uiCode, "pps_extension2_flag");
    414     if ( uiCode )
    415     {
    416 #endif
    417       while ( xMoreRbspData() )
    418       {
    419         READ_FLAG( uiCode, "pps_extension_data_flag");
    420       }
    421 #if H_3D
    422     }
    423 #endif
    424   }
    425 #endif
    426405}
    427406
     
    849828  assert(uiCode <= 12);
    850829
    851 #if H_MV_HLS_7_SPS_P0155_16_32
     830#if H_MV
    852831  if ( pcSPS->getLayerId() == 0 )
    853832  { 
     
    888867    }
    889868  }
    890 #if H_MV_HLS_7_SPS_P0155_16_32
     869#if H_MV
    891870  }
    892871#endif
     
    10531032    READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode );
    10541033    READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode );
    1055 #if H_MV_HLS_7_RESERVED_FLAGS
    10561034    READ_FLAG( uiCode, "sps_multilayer_ext_reserved_zero_flag[ i ]" );
    1057 #endif
    10581035  }
    10591036}
     
    10921069  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
    10931070
    1094 #if H_MV_HLS_7_VPS_P0125_24
    10951071  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
    1096 #else
    1097 #if H_MV && !H_MV_HLS7_GEN
    1098   READ_CODE( 16, uiCode,  "vps_extension_offset" );               
    1099 #else
    1100   READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
    1101 #endif
    1102 #endif
    11031072  parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
    11041073  UInt subLayerOrderingInfoPresentFlag;
     
    12121181  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
    12131182
    1214 #if !H_MV_HLS_7_VPS_P0307_23
    1215   READ_FLAG( uiCode, "vps_vui_present_flag" );                    pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
    1216   if ( pcVPS->getVpsVuiPresentFlag() )
    1217   { 
    1218   READ_CODE( 16, uiCode, "vps_vui_offset" );                      pcVPS->setVpsVuiOffset( uiCode );
    1219   }
    1220 #endif
    1221 
    12221183  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
    12231184
     
    13251286
    13261287  READ_FLAG( uiCode, "all_ref_layers_active_flag" );             pcVPS->setAllRefLayersActiveFlag( uiCode == 1 );
    1327 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1328   READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1"      );  pcVPS->setVpsNumberLayerSetsMinus1    ( uiCode );
    1329 #endif
    1330 
    1331 #if !H_MV_HLS_7_VPS_P0306_22
    1332   READ_CODE( 6,  uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );
    1333 #else
     1288
    13341289  READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 
    1335 #endif
     1290
    13361291  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
    13371292  {
    13381293    READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
    1339 #if !H_MV_HLS_7_VPS_P0048_14
    1340     if( !pcVPS->getVpsProfilePresentFlag( i ) )
    1341     {
    1342       READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );
    1343       pcVPS->checkProfileRefMinus1( i );     
    1344     }
    1345 #endif
    13461294    parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
    13471295    if( !pcVPS->getVpsProfilePresentFlag( i ) )
    13481296    {
    13491297      TComPTL temp = *pcVPS->getPTL( i );
    1350 #if H_MV_HLS_7_VPS_P0048_14
    13511298      *pcVPS->getPTL( i ) = *pcVPS->getPTL( i - 1 );
    1352 #else
    1353       *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 );
    1354 #endif
    13551299      pcVPS->getPTL( i )->copyLevelFrom( &temp );
    13561300    }
    13571301  }
    13581302
    1359 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    13601303  READ_UVLC( uiCode, "num_add_output_layer_sets"      ); pcVPS->setNumAddOutputLayerSets( uiCode );
    13611304  pcVPS->initTargetLayerIdLists( );
     
    13651308  } 
    13661309
    1367 #else
    1368   Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;
    1369 
    1370   READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 );
    1371 
    1372   if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
    1373   {
    1374     READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1"      ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode );
    1375     numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1);
    1376   }
    1377 
    1378   if( numOutputLayerSets > 1)
    1379   {
    1380     READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" ); pcVPS->setDefaultOneTargetOutputLayerIdc( uiCode );
    1381     pcVPS->checkDefaultOneTargetOutputLayerIdc();
    1382   } 
    1383 #endif
    1384 
    13851310  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
    13861311  pcVPS->setOutputLayerSetIdxMinus1(0, -1);
    13871312
    1388 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    13891313  pcVPS->deriveTargetLayerIdList( 0 );
    13901314  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
    13911315  {
    13921316    if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
    1393 #else
    1394   for( Int i = 1; i < numOutputLayerSets; i++ )
    1395   {
    1396     if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
    1397 #endif
    13981317    {       
    13991318      READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );
    1400 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    14011319    }
    14021320
     
    14161334    }
    14171335    pcVPS->deriveTargetLayerIdList( i );
    1418 #else
    1419       for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
    1420       {
    1421         READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );
    1422       }       
    1423     }
    1424     else
    1425     { // These inference rules would also be helpful in spec text
    1426       pcVPS->setOutputLayerSetIdxMinus1(i, i - 1 );
    1427       for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
    1428       {             
    1429         pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j ));
    1430       }
    1431     }
    1432 #endif
     1336
    14331337    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    14341338    {     
     
    14361340    }
    14371341
    1438 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    14391342    if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
    14401343    {
     
    14421345    }
    14431346  }
    1444 #else
    1445   }
    1446   if( pcVPS->getMaxLayersMinus1() > 0 )
    1447   {
    1448     READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 );
    1449   }
    1450 #endif
    1451 
    1452 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    1453   pcVPS->deriveTargetLayerIdLists();
    1454 #endif
    14551347
    14561348  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    14571349  if ( pcVPS->getRepFormatIdxPresentFlag() )
    14581350  {
    1459 #if H_MV_HLS_7_VPS_P0306_22
    14601351    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
    1461 #else
    1462     READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
    1463 #endif
    14641352  }
    14651353
     
    14791367      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    14801368      {
    1481 #if H_MV_HLS_7_VPS_P0306_22
    14821369        READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1483 #else
    1484         READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1485 #endif
    14861370      }
    14871371    }
     
    15001384  }
    15011385
    1502 #if H_MV_HLS_7_RESERVED_FLAGS
    15031386  READ_FLAG( uiCode, "vps_reserved_zero_flag" );
    1504 #endif
    15051387  parseDpbSize( pcVPS );
    15061388
     
    15311413  } 
    15321414
    1533 #if H_MV_HLS_7_VPS_P0307_23
    15341415  READ_UVLC( uiCode, "vps_non_vui_extension_length" ); pcVPS->setVpsNonVuiExtensionLength( uiCode );
    15351416  for ( Int i = 1; i <= pcVPS->getVpsNonVuiExtensionLength(); i++ )
     
    15381419  }
    15391420  READ_FLAG( uiCode, "vps_vui_present_flag" );  pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
    1540 #endif
    1541 #if !H_MV_HLS_7_RESERVED_FLAGS
    1542   READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" );
    1543 #endif
    15441421  if( pcVPS->getVpsVuiPresentFlag() )
    15451422  {
     
    15471424    parseVPSVUI( pcVPS );
    15481425  }     
    1549 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
    15501426  {
    15511427    TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( );
     
    15531429    pcVPSVUI->inferVpsVui( false );
    15541430  }
    1555 #endif
    15561431
    15571432  pcVPS->checkVPSExtensionSyntax();
     
    16011476    READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 );
    16021477  }
    1603 #if H_MV_HLS_7_MISC_P0068_21
    16041478  if( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) )
    16051479  {
    16061480    READ_FLAG( uiCode, "all_layers_idr_aligned_flag" ); pcVPSVUI->setAllLayersIdrAlignedFlag( uiCode == 1 );
    16071481  }
    1608 #endif
    16091482  READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 );
    16101483  READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 );
    16111484  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    16121485  {
    1613 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    16141486    for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1615 #else
    1616     for( Int i = 0; i  <=  pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
    1617 #endif
    16181487    {
    16191488      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
     
    16411510  }
    16421511
    1643 #if H_MV_HLS_7_VPS_P0076_15
    16441512  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
    16451513  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     
    16751543    }
    16761544  }
    1677 #endif
    16781545
    16791546  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
     
    17121579  }
    17131580
    1714 #if H_MV_HLS_7_RESERVED_FLAGS
    17151581  READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" );
    1716 #endif
    1717 
    17181582  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
    17191583
     
    17371601  }
    17381602
    1739 #if !H_MV_HLS_7_VPS_P0076_15
    1740   READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
    1741   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
    1742   {
    1743     READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode );
    1744   }
    1745   else
    1746   {
    1747     pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
    1748   }
    1749 
    1750   for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
    1751   {
    1752     assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL );
    1753     TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo();     
    1754     parseVideoSignalInfo( curVideoSignalInfo );
    1755     pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo );
    1756   }
    1757  
    1758   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
    1759   {
    1760     for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1761     {
    1762       READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
    1763       assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
    1764     }
    1765   }
    1766   else
    1767   {
    1768     for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1769     {
    1770       pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i );
    1771     }
    1772   }
    1773 #endif
    17741603  READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 );
    17751604  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     
    17771606    parseVpsVuiBspHrdParameters( pcVPS );
    17781607}
    1779 #if H_MV_HLS_7_MISC_P0182_13
    17801608  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    17811609  {
     
    17851613    }
    17861614  }
    1787 #endif
    17881615}
    17891616
     
    18641691  { 
    18651692    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
    1866 #if H_MV_HLS_7_HRD_P0156_7
    18671693    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
    1868 #else
    1869     for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
    1870 #endif
    18711694    { 
    18721695      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    18761699      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    18771700      { 
    1878 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    18791701        for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
    1880 #else
    1881         for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
    1882 #endif
    18831702        {
    18841703          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     
    19331752        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
    19341753#if H_3D_SPIVMP
    1935 #if SEC_SPIVMP_MCP_SIZE_G0077
    19361754        READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3);
    1937 #else
    1938         READ_UVLC (uiCode, "log2_sub_PU_size_minus2");     pcVPS->setSubPULog2Size(i, uiCode+2);
    1939 #endif
    19401755#endif
    19411756#endif
     
    19651780        if (i!=1)
    19661781        {
    1967 #if SEC_SPIVMP_MCP_SIZE_G0077
    19681782          READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3);
    1969 #else
    1970           READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]");     pcVPS->setSubPULog2Size(i, uiCode+2);
    1971 #endif
    19721783        }
    19731784#endif
     
    19911802  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
    19921803  {
    1993 #if FIX_CAM_PARS_COLLECTOR
    19941804    pcVPS->setCamParPresent         ( viewIndex, false );
    19951805    pcVPS->setHasCamParInSliceHeader( viewIndex, false );
    1996 #endif
    19971806    READ_FLAG( uiCode, "cp_present_flag[i]" );                  bCamParPresentFlag = ( uiCode == 1);
    19981807    if ( bCamParPresentFlag )
     
    20131822    }
    20141823  }
    2015 #if QC_SPIVMP_MPI_G0119
    20161824  READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3");              pcVPS->setSubPUMPILog2Size( uiCode + 3 );
    2017 #endif
    20181825  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    20191826}
     
    27282535  if(pps->getSliceHeaderExtensionPresentFlag())
    27292536  {
    2730 #if !H_MV_HLS_7_POC_P0041   
    2731     READ_UVLC(uiCode,"slice_header_extension_length");
    2732     for(Int i=0; i<uiCode; i++)
    2733     {
    2734       UInt ignore;
    2735       READ_CODE(8,ignore,"slice_header_extension_data_byte");
    2736     }
    2737   }
    2738 #else
    27392537#if H_MV
    27402538    READ_UVLC( uiCode, "slice_segment_header_extension_length" ); rpcSlice->setSliceSegmentHeaderExtensionLength( uiCode );
     
    28062604    }
    28072605  }
    2808 #endif
    28092606#endif
    28102607  }
     
    31032900#endif
    31042901#if H_3D_INTER_SDC
    3105 #if QC_SDC_UNIFY_G0130
    31062902Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    31072903{
     
    31132909  assert(0);
    31142910}
    3115 #else
    3116 Void TDecCavlc::parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    3117 {
    3118   assert(0);
    3119 }
    3120 
    3121 Void TDecCavlc::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
    3122 {
    3123   assert(0);
    3124 }
    3125 #endif
     2911
    31262912#endif
    31272913#if H_3D_DBBP
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r872 r884  
    124124#endif
    125125#if H_3D_INTER_SDC
    126 #if QC_SDC_UNIFY_G0130
    127126  Void  parseDeltaDC        ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
    128127  Void  parseSDCFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    129 #else
    130   Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    131   Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
    132 #endif
    133128#endif
    134129#if H_3D_DBBP
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r872 r884  
    293293
    294294
    295 #if MTK_DDD_G0063
     295#if H_3D_DDD
    296296      pcCU->setUseDDD( false, uiAbsPartIdx, uiDepth );
    297297#endif
     
    339339      if( pcCU->getSlice()->getIsDepth())
    340340      {
    341 #if SEC_DEPTH_DV_DERIVAITON_G0074
    342341        DvInfo.bDV = m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo);
    343 #else
    344         DvInfo.bDV = m_ppcCU[uiDepth]->getDispNeighBlocks(0, 0, &DvInfo);
    345 #endif
    346342      }
    347343      else
     
    414410    m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
    415411    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    416 
    417 #if !SEC_IC_ARP_SIG_G0072
     412#if H_3D_ARP
     413    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
     414#endif
    418415#if H_3D_IC
    419416    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    420 #endif
    421 #endif
    422 #if H_3D_ARP
    423     m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
    424 #endif
    425 #if SEC_IC_ARP_SIG_G0072
    426 #if H_3D_IC
    427     m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    428 #endif
    429417#endif
    430418
     
    466454    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    467455
    468 #if MTK_DDD_G0063
     456#if H_3D_DDD
    469457    if( uiMergeIndex == m_ppcCU[uiDepth]->getUseDDDCandIdx() )
    470458    {
     
    484472        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    485473        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    486 #if NTT_STORE_SPDV_VSP_G0148
     474#if H_3D_VSP
    487475        if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
    488476        {
     
    551539  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
    552540
    553 #if QC_SDC_UNIFY_G0130
     541#if H_3D_DIM_SDC
    554542  m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    555543#endif
     
    573561  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
    574562  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
    575 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
    576   m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    577 #endif
    578563  // Coefficient decoding
    579564  Bool bCodeDQP = getdQPFlag();
     
    663648#endif
    664649#if H_3D_INTER_SDC
    665 #if QC_SDC_UNIFY_G0130
    666650      if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) )
    667 #else
    668       if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )
    669 #endif
    670651      {
    671652        xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     
    730711  UInt  uiWidth      = pcCU->getWidth ( 0 );
    731712  UInt  uiHeight     = pcCU->getHeight( 0 );
    732 #if !SEC_INTER_SDC_G0101
    733   UChar* pMask       = pcCU->getInterSDCMask();
    734 
    735   memset( pMask, 0, uiWidth*uiHeight );
    736   pcCU->xSetInterSDCCUMask( pcCU, pMask );
    737 #endif
    738713
    739714  Pel  *pResi;
     
    746721    for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
    747722    {
    748 #if SEC_INTER_SDC_G0101
    749723      pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 );
    750 #else
    751       UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
    752 #if QC_SDC_UNIFY_G0130
    753       pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 );
    754 #else
    755       pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );
    756 #endif
    757 #endif
    758724    }
    759725    pResi += uiResiStride;
     
    929895#endif
    930896 
    931 #if H_3D && UPDATE_HM13
     897#if H_3D
    932898  Bool useDltFlag = (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps());
    933899
     
    955921    {
    956922#if H_3D
    957 #if UPDATE_HM13
    958923      if ( useDltFlag )
    959 #else
    960       if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    961 #endif
    962924      {
    963925        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 ] ) );
     
    11511113  UInt uiWidth        = pcCU->getWidth  ( 0 );
    11521114  UInt uiHeight       = pcCU->getHeight ( 0 );
    1153 #if QC_PKU_SDC_SPLIT_G0123
    1154 #if HS_TSINGHUA_SDC_SPLIT_G0111
    1155 #if QC_GENERIC_SDC_G0122
    11561115  TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
    1157 #endif
    1158 #else
    1159 #if QC_GENERIC_SDC_G0122
    1160   TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    1161 #endif
    1162 #endif
    1163 #endif
    1164 #if QC_PKU_SDC_SPLIT_G0123
    11651116  UInt numParts = 1;
    1166   UInt i = 0;
    11671117  UInt sdcDepth    = 0;
    11681118  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     
    11811131  UInt    uiLumaPredMode = 0; 
    11821132
    1183 #if HS_TSINGHUA_SDC_SPLIT_G0111
    11841133  if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1)
    11851134  {
     
    11881137    uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
    11891138  }
    1190 #else
    1191   if (uiWidth == 64)
    1192   {
    1193     numParts = 4;
    1194     sdcDepth = 1;
    1195     uiWidth = uiHeight = 32;
    1196   }
    1197 #endif
    1198 
    1199   for ( i = 0; i < numParts; i++ )
     1139
     1140  for ( Int i = 0; i < numParts; i++ )
    12001141  {
    12011142    uiStride    = pcRecoYuv->getStride  ();
     
    12031144    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    12041145    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
    1205  
     1146
    12061147    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    12071148    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     
    12111152
    12121153    AOF( uiWidth == uiHeight );
    1213 #else
    1214   TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
    1215   TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
    1216   TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
    1217  
    1218   UInt    uiStride    = pcRecoYuv->getStride  ();
    1219   Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
    1220   Pel*    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    1221   Pel*    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
    1222  
    1223   UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    1224   Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    1225   UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    1226  
    1227   UInt    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
    1228  
    1229   AOF( uiWidth == uiHeight );
    1230   AOF( uiAbsPartIdx == 0 );
    1231   AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
    1232   AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
    1233 #endif
    1234  
    1235   //===== init availability pattern =====
    1236   Bool  bAboveAvail = false;
    1237   Bool  bLeftAvail  = false;
    1238 #if QC_PKU_SDC_SPLIT_G0123
    1239   pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
    1240   pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
    1241 #else
    1242   pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
    1243   pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
    1244 #endif
    1245 #if !QC_PKU_SDC_SPLIT_G0123
    1246 #if QC_GENERIC_SDC_G0122
    1247   TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    1248 #endif
    1249 #endif
    1250 #if HS_TSINGHUA_SDC_SPLIT_G0111
    1251   TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    1252 #endif
    1253   //===== get prediction signal =====
    1254 #if H_3D_DIM
    1255   if( isDimMode( uiLumaPredMode ) )
    1256   {
    1257     m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight
    1258 #if QC_GENERIC_SDC_G0122
    1259       , false, dmm4Segmentation
    1260 #endif
    1261       );
    1262 #if HS_TSINGHUA_SDC_SPLIT_G0111
    1263     Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
    1264     Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
    1265     for( UInt k = 0; k < (uiWidth*uiHeight); k++ )
    1266     {
    1267       dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
    1268     }
    1269 #endif
    1270   }
    1271   else
    1272   {
    1273 #endif
    1274     m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
    1275 #if H_3D_DIM
    1276   }
    1277 #endif
    1278 #if QC_PKU_SDC_SPLIT_G0123
     1154
     1155    //===== init availability pattern =====
     1156    Bool  bAboveAvail = false;
     1157    Bool  bLeftAvail  = false;
     1158
     1159    pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
     1160    pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
     1161
     1162    TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1163    //===== get prediction signal =====
     1164    if( isDimMode( uiLumaPredMode ) )
     1165    {
     1166      m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, false, dmm4Segmentation  );
     1167      Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
     1168      Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
     1169      for( UInt k = 0; k < (uiWidth*uiHeight); k++ )
     1170      {
     1171        dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
     1172      }
     1173    }
     1174    else
     1175    {
     1176      m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     1177    }
     1178
    12791179    if ( numParts > 1 )
    12801180    {
     
    12921192    }
    12931193    uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 );
    1294 #if HS_TSINGHUA_SDC_SPLIT_G0111
    12951194    dmm4Segmentation->destroy(); delete dmm4Segmentation;
    1296 #endif
    12971195  }
    12981196  uiAbsPartIdx = 0;
     
    13091207  piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    13101208  uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    1311 #endif
    13121209  // number of segments depends on prediction mode
    13131210  UInt uiNumSegments = 1;
     
    13261223    uiMaskStride = pcWedgelet->getStride();
    13271224  }
    1328 #if QC_GENERIC_SDC_G0122
    13291225  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
    13301226  {
    13311227    uiNumSegments = 2;
    1332 #if HS_TSINGHUA_SDC_SPLIT_G0111
    13331228    pbMask  = dmm4SegmentationOrg->getPattern();
    13341229    uiMaskStride = dmm4SegmentationOrg->getStride();
    1335 #else
    1336     pbMask  = dmm4Segmentation->getPattern();
    1337     uiMaskStride = dmm4Segmentation->getStride();
    1338 #endif
    1339   }
    1340 #endif
     1230  }
    13411231  // get DC prediction for each segment
    13421232  Pel apDCPredValues[2];
     
    14001290    pRecCr += uiStrideC;
    14011291  }
    1402 #if QC_GENERIC_SDC_G0122
    1403 #if HS_TSINGHUA_SDC_SPLIT_G0111
    14041292  dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
    1405 #else
    1406   dmm4Segmentation->destroy(); delete dmm4Segmentation;
    1407 #endif
    1408 #endif
    14091293}
    14101294#endif
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r872 r884  
    111111  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
    112112
    113 #if SEC_IC_ARP_SIG_G0072
    114113  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
    115 #else
    116   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
    117 #endif
    118114  {
    119115    return;
     
    272268      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    273269      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    274 #if !SEC_IC_ARP_SIG_G0072
     270#if H_3D_ARP
     271      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
     272#endif
    275273#if H_3D_IC
    276274      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    277 #endif
    278 #endif
    279 #if H_3D_ARP
    280       decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    281 #endif
    282 #if SEC_IC_ARP_SIG_G0072
    283 #if H_3D_IC
    284       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    285 #endif
    286275#endif
    287276#if H_3D_DBBP
     
    362351      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    363352
    364 #if MTK_DDD_G0063
     353#if H_3D_DDD
    365354      if( uiMergeIndex == pcSubCU->getUseDDDCandIdx() )
    366355      {
     
    384373          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    385374          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    386 #if NTT_STORE_SPDV_VSP_G0148
     375#if H_3D_VSP
    387376#if H_3D_DBBP
    388377          if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
     
    440429        }
    441430      }
    442 #if !SEC_IC_ARP_SIG_G0072
     431#if H_3D_ARP
     432      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
     433#endif
    443434#if H_3D_IC
    444435      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    445436#endif
    446 #endif
    447 #if H_3D_ARP
    448       decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    449 #endif
    450 #if SEC_IC_ARP_SIG_G0072
    451 #if H_3D_IC
    452       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    453 #endif
    454 #endif
    455437    }
    456438#if H_3D_VSP
    457 #if NTT_STORE_SPDV_VSP_G0148
    458439    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
    459 #else
    460     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
    461 #endif
    462440#else
    463441    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
     
    797775  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    798776  UInt uiChromaOffset = uiLumaOffset>>2;
    799 #if QC_SDC_UNIFY_G0130
    800777#if H_3D_DIM_SDC
    801778  if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )
     
    807784    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    808785  }
    809 #endif
    810786
    811787#if H_3D_INTER_SDC
     
    817793  }
    818794#endif
    819 #if QC_SDC_UNIFY_G0130_FIX
    820795  if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) )
    821 #else
    822   if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
    823 #endif
    824796  {
    825797    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
     
    842814    }
    843815  }
    844 #else
    845 #if H_3D_DIM_SDC
    846   if( pcCU->getSDCFlag( uiAbsPartIdx ) )
    847   {
    848     assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
    849     assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
    850     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
    851     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    852     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    853     return;
    854   }
    855 #endif
    856  
    857 #if H_3D_INTER_SDC
    858   if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
    859   {
    860     assert( !pcCU->isSkipped( uiAbsPartIdx ) );
    861     assert( !pcCU->isIntra( uiAbsPartIdx) );
    862     assert( pcCU->getSlice()->getIsDepth() );
    863 
    864     decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth );
    865     return;
    866   }
    867 #endif
    868816#endif
    869817
     
    893841
    894842#if H_3D_INTER_SDC
    895 #if QC_SDC_UNIFY_G0130
    896843Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    897844{
     
    904851  }
    905852
    906 #if SEC_INTER_SDC_G0101
    907853  if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )
    908 #else
    909   if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
    910 #endif
    911854  {
    912855    return;
    913856  }
    914857
    915 #if SEC_INTER_SDC_G0101
    916858  assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
    917 #else
    918   assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
    919 #endif
    920 
    921859  m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    922860}
    923 
    924 #else
    925 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    926 {
    927   pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);
    928 
    929   if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
    930   {
    931     return;
    932   }
    933 
    934   if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
    935   {
    936     return;
    937   }
    938 
    939   m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    940 }
    941 
    942 Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    943 {
    944   if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
    945   {
    946     return;
    947   }
    948 
    949   if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
    950   {
    951     return;
    952   }
    953 
    954   UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );