Changeset 773 in 3DVCSoftware for trunk/source


Ignore:
Timestamp:
16 Jan 2014, 09:56:13 (10 years ago)
Author:
tech
Message:

Merged branch/9.2-dev0@722.

Location:
trunk/source
Files:
42 edited

Legend:

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

    r738 r773  
    8585  ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)")
    8686#if H_MV
    87 #if H_MV_6_HRD_O0217_13
    8887  ("TargetOptLayerSetIdx,x", m_targetOptLayerSetIdx, -1, "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded. 
    89 #else
    90   ("MaxLayerId,-ls", m_maxLayerId, MAX_NUM_LAYER_IDS-1, "Maximum LayerId to be decoded.")
    91 #endif
    9288#endif
    9389  ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
     
    128124  if ( !cfg_TargetDecLayerIdSetFile.empty() )
    129125  {
    130 #if H_MV_6_HRD_O0217_13
     126#if H_MV
    131127    m_targetDecLayerIdSetFileEmpty = false;     
    132128#endif
     
    174170  }
    175171#if H_MV
    176 #if H_MV_6_HRD_O0217_13
    177172  m_targetDecLayerIdSet.push_back( 0 );         // Only base layer at startup
    178 #else
    179   else
    180   {
    181     for ( Int curLayerId = 0; curLayerId <= m_maxLayerId; curLayerId++ )
    182     {
    183       m_targetDecLayerIdSet.push_back( curLayerId );
    184     }
    185   }
    186 #endif
    187173#endif
    188174
  • trunk/source/App/TAppDecoder/TAppDecCfg.h

    r738 r773  
    5959  Char*         m_pchBitstreamFile;                   ///< input bitstream file name
    6060#if H_MV
    61 #if H_MV_6_HRD_O0217_13
    6261  Int           m_targetOptLayerSetIdx;               ///< target output layer set index
    63 #endif
    6462  Int           m_maxLayerId;                         ///< maximum nuh_layer_id decoded
    6563  std::vector<Char*> m_pchReconFiles;                 ///< array of output reconstruction file name create from output reconstruction file name
     
    7775
    7876  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    79 #if H_MV_6_HRD_O0217_13
     77#if H_MV
    8078  Bool          m_targetDecLayerIdSetFileEmpty;      ///< indication if target layers are given by file
    8179#endif
     
    8886  TAppDecCfg()
    8987  : m_pchBitstreamFile(NULL)
    90 #if H_MV
    91 #if !H_MV_6_HRD_O0217_13
    92   , m_maxLayerId(0)
    93 #endif
    94 #endif
    9588  , m_pchReconFile(NULL)
    9689  , m_iSkipFrame(0)
     
    9992  , m_iMaxTemporalLayer(-1)
    10093  , m_decodedPictureHashSEIEnabled(0)
    101 #if H_MV_6_HRD_O0217_13
     94#if H_MV
    10295  , m_targetDecLayerIdSetFileEmpty(true)
    10396#endif
  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r738 r773  
    6161{
    6262#if H_MV
    63 #if H_MV_LAYER_WISE_STARTUP
    6463  for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++)
    6564  {
     
    6766    m_layerInitilizedFlags[i] = false;
    6867  }
    69 #else
    70   for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1;
    71 #endif
    7268#endif
    7369#if H_3D
     
    192188    Bool newSliceDiffPoc   = false;
    193189    Bool newSliceDiffLayer = false;
    194 #if H_MV_FIX_SKIP_PICTURES
    195190    Bool sliceSkippedFlag = false;
    196 #endif
    197191#if H_3D
    198192    Bool allLayersDecoded  = false;     
     
    212206      read(nalu, nalUnit);
    213207#if H_MV     
    214 #if !H_MV_6_HRD_O0217_13
    215       Int decIdx     = xGetDecoderIdx( nalu.m_layerId , true );
    216 #endif
    217 #if H_MV_6_LAYER_ID_32
    218208      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || nalu.m_layerId > MAX_NUM_LAYER_IDS-1 )
    219 #else           
    220       if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) )
    221 #endif
    222209      {
    223210        bNewPicture = false;
    224 #if H_MV_6_LAYER_ID_32
    225211        if ( !bitstreamFile )
    226212        {
    227213          decIdxLastPic     = decIdxCurrPic;
    228214        }
    229 #endif
    230215      }
    231216      else
    232217      {
    233 #if H_MV_6_HRD_O0217_13
    234218        Int decIdx     = xGetDecoderIdx( nalu.m_layerId , true );     
    235 #endif
    236219        newSliceDiffLayer = nalu.isSlice() && ( nalu.m_layerId != layerIdCurrPic ) && !firstSlice;
    237 #if H_MV_FIX_SKIP_PICTURES
    238220        newSliceDiffPoc   = m_tDecTop[decIdx]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[decIdx], newSliceDiffLayer, sliceSkippedFlag );
    239 #else
    240         newSliceDiffPoc   = m_tDecTop[decIdx]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[decIdx], newSliceDiffLayer );
    241 #endif
    242221        // decode function only returns true when all of the following conditions are true
    243222        // - poc in particular layer changes
     
    245224        // - nalu.isSlice() == true     
    246225
    247 #if H_MV_6_HRD_O0217_13
    248226        // Update TargetDecLayerIdList only when not specified by layer id file, specification by file might actually out of conformance.
    249227        if (nalu.m_nalUnitType == NAL_UNIT_VPS && m_targetDecLayerIdSetFileEmpty )
     
    258236          m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx );
    259237        }
    260 #endif
    261 #if H_MV_FIX_SKIP_PICTURES
    262238        bNewPicture       = ( newSliceDiffLayer || newSliceDiffPoc ) && !sliceSkippedFlag;
    263239        if ( nalu.isSlice() && firstSlice && !sliceSkippedFlag )       
    264 #else
    265         bNewPicture       = newSliceDiffLayer || newSliceDiffPoc;
    266 
    267         if ( nalu.isSlice() && firstSlice )
    268 #endif
    269240        {
    270241          layerIdCurrPic = nalu.m_layerId;
     
    881852  Int decIdx = -1;
    882853
    883 #if H_MV_6_LAYER_ID_32
    884854  if ( layerId > MAX_NUM_LAYER_IDS-1 ) 
    885855  {
    886856    return decIdx;
    887857  }
    888 #endif
    889858
    890859  if ( m_layerIdToDecIdx[ layerId ] != -1 )
     
    906875    m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
    907876    m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists );
    908 #if H_MV_LAYER_WISE_STARTUP
    909877    m_tDecTop[ decIdx ]->setLayerInitilizedFlags( m_layerInitilizedFlags );
    910 #endif
    911878
    912879#if H_3D
  • trunk/source/App/TAppDecoder/TAppDecTop.h

    r738 r773  
    6767  Int                             m_numDecoders;                               ///< number of decoder instances
    6868  TComPicLists                    m_ivPicLists;                                ///< picture buffers of decoder instances
    69 #if H_MV_LAYER_WISE_STARTUP
    7069  Bool                            m_layerInitilizedFlags[ MAX_NUM_LAYER_IDS ]; ///< for layerwise startup
    71 #endif
    7270
    7371#else
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r738 r773  
    378378#if H_3D_DIM
    379379  ("DMM",                   m_useDMM,           true,  "Depth intra model modes")
    380 #if !SEC_DMM3_RBC_F0147
    381   ("RBC",                   m_useRBC,           true,  "Region boundary chain mode")
    382 #endif
    383380  ("SDC",                   m_useSDC,           true,  "Simplified depth coding")
    384381  ("DLT",                   m_useDLT,           true,  "Depth lookup table")
     
    391388  ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")   
    392389  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 
    393 #if H_MV_6_PS_0109_25
    394390  ("DefaultOneTargetOutputLayerFlag"  , m_defaultOneTargetOutputLayerIdc  , 0, "Output highest layer of layer sets by default")
    395 #else
    396   ("DefaultOneTargetOutputLayerFlag", m_defaultOneTargetOutputLayerFlag,  false , "Output highest layer of layer sets by default")     
    397 #endif
    398391  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 
    399392  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 
     
    451444  ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs")
    452445  ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs")
    453  
    454446  // Coding structure parameters
    455 #if H_MV_LAYER_WISE_STARTUP
     447#if H_MV 
    456448  ("IntraPeriod,-ip",         m_iIntraPeriod,std::vector<Int>(1,-1), "Intra period in frames, (-1: only first frame), per layer")
    457449#else
    458   ("IntraPeriod,-ip",         m_iIntraPeriod,              -1, "Intra period in frames, (-1: only first frame)")
     450("IntraPeriod,-ip",         m_iIntraPeriod,              -1, "Intra period in frames, (-1: only first frame)")
    459451#endif
    460452  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
     
    518510  ("AdvMultiviewResPred",      m_uiUseAdvResPred,           (UInt)1, "Usage of Advanced Residual Prediction" )
    519511#endif
    520 #if MTK_SPIVMP_F0110
     512#if H_3D_SPIVMP
    521513  ("SubPULog2Size", m_iSubPULog2Size, (Int)3, "Sub-PU size index: 2^n")
    522514#endif
    523515
    524516#if H_3D_IC
    525 #if SEC_ONLY_TEXTURE_IC_F0151
    526517  ("IlluCompEnable",           m_abUseIC, true, "Enable illumination compensation")
    527 #else
    528   ("IlluCompEnable",           m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation")
    529 #endif
    530518#endif
    531519#if H_3D_INTER_SDC
    532520  ("InterSDC",                 m_bDepthInterSDCFlag,        true, "Enable depth inter SDC")
    533521#endif
    534 #if SEC_MPI_ENABLING_MERGE_F0150
     522#if H_3D_IV_MERGE
    535523  ("MPI",                      m_bMPIFlag,        true, "Enable MPI")
    536524#endif
     
    633621#if H_MV
    634622
    635 #if H_MV_6_HRD_O0217_13
    636623  // DBP Size
    637624  ("SubLayerFlagInfoPresentFlag",  m_subLayerFlagInfoPresentFlag , false                                           , "SubLayerFlagInfoPresentFlag")
    638 #endif
    639625  // VPS VUI
    640626  ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
    641 #if H_MV_6_PS_O0223_29
    642627  ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false                                           , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
    643628  ("CrossLayerIrapAlignedFlag"   , m_crossLayerIrapAlignedFlag   , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
    644 #endif
    645629  ("BitRatePresentVpsFlag"       , m_bitRatePresentVpsFlag       , false                                           , "BitRatePresentVpsFlag       ")
    646630  ("PicRatePresentVpsFlag"       , m_picRatePresentVpsFlag       , false                                           , "PicRatePresentVpsFlag       ")
     
    651635  ("ConstantPicRateIdc"          , m_constantPicRateIdc          , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
    652636  ("AvgPicRate"                  , m_avgPicRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
    653 #if H_MV_6_O0226_37
    654637  ("TilesNotInUseFlag"            , m_tilesNotInUseFlag            , true                                          , "TilesNotInUseFlag            ")
    655638  ("TilesInUseFlag"               , m_tilesInUseFlag               , std::vector< Bool >(1,false)                   , "TilesInUseFlag               ")
     
    657640  ("WppNotInUseFlag"              , m_wppNotInUseFlag              , true                                          , "WppNotInUseFlag              ")
    658641  ("WppInUseFlag"                 , m_wppInUseFlag                 , std::vector< Bool >(1,0)                      , "WppInUseFlag                 ")
    659 #endif
    660642  ("TileBoundariesAlignedFlag"   , m_tileBoundariesAlignedFlag   , std::vector< Bool >(1,0)  ,MAX_NUM_LAYERS       , "TileBoundariesAlignedFlag    per direct reference for the N-th layer")
    661643  ("IlpRestrictedRefLayersFlag"  , m_ilpRestrictedRefLayersFlag  , false                                           , "IlpRestrictedRefLayersFlag")
     
    787769#endif
    788770#if H_3D_IV_MERGE
    789 #if QC_DEPTH_IV_MRG_F0125 
    790771  ("IvMvPred",                        m_ivMvPredFlag            , std::vector<Bool>(2, true)            , "inter view motion prediction " )
    791 #else
    792   ("IvMvPred",                        m_ivMvPredFlag,           true            , "inter view motion prediction " ) 
    793 #endif
    794772#endif
    795773#if H_3D_NBDV_REF
     
    10741052  xResizeVector( m_bLoopFilterDisable );
    10751053  xResizeVector( m_bUseSAO );
    1076 #if H_MV_LAYER_WISE_STARTUP
    10771054  xResizeVector( m_iIntraPeriod );
    1078 #endif
    1079 #if H_MV_6_O0226_37
    10801055  xResizeVector( m_tilesInUseFlag );
    10811056  xResizeVector( m_loopFilterNotAcrossTilesFlag );
    10821057  xResizeVector( m_wppInUseFlag );
    1083 #endif
    10841058#else
    10851059  m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
     
    14261400    for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++ )
    14271401    {
    1428 #if H_MV_6_LAYER_ID_32
    14291402      xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than MAX_NUM_LAYER_IDS" );
    1430 #else
    1431       xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than 64" );
    1432 #endif
    14331403    }
    14341404  }
     
    14561426  }
    14571427
    1458 #if H_MV_6_PS_0109_25
    14591428  xConfirmPara( m_defaultOneTargetOutputLayerIdc < 0 || m_defaultOneTargetOutputLayerIdc > 1, "Default one target output layer idc must be equal to 0 or equal to 1" );
    1460 #endif
    14611429  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" );
    14621430
     
    14751443  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
    14761444  xConfirmPara( m_iGOPSize > 1 &&  m_iGOPSize % 2,                                          "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
    1477 #if H_MV_LAYER_WISE_STARTUP
     1445#if H_MV
    14781446  for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    14791447  {
     
    15081476  if (m_iDecodingRefreshType == 2)
    15091477  {
    1510 #if H_MV_LAYER_WISE_STARTUP
     1478#if H_MV
    15111479    for (Int i = 0; i < m_numberOfLayers; i++ )
    15121480    {
     
    15441512  xConfirmPara( ( 0 != m_uiUseAdvResPred ) &&  ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." );
    15451513#endif
    1546 #if MTK_SPIVMP_F0110
     1514#if H_3D_SPIVMP
    15471515  xConfirmPara( m_iSubPULog2Size < 2,                                        "SubPULog2Size must be 2 or greater.");
    15481516  xConfirmPara( m_iSubPULog2Size > 6,                                        "SubPULog2Size must be 6 or smaller.");
     
    17741742  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
    17751743   * This permits the ability to omit a GOP structure specification */
    1776 #if H_MV_LAYER_WISE_STARTUP
     1744#if H_MV
    17771745  if (m_iIntraPeriod[layer] == 1 && m_GOPList[0].m_POC == -1) {
    17781746#else
     
    18031771  }
    18041772  Int numOK=0;
    1805 #if H_MV_LAYER_WISE_STARTUP
     1773#if H_MV
    18061774  xConfirmPara( m_iIntraPeriod[layer] >=0&&(m_iIntraPeriod[layer]%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
    18071775#else
    1808   xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
     1776xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
    18091777#endif
    18101778
     
    18181786 
    18191787#if H_MV
    1820 #if H_MV_LAYER_WISE_STARTUP
    18211788  if ( (m_iIntraPeriod[layer] != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) )
    1822 #else
    1823   if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) )
    1824 #endif
    18251789#else
    18261790  if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) )
     
    23472311  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    23482312  printf("Motion search range          : %d\n", m_iSearchRange );
    2349 #if H_MV_LAYER_WISE_STARTUP
     2313#if H_MV
    23502314  xPrintParaVector( "Intra period", m_iIntraPeriod );
    23512315#else
     
    25052469#endif
    25062470#if H_3D_IV_MERGE
    2507 #if QC_DEPTH_IV_MRG_F0125
    25082471  printf("IvMvPred:%d %d", m_ivMvPredFlag[0] ? 1 : 0, m_ivMvPredFlag[1] ? 1 : 0);
    2509 #else
    2510   printf("IvMvPred:%d ", m_ivMvPredFlag );
    2511 #endif
    2512 #if MTK_SPIVMP_F0110
     2472#if H_3D_SPIVMP
    25132473  printf(" SubPULog2Size:%d  " , m_iSubPULog2Size  );
    25142474#endif
     
    25182478#endif
    25192479#if H_3D_IC
    2520 #if SEC_ONLY_TEXTURE_IC_F0151
    25212480  printf( "IlluCompEnable: %d ", m_abUseIC);
    2522 #else
    2523   printf( "IlluCompEnable: %d %d ", m_abUseIC[0] ? 1 : 0, m_abUseIC[1] ? 1 : 0 );
    2524 #endif
    25252481#endif
    25262482#if H_3D_NBDV_REF
     
    25352491#if H_3D_DIM
    25362492  printf("DMM:%d ", m_useDMM );
    2537 #if !SEC_DMM3_RBC_F0147
    2538   printf("RBC:%d ", m_useRBC );
    2539 #endif
    25402493  printf("SDC:%d ", m_useSDC );
    25412494  printf("DLT:%d ", m_useDLT );
     
    25442497  printf( "interSDC: %d ", m_bDepthInterSDCFlag ? 1 : 0 );
    25452498#endif
    2546 #if SEC_MPI_ENABLING_MERGE_F0150
     2499#if H_3D_IV_MERGE
    25472500  printf( "MPI: %d ", m_bMPIFlag ? 1 : 0 );
    25482501#endif
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r738 r773  
    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_6_PS_0109_25
    9291  Int                    m_defaultOneTargetOutputLayerIdc;    ///< Output highest layer of layer sets by default when equal to 1
    93 #else
    94   Bool                   m_defaultOneTargetOutputLayerFlag;   ///< Output highest layer of layer sets by default 
    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
     
    10298  std::vector< std::vector<Int> > m_dependencyTypes;          ///< Dependency types of direct reference layers
    10399
    104 #if H_MV_6_HRD_O0217_13
    105100  // DBP Size
    106101  Bool m_subLayerFlagInfoPresentFlag;
    107 #endif
    108102
    109103  // VPS VUI
    110104  Bool m_vpsVuiPresentFlag;
    111 #if H_MV_6_PS_O0223_29
    112105  Bool m_crossLayerPicTypeAlignedFlag;
    113106  Bool m_crossLayerIrapAlignedFlag;
    114 #endif
    115107  Bool m_bitRatePresentVpsFlag;
    116108  Bool m_picRatePresentVpsFlag;
     
    121113  std::vector< std::vector<Int  > > m_constantPicRateIdc;
    122114  std::vector< std::vector<Int  > > m_avgPicRate;
    123 #if H_MV_6_O0226_37
    124115  Bool                              m_tilesNotInUseFlag;
    125116  std::vector< Bool >               m_tilesInUseFlag;
     
    128119  std::vector< Bool >               m_wppInUseFlag;
    129120
    130 #endif
    131121  std::vector< std::vector<Bool > > m_tileBoundariesAlignedFlag; 
    132122  Bool m_ilpRestrictedRefLayersFlag;
     
    136126
    137127#if H_3D_IV_MERGE
    138 #if QC_DEPTH_IV_MRG_F0125
    139128  vector<Bool>           m_ivMvPredFlag;                      ///< Interview motion vector prediction
    140 #else
    141   Bool                   m_ivMvPredFlag;                      ///< Interview motion vector prediction
    142 #endif
    143 #if MTK_SPIVMP_F0110
     129#if H_3D_SPIVMP
    144130  Int                    m_iSubPULog2Size;                   
    145131#endif
     
    150136#endif
    151137#if H_3D_IC
    152 #if SEC_ONLY_TEXTURE_IC_F0151
    153138  Bool   m_abUseIC;
    154 #else
    155   vector<Bool> m_abUseIC;                                    ///< flag for using illumination compensation for inter-view prediction
    156 #endif
    157139#endif
    158140#if H_3D_NBDV_REF
     
    196178 
    197179  // coding structure
    198 #if H_MV_LAYER_WISE_STARTUP
     180#if H_MV
    199181  std::vector<Int> m_iIntraPeriod;                            ///< period of I-slice (random access period)
    200182#else
     
    497479#if H_3D_DIM
    498480  Bool      m_useDMM;                                        ///< flag for using DMM
    499 #if !SEC_DMM3_RBC_F0147
    500   Bool      m_useRBC;                                        ///< flag for using RBC
    501 #endif
    502481  Bool      m_useSDC;                                        ///< flag for using SDC
    503482  Bool      m_useDLT;                                        ///< flag for using DLT
     
    510489  Bool m_bDepthInterSDCFlag;                                ///< flag for inter SDC of depth map coding
    511490#endif
    512 #if SEC_MPI_ENABLING_MERGE_F0150
     491#if H_3D_IV_MERGE
    513492  Bool m_bMPIFlag;                                           ///< flag for MPI of depth map coding
    514493#endif
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r758 r773  
    7676#endif
    7777 
    78 #if CAM_HLS_F0136_F0045_F0082
     78#if H_3D
    7979  vps.createCamPars(m_iNumberOfViews);
    80 #endif
    81 
    82 #if DLT_DIFF_CODING_IN_PPS
    8380  TComDLT& dlt = m_dlt;
    8481#endif
     
    134131  xSetVPSExtension2        ( vps );
    135132  m_ivPicLists.setVPS      ( &vps );
    136 #if DLT_DIFF_CODING_IN_PPS
    137133  xDeriveDltArray          ( vps, dlt );
    138 #endif
    139134#endif
    140135
     
    160155    //====== Camera Parameters =========
    161156    m_cTEncTop.setCameraParameters             ( &m_cCameraData );     
    162 #if QC_DEPTH_IV_MRG_F0125
    163157    m_cTEncTop.setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
    164158    m_cTEncTop.setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
    165159    m_cTEncTop.setCodedScale                   ( m_cCameraData.getCodedScale             () );
    166160    m_cTEncTop.setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
    167 #else
    168     m_cTEncTop.setCamParPrecision              ( isDepth ? false : m_cCameraData.getCamParsCodedPrecision  () );
    169     m_cTEncTop.setCamParInSliceHeader          ( isDepth ? 0     : m_cCameraData.getVaryingCameraParameters() );
    170     m_cTEncTop.setCodedScale                   ( isDepth ? 0     : m_cCameraData.getCodedScale             () );
    171     m_cTEncTop.setCodedOffset                  ( isDepth ? 0     : m_cCameraData.getCodedOffset            () );
    172 #endif
    173161#if H_3D_VSO
    174162    //====== VSO =========
     
    194182    m_cTEncTop.setARPStepNum                   ( ( isDepth || 0==layerIdInVps ) ? 1 : H_3D_ARP_WFNR     );
    195183#endif
    196 #if MTK_SPIVMP_F0110
     184#if H_3D_SPIVMP
    197185    m_cTEncTop.setSubPULog2Size                 (( isDepth || 0==layerIdInVps ) ? 0 : m_iSubPULog2Size   );
    198186#endif
    199187#if H_3D_IC
    200 #if SEC_ONLY_TEXTURE_IC_F0151
    201188    m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
    202 #else
    203     m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] );
    204 #endif
    205189#endif
    206190  //========== Depth intra modes ==========
    207191#if H_3D_DIM
    208192    m_cTEncTop.setUseDMM                       ( isDepth ? m_useDMM               : false );
    209 #if !SEC_DMM3_RBC_F0147
    210     m_cTEncTop.setUseRBC                       ( isDepth ? m_useRBC               : false );
    211 #endif
    212193    m_cTEncTop.setUseSDC                       ( isDepth ? m_useSDC               : false );
    213194    m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT               : false );
     
    221202    m_cTEncTop.setInterSDCEnable               ( isDepth ? m_bDepthInterSDCFlag    : false );
    222203#endif
    223 #if SEC_MPI_ENABLING_MERGE_F0150
     204#if H_3D_IV_MERGE
    224205    m_cTEncTop.setUseMPI               ( isDepth ? m_bMPIFlag    : false );
    225206#endif
     
    227208
    228209    m_cTEncTop.setIvPicLists                   ( &m_ivPicLists );
    229   // H_MV
     210#endif  // H_MV
    230211  m_cTEncTop.setVPS(&vps);
    231212
    232 #if DLT_DIFF_CODING_IN_PPS
     213#if H_3D
    233214  m_cTEncTop.setDLT(&dlt);
    234215#endif
     
    249230 
    250231  //====== Coding Structure ========
    251 #if H_MV_LAYER_WISE_STARTUP
     232#if H_MV
    252233  m_cTEncTop.setIntraPeriod                  ( m_iIntraPeriod[ layerIdInVps ] );
    253234#else
     
    796777Void TAppEncTop::xInitLib(Bool isFieldCoding)
    797778{
    798 #if CAM_HLS_F0136_F0045_F0082
     779#if H_3D
    799780  for ( Int viewIndex = 0; viewIndex < m_vps.getNumViews(); viewIndex++ )
    800781  {
     
    12701251
    12711252#if H_3D_DIM_DLT
    1272 #if DLT_DIFF_CODING_IN_PPS
    12731253Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt)
    1274 #else
    1275 Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps)
    1276 #endif
    12771254{
    12781255  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     
    13341311  if( uiNumFrames == 0 || numBitsForValue(iNumDepthValues) == g_bitDepthY )
    13351312  {
    1336 #if DLT_DIFF_CODING_IN_PPS
    13371313    dlt->setUseDLTFlag(layer, false);
    1338 #else
    1339     // don't use DLT
    1340     vps->setUseDLTFlag(layer, false);
    1341 #endif
    13421314  }
    13431315 
    13441316  // assign LUT
    1345 #if DLT_DIFF_CODING_IN_PPS
    13461317  if( dlt->getUseDLTFlag(layer) )
     1318  {
    13471319    dlt->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
    1348 #else
    1349   if( vps->getUseDLTFlag(layer) )
    1350     vps->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
    1351 #endif
     1320  }
    13521321 
    13531322  // free temporary memory
     
    13721341  Int maxViewId = xGetMax( m_viewId );
    13731342
    1374 #if H_MV_6_PS_O0109_22
    13751343  Int viewIdLen = gCeilLog2( maxViewId + 1 );
    13761344  const Int maxViewIdLen = ( 1 << 4 ) - 1;
    13771345  assert( viewIdLen <= maxViewIdLen );
    13781346  vps.setViewIdLen( viewIdLen );
    1379 #else
    1380   Int viewIdLenMinus1 = std::max( gCeilLog2( maxViewId + 1 ) - 1, 0 ) ;
    1381   const Int maxViewIdLenMinus1 = ( 1 << 4 ) - 1;
    1382   assert( viewIdLenMinus1 <= maxViewIdLenMinus1  );
    1383   vps.setViewIdLenMinus1( viewIdLenMinus1 );
    1384 #endif
    13851347  for (Int i = 0; i < m_iNumberOfViews; i++)
    13861348  {
     
    14031365    }
    14041366
    1405 #if H_MV_6_PS_O0096_21
    14061367  Int  defaultDirectDependencyType = -1;
    14071368  Bool defaultDirectDependencyFlag = true;
    1408 #endif
    14091369  for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ )
    14101370  {
     
    14151375      Int refLayer = m_directRefLayers[depLayer][i];
    14161376      vps.setDirectDependencyFlag( depLayer, refLayer, true);
    1417 #if H_MV_6_PS_O0096_21
    14181377      Int curDirectDependencyType = m_dependencyTypes[depLayer][i];
    14191378
     
    14281387     
    14291388      vps.setDirectDependencyType( depLayer, refLayer, curDirectDependencyType);       
    1430 #else
    1431       vps.setDirectDependencyType( depLayer, refLayer,m_dependencyTypes[depLayer][i]);
    1432 #endif
    1433     }
    1434   }
    1435 
    1436 #if H_MV_6_PS_O0096_21
     1389    }
     1390  }
     1391
    14371392  vps.setDefaultDirectDependencyFlag( defaultDirectDependencyFlag );       
    14381393  vps.setDefaultDirectDependencyType( defaultDirectDependencyFlag ? defaultDirectDependencyType : -1 );       
    1439 #endif
    1440 
    1441 #if H_MV_6_ILDSD_O0120_26
     1394
    14421395  // Max sub layers, + presence flag
    14431396  Bool subLayersMaxMinus1PresentFlag = false;
     
    14641417
    14651418  vps.setVpsSubLayersMaxMinus1PresentFlag( subLayersMaxMinus1PresentFlag );
    1466 #endif
    14671419
    14681420
     
    14711423  for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++)
    14721424    {
    1473 #if !H_MV_6_ILDDS_O0225_30
    1474     Int maxTid = -1;
    1475 #endif
    14761425    for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++)
    14771426      {
    1478 #if H_MV_6_ILDDS_O0225_30
    14791427      Int maxTid = -1;
    1480 #endif
    14811428      for( Int i = 0; i < getGOPSize(); i++ )
    14821429      {       
     
    14921439        }
    14931440      }
    1494 #if H_MV_6_ILDDS_O0225_30   
    14951441      vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 );
    14961442      maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 );   
    14971443    }
    1498 #else
    1499     }
    1500     vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 );
    1501     maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 );   
    1502 #endif
    15031444  }
    15041445
     
    15181459 
    15191460  // Poc Lsb Not Present Flag
    1520 #if H_MV_6_MISC_O0062_31
    15211461  for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers; layerIdInVps++)
    15221462  {
     
    15261466    }
    15271467  }
    1528 #endif
    15291468 
    15301469  // All Ref layers active flag
     
    15351474    {       
    15361475      GOPEntry ge =  m_GOPListMvc[layerIdInVps][ ( i < getGOPSize()  ? i : MAX_GOP ) ];
    1537 #if H_MV_6_ILDDS_ILREFPICS_27_34
    15381476      Int tId = ge.m_temporalId;  // Should be equal for all layers.
    15391477     
     
    15711509      }
    15721510      assert ( maxTidIlRefAndSubLayerMaxVaildFlag ); // Something wrong with MaxTidIlRefPicsPlus1 or SubLayersVpsMaxMinus1
    1573 #else
    1574       allRefLayersActiveFlag = allRefLayersActiveFlag && (ge.m_numActiveRefLayerPics == m_directRefLayers[ layerIdInVps ].size() );
    1575 #endif
    15761511    }           
    15771512  }
     
    15791514  vps.setAllRefLayersActiveFlag( allRefLayersActiveFlag );
    15801515
    1581 #if !H_MV_6_PS_O0223_29
    1582   // Currently cross layer irap aligned is always true.   
    1583   vps.setCrossLayerIrapAlignedFlag( true );
    1584 #endif
    15851516  vps.setRefLayers();
    15861517};
     
    16521583  repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight );
    16531584  repFormat->setPicWidthVpsInLumaSamples  ( m_iSourceWidth  );   
    1654 #if H_MV_6_PS_REP_FORM_18_19_20
    16551585  repFormat->setChromaAndBitDepthVpsPresentFlag( true );   
    1656 #endif
    16571586  // ToDo not supported yet.
    16581587  //repFormat->setSeparateColourPlaneVpsFlag( );
     
    16671596}
    16681597
    1669 #if H_MV_6_HRD_O0217_13
    16701598Void TAppEncTop::xSetDpbSize                ( TComVPS& vps )
    16711599{
     
    17231651  } 
    17241652}
    1725 #endif
    17261653
    17271654
     
    17431670    }
    17441671  }
    1745 #if H_MV_6_HRD_O0217_13
    17461672  vps.deriveLayerSetLayerIdList();
    1747 #endif
    17481673
    17491674  Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size();
    17501675  // Additional output layer sets + profileLevelTierIdx
    1751 #if H_MV_6_PS_0109_25
    17521676  vps.setDefaultOneTargetOutputLayerIdc   ( m_defaultOneTargetOutputLayerIdc );
    1753 #else
    1754   vps.setDefaultOneTargetOutputLayerFlag   ( m_defaultOneTargetOutputLayerFlag );
    1755 #endif
    17561677  vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets       != 0 );   
    17571678  vps.setNumAddOutputLayerSetsMinus1       ( numAddOuputLayerSets - 1        );
     
    17591680
    17601681
    1761 #if H_MV_6_HRD_O0217_13
    17621682  for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++)
    17631683  {
     
    17741694    }
    17751695  }
    1776 #else
    1777   for (Int lsIdx = 1; lsIdx < m_vpsNumLayerSets; lsIdx++)
    1778   {
    1779     vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] );
    1780   }
    1781 #endif
    17821696
    17831697  for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ )
     
    18021716    }
    18031717  }
    1804 #if H_MV_6_HRD_O0217_13
    18051718  vps.deriveTargetLayerIdLists();
    1806 #endif
    18071719}
    18081720
     
    18211733    // however preliminary setting it from input parameters
    18221734
    1823 #if H_MV_6_PS_O0223_29
    18241735    pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag );
    18251736    pcVPSVUI->setCrossLayerIrapAlignedFlag   ( m_crossLayerIrapAlignedFlag    );
    1826 #endif
    18271737
    18281738    pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag );
     
    18631773    }
    18641774
    1865 #if H_MV_6_O0226_37
    18661775    pcVPSVUI->setTilesNotInUseFlag( m_tilesNotInUseFlag );
    18671776
     
    18991808      }
    19001809    }
    1901 #else
    1902     for( Int i = 1; i  <=  vps.getMaxLayersMinus1(); i++ )
    1903     {
    1904       for( Int  j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ); j++ )
    1905       {
    1906         if ( m_tileBoundariesAlignedFlag[i].size() > j )
    1907         {
    1908           pcVPSVUI->setTileBoundariesAlignedFlag( i, j, m_tileBoundariesAlignedFlag[i][j]);
    1909         }
    1910       }
    1911     }
    1912 #endif
    19131810
    19141811    pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag );
     
    19411838      }
    19421839    }     
    1943 #if H_MV_6_PS_O0118_33
    19441840    pcVPSVUI->setVideoSignalInfoIdxPresentFlag( true );
    19451841    pcVPSVUI->setVpsNumVideoSignalInfoMinus1  ( 0    );
     
    19611857      pcVPSVUI->setVpsVideoSignalInfoIdx( i, 0 );
    19621858    }
    1963 #endif
    1964 #if H_MV_6_HRD_O0164_15
    19651859    pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD
    1966 #endif
    19671860  }
    19681861}
     
    19711864Void TAppEncTop::xSetVPSExtension2( TComVPS& vps )
    19721865{
    1973 
    19741866  for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ )
    19751867  {
     
    19811873    vps.setARPStepNum      ( layer, ( isDepth || isLayerZero ) ? 1 : H_3D_ARP_WFNR     );
    19821874#endif 
    1983 #if MTK_SPIVMP_F0110
     1875#if H_3D_SPIVMP
    19841876    if( isDepth )
    19851877    {
    1986 #if MTK_F0110_FIX
    19871878      vps.setSubPULog2Size         ( layer, (layer != 1) ? 6: 0 );
    1988 #else
    1989       vps.setSubPULog2Size         ( layer, (layer != 1) ? m_iSubPULog2Size: 0 );
    1990 #endif
    19911879    }
    19921880    else
     
    19971885
    19981886#if H_3D_DIM
    1999 #if SEC_DMM3_RBC_F0147
    20001887    vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useSDC || m_useDLT ) );
    2001 #else
    2002     vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useRBC || m_useSDC || m_useDLT ) );
    2003 #endif
    2004 #if H_3D_DIM_DLT
    2005 #if !DLT_DIFF_CODING_IN_PPS
    2006     vps.setUseDLTFlag( layer , isDepth && m_useDLT );
    2007     if( vps.getUseDLTFlag( layer ) )
    2008     {
    2009 #if H_MV_LAYER_WISE_STARTUP
    2010       xAnalyzeInputBaseDepth(layer, max(  m_iIntraPeriod[layer], 24), &vps);
    2011 #else
    2012       xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps);
    2013 #endif
    2014     }
    2015 #endif
    2016 #endif
    20171888#endif
    20181889
    20191890#if H_3D_IV_MERGE
    2020 #if QC_DEPTH_IV_MRG_F0125
    20211891    if( isDepth )
    20221892    {
     
    20271897      vps.setIvMvPredFlag         ( layer, !isLayerZero && m_ivMvPredFlag[0] );
    20281898    }
    2029 #else
    2030     vps.setIvMvPredFlag         ( layer, !isLayerZero && !isDepth && m_ivMvPredFlag );
    2031 #endif
    20321899#endif
    20331900#if H_3D_NBDV_REF
     
    20401907    vps.setInterSDCFlag( layer, !isLayerZero && isDepth && m_bDepthInterSDCFlag );
    20411908#endif
    2042 #if SEC_MPI_ENABLING_MERGE_F0150
     1909#if H_3D_IV_MERGE
    20431910    vps.setMPIFlag( layer, !isLayerZero && isDepth && m_bMPIFlag );
    20441911#endif
     
    20481915#endif
    20491916}
    2050 #endif
    2051 
    2052 #if DLT_DIFF_CODING_IN_PPS
     1917
    20531918Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT& dlt )
    20541919{
     
    20801945}
    20811946#endif
    2082 #endif
     1947
    20831948//! \}
  • trunk/source/App/TAppEncoder/TAppEncTop.h

    r758 r773  
    8686#endif
    8787
    88 #if DLT_DIFF_CODING_IN_PPS
     88#if H_3D
    8989  TComDLT                    m_dlt;                         ///< dlt
    9090#endif
     
    129129  Void xSetProfileTierLevel       ( TComVPS& vps );
    130130  Void xSetRepFormat              ( TComVPS& vps );
    131 #if H_MV_6_HRD_O0217_13
    132131  Void xSetDpbSize                ( TComVPS& vps );
    133 #endif
    134132  Void xSetVPSVUI                 ( TComVPS& vps );
    135133  GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc );
     
    138136#if H_3D
    139137  Void xSetVPSExtension2( TComVPS& vps );
    140 #endif
    141 #if DLT_DIFF_CODING_IN_PPS
    142138  Void xDeriveDltArray( TComVPS& vps, TComDLT& dlt );
    143139#endif
    144140#if H_3D_DIM_DLT
    145 #if DLT_DIFF_CODING_IN_PPS
    146141  Void  xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt);
    147 #else
    148   Void  xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps);
    149 #endif
    150142#endif
    151143public:
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r724 r773  
    109109#define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
    110110#define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
    111 #if QC_DIM_DELTADC_UNIFY_F0132
    112111#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
    113 #else
    114 #define NUM_DDC_DATA_CTX              2       ///< number of context models for deltaDC data (DMM or RBC)
    115 #endif
    116112#if H_3D_DIM_DMM
    117113#define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
    118 #if !SEC_DMM3_RBC_F0147
    119 #define NUM_DMM3_DATA_CTX             1       ///< number of context models for DMM3 data
    120 #endif
    121 #endif
    122 #if H_3D_DIM_RBC
    123 #define NUM_RBC_DATA_CTX              1       ///< number of context models for RBC data
    124114#endif
    125115#endif
     
    377367INIT_ARPW[3][NUM_ARPW_CTX] =
    378368{
    379 #if LGE_ARP_CTX_F0161
    380369    { 162, 153, 154, 162 },
    381370    { 162, 153, 154, 162 },
    382371    { 162, 153, 154, 162 },
    383 #else
    384   { 154, 154, 154, 154 },
    385   { 154, 154, 154, 154 },
    386   { 154, 154, 154, 154 },
    387 #endif
    388372};
    389373#endif
     
    393377INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 
    394378{
    395 #if LGE_IC_CTX_F0160
    396379    { 154,  154,  154, },
    397380    { 154,  154,  154, },
    398381    { 154,  154,  154, },
    399 #else
    400   { CNU,  CNU,  CNU, },
    401   { 197,  185,  201, },
    402   { 197,  185,  201, },
    403 #endif
    404382};
    405383#endif
     
    423401INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] =
    424402{
    425 #if QC_DIM_DELTADC_UNIFY_F0132
    426   { 154 },
    427   { 154 },
    428   { 154 },
    429 #else
    430   { CNU, CNU },
    431   { CNU, CNU },
    432   { CNU, CNU },
    433 #endif
     403  { 154 },
     404  { 154 },
     405  { 154 },
    434406};
    435407#if H_3D_DIM_DMM
     
    441413  { CNU },
    442414};
    443 #if !SEC_DMM3_RBC_F0147
    444 static const UChar
    445 INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] =
    446 {
    447   { CNU },
    448   { CNU },
    449   { CNU },
    450 };
    451 #endif
    452 #endif
    453 #if H_3D_DIM_RBC
    454 static const UChar
    455 INIT_RBC_DATA[3][NUM_RBC_DATA_CTX] =
    456 {
    457   { CNU },
    458   { CNU },
    459   { CNU },
    460 };
    461415#endif
    462416#if H_3D_DIM_SDC
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r724 r773  
    120120    m_dmmWedgeTabIdx[i] = NULL;
    121121  }
    122 #if !SEC_DMM3_RBC_F0147
    123   m_dmm3IntraTabIdx = NULL;
    124 #endif
    125 #endif
    126 #if H_3D_DIM_RBC
    127   m_pucEdgeCode     = NULL;
    128   m_pucEdgeNumber   = NULL;
    129   m_pucEdgeStartPos = NULL;
    130   m_pbEdgeLeftFirst = NULL;
    131   m_pbEdgePartition = NULL;
    132122#endif
    133123#if H_3D_DIM_SDC
     
    146136  m_piVSPFlag            = NULL;
    147137#endif
    148 #if MTK_SPIVMP_F0110
     138#if H_3D_SPIVMP
    149139  m_pbSPIVMPFlag         = NULL;
    150140#endif
     
    200190    m_piVSPFlag          = (Char*  )xMalloc(Char,   uiNumPartition);
    201191#endif
    202 #if MTK_SPIVMP_F0110
     192#if H_3D_SPIVMP
    203193    m_pbSPIVMPFlag       = (Bool*  )xMalloc(Bool,   uiNumPartition);
    204194#endif
     
    279269      m_dmmWedgeTabIdx[i]    = (UInt*)xMalloc(UInt, uiNumPartition);
    280270    }
    281 #if !SEC_DMM3_RBC_F0147
    282     m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition);
    283 #endif
    284 #endif
    285 #if H_3D_DIM_RBC
    286     m_pucEdgeCode     = (UChar*)xMalloc(UChar, uiNumPartition * RBC_MAX_EDGE_NUM_PER_4x4);
    287     m_pucEdgeNumber   = (UChar*)xMalloc(UChar, uiNumPartition);
    288     m_pucEdgeStartPos = (UChar*)xMalloc(UChar, uiNumPartition);
    289     m_pbEdgeLeftFirst = (Bool*)xMalloc(Bool, uiNumPartition);
    290     m_pbEdgePartition = (Bool*)xMalloc(Bool, uiNumPartition * 16);
    291271#endif
    292272#if H_3D_DIM_SDC
     
    362342    if ( m_piVSPFlag          ) { xFree(m_piVSPFlag);           m_piVSPFlag         = NULL; }
    363343#endif
    364 #if MTK_SPIVMP_F0110
     344#if H_3D_SPIVMP
    365345    if ( m_pbSPIVMPFlag       ) { xFree(m_pbSPIVMPFlag);           m_pbSPIVMPFlag         = NULL; }
    366346#endif
     
    417397      if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; }
    418398    }
    419 #if !SEC_DMM3_RBC_F0147
    420     if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; }
    421 #endif
    422 #endif
    423 #if H_3D_DIM_RBC
    424     if ( m_pbEdgeLeftFirst ) { xFree( m_pbEdgeLeftFirst ); m_pbEdgeLeftFirst = NULL; }
    425     if ( m_pucEdgeStartPos ) { xFree( m_pucEdgeStartPos ); m_pucEdgeStartPos = NULL; }
    426     if ( m_pucEdgeNumber   ) { xFree( m_pucEdgeNumber   ); m_pucEdgeNumber   = NULL; }
    427     if ( m_pucEdgeCode     ) { xFree( m_pucEdgeCode     ); m_pucEdgeCode     = NULL; }
    428     if ( m_pbEdgePartition ) { xFree( m_pbEdgePartition ); m_pbEdgePartition = NULL; }
    429399#endif
    430400#if H_3D_DIM_SDC
     
    571541    m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui];
    572542#endif
    573 #if MTK_SPIVMP_F0110
     543#if H_3D_SPIVMP
    574544    m_pbSPIVMPFlag[ui] = pcFrom->m_pbSPIVMPFlag[ui];
    575545#endif
     
    616586    memset( m_piVSPFlag         + firstElement, 0,                        numElements * sizeof( *m_piVSPFlag ) );
    617587#endif
    618 #if MTK_SPIVMP_F0110
     588#if H_3D_SPIVMP
    619589    memset( m_pbSPIVMPFlag      + firstElement, 0,                        numElements * sizeof( *m_pbSPIVMPFlag ) );
    620590#endif
     
    643613      memset( m_dmmWedgeTabIdx[i] + firstElement, 0,                      numElements * sizeof( *m_dmmWedgeTabIdx[i] ) );
    644614    }
    645 #if !SEC_DMM3_RBC_F0147
    646     memset( m_dmm3IntraTabIdx   + firstElement, 0,                        numElements * sizeof( *m_dmm3IntraTabIdx ) );
    647 #endif
    648 #endif
    649 #if H_3D_DIM_RBC
    650     memset( m_pucEdgeCode       + firstElement, 0,                        numElements * sizeof( *m_pucEdgeCode     ) * RBC_MAX_EDGE_NUM_PER_4x4 );
    651     memset( m_pucEdgeNumber     + firstElement, 0,                        numElements * sizeof( *m_pucEdgeNumber   ) );
    652     memset( m_pucEdgeStartPos   + firstElement, 0,                        numElements * sizeof( *m_pucEdgeStartPos ) );
    653     memset( m_pbEdgeLeftFirst   + firstElement, false,                    numElements * sizeof( *m_pbEdgeLeftFirst ) );
    654     memset( m_pbEdgePartition   + firstElement, false,                    numElements * sizeof( *m_pbEdgePartition ) * 16 );
    655615#endif
    656616#if H_3D_DIM_SDC
     
    799759      m_piVSPFlag[ui] = 0;
    800760#endif
    801 #if MTK_SPIVMP_F0110
     761#if H_3D_SPIVMP
    802762      m_pbSPIVMPFlag[ui] = 0;
    803763#endif
     
    825785        m_dmmWedgeTabIdx[i] [ui] = 0;
    826786      }
    827 #if !SEC_DMM3_RBC_F0147
    828       m_dmm3IntraTabIdx [ui] = 0;
    829 #endif
    830787#endif
    831788#if H_3D_DIM_SDC
     
    902859  memset( m_piVSPFlag,          0, sizeof( Char  ) * m_uiNumPartition );
    903860#endif
    904 #if MTK_SPIVMP_F0110
     861#if H_3D_SPIVMP
    905862  memset( m_pbSPIVMPFlag,       0, sizeof( Bool  ) * m_uiNumPartition );
    906863#endif
     
    941898    memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition );
    942899  }
    943 #if !SEC_DMM3_RBC_F0147
    944   memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition );
    945 #endif
    946 #endif
    947 #if H_3D_DIM_RBC
    948   memset( m_pucEdgeCode    , 0, iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
    949   memset( m_pucEdgeNumber  , 0, iSizeInUchar );
    950   memset( m_pucEdgeStartPos, 0, iSizeInUchar );
    951   memset( m_pbEdgeLeftFirst, 0, iSizeInBool );
    952   memset( m_pbEdgePartition, 0, iSizeInBool * 16 );
    953900#endif
    954901#if H_3D_DIM_SDC
     
    1001948      m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui];
    1002949#endif
    1003 #if MTK_SPIVMP_F0110
     950#if H_3D_SPIVMP
    1004951      m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui];
    1005952#endif
     
    1028975        m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui];
    1029976      }
    1030 #if !SEC_DMM3_RBC_F0147
    1031       m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui];
    1032 #endif
    1033977#endif
    1034978#if H_3D_DIM_SDC
     
    11541098  m_piVSPFlag           = pcCU->getVSPFlag()          + uiPart;
    11551099#endif
    1156 #if MTK_SPIVMP_F0110
     1100#if H_3D_SPIVMP
    11571101  m_pbSPIVMPFlag        = pcCU->getSPIVMPFlag()          + uiPart;
    11581102#endif
     
    11871131    m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart;
    11881132  }
    1189 #if !SEC_DMM3_RBC_F0147
    1190   m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart;
    1191 #endif
    1192 #endif
    1193 #if H_3D_DIM_RBC
    1194   m_pucEdgeCode     = pcCU->getEdgeCode( uiPart );
    1195   m_pucEdgeNumber   = pcCU->getEdgeNumber()      + uiPart;
    1196   m_pucEdgeStartPos = pcCU->getEdgeStartPos()    + uiPart;
    1197   m_pbEdgeLeftFirst = pcCU->getEdgeLeftFirst()   + uiPart;
    1198   m_pbEdgePartition = pcCU->getEdgePartition( uiPart );
    11991133#endif
    12001134#if H_3D_DIM_SDC
     
    13131247  m_pDvInfo            = pcCU->getDvInfo()                + uiAbsPartIdx;
    13141248#endif
    1315 #if MTK_SPIVMP_F0110
     1249#if H_3D_SPIVMP
    13161250  m_pbSPIVMPFlag       = pcCU->getSPIVMPFlag()               + uiAbsPartIdx;
    13171251#endif
     
    13651299
    13661300#endif
    1367 #if MTK_SPIVMP_F0110
     1301#if H_3D_SPIVMP
    13681302  memcpy( m_pbSPIVMPFlag        + uiOffset, pcCU->getSPIVMPFlag(),        sizeof( Bool ) * uiNumPartition );
    13691303#endif
     
    13911325    memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition );
    13921326  }
    1393 #if !SEC_DMM3_RBC_F0147
    1394   memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition );
    1395 #endif
    1396 #endif
    1397 #if H_3D_DIM_RBC
    1398   memcpy( getEdgeCode( uiOffset ),       pcCU->getEdgeCode(0),      iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
    1399   memcpy( getEdgeNumber()    + uiOffset, pcCU->getEdgeNumber(),     iSizeInUchar );
    1400   memcpy( getEdgeStartPos()  + uiOffset, pcCU->getEdgeStartPos(),   iSizeInUchar );
    1401   memcpy( getEdgeLeftFirst() + uiOffset, pcCU->getEdgeLeftFirst(),  iSizeInBool );
    1402   memcpy( getEdgePartition( uiOffset ),  pcCU->getEdgePartition(0), iSizeInBool * 16 );
    14031327#endif
    14041328#if H_3D_DIM_SDC
     
    14971421  memcpy( rpcCU->getDvInfo()            + m_uiAbsIdxInLCU, m_pDvInfo,             sizeof( *m_pDvInfo ) * m_uiNumPartition );
    14981422#endif
    1499 #if MTK_SPIVMP_F0110
     1423#if H_3D_SPIVMP
    15001424  memcpy( rpcCU->getSPIVMPFlag()        + m_uiAbsIdxInLCU, m_pbSPIVMPFlag,        sizeof( Bool ) * m_uiNumPartition );
    15011425#endif
     
    15231447    memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition );
    15241448  }
    1525 #if !SEC_DMM3_RBC_F0147
    1526   memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition );
    1527 #endif
    1528 #endif
    1529 #if H_3D_DIM_RBC
    1530   memcpy( rpcCU->getEdgeCode( m_uiAbsIdxInLCU ),         m_pucEdgeCode,     iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
    1531   memcpy( rpcCU->getEdgeNumber()      + m_uiAbsIdxInLCU, m_pucEdgeNumber,   iSizeInUchar );
    1532   memcpy( rpcCU->getEdgeStartPos()    + m_uiAbsIdxInLCU, m_pucEdgeStartPos, iSizeInUchar );
    1533   memcpy( rpcCU->getEdgeLeftFirst()   + m_uiAbsIdxInLCU, m_pbEdgeLeftFirst, iSizeInBool );
    1534   memcpy( rpcCU->getEdgePartition( m_uiAbsIdxInLCU ),    m_pbEdgePartition, iSizeInBool * 16 );
    15351449#endif
    15361450#if H_3D_DIM_SDC
     
    16161530  memcpy( rpcCU->getVSPFlag()           + uiPartOffset, m_piVSPFlag,           sizeof(Char) * uiQNumPart );
    16171531#endif
    1618 #if MTK_SPIVMP_F0110
     1532#if H_3D_SPIVMP
    16191533  memcpy( rpcCU->getSPIVMPFlag()        + uiPartOffset, m_pbSPIVMPFlag,        sizeof(Bool) * uiQNumPart );
    16201534#endif
     
    16411555    memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart );
    16421556  }
    1643 #if !SEC_DMM3_RBC_F0147
    1644   memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart );
    1645 #endif
    1646 #endif
    1647 #if H_3D_DIM_RBC
    1648   memcpy( rpcCU->getEdgeCode( uiPartOffset ),         m_pucEdgeCode,     iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
    1649   memcpy( rpcCU->getEdgeNumber()      + uiPartOffset, m_pucEdgeNumber,   iSizeInUchar );
    1650   memcpy( rpcCU->getEdgeStartPos()    + uiPartOffset, m_pucEdgeStartPos, iSizeInUchar );
    1651   memcpy( rpcCU->getEdgeLeftFirst()   + uiPartOffset, m_pbEdgeLeftFirst, iSizeInBool );
    1652   memcpy( rpcCU->getEdgePartition( uiPartOffset ),    m_pbEdgePartition, iSizeInBool * 16 );
    16531557#endif
    16541558#if H_3D_DIM_SDC
     
    23752279  UInt        uiCtx = 0;
    23762280
    2377 #if LGE_IC_CTX_F0160
    23782281  TComDataCU* pcTempCU = NULL;
    23792282  UInt        uiTempPartIdx = 0;
     
    23842287  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    23852288  uiCtx    += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
    2386 #endif
    23872289
    23882290  return uiCtx;
     
    27452647}
    27462648
    2747 #if MTK_SPIVMP_F0110
     2649#if H_3D_SPIVMP
    27482650Void TComDataCU::setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    27492651{
     
    33453247 *   false: otherwise
    33463248 */
    3347 #if ETRIKHU_MERGE_REUSE_F0093
    33483249inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    33493250  Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3350 #else
    3351 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    3352                                      Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag )
    3353 #endif
    3354 {
     3251  {
    33553252  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )
    33563253  {
     
    33673264  }
    33683265
    3369 #if ETRIKHU_MERGE_REUSE_F0093
    33703266  rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3371 #endif
    33723267 
    33733268  Bool  refViewAvailFlag = false;
     
    34543349
    34553350#if H_3D_IV_MERGE
    3456 #if ETRIKHU_MERGE_REUSE_F0093
    34573351inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,
    34583352  Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3459 #else
    3460 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,
    3461                                        Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag )
    3462 #endif
    34633353{
    34643354  for(Int iLoop = 0; iLoop < 2; iLoop ++ )
     
    34793369        clipMv( cMv );
    34803370
    3481 #if ETRIKHU_MERGE_REUSE_F0093
    34823371        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3483 #endif
    34843372
    34853373        abCandIsInter        [ iCount ] = true;
     
    35023390    if(ivCandDir[iLoop + 2])
    35033391    {
    3504 #if ETRIKHU_MERGE_REUSE_F0093
    35053392      TComMvField tmpMV[2];
    35063393      UChar tmpDir = ivCandDir[iLoop + 2];
    3507 #else
    3508       abCandIsInter        [ iCount ] = true;
    3509       puhInterDirNeighbours[ iCount ] = ivCandDir[iLoop + 2];
    3510 #endif
    35113394      if( ( ivCandDir[iLoop + 2] & 1 ) == 1 )
    35123395      {
    3513 #if ETRIKHU_MERGE_REUSE_F0093
    35143396        tmpMV[0].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] );
    3515 #else
    3516         pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] );
    3517 #endif
    35183397      }
    35193398      if( ( ivCandDir[iLoop + 2] & 2 ) == 2 )
    35203399      {
    3521 #if ETRIKHU_MERGE_REUSE_F0093
    35223400        tmpMV[1].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
    3523 #else
    3524         pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
    3525 #endif
    35263401      }
    35273402     
     
    35303405      if( !iLoop && ivCandDir[0] > 0)
    35313406      {
    3532 #if ETRIKHU_MERGE_REUSE_F0093
    35333407        if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1])
    3534 #else
    3535         if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0 ]== pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[1]==pcMvFieldNeighbours[(iCount<<1)+1])
    3536 #endif
    35373408        {
    35383409            bRemove                         = true;
    3539 #if !ETRIKHU_MERGE_REUSE_F0093
    3540             abCandIsInter        [ iCount ] = false; 
    3541             puhInterDirNeighbours[ iCount ] = 0;
    3542             TComMv  cZeroMv;
    3543             pcMvFieldNeighbours  [ iCount<<1   ].setMvField( cZeroMv, NOT_VALID );
    3544             pcMvFieldNeighbours  [(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    3545 #endif
    35463410        }
    35473411      }
    35483412      if(!bRemove)
    35493413      {
    3550 
    3551 #if ETRIKHU_MERGE_REUSE_F0093
    35523414        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    35533415
     
    35623424          pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
    35633425        }
    3564 #endif
    3565 
    35663426#if H_3D_NBDV
    35673427        if(iLoop) // For IvMcShift candidate
     
    36033463#endif
    36043464
    3605 
    3606 
    3607 
    3608 
    3609 
    3610 
    3611 
    3612 
    3613 #if ETRIKHU_MERGE_REUSE_F0093
     3465#if H_3D
    36143466Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV)
    36153467{
     
    39993851 * \param numValidMergeCand
    40003852 */
    4001 #if ETRIKHU_MERGE_REUSE_F0093
     3853#if H_3D
    40023854Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    40033855#else
     
    40083860      , InheritedVSPDisInfo*  inheritedVSPDisInfo
    40093861#endif
    4010 #if MTK_SPIVMP_F0110
     3862#if H_3D_SPIVMP
    40113863      , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    40123864#endif
     
    40243876  Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
    40253877#endif
    4026 #if ETRIKHU_MERGE_REUSE_F0093
     3878#if H_3D
    40273879  TComMvField tmpMV[2];
    40283880  UChar tmpDir;
     
    40463898  {
    40473899    abCandIsInter[ui] = false;
    4048 #if H_3D_IV_MERGE
    4049     pcMvFieldNeighbours[ ( ui << 1 )     ].setMvField(cZeroMv, NOT_VALID);
    4050     pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID);
    4051 #else
    40523900    pcMvFieldNeighbours[ ( ui << 1 )     ].setRefIdx(NOT_VALID);
    40533901    pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID);
    4054 #endif
    40553902  }
    40563903#endif
     
    40693916
    40703917  UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB;
    4071 #if !ETRIKHU_MERGE_REUSE_F0093
     3918#if !H_3D
    40723919  PartSize cCurPS = getPartitionSize( uiAbsPartIdx );
    40733920#endif
    40743921  deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
    40753922  deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
    4076 #if SEC_MPI_ENABLING_MERGE_F0150
     3923#if H_3D
    40773924  Bool bMPIFlag   = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() );
    4078 #endif
    4079 #if QC_DEPTH_IV_MRG_F0125
    40803925  Bool bIsDepth = getSlice()->getIsDepth();
    4081 #if !BUGFIX_F0093
    4082   Bool bDepthIPMCAvai = false;
    4083 #endif
    40843926#endif
    40853927
    4086 #if LGE_SHARP_VSP_INHERIT_F0104
    40873928#if H_3D_IC
    40883929  Bool bICFlag = getICFlag(uiAbsPartIdx);
     
    40913932  Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false;
    40923933#endif
    4093 #endif
    4094 
    4095 #if ETRIKHU_MERGE_REUSE_F0093
     3934
     3935#if H_3D
    40963936  Int  iPosLeftAbove[2] = {-1, -1};
    40973937
     
    41183958#if H_3D_VSP
    41193959    if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
    4120 #if LGE_SHARP_VSP_INHERIT_F0104
    41213960#if H_3D_IC
    41223961      && !bICFlag
     
    41253964      && !bARPFlag
    41263965#endif
    4127 #endif
    41283966      )
    41293967    {
    41303968      vspFlag[numA1B1B0] = 1;
    4131 #if !MTK_VSP_SIMPLIFICATION_F0111
    4132       xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);
    4133 #endif
    41343969    }
    41353970#endif
     
    41453980    iPosLeftAbove[1] = numA1B1B0;
    41463981#if H_3D_VSP
    4147 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F0111
    41483982    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
    4149 #else
    4150     if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1
    4151 #endif
    4152 #if LGE_SHARP_VSP_INHERIT_F0104
    41533983#if H_3D_IC
    41543984      && !bICFlag
     
    41573987      && !bARPFlag
    41583988#endif
    4159 #endif
    41603989      )
    41613990    {
    41623991      vspFlag[numA1B1B0] = 1;
    4163 #if !MTK_VSP_SIMPLIFICATION_F0111
    4164       xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo);
    4165 #endif
    41663992    }
    41673993#endif
     
    41774003  {
    41784004#if H_3D_VSP
    4179 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F0111
    41804005    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
    4181 #else
    4182     if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1
    4183 #endif
    4184 #if LGE_SHARP_VSP_INHERIT_F0104
    41854006#if H_3D_IC
    41864007      && !bICFlag
     
    41894010      && !bARPFlag
    41904011#endif
    4191 #endif
    41924012      )
    41934013    {
    41944014      vspFlag[numA1B1B0] = 1;
    4195 #if !MTK_VSP_SIMPLIFICATION_F0111
    4196       xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);
    4197 #endif
    41984015    }
    41994016#endif
     
    42084025#if H_3D_VSP
    42094026    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
    4210 #if LGE_SHARP_VSP_INHERIT_F0104
    42114027#if H_3D_IC
    42124028      && !bICFlag
     
    42154031      && !bARPFlag
    42164032#endif
    4217 #endif
    42184033      )
    42194034    {
    42204035      vspFlag[numA1B1B0] = 1;
    4221 #if !MTK_VSP_SIMPLIFICATION_F0111
    4222       xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);
    4223 #endif
    42244036    }
    42254037#endif
     
    42354047  {
    42364048#if H_3D_VSP
    4237 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F0111
    42384049    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
    4239 #else
    4240     if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1
    4241 #endif
    4242 #if LGE_SHARP_VSP_INHERIT_F0104
    42434050#if H_3D_IC
    42444051      && !bICFlag
     
    42474054      && !bARPFlag
    42484055#endif
    4249 #endif
    42504056      )
    42514057    {
    42524058      vspFlag[numA1B1B0+iCountHEVC] = 1;
    4253 #if !MTK_VSP_SIMPLIFICATION_F0111
    4254       xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);
    4255 #endif
    42564059    }
    42574060#endif
     
    42654068
    42664069#if H_3D_IV_MERGE
    4267  
     4070
    42684071  /////////////////////////////////////////////
    42694072  //////// TEXTURE MERGE CANDIDATE (T) ////////
    42704073  /////////////////////////////////////////////
    4271  
    4272 #if SEC_MPI_ENABLING_MERGE_F0150
     4074
    42734075  if( bMPIFlag)
    4274 #else
    4275   if( m_pcSlice->getIsDepth())
    4276 #endif
    42774076  {
    42784077    UInt uiPartIdxCenter;
    42794078    xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );   
    4280 
    4281 #if ETRIKHU_MERGE_REUSE_F0093
    42824079    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    42834080    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    42844081    Int tRef[2]={-1, -1};
    4285 #endif
    42864082
    42874083#if H_3D_FCO
     
    42894085    TComDataCU *pcTextureCU = 0;
    42904086    if ( pcTexturePic )
    4291         pcTextureCU = pcTexturePic->getCU( getAddr() );
     4087      pcTextureCU = pcTexturePic->getCU( getAddr() );
    42924088#else
    42934089    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
    42944090#endif
    4295  
     4091
    42964092#if H_3D_FCO
    42974093    if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
     
    43004096#endif
    43014097    {
    4302 #if ETRIKHU_MERGE_REUSE_F0093
    43034098      pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] );
    43044099      tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() );
     
    44144209        }
    44154210        iCount ++;
    4416 
    4417 #else
    4418       pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
    4419       Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() );
    4420       if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
    4421       {
    4422         TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
    4423         const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4424         cMvPred+=cAdd;
    4425         cMvPred>>=2;
    4426         clipMv(cMvPred);
    4427         pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef);
    4428       }
    4429       if ( getSlice()->isInterB() )
    4430       {
    4431         pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    4432         iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() );
    4433         if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) )
    4434         {
    4435           TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
    4436           const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4437           cMvPred+=cAdd;
    4438           cMvPred>>=2;
    4439           clipMv(cMvPred);
    4440           pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef);
    4441         }
    4442       }
    4443       puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0;
    4444       puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0;
    4445       if( puhInterDirNeighbours[iCount] != 0 )
    4446       {
    4447         abCandIsInter[iCount] = true;
    4448         if ( mrgCandIdx == iCount )
    4449         {
    4450           return;
    4451         }
    4452         iCount ++;
    4453       }
    4454 #endif
    4455       }
    4456     }
    4457   }
    4458 
    4459 
    4460 #if !ETRIKHU_MERGE_REUSE_F0093
    4461   //////////////////////////////////
    4462   //////// GET DISPARITIES  ////////
    4463   //////////////////////////////////
    4464 
    4465   DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
    4466   for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++)
    4467   {
    4468     inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo;
    4469   }
    4470 #endif
     4211      }
     4212    }
     4213  }
    44714214
    44724215  /////////////////////////////////////////////////////////////////
     
    44754218
    44764219  Int  posIvDC          = -1;
    4477 #if !ETRIKHU_MERGE_REUSE_F0093
    4478   Bool bLeftAvai        = false;
    4479   Int  iPosLeftAbove[2] = {-1, -1};
    4480 #endif
    44814220
    44824221  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
     
    44894228
    44904229  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    4491  
     4230
    44924231  if ( ivMvPredFlag )
    44934232  {
    4494     getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir
    4495 #if QC_DEPTH_IV_MRG_F0125
    4496     , bIsDepth
    4497 #endif
    4498 #if MTK_SPIVMP_F0110
    4499     , pcMvFieldSP, puhInterDirSP
    4500 #endif
    4501     );
     4233    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
    45024234  } 
    4503  
     4235
    45044236  ///////////////////////////////////////////////
    45054237  //////// INTER VIEW MOTION COMP(IvMC) /////////
     
    45084240  if( ivCandDir[0] )
    45094241  {
    4510 #if ETRIKHU_MERGE_REUSE_F0093
    45114242    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    45124243    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     
    45254256    Int iCnloop=0;
    45264257
    4527 #if BUGFIX_F0093
    45284258    if (!bIsDepth)
    45294259    {
    4530 #endif
    45314260      for(Int i = 0; i < 2; i ++)
    45324261      {
     
    45424271        }     
    45434272      }
    4544 #if BUGFIX_F0093
    4545     }
    4546 #endif
    4547 #if QC_DEPTH_IV_MRG_F0125
    4548 #if BUGFIX_F0093
     4273    }
    45494274    if (bIsDepth)
    4550 #else
    4551     if ( bIsDepth && !bRemoveSpa)
    4552 #endif
    45534275    {
    45544276      iCnloop = iCount-1;
    45554277      for(; iCnloop >= 0; iCnloop --)
    45564278      {
    4557 #if BUGFIX_F0093
    45584279        if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1])  // F0125 compatible with F0093
    4559 #else
    4560         if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    4561 #endif
    45624280        {
    45634281          bRemoveSpa                      = true;
     
    45654283        }
    45664284      }
    4567 #if !BUGFIX_F0093
    4568       if(!bRemoveSpa)
    4569       {
    4570         bDepthIPMCAvai = true;
    4571       }
    4572 #endif
    4573     }
    4574 #endif
     4285    }
    45754286
    45764287    if (!bRemoveSpa)
     
    46284339    if (bIvMC)
    46294340    {
    4630 #if MTK_SPIVMP_F0110
    46314341      pbSPIVMPFlag[iCount] = true;
    4632 #endif
    46334342      if( ( ivCandDir[0] & 1 ) == 1 )
    46344343      {
     
    46424351      puhInterDirNeighbours[ iCount ] = ivCandDir[0];
    46434352
    4644 #if !BUGFIX_F0093
    4645 #if QC_DEPTH_IV_MRG_F0125
    4646       if ( bDepthIPMCAvai || !bIsDepth )
    4647       {
    4648 #endif
    4649 #endif
    4650         if ( mrgCandIdx == iCount )
    4651         {
    4652           return;
    4653         }
    4654         iCount ++;
    4655 #if !BUGFIX_F0093
    4656 #if QC_DEPTH_IV_MRG_F0125
    4657       }
    4658 #endif
    4659 #endif
    4660     }
    4661 #else
    4662     abCandIsInter        [ iCount ] = true;
    4663     puhInterDirNeighbours[ iCount ] = ivCandDir[0];   
    4664 
    4665     if( ( ivCandDir[0] & 1 ) == 1 )
    4666     {
    4667       pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );
    4668     }
    4669     if( ( ivCandDir[0] & 2 ) == 2 )
    4670     {
    4671       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );
    4672     }
    4673 #if QC_DEPTH_IV_MRG_F0125
    4674     if ( bIsDepth )
    4675     {
    4676       Bool bRemoveSpa = false;
    4677       Int iCnloop = iCount-1;
    4678       for(; iCnloop >= 0; iCnloop --)
    4679       {
    4680         if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    4681         {
    4682           bRemoveSpa                      = true;
    4683           abCandIsInter        [ iCount ] = false;
    4684 
    4685           puhInterDirNeighbours[iCount]   = 0;
    4686           pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
    4687           pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    4688           break;
    4689         }
    4690       }
    4691       if(!bRemoveSpa)
    4692       {
    4693         bDepthIPMCAvai = true;
    4694       }
    4695     }
    4696     if ( bDepthIPMCAvai || !bIsDepth )
    4697     {
    4698 #endif
    46994353      if ( mrgCandIdx == iCount )
    47004354      {
     
    47024356      }
    47034357      iCount ++;
    4704 #if QC_DEPTH_IV_MRG_F0125
    4705     }
    4706 #endif
    4707 
    4708 #endif
    4709 
     4358    }
    47104359  }
    47114360
     
    47174366#endif
    47184367
    4719 
    4720 
    4721 
    4722 
    4723 #if ETRIKHU_MERGE_REUSE_F0093
     4368#if H_3D
    47244369  iCount += numA1B1B0;
    47254370#else
    4726 #if H_3D
    4727   ////////////////////////////
    4728   //////// LEFT (A1) /////////
    4729   ////////////////////////////
    4730 #endif
    47314371  //left
    47324372  UInt uiLeftPartIdx = 0;
     
    47484388      pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    47494389    }
    4750 #if H_3D_IV_MERGE
    4751     Bool bRemoveSpa = false; //pruning to inter-view candidates
    4752 #if QC_DEPTH_IV_MRG_F0125
    4753     Int  iCnloop = bDepthIPMCAvai ? (iCount-2): (iCount-1);
    4754 #else
    4755     Int  iCnloop    = iCount - 1;
    4756 #endif
    4757     for(; iCnloop >= 0; iCnloop --)
    4758     {
    4759       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    4760       {
    4761         bRemoveSpa                      = true;
    4762         abCandIsInter        [ iCount ] = false;
    4763 
    4764         //reset to the default value for MC
    4765         puhInterDirNeighbours[iCount]   = 0;
    4766         pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
    4767         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    4768         break;
    4769       }
    4770     }
    4771     if(!bRemoveSpa)
    4772     {
    4773       bLeftAvai = true;
    4774       iPosLeftAbove[0] = iCount;
    4775 #if H_3D_NBDV
    4776       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    4777       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    4778 #endif
    4779 #if H_3D_VSP
    4780       if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
    4781 #if LGE_SHARP_VSP_INHERIT_F0104
    4782 #if H_3D_IC
    4783         && !bICFlag
    4784 #endif
    4785 #if H_3D_ARP
    4786         && !bARPFlag
    4787 #endif
    4788 #endif
    4789         )
    4790       {
    4791         vspFlag[iCount] = 1;
    4792 #if !MTK_VSP_SIMPLIFICATION_F0111
    4793         xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);
    4794 #endif
    4795       }
    4796 #endif
    4797       if ( mrgCandIdx == iCount )
    4798       {
    4799         return;
    4800       }
    4801       iCount ++;
    4802     }
    4803 #else // H_3D_IV_MERGE
     4390
    48044391    if ( mrgCandIdx == iCount )
    48054392    {
     
    48074394    }
    48084395    iCount ++;
    4809 #endif // H_3D_IV_MERGE
    48104396  }
    48114397
     
    48154401    return;
    48164402  }
    4817 #if H_3D
    4818   ////////////////////////////
    4819   //////// ABOVE (B1) ////////
    4820   ////////////////////////////
    4821 #endif
     4403
    48224404  // above
    48234405  UInt uiAbovePartIdx = 0;
     
    48394421      pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    48404422    }
    4841 #if H_3D_IV_MERGE
    4842     Bool bRemoveSpa = false; //pruning to inter-view candidates
    4843 #if QC_DEPTH_IV_MRG_F0125
    4844     Int iCnloop;
    4845     if( bIsDepth )
    4846       iCnloop = (bLeftAvai && bDepthIPMCAvai) ? (iCount-3) : ((bLeftAvai || bDepthIPMCAvai)  ? (iCount-2): (iCount-1));
    4847     else
    4848       iCnloop = bLeftAvai? (iCount-2): (iCount-1);
    4849 #else
    4850     Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
    4851 #endif
    4852     for(; iCnloop >= 0; iCnloop --)
    4853     {
    4854       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    4855       {
    4856         bRemoveSpa                      = true;
    4857         abCandIsInter        [ iCount ] = false;
    4858 
    4859         //reset to the default value for MC
    4860         puhInterDirNeighbours[iCount]   = 0;
    4861 
    4862         pcMvFieldNeighbours[iCount<<1]    .setMvField( cZeroMv, NOT_VALID );
    4863         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    4864         break;
    4865       }
    4866     }
    4867 
    4868     if(!bRemoveSpa)
    4869     {
    4870       iPosLeftAbove[1] = iCount;
    4871 #if H_3D_NBDV
    4872       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    4873       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    4874 #endif
    4875 #if H_3D_VSP
    4876 #if MTK_VSP_SIMPLIFICATION_F0111
    4877       if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
    4878 #if LGE_SHARP_VSP_INHERIT_F0104
    4879 #if H_3D_IC
    4880         && !bICFlag
    4881 #endif
    4882 #if H_3D_ARP
    4883         && !bARPFlag
    4884 #endif
    4885 #endif
    4886         )
    4887 #else
    4888       if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1
    4889 #if LGE_SHARP_VSP_INHERIT_F0104
    4890 #if H_3D_IC
    4891         && !bICFlag
    4892 #endif
    4893 #if H_3D_ARP
    4894         && !bARPFlag
    4895 #endif
    4896 #endif
    4897         )
    4898 #endif
    4899       {
    4900 
    4901         vspFlag[iCount] = 1;
    4902 #if !MTK_VSP_SIMPLIFICATION_F0111
    4903         xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo);
    4904 #endif
    4905       }
    4906 #endif
    4907       if ( mrgCandIdx == iCount )
    4908       {
    4909         return;
    4910       }
    4911       iCount ++;
    4912     }
    4913 #else // H_3D_IV_MERGE
     4423
    49144424    if ( mrgCandIdx == iCount )
    49154425    {
     
    49174427    }
    49184428    iCount ++;
    4919 #endif // H_3D_IV_MERGE
    49204429  }
    49214430  // early termination
     
    49244433    return;
    49254434  }
    4926 
    4927 #if H_3D
    4928   //////////////////////////////////
    4929   //////// ABOVE RIGHT (B0) ////////
    4930   //////////////////////////////////
    4931 #endif
    49324435
    49334436  // above right
     
    49494452      pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    49504453    }
    4951 #if H_3D_NBDV
    4952     pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    4953     pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    4954 #endif
    4955 #if H_3D_VSP
    4956 #if MTK_VSP_SIMPLIFICATION_F0111
    4957     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
    4958 #if LGE_SHARP_VSP_INHERIT_F0104
    4959 #if H_3D_IC
    4960       && !bICFlag
    4961 #endif
    4962 #if H_3D_ARP
    4963       && !bARPFlag
    4964 #endif
    4965 #endif
    4966       )
    4967 #else
    4968     if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1
    4969 #if LGE_SHARP_VSP_INHERIT_F0104
    4970 #if H_3D_IC
    4971       && !bICFlag
    4972 #endif
    4973 #if H_3D_ARP
    4974       && !bARPFlag
    4975 #endif
    4976 #endif
    4977       )
    4978 #endif
    4979     {
    4980       vspFlag[iCount] = 1;
    4981 #if !MTK_VSP_SIMPLIFICATION_F0111
    4982       xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);
    4983 #endif
    4984     }
    4985 #endif
     4454
    49864455    if ( mrgCandIdx == iCount )
    49874456    {
     
    50034472  /////////////////////////////////////////////
    50044473
    5005 #if ETRIKHU_MERGE_REUSE_F0093
    50064474  if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())
    5007 #else
    5008   if( ivCandDir[1] )
    5009 #endif
    50104475  {
    50114476    assert(iCount < getSlice()->getMaxNumMergeCand());
    50124477
    5013 #if ETRIKHU_MERGE_REUSE_F0093
    50144478    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    50154479    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     
    50224486      tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
    50234487    }
    5024 #else
    5025     abCandIsInter        [ iCount ] = true;
    5026     puhInterDirNeighbours[ iCount ] = ivCandDir[1];
    5027     if( ( ivCandDir[1] & 1 ) == 1 )
    5028     {
    5029       pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );
    5030     }
    5031     if( ( ivCandDir[1] & 2 ) == 2 )
    5032     {
    5033       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
    5034     }
    5035 #endif
    50364488
    50374489    Bool bRemoveSpa = false; //pruning to A1, B1
     
    50464498      {
    50474499        bRemoveSpa                      = true;
    5048 #if !ETRIKHU_MERGE_REUSE_F0093
    5049         abCandIsInter        [ iCount ] = false;
    5050         //reset to the default value for MC
    5051         puhInterDirNeighbours[iCount]   = 0;
    5052         pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
    5053         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    5054 #endif
    50554500        break;
    50564501      }     
     
    50584503    if(!bRemoveSpa)
    50594504    {
    5060 #if ETRIKHU_MERGE_REUSE_F0093
    50614505      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    50624506      puhInterDirNeighbours[ iCount ] = ivCandDir[1];
     
    50694513        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
    50704514      }
    5071 #endif
    50724515#if H_3D_NBDV
    50734516      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
     
    50924535  //////// VIEW SYNTHESIS PREDICTION (VSP) ////////
    50934536  /////////////////////////////////////////////////
    5094 #if ETRIKHU_MERGE_REUSE_F0093
    50954537  if (iCount<getSlice()->getMaxNumMergeCand())
    50964538  {
    5097 #endif
    50984539
    50994540  if (
    5100 #if LGE_SHARP_VSP_INHERIT_F0104
    51014541#if H_3D_IC
    51024542      !bICFlag &&
     
    51054545      !bARPFlag &&
    51064546#endif
    5107 #endif
    5108 #if ETRIKHU_MERGE_REUSE_F0093
    51094547      xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
    5110 #else
    5111       xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )
    5112 #endif
    51134548  {
    51144549    return;
     
    51214556  }
    51224557#endif
    5123 #if ETRIKHU_MERGE_REUSE_F0093
    5124   }
    5125 #endif
    5126 
    5127 #if ETRIKHU_MERGE_REUSE_F0093
     4558#if H_3D
     4559  }
     4560#endif
     4561
     4562#if H_3D
    51284563  iCount += numA0B2;
    51294564#else
    5130 #if H_3D
    5131   ///////////////////////////////////
    5132   //////// LEFT BOTTOM (A0) ////////
    5133   ///////////////////////////////////
    5134 #endif
    5135 
    51364565  //left bottom
    51374566  UInt uiLeftBottomPartIdx = 0;
     
    51524581      pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    51534582    }
    5154 #if H_3D_NBDV
    5155     pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5156     pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5157 #endif
    5158 #if H_3D_VSP
    5159     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
    5160 #if LGE_SHARP_VSP_INHERIT_F0104
    5161 #if H_3D_IC
    5162         && !bICFlag
    5163 #endif
    5164 #if H_3D_ARP
    5165         && !bARPFlag
    5166 #endif
    5167 #endif
    5168         )
    5169     {
    5170       vspFlag[iCount] = 1;
    5171 #if !MTK_VSP_SIMPLIFICATION_F0111
    5172       xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);
    5173 #endif
    5174     }
    5175 #endif
    51764583    if ( mrgCandIdx == iCount )
    51774584    {
     
    51854592    return;
    51864593  }
    5187 #if H_3D
    5188   ///////////////////////////////////
    5189   //////// LEFT ABOVE (B2) ////////
    5190   ///////////////////////////////////
    5191 #endif
    51924594
    51934595  // above left
     
    52124614        pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    52134615      }
    5214 #if H_3D_NBDV
    5215       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5216       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5217 #endif
    5218 #if H_3D_VSP
    5219 #if MTK_VSP_SIMPLIFICATION_F0111
    5220       if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
    5221 #if LGE_SHARP_VSP_INHERIT_F0104
    5222 #if H_3D_IC
    5223           && !bICFlag
    5224 #endif
    5225 #if H_3D_ARP
    5226           && !bARPFlag
    5227 #endif
    5228 #endif
    5229           )
    5230 #else
    5231       if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1
    5232 #if LGE_SHARP_VSP_INHERIT_F0104
    5233 #if H_3D_IC
    5234           && !bICFlag
    5235 #endif
    5236 #if H_3D_ARP
    5237           && !bARPFlag
    5238 #endif
    5239 #endif
    5240           )
    5241 #endif
    5242       {
    5243         vspFlag[iCount] = 1;
    5244 #if !MTK_VSP_SIMPLIFICATION_F0111
    5245         xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);
    5246 #endif
    5247       }
    5248 #endif
    52494616      if ( mrgCandIdx == iCount )
    52504617      {
     
    52664633  //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
    52674634  ////////////////////////////////////////////////////
    5268 #if ETRIKHU_MERGE_REUSE_F0093
    52694635  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() )
    52704636  {
    52714637    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
    5272 #else
    5273   if(  ivMvPredFlag  )
    5274   {
    5275     if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag))
    5276 #endif
    52774638    {
    52784639      return;
     
    52864647#endif
    52874648
    5288 #if ETRIKHU_MERGE_REUSE_F0093
     4649#if H_3D
    52894650  if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
    52904651  {
     
    52974658  numValidMergeCand = iCount;
    52984659#else
    5299 #if H_3D
    5300   /////////////////////////////////
    5301   //////// Collocate (COL) ////////
    5302   /////////////////////////////////
    5303 #endif
    53044660  if ( getSlice()->getEnableTMVPFlag())
    53054661  {
     
    53664722    if ( getSlice()->isInterB() )
    53674723    {
    5368 #if H_3D_TMVP
    5369       iRefIdx = 0;
    5370 #endif
    53714724      bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);
    53724725      if( bExistMV == false )
     
    53854738      puhInterDirNeighbours[uiArrayAddr] = dir;
    53864739      abCandIsInter[uiArrayAddr] = true;
    5387 #if H_3D_NBDV
    5388       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5389       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5390 #endif
    53914740      if ( mrgCandIdx == iCount )
    53924741      {
     
    54064755  if ( getSlice()->isInterB())
    54074756  {
    5408 #if H_3D_IV_MERGE
    5409     UInt uiPriorityList0[20] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3,    0, 4, 1, 4, 2, 4, 3, 4 };
    5410     UInt uiPriorityList1[20] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2,    4, 0, 4, 1, 4, 2, 4, 3 };
    5411 #else
    54124757    UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};
    54134758    UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};
    5414 #endif
    54154759
    54164760    for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++)
    54174761    {
    54184762      Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];
    5419 #if H_3D_VSP
    5420       Bool bValid = true;
    5421       if ( vspFlag[i] == 1 || vspFlag[j] == 1 )
    5422       {
    5423         bValid = false;
    5424       }
    5425       if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) )
    5426       {
    5427         assert(bValid == true);
    5428       }
    5429 #endif
    5430 #if H_3D_VSP
    5431       if (abCandIsInter[i] && abCandIsInter[j] && (puhInterDirNeighbours[i]&0x1) && (puhInterDirNeighbours[j]&0x2) && bValid)
    5432 #else
    54334763      if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
    5434 #endif
    54354764      {
    54364765        abCandIsInter[uiArrayAddr] = true;
     
    54884817#endif
    54894818}
    5490 
    5491 
    5492 
    5493 
    54944819#else
    54954820
     
    55034828 */
    55044829Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    5505 #if H_3D_VSP
    5506       , Int* vspFlag
    5507       , InheritedVSPDisInfo*  inheritedVSPDisInfo
    5508 #endif
    55094830      , Int& numValidMergeCand, Int mrgCandIdx
    55104831)
    55114832{
    55124833  UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx;
    5513 #if H_3D_IV_MERGE
    5514   ////////////////////////////
    5515   //////// INIT LISTS ////////
    5516   ////////////////////////////
    5517   TComMv cZeroMv;
    5518   Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
    5519 #else
    55204834  Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
    5521 #endif
    55224835  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui )
    55234836  {
    55244837    abCandIsInter[ui] = false;
    5525 #if H_3D_IV_MERGE
    5526     pcMvFieldNeighbours[ ( ui << 1 )     ].setMvField(cZeroMv, NOT_VALID);
    5527     pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID);
    5528 #else
    55294838    pcMvFieldNeighbours[ ( ui << 1 )     ].setRefIdx(NOT_VALID);
    55304839    pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID);
    5531 #endif
    55324840  }
    55334841  numValidMergeCand = getSlice()->getMaxNumMergeCand();
    5534 #if H_3D
    5535   //////////////////////////////////
    5536   //////// DERIVE LOCATIONS ////////
    5537   //////////////////////////////////
    5538 #endif
    55394842  // compute the location of the current PU
    55404843  Int xP, yP, nPSW, nPSH;
     
    55474850  deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
    55484851  deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
    5549 #if SEC_MPI_ENABLING_MERGE_F0150
    5550   Bool bMPIFlag   = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() );
    5551 #endif
    5552 #if QC_DEPTH_IV_MRG_F0125
    5553   Bool bIsDepth = getSlice()->getIsDepth();
    5554   Bool bDepthIPMCAvai = false;
    5555 #endif
    5556 
    5557 #if LGE_SHARP_VSP_INHERIT_F0104
    5558 #if H_3D_IC
    5559   Bool bICFlag = getICFlag(uiAbsPartIdx);
    5560 #endif
    5561 #if H_3D_ARP
    5562   Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false;
    5563 #endif
    5564 #endif
    5565 
    5566 #if H_3D_IV_MERGE
    5567  
    5568   /////////////////////////////////////////////
    5569   //////// TEXTURE MERGE CANDIDATE (T) ////////
    5570   /////////////////////////////////////////////
    5571 
    5572 #if SEC_MPI_ENABLING_MERGE_F0150
    5573   if( bMPIFlag)
    5574 #else
    5575   if( m_pcSlice->getIsDepth())
    5576 #endif
    5577   {
    5578     UInt uiPartIdxCenter;
    5579     xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );   
    5580 #if H_3D_FCO
    5581     TComPic * pcTexturePic = m_pcSlice->getTexturePic();
    5582     TComDataCU *pcTextureCU = 0;
    5583     if ( pcTexturePic )
    5584         pcTextureCU = pcTexturePic->getCU( getAddr() );
    5585 #else
    5586     TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
    5587 #endif
    5588  
    5589 #if H_3D_FCO
    5590     if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
    5591 #else
    5592     if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
    5593 #endif
    5594     {
    5595       pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
    5596       Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() );
    5597       if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
    5598       {
    5599         TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
    5600         const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    5601         cMvPred+=cAdd;
    5602         cMvPred>>=2;
    5603         clipMv(cMvPred);
    5604         pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef);
    5605       }
    5606 
    5607       if ( getSlice()->isInterB() )
    5608       {
    5609         pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    5610         iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() );
    5611         if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) )
    5612         {
    5613           TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
    5614           const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    5615           cMvPred+=cAdd;
    5616           cMvPred>>=2;
    5617           clipMv(cMvPred);
    5618           pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef);
    5619         }
    5620       }
    5621 
    5622       puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0;
    5623       puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0;
    5624 
    5625       if( puhInterDirNeighbours[iCount] != 0 )
    5626       {
    5627         abCandIsInter[iCount] = true;
    5628         if ( mrgCandIdx == iCount )
    5629         {
    5630           return;
    5631         }
    5632         iCount ++;
    5633       }
    5634     }
    5635   }
    5636 
    5637   //////////////////////////////////
    5638   //////// GET DISPARITIES  ////////
    5639   //////////////////////////////////
    5640 
    5641   DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
    5642 
    5643   for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++)
    5644   {
    5645     inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo;
    5646   }
    5647 
    5648   /////////////////////////////////////////////////////////////////
    5649   //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC  Candidates /////
    5650   /////////////////////////////////////////////////////////////////
    5651 
    5652   Int  posIvDC          = -1;
    5653   Bool bLeftAvai        = false;
    5654   Int  iPosLeftAbove[2] = {-1, -1};
    5655 
    5656 
    5657   // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
    5658   // An enumerator would be appropriate here!
    5659   TComMv ivCandMv    [8];
    5660   Int    ivCandRefIdx[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
    5661 
    5662   // { IvMC, IvDC, IvMCShift, IvDCShift }; 
    5663   Int    ivCandDir   [4] = {0, 0, 0, 0};
    5664 
    5665   Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    5666  
    5667   if ( ivMvPredFlag )
    5668   {
    5669     getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir
    5670 #if QC_DEPTH_IV_MRG_F0125
    5671     , bIsDepth
    5672 #endif
    5673     );
    5674   } 
    5675  
    5676   ///////////////////////////////////////////////
    5677   //////// INTER VIEW MOTION COMP(IvMC) /////////
    5678   ///////////////////////////////////////////////
    5679 
    5680   if( ivCandDir[0] )
    5681   {
    5682     abCandIsInter        [ iCount ] = true;
    5683     puhInterDirNeighbours[ iCount ] = ivCandDir[0];   
    5684 
    5685     if( ( ivCandDir[0] & 1 ) == 1 )
    5686     {
    5687       pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );
    5688     }
    5689     if( ( ivCandDir[0] & 2 ) == 2 )
    5690     {
    5691       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );
    5692     }
    5693 
    5694 #if QC_DEPTH_IV_MRG_F0125
    5695     if ( bIsDepth )
    5696     {
    5697       Bool bRemoveSpa = false;
    5698       Int iCnloop = iCount-1;
    5699       for(; iCnloop >= 0; iCnloop --)
    5700       {
    5701         if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    5702         {
    5703           bRemoveSpa                      = true;
    5704           abCandIsInter        [ iCount ] = false;
    5705 
    5706           puhInterDirNeighbours[iCount]   = 0;
    5707           pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
    5708           pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    5709           break;
    5710         }
    5711       }
    5712       if(!bRemoveSpa)
    5713       {
    5714         bDepthIPMCAvai = true;
    5715       }
    5716     }
    5717     if ( bDepthIPMCAvai || !bIsDepth )
    5718     {
    5719 #endif
    5720     if ( mrgCandIdx == iCount )
    5721     {
    5722       return;
    5723     }
    5724     iCount ++;
    5725 #if QC_DEPTH_IV_MRG_F0125
    5726     }
    5727 #endif
    5728   }
    5729 
    5730   // early termination
    5731   if (iCount == getSlice()->getMaxNumMergeCand())
    5732   {
    5733     return;
    5734   }
    5735 #endif
    5736 
    5737 #if H_3D
    5738   ////////////////////////////
    5739   //////// LEFT (A1) /////////
    5740   ////////////////////////////
    5741 #endif
     4852
    57424853  //left
    57434854  UInt uiLeftPartIdx = 0;
     
    57594870      pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    57604871    }
    5761 #if H_3D_IV_MERGE
    5762     Bool bRemoveSpa = false; //pruning to inter-view candidates
    5763 #if QC_DEPTH_IV_MRG_F0125
    5764     Int  iCnloop = bDepthIPMCAvai ? (iCount-2): (iCount-1);
    5765 #else
    5766     Int  iCnloop    = iCount - 1;
    5767 #endif
    5768     for(; iCnloop >= 0; iCnloop --)
    5769     {
    5770       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    5771       {
    5772         bRemoveSpa                      = true;
    5773         abCandIsInter        [ iCount ] = false;
    5774 
    5775         //reset to the default value for MC
    5776         puhInterDirNeighbours[iCount]   = 0;
    5777         pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
    5778         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    5779         break;
    5780       }
    5781     }
    5782     if(!bRemoveSpa)
    5783     {
    5784       bLeftAvai = true;
    5785       iPosLeftAbove[0] = iCount;
    5786 #if H_3D_NBDV
    5787       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5788       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5789 #endif
    5790 #if H_3D_VSP
    5791       if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
    5792 #if LGE_SHARP_VSP_INHERIT_F0104
    5793 #if H_3D_IC
    5794           && !bICFlag
    5795 #endif
    5796 #if H_3D_ARP
    5797           && !bARPFlag
    5798 #endif
    5799 #endif
    5800           )
    5801       {
    5802         vspFlag[iCount] = 1;
    5803 #if !MTK_VSP_SIMPLIFICATION_F0111
    5804         xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);
    5805 #endif
    5806       }
    5807 #endif
    5808       if ( mrgCandIdx == iCount )
    5809       {
    5810         return;
    5811       }
    5812       iCount ++;
    5813     }
    5814 #else // H_3D_IV_MERGE
    58154872    if ( mrgCandIdx == iCount )
    58164873    {
     
    58184875    }
    58194876    iCount ++;
    5820 #endif // H_3D_IV_MERGE
    58214877  }
    58224878 
     
    58264882    return;
    58274883  }
    5828 #if H_3D
    5829   ////////////////////////////
    5830   //////// ABOVE (B1) ////////
    5831   ////////////////////////////
    5832 #endif
     4884
    58334885  // above
    58344886  UInt uiAbovePartIdx = 0;
     
    58504902      pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    58514903    }
    5852 #if H_3D_IV_MERGE
    5853     Bool bRemoveSpa = false; //pruning to inter-view candidates
    5854 #if QC_DEPTH_IV_MRG_F0125
    5855     Int iCnloop;
    5856     if( bIsDepth )
    5857       iCnloop = (bLeftAvai && bDepthIPMCAvai) ? (iCount-3) : ((bLeftAvai || bDepthIPMCAvai)  ? (iCount-2): (iCount-1));
    5858     else
    5859       iCnloop = bLeftAvai? (iCount-2): (iCount-1);
    5860 #else
    5861     Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
    5862 #endif
    5863     for(; iCnloop >= 0; iCnloop --)
    5864     {
    5865       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    5866       {
    5867         bRemoveSpa                      = true;
    5868         abCandIsInter        [ iCount ] = false;
    5869 
    5870         //reset to the default value for MC
    5871         puhInterDirNeighbours[iCount]   = 0;
    5872 
    5873         pcMvFieldNeighbours[iCount<<1]    .setMvField( cZeroMv, NOT_VALID );
    5874         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    5875         break;
    5876       }
    5877     }
    5878 
    5879     if(!bRemoveSpa)
    5880     {
    5881       iPosLeftAbove[1] = iCount;
    5882 #if H_3D_NBDV
    5883       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5884       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5885 #endif
    5886 #if H_3D_VSP
    5887 #if MTK_VSP_SIMPLIFICATION_F0111
    5888       if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
    5889 #if LGE_SHARP_VSP_INHERIT_F0104
    5890 #if H_3D_IC
    5891           && !bICFlag
    5892 #endif
    5893 #if H_3D_ARP
    5894           && !bARPFlag
    5895 #endif
    5896 #endif
    5897           )
    5898 #else
    5899       if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1
    5900 #if LGE_SHARP_VSP_INHERIT_F0104
    5901 #if H_3D_IC
    5902           && !bICFlag
    5903 #endif
    5904 #if H_3D_ARP
    5905           && !bARPFlag
    5906 #endif
    5907 #endif
    5908           )
    5909 #endif
    5910       {
    5911 
    5912         vspFlag[iCount] = 1;
    5913 #if !MTK_VSP_SIMPLIFICATION_F0111
    5914         xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo);
    5915 #endif
    5916       }
    5917 #endif
    5918       if ( mrgCandIdx == iCount )
    5919       {
    5920         return;
    5921       }
    5922       iCount ++;
    5923     }
    5924 #else // H_3D_IV_MERGE
     4904
    59254905    if ( mrgCandIdx == iCount )
    59264906    {
     
    59284908    }
    59294909    iCount ++;
    5930 #endif // H_3D_IV_MERGE
    59314910  }
    59324911  // early termination
     
    59364915  }
    59374916
    5938 #if H_3D
    5939   //////////////////////////////////
    5940   //////// ABOVE RIGHT (B0) ////////
    5941   //////////////////////////////////
    5942 #endif
    59434917
    59444918  // above right
     
    59604934      pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    59614935    }
    5962 #if H_3D_NBDV
    5963     pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5964     pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5965 #endif
    5966 #if H_3D_VSP
    5967 #if MTK_VSP_SIMPLIFICATION_F0111
    5968     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
    5969 #if LGE_SHARP_VSP_INHERIT_F0104
    5970 #if H_3D_IC
    5971         && !bICFlag
    5972 #endif
    5973 #if H_3D_ARP
    5974         && !bARPFlag
    5975 #endif
    5976 #endif
    5977         )
    5978 #else
    5979     if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1
    5980 #if LGE_SHARP_VSP_INHERIT_F0104
    5981 #if H_3D_IC
    5982         && !bICFlag
    5983 #endif
    5984 #if H_3D_ARP
    5985         && !bARPFlag
    5986 #endif
    5987 #endif
    5988         )
    5989 #endif
    5990     {
    5991       vspFlag[iCount] = 1;
    5992 #if !MTK_VSP_SIMPLIFICATION_F0111
    5993       xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);
    5994 #endif
    5995     }
    5996 #endif
    59974936    if ( mrgCandIdx == iCount )
    59984937    {
     
    60064945    return;
    60074946  }
    6008 
    6009 #if H_3D_IV_MERGE
    6010   /////////////////////////////////////////////
    6011   //////// INTER VIEW DISP COMP (IvDC) ////////
    6012   /////////////////////////////////////////////
    6013 
    6014   if( ivCandDir[1] )
    6015   {
    6016     assert(iCount < getSlice()->getMaxNumMergeCand());
    6017     abCandIsInter        [ iCount ] = true;
    6018     puhInterDirNeighbours[ iCount ] = ivCandDir[1];
    6019     if( ( ivCandDir[1] & 1 ) == 1 )
    6020     {
    6021       pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );
    6022     }
    6023     if( ( ivCandDir[1] & 2 ) == 2 )
    6024     {
    6025       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
    6026     }
    6027 
    6028     Bool bRemoveSpa = false; //pruning to A1, B1
    6029     for(Int i = 0; i < 2; i ++)
    6030     {
    6031       Int iCnloop = iPosLeftAbove[i];
    6032       if ( iCnloop == -1 )
    6033       {
    6034         continue;
    6035       }
    6036       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    6037       {
    6038         bRemoveSpa                      = true;
    6039         abCandIsInter        [ iCount ] = false;
    6040         //reset to the default value for MC
    6041         puhInterDirNeighbours[iCount]   = 0;
    6042         pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
    6043         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
    6044         break;
    6045       }     
    6046     }
    6047     if(!bRemoveSpa)
    6048     {
    6049 #if H_3D_NBDV
    6050       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    6051       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    6052 #endif
    6053       posIvDC  = iCount;
    6054       if ( mrgCandIdx == iCount )
    6055         return;
    6056       iCount ++;
    6057 
    6058       // early termination
    6059       if (iCount == getSlice()->getMaxNumMergeCand())
    6060       {
    6061         return;
    6062       }
    6063     }
    6064   }
    6065 #endif // H_3D_IV_MERGE
    6066 
    6067 #if H_3D_VSP
    6068   /////////////////////////////////////////////////
    6069   //////// VIEW SYNTHESIS PREDICTION (VSP) ////////
    6070   /////////////////////////////////////////////////
    6071 
    6072   if (
    6073 #if LGE_SHARP_VSP_INHERIT_F0104
    6074 #if H_3D_IC
    6075       !bICFlag &&
    6076 #endif
    6077 #if H_3D_ARP
    6078       !bARPFlag &&
    6079 #endif
    6080 #endif
    6081       xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )
    6082   {
    6083     return;
    6084   }
    6085 
    6086   // early termination
    6087   if (iCount == getSlice()->getMaxNumMergeCand())
    6088   {
    6089     return;
    6090   }
    6091 #endif
    6092 #if H_3D
    6093   ///////////////////////////////////
    6094   //////// LEFT BOTTOM (A0) ////////
    6095   ///////////////////////////////////
    6096 #endif
    60974947
    60984948  //left bottom
     
    61144964      pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    61154965    }
    6116 #if H_3D_NBDV
    6117     pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    6118     pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    6119 #endif
    6120 #if H_3D_VSP
    6121     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
    6122 #if LGE_SHARP_VSP_INHERIT_F0104
    6123 #if H_3D_IC
    6124         && !bICFlag
    6125 #endif
    6126 #if H_3D_ARP
    6127         && !bARPFlag
    6128 #endif
    6129 #endif
    6130         )
    6131     {
    6132       vspFlag[iCount] = 1;
    6133 #if !MTK_VSP_SIMPLIFICATION_F0111
    6134       xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);
    6135 #endif
    6136     }
    6137 #endif
     4966
    61384967    if ( mrgCandIdx == iCount )
    61394968    {
     
    61474976    return;
    61484977  }
    6149 #if H_3D
    6150   ///////////////////////////////////
    6151   //////// LEFT ABOVE (B2) ////////
    6152   ///////////////////////////////////
    6153 #endif
    61544978
    61554979  // above left
     
    61744998        pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    61754999      }
    6176 #if H_3D_NBDV
    6177       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    6178       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    6179 #endif
    6180 #if H_3D_VSP
    6181 #if MTK_VSP_SIMPLIFICATION_F0111
    6182       if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
    6183 #if LGE_SHARP_VSP_INHERIT_F0104
    6184 #if H_3D_IC
    6185           && !bICFlag
    6186 #endif
    6187 #if H_3D_ARP
    6188           && !bARPFlag
    6189 #endif
    6190 #endif
    6191           )
    6192 #else
    6193       if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1
    6194 #if LGE_SHARP_VSP_INHERIT_F0104
    6195 #if H_3D_IC
    6196           && !bICFlag
    6197 #endif
    6198 #if H_3D_ARP
    6199           && !bARPFlag
    6200 #endif
    6201 #endif
    6202           )
    6203 #endif
    6204       {
    6205         vspFlag[iCount] = 1;
    6206 #if !MTK_VSP_SIMPLIFICATION_F0111
    6207         xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);
    6208 #endif
    6209       }
    6210 #endif
    62115000      if ( mrgCandIdx == iCount )
    62125001      {
     
    62215010    return;
    62225011  }
    6223 #if H_3D_IV_MERGE
    6224   ////////////////////////////////////////////////////
    6225   //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
    6226   ////////////////////////////////////////////////////
    6227 
    6228   if(  ivMvPredFlag  )
    6229   {
    6230     if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag))
    6231     {
    6232       return;
    6233     }
    6234     //early termination
    6235     if (iCount == getSlice()->getMaxNumMergeCand())
    6236     {
    6237       return;
    6238     }
    6239   }
    6240 #endif
    6241 #if H_3D
    6242   /////////////////////////////////
    6243   //////// Collocate (COL) ////////
    6244   /////////////////////////////////
    6245 #endif
     5012
    62465013  if ( getSlice()->getEnableTMVPFlag())
    62475014  {
     
    63085075    if ( getSlice()->isInterB() )
    63095076    {
    6310 #if H_3D_TMVP
    6311       iRefIdx = 0;
    6312 #endif
    63135077      bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);
    63145078      if( bExistMV == false )
     
    63275091      puhInterDirNeighbours[uiArrayAddr] = dir;
    63285092      abCandIsInter[uiArrayAddr] = true;
    6329 #if H_3D_NBDV
    6330       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    6331       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    6332 #endif
    63335093      if ( mrgCandIdx == iCount )
    63345094      {
     
    63485108  if ( getSlice()->isInterB())
    63495109  {
    6350 #if H_3D_IV_MERGE
    6351     UInt uiPriorityList0[20] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3,    0, 4, 1, 4, 2, 4, 3, 4 };
    6352     UInt uiPriorityList1[20] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2,    4, 0, 4, 1, 4, 2, 4, 3 };
    6353 #else
    63545110    UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};
    63555111    UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};
    6356 #endif
    63575112
    63585113    for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++)
    63595114    {
    63605115      Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];
    6361 #if H_3D_VSP
    6362       Bool bValid = true;
    6363       if ( vspFlag[i] == 1 || vspFlag[j] == 1 )
    6364       {
    6365         bValid = false;
    6366       }
    6367       if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) )
    6368       {
    6369         assert(bValid == true);
    6370       }
    6371 #endif
    6372 #if H_3D_VSP
    6373       if (abCandIsInter[i] && abCandIsInter[j] && (puhInterDirNeighbours[i]&0x1) && (puhInterDirNeighbours[j]&0x2) && bValid)
    6374 #else
    63755116      if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
    6376 #endif
    63775117      {
    63785118        abCandIsInter[uiArrayAddr] = true;
     
    64295169  numValidMergeCand = uiArrayAddr;
    64305170}
    6431 
    6432 
    64335171#endif
    64345172
     
    67705508}
    67715509
    6772 #if LGE_IC_CTX_F0160
     5510#if H_3D_IC
    67735511Bool TComDataCU::isIC( UInt uiPartIdx )
    67745512{
     
    76236361}
    76246362#endif
    7625 #if QC_DEPTH_IV_MRG_F0125
     6363#if H_3D_IV_MERGE
    76266364Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    76276365{
     
    82036941#endif
    82046942
    8205 #if MTK_SPIVMP_F0110
     6943#if H_3D_SPIVMP
    82066944Void TComDataCU::getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight)
    82076945{
     
    82556993#if H_3D_IV_MERGE
    82566994Bool
    8257 TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc
    8258 #if QC_DEPTH_IV_MRG_F0125
    8259 , Bool bIsDepth           
    8260 #endif
    8261 #if MTK_SPIVMP_F0110
     6995TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth           
     6996#if H_3D_SPIVMP
    82626997, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    82636998#endif
     
    82687003 
    82697004  //--- get base CU/PU and check prediction mode ---
    8270 #if QC_DEPTH_IV_MRG_F0125
    82717005  TComPic*    pcBasePic   = pcSlice->getIvPic( bIsDepth, iViewIndex );
    8272 #else
    8273   TComPic*    pcBasePic   = pcSlice->getIvPic( false, iViewIndex );
    8274 #endif
    82757006  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
    82767007
     
    82837014  pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
    82847015
    8285 #if !MTK_SPIVMP_F0110
    8286 #if QC_DEPTH_IV_MRG_F0125
     7016#if !H_3D_SPIVMP
    82877017  iCurrPosX  += ( iWidth  >> 1 );
    82887018  iCurrPosY  += ( iHeight >> 1 );
    8289 #else
    8290   iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
    8291   iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
    8292 #endif
    82937019#endif
    82947020
     
    83087034#endif
    83097035
    8310 #if MTK_SPIVMP_F0110
     7036#if H_3D_SPIVMP
    83117037  ////////////////////////////////
    83127038  //////////sub-PU IvMC///////////
     
    84387164  ////////////////////////////////
    84397165
    8440 #if MTK_SPIVMP_F0110
     7166#if H_3D_SPIVMP
    84417167  for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
    84427168#else
     
    84477173    // iLoopCan == 1 --> IvMCShift
    84487174
    8449 #if !MTK_SPIVMP_F0110
     7175#if !H_3D_SPIVMP
    84507176    Int         iBaseCUAddr;
    84517177    Int         iBaseAbsPartIdx;
     
    84557181    Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
    84567182
    8457 #if MTK_SPIVMP_F0110
     7183#if H_3D_SPIVMP
    84587184    iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
    84597185    iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
     
    84647190    pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
    84657191
    8466 #if MTK_SPIVMP_F0110
     7192#if H_3D_SPIVMP
    84677193    pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    84687194#else
     
    84967222                  TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    84977223#if H_3D_NBDV
    8498 #if QC_DEPTH_IV_MRG_F0125
     7224#if H_3D_IV_MERGE
    84997225                  if( !bIsDepth )
    85007226                  {
     
    85047230                    cMv.setIDVVer    (cDv.getVer()); 
    85057231                    cMv.setIDVVId    (iViewIndex);
    8506 #if QC_DEPTH_IV_MRG_F0125
     7232#if H_3D_IV_MERGE
    85077233                  }
    85087234#endif
     
    85217247    }
    85227248  }
    8523 #if MTK_SPIVMP_F0110
     7249#if H_3D_SPIVMP
    85247250  for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
    85257251#else
     
    85527278#endif
    85537279          cMv.setHor( cMv.getHor() + ioffsetDV );
    8554 #if QC_DEPTH_IV_MRG_F0125
     7280#if H_3D_IV_MERGE
    85557281          if( bIsDepth )
    85567282            cMv.setHor((cMv.getHor()+2)>>2);
     
    86397365  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
    86407366}
    8641 #if !SEC_DMM3_RBC_F0147
    8642 Void  TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )
    8643 {
    8644   UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
    8645   for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm3IntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; }
    8646 }
    8647 #endif
    8648 #endif
    8649 #if H_3D_DIM_RBC
    8650 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )
    8651 {
    8652   Int iWidth;
    8653   Int iHeight;
    8654   if( uiDepth == 0 )
    8655   {
    8656     iWidth = 64;
    8657     iHeight = 64;
    8658   }
    8659   else if( uiDepth == 1 )
    8660   {
    8661     iWidth = 32;
    8662     iHeight = 32;
    8663   }
    8664   else if( uiDepth == 2 )
    8665   {
    8666     iWidth = 16;
    8667     iHeight = 16;
    8668   }
    8669   else if( uiDepth == 3 )
    8670   {
    8671     iWidth = 8;
    8672     iHeight = 8;
    8673   }
    8674   else // uiDepth == 4
    8675   {
    8676     iWidth = 4;
    8677     iHeight = 4;
    8678   }
    8679 
    8680   Int iPtr = 0;
    8681   Int iX, iY;
    8682   Int iDir = -1;
    8683   Int iDiffX = 0, iDiffY = 0;
    8684 
    8685   // 1. Edge Code -> Vert & Horz Edges
    8686   Bool*  pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight );
    8687 
    8688   for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ )
    8689     pbEdge  [ ui ] = false;
    8690 
    8691   // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7)
    8692   // Code      : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6)
    8693   const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 },
    8694   { 1, 5, 7, 2, 3, 4, 6 },
    8695   { 2, 4, 5, 0, 1, 6, 7 },
    8696   { 3, 7, 6, 1, 0, 5, 4 },
    8697   { 4, 0, 2, 6, 5, 3, 1 },
    8698   { 5, 2, 1, 4, 7, 0, 3 },
    8699   { 6, 3, 0, 7, 4, 1, 2 },
    8700   { 7, 1, 3, 5, 6, 2, 0 }};
    8701 
    8702   UChar ucCode = pucEdgeCode[iPtr++];
    8703 
    8704   if( !bLeft )
    8705   {
    8706     iX = ucStartPos;
    8707     iY = 0;
    8708 
    8709     switch(ucCode)
    8710     {
    8711     case 0: // bottom
    8712       iDir = 3;
    8713       if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8714       break;
    8715     case 2: // left-bottom
    8716       iDir = 6;
    8717       if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8718       break;
    8719     case 1: // right-bottom
    8720       iDir = 7;
    8721       if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8722       if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8723       break;
    8724     case 4: // left
    8725       iDir = 0;
    8726       assert(false);
    8727       break;
    8728     case 3: // right
    8729       iDir = 1;
    8730       if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8731       if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8732       break;
    8733     }
    8734   }
    8735   else
    8736   {
    8737     iX = 0;
    8738     iY = ucStartPos;
    8739 
    8740     switch(ucCode)
    8741     {
    8742     case 0: // right
    8743       iDir = 1;
    8744       if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8745       break;
    8746     case 1: // right-top
    8747       iDir = 5;
    8748       if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8749       if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8750       break;
    8751     case 2: // right-bottom
    8752       iDir = 7;
    8753       if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8754       break;
    8755     case 3: // top
    8756       iDir = 2;
    8757       if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8758       if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8759       break;
    8760     case 4: // bottom
    8761       iDir = 3;
    8762       assert(false);
    8763       break;
    8764     }
    8765   }
    8766 
    8767   switch( iDir )
    8768   {
    8769   case 0: // left
    8770     iDiffX = -1;
    8771     iDiffY = 0;
    8772     break;
    8773   case 1: // right
    8774     iDiffX = +1;
    8775     iDiffY = 0;
    8776     break;
    8777   case 2: // top
    8778     iDiffX = 0;
    8779     iDiffY = -1;
    8780     break;
    8781   case 3: // bottom
    8782     iDiffX = 0;
    8783     iDiffY = +1;
    8784     break;
    8785   case 4: // left-top
    8786     iDiffX = -1;
    8787     iDiffY = -1;
    8788     break;
    8789   case 5: // right-top
    8790     iDiffX = +1;
    8791     iDiffY = -1;
    8792     break;
    8793   case 6: // left-bottom
    8794     iDiffX = -1;
    8795     iDiffY = +1;
    8796     break;
    8797   case 7: // right-bottom
    8798     iDiffX = +1;
    8799     iDiffY = +1;
    8800     break;
    8801   }
    8802 
    8803   iX += iDiffX;
    8804   iY += iDiffY;
    8805 
    8806   while( iPtr < ucNumEdge )
    8807   {
    8808     ucCode = pucEdgeCode[iPtr++];
    8809 
    8810     Int iNewDir = tableDir[iDir][ucCode];
    8811 
    8812     switch( iNewDir )
    8813     {
    8814     case 0: // left
    8815       iDiffX = -1;
    8816       iDiffY = 0;
    8817       break;
    8818     case 1: // right
    8819       iDiffX = +1;
    8820       iDiffY = 0;
    8821       break;
    8822     case 2: // top
    8823       iDiffX = 0;
    8824       iDiffY = -1;
    8825       break;
    8826     case 3: // bottom
    8827       iDiffX = 0;
    8828       iDiffY = +1;
    8829       break;
    8830     case 4: // left-top
    8831       iDiffX = -1;
    8832       iDiffY = -1;
    8833       break;
    8834     case 5: // right-top
    8835       iDiffX = +1;
    8836       iDiffY = -1;
    8837       break;
    8838     case 6: // left-bottom
    8839       iDiffX = -1;
    8840       iDiffY = +1;
    8841       break;
    8842     case 7: // right-bottom
    8843       iDiffX = +1;
    8844       iDiffY = +1;
    8845       break;
    8846     }
    8847 
    8848     switch( iDir )
    8849     {
    8850     case 0: // left
    8851       switch( ucCode )
    8852       {
    8853       case 0:
    8854       case 2:
    8855         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8856         break;
    8857       case 1:
    8858       case 3:
    8859         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8860         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8861         break;
    8862       case 4:
    8863       case 6:
    8864         // no
    8865         break;
    8866       case 5:
    8867         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8868         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8869         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8870         break;
    8871       }
    8872       break;
    8873     case 1: // right
    8874       switch( ucCode )
    8875       {
    8876       case 0:
    8877       case 2:
    8878         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8879         break;
    8880       case 1:
    8881       case 3:
    8882         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8883         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8884         break;
    8885       case 4:
    8886       case 6:
    8887         // no
    8888         break;
    8889       case 5:
    8890         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8891         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8892         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8893         break;
    8894       }
    8895       break;
    8896     case 2: // top
    8897       switch( ucCode )
    8898       {
    8899       case 0:
    8900       case 2:
    8901         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8902         break;
    8903       case 1:
    8904       case 3:
    8905         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8906         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8907         break;
    8908       case 4:
    8909       case 6:
    8910         // no
    8911         break;
    8912       case 5:
    8913         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8914         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8915         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8916         break;
    8917       }
    8918       break;
    8919     case 3: // bottom
    8920       switch( ucCode )
    8921       {
    8922       case 0:
    8923       case 2:
    8924         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8925         break;
    8926       case 1:
    8927       case 3:
    8928         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8929         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8930         break;
    8931       case 4:
    8932       case 6:
    8933         // no
    8934         break;
    8935       case 5:
    8936         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8937         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8938         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8939         break;
    8940       }
    8941       break;
    8942     case 4: // left-top
    8943       switch( ucCode )
    8944       {
    8945       case 0:
    8946       case 1:
    8947         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8948         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8949         break;
    8950       case 2:
    8951       case 4:
    8952         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8953         break;
    8954       case 3:
    8955       case 5:
    8956         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8957         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8958         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8959         break;
    8960       case 6:
    8961         // no
    8962         break;
    8963       }
    8964       break;
    8965     case 5: // right-top
    8966       switch( ucCode )
    8967       {
    8968       case 0:
    8969       case 1:
    8970         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8971         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8972         break;
    8973       case 2:
    8974       case 4:
    8975         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8976         break;
    8977       case 3:
    8978       case 5:
    8979         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8980         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    8981         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    8982         break;
    8983       case 6:
    8984         // no
    8985         break;
    8986       }
    8987       break;
    8988     case 6: // left-bottom
    8989       switch( ucCode )
    8990       {
    8991       case 0:
    8992       case 1:
    8993         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8994         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    8995         break;
    8996       case 2:
    8997       case 4:
    8998         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    8999         break;
    9000       case 3:
    9001       case 5:
    9002         if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
    9003         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    9004         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    9005         break;
    9006       case 6:
    9007         // no
    9008         break;
    9009       }
    9010       break;
    9011     case 7: // right-bottom
    9012       switch( ucCode )
    9013       {
    9014       case 0:
    9015       case 1:
    9016         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    9017         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    9018         break;
    9019       case 2:
    9020       case 4:
    9021         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    9022         break;
    9023       case 3:
    9024       case 5:
    9025         if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
    9026         if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
    9027         if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
    9028         break;
    9029       case 6:
    9030         // no
    9031         break;
    9032       }
    9033       break;
    9034     }
    9035 
    9036     assert( iX >= 0 && iX <= iWidth );
    9037     assert( iY >= 0 && iY <= iHeight );
    9038 
    9039     iX += iDiffX;
    9040     iY += iDiffY;
    9041     iDir = iNewDir;
    9042   }
    9043 
    9044   // finalize edge chain
    9045   if( iX == iWidth-1 )
    9046   {
    9047     if( iY == 0 )
    9048     {
    9049       if( iDir == 1 )
    9050       {
    9051         pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9052       }
    9053       else if( iDir == 5 )
    9054       {
    9055         pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9056       }
    9057       else
    9058       {
    9059         assert(false);
    9060       }
    9061     }
    9062     else if( iY == iHeight-1 )
    9063     {
    9064       if( iDir == 3 )
    9065       {
    9066         pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9067       }
    9068       else if( iDir == 7 )
    9069       {
    9070         pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9071       }
    9072       else
    9073       {
    9074         assert(false);
    9075       }
    9076     }
    9077     else
    9078     {
    9079       if( iDir == 1 )
    9080       {
    9081         pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9082       }
    9083       else if( iDir == 3 )
    9084       {
    9085         pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9086         pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9087       }
    9088       else if( iDir == 5 )
    9089       {
    9090         pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9091       }
    9092       else if( iDir == 7 )
    9093       {
    9094         pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9095         pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9096       }
    9097       else
    9098       {
    9099         assert(false);
    9100       }
    9101     }
    9102   }
    9103   else if( iX == 0 )
    9104   {
    9105     if( iY == 0 )
    9106     {
    9107       if( iDir == 2 )
    9108       {
    9109         pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9110       }
    9111       else if( iDir == 4 )
    9112       {
    9113         pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9114       }
    9115       else
    9116       {
    9117         assert(false);
    9118       }
    9119     }
    9120     else if( iY == iHeight-1 )
    9121     {
    9122       if( iDir == 0 )
    9123       {
    9124         pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9125       }
    9126       else if( iDir == 6 )
    9127       {
    9128         pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9129       }
    9130       else
    9131       {
    9132         assert(false);
    9133       }
    9134     }
    9135     else
    9136     {
    9137       if( iDir == 0 )
    9138       {
    9139         pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9140       }
    9141       else if( iDir == 2 )
    9142       {
    9143         pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9144         pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9145       }
    9146       else if( iDir == 4 )
    9147       {
    9148         pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9149         pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9150       }
    9151       else if( iDir == 6 )
    9152       {
    9153         pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9154       }
    9155       else
    9156       {
    9157         assert(false);
    9158       }
    9159     }
    9160   }
    9161   else if( iY == 0 )
    9162   {
    9163     if( iDir == 1 )
    9164     {
    9165       pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9166       pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9167     }
    9168     else if( iDir == 2 )
    9169     {
    9170       pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9171     }
    9172     else if( iDir == 4 )
    9173     {
    9174       pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9175     }
    9176     else if( iDir == 5 )
    9177     {
    9178       pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
    9179       pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
    9180     }
    9181     else
    9182     {
    9183       assert(false);
    9184     }
    9185   }
    9186   else if( iY == iHeight-1 )
    9187   {
    9188     if( iDir == 0 )
    9189     {
    9190       pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9191       pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9192     }
    9193     else if( iDir == 3 )
    9194     {
    9195       pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9196     }
    9197     else if( iDir == 6 )
    9198     {
    9199       pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
    9200       pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9201     }
    9202     else if( iDir == 7 )
    9203     {
    9204       pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
    9205     }
    9206     else
    9207     {
    9208       assert(false);
    9209     }
    9210   }
    9211   else
    9212   {
    9213     printf("reconPartiton: wrong termination\n");
    9214     assert(false);
    9215   }
    9216 
    9217   // Reconstruct Region from Chain Code
    9218   Bool* pbVisit  = (Bool*) xMalloc( Bool, iWidth * iHeight );
    9219   Int*  piStack  = (Int* ) xMalloc( Int,  iWidth * iHeight );
    9220 
    9221   for( UInt ui = 0; ui < iWidth * iHeight; ui++ )
    9222   {
    9223     pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)
    9224     pbVisit [ ui ] = false;
    9225   }
    9226 
    9227   iPtr = 0;
    9228   piStack[iPtr++] = (0 << 8) | (0);
    9229   pbRegion[ 0 ] = false;
    9230 
    9231   while(iPtr > 0)
    9232   {
    9233     Int iTmp = piStack[--iPtr];
    9234     Int iX1, iY1;
    9235     iX1 = iTmp & 0xff;
    9236     iY1 = (iTmp >> 8) & 0xff;
    9237 
    9238     pbVisit[ iX1 + iY1 * iWidth ] = true;
    9239 
    9240     assert( iX1 >= 0 && iX1 < iWidth );
    9241     assert( iY1 >= 0 && iY1 < iHeight );
    9242 
    9243     if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )
    9244     {
    9245       piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);
    9246       pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;
    9247     }
    9248     if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )
    9249     {
    9250       piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);
    9251       pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;
    9252     }
    9253     if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )
    9254     {
    9255       piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;
    9256       pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;
    9257     }
    9258     if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )
    9259     {
    9260       piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;
    9261       pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;
    9262     }
    9263   }
    9264 
    9265   xFree( pbEdge );
    9266   xFree( pbVisit );
    9267   xFree( piStack );
    9268 }
    92697367#endif
    92707368
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r724 r773  
    198198                                      ///< 0: non-VSP; 1: VSP
    199199#endif
    200 #if MTK_SPIVMP_F0110
     200#if H_3D_SPIVMP
    201201  Bool*         m_pbSPIVMPFlag;       ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP
    202202                                      ///< 0: non-SPIVMP; 1: SPIVMP
     
    212212#if H_3D_DIM_DMM
    213213  UInt*         m_dmmWedgeTabIdx[DMM_NUM_TYPE];
    214 #if !SEC_DMM3_RBC_F0147
    215   UInt*         m_dmm3IntraTabIdx;
    216 #endif
    217 #endif
    218 #if H_3D_DIM_RBC
    219   UChar*        m_pucEdgeCode;          ///< array of edge code
    220   UChar*        m_pucEdgeNumber;        ///< total number of edge
    221   UChar*        m_pucEdgeStartPos;      ///< starting point position
    222   Bool*         m_pbEdgeLeftFirst;      ///< true if edge should be checked in left boundary first
    223   Bool*         m_pbEdgePartition;      ///< true if it belongs to region 1, otherwise, region 0
    224214#endif
    225215#if H_3D_DIM_SDC
     
    233223  UChar*        m_pucInterSDCMask;
    234224#endif
    235 #if ETRIKHU_MERGE_REUSE_F0093
     225#if H_3D
    236226  Bool          m_bAvailableFlagA1;    ///< A1 available flag
    237227  Bool          m_bAvailableFlagB1;    ///< B1 available flag
     
    256246  UInt*         m_sliceSegmentStartCU; ///< Start CU address of current slice
    257247  Char          m_codedQP;
    258 #if ETRIKHU_MERGE_REUSE_F0093
     248#if H_3D
    259249  DisInfo       m_cDefaultDisInfo;    ///< Default disparity information for initializing
    260250#endif
     
    266256  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    267257#if H_3D_VSP
    268 #if ETRIKHU_MERGE_REUSE_F0093
    269258  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    270259                             Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo);
    271 #else
    272   Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    273                              Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag );
    274 #endif
    275260#endif
    276261#if H_3D_IV_MERGE
    277 #if ETRIKHU_MERGE_REUSE_F0093
    278262  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv,
    279263                               Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo   );
    280 #else
    281   Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv,
    282                                Int* ivCandRefIdx, Int posIvDC, Int* vspFlag );
    283 #endif
    284264  Bool          xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int*  ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand );
    285265#endif
     
    519499   );
    520500   
    521 #if ETRIKHU_MERGE_REUSE_F0093
     501#if H_3D
    522502  Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
    523 #endif
    524 #if QC_DEPTH_IV_MRG_F0125
    525503  Bool          getDispNeighBlocks  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    526504  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
     
    535513  Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
    536514#endif
    537 #if MTK_SPIVMP_F0110
     515#if H_3D_SPIVMP
    538516  Void          getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight);
    539517  Void          getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr );
     
    541519#endif
    542520#if H_3D_IV_MERGE
    543   Bool          getInterViewMergeCands          ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc
    544 #if QC_DEPTH_IV_MRG_F0125
    545     , Bool bIsDepth           
    546 #endif
    547 #if MTK_SPIVMP_F0110
     521  Bool          getInterViewMergeCands          ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth           
     522
     523#if H_3D_SPIVMP
    548524    , TComMvField* pcMFieldSP, UChar* puhInterDirSP
    549525#endif
     
    584560  Void  setDmmWedgeTabIdxSubParts     ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth );
    585561
    586 #if !SEC_DMM3_RBC_F0147
    587   UInt* getDmm3IntraTabIdx            ()                      { return m_dmm3IntraTabIdx;        }
    588   UInt  getDmm3IntraTabIdx            ( UInt uiIdx )          { return m_dmm3IntraTabIdx[uiIdx]; }
    589   Void  setDmm3IntraTabIdx            ( UInt uiIdx, UInt uh ) { m_dmm3IntraTabIdx[uiIdx] = uh;   }
    590   Void  setDmm3IntraTabIdxSubParts    ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
    591 #endif
    592 #endif
    593 #if H_3D_DIM_RBC
    594   UChar* getEdgeCode( UInt uiIdx )                 { return &m_pucEdgeCode[uiIdx * RBC_MAX_EDGE_NUM_PER_4x4]; }
    595 
    596   UChar* getEdgeNumber( )                          { return m_pucEdgeNumber;           }
    597   UChar  getEdgeNumber( UInt uiIdx )               { return m_pucEdgeNumber[uiIdx];    }
    598   Void   setEdgeNumber( UInt uiIdx, UChar val )    { m_pucEdgeNumber[uiIdx] = val;     }
    599 
    600   UChar* getEdgeStartPos( )                        { return m_pucEdgeStartPos;         }
    601   UChar  getEdgeStartPos( UInt uiIdx )             { return m_pucEdgeStartPos[uiIdx];  }
    602   Void   setEdgeStartPos( UInt uiIdx, UChar val )  { m_pucEdgeStartPos[uiIdx] = val;   }
    603 
    604   Bool*  getEdgeLeftFirst( )                       { return m_pbEdgeLeftFirst;         }
    605   Bool   getEdgeLeftFirst( UInt uiIdx )            { return m_pbEdgeLeftFirst[uiIdx];  }
    606   Void   setEdgeLeftFirst( UInt uiIdx, Bool val )  { m_pbEdgeLeftFirst[uiIdx] = val;   }
    607 
    608   Bool*  getEdgePartition( UInt uiIdx )            { return &m_pbEdgePartition[uiIdx * 16]; }
    609 
    610   Void   reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion );
    611562#endif
    612563#if H_3D_DIM_SDC
     
    704655  Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
    705656
    706 #if ETRIKHU_MERGE_REUSE_F0093
     657#if H_3D
    707658  Bool          getAvailableFlagA1() { return m_bAvailableFlagA1;}
    708659  Bool          getAvailableFlagB1() { return m_bAvailableFlagB1;}
     
    720671                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
    721672#endif
    722 #if MTK_SPIVMP_F0110
     673#if H_3D_SPIVMP
    723674                                            , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    724675#endif
     
    729680  inline Void   xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount,  InheritedVSPDisInfo*  inheritedVSPDisInfo);
    730681
    731 #if MTK_SPIVMP_F0110
     682#if H_3D_SPIVMP
    732683  Bool*         getSPIVMPFlag        ()                        { return m_pbSPIVMPFlag;          }
    733684  Bool          getSPIVMPFlag        ( UInt uiIdx )            { return m_pbSPIVMPFlag[uiIdx];   }
     
    753704  Bool          isBipredRestriction( UInt puIdx );
    754705
    755 #if LGE_IC_CTX_F0160
     706#if H_3D_IC
    756707  Bool          isIC      ( UInt uiPartIdx );
    757708#endif
  • trunk/source/Lib/TLibCommon/TComMotionInfo.cpp

    r724 r773  
    4040#include "assert.h"
    4141#include <stdlib.h>
    42 #if MTK_SPIVMP_F0110
     42#if H_3D_SPIVMP
    4343#include "TComDataCU.h"
    4444#include "TComPic.h"
     
    328328}
    329329
    330 #if MTK_SPIVMP_F0110
     330#if H_3D_SPIVMP
    331331Void TComCUMvField::setMvFieldSP( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  )
    332332{
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r724 r773  
    5050// ====================================================================================================================
    5151
    52 #if MTK_SPIVMP_F0110
     52#if H_3D_SPIVMP
    5353class TComDataCU;
    5454#endif
     
    173173  Void    setAllRefIdx ( Int iRefIdx,                 PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
    174174  Void    setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
    175 #if MTK_SPIVMP_F0110
     175#if H_3D_SPIVMP
    176176  Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
    177177#endif
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r758 r773  
    425425  Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );   
    426426  Bool isDmmMode  = (dimType <  DMM_NUM_TYPE);
    427 #if !SEC_DMM3_RBC_F0147
    428   Bool isRbcMode  = (dimType == RBC_IDX);
    429 #endif
    430427
    431428  Bool* biSegPattern  = NULL;
     
    443440        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
    444441      } break;
    445 #if !SEC_DMM3_RBC_F0147
    446     case( DMM3_IDX ):
    447       {
    448         UInt uiTabIdx = 0;
    449         if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }
    450         else
    451         {
    452           uiTabIdx = xPredWedgeFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm3IntraTabIdx( uiAbsPartIdx ) );
    453           pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, uiAbsPartIdx, (pcCU->getDepth(0) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1)) );
    454         }
    455         dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);
    456       } break;
    457 #endif
    458442    case( DMM4_IDX ):
    459443      {
     
    468452  }
    469453#endif
    470 #if H_3D_DIM_RBC
    471   if( isRbcMode )
    472   {
    473     biSegPattern  = pcCU->getEdgePartition( uiAbsPartIdx );
    474     patternStride = iWidth;
    475   }
    476 #endif
    477454
    478455  // get predicted partition values
    479456  assert( biSegPattern );
    480457  Int* piMask = NULL;
    481 #if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171
    482458  piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering
    483 #else
    484   if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM
    485   else            piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );
    486 #endif
    487459  assert( piMask );
    488460  Int maskStride = 2*iWidth + 1; 
     
    499471    Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx );
    500472#if H_3D_DIM_DMM
    501 #if QC_DIM_DELTADC_UNIFY_F0132 && !SEC_DMM3_RBC_F0147
    502     if( isDmmMode || isRbcMode)
    503 #else
    504473    if( isDmmMode )
    505 #endif
    506474    {
    507475#if H_3D_DIM_DLT
    508 #if DLT_DIFF_CODING_IN_PPS
    509476      segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
    510477      segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
    511478#else
    512       segDC1 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
    513       segDC2 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
    514 #endif
    515 #else
    516479      segDC1 = ClipY( predDC1 + deltaDC1 );
    517480      segDC2 = ClipY( predDC2 + deltaDC2 );
    518481#endif
    519     }
    520 #endif
    521 #if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132
    522     if( isRbcMode )
    523     {
    524       xDeltaDCQuantScaleUp( pcCU, deltaDC1 );
    525       xDeltaDCQuantScaleUp( pcCU, deltaDC2 );
    526       segDC1 = ClipY( predDC1 + deltaDC1 );
    527       segDC2 = ClipY( predDC2 + deltaDC2 );
    528482    }
    529483#endif
     
    566520}
    567521
    568 #if MTK_SPIVMP_F0110
     522#if H_3D_SPIVMP
    569523Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr )
    570524{
     
    677631      else
    678632      {
    679 #if MTK_SPIVMP_F0110
     633#if H_3D_SPIVMP
    680634        if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    681635        {
     
    717671            xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    718672          }
    719 #if MTK_SPIVMP_F0110
     673#if H_3D_SPIVMP
    720674        }
    721675#endif
     
    763717      else
    764718      {
    765 #if MTK_SPIVMP_F0110
     719#if H_3D_SPIVMP
    766720       if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    767721      {
     
    802756          xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    803757        }
    804 #if MTK_SPIVMP_F0110
     758#if H_3D_SPIVMP
    805759       }
    806760#endif
     
    830784  pcCU->clipMv(cMv);
    831785#if H_3D_ARP
    832 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    833786  if(pcCU->getARPW( uiPartAddr ) > 0  && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC())
    834787  {
    835       xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi );
     788    xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi );
    836789  }
    837790  else
    838 #endif
    839   if(  pcCU->getARPW( uiPartAddr ) > 0
    840     && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N
    841     && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()
    842     )
    843   {
    844     xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi );
    845   }
    846   else
    847   {
     791  {
     792    if(  pcCU->getARPW( uiPartAddr ) > 0
     793      && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N
     794      && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()
     795      )
     796    {
     797      xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi );
     798    }
     799    else
     800    {
    848801#endif
    849802#if H_3D_IC
    850     Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() );
    851     xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
     803      Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() );
     804      xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    852805#if H_3D_ARP
    853       , false
    854 #endif
    855       , bICFlag );
    856     bICFlag = bICFlag && (iWidth > 8);
    857     xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
     806        , false
     807#endif
     808        , bICFlag );
     809      bICFlag = bICFlag && (iWidth > 8);
     810      xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    858811#if H_3D_ARP
    859       , false
    860 #endif
    861       , bICFlag );
     812        , false
     813#endif
     814        , bICFlag );
    862815#else
    863   xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );
    864   xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );
     816      xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );
     817      xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );
    865818#endif
    866819#if H_3D_ARP
     820    }
    867821  }
    868822#endif
     
    918872  pcBaseViewDepthPicYuv->extendPicBorder();
    919873
    920 #if MTK_F0109_LG_F0120_VSP_BLOCK
    921874  Int vspSize=0;
    922875  xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize );
     
    924877  xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    925878  xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    926 #else
    927   xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp );
    928   // sub-PU based compensation
    929   xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
    930   xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
    931 #endif
    932879}
    933880#endif
     
    959906  if( cDistparity.bDV )
    960907  {
    961 #if SHARP_ARP_REF_CHECK_F0105
    962908    Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList);
    963909    if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() )
    964 #else
    965     if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC() )
    966 #endif
    967910    {
    968911      bTobeScaled = true;
     
    971914    pcPicYuvBaseCol =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(),                              cDistparity.m_aVIdxCan );
    972915
    973 #if SHARP_ARP_REF_CHECK_F0105
    974916    pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan );
    975917
    976918    if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan))
    977 #else
    978     pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC(), cDistparity.m_aVIdxCan );
    979    
    980     if( ( !pcPicYuvBaseCol || pcPicYuvBaseCol->getPOC() != pcCU->getSlice()->getPOC() ) || ( !pcPicYuvBaseRef || pcPicYuvBaseRef->getPOC() != pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ) )
    981 #endif
    982919    {
    983920      dW = 0;
     
    986923    else
    987924    {
    988 #if SHARP_ARP_REF_CHECK_F0105
    989925      assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() );
    990 #else
    991       assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() );
    992 #endif
    993926    }
    994927
     
    1039972  }
    1040973}
    1041 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    1042974Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
    1043975{
     
    1061993
    1062994  assert(dW > 0);
    1063 #if SHARP_ARP_REF_CHECK_F0105
    1064995  if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))
    1065996  {
    1066997    dW = 0;
    1067998  }
    1068 #endif
    1069999  Int uiLCUAddr,uiAbsPartAddr;
    10701000  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
     
    11441074  }
    11451075}
    1146 #endif
    11471076
    11481077#endif
     
    18041733#if H_3D_VSP
    18051734// not fully support iRatioTxtPerDepth* != 1
    1806 #if MTK_F0109_LG_F0120_VSP_BLOCK
    18071735Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
    1808 #else
    1809 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
    1810 #endif
    18111736{
    18121737  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
     
    18361761  Pel *depth = yuvDepth->getLumaAddr();
    18371762
    1838 #if !SHARP_VSP_BLOCK_IN_AMP_F0102
    1839   if( width<8 || height<8 )
    1840   { // no split
    1841     Int rightOffset = width - 1;
    1842     Int depStrideBlock = depStride * nTxtPerDepthY;
    1843     Pel *refDepthTop = refDepth;
    1844     Pel *refDepthBot = refDepthTop + (height-1)*refDepStride;
    1845 
    1846     Pel maxDepth = refDepthTop[0] > refDepthBot[0] ? refDepthTop[0] : refDepthBot[0];
    1847     if( maxDepth < refDepthTop[rightOffset] ) { maxDepth = refDepthTop[rightOffset]; }
    1848     if( maxDepth < refDepthBot[rightOffset] ) { maxDepth = refDepthBot[rightOffset]; }
    1849 
    1850     for( Int sY=0; sY<height; sY+=nTxtPerDepthY )
    1851     {
    1852       for( Int sX=0; sX<width; sX+=nTxtPerDepthX )
    1853       {
    1854         depth[sX] = maxDepth;
    1855       }
    1856       depth += depStrideBlock;
    1857     }
    1858 #if MTK_F0109_LG_F0120_VSP_BLOCK
    1859   if(width==4)
    1860     vspSize=0;
    1861   else
    1862     vspSize=1;
    1863 #endif
    1864   }
    1865   else
    1866   { // split to 4x8, or 8x4
    1867     Int blocksize    = 8;
    1868     Int subblocksize = 4;
    1869     Int depStrideBlock = depStride * blocksize;
    1870     Pel *depthTmp = NULL;
    1871     Int depStrideTmp = depStride * nTxtPerDepthY;
    1872     Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };
    1873     Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };
    1874     Pel repDepth4x8[2] = {0, 0};
    1875     Pel repDepth8x4[2] = {0, 0};
    1876 #endif
    1877 
    1878 #if !MTK_F0109_LG_F0120_VSP_BLOCK
    1879 #if SHARP_VSP_BLOCK_IN_AMP_F0102
    1880     Int blocksize    = 8;
    1881     Int subblocksize = 4;
    1882     Int depStrideBlock = depStride * blocksize;
    1883     Pel *depthTmp = NULL;
    1884     Int depStrideTmp = depStride * nTxtPerDepthY;
    1885     Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };
    1886     Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };
    1887 #endif
    1888     Int refDepStrideBlock    = refDepStride * blocksize;
    1889     Int refDepStrideSubBlock = refDepStride * subblocksize;
    1890 
    1891     refDepthTmp[0] = refDepth;
    1892     refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock;
    1893     refDepthTmp[1] = refDepthTmp[2] - refDepStride;
    1894     refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;
    1895 
    1896 #if SHARP_VSP_BLOCK_IN_AMP_F0102
    1897     Int subBlockW, subBlockH;
    1898     Int blockW, blockH;
    1899     subBlockW = subBlockH = 8;
    1900     if (height % 8)
    1901     {
    1902       subBlockW = 8;
    1903       subBlockH = 4;
    1904       blockW = width;  // no further split
    1905       blockH = height; // no further split
    1906     }
    1907     else if (width % 8)
    1908     {
    1909       subBlockW = 4;
    1910       subBlockH = 8;
    1911       blockW = width;  // no further split
    1912       blockH = height; // no further split
    1913     }
    1914     else
    1915     {
    1916       blockW = blockH = 8;
    1917     }
    1918     for( Int y=0; y<height; y+=blockH )
    1919     {
    1920       for( Int x=0; x<width; x+=blockW )
    1921       {
    1922         if (blockW == 8 && blockH == 8)
    1923         {
    1924           Bool ULvsBR = false, URvsBL = false;
    1925           ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];
    1926           URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];
    1927           if( ULvsBR ^ URvsBL )
    1928           { // 4x8
    1929             subBlockW = 4;
    1930             subBlockH = 8;
    1931           }
    1932           else
    1933           {
    1934             subBlockW = 8;
    1935             subBlockH = 4;
    1936           }
    1937         }
    1938         for( Int yy=0; yy<blockH; yy+=subBlockH )
    1939         {
    1940           for( Int xx=0; xx<blockW; xx+=subBlockW )
    1941           {
    1942             Pel  maxDepthVal = 0;
    1943             Int xP0, xP1, yP0, yP1;
    1944             xP0 = x+xx;
    1945             xP1 = x+xx+subBlockW-1;
    1946             yP0 = yy;
    1947             yP1 = yy+subBlockH-1;
    1948             maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP0*refDepStride]);
    1949             maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP0*refDepStride]);
    1950             maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP1*refDepStride]);
    1951             maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP1*refDepStride]);
    1952             depthTmp = &depth[x+xx+yy*depStride];
    1953             for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
    1954             {
    1955               for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
    1956               {
    1957                 depthTmp[sX] = maxDepthVal;
    1958               }
    1959               depthTmp += depStrideTmp;
    1960             }
    1961           }
    1962         }
    1963       }
    1964       refDepthTmp[0] += refDepStrideBlock;
    1965       depth       += depStrideBlock;
    1966     }
    1967 #else // SHARP_VSP_BLOCK_IN_AMP_F0102
    1968     for( Int y=0; y<height; y+=blocksize )
    1969     {
    1970       for( Int x=0; x<width; x+=blocksize )
    1971       {
    1972         Bool ULvsBR = false, URvsBL = false;
    1973 
    1974         ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];
    1975         URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];
    1976 
    1977         if( ULvsBR ^ URvsBL )
    1978         { // 4x8
    1979           repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]];
    1980           if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] )
    1981           {
    1982             repDepth4x8[0] = refDepthTmp[3][x+offset[0]];
    1983           }
    1984           if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] )
    1985           {
    1986             repDepth4x8[0] = refDepthTmp[3][x+offset[1]];
    1987           }
    1988           repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]];
    1989           if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] )
    1990           {
    1991             repDepth4x8[1] = refDepthTmp[3][x+offset[2]];
    1992           }
    1993           if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] )
    1994           {
    1995             repDepth4x8[1] = refDepthTmp[3][x+offset[3]];
    1996           }
    1997 
    1998           depthTmp = &depth[x];
    1999           for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )
    2000           {
    2001             for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )
    2002             {
    2003               depthTmp[sX] = repDepth4x8[0];
    2004             }
    2005             depthTmp += depStrideTmp;
    2006           }
    2007           depthTmp = &depth[x+subblocksize];
    2008           for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )
    2009           {
    2010             for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )
    2011             {
    2012               depthTmp[sX] = repDepth4x8[1];
    2013             }
    2014             depthTmp += depStrideTmp;
    2015           }
    2016         }
    2017         else
    2018         { // 8x4
    2019           repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]];
    2020           if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] )
    2021           {
    2022             repDepth8x4[0] = refDepthTmp[1][x+offset[0]];
    2023           }
    2024           if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] )
    2025           {
    2026             repDepth8x4[0] = refDepthTmp[1][x+offset[3]];
    2027           }
    2028           repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]];
    2029           if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] )
    2030           {
    2031             repDepth8x4[1] = refDepthTmp[3][x+offset[0]];
    2032           }
    2033           if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] )
    2034           {
    2035             repDepth8x4[1] = refDepthTmp[3][x+offset[3]];
    2036           }
    2037          
    2038           depthTmp = &depth[x];
    2039           for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )
    2040           {
    2041             for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )
    2042             {
    2043               depthTmp[sX] = repDepth8x4[0];
    2044             }
    2045             depthTmp += depStrideTmp;
    2046           }
    2047           for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )
    2048           {
    2049             for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )
    2050             {
    2051               depthTmp[sX] = repDepth8x4[1];
    2052             }
    2053             depthTmp += depStrideTmp;
    2054           }
    2055         }
    2056       }
    2057       refDepthTmp[0] += refDepStrideBlock;
    2058       refDepthTmp[1] += refDepStrideBlock;
    2059       refDepthTmp[2] += refDepStrideBlock;
    2060       refDepthTmp[3] += refDepStrideBlock;
    2061       depth       += depStrideBlock;
    2062     }
    2063 #endif // SHARP_VSP_BLOCK_IN_AMP_F0102
    2064 #else
    2065 #if SHARP_VSP_BLOCK_IN_AMP_F0102
    20661763  if ((height % 8))
    20671764  {
     
    21151812      }
    21161813    }
    2117   }
    2118 #else // SHARP_VSP_BLOCK_IN_AMP_F0102
    2119     Int refDepStrideBlock    = refDepStride * height;
    2120     Int refDepStrideSubBlock = refDepStride * height/2;
    2121     refDepthTmp[0] = refDepth;
    2122     refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock;
    2123     refDepthTmp[1] = refDepthTmp[2] - refDepStride;
    2124     refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;
    2125     offset[3] = width-1;
    2126     Bool ULvsBR = false, URvsBL = false;
    2127     ULvsBR = refDepthTmp[0][0+offset[0]] < refDepthTmp[3][0+offset[3]];
    2128     URvsBL = refDepthTmp[0][0+offset[3]] < refDepthTmp[3][0+offset[0]];
    2129     refDepStrideBlock    = refDepStride * blocksize;
    2130     refDepStrideSubBlock = refDepStride * subblocksize;
    2131     refDepthTmp[0] = refDepth;
    2132     refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock;
    2133     refDepthTmp[1] = refDepthTmp[2] - refDepStride;
    2134     refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;
    2135     offset[3] = blocksize-1;
    2136     if( ULvsBR ^ URvsBL )
    2137     {
    2138     vspSize = 0;//4x8
    2139     for( Int y=0; y<height; y+=blocksize )
    2140     {
    2141       for( Int x=0; x<width; x+=blocksize )
    2142       {
    2143         { // 4x8
    2144           repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]];
    2145           if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] )
    2146           {
    2147             repDepth4x8[0] = refDepthTmp[3][x+offset[0]];
    2148           }
    2149           if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] )
    2150           {
    2151             repDepth4x8[0] = refDepthTmp[3][x+offset[1]];
    2152           }
    2153           repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]];
    2154           if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] )
    2155           {
    2156             repDepth4x8[1] = refDepthTmp[3][x+offset[2]];
    2157           }
    2158           if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] )
    2159           {
    2160             repDepth4x8[1] = refDepthTmp[3][x+offset[3]];
    2161   }
    2162 
    2163           depthTmp = &depth[x];
    2164           for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )
    2165           {
    2166             for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )
    2167             {
    2168               depthTmp[sX] = repDepth4x8[0];
    2169             }
    2170             depthTmp += depStrideTmp;
    2171           }
    2172           depthTmp = &depth[x+subblocksize];
    2173           for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )
    2174           {
    2175             for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )
    2176             {
    2177               depthTmp[sX] = repDepth4x8[1];
    2178             }
    2179             depthTmp += depStrideTmp;
    2180           }
    2181         }
    2182       }
    2183       refDepthTmp[0] += refDepStrideBlock;
    2184       refDepthTmp[1] += refDepStrideBlock;
    2185       refDepthTmp[2] += refDepStrideBlock;
    2186       refDepthTmp[3] += refDepStrideBlock;
    2187       depth       += depStrideBlock;
    2188     }
    2189   }
    2190   else
    2191   { // 8x4
    2192     vspSize = 1;
    2193     for( Int y=0; y<height; y+=blocksize )
    2194     {
    2195       for( Int x=0; x<width; x+=blocksize )
    2196       {
    2197         repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]];
    2198         if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] )
    2199         {
    2200           repDepth8x4[0] = refDepthTmp[1][x+offset[0]];
    2201         }
    2202         if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] )
    2203         {
    2204           repDepth8x4[0] = refDepthTmp[1][x+offset[3]];
    2205         }
    2206         repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]];
    2207         if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] )
    2208         {
    2209           repDepth8x4[1] = refDepthTmp[3][x+offset[0]];
    2210         }
    2211         if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] )
    2212         {
    2213           repDepth8x4[1] = refDepthTmp[3][x+offset[3]];
    2214         }
    2215 
    2216         depthTmp = &depth[x];
    2217         for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )
    2218         {
    2219           for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )
    2220           {
    2221             depthTmp[sX] = repDepth8x4[0];
    2222           }
    2223           depthTmp += depStrideTmp;
    2224         }
    2225         for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )
    2226         {
    2227           for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )
    2228           {
    2229             depthTmp[sX] = repDepth8x4[1];
    2230           }
    2231           depthTmp += depStrideTmp;
    2232 }
    2233       }
    2234       refDepthTmp[0] += refDepStrideBlock;
    2235       refDepthTmp[1] += refDepStrideBlock;
    2236       refDepthTmp[2] += refDepStrideBlock;
    2237       refDepthTmp[3] += refDepStrideBlock;
    2238       depth       += depStrideBlock;
    2239     }
    2240   }
    2241 #endif   
    2242 #endif
    2243 #if !SHARP_VSP_BLOCK_IN_AMP_F0102
    2244   }
    2245 #endif
    2246 
    2247 
    2248 }
    2249 #if MTK_F0109_LG_F0120_VSP_BLOCK
     1814  }   
     1815}
     1816
    22501817Void 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)
    2251 #else
    2252 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 )
    2253 #endif
    22541818{
    22551819  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
    22561820  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
    22571821 
    2258 #if MTK_F0109_LG_F0120_VSP_BLOCK
    22591822  nTxtPerDepthX = nTxtPerDepthX << vspSize;
    22601823  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2261 #endif
     1824
    22621825  Int refStride = picRef->getStride();
    22631826  Int dstStride = yuvDst->getStride();
     
    23651928}
    23661929
    2367 #if MTK_F0109_LG_F0120_VSP_BLOCK
    23681930Void 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)
    2369 #else
    2370 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 )
    2371 #endif
    23721931{
    23731932#if (H_3D_VSP_BLOCKSIZE==1)
     
    23791938#endif
    23801939
    2381 #if MTK_F0109_LG_F0120_VSP_BLOCK
    23821940  nTxtPerDepthX = nTxtPerDepthX << vspSize;
    23831941  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2384 #endif
     1942
    23851943  Int refStride = picRef->getCStride();
    23861944  Int dstStride = yuvDst->getCStride();
     
    25642122
    25652123#if H_3D_DIM_DMM
    2566 #if !SEC_DMM3_RBC_F0147
    2567 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx )
    2568 {
    2569   TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
    2570   assert( pcPicTex != NULL );
    2571   TComDataCU*   pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
    2572   UInt          uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    2573   Int           uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
    2574 
    2575   assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 );
    2576   return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);
    2577 }
    2578 #endif
    25792124
    25802125Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge )
     
    26282173#endif
    26292174
    2630 #if H_3D_DIM_RBC
    2631 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC )
    2632 {
    2633   Int  iSign  = rDeltaDC < 0 ? -1 : 1;
    2634   UInt uiAbs  = abs( rDeltaDC );
    2635 
    2636   Int iQp = pcCU->getQP(0);
    2637   Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) );
    2638   Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) );
    2639 
    2640   rDeltaDC = iSign * roftoi( uiAbs * dStepSize );
    2641   return;
    2642 }
    2643 
    2644 Void TComPrediction::xDeltaDCQuantScaleDown( TComDataCU*  pcCU, Pel& rDeltaDC )
    2645 {
    2646   Int  iSign  = rDeltaDC < 0 ? -1 : 1;
    2647   UInt uiAbs  = abs( rDeltaDC );
    2648 
    2649   Int iQp = pcCU->getQP(0);
    2650   Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) );
    2651   Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) );
    2652 
    2653   rDeltaDC = iSign * roftoi( uiAbs / dStepSize );
    2654   return;
    2655 }
    2656 #endif
     2175
    26572176#if H_3D_DIM_SDC
    26582177Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r724 r773  
    9393#if H_3D_ARP
    9494  Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL );
    95 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    9695  Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );
    97 #endif
    9896#endif
    9997  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false          );
     
    123121
    124122#if H_3D_VSP
    125 #if MTK_F0109_LG_F0120_VSP_BLOCK
    126123  Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 );
    127124  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);
    128125  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 #else
    130   Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int txtPerDepthX=1, Int txtPerDepthY=1 );
    131   Void xPredInterLumaBlkFromDM    ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi );
    132   Void xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi );
    133 #endif
    134126#endif
    135127
     
    142134  Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight );
    143135  Bool xCheckIdenticalMotion    ( TComDataCU* pcCU, UInt PartAddr);
    144 #if MTK_SPIVMP_F0110
     136#if H_3D_SPIVMP
    145137  Bool xCheckTwoSPMotion ( TComDataCU* pcCU, UInt PartAddr0, UInt PartAddr1 );
    146138  Void xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr );
     
    154146  Void xPredContourFromTex      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge );
    155147  Void xCopyTextureLumaBlock    ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight );
    156 #endif
    157 #if H_3D_DIM_RBC
    158   Void xDeltaDCQuantScaleUp     ( TComDataCU* pcCU, Pel& rDeltaDC );
    159   Void xDeltaDCQuantScaleDown   ( TComDataCU* pcCU, Pel& rDeltaDC );
    160148#endif
    161149#endif
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r738 r773  
    573573#if H_MV_ENC_DEC_TRAC
    574574#if ENC_DEC_TRACE
    575 #if H_MV_FIX_TRACE_FILE
    576575Void writeToTraceFile( const Char* symbolName, Int val, Bool doIt )
    577 #else
    578 Void writeToTraceFile( Char* symbolName, Int val, Bool doIt )
    579 #endif
    580576{
    581577  if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt  )
     
    592588}
    593589
    594 #if H_MV_FIX_TRACE_FILE
    595590Void writeToTraceFile( const Char* symbolName, Bool doIt )
    596 #else
    597 Void writeToTraceFile( Char* symbolName, Bool doIt )
    598 #endif
    599591{
    600592  if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt  )
     
    612604std::vector< std::vector<TComWedgeRef>  > g_dmmWedgeRefLists;
    613605std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists;
    614 #if !SEC_DMM3_RBC_F0147
    615 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
    616 #endif
    617606
    618607Void initWedgeLists( Bool initNodeList )
     
    733722  }
    734723
    735 #if !SEC_DMM3_RBC_F0147
    736   UInt uiThrSz = DMM3_SIMPLIFY_TR;
    737   std::vector< std::vector<UInt> > auiWdgListSz;
    738   for( Int idxM=2; idxM<=34 ; idxM++)
    739   {
    740     std::vector<UInt> auiWdgList;
    741     for( Int idxW=0; idxW<racWedgeList.size(); idxW++)
    742     {
    743       UInt uiAbsDiff = abs(idxM-(Int)racWedgeList[idxW].getAng());
    744       if( uiAbsDiff <= uiThrSz )
    745       {
    746         auiWdgList.push_back(idxW);
    747       }
    748     }
    749     auiWdgListSz.push_back(auiWdgList);
    750   }
    751   g_aauiWdgLstM3.push_back(auiWdgListSz);
    752 #endif
     724
    753725}
    754726
  • trunk/source/Lib/TLibCommon/TComRom.h

    r738 r773  
    172172extern       std::vector< std::vector<TComWedgeRef> >        g_dmmWedgeRefLists;
    173173extern       std::vector< std::vector<TComWedgeNode> >       g_dmmWedgeNodeLists;
    174 #if !SEC_DMM3_RBC_F0147
    175 extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
    176 #endif
    177174
    178175Void initWedgeLists( Bool initNodeList = false );
     
    236233
    237234
    238 #if H_MV_FIX_TRACE_FILE
    239235 Void           writeToTraceFile( const Char* symbolName, Int val, Bool doIt );
    240236 Void           writeToTraceFile( const Char* symbolName, Bool doIt );
    241 #else
    242  Void           writeToTraceFile( Char* symbolName, Int val, Bool doIt );
    243  Void           writeToTraceFile( Char* symbolName, Bool doIt );
    244 #endif
    245237#endif
    246238#else
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r758 r773  
    110110#endif
    111111, m_pocResetFlag                  (false)
    112 #if H_MV_6_RALS_O0149_11
     112#if H_MV
    113113, m_crossLayerBlaFlag             (false)
    114114#endif
     
    753753  {       
    754754    if ( this->getNumRefIdx( RefPicList( uiRefListIdx ) ) == 0)
     755    {
    755756        continue;
    756 #if !SHARP_ARP_REF_CHECK_F0105
    757 // move the following to setARPStepNum() to define ARP related thing in ARP function.
    758 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    759      for(Int i = 0; i < this->getNumRefIdx(RefPicList(uiRefListIdx)); i++ )
    760        {
    761        if ( this->getRefPic(RefPicList(uiRefListIdx), i)->getPOC() != getPOC() )
    762        {
    763          this->setFirstTRefIdx (RefPicList(uiRefListIdx), i);
    764          break;
    765        }
    766      }
    767 #endif
    768 #endif
     757    }
    769758    Bool bZeroIdxLtFlag = this->getRefPic(RefPicList(uiRefListIdx), 0)->getIsLongTerm();
    770759    for(Int i = 1; i < this->getNumRefIdx(RefPicList(uiRefListIdx)); i++ )
     
    782771Void TComSlice::setCamparaSlice( Int** aaiScale, Int** aaiOffset )
    783772
    784 #if CAM_HLS_F0136_F0045_F0082
    785773  if( m_pcVPS->hasCamParInSliceHeader( m_viewIndex ) )
    786 #else
    787   if( m_pcSPS->hasCamParInSliceHeader() )
    788 #endif
    789774  {   
    790775    for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < m_viewIndex; uiBaseViewIndex++ )
     
    17161701, m_hrdOpSetIdx               (NULL)
    17171702, m_cprmsPresentFlag          (NULL)
    1718 #if H_MV_6_HRD_O0217_13
     1703#if H_MV
    17191704, m_dpbSize                   (NULL)
    1720 #endif
    1721 #if H_MV
    17221705, m_vpsVUI                 (  NULL )
    17231706#endif
     
    17341717    for( Int layerId = 0; layerId < MAX_VPS_NUH_LAYER_ID_PLUS1; layerId++ )
    17351718    {
    1736 #if H_MV_6_HRD_O0217_13
    17371719      m_layerIdIncludedFlag[lsIdx][layerId] = (( lsIdx == 0 ) && ( layerId == 0 )) ;
    1738 #else
    1739       m_layerIdIncludedFlag[lsIdx][layerId] = false;
    1740 #endif
    17411720    }
    17421721  }
     
    17521731  m_moreOutputLayerSetsThanDefaultFlag = false;   
    17531732  m_numAddOutputLayerSetsMinus1        = -1;   
    1754 #if H_MV_6_PS_0109_25
    17551733  m_defaultOneTargetOutputLayerIdc     = 0;
    1756 #else
    1757   m_defaultOneTargetOutputLayerFlag    = false;
    1758 #endif
    17591734 
    17601735  for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++)
     
    17671742    }
    17681743  }
    1769 #if H_MV_6_GEN_0153_28
    17701744  m_altOutputLayerFlag       = false;
    1771 #endif
    17721745  m_maxOneActiveRefLayerFlag = false;
    17731746  m_directDepTypeLenMinus2   = 0;         
     
    18061779    m_layerIdInNuh      [i] = ( i == 0 ) ? 0 : -1;
    18071780    m_numDirectRefLayers[i] = 0;
    1808 #if !H_MV_6_ILDDS_O0225_30
    1809     m_maxTidIlRefPicPlus1[i] = 7;
    1810 #endif
    18111781    m_vpsRepFormatIdx    [i] = 0;
    1812 #if H_MV_6_MISC_O0062_31
    18131782    m_pocLsbNotPresentFlag[i] = 0;
    1814 #endif
    18151783    m_repFormat          [i] = NULL;
    18161784    m_viewIdVal          [i] = 0;
     
    18191787    m_viewIndex         [i] = -1;
    18201788    m_vpsDepthModesFlag [i] = false;
    1821 #if H_3D_DIM_DLT
    1822 #if !DLT_DIFF_CODING_IN_PPS
    1823     m_bUseDLTFlag         [i] = false;
    1824    
    1825     // allocate some memory and initialize with default mapping
    1826     m_iNumDepthmapValues[i] = ((1 << g_bitDepthY)-1)+1;
    1827     m_iBitsPerDepthValue[i] = numBitsForValue(m_iNumDepthmapValues[i]);
    1828    
    1829     m_iDepthValue2Idx[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
    1830     m_iIdx2DepthValue[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
    1831    
    1832     //default mapping
    1833     for (Int d=0; d<m_iNumDepthmapValues[i]; d++)
    1834     {
    1835       m_iDepthValue2Idx[i][d] = d;
    1836       m_iIdx2DepthValue[i][d] = d;
    1837     }
    1838 #endif
    1839 #endif
    1840 #if H_3D
    18411789    m_ivMvScalingFlag = true;
    1842 #endif
    18431790#endif
    18441791
     
    18481795      m_directDependencyType[i][j] = -1;
    18491796      m_refLayerId[i][j]           = -1;
    1850 #if H_MV_6_ILDDS_O0225_30     
    18511797      m_maxTidIlRefPicsPlus1[i][j]  = 7;
    1852 #endif
    18531798    }
    18541799
     
    18631808  }
    18641809  m_vpsVUI = new TComVPSVUI;
    1865 #if H_MV_6_HRD_O0217_13
    18661810  m_dpbSize = new TComDpbSize;
    1867 #endif
    1868 #
     1811
    18691812#if H_3D
    18701813  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     
    18721815#if H_3D_IV_MERGE
    18731816    m_ivMvPredFlag         [ i ] = false;
    1874 #if MTK_SPIVMP_F0110
     1817#if H_3D_SPIVMP
    18751818    m_iSubPULog2Size       [ i ] = 0;
    18761819#endif
     
    18851828    m_bInterSDCFlag        [ i ] = false;
    18861829#endif
    1887 #if SEC_MPI_ENABLING_MERGE_F0150
     1830#if H_3D_IV_MERGE
    18881831    m_bMPIFlag             [ i ] = false;
    18891832#endif
     
    18951838TComVPS::~TComVPS()
    18961839{
    1897 if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
     1840  if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
    18981841  if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
    18991842  if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
    19001843#if H_MV
    19011844  if ( m_vpsVUI          != NULL )     delete m_vpsVUI;
    1902 #if H_MV_6_HRD_O0217_13
    19031845  if ( m_dpbSize         != NULL )     delete m_dpbSize;
    1904 #endif
    19051846
    19061847  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
    19071848  {
    19081849    if (m_repFormat[ i ] != NULL )      delete m_repFormat[ i ];   
    1909 #if H_3D_DIM_DLT
    1910 #if !DLT_DIFF_CODING_IN_PPS
    1911     if ( m_iDepthValue2Idx[i] != 0 )
    1912     {
    1913        xFree( m_iDepthValue2Idx[i] );
    1914        m_iDepthValue2Idx[i] = 0;
    1915     }
    1916 
    1917     if ( m_iIdx2DepthValue[i] != 0 )
    1918     {
    1919       xFree( m_iIdx2DepthValue[i] );
    1920       m_iIdx2DepthValue[i] = 0;
    1921     }
    1922 #endif
    1923 #endif
    1924   }
    1925 #endif
    1926 #if CAM_HLS_F0136_F0045_F0082
     1850  }
     1851#endif
     1852#if H_3D
    19271853  deleteCamPars();
    19281854#endif
    19291855}
    1930 
    1931 #if H_3D_DIM_DLT
    1932 #if !DLT_DIFF_CODING_IN_PPS
    1933   Void TComVPS::setDepthLUTs(Int layerIdInVps, Int* idxToDepthValueTable, Int iNumDepthValues)
    1934   {
    1935     if( idxToDepthValueTable == NULL || iNumDepthValues == 0 ) // default mapping only
    1936       return;
    1937    
    1938     // copy idx2DepthValue to internal array
    1939     memcpy(m_iIdx2DepthValue[layerIdInVps], idxToDepthValueTable, iNumDepthValues*sizeof(UInt));
    1940    
    1941     UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);
    1942     for(Int p=0; p<=uiMaxDepthValue; p++)
    1943     {
    1944       Int iIdxDown    = 0;
    1945       Int iIdxUp      = iNumDepthValues-1;
    1946       Bool bFound     = false;
    1947      
    1948       // iterate over indices to find lower closest depth
    1949       Int i = 1;
    1950       while(!bFound && i<iNumDepthValues)
    1951       {
    1952         if( m_iIdx2DepthValue[layerIdInVps][i] > p )
    1953         {
    1954           iIdxDown  = i-1;
    1955           bFound    = true;
    1956         }
    1957        
    1958         i++;
    1959       }
    1960       // iterate over indices to find upper closest depth
    1961       i = iNumDepthValues-2;
    1962       bFound = false;
    1963       while(!bFound && i>=0)
    1964       {
    1965         if( m_iIdx2DepthValue[layerIdInVps][i] < p )
    1966         {
    1967           iIdxUp  = i+1;
    1968           bFound    = true;
    1969         }
    1970        
    1971         i--;
    1972       }
    1973      
    1974       // assert monotony
    1975       assert(iIdxDown<=iIdxUp);
    1976      
    1977       // assign closer depth value/idx
    1978       if( abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxDown]) < abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxUp]) )
    1979       {
    1980         m_iDepthValue2Idx[layerIdInVps][p] = iIdxDown;
    1981       }
    1982       else
    1983       {
    1984         m_iDepthValue2Idx[layerIdInVps][p] = iIdxUp;
    1985       }
    1986      
    1987     }
    1988    
    1989     // update DLT variables
    1990     m_iNumDepthmapValues[layerIdInVps] = iNumDepthValues;
    1991     m_iBitsPerDepthValue[layerIdInVps] = numBitsForValue(m_iNumDepthmapValues[layerIdInVps]);
    1992   }
    1993 #endif
    1994 #endif
    19951856
    19961857#if H_MV
     
    20791940  return foundLayerIdinNuh;
    20801941}
    2081 #if CAM_HLS_F0136_F0045_F0082
     1942
    20821943Void TComVPS::createCamPars(Int iNumViews)
    20831944{
     
    21682029  }
    21692030}
    2170 #endif // CAM_HLS_F0136_F0045_F0082
    21712031
    21722032#endif // H_3D
     
    22042064  assert( lsIdx >= 0 );
    22052065  assert( lsIdx <= getVpsNumLayerSetsMinus1() );
    2206 #if H_MV_6_HRD_O0217_13
    22072066  return (Int) m_layerSetLayerIdList[ lsIdx ].size();
    2208 #else
    2209   Int numLayersInIdList = 0;
    2210   for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ )
    2211   {
    2212     numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) );
    2213   }
    2214   return numLayersInIdList;
    2215 #endif
    2216 }
    2217 
    2218 #if H_MV_6_HRD_O0217_13
     2067}
     2068
    22192069Int    TComVPS::getNumOutputLayerSets()
    22202070{
     
    22262076  return numOutputLayerSets;
    22272077}
    2228 #endif
    22292078
    22302079Int TComVPS::getNumViews()
     
    22582107}
    22592108
    2260 #if H_MV_6_HRD_O0217_13
    22612109Void TComVPS::deriveLayerSetLayerIdList()
    22622110{
     
    22942142  }
    22952143}
    2296 #endif
    22972144#endif // H_MV
    22982145
     
    23492196, m_spsScalingListRefLayerId  ( 0 )
    23502197
    2351 #if !H_MV_6_PS_REP_FORM_18_19_20
    2352 , m_updateRepFormatFlag       ( true )
    2353 #else
    23542198, m_updateRepFormatFlag       ( false )
    23552199, m_spsRepFormatIdx           ( 0 )
    2356 #endif
    23572200, m_interViewMvVertConstraintFlag (false)
    23582201#endif
     
    23702213  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    23712214  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
    2372 #if H_MV_6_PSEM_O0142_3
     2215#if H_MV
    23732216  m_spsExtensionFlag = false;
    23742217  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
     
    23762219    m_spsExtensionTypeFlag[ i ] = false;
    23772220  }
    2378 #endif
    2379 #if H_MV_6_SHVC_O0098_36
    23802221  m_numScaledRefLayerOffsets = 0;
    23812222
     
    25482389, m_ppsInferScalingListFlag(false)
    25492390, m_ppsScalingListRefLayerId(0)
    2550 #if DLT_DIFF_CODING_IN_PPS
     2391#if H_3D
    25512392, m_pcDLT(NULL)
    25522393#endif
     
    25712412}
    25722413
    2573 #if DLT_DIFF_CODING_IN_PPS
     2414#if H_3D
    25742415TComDLT::TComDLT()
    25752416: m_bDltPresentFlag(false)
     
    27532594  if ( layerIdCurr > 0 )
    27542595  {
    2755 #if H_MV_6_PS_REP_FORM_18_19_20
    27562596    Int            repFormatIdx = getUpdateRepFormatFlag() ?  getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ;
    27572597    TComRepFormat* repFormat    = vps->getRepFormat( repFormatIdx );
    2758 #else
    2759     TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) );
    2760     if ( !getUpdateRepFormatFlag() )
    2761     {       
    2762 #endif
    27632598      setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() );         
    27642599      //// ToDo: add when supported:
     
    27732608      setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 );
    27742609      setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
    2775 #if !H_MV_6_PS_REP_FORM_18_19_20
    2776     }
    2777     else
    2778 #else
    27792610    if ( getLayerId() > 0 && getUpdateRepFormatFlag() )
    2780 #endif
    27812611    {
    27822612      assert( getChromaFormatIdc()      <=  repFormat->getChromaFormatVpsIdc()         );
     
    28082638}
    28092639#endif
    2810 #if H_3D
    2811 #if !CAM_HLS_F0136_F0045_F0082
    2812 Void
    2813 TComSPS::initCamParaSPS( UInt uiViewIndex, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
    2814 {
    2815   AOT( uiViewIndex != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) ); 
    2816  
    2817   m_uiCamParPrecision     = ( uiViewIndex ? uiCamParPrecision : 0 );
    2818   m_bCamParInSliceHeader  = ( uiViewIndex ? bCamParSlice  : false );
    2819   ::memset( m_aaiCodedScale,  0x00, sizeof( m_aaiCodedScale  ) );
    2820   ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
    2821 
    2822   if( !m_bCamParInSliceHeader )
    2823   {
    2824     for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < uiViewIndex; uiBaseViewIndex++ )
    2825     {
    2826       m_aaiCodedScale [ 0 ][ uiBaseViewIndex ] = aaiScale [ uiBaseViewIndex ][     uiViewIndex ];
    2827       m_aaiCodedScale [ 1 ][ uiBaseViewIndex ] = aaiScale [     uiViewIndex ][ uiBaseViewIndex ];
    2828       m_aaiCodedOffset[ 0 ][ uiBaseViewIndex ] = aaiOffset[ uiBaseViewIndex ][     uiViewIndex ];
    2829       m_aaiCodedOffset[ 1 ][ uiBaseViewIndex ] = aaiOffset[     uiViewIndex ][ uiBaseViewIndex ];
    2830     }
    2831   }
    2832 }
    2833 #endif
    2834 #endif
     2640
    28352641TComReferencePictureSet::TComReferencePictureSet()
    28362642: m_numberOfPictures (0)
     
    31502956    {
    31512957      TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc );
    3152 #if H_MV_LAYER_WISE_STARTUP
    31532958      if ( pcPic )
    31542959      {
    3155 #endif
    31562960      if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    31572961      {
     
    31762980      }
    31772981    }
    3178 #if H_MV_LAYER_WISE_STARTUP
    3179       }
    3180 #endif
     2982      }
    31812983  }
    31822984}
     
    32363038
    32373039
    3238 #if H_MV_6_ILDDS_ILREFPICS_27_34
    32393040Int  TComSlice::getRefLayerPicFlag( Int i )
    32403041{
     
    32793080  return numRefLayerPics;
    32803081}
    3281 #endif
    32823082
    32833083
     
    32933093  else if (getVPS()->getAllRefLayersActiveFlag() )
    32943094  {
    3295 #if H_MV_6_ILDDS_ILREFPICS_27_34
    32963095    numActiveRefLayerPics = getNumRefLayerPics();
    3297 #else
    3298     numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() );
    3299 #endif
    33003096  }
    33013097  else if ( !getInterLayerPredEnabledFlag() )
     
    33053101  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
    33063102  {
    3307 #if H_MV_6_ILDDS_ILREFPICS_27_34
    33083103    numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0;
    3309 #else
    3310     numActiveRefLayerPics = 1;
    3311 #endif
    33123104  }
    33133105  else
     
    33243116
    33253117#if H_3D_ARP
    3326 #if SHARP_ARP_REF_CHECK_F0105
    33273118Void TComSlice::setARPStepNum( TComPicLists*ivPicLists )
    3328 #else
    3329 Void TComSlice::setARPStepNum()                                 
    3330 #endif
    3331 {
    3332 #if SHARP_ARP_REF_CHECK_F0105
     3119{
    33333120  Bool tempRefPicInListsFlag = false;
    3334 #else
    3335   Bool bAllIvRef = true;
    3336 #endif
    3337 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    33383121  if(!getVPS()->getUseAdvRP(getLayerId()) || this->isIRAP())
    3339 #else
    3340   if(!getVPS()->getUseAdvRP(getLayerId()))
    3341 #endif
    33423122  {
    33433123    m_nARPStepNum = 0;
     
    33453125  else
    33463126  {
    3347 #if SHARP_ARP_REF_CHECK_F0105
    33483127    setFirstTRefIdx (REF_PIC_LIST_0, -1);
    33493128    setFirstTRefIdx (REF_PIC_LIST_1, -1);
     
    33613140    tempRefPicInListsFlag = getFirstTRefIdx(REF_PIC_LIST_0) >= 0 || getFirstTRefIdx(REF_PIC_LIST_1) >= 0;
    33623141    m_nARPStepNum = tempRefPicInListsFlag ? getVPS()->getARPStepNum(getLayerId()) : 0;
    3363 #else
    3364     for( Int iRefListId = 0; iRefListId < 2; iRefListId++ )
    3365     {
    3366       RefPicList  eRefPicList = RefPicList( iRefListId );
    3367       Int iNumRefIdx = getNumRefIdx(eRefPicList);
    3368      
    3369       if( iNumRefIdx <= 0 )
    3370       {
    3371         continue;
    3372       }
    3373 
    3374       for ( Int i = 0; i < iNumRefIdx; i++ )
    3375       {
    3376         if( getRefPic( eRefPicList, i)->getPOC() != getPOC() )
    3377         {
    3378           bAllIvRef = false;
    3379           break;
    3380         }
    3381       }
    3382 
    3383       if( bAllIvRef == false ) { break; }
    3384     }
    3385     m_nARPStepNum = !bAllIvRef ? getVPS()->getARPStepNum(getLayerId()) : 0;
    3386 #endif
    3387   }
    3388 #if SHARP_ARP_REF_CHECK_F0105
     3142  }
     3143
    33893144  if (tempRefPicInListsFlag)
    33903145  {
     
    34073162        }
    34083163      }
    3409   }
    3410 }
    3411 #endif
     3164    }
     3165  }
    34123166}
    34133167#endif
     
    35143268#endif
    35153269
    3516 #if QC_DEPTH_IV_MRG_F0125
     3270#if H_3D_IV_MERGE
    35173271  setupLUT = setupLUT || ( getVPS()->getIvMvPredFlag(layerIdInVPS ) && getIsDepth() );
    35183272#endif
     
    35433297  assert( m_depthToDisparityF != NULL );
    35443298
    3545 #if CAM_HLS_F0136_F0045_F0082
    35463299  TComVPS* vps = getVPS();
    3547 #else
    3548   TComSPS* sps = getSPS();
    3549 #endif
    3550 
    3551 #if CAM_HLS_F0136_F0045_F0082
     3300
    35523301  Int log2Div = g_bitDepthY - 1 + vps->getCamParPrecision();
    35533302  Int viewIndex = getViewIndex();
     
    35593308  Int* invCodScale  = camParaSH ? m_aaiCodedScale [ 1 ] : vps->getInvCodedScale ( viewIndex );
    35603309  Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : vps->getInvCodedOffset( viewIndex );
    3561 #else
    3562   Int log2Div = g_bitDepthY - 1 + sps->getCamParPrecision();
    3563 
    3564   Bool camParaSH = m_pcSPS->hasCamParInSliceHeader();
    3565 
    3566   Int* codScale     = camParaSH ? m_aaiCodedScale [ 0 ] : sps->getCodedScale    ();
    3567   Int* codOffset    = camParaSH ? m_aaiCodedOffset[ 0 ] : sps->getCodedOffset   ();
    3568   Int* invCodScale  = camParaSH ? m_aaiCodedScale [ 1 ] : sps->getInvCodedScale ();
    3569   Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : sps->getInvCodedOffset();
    3570 #endif
    35713310
    35723311  for (Int i = 0; i <= ( getViewIndex() - 1); i++)
     
    39253664TComVPSVUI::TComVPSVUI()
    39263665{
    3927 #if H_MV_6_PS_O0223_29
    39283666  m_crossLayerIrapAlignedFlag = true;
    3929 #endif
    39303667  m_bitRatePresentVpsFlag = false;
    39313668  m_picRatePresentVpsFlag = false;
     
    39553692    }
    39563693  }
    3957 #if H_MV_6_PS_O0118_33 
    39583694  for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
    39593695  {
    39603696    m_videoSignalInfo          [i] = NULL;     
    39613697  }
    3962 #endif
    3963 
    3964 #if H_MV_6_HRD_O0164_15
     3698
    39653699  m_vpsVuiBspHrdPresentFlag = false;
    39663700  m_vpsVuiBspHrdParameters  = new TComVpsVuiBspHrdParameters();
    3967 #endif
    3968 }
    3969 
    3970 #if H_MV_6_PS_O0118_33