Changeset 773 in 3DVCSoftware


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
     3701}
     3702
    39713703TComVPSVUI::~TComVPSVUI()
    39723704{
     
    39773709  }
    39783710
    3979 #if H_MV_6_HRD_O0164_15
    39803711  if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters;
    39813712  m_vpsVuiBspHrdParameters = NULL;
    3982 #endif
    3983 }
    3984 #endif
    3985 
    3986 #if H_MV_6_PS_REP_FORM_18_19_20
     3713}
     3714
    39873715Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag )
    39883716{
     
    40023730}
    40033731}
    4004 #endif
    4005 
    4006 #if H_MV_6_HRD_O0164_15
     3732
    40073733Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h )
    40083734{
     
    40313757  }
    40323758}
    4033 #endif
    4034 #endif
     3759
     3760Void TComVUI::inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr )
     3761{
     3762  if ( layerIdCurr == 0 || !vps->getVpsVuiPresentFlag() )
     3763  {
     3764    return;
     3765  }
     3766
     3767  TComVPSVUI* vpsVUI = vps->getVPSVUI();
     3768  assert( vpsVUI != NULL ); 
     3769
     3770  TComVideoSignalInfo* videoSignalInfo = vpsVUI->getVideoSignalInfo( vpsVUI->getVpsVideoSignalInfoIdx( vps->getLayerIdInVps( layerIdCurr ) ) );
     3771  assert( videoSignalInfo != NULL );
     3772
     3773  setVideoFormat            ( videoSignalInfo->getVideoVpsFormat            () );
     3774  setVideoFullRangeFlag     ( videoSignalInfo->getVideoFullRangeVpsFlag     () );
     3775  setColourPrimaries        ( videoSignalInfo->getColourPrimariesVps        () );
     3776  setTransferCharacteristics( videoSignalInfo->getTransferCharacteristicsVps() );
     3777  setMatrixCoefficients     ( videoSignalInfo->getMatrixCoeffsVps           () );
     3778}
     3779#endif
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r758 r773  
    5353#if H_MV
    5454class TComPicLists;
     55class TComVPS;
    5556#endif
    5657// ====================================================================================================================
     
    6263// ====================================================================================================================
    6364
    64 #if H_MV_6_HRD_O0164_15
    65 class TComVPS;
    66 #endif
    6765/// Reference Picture Set class
    6866class TComReferencePictureSet
     
    407405#if H_MV
    408406
    409 #if H_MV_6_PS_O0118_33
    410407class TComVideoSignalInfo
    411408{
     
    432429  Int  getMatrixCoeffsVps(  ) { return m_matrixCoeffsVps; }
    433430};
    434 #endif
    435 #if H_MV_6_HRD_O0164_15
    436431class TComVpsVuiBspHrdParameters
    437432{
     
    473468};
    474469
    475 #endif
    476470class TComVPSVUI
    477471{
    478472private:
    479 #if H_MV_6_PS_O0223_29
    480473  Bool m_crossLayerPicTypeAlignedFlag;
    481474  Bool m_crossLayerIrapAlignedFlag;
    482 #endif
    483475  Bool m_bitRatePresentVpsFlag;
    484476  Bool m_picRatePresentVpsFlag;
     
    489481  Int  m_constantPicRateIdc          [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER];
    490482  Int  m_avgPicRate                  [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER];
    491 #if H_MV_6_O0226_37
    492483  Bool m_tilesNotInUseFlag;
    493484  Bool m_tilesInUseFlag              [MAX_NUM_LAYERS];
    494485  Bool m_loopFilterNotAcrossTilesFlag[MAX_NUM_LAYERS];
    495 #endif 
    496486  Bool m_tileBoundariesAlignedFlag   [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    497 #if H_MV_6_O0226_37
    498487  Bool m_wppNotInUseFlag;
    499488  Bool m_wppInUseFlag                [MAX_NUM_LAYERS];
    500 #endif
    501489  Bool m_ilpRestrictedRefLayersFlag;
    502490  Int  m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    503491  Bool m_ctuBasedOffsetEnabledFlag   [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    504492  Int  m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    505 #if H_MV_6_PS_O0118_33
    506493  Bool m_videoSignalInfoIdxPresentFlag;
    507494  Int  m_vpsNumVideoSignalInfoMinus1;
    508495  TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO];   
    509496  Int  m_vpsVideoSignalInfoIdx       [MAX_NUM_VIDEO_SIGNAL_INFO];
    510 #endif
    511 #if H_MV_6_HRD_O0164_15
    512497  Bool m_vpsVuiBspHrdPresentFlag;
    513498  TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters;
    514 #endif
    515499
    516500public:
    517501  TComVPSVUI();
    518502  ~TComVPSVUI();
    519 #if H_MV_6_PS_O0223_29
    520503  Void setCrossLayerPicTypeAlignedFlag( Bool flag ) { m_crossLayerPicTypeAlignedFlag = flag; }
    521504  Bool getCrossLayerPicTypeAlignedFlag(  ) { return m_crossLayerPicTypeAlignedFlag; }
     
    523506  Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; }
    524507  Bool getCrossLayerIrapAlignedFlag(  ) { return m_crossLayerIrapAlignedFlag; }
    525 #endif
    526508
    527509  Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; }
     
    549531  Int  getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; }
    550532
    551 #if H_MV_6_O0226_37
    552533  Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; }
    553534  Bool getTilesNotInUseFlag(  ) { return m_tilesNotInUseFlag; }
     
    558539  Void setLoopFilterNotAcrossTilesFlag( Int i, Int  val ) { m_loopFilterNotAcrossTilesFlag[i] = val; }
    559540  Bool getLoopFilterNotAcrossTilesFlag( Int i ) { return m_loopFilterNotAcrossTilesFlag[i]; }
    560 #endif
    561541
    562542  Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; }
    563543  Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; }
    564544
    565 #if H_MV_6_O0226_37
    566545  Void setWppNotInUseFlag( Bool flag ) { m_wppNotInUseFlag = flag; }
    567546  Bool getWppNotInUseFlag(  ) { return m_wppNotInUseFlag; }
     
    569548  Void setWppInUseFlag( Int i, Bool flag ) { m_wppInUseFlag[i] = flag; }
    570549  Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; }
    571 #endif
    572550
    573551  Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; }
     
    583561  Int  getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; }
    584562
    585 #if H_MV_6_PS_O0118_33
    586563  Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; }
    587564  Bool getVideoSignalInfoIdxPresentFlag(  ) { return m_videoSignalInfoIdxPresentFlag; }
     
    595572  Void setVpsVideoSignalInfoIdx( Int i, Int  val ) { m_vpsVideoSignalInfoIdx[i] = val; }
    596573  Int  getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; }
    597 #endif
    598 
    599 #if H_MV_6_HRD_O0164_15
     574
    600575  Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; }
    601576  Bool getVpsVuiBspHrdPresentFlag(  ) { return m_vpsVuiBspHrdPresentFlag; }
     
    603578  Void setVpsVuiBspHrdParameters( TComVpsVuiBspHrdParameters* val) {  m_vpsVuiBspHrdParameters = val; }
    604579  TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters(  ) { return m_vpsVuiBspHrdParameters; }
    605 #endif
    606580};
    607581
     
    609583{
    610584private:
    611 #if H_MV_6_PS_REP_FORM_18_19_20
    612585  Bool m_chromaAndBitDepthVpsPresentFlag;
    613 #endif
    614586  Int  m_chromaFormatVpsIdc;
    615587  Bool m_separateColourPlaneVpsFlag;
     
    622594  TComRepFormat() { }; 
    623595
    624 #if H_MV_6_PS_REP_FORM_18_19_20
    625596  Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; }
    626597  Bool getChromaAndBitDepthVpsPresentFlag(  ) { return m_chromaAndBitDepthVpsPresentFlag; }
    627598  Void checkChromaAndBitDepthVpsPresentFlag( Int i ) { assert( i != 0 || m_chromaAndBitDepthVpsPresentFlag ); } // The value of chroma_and_bit_depth_vps_present_flag of the first rep_format( ) syntax structure in the VPS shall be equal to 1. 
    628599  Void inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag );
    629 #endif
    630600
    631601  Void setChromaFormatVpsIdc( Int  val ) { m_chromaFormatVpsIdc = val; }
     
    647617  Int  getBitDepthVpsChromaMinus8(  ) { return m_bitDepthVpsChromaMinus8; }
    648618};
    649 #endif
    650 
    651 #if H_MV_6_HRD_O0217_13
     619
     620
    652621class TComDpbSize
    653622{
     
    696665};
    697666#endif
    698 
    699667class TComVPS
    700668{
     
    748716  Int         m_dimensionId              [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 
    749717
    750 #if H_MV_6_PS_O0109_22
    751718  Int         m_viewIdLen;
    752 #else
    753   Int         m_viewIdLenMinus1;
    754 #endif
    755719  Int         m_viewIdVal                [MAX_NUM_LAYERS];
    756720  Bool        m_directDependencyFlag     [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
    757 #if H_MV_6_ILDSD_O0120_26
    758721  Bool        m_vpsSubLayersMaxMinus1PresentFlag;
    759722  Int         m_subLayersVpsMaxMinus1    [MAX_NUM_LAYERS];
    760 #endif
    761723  Bool        m_maxTidRefPresentFlag;
    762 #if H_MV_6_ILDDS_O0225_30
    763724  Int         m_maxTidIlRefPicsPlus1     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    764 #else
    765   Int         m_maxTidIlRefPicPlus1      [MAX_NUM_LAYERS];
    766 #endif
    767725  Bool        m_allRefLayersActiveFlag;
    768726  Int         m_vpsNumberLayerSetsMinus1;
     
    772730  Bool        m_moreOutputLayerSetsThanDefaultFlag;
    773731  Int         m_numAddOutputLayerSetsMinus1;   
    774 #if H_MV_6_PS_0109_25
    775732  Int         m_defaultOneTargetOutputLayerIdc;
    776 #else
    777   Bool        m_defaultOneTargetOutputLayerFlag;
    778 #endif
    779733  Int         m_outputLayerSetIdxMinus1  [MAX_VPS_OUTPUTLAYER_SETS]; 
    780734  Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
    781735  Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
    782 #if H_MV_6_GEN_0153_28
    783736  Bool        m_altOutputLayerFlag;
    784 #endif
    785737  Bool        m_repFormatIdxPresentFlag;
    786738  Int         m_vpsNumRepFormatsMinus1;
     
    788740  TComRepFormat* m_repFormat             [MAX_NUM_LAYERS];
    789741  Bool        m_maxOneActiveRefLayerFlag;       
    790 #if H_MV_6_MISC_O0062_31
    791742  Bool        m_pocLsbNotPresentFlag     [MAX_NUM_LAYERS];
    792 #endif
    793 
    794 #if H_MV_6_HRD_O0217_13
     743
    795744  TComDpbSize* m_dpbSize;
    796 #endif
    797 #if !H_MV_6_PS_O0223_29       
    798   Bool        m_crossLayerIrapAlignedFlag;
    799 #endif
    800745  Int         m_directDepTypeLenMinus2;         
    801 #if H_MV_6_PS_O0096_21
    802746  Bool        m_defaultDirectDependencyFlag;
    803747  Int         m_defaultDirectDependencyType;
    804 #endif
    805748  Bool        m_vpsVuiPresentFlag;
    806749  TComVPSVUI* m_vpsVUI;
     
    822765  Int         m_viewIndex                [MAX_NUM_LAYERS   ];
    823766 
    824 #if H_MV_6_HRD_O0217_13
    825767  std::vector< std::vector< Int> >       m_targetDecLayerIdLists;   //[TargetOptLayerSetIdx][i]
    826768  std::vector< std::vector< Int> >       m_targetOptLayerIdLists;
    827769  std::vector< std::vector< Int> >       m_layerSetLayerIdList;
    828 #endif
    829770
    830771
     
    838779#if H_3D_IV_MERGE
    839780  Bool        m_ivMvPredFlag             [ MAX_NUM_LAYERS ];
    840 #if MTK_SPIVMP_F0110
     781#if H_3D_SPIVMP
    841782  Int         m_iSubPULog2Size           [MAX_NUM_LAYERS   ];
    842783#endif
     
    850791  Bool        m_vpsDepthModesFlag        [MAX_NUM_LAYERS   ];
    851792
    852 #if H_3D_DIM_DLT
    853 #if !DLT_DIFF_CODING_IN_PPS
    854   Bool        m_bUseDLTFlag              [MAX_NUM_LAYERS   ];
    855  
    856   Int         m_iBitsPerDepthValue       [MAX_NUM_LAYERS   ];
    857   Int         m_iNumDepthmapValues       [MAX_NUM_LAYERS   ];
    858   Int*        m_iDepthValue2Idx          [MAX_NUM_LAYERS   ];
    859   Int*        m_iIdx2DepthValue          [MAX_NUM_LAYERS   ];
    860 #endif
    861 #endif
    862 
    863793#if H_3D
    864 #if CAM_HLS_F0136_F0045_F0082
    865794  UInt        m_uiCamParPrecision;
    866795  Bool*       m_bCamParInSliceHeader;
     
    868797  Int         ***m_aaaiCodedScale ;
    869798  Int         ***m_aaaiCodedOffset;
    870 #endif
    871799  Bool        m_ivMvScalingFlag;
    872800#endif
     
    874802  Bool        m_bInterSDCFlag[MAX_NUM_LAYERS   ];
    875803#endif
    876 #if SEC_MPI_ENABLING_MERGE_F0150
     804#if H_3D_IV_MERGE
    877805  Bool        m_bMPIFlag[MAX_NUM_LAYERS   ];
    878806#endif
     
    901829  UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
    902830  Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
    903 #if H_MV_6_HRD_O0164_15
     831
     832#if H_MV   
    904833  UInt    getMaxSubLayersMinus1()             { return m_uiMaxTLayers - 1;  }  // For consistency with draft spec
    905 #endif
    906 #if H_MV   
    907834  UInt    getMaxLayersMinus1()                { return m_uiMaxLayersMinus1;  };
    908835  Void    setMaxLayersMinus1(UInt l)          { m_uiMaxLayersMinus1 = l; }
     
    978905  Int     getDimensionId( Int layerIdInVps, Int scalIdx )                  { return m_dimensionId[layerIdInVps][scalIdx]; }
    979906
    980 #if H_MV_6_PS_O0109_22
    981907  Void    setViewIdLen( Int  val )                                         { m_viewIdLen = val; }
    982908  Int     getViewIdLen(  )                                                 { return m_viewIdLen; }
    983 #else
    984   Void    setViewIdLenMinus1( Int  val )                                   { m_viewIdLenMinus1 = val; }
    985   Int     getViewIdLenMinus1(  )                                           { return m_viewIdLenMinus1; }
    986 #endif
    987909
    988910  Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; }
     
    990912  Void    setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val;  }
    991913  Bool    getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps )           { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; }
    992 #if H_MV_6_ILDSD_O0120_26
    993914  Void    setVpsSubLayersMaxMinus1PresentFlag( Bool flag )                 { m_vpsSubLayersMaxMinus1PresentFlag = flag; }
    994915  Bool    getVpsSubLayersMaxMinus1PresentFlag(  )                          { return m_vpsSubLayersMaxMinus1PresentFlag; }
     
    996917  Int     getSubLayersVpsMaxMinus1( Int i )                                { return m_subLayersVpsMaxMinus1[i]; }
    997918  Void    checkSubLayersVpsMaxMinus1( Int i )                              { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); }
    998 #endif
    999919  Void    setMaxTidRefPresentFlag( Bool flag )                             { m_maxTidRefPresentFlag = flag; }
    1000920  Bool    getMaxTidRefPresentFlag(  )                                      { return m_maxTidRefPresentFlag; }
    1001 #if H_MV_6_ILDDS_O0225_30
    1002921  Void    setMaxTidIlRefPicsPlus1( Int i, Int j, Int  val )                { m_maxTidIlRefPicsPlus1[i][j] = val; }
    1003922  Int     getMaxTidIlRefPicsPlus1( Int i, Int j )                          { return m_maxTidIlRefPicsPlus1[i][j]; }
    1004 #else
    1005   Void    setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val )              { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val;  }
    1006   Int     getMaxTidIlRefPicPlus1( Int layerIdInVps )                       { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; }
    1007 #endif
    1008923  Void    setAllRefLayersActiveFlag( Bool flag )                           { m_allRefLayersActiveFlag = flag; }
    1009924  Bool    getAllRefLayersActiveFlag(  )                                    { return m_allRefLayersActiveFlag; }
     
    1019934  Void    setProfileRefMinus1( Int profileTierLevelIdx, Int val )          { m_profileRefMinus1[ profileTierLevelIdx ] = val;  }
    1020935  Int     getProfileRefMinus1( Int profileTierLevelIdx )                   { return m_profileRefMinus1[ profileTierLevelIdx ]; }
    1021 #if H_MV_6_PS_O0109_23
    1022936  Void    checkProfileRefMinus1( Int i )                                   { assert( getProfileRefMinus1( i ) + 1 <= i ); };  //  The value of profile_ref_minus1[ i ] + 1 shall be less than or equal to i.
    1023 #endif
    1024937  Void    setMoreOutputLayerSetsThanDefaultFlag( Bool flag )               { m_moreOutputLayerSetsThanDefaultFlag = flag; }
    1025938  Bool    getMoreOutputLayerSetsThanDefaultFlag()                          { return m_moreOutputLayerSetsThanDefaultFlag; }
     
    1028941  Int     getNumAddOutputLayerSetsMinus1( )                                { return m_numAddOutputLayerSetsMinus1; }
    1029942 
    1030 #if H_MV_6_PS_0109_25 
    1031943  Void    setDefaultOneTargetOutputLayerIdc( Int  val )                    { m_defaultOneTargetOutputLayerIdc = val; }
    1032944  Int     getDefaultOneTargetOutputLayerIdc(  )                            { return m_defaultOneTargetOutputLayerIdc; }
    1033945  Void    checkDefaultOneTargetOutputLayerIdc( )                           { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); }
    1034 #else
    1035   Void    setDefaultOneTargetOutputLayerFlag( Bool flag )                  { m_defaultOneTargetOutputLayerFlag = flag; }
    1036   Bool    getDefaultOneTargetOutputLayerFlag( )                            { return m_defaultOneTargetOutputLayerFlag; }
    1037 #endif
    1038946 
    1039947  Void    setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val )        { m_outputLayerSetIdxMinus1[ outLayerSetIdx ]  = val; }
     
    1042950  Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )       { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; }
    1043951  Bool    getOutputLayerFlag( Int outLayerSetIdx, Int i )                  { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; }
    1044 #if H_MV_6_HRD_O0217_13
    1045952  Bool    inferOutputLayerFlag( Int layerSetIdx, Int i )                   { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1  ) ));  }
    1046 #endif
    1047953
    1048954  Void    setProfileLevelTierIdx( Int outLayerSetIdx, Int val )            { m_profileLevelTierIdx[ outLayerSetIdx  = val ]; }
    1049955  Int     getProfileLevelTierIdx( Int outLayerSetIdx )                     { return m_profileLevelTierIdx[ outLayerSetIdx ]; }
    1050 #if H_MV_6_GEN_0153_28
    1051956  Void    setAltOutputLayerFlag( Bool flag )                               { m_altOutputLayerFlag = flag; }
    1052957  Bool    getAltOutputLayerFlag(  )                                        { return m_altOutputLayerFlag; }
    1053 #endif
    1054958
    1055959  Void    setRepFormatIdxPresentFlag( Bool flag )                          { m_repFormatIdxPresentFlag = flag; }
     
    1067971  Bool    getMaxOneActiveRefLayerFlag( )                                   { return m_maxOneActiveRefLayerFlag; }
    1068972
    1069 #if H_MV_6_HRD_O0217_13
    1070973  Void    setDpbSize( TComDpbSize* val )                                   { assert( m_dpbSize != 0 ); m_dpbSize = val; }
    1071974  TComDpbSize* getDpbSize( )                                               { return m_dpbSize;}
    1072 #endif
    1073 
    1074 #if H_MV_6_MISC_O0062_31
     975
    1075976  Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; }
    1076977  Bool    getPocLsbNotPresentFlag( Int i )                                 { return m_pocLsbNotPresentFlag[i]; }
    1077 #endif
    1078 #if !H_MV_6_PS_O0223_29 
    1079   Void    setCrossLayerIrapAlignedFlag( Bool flag )                        { m_crossLayerIrapAlignedFlag = flag; }
    1080   Bool    getCrossLayerIrapAlignedFlag(  )                                 { return m_crossLayerIrapAlignedFlag; }
    1081 #endif
    1082978  Void    setDirectDepTypeLenMinus2( Int val)                              { m_directDepTypeLenMinus2 = val; }
    1083979  Int     getDirectDepTypeLenMinus2( )                                     { return m_directDepTypeLenMinus2; }
    1084980
    1085 #if H_MV_6_PS_O0096_21
    1086981  Void    setDefaultDirectDependencyFlag( Bool flag )                      { m_defaultDirectDependencyFlag = flag; }
    1087982  Bool    getDefaultDirectDependencyFlag(  )                               { return m_defaultDirectDependencyFlag; }
     
    1089984  Void    setDefaultDirectDependencyType( Int  val )                       { m_defaultDirectDependencyType = val; }
    1090985  Int     getDefaultDirectDependencyType(  )                               { return m_defaultDirectDependencyType; }
    1091 #endif
    1092986  Void    setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; }
    1093987  Int     getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps)   { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; }
     
    1096990
    1097991  TComVPSVUI* getVPSVUI(  )                                                { return m_vpsVUI;  }
    1098   // VPS EXTENSION SEMANTICS VARIABLES
     992 
     993 // VPS EXTENSION SEMANTICS VARIABLES
    1099994  Void    setLayerIdInVps( Int layerIdInNuh, Int val )                     { m_layerIdInVps[layerIdInNuh] = val;  }
    1100995  Int     getLayerIdInVps( Int layerIdInNuh )                              { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; }
    1101996
    1102997  Int     getScalabilityId ( Int layerIdInVps, ScalabilityType scalType );
    1103 #if H_MV_6_FIX_GET_VIEW_ID
    1104998  Int     getViewId        ( Int layerIdInNuh )                            { return m_viewIdVal[ getViewIndex( layerIdInNuh )]; }
    1105 #else
    1106   Int     getViewId        ( Int layerIdInNuh )                            { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; }
    1107 #endif
    1108999  Void    setRefLayers();
    11091000
     
    11201011  Int     getNumLayersInIdList ( Int lsIdx );
    11211012
    1122 #if H_MV_6_HRD_O0217_13
    11231013  Int     getNumOutputLayerSets() ;   
    11241014  Int     getNumSubDpbs( Int i )                                           { return getNumLayersInIdList( i ); }; 
    11251015  Bool    isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh );   
    1126 #if H_MV_6_HRD_O0217_13
    11271016  Void    deriveLayerSetLayerIdList();
    11281017  Void    deriveTargetLayerIdLists();
    11291018  std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx )     { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; };
    11301019  std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx )     { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; };
    1131 #endif
    1132 #endif
    11331020
    11341021
     
    11501037  Void    setARPStepNum( Int layerIdInVps, UInt val )                      { m_uiARPStepNum[layerIdInVps]    = val;     }
    11511038#endif
    1152 #if CAM_HLS_F0136_F0045_F0082
     1039
    11531040  Void createCamPars(Int iNumViews);
    11541041  Void deleteCamPars();
     
    11621049  Int* getInvCodedScale      ( Int viewIndex )  { return m_aaaiCodedScale [viewIndex][1]; }
    11631050  Int* getInvCodedOffset     ( Int viewIndex )  { return m_aaaiCodedOffset[viewIndex][1]; }
    1164 #endif
    11651051
    11661052#if H_3D_IV_MERGE
    11671053  Void    setIvMvPredFlag     ( Int layerIdInVps, Bool val )  { m_ivMvPredFlag[ layerIdInVps ] = val; }
    11681054  Bool    getIvMvPredFlag     ( Int layerIdInVps )            { return m_ivMvPredFlag[ layerIdInVps ]; };
    1169 #if MTK_SPIVMP_F0110
     1055#if H_3D_SPIVMP
    11701056  Int     getSubPULog2Size(Int layerIdInVps)           { return m_iSubPULog2Size[layerIdInVps]; }
    11711057  Void    setSubPULog2Size(Int layerIdInVps, Int u)    { m_iSubPULog2Size[layerIdInVps] = u;}
     
    11821068  Void    setVpsDepthModesFlag( Int layerIdInVps, Bool val )               { m_vpsDepthModesFlag[ layerIdInVps ] = val; }
    11831069  Bool    getVpsDepthModesFlag( Int layerIdInVps )                         { return m_vpsDepthModesFlag[ layerIdInVps ]; }
    1184 
    1185 #if H_3D_DIM_DLT
    1186 #if !DLT_DIFF_CODING_IN_PPS
    1187   Bool    getUseDLTFlag      ( Int layerIdInVps )                         { return m_bUseDLTFlag[ layerIdInVps ]; }
    1188   Void    setUseDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ]  = b;          }
    1189  
    1190   Int     getBitsPerDepthValue( Int layerIdInVps )        { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; }
    1191   Int     getNumDepthValues( Int layerIdInVps )           { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); }
    1192   Int     depthValue2idx( Int layerIdInVps, Pel value )   { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; }
    1193   Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }
    1194   Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
    1195 #endif
    1196 #endif
    11971070
    11981071  Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
     
    12021075  Void    setInterSDCFlag      ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; }
    12031076#endif
    1204 #if SEC_MPI_ENABLING_MERGE_F0150
     1077#if H_3D_IV_MERGE
    12051078  Bool    getMPIFlag      ( Int layerIdInVps )           { return m_bMPIFlag[layerIdInVps]; }
    12061079  Void    setMPIFlag      ( Int layerIdInVps, Bool bval ){ m_bMPIFlag[layerIdInVps] = bval; }
     
    12101083};
    12111084
    1212 #if DLT_DIFF_CODING_IN_PPS
     1085#if H_3D
    12131086class TComDLT
    12141087{
     
    14811354  TComHRD* getHrdParameters                 ()             { return &m_hrdParameters; }
    14821355  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    1483 
    1484 #if H_MV_6_PS_O0118_33
    1485   Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr )
    1486   {
    1487     if ( layerIdCurr == 0 || !vps->getVpsVuiPresentFlag() )
    1488     {
    1489       return;
    1490     }
    1491 
    1492     TComVPSVUI* vpsVUI = vps->getVPSVUI();
    1493     assert( vpsVUI != NULL ); 
    1494 
    1495     TComVideoSignalInfo* videoSignalInfo = vpsVUI->getVideoSignalInfo( vpsVUI->getVpsVideoSignalInfoIdx( vps->getLayerIdInVps( layerIdCurr ) ) );
    1496     assert( videoSignalInfo != NULL );
    1497 
    1498     setVideoFormat            ( videoSignalInfo->getVideoVpsFormat            () );
    1499     setVideoFullRangeFlag     ( videoSignalInfo->getVideoFullRangeVpsFlag     () );
    1500     setColourPrimaries        ( videoSignalInfo->getColourPrimariesVps        () );
    1501     setTransferCharacteristics( videoSignalInfo->getTransferCharacteristicsVps() );
    1502     setMatrixCoefficients     ( videoSignalInfo->getMatrixCoeffsVps           () );     
    1503   }
     1356#if H_MV
     1357  Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr );
    15041358#endif
    15051359};
     
    15881442  TComVPS*    m_pcVPS;
    15891443  // SPS
    1590 #if H_MV_6_PSEM_O0142_3
    15911444  Bool        m_spsExtensionFlag;
    15921445  Bool        m_spsExtensionTypeFlag[PS_EX_T_MAX_NUM];
    1593 #endif
    15941446  Bool        m_spsInferScalingListFlag;
    15951447  Int         m_spsScalingListRefLayerId;
    15961448  Bool        m_updateRepFormatFlag;
    1597 #if H_MV_6_PS_REP_FORM_18_19_20 
    15981449  Int         m_spsRepFormatIdx;
    1599 #endif
    16001450  // SPS Extension
    16011451  Bool        m_interViewMvVertConstraintFlag;
    1602 #if H_MV_6_SHVC_O0098_36
    16031452  Int         m_numScaledRefLayerOffsets;
    16041453  Int         m_scaledRefLayerId          [MAX_NUM_SCALED_REF_LAYERS];
     
    16071456  Int         m_scaledRefLayerRightOffset [MAX_NUM_LAYERS];
    16081457  Int         m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS];
    1609 #endif
    16101458#endif
    16111459#if H_3D
     
    17441592  TComPTL* getPTL()     { return &m_pcPTL; }
    17451593#if H_MV
    1746 #if H_MV_6_PSEM_O0142_3
    17471594  Void setSpsExtensionFlag( Bool flag ) { m_spsExtensionFlag = flag; }
    17481595  Bool getSpsExtensionFlag( )  { return m_spsExtensionFlag; }
     
    17501597  Void setSpsExtensionTypeFlag( Int i, Bool flag ) { m_spsExtensionTypeFlag[i] = flag; }
    17511598  Bool getSpsExtensionTypeFlag( Int i ) { return m_spsExtensionTypeFlag[i]; }
    1752 #endif
    17531599  Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
    17541600  TComVPS*  getVPS          () { return m_pcVPS; }
     
    17621608  Void setUpdateRepFormatFlag( Bool flag )     { m_updateRepFormatFlag = flag; }
    17631609  Bool getUpdateRepFormatFlag(  )              { return m_updateRepFormatFlag; }
    1764 #if H_MV_6_PS_REP_FORM_18_19_20
    17651610  Void setSpsRepFormatIdx( Int  val )          { m_spsRepFormatIdx = val; }
    17661611  Int  getSpsRepFormatIdx(  )                  { return m_spsRepFormatIdx; }
    1767 #endif
    17681612  // SPS Extension
    17691613  Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }
    17701614  Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
    17711615
    1772 #if H_MV_6_SHVC_O0098_36
    17731616  Void setNumScaledRefLayerOffsets( Int  val )    { m_numScaledRefLayerOffsets = val; }
    17741617  Int  getNumScaledRefLayerOffsets(  )            { return m_numScaledRefLayerOffsets; }
     
    17881631  Void setScaledRefLayerBottomOffset( Int j, Int  val ) { m_scaledRefLayerBottomOffset[j] = val; }
    17891632  Int  getScaledRefLayerBottomOffset( Int j )           { return m_scaledRefLayerBottomOffset[j]; }
    1790 #endif
    17911633  // Inference
    17921634  Void inferRepFormat( TComVPS* vps, Int layerIdCurr );
     
    17991641  Void setUsePC ( Bool b ) { m_bUsePC  = b;    }
    18001642  Bool getUsePC ()         { return m_bUsePC;  }
    1801 #endif
    1802 #if H_3D
    1803 #if !CAM_HLS_F0136_F0045_F0082
    1804   Void initCamParaSPS      (  UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
    1805   UInt getCamParPrecision    ()  { return m_uiCamParPrecision; }
    1806   Bool hasCamParInSliceHeader()  { return m_bCamParInSliceHeader; }
    1807 #if QC_DEPTH_IV_MRG_F0125
    1808   Void setHasCamParInSliceHeader( Bool b )  { m_bCamParInSliceHeader = b; }
    1809 #endif
    1810   Int* getCodedScale         ()  { return m_aaiCodedScale [0]; }
    1811   Int* getCodedOffset        ()  { return m_aaiCodedOffset[0]; }
    1812   Int* getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
    1813   Int* getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
    1814 #endif
    18151643#endif
    18161644#if H_MV
     
    19191747#endif
    19201748
    1921 #if DLT_DIFF_CODING_IN_PPS
     1749#if H_3D
    19221750  TComDLT*  m_pcDLT;
    19231751#endif
     
    19481776  UInt      getMinCuDQPSize     ()         { return m_uiMinCuDQPSize; }
    19491777
    1950 #if DLT_DIFF_CODING_IN_PPS
     1778#if H_3D
    19511779  Void      setDLT              ( TComDLT* pcDLT ) { m_pcDLT = pcDLT; }
    19521780  TComDLT*  getDLT              ()                 { return m_pcDLT; }
     
    22012029// Additional slice header syntax elements
    22022030  Bool       m_pocResetFlag;
    2203 #if H_MV_6_RALS_O0149_11
    22042031  Bool       m_crossLayerBlaFlag;
    2205 #endif
    22062032  Bool       m_discardableFlag;
    22072033  Bool       m_interLayerPredEnabledFlag;
     
    22142040#endif
    22152041#if H_3D_ARP
    2216 #if SHARP_ARP_REF_CHECK_F0105
    22172042  Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS];
    2218 #endif
    22192043  TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS];
    22202044  UInt                 m_nARPStepNum;
    2221 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    22222045  Int         m_aiFirstTRefIdx    [2];
    2223 #endif
    22242046#endif
    22252047#if H_3D_IC
     
    23082130#if H_3D_ARP
    23092131  Void      setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx )      { m_pBaseViewRefPicList[iViewIdx] = pListPic;                   }
    2310 #if SHARP_ARP_REF_CHECK_F0105
    23112132  Void      setARPStepNum( TComPicLists*ivPicLists );
    2312 #else
    2313   Void      setARPStepNum();                                 
    2314 #endif
    23152133  TComPic*  getBaseViewRefPic    ( UInt uiPOC , Int iViewIdx )                       { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); }
    23162134  UInt      getARPStepNum( )                                                         { return m_nARPStepNum;                                         } 
     
    25132331  Int       getAlterRefIdx          ( RefPicList e )        { return  m_aiAlterRefIdx[e];     }
    25142332#endif
    2515 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
     2333#if H_3D_ARP
    25162334  Int       getFirstTRefIdx        ( RefPicList e )                { return  m_aiFirstTRefIdx[e];     }
    25172335  Void      setFirstTRefIdx        ( RefPicList e, Int i )         { m_aiFirstTRefIdx[e]    = i;      }
    2518 #endif
    2519 #if SHARP_ARP_REF_CHECK_F0105
    25202336  Bool      getArpRefPicAvailable( RefPicList e, Int viewIdx) {return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; }
    25212337#endif
     
    25412357// Additional slice header syntax elements
    25422358
    2543 #if H_MV_6_RALS_O0149_11
    25442359  Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; }
    25452360  Bool getCrossLayerBlaFlag(  ) { return m_crossLayerBlaFlag; }
     
    25522367    }
    25532368  }
    2554 #endif
    25552369
    25562370  Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; }
    25572371  Bool getPocResetFlag(  ) { return m_pocResetFlag; }
    25582372
    2559 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; }
    2560 Bool getDiscardableFlag(  ) { return m_discardableFlag; }
    2561 
    2562 Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; }
    2563 Bool getInterLayerPredEnabledFlag(  ) { return m_interLayerPredEnabledFlag; }
    2564 
    2565 Void setNumInterLayerRefPicsMinus1( Int  val ) { m_numInterLayerRefPicsMinus1 = val; }
    2566 Int  getNumInterLayerRefPicsMinus1(  ) { return m_numInterLayerRefPicsMinus1; }
    2567 
    2568 Void setInterLayerPredLayerIdc( Int i, Int  val ) { m_interLayerPredLayerIdc[i] = val; }
    2569 Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; }
     2373  Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; }
     2374  Bool getDiscardableFlag(  ) { return m_discardableFlag; }
     2375
     2376  Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; }
     2377  Bool getInterLayerPredEnabledFlag(  ) { return m_interLayerPredEnabledFlag; }
     2378
     2379  Void setNumInterLayerRefPicsMinus1( Int  val ) { m_numInterLayerRefPicsMinus1 = val; }
     2380  Int  getNumInterLayerRefPicsMinus1(  ) { return m_numInterLayerRefPicsMinus1; }
     2381
     2382  Void setInterLayerPredLayerIdc( Int i, Int  val ) { m_interLayerPredLayerIdc[i] = val; }
     2383  Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; }
    25702384
    25712385  // Additional variables derived in slice header semantics
     
    25732387  Int  getInterLayerPredLayerIdcLen    ( ) { return gCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerId() )); }
    25742388
    2575 #if H_MV_6_ILDDS_ILREFPICS_27_34
    25762389  Int  getRefLayerPicFlag( Int i );
    25772390  Int  getRefLayerPicIdc ( Int j );
    25782391  Int  getNumRefLayerPics( );
    2579 #endif
    25802392
    25812393  Int  getNumActiveRefLayerPics( );
  • trunk/source/Lib/TLibCommon/TComWedgelet.h

    r724 r773  
    5050enum DIM_IDX
    5151{
    52 #if SEC_DMM3_RBC_F0147
    5352  DMM1_IDX = 0,
    5453  DMM4_IDX = 1,
    55 #else
    56   DMM1_IDX = 0,
    57   DMM3_IDX = 1,
    58   DMM4_IDX = 2,
    59   RBC_IDX  = 3
    60 #endif
    6154};
    6255
    63 #if SEC_DMM3_RBC_F0147
    6456#define DMM_NUM_TYPE   2
    6557#define DIM_NUM_TYPE   (DMM_NUM_TYPE)
    66 #else
    67 #define DMM_NUM_TYPE   3
    68 #define RBC_NUM_TYPE   1
    69 #define DIM_NUM_TYPE   (DMM_NUM_TYPE+RBC_NUM_TYPE)
    70 #endif
    7158#define DIM_NO_IDX     MAX_UINT
    7259
     
    7663#endif
    7764
    78 #if H_3D_DIM_RBC
    79 #define RBC_THRESHOLD              20
    80 #define RBC_MAX_EDGE_NUM_PER_4x4   8
    81 #define RBC_MAX_DISTANCE           255
    82 #endif
    83 
    8465#if H_3D_DIM_DMM
    8566#define DMM_NO_WEDGEINDEX       MAX_UINT
    8667#define DMM_NUM_WEDGE_REFINES   8
    87 #if !SEC_DMM3_RBC_F0147
    88 #define DMM3_SIMPLIFY_TR        1
    89 #endif
    9068
    9169enum WedgeResolution
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r758 r773  
    6969///////////////////////////////////   MAJOR DEFINES   /////////////////////////////////// 
    7070/////////////////////////////////////////////////////////////////////////////////////////
     71
    7172#if H_MV
    7273#define H_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
     
    9899                                              // MTK_TEXTURE_MRGCAND_BUGFIX_E0182  Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
    99100#define H_3D_ARP                          1   // Advanced residual prediction (ARP), JCT3V-D0177
     101                                              // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
     102                                              // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
     103                                              // LGE_ARP_CTX_F0161                JCT3V-F0161
    100104#define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    101105                                              // Unifying rounding offset, for IC part, JCT3V-D0135
     
    103107                                              // SHARP_ILLUCOMP_REFINE_E0046
    104108                                              // MTK_CLIPPING_ALIGN_IC_E0168       // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
     109                                              // LGE_IC_CTX_F0160 //JCT3V-F0160
     110                                              // SEC_ONLY_TEXTURE_IC_F0151
    105111
    106112#if H_3D_NBDV
     
    111117                                              // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV
    112118                                              // NTT_DoNBDV_VECTOR_CLIP_E0141 disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209
    113 
    114119#endif
    115120
     
    124129                                              // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208
    125130                                              // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208
     131                                              // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 
     132                                              // SHARP_VSP_BLOCK_IN_AMP_F0102 VSP partitioning for AMP
     133                                              // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
     134                                              // LGE_SHARP_VSP_INHERIT_F0104
     135
    126136#define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
    127137                                              // HHI_INTER_VIEW_MOTION_PRED
     
    133143                                              // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
    134144                                              // QC_INRIA_MTK_MRG_E0126
    135 
    136 
     145                                              // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate
     146                                              // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
    137147#define H_3D_TMVP                         1   // QC_TMVP_C0047
    138148                                              // Sony_M23639
     
    159169                                              // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC
    160170                                              // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   Removal of overlap between DMM3 and DMM1
     171                                              // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
     172                                              // HHI_DIM_PREDSAMP_FIX_F0171
     173                                              // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs
     174                                              // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
    161175
    162176#define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
    163177                                              // LGE_INTER_SDC_E0156  Enable inter SDC for depth coding
     178#define H_3D_SPIVMP                       1   // H_3D_SPIVMP    // JCT3V-F0110: Sub-PU level inter-view motion prediction
    164179#define H_3D_FCO                          0   // Flexible coding order for 3D
     180
    165181
    166182
     
    175191#endif
    176192
    177 #define CAM_HLS_F0136_F0045_F0082         1   // JCT3V-F0136/F0045: view order index based camera parameter signaling
    178                                               // JCT3V-F0082: the cp_in_slice_segment_layer_flag to be view specific and used as a condition of the presence of slice header level camera parameters
    179 #define CAM_HLS_F0044                     1   // JCT3V-F0044: move camera parameter from slice header extension to slice header
    180 
    181 
    182193// Rate Control
    183194#define KWU_FIX_URQ                       1
     
    203214#endif
    204215
    205 ////   ****** neighbouring block-based disparity vector  *********
     216////   ****** NEIGHBOURING BLOCK-BASED DISPARITY VECTOR  *********
    206217#if H_3D_NBDV
    207218#define DVFROM_LEFT                       0
     
    222233
    223234#if H_3D_DIM_DLT
    224 #define DLT_DIFF_CODING_IN_PPS            1   // moving DLT syntax elements from VPS to PPS and differential coding of DLT values
    225                                               // JCT3V-F0131, JCT3V-F0139
    226 #if DLT_DIFF_CODING_IN_PPS
    227 #define Log2( n ) ( log((double)n) / log(2.0) )
    228 #endif
    229235#define H_3D_DELTA_DLT                    1
    230236#endif
     
    258264#endif
    259265
    260 /////////////////////////////////////////////////////////////////////////////////////////
    261 ///////////////////////////////////   HTM-9.2 Integrations //////////////////////////////
    262 /////////////////////////////////////////////////////////////////////////////////////////
    263 
    264 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!!
    265 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!!
    266 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!!
    267 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!!
    268 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!!
    269 
    270 /////////////////////////////////////////////////////////////////////////////////////////
    271 ///////////////////////////////////   HTM-9.1 Integrations //////////////////////////////
    272 /////////////////////////////////////////////////////////////////////////////////////////
    273 
    274 #define H_MV_FIX_TRACE_FILE                     1  // Fix linux compilation error related const char conversion
    275 
    276 #define H_MV_LAYER_WISE_STARTUP                 1  // Basic version of layer wise startup.
    277 #define H_MV_FIX_SKIP_PICTURES                  1  // Fix related to skipping pictures.
    278 #define H_MV_6_HRD_O0164_15                     1  // (HRD/O0164/Multilayer HRD) #15 Decision: Adopt, modified as follows: It was suggested to constrain the stalling based on the relative cpb removal times, which must be in decoding order. The "du_based_bpb_sync_flag" is not needed, in view of this. SEI in the highest layer of the layer set or (inclusive "or") VPS VUI is used to carry the parameters (at encoder discretion). SEI in higher layer and SEI in VUI do not need to repeat information available in some lower layer. Shall be after APS SEI and buffering period SEI and before all other SEI of all layers except other HRD related SEI.
    279 #define H_MV_6_HRD_O0217_13                     1  // (HRD/O0217/Sub-DPB based DPB operations) #13 Decision: Adopt ?Specify a separate DPB capacity for each layer ?no sharing of capacity across layers ?each layer has its own parameters (max pictures, max latency, max reordering). This proposal would specify distinct parameters for each "output layer set" and to change the definition of an operation point to be specific to an output layer set instead of a 'layer set". Decision: Adopted this aspect as well.
    280 #define H_MV_6_SHVC_O0098_36                    1  // (SHVC/O0098/Scaled ref layer offset) #36 Modify signalling of scaled reference layer offsets to allow signalling of any lower layer, rather than just a direct reference layer, in order to enable alignment of auxiliary pictures. In further JCT-VC and JCT-3V discussion, it was also agreed to use the same offset signalling for MV-HEVC as well as SHVC
    281 #define H_MV_6_GEN_0153_28                      1  //(Gen/O0153/output highest layer) #28 Add a flag in the VPS to indicate if startup process should output the highest available layer if the target output layer is not available.
    282 #define H_MV_6_PS_0109_25                       1  //XXX(PS/O0109/default_one_target_output_layer_idc) #25 To change default_one_target_output_layer_flag to a two-bit default_one_target_output_layer_idc, and reserve the values 2 and 3
    283 #define H_MV_6_O0226_37                         1  //(VUI/O0226/Mod tile WPP) #37 Modifications to the VUI indicators of tile and WPP alignment related syntax elements, from the r1.
    284 #define H_MV_6_RALS_O0149_11                    1  //XXX (RALS/O0149/Prop2): #11 Proposal: A new slice_reserved_flag is taken into use to indicate if a base-layer IDR picture initiates the layer-wise start-up process. Decision: Adopt (the bit should not be required to be present; if present should be the bit after the discardable_flag, and discardable_flag should be the first one of the three, and the poc reset flag is not required to be present).
    285 #define H_MV_6_PSEM_O0142_3                     1  // (PSEM/O0142/Conditional extension syntax) #3 Adopt JCTVC-O0142 (as a structure to be used to switch whatever extensions we define in SPS, not necessarily committing to having these extensions be separate for each extension, but the current plan unless decided otherwise is to use one flag for range extensions syntax presence and one flag for SHVC+MV-HEVC extension syntax presence)
    286 #define H_MV_6_FIX_GET_VIEW_ID                  1  // Fix get view id
    287 #define H_MV_6_LAYER_ID_32                      1  // (Gen/O0137,O0200,O0223,Layer id) #32 Add (editorial equivalent of) "The value of nuh_layer_id shall be in the range of 0 to 62. The value of 63 for nuh_layer_id is reserved for future use by ITU-T | ISO/IEC. Decoders shall ignore all data that follow the value 63 for nuh_layer_id in a NAL unit." and specify that vps_max_layers_minus1 shall not be equal to 63, but decoders shall allow that value to appear in the bitstream. Specify that the value 63 is interpreted the same as the value 62 (e.g., MaxLayersMinus1 = Min( 62, vps_max_layers_minus1) and subsequently refer to MaxLayersMinus1 instead of vps_max_layers_minus1)
    288 #define H_MV_6_PS_O0118_33                      1  // (PS/O0118/visual signal info in vui per layer) #33 Add visual signal information (video_format, video_full_range_flag, colour_primaries, transfer_characteristics, matrix_coeffs) per layer to the VPS VUI, from v2 version of JCTVC-O0118.
    289 #define H_MV_6_POC_31_35_38                     1  //XXX  Various related to POC
    290                                                    // (Misc/O0062/POC LSB present) (SH changes)
    291                                                    // (POC/O0117/Modify PicOrderCntVal of prevTid0Pic) #35 Modification of the PicOrderCntVal of prevTid0Pic and modification to the decoding process for reference picture set, to address problems found for cross-layer POC alignment.
    292                                                    // (POC/O0211/Fix ambiguity) #38 Modify POC derivation to correct an ambiguity in the spec.
    293 #define H_MV_6_MISC_O0062_31                    1  // (Misc/O0062/POC LSB present) (without SH changes ) #31 The proposal's "option 3" is to add a flag in the VPS for each EL to control whether these LSBs are present or not (for IDR pictures), and when not present, the LSBs are inferred to be equal to 0. Decision: Adopted (as described herein).
    294 #define H_MV_6_ILDDS_ILREFPICS_27_34            1  // Various inter layer reference picture derivation
    295                                                    // (ILDSD/O0225/max_tid_il_ref_pics RPL const.) #27 Change derivation of NumActiveRefLayerPics to consider max_tid_il_ref_pics.
    296                                                    // (ILDSD/O0120/sub_layers_vps_max_minus1 RPL const) #34 Modify inter-layer reference picture list default construction to incorporate max temporal sub-layers per layer syntax elements in VPS extension, from r2 version of JCTVC-O0120
    297 #define H_MV_6_ILDDS_O0225_30                   1  // (ILDSD/O0225/signal max_tid_il_ref_pics per layer ) #30 2nd proposal of JCTVC-O0225 regarding signalling of max_tid_il_ref_pics per layer, based upon relation to SCE2 on single loop decoding. Decision: Adopted.
    298 #define H_MV_6_ILDSD_O0120_26                   1  // (ILDSD/O0120/sub_layers_vps_max_minus1) #26 Add syntax elements to signal max temporal sub-layers for each layer in the VPS, with a gating flag, from JCTVC- option 2.
    299 #define H_MV_6_PS_O0223_29                      1  // (PS/O0223/Cross layer alignment type) #29 Add a flag in VPS VUI to indicate cross layer pic type alignment.  Move cross_layer_irap_aligned_flag to VPS VUI and make presence condition on added flag
    300 #define H_MV_6_PS_0092_17                       1  // (PS/O0092/Sharing SPS PPS) #17 Restrict sharing of SPS and PPS across layers to avoid creating problems during sub-bitstream extraction, based on modification of proposals in JCTVC-O0059 and JCTVC-O0092, reflected in the v2 version of O0092.
    301 #define H_MV_6_PS_REP_FORM_18_19_20             1  //  Various Rep format
    302                                                    // (PS/O0096/rep format syntax element length ) #20 Modification of length to 8 bit as decided later in trac.
    303                                                    // (PS/O0179/Rep. Format) #18 Add flag in rep_format( ) syntax structure to control sending of chroma and bit depth related parameters, as proposed in the v2 version of JCTVC-O0179.
    304                                                    // (PS/O0096/rep format) #20 Modify the SPS syntax for layers with nuh_layer_id > 0 to signal a reference to a rep_format index in the VPS, rather than signalling explicit representation format data in the SPS, from the v2 version of JCTVC-O0096.
    305                                                    // (PS/FIX/N0092/Rep. Format) #19 Inferences.
    306 #define H_MV_6_PS_O0096_21                      1  // (PS/O0096/direct_dependency_type gating flag) #21 Add a gating flag in VPS extension to condition the presence of direct dependency type, with a default type signalled, from JCTVC-O0096
    307 #define H_MV_6_PS_O0109_22                      1  // (PS/O0109/view_id_len) #22 Modify the VPS extension syntax and semantics to replace view_id_len_minus1 with view_id_len, always signal that syntax element, add a constraint that (1<<view_id_len) >= NumViews, and modify view_id_val semantics to infer value of 0 when not present, from discussion of JCTVC-O0109
    308 #define H_MV_6_PS_O0109_23                      1  // (PS/O0109/profile_ref_minus1 constraint) #23 Modify the semantics of profile_ref_minus1[ i ] to replace “shall be less than i?with “shall be less than or equal to i? from discussion of JCTVC-O0109
    309 #define H_MV_6_PS_O0109_24                      1  // (PS/O0109/vps_vui_present_flag move) #24 Move the vps_vui_present_flag to precede vps_vui_offset, and make vps_vui_offset conditional on that flag, from JCTVC-O0109
    310 /////////////////////////////////////////////////////////////////////////////////////////
    311 ///////////////////////////////////   HTM-9.0 Integrations //////////////////////////////
    312 /////////////////////////////////////////////////////////////////////////////////////////
    313 
    314266#if H_3D
    315 
    316 #define FIX_MISSING_MACRO_R690                  1 // Missing macro in integration to revision 690
    317 
    318 #define SEC_MPI_ENABLING_MERGE_F0150            1 // MPI flag in VPS and enabling in Merge mode
    319 #define ETRIKHU_MERGE_REUSE_F0093               1 // Reuse HEVC merge candidate list construction for base candidates, JCT3V-F0093
    320 
    321 #if H_3D_ARP
    322 #define QC_MTK_INTERVIEW_ARP_F0123_F0108        1 //JCT3V-F0123; JCT3V-F0108
    323 #define SHARP_ARP_REF_CHECK_F0105               1 // ARP reference picture selection and DPB check
    324 #define LGE_ARP_CTX_F0161                       1 //JCT3V-F0161
    325 #endif
    326 
    327 #if H_3D_IV_MERGE
    328 #define QC_DEPTH_IV_MRG_F0125                   1 // JCT3V-F0125: Depth oriented Inter-view MV candidate
    329 #define MTK_SPIVMP_F0110                        1 // JCT3V-F0110: Sub-PU level inter-view motion prediction
    330 #define MTK_F0110_FIX                           1 // Disable Sub-PU IVMP in Depth, fix some delete problems
    331 #define BUGFIX_F0093                            1 // bug fix for F0093 for depth IvMC pruning
    332 #define BUGFIX_2_F0093                          1 // bug fix for VSP inheritance
    333 #endif
    334 
    335 #if H_3D_VSP
    336 #define MTK_F0109_LG_F0120_VSP_BLOCK            1 // MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 
    337 #define SHARP_VSP_BLOCK_IN_AMP_F0102            1 // VSP partitioning for AMP
    338 #define MTK_VSP_SIMPLIFICATION_F0111            1 // 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
    339 #define LGE_SHARP_VSP_INHERIT_F0104             1
    340 #endif
    341 
    342 #define LGE_BUGFIX_F0158                        1 //JCT3V-F0158
    343 #define LGE_IC_CTX_F0160                        1 //JCT3V-F0160
    344 #define SEC_ONLY_TEXTURE_IC_F0151               1
    345 
    346 #if H_3D_DIM
    347 #define SEC_DMM3_RBC_F0147                      1 // Removal of DMM3 and RBC from DMMs
    348 #if !SEC_DMM3_RBC_F0147
    349 #define H_3D_DIM_RBC                            1 // Region Boundary Chain mode
    350 #endif
    351 #define QC_DIM_DELTADC_UNIFY_F0132              1 // Unify delta DC coding in depth intra modes
    352 #define HHI_DIM_PREDSAMP_FIX_F0171              1
    353 #define LGE_PRED_RES_CODING_DLT_DOMAIN_F0159    1 //JCT3V-F0159
    354 #endif
    355 #endif
    356 
     267#define PPS_FIX_DEPTH                           1
     268#endif
     269
     270
     271/////////////////////////////////////////////////////////////////////////////////////////
     272///////////////////////////////////   HTM-10.0 Integrations //////////////////////////////
     273/////////////////////////////////////////////////////////////////////////////////////////
     274
     275// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     276// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     277// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     278// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     279// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     280// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     281// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     282// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     283// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
     284// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
    357285
    358286/////////////////////////////////////////////////////////////////////////////////////////
     
    370298#define MAX_VPS_OP_SETS_PLUS1                     1024
    371299#if H_MV
    372 #if H_MV_6_LAYER_ID_32
    373300#define MAX_VPS_NUH_LAYER_ID_PLUS1  63
    374 #else
    375 #define MAX_VPS_NUH_LAYER_ID_PLUS1  64
    376 #endif
    377301#define MAX_NUM_SCALABILITY_TYPES   16
    378302#define ENC_CFG_CONSOUT_SPACE       29           
     
    398322#define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
    399323#if H_MV
    400 #if H_MV_6_LAYER_ID_32
    401324#define MAX_NUM_LAYER_IDS               63
    402325#define MAX_NUM_LAYERS                  63
    403 #else
    404 #define MAX_NUM_LAYER_IDS               64
    405 #define MAX_NUM_LAYERS                  64
    406 #endif
    407326#define MAX_VPS_PROFILE_TIER_LEVEL      64
    408327#define MAX_VPS_ADD_OUTPUT_LAYER_SETS   1024
    409328#define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 )
    410 #if H_MV_6_PS_O0118_33
    411329#define  MAX_NUM_VIDEO_SIGNAL_INFO      16
    412 #endif
    413 #if H_MV_6_SHVC_O0098_36
    414330#define MAX_NUM_SCALED_REF_LAYERS       MAX_NUM_LAYERS-1
    415 #endif
    416 #if H_MV_6_HRD_O0164_15
    417331#define MAX_NUM_BSP_HRD_PARAMETERS      100 ///< Maximum value is actually not specified
    418332#define MAX_NUM_BITSTREAM_PARTITIONS    100 ///< Maximum value is actually not specified
    419333#define MAX_NUM_BSP_SCHED_COMBINATION   100 ///< Maximum value is actually not specified
    420 #endif
     334#else
     335#define MAX_NUM_LAYER_IDS                64
    421336#endif
    422337
     
    896811#if H_MV
    897812
    898 #if H_MV_6_PSEM_O0142_3
    899813  enum PsExtensionTypes
    900814  {
     
    906820    PS_EX_T_MAX_NUM = 8
    907821  };
    908 #endif
    909822
    910823/// scalability types
     
    937850  };
    938851
    939 
    940 #endif
    941 #endif
     852#define Log2( n ) ( log((double)n) / log(2.0) ) // Ed.(GT): This is very very bad and should be fixed to used integer arithmetics ( see gCeilLog2 ) moreover it should not be defined in the tool macro section!
     853#endif
     854#endif
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r758 r773  
    215215}
    216216
    217 #if DLT_DIFF_CODING_IN_PPS
     217#if H_3D
    218218Void TDecCavlc::parsePPS(TComPPS* pcPPS, TComVPS* pcVPS )
    219219#else
     
    368368  if (uiCode)
    369369  {
    370 #if DLT_DIFF_CODING_IN_PPS
     370#if H_3D
    371371    parsePPSExtension( pcPPS, pcVPS );
    372372    READ_FLAG( uiCode, "pps_extension2_flag");
     
    378378        READ_FLAG( uiCode, "pps_extension_data_flag");
    379379      }
    380 #if DLT_DIFF_CODING_IN_PPS
    381     }
    382 #endif
    383   }
    384 }
    385 
    386 #if DLT_DIFF_CODING_IN_PPS
     380#if H_3D
     381    }
     382#endif
     383  }
     384}
     385
     386#if H_3D
    387387Void TDecCavlc::parsePPSExtension( TComPPS* pcPPS, TComVPS* pcVPS )
    388388{
     389  //Ed.(GT): pcVPS should not be used here. Needs to be fixed.
    389390  UInt uiCode = 0;
    390391  TComDLT* pcDLT = new TComDLT;
     
    556557
    557558  READ_FLAG(     uiCode, "video_signal_type_present_flag");           pcVUI->setVideoSignalTypePresentFlag(uiCode);
    558 #if H_MV_6_PS_O0118_33
     559#if H_MV
    559560  assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() );
    560561#endif
    561 
    562562  if (pcVUI->getVideoSignalTypePresentFlag())
    563563  {
     
    746746  {
    747747    READ_FLAG( uiCode, "update_rep_format_flag" );               pcSPS->setUpdateRepFormatFlag( uiCode == 1 );
    748 #if H_MV_6_PS_REP_FORM_18_19_20
    749748    if ( pcSPS->getUpdateRepFormatFlag() )
    750749    {
     
    754753  else
    755754  {
    756 #else
    757   }
    758  
    759   if ( pcSPS->getUpdateRepFormatFlag() )
    760   {
    761 #endif
    762755#endif
    763756  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     
    795788
    796789#if H_MV
    797 #if H_MV_6_PS_REP_FORM_18_19_20
    798790  if ( pcSPS->getLayerId() == 0 )
    799 #else
    800   if ( pcSPS->getUpdateRepFormatFlag() )
    801 #endif
    802791  {
    803792#endif
     
    948937
    949938  READ_FLAG( uiCode, "sps_extension_flag");
    950 #if H_MV_6_PSEM_O0142_3
     939#if H_MV
    951940  pcSPS->setSpsExtensionFlag( uiCode );
    952 #endif
    953941  if (pcSPS->getSpsExtensionFlag( ) )
    954   {
    955 #if !H_MV_6_PSEM_O0142_3
    956 #if H_MV
    957     parseSPSExtension( pcSPS );
    958     READ_FLAG( uiCode, "sps_extension2_flag");
    959     if ( uiCode )
    960     {
    961 #if H_3D
    962       parseSPSExtension2( pcSPS, viewIndex, depthFlag );
    963       READ_FLAG( uiCode, "sps_extension3_flag");
    964       if ( uiCode )
    965       {
    966 #endif
    967 #endif
    968 #else   
     942#else
     943  if (uiCode)
     944#endif
     945  {
     946#if H_MV
    969947    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
    970948    {
     
    996974          READ_FLAG( uiCode, "sps_extension_data_flag");
    997975        }
    998 #if H_MV_6_PSEM_O0142_3
    999     }
    1000 #else
    1001 #if H_MV     
    1002 #if H_3D
    1003       }
    1004 #endif
    1005     }
    1006 #endif
     976#if H_MV
     977    }
    1007978#endif
    1008979  }
     
    1014985  UInt uiCode;
    1015986  READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
    1016 #if !H_MV_6_SHVC_O0098_36
    1017   READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" );
    1018 #else
    1019987 
    1020988  READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets( uiCode );
     
    1031999    READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode );
    10321000  }
    1033 #endif 
    10341001}
    10351002
     
    10481015  }
    10491016#endif
    1050 
    1051 #if !CAM_HLS_F0136_F0045_F0082
    1052   UInt uiCamParPrecision = 0;
    1053   Bool bCamParSlice      = false;
    1054   if ( !depthFlag )
    1055   {     
    1056     READ_UVLC( uiCamParPrecision, "cp_precision" );
    1057     READ_FLAG( uiCode, "cp_in_slice_header_flag" );    bCamParSlice = ( uiCode == 1 );
    1058     if( !bCamParSlice )
    1059     {       
    1060       for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ )
    1061       {
    1062         Int iCode;
    1063         READ_SVLC( iCode, "cp_scale" );                m_aaiTempScale  [ uiBaseIndex ][ viewIndex ]   = iCode;
    1064         READ_SVLC( iCode, "cp_off" );                  m_aaiTempOffset [ uiBaseIndex ][ viewIndex ]   = iCode;
    1065         READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale  [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ viewIndex ];
    1066         READ_SVLC( iCode, "cp_inv_off_plus_off" );     m_aaiTempOffset [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ viewIndex ];
    1067       }
    1068     }
    1069   }
    1070   pcSPS->initCamParaSPS( viewIndex, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );
    1071 #endif
    10721017}
    10731018#endif
     
    10811026  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
    10821027#if H_MV
    1083 #if H_MV_6_LAYER_ID_32
    10841028  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( std::min( uiCode, (UInt) ( MAX_NUM_LAYER_IDS-1) )  );
    1085 #else
    1086   READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( uiCode  );
    1087 #endif
    10881029#else
    10891030  READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
     
    11401081    }
    11411082  }
    1142 #if H_MV_6_HRD_O0217_13
     1083#if H_MV
    11431084  pcVPS->deriveLayerSetLayerIdList();
    11441085#endif
     
    11811122#if H_3D
    11821123      m_pcBitstream->readOutTrailingBits();
    1183 #if CAM_HLS_F0136_F0045_F0082
    11841124      pcVPS->createCamPars(pcVPS->getNumViews());
    1185 #endif
    11861125      parseVPSExtension2( pcVPS );   
    11871126      READ_FLAG( uiCode,  "vps_extension3_flag" );
     
    12091148  UInt uiCode;
    12101149  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
    1211 #if H_MV_6_PS_O0109_24
    12121150  READ_FLAG( uiCode, "vps_vui_present_flag" );                    pcVPS->setVpsVuiPresentFlag( uiCode == 1 );  if ( pcVPS->getVpsVuiPresentFlag() )
    12131151  { 
    1214 #endif
    12151152  READ_CODE( 16, uiCode, "vps_vui_offset" );                      pcVPS->setVpsVuiOffset( uiCode );
    1216 #if H_MV_6_PS_O0109_24
    1217   }
    1218 #endif
     1153  }
    12191154
    12201155  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
     
    12631198  }
    12641199
    1265 #if H_MV_6_PS_O0109_22
    12661200  READ_CODE( 4, uiCode, "view_id_len" ); pcVPS->setViewIdLen( uiCode );
    12671201
     
    12801214    }
    12811215  }
    1282 #else
    1283   // GT spec says: trac #39
    1284   // if ( pcVPS->getNumViews() > 1 ) 
    1285   //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    1286   {
    1287     READ_CODE( 4, uiCode, "view_id_len_minus1" ); pcVPS->setViewIdLenMinus1( uiCode );
    1288   }
    1289 
    1290   for( Int i = 0; i < pcVPS->getNumViews(); i++ )
    1291   {
    1292     READ_CODE( pcVPS->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode );
    1293   }
    1294 #endif
    12951216
    12961217
     
    13021223    }
    13031224  }
    1304 #if H_MV_6_MISC_O0062_31
    13051225  pcVPS->setRefLayers();
    1306 #endif
    1307 #if H_MV_6_ILDSD_O0120_26
    13081226  READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 );
    13091227  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    13231241    }
    13241242  }
    1325 #endif
    13261243  READ_FLAG( uiCode, "max_tid_ref_present_flag" ); pcVPS->setMaxTidRefPresentFlag( uiCode == 1 );
    13271244
     
    13301247    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
    13311248    {
    1332 #if H_MV_6_ILDDS_O0225_30
    13331249      for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ )
    13341250      {
     
    13381254        }
    13391255      }
    1340 #else
    1341       READ_CODE( 3, uiCode,       "max_tid_il_ref_pics_plus1[i]" );      pcVPS->setMaxTidIlRefPicPlus1( i , uiCode );
    1342 #endif
    13431256    }
    13441257  }
     
    13541267    {
    13551268      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );
    1356 #if H_MV_6_PS_O0109_23
    13571269      pcVPS->checkProfileRefMinus1( i );     
    1358 #endif
    13591270    }
    13601271    parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
     
    13791290  if( numOutputLayerSets > 1)
    13801291  {
    1381 #if H_MV_6_PS_0109_25
    13821292    READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" ); pcVPS->setDefaultOneTargetOutputLayerIdc( uiCode );
    13831293    pcVPS->checkDefaultOneTargetOutputLayerIdc();
    1384 #else
    1385     READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag(  uiCode == 1);
    1386 #endif
    13871294  } 
    13881295
    1389 #if H_MV_6_HRD_O0217_13
    13901296  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
    13911297  pcVPS->setOutputLayerSetIdxMinus1(0, -1);
    1392 #endif
    13931298  for( Int i = 1; i < numOutputLayerSets; i++ )
    13941299  {
     
    14011306      }       
    14021307    }
    1403 #if H_MV_6_HRD_O0217_13
    14041308    else
    14051309    { // These inference rules would also be helpful in spec text
     
    14101314      }
    14111315    }
    1412 #endif
    14131316
    14141317    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     
    14171320    }
    14181321  }
    1419 #if H_MV_6_GEN_0153_28
    14201322  if( pcVPS->getMaxLayersMinus1() > 0 )
    14211323  {
    14221324    READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 );
    14231325  }
    1424 #endif
    1425 #if H_MV_6_HRD_O0217_13
    14261326  pcVPS->deriveTargetLayerIdLists();
    1427 #endif
    14281327  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    14291328  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    14341333  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    14351334  {
    1436 #if H_MV_6_PS_REP_FORM_18_19_20
    14371335    assert( pcVPS->getRepFormat(i) == NULL );
    14381336    TComRepFormat* curRepFormat = new TComRepFormat();
     
    14401338    parseRepFormat( i, curRepFormat ,  prevRepFormat);
    14411339    pcVPS->setRepFormat(i, curRepFormat );
    1442 #else
    1443     assert( pcVPS->getRepFormat(i) == NULL );
    1444     TComRepFormat* repFormat = new TComRepFormat();
    1445     parseRepFormat( repFormat );
    1446     pcVPS->setRepFormat(i, repFormat );
    1447 #endif
    14481340  }
    14491341
     
    14541346      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    14551347      {
    1456 #if H_MV_6_PS_REP_FORM_18_19_20
    14571348        READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1458 #else
    1459         READ_CODE( 4, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1460 #endif
    14611349      }
    14621350    }
     
    14641352
    14651353  READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 );
    1466 #if H_MV_6_MISC_O0062_31
    14671354  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    14681355  {
     
    14721359    }
    14731360  }
    1474 #endif
    1475 
    1476 #if H_MV_6_HRD_O0217_13
     1361
    14771362  parseDpbSize( pcVPS );
    1478 #endif
    1479 
    1480 #if !H_MV_6_PS_O0223_29
    1481   READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPS->setCrossLayerIrapAlignedFlag( uiCode == 1 );
    1482 #endif
     1363
    14831364  READ_UVLC( uiCode, "direct_dep_type_len_minus2")    ; pcVPS->setDirectDepTypeLenMinus2   ( uiCode );
    14841365
    1485 #if H_MV_6_PS_O0096_21
    14861366  READ_FLAG( uiCode, "default_direct_dependency_flag" ); pcVPS->setDefaultDirectDependencyFlag( uiCode == 1 );
    14871367  if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     
    15071387    }
    15081388  } 
    1509 #else
    1510   for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    1511   {
    1512     for( Int j = 0; j < i; j++ )
    1513     {
    1514       if (pcVPS->getDirectDependencyFlag( i, j) )
    1515       {       
    1516         READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
    1517       }
    1518     }
    1519   }
    1520 #endif
    15211389
    15221390  READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" );
    1523 #if !H_MV_6_PS_O0109_24
    1524   READ_FLAG( uiCode, "vps_vui_present_flag" )       ; pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
    1525 #endif
    15261391
    15271392  if( pcVPS->getVpsVuiPresentFlag() )
     
    15321397
    15331398  pcVPS->checkVPSExtensionSyntax();
    1534 #if !H_MV_6_MISC_O0062_31
    1535   pcVPS->setRefLayers();
    1536 #endif
    1537 }
    1538 
    1539 #if H_MV_6_PS_REP_FORM_18_19_20
     1399}
     1400
    15401401Void TDecCavlc::parseRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat )
    1541 #else
    1542 Void TDecCavlc::parseRepFormat( TComRepFormat* pcRepFormat )
    1543 #endif
    15441402{
    15451403  assert( pcRepFormat );
     
    15471405  UInt uiCode;
    15481406
    1549 #if H_MV_6_PS_REP_FORM_18_19_20
    15501407  READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" );  pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode );
    15511408  READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode );
     
    15561413  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
    15571414  { 
    1558 #endif
    15591415  READ_CODE( 2,  uiCode, "chroma_format_vps_idc" );          pcRepFormat->setChromaFormatVpsIdc       ( uiCode );
    15601416  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     
    15621418    READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 );
    15631419  }
    1564 #if !H_MV_6_PS_REP_FORM_18_19_20
    1565   READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" );  pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode );
    1566   READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode );
    1567 #endif
    15681420  READ_CODE( 4,  uiCode, "bit_depth_vps_luma_minus8" );      pcRepFormat->setBitDepthVpsLumaMinus8    ( uiCode );
    15691421  READ_CODE( 4,  uiCode, "bit_depth_vps_chroma_minus8" );    pcRepFormat->setBitDepthVpsChromaMinus8  ( uiCode );
    1570 #if H_MV_6_PS_REP_FORM_18_19_20
    15711422  }
    15721423  else
     
    15741425    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, false );
    15751426  }
    1576 #endif
    15771427}
    15781428
     
    15871437
    15881438  UInt uiCode;
    1589 #if H_MV_6_PS_O0223_29
    15901439  READ_FLAG( uiCode, "cross_layer_pic_type_aligned_flag" ); pcVPSVUI->setCrossLayerPicTypeAlignedFlag( uiCode == 1 );
    15911440  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     
    15931442    READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 );
    15941443  }
    1595 #endif
    15961444  READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 );
    15971445  READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 );
     
    16241472  }
    16251473
    1626 #if H_MV_6_O0226_37
    16271474  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
    16281475  if( !pcVPSVUI->getTilesNotInUseFlag() )
     
    16591506    }
    16601507  }
    1661 #else
    1662   for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1663   {
    1664     for( Int  j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    1665     {
    1666       READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVPSVUI->setTileBoundariesAlignedFlag( i, j, uiCode == 1 );
    1667     }
    1668   }
    1669 #endif
    16701508
    16711509  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
     
    16901528  }
    16911529
    1692 #if H_MV_6_PS_O0118_33
    16931530  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
    16941531  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     
    17241561    }
    17251562  }
    1726 #endif
    1727 #if H_MV_6_HRD_O0164_15
    17281563  READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 );
    17291564  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     
    17311566    parseVpsVuiBspHrdParameters( pcVPS );
    17321567}
    1733 #endif
    1734 }
    1735 
    1736 #if H_MV_6_HRD_O0164_15
     1568}
     1569
    17371570Void TDecCavlc::parseVpsVuiBspHrdParameters( TComVPS* pcVPS )
    17381571{
     
    17911624  } 
    17921625
    1793 #endif
    1794 
    1795 #if H_MV_6_PS_O0118_33
     1626
    17961627Void TDecCavlc::parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
    17971628{
     
    18031634  READ_CODE( 8, uiCode, "matrix_coeffs_vps" );            pcVideoSignalInfo->setMatrixCoeffsVps( uiCode );
    18041635}
    1805 #endif
    1806 
    1807 #if H_MV_6_HRD_O0217_13
     1636
    18081637Void TDecCavlc::parseDpbSize( TComVPS* vps )
    18091638{
     
    18471676}
    18481677#endif
    1849 #endif
    18501678
    18511679#if H_3D
     
    18591687    pcVPS->setARPStepNum( i, 1 );
    18601688#endif 
    1861 #if MTK_SPIVMP_F0110
     1689#if H_3D_SPIVMP
    18621690    pcVPS->setSubPULog2Size(i, 0);
    18631691#endif
     
    18681696#if H_3D_IV_MERGE
    18691697        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
    1870 #if MTK_SPIVMP_F0110
     1698#if H_3D_SPIVMP
    18711699        READ_UVLC (uiCode, "log2_sub_PU_size_minus2");     pcVPS->setSubPULog2Size(i, uiCode+2);
    18721700#endif
     
    18851713      else
    18861714      {
    1887 #if QC_DEPTH_IV_MRG_F0125 && H_3D_IV_MERGE
     1715#if H_3D_IV_MERGE
    18881716        if(i!=1)
    18891717        {
     
    18911719        }
    18921720#endif
    1893 #if MTK_SPIVMP_F0110
     1721#if H_3D_SPIVMP
    18941722        if (i!=1)
    18951723        {
     
    18971725        }
    18981726#endif
    1899 #if SEC_MPI_ENABLING_MERGE_F0150
     1727#if H_3D_IV_MERGE
    19001728        READ_FLAG( uiCode, "mpi_flag[i]" );             pcVPS->setMPIFlag( i, uiCode == 1 ? true : false );
    19011729#endif
    19021730        READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
    19031731        //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false );
    1904 #if H_3D_DIM_DLT
    1905 #if !DLT_DIFF_CODING_IN_PPS
    1906         if( pcVPS->getVpsDepthModesFlag( i ) )
    1907         {
    1908           READ_FLAG( uiCode, "dlt_flag[i]" );                       pcVPS->setUseDLTFlag( i, uiCode == 1 ? true : false );
    1909         }
    1910         if( pcVPS->getUseDLTFlag( i ) )
    1911         {
    1912           // decode mapping
    1913           UInt uiNumDepthValues;
    1914           // parse number of values in DLT
    1915           READ_UVLC(uiNumDepthValues, "num_depth_values_in_dlt[i]");
    1916 
    1917           // parse actual DLT values
    1918           Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));
    1919           for(Int d=0; d<uiNumDepthValues; d++)
    1920           {
    1921             READ_UVLC(uiCode, "dlt_depth_value[i][d]");
    1922             aiIdx2DepthValue[d] = (Int)uiCode;
    1923           }
    1924 
    1925           pcVPS->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
    1926 
    1927           // clean memory
    1928           free(aiIdx2DepthValue);
    1929         }
    1930 #endif
    1931 #endif
    19321732#if H_3D_INTER_SDC
    19331733            READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
     
    19361736    }
    19371737  }
    1938 #if CAM_HLS_F0136_F0045_F0082
     1738
    19391739  UInt uiCamParPrecision = 0;
    19401740  Bool bCamParSlice      = false;
     
    19621762    }
    19631763  }
    1964 #endif
     1764
    19651765  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    19661766}
     
    20001800  sps->inferRepFormat  ( vps , rpcSlice->getLayerId() );
    20011801  sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
    2002 #if H_MV_6_PS_O0118_33
    20031802  if ( sps->getVuiParametersPresentFlag() )
    20041803  {
    20051804    sps->getVuiParameters()->inferVideoSignalInfo( vps, rpcSlice->getLayerId() );
    20061805  }
    2007 #endif
    20081806  rpcSlice->setVPS(vps);     
    20091807  rpcSlice->setViewId   ( vps->getViewId   ( rpcSlice->getLayerId() )      );
     
    20591857#if H_MV   
    20601858    Int esb = 0; //Don't use i, otherwise will shadow something below
    2061 #if !H_MV_6_RALS_O0149_11
     1859
     1860    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1861    {
     1862      esb++;
     1863      READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
     1864    }
     1865
     1866    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1867    {
     1868      esb++;
     1869      READ_FLAG( uiCode, "cross_layer_bla_flag" ); rpcSlice->setCrossLayerBlaFlag( uiCode == 1 );
     1870    }
     1871    rpcSlice->checkCrossLayerBlaFlag( );
     1872
    20621873    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    20631874    {
     
    20651876      READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 );
    20661877    }
    2067 #endif
    2068 
    2069     if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    2070     {
    2071       esb++;
    2072       READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
    2073     }
    2074 
    2075 #if H_MV_6_RALS_O0149_11
    2076     if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    2077     {
    2078       esb++;
    2079       READ_FLAG( uiCode, "cross_layer_bla_flag" ); rpcSlice->setCrossLayerBlaFlag( uiCode == 1 );
    2080     }
    2081     rpcSlice->checkCrossLayerBlaFlag( );
    2082 
    2083     if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    2084     {
    2085       esb++;
    2086       READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 );
    2087     }
    2088 #endif
    20891878
    20901879    for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
     
    21111900
    21121901
    2113 #if H_MV_6_POC_31_35_38
     1902#if H_MV
    21141903    UInt slicePicOrderCntLsb = 0;
    21151904    Int iPOClsb = slicePicOrderCntLsb;  // Needed later
     
    21621951    if( rpcSlice->getIdrPicFlag() )
    21631952    {
    2164 #if !H_MV_6_POC_31_35_38
     1953#if !H_MV
    21651954      rpcSlice->setPOC(0);
    21661955#endif
     
    21771966    else
    21781967    {
    2179 #if !H_MV_6_POC_31_35_38
     1968#if !H_MV
    21801969      READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 
    21811970      Int iPOClsb = uiCode;
     
    22051994      }
    22061995      rpcSlice->setPOC              (iPOCmsb+iPOClsb);
    2207 #if H_MV
    2208       if ( rpcSlice->getPocResetFlag() ) 
    2209       {
    2210         rpcSlice->setPocBeforeReset   ( rpcSlice->getPOC() );
    2211         rpcSlice->setPOC              ( 0 );
    2212 
    2213       }     
    2214 #endif
    22151996#endif
    22161997      TComReferencePictureSet* rps;
     
    23472128    }
    23482129#if H_MV
    2349 #if H_MV_6_ILDDS_ILREFPICS_27_34
    23502130    Bool interLayerPredLayerIdcPresentFlag = false;
    2351 #endif
    23522131    Int layerId       = rpcSlice->getLayerId();
    23532132    if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     
    23622141        if ( rpcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    23632142        {
    2364 #if H_MV_6_ILDDS_ILREFPICS_27_34
    23652143          interLayerPredLayerIdcPresentFlag = true;
    2366 #endif
    23672144          for( Int idx = 0; idx < rpcSlice->getNumActiveRefLayerPics(); idx++ )   
    23682145          {
     
    23722149      } 
    23732150    }
    2374 #if H_MV_6_ILDDS_ILREFPICS_27_34
    23752151    if ( !interLayerPredLayerIdcPresentFlag )
    23762152    {
     
    23802156      }
    23812157    }
    2382 #endif
    23832158#endif
    23842159    if(sps->getUseSAO())
     
    25502325    }
    25512326#if H_3D_IC
    2552 #if SEC_ONLY_TEXTURE_IC_F0151
    25532327    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth())
    2554 #else
    2555     else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) )
    2556 #endif
    25572328    {
    25582329      UInt uiCodeTmp = 0;
     
    25722343      READ_UVLC( uiCode, "five_minus_max_num_merge_cand");
    25732344#if H_3D_IV_MERGE
    2574 #if SEC_MPI_ENABLING_MERGE_F0150
    25752345      if(rpcSlice->getIsDepth())
    25762346      {
     
    25842354        rpcSlice->setMaxNumMergeCand(( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);
    25852355      }
    2586 #else
    2587       Bool ivMvPredFlag = rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ;
    2588       rpcSlice->setMaxNumMergeCand(( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);
    2589 #endif
     2356
    25902357#else
    25912358      rpcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode);
     
    26892456  }
    26902457
    2691 #if CAM_HLS_F0044
    2692 #if CAM_HLS_F0136_F0045_F0082
     2458#if H_3D
    26932459  if( rpcSlice->getVPS()->hasCamParInSliceHeader( rpcSlice->getViewIndex() )  && !rpcSlice->getIsDepth() )
    2694 #else
    2695   if( rpcSlice->getSPS()->hasCamParInSliceHeader() )
    2696 #endif
    26972460  {
    26982461    UInt uiViewIndex = rpcSlice->getViewIndex();
     
    27062469    rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset );
    27072470  }
    2708 
    27092471#endif
    27102472
     
    27122474  {
    27132475    READ_UVLC(uiCode,"slice_header_extension_length");
    2714 #if H_3D && !CAM_HLS_F0044
    2715 #if CAM_HLS_F0136_F0045_F0082
    2716     if( rpcSlice->getVPS()->hasCamParInSliceHeader( rpcSlice->getViewIndex() )  && !rpcSlice->getIsDepth() )
    2717 #else
    2718     if( rpcSlice->getSPS()->hasCamParInSliceHeader() )
    2719 #endif
    2720     {
    2721       UInt uiViewIndex = rpcSlice->getViewIndex();
    2722       for( UInt uiBaseIndex = 0; uiBaseIndex < uiViewIndex; uiBaseIndex++ )
    2723       {
    2724         READ_SVLC( iCode, "cp_scale" );                m_aaiTempScale [ uiBaseIndex ][ uiViewIndex ] = iCode;
    2725         READ_SVLC( iCode, "cp_off" );                  m_aaiTempOffset[ uiBaseIndex ][ uiViewIndex ] = iCode;
    2726         READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale [ uiViewIndex ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ uiViewIndex ];
    2727         READ_SVLC( iCode, "cp_inv_off_plus_off" );     m_aaiTempOffset[ uiViewIndex ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ uiViewIndex ];
    2728       }
    2729       rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset );
    2730     }
    2731 
    2732     READ_FLAG(uiCode,"slice_segment_header_extension2_flag");
    2733     if ( uiCode )
    2734     {   
    2735       READ_UVLC(uiCode,"slice_header_extension2_length");
    2736       for(Int i=0; i<uiCode; i++)
    2737       {
    2738         UInt ignore;
    2739         READ_CODE(8,ignore,"slice_header_extension2_data_byte");
    2740       }
    2741     }
    2742   }
    2743 #else
     2476
    27442477    for(Int i=0; i<uiCode; i++)
    27452478    {
     
    27482481    }
    27492482  }
    2750 #endif
     2483
    27512484  m_pcBitstream->readByteAlignment();
    27522485
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r758 r773  
    7878#if H_MV
    7979  Void  parseVPSExtension   ( TComVPS* pcVPS );
    80 #if H_MV_6_PS_REP_FORM_18_19_20
    8180  Void  parseRepFormat      ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
    82 #else
    83   Void  parseRepFormat      ( TComRepFormat* pcRepFormat );
    84 #endif
    8581  Void  parseVPSVUI         ( TComVPS* pcVPS );
    86 #if H_MV_6_PS_O0118_33
    8782  Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo );
    88 #endif
    89 #if H_MV_6_HRD_O0217_13
    9083  Void  parseDpbSize        ( TComVPS* pcVPS );
    91 #endif
    92 #if H_MV_6_HRD_O0164_15
    9384  Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS );
    94 #endif
    9585#endif
    9686
     
    10696#endif
    10797
    108 #if H_3D && DLT_DIFF_CODING_IN_PPS
     98#if H_3D
    10999  Void  parsePPS            ( TComPPS* pcPPS, TComVPS* pcVPS );
    110100  Void  parsePPSExtension   ( TComPPS* pcPPS, TComVPS* pcVPS );
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r758 r773  
    135135Void TDecCu::decompressCU( TComDataCU* pcCU )
    136136{
    137 #if !QC_DEPTH_IV_MRG_F0125
     137#if !H_3D_IV_MERGE
    138138  xDecompressCU( pcCU, 0,  0 );
    139139#endif
     
    315315      m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth)  );
    316316      m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );     
    317 #if QC_DEPTH_IV_MRG_F0125
     317#if H_3D_IV_MERGE
    318318      if( pcCU->getSlice()->getIsDepth())
    319319      {
     
    333333        DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo);
    334334      }
    335 #if QC_DEPTH_IV_MRG_F0125
     335#if H_3D_IV_MERGE
    336336      }
    337337#endif
     
    390390    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    391391
    392 #if LGE_SHARP_VSP_INHERIT_F0104
    393392#if H_3D_IC
    394393    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     
    396395#if H_3D_ARP
    397396    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
    398 #endif
    399397#endif
    400398
     
    403401    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    404402    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    405 #if MTK_SPIVMP_F0110
     403#if H_3D_SPIVMP
    406404    Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    407405    memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    411409    puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()];
    412410#endif
    413 #if ETRIKHU_MERGE_REUSE_F0093
    414411    m_ppcCU[uiDepth]->initAvailableFlags();
    415412    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    416413    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
    417 #if MTK_SPIVMP_F0110
     414#if H_3D_SPIVMP
    418415      , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    419416#endif
    420417      , numValidMergeCand, uiMergeIndex );
    421 #else
    422     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex );
    423 #endif
    424418    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    425419#else
    426 #if ETRIKHU_MERGE_REUSE_F0093
     420#if H_3D
    427421    m_ppcCU[uiDepth]->initAvailableFlags();
    428422    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
     
    468462      }
    469463    }
    470 #if MTK_SPIVMP_F0110
     464#if H_3D_SPIVMP
    471465    pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    472466    if (bSPIVMPFlag[uiMergeIndex])
     
    488482      }
    489483    }
    490 #if MTK_F0110_FIX
    491484    delete[] pcMvFieldSP;
    492485    delete[] puhInterDirSP;
    493 #else
    494     delete pcMvFieldSP;
    495     delete puhInterDirSP;
    496 #endif
    497 #endif
    498 #if !LGE_SHARP_VSP_INHERIT_F0104
    499 #if H_3D_IC
    500     m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    501 #endif
    502 #if H_3D_ARP
    503     m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
    504 #endif
    505486#endif
    506487
    507488    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    508 #if QC_DEPTH_IV_MRG_F0125
     489#if H_3D_IV_MERGE
    509490    xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    510491#endif
     
    522503    {
    523504      xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    524 #if QC_DEPTH_IV_MRG_F0125
     505#if H_3D_IV_MERGE
    525506      xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    526507#endif
     
    534515  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
    535516  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
    536 #if !LGE_SHARP_VSP_INHERIT_F0104
    537 #if H_3D_IC
    538   m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    539 #endif
    540 #if H_3D_ARP
    541   m_pcEntropyDecoder->decodeARPW    ( pcCU , uiAbsPartIdx , uiDepth ); 
    542 #endif 
    543 #endif
    544517#if H_3D_INTER_SDC
    545518  m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     
    550523  setdQPFlag( bCodeDQP );
    551524  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    552 #if QC_DEPTH_IV_MRG_F0125
     525#if H_3D_IV_MERGE
    553526  xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    554527#endif
     
    568541{
    569542  TComPic* pcPic = pcCU->getPic();
    570 #if !QC_DEPTH_IV_MRG_F0125 
     543#if !H_3D_IV_MERGE
    571544  Bool bBoundary = false;
    572545  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
     
    780753    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    781754    {
    782 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    783 #if DLT_DIFF_CODING_IN_PPS
     755#if H_3D
    784756      if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    785 #else
    786       if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    787 #endif
    788         {
    789 #if DLT_DIFF_CODING_IN_PPS
    790           pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    791 #else
    792           pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    793 #endif
    794         }
    795         else
    796         {
    797       pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    798         }
     757      {
     758        pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     759      }
     760      else
     761      {
     762        pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     763      }
    799764#else
    800765      pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     
    1008973  {
    1009974#if H_3D_DIM_DLT
    1010 #if DLT_DIFF_CODING_IN_PPS
    1011975    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1012976    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    1013977    Pel   pRecoValue  = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1014 #else
    1015     Pel   pPredIdx    = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1016     Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    1017     Pel   pRecoValue  = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1018 #endif
    1019978
    1020979    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r735 r773  
    111111  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
    112112
    113 #if SEC_ONLY_TEXTURE_IC_F0151
    114113  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
    115 #else
    116   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )
    117 #endif
    118114  {
    119115    return;
     
    213209  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    214210#endif
    215 #if MTK_SPIVMP_F0110
     211#if H_3D_SPIVMP
    216212  Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    217213  TComMvField*  pcMvFieldSP;
     
    245241      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    246242      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    247 #if LGE_SHARP_VSP_INHERIT_F0104
    248243#if H_3D_IC
    249244      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     
    251246#if H_3D_ARP
    252247      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    253 #endif
    254248#endif
    255249      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )
     
    262256          memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    263257          InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    264 #if MTK_SPIVMP_F0110
     258#if H_3D_SPIVMP
    265259          memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    266260#endif
    267 #if ETRIKHU_MERGE_REUSE_F0093
    268261          pcSubCU->initAvailableFlags();
    269262          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    270263          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
    271 #if MTK_SPIVMP_F0110
     264#if H_3D_SPIVMP
    272265            , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    273266#endif
    274267            , numValidMergeCand );
    275 #else
    276           pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
    277 #endif
    278268          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    279269
     
    283273          }
    284274#else
    285 #if ETRIKHU_MERGE_REUSE_F0093
     275#if H_3D
    286276          pcSubCU->initAvailableFlags();
    287277          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
     
    303293        memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    304294        InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    305 #if MTK_SPIVMP_F0110
     295#if H_3D_SPIVMP
    306296        memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    307297#endif
    308 #if ETRIKHU_MERGE_REUSE_F0093
    309298        pcSubCU->initAvailableFlags();
    310299        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    311300        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
    312 #if MTK_SPIVMP_F0110
     301#if H_3D_SPIVMP
    313302          , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    314303#endif
    315304          ,numValidMergeCand, uiMergeIndex );
    316 #else
    317         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex );
    318 #endif
    319305        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    320306        if(vspFlag[uiMergeIndex])
     
    323309        }
    324310#else
    325 #if ETRIKHU_MERGE_REUSE_F0093
     311#if H_3D
    326312        pcSubCU->initAvailableFlags();
    327313        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
     
    345331        }
    346332      }
    347 #if MTK_SPIVMP_F0110
     333#if H_3D_SPIVMP
    348334      pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 
    349335      if (bSPIVMPFlag[uiMergeIndex] != 0)
     
    381367        }
    382368      }
    383 #if LGE_SHARP_VSP_INHERIT_F0104
    384369#if H_3D_IC
    385370      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     
    387372#if H_3D_ARP
    388373      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    389 #endif
    390374#endif
    391375    }
     
    401385    }
    402386  }
    403 #if MTK_SPIVMP_F0110
    404 #if MTK_F0110_FIX
     387#if H_3D_SPIVMP
    405388  delete[] pcMvFieldSP;
    406389  delete[] puhInterDirSP;
    407 #else
    408   delete pcMvFieldSP;
    409   delete puhInterDirSP;
    410 #endif
    411390#endif
    412391  return;
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r758 r773  
    7171  virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
    7272#endif
    73 #if DLT_DIFF_CODING_IN_PPS
     73#if H_3D
    7474  virtual Void  parsePPS                  ( TComPPS* pcPPS, TComVPS* pcVPS )                      = 0;
    7575#else
     
    152152  Void    decodeSPS                   ( TComSPS* pcSPS     )    { m_pcEntropyDecoderIf->parseSPS(pcSPS);                    }
    153153#endif
    154 #if DLT_DIFF_CODING_IN_PPS
     154#if H_3D
    155155  Void    decodePPS                   ( TComPPS* pcPPS, TComVPS* pcVPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS, pcVPS);                    }
    156156#else
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r758 r773  
    8989#if H_3D_DIM_DMM
    9090, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    91 #if !SEC_DMM3_RBC_F0147
    92 , m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    93 #endif
    94 #endif
    95 #if H_3D_DIM_RBC
    96 , m_cRbcDataSCModel           ( 1,             1,               NUM_RBC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9791#endif
    9892#if H_3D_DIM_SDC
     
    178172#if H_3D_DIM_DMM
    179173  m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
    180 #if !SEC_DMM3_RBC_F0147
    181   m_cDmm3DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM3_DATA );
    182 #endif
    183 #endif
    184 #if H_3D_DIM_RBC
    185   m_cRbcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_RBC_DATA );
    186174#endif
    187175#if H_3D_DIM_SDC
     
    253241#if H_3D_DIM_DMM
    254242  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    255 #if !SEC_DMM3_RBC_F0147
    256   m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
    257 #endif
    258 #endif
    259 #if H_3D_DIM_RBC
    260   m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
    261243#endif
    262244#if H_3D_DIM_SDC
     
    414396}
    415397
    416 #if QC_DIM_DELTADC_UNIFY_F0132
    417398Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg )
    418399{
     
    431412  }
    432413}
    433 #else
    434 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt dimType )
    435 {
    436   UInt absValDeltaDC = 0;
    437   xReadExGolombLevel( absValDeltaDC, m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
    438   rValDeltaDC = (Pel)absValDeltaDC;
    439 
    440   if( rValDeltaDC != 0 )
    441   {
    442     UInt uiSign;
    443     m_pcTDecBinIf->decodeBinEP( uiSign );
    444     if ( uiSign )
    445     {
    446       rValDeltaDC = -rValDeltaDC;
    447     }
    448   }
    449 }
    450 #endif
     414
    451415
    452416#if H_3D_DIM_DMM
     
    461425  ruiTabIdx = uiIdx;
    462426}
    463 #if !SEC_DMM3_RBC_F0147
    464 Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit )
    465 {
    466   UInt uiSymbol, uiIdx = 0;
    467   for( Int i = 0; i < iNumBit; i++ )
    468   {
    469     m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm3DataSCModel.get(0, 0, 0) );
    470     uiIdx += uiSymbol << i;
    471   }
    472   ruiIntraIdx = uiIdx;
    473 }
    474 #endif
    475 #endif
    476 #if H_3D_DIM_RBC
    477 Void TDecSbac::xParseRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    478 {
    479   UInt uiSymbol = 0;
    480 
    481   // 1. Top(0) or Left(1)
    482   UChar ucLeft;
    483   m_pcTDecBinIf->decodeBinEP( uiSymbol );
    484   ucLeft = uiSymbol;
    485 
    486   // 2. Start position (lowest bit first)
    487   UChar ucStart = 0;
    488   for( UInt ui = 0; ui < 6 - uiDepth; ui++ )
    489   {
    490     m_pcTDecBinIf->decodeBinEP( uiSymbol );
    491     ucStart |= (uiSymbol << ui);
    492   }
    493 
    494   // 3. Number of edges
    495   UChar ucMax = 0;
    496   for( UInt ui = 0; ui < 7 - uiDepth; ui++ )
    497   {
    498     m_pcTDecBinIf->decodeBinEP( uiSymbol );
    499     ucMax |= (uiSymbol << ui);
    500   }
    501   ucMax++; // +1
    502 
    503   // 4. Edges
    504   UChar* pucSymbolList = (UChar*) xMalloc( UChar, 256 * RBC_MAX_EDGE_NUM_PER_4x4 );
    505   for( Int iPtr = 0; iPtr < ucMax; iPtr++ )
    506   {
    507     UChar ucEdge = 0;
    508     UInt  uiReorderEdge = 0;
    509     for( UInt ui = 0; ui < 6; ui++ )
    510     {
    511       m_pcTDecBinIf->decodeBin( uiSymbol, m_cRbcDataSCModel.get( 0, 0, 0 ) );
    512       ucEdge <<= 1;
    513       ucEdge |= uiSymbol;
    514       if( uiSymbol == 0 )
    515         break;
    516     }
    517 
    518     switch( ucEdge )
    519     {
    520     case 0 :  // "0"       
    521       uiReorderEdge = 0;
    522       break;
    523     case 2 :  // "10"
    524       uiReorderEdge = 1;
    525       break;
    526     case 6 :  // "110"
    527       uiReorderEdge = 2;
    528       break;
    529     case 14 : // "1110"
    530       uiReorderEdge = 3;
    531       break;
    532     case 30 : // "11110"
    533       uiReorderEdge = 4;
    534       break;
    535     case 62 : // "111110"
    536       uiReorderEdge = 5;
    537       break;
    538     case 63 : // "111111"
    539       uiReorderEdge = 6;
    540       break;
    541     default :
    542       printf("parseIntraEdgeChain: error (unknown code %d)\n",ucEdge);
    543       assert(false);
    544       break;
    545     }
    546     pucSymbolList[iPtr] = uiReorderEdge;
    547   }
    548   /////////////////////
    549   // Edge Reconstruction
    550   Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx );
    551   pcCU->reconPartition( uiAbsPartIdx, uiDepth, ucLeft == 1, ucStart, ucMax, pucSymbolList, pbRegion );
    552   xFree( pucSymbolList );
    553 }
    554 #endif
     427#endif
     428
    555429#if H_3D_DIM_SDC
    556430Void TDecSbac::xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
     
    568442 
    569443#if H_3D_DIM_DLT
    570 #if DLT_DIFF_CODING_IN_PPS
    571444  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    572 #else
    573   UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    574 #endif
    575445#else
    576446  UInt uiMaxResidualBits = g_bitDepthY;
     
    596466    UInt uiCount = 0;
    597467#if H_3D_DIM_DLT
    598 #if DLT_DIFF_CODING_IN_PPS
    599468    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    600 #else
    601     UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    602 #endif
    603469#else
    604470    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
     
    11751041      pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth );
    11761042    } break;
    1177 #if !SEC_DMM3_RBC_F0147
    1178   case( DMM3_IDX ):
    1179     {
    1180       UInt uiIntraIdx = 0;
    1181       xParseDmm3WedgeIdx( uiIntraIdx, g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    1182       pcCU->setDmm3IntraTabIdxSubParts( uiIntraIdx, absPartIdx, depth );
    1183     } break;
    1184 #endif
    11851043  case( DMM4_IDX ): break;
    11861044#endif
    1187 #if H_3D_DIM_RBC
    1188   case( RBC_IDX ):
    1189     {
    1190       xParseRbcEdge( pcCU, absPartIdx, depth );
    1191     } break;
    1192 #endif
    11931045  default: break;
    11941046  }
    11951047
    1196 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    1197   if( pcCU->getSDCFlag(absPartIdx) )
    1198   {
    1199     assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
    1200     pcCU->setTrIdxSubParts(0, absPartIdx, depth);
    1201     pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
    1202 
    1203     UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2;
    1204     for (UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
    1205     {
    1206       xParseSDCResidualData(pcCU, absPartIdx, depth, uiSeg);
    1207     }
    1208   }
    1209   else
    1210   {
    1211 #endif
    1212 #if QC_DIM_DELTADC_UNIFY_F0132
    1213     if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
    1214 #else
    1215     if( dimType < DIM_NUM_TYPE )
    1216 #endif
    1217     {
    1218       UInt symbol;
    1219 #if QC_DIM_DELTADC_UNIFY_F0132
    1220       UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1048  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
     1049  {
     1050    UInt symbol;
     1051    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1052
     1053    if( pcCU->getSDCFlag( absPartIdx ) )
     1054    {
     1055      assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
     1056      pcCU->setTrIdxSubParts(0, absPartIdx, depth);
     1057      pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
     1058    }
     1059
     1060    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
     1061
     1062    if( symbol )
     1063    {
     1064      if( !pcCU->getSDCFlag( absPartIdx ) )
     1065      {
     1066        dir += symbol;
     1067      }
     1068    }
     1069    for( UInt segment = 0; segment < uiNumSegments; segment++ )
     1070    {
     1071      Pel valDeltaDC = 0;
     1072      if( symbol )
     1073      {
     1074        xParseDimDeltaDC( valDeltaDC, uiNumSegments );
     1075      }
    12211076
    12221077      if( pcCU->getSDCFlag( absPartIdx ) )
    12231078      {
    1224         assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
    1225         pcCU->setTrIdxSubParts(0, absPartIdx, depth);
    1226         pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
    1227       }
    1228 
    1229       m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
    1230 
    1231       if( symbol )
    1232       {
    1233         if( !pcCU->getSDCFlag( absPartIdx ) )
    1234         {
    1235           dir += symbol;
    1236         }
    1237       }
    1238       for( UInt segment = 0; segment < uiNumSegments; segment++ )
    1239       {
    1240         Pel valDeltaDC = 0;
    1241         if( symbol )
    1242         {
    1243           xParseDimDeltaDC( valDeltaDC, uiNumSegments );
    1244         }
    1245 
    1246         if( pcCU->getSDCFlag( absPartIdx ) )
    1247         {
    1248           pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
    1249         }
    1250         else
    1251         {
    1252           pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
    1253         }
    1254       }
    1255 #else
    1256       m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
    1257       if( symbol )
    1258       {
    1259         dir += symbol;
    1260         for( UInt segment = 0; segment < 2; segment++ )
    1261         {
    1262           Pel valDeltaDC = 0;
    1263           xParseDimDeltaDC( valDeltaDC, dimType );
    1264           pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
    1265         }
    1266       }
    1267 #endif
    1268     }
    1269 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    1270   }
    1271 #endif
     1079        pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
     1080      }
     1081      else
     1082      {
     1083        pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
     1084      }
     1085    }
     1086  }
    12721087
    12731088  pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
     
    12971112  else if( puIdx == 0 )
    12981113  {
    1299 #if SEC_DMM3_RBC_F0147
    13001114    while( binNum < 1 && symbol )
    1301 #else
    1302     while( binNum < 3 && symbol )
    1303 #endif
    13041115    {
    13051116      ctxDepthMode = puIdx*3 + ((binNum >= 2) ? 2 : binNum);
     
    13081119      binNum++;
    13091120    }
    1310 #if SEC_DMM3_RBC_F0147
    1311     if( modeCode == 0 ) { dir = 0;                       sdcFlag = 0;}
    1312     else if( modeCode == 1 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
    1313 #else
    1314          if( modeCode == 0 ) { dir = 0;                       sdcFlag = 0;}
    1315     else if( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
    1316     else if( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
    1317     else if( modeCode == 7 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1318 #endif
     1121    if( modeCode == 0 )
     1122    {
     1123      dir = 0;
     1124      sdcFlag = 0;
     1125    }
     1126    else if ( modeCode == 1 )
     1127    {
     1128      dir = (2*DMM1_IDX+DIM_OFFSET);
     1129      sdcFlag = 0;
     1130    }
    13191131  }
    13201132  else
    13211133  {
    1322 #if SEC_DMM3_RBC_F0147
    13231134    while( binNum < 4 && symbol )
    13241135    {
     
    13331144    else if ( modeCode == 14 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
    13341145    else if ( modeCode == 15 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
    1335 #else
    1336     UInt maxBinNum = 0;
    1337     m_pcTDecBinIf->decodeBinEP(symbol);
    1338     if( symbol == 1 )
    1339     {
    1340       maxBinNum = 3;
    1341     }
    1342     else
    1343     {
    1344       maxBinNum = 2;
    1345       symbol = 1;
    1346     }
    1347     while( binNum<maxBinNum && symbol )
    1348     {
    1349       ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum );
    1350       m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode));
    1351       modeCode = (modeCode<<1)+symbol;
    1352       binNum++;
    1353     }
    1354     if( maxBinNum == 3 )
    1355     {
    1356       if ( modeCode == 0 )       { dir =  PLANAR_IDX;             sdcFlag = 1;}
    1357       else if ( modeCode == 2 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1358       else if ( modeCode == 6 )  { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
    1359       else if ( modeCode == 7 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
    1360     }
    1361     else
    1362     {
    1363       if ( modeCode == 0 )       { dir = 5;                       sdcFlag = 0;}
    1364       else if ( modeCode == 2 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
    1365       else if ( modeCode == 3 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
    1366     }
    1367 #endif
     1146
    13681147  }
    13691148  pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r758 r773  
    8181  Void  parseSPS                  ( TComSPS* /*pcSPS*/ ) {}
    8282#endif
    83 #if DLT_DIFF_CODING_IN_PPS
     83#if H_3D
    8484  Void  parsePPS                  ( TComPPS* /*pcPPS*/, TComVPS* /*pcVPS*/ ) {}
    8585#else
     
    103103#if H_3D_DIM
    104104  Void  xReadExGolombLevel   ( UInt& ruiSymbol, ContextModel& rcSCModel  );
    105 #if QC_DIM_DELTADC_UNIFY_F0132
    106105  Void  xParseDimDeltaDC     ( Pel& rValDeltaDC, UInt uiNumSeg );
    107 #else
    108   Void  xParseDimDeltaDC     ( Pel& rValDeltaDC, UInt dimType );
    109 #endif
    110106#if H_3D_DIM_DMM
    111107  Void  xParseDmm1WedgeIdx   ( UInt& ruiTabIdx, Int iNumBit );
    112 #if !SEC_DMM3_RBC_F0147
    113   Void  xParseDmm3WedgeIdx   ( UInt& ruiIntraIdx, Int iNumBit );
    114 #endif
    115 #endif
    116 #if H_3D_DIM_RBC
    117   Void  xParseRbcEdge        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    118108#endif
    119109#if H_3D_DIM_SDC
     
    223213#if H_3D_DIM_DMM
    224214  ContextModel3DBuffer m_cDmm1DataSCModel;
    225 #if !SEC_DMM3_RBC_F0147
    226   ContextModel3DBuffer m_cDmm3DataSCModel;
    227 #endif
    228 #endif
    229 #if H_3D_DIM_RBC
    230   ContextModel3DBuffer m_cRbcDataSCModel;
    231215#endif
    232216#if H_3D_DIM_SDC 
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r758 r773  
    228228    m_uiMaxViewIndex                     = std::max( m_uiMaxViewIndex, uiViewIndex );
    229229    m_aiViewId[ uiViewIndex ]            = pcSlice->getViewId();
    230 #if CAM_HLS_F0136_F0045_F0082
     230
    231231    if( uiViewIndex == 1 )
    232232    {
     
    239239      AOF( m_bCamParsVaryOverTime    == pcSlice->getVPS()->hasCamParInSliceHeader ( uiViewIndex ) );
    240240    }
    241 #else
    242     if( uiViewIndex == 1 )
    243     {
    244       m_uiCamParsCodedPrecision       = pcSlice->getSPS()->getCamParPrecision     ();
    245       m_bCamParsVaryOverTime          = pcSlice->getSPS()->hasCamParInSliceHeader ();
    246     }
    247     else if( uiViewIndex > 1 )
    248     {
    249       AOF( m_uiCamParsCodedPrecision == pcSlice->getSPS()->getCamParPrecision     () );
    250       AOF( m_bCamParsVaryOverTime    == pcSlice->getSPS()->hasCamParInSliceHeader () );
    251     }
    252 #endif
     241
    253242    for( UInt uiBaseIndex = 0; uiBaseIndex < uiViewIndex; uiBaseIndex++ )
    254243    {
     
    264253      else
    265254      {
    266 #if CAM_HLS_F0136_F0045_F0082
    267255        m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getVPS()->getCodedScale    (uiViewIndex) [ uiBaseIndex ];
    268256        m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getVPS()->getCodedOffset   (uiViewIndex) [ uiBaseIndex ];
    269257        m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getVPS()->getInvCodedScale (uiViewIndex) [ uiBaseIndex ];
    270258        m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getVPS()->getInvCodedOffset(uiViewIndex) [ uiBaseIndex ];
    271 #else
    272         m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getSPS()->getCodedScale    () [ uiBaseIndex ];
    273         m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getSPS()->getCodedOffset   () [ uiBaseIndex ];
    274         m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getSPS()->getInvCodedScale () [ uiBaseIndex ];
    275         m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseIndex ];
    276 #endif
    277259        xInitLUTs( uiBaseIndex, uiViewIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
    278260        xInitLUTs( uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     
    302284}
    303285
    304 #if QC_DEPTH_IV_MRG_F0125
     286#if H_3D_IV_MERGE
    305287Void
    306288CamParsCollector::copyCamParamForSlice( TComSlice* pcSlice )
    307289{
    308 #if !CAM_HLS_F0136_F0045_F0082
    309   UInt uiViewIndex = pcSlice->getViewIndex();
    310 
    311   pcSlice->getSPS()->initCamParaSPS( uiViewIndex, m_uiCamParsCodedPrecision, m_bCamParsVaryOverTime, m_aaiCodedScale, m_aaiCodedOffset );
    312 #endif
    313290  if( m_bCamParsVaryOverTime )
    314291  {
     
    656633#if H_MV
    657634  m_apcSlicePilot->setVPS(vps); 
    658 #if H_MV_6_PS_0092_17
    659635  // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
    660636  assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) );   
    661637  // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
    662638  assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) );
    663 #endif
    664639  sps->inferRepFormat  ( vps , m_layerId );
    665640  sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) );
     
    692667
    693668#if H_MV
    694 #if H_MV_FIX_SKIP_PICTURES
    695669Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag  )
    696 #else
    697 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag )
    698 #endif
    699670{
    700671  assert( nalu.m_layerId == m_layerId );
     
    754725#endif
    755726
    756 #if H_MV_LAYER_WISE_STARTUP
     727#if H_MV
    757728    xCeckNoClrasOutput();
    758729#endif
     
    762733    m_prevSliceSkipped = true;
    763734    m_skippedPOC = m_apcSlicePilot->getPOC();
    764 #if H_MV_FIX_SKIP_PICTURES
    765       sliceSkippedFlag = true;
     735#if H_MV
     736    sliceSkippedFlag = true;
    766737#endif
    767738      return false;
     
    772743    m_prevSliceSkipped = true;
    773744    m_skippedPOC = m_apcSlicePilot->getPOC();
    774 #if H_MV_FIX_SKIP_PICTURES
    775       sliceSkippedFlag = true;
     745#if H_MV
     746    sliceSkippedFlag = true;
    776747#endif
    777748      return false;
     
    1007978    pcSlice->setRefPicList     ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
    1008979#if H_3D_ARP
    1009 #if SHARP_ARP_REF_CHECK_F0105
    1010980    pcSlice->setARPStepNum(m_ivPicLists);
    1011 #else
    1012     pcSlice->setARPStepNum();
    1013 #endif
    1014981    if( pcSlice->getARPStepNum() > 1 )
    1015982    {
     
    11131080  }
    11141081
    1115 #if QC_DEPTH_IV_MRG_F0125
     1082#if H_3D_IV_MERGE
    11161083  if( pcSlice->getIsDepth() && m_pcCamParsCollector )
    11171084  {
     
    11271094    m_pcCamParsCollector->setSlice( pcSlice );
    11281095  }
    1129 #if QC_DEPTH_IV_MRG_F0125
    1130   if( pcSlice->getIsDepth() )
    1131   {
    1132 #if !CAM_HLS_F0136_F0045_F0082
    1133     pcSlice->getSPS()->setHasCamParInSliceHeader( false );
    1134 #endif
    1135   }
    1136 #endif
    11371096#endif
    11381097  m_bFirstSliceInPicture = false;
     
    11741133  pps->setLayerId( getLayerId() );
    11751134#endif
    1176 #if DLT_DIFF_CODING_IN_PPS
     1135#if H_3D
    11771136  // Assuming that all PPS indirectly refer to the same VPS via different SPS
    11781137  // There is no parsing dependency in decoding DLT in PPS.
     
    11811140  //   Step 1) decoding DLT tables based on the number of depth layers, and
    11821141  //   Step 2) mapping DLT tables to the depth layers
    1183   // as descripted in the 3D-HEVC WD.
     1142  // as described in the 3D-HEVC WD.
    11841143  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    11851144  m_cEntropyDecoder.decodePPS( pps, vps );
     
    12261185
    12271186#if H_MV
    1228 #if H_MV_FIX_SKIP_PICTURES
    12291187Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag )
    1230 #else
    1231 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag)
    1232 #endif
    12331188#else
    12341189Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay)
     
    12751230    case NAL_UNIT_CODED_SLICE_RASL_R:
    12761231#if H_MV
    1277 #if H_MV_FIX_SKIP_PICTURES
    12781232      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
    1279 #else
    1280       return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag);
    1281 #endif
    12821233#else
    12831234      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
     
    13281279    return true;
    13291280  }
    1330 #if H_MV_LAYER_WISE_STARTUP
     1281#if H_MV
    13311282  else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet.
    13321283#else
     
    13401291    {
    13411292
    1342 #if H_MV_LAYER_WISE_STARTUP
     1293#if H_MV
    13431294      if ( xAllRefLayersInitilized() )
    13441295      {
     
    13571308    else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
    13581309    {
    1359 #if H_MV_LAYER_WISE_STARTUP
     1310#if H_MV
    13601311      if ( xAllRefLayersInitilized() )
    13611312      {
    13621313        m_layerInitilizedFlag[ m_layerId ] = true;
     1314        m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
     1315      }
     1316      else
     1317      {
     1318        return true;
     1319      }
     1320#else
    13631321      m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
     1322#endif
    13641323    }
    13651324    else
    13661325    {
    1367         return true;
    1368       }
    1369 #else
    1370       m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
    1371 #endif
    1372     }
    1373     else
    1374     {
    1375 #if H_MV_FIX_SKIP_PICTURES
     1326#if H_MV
    13761327      static Bool warningMessage[MAX_NUM_LAYERS];
    13771328      static Bool warningInitFlag = false;
     
    14081359    return true;
    14091360  }
    1410 #if H_MV_LAYER_WISE_STARTUP
     1361#if H_MV
    14111362  return !m_layerInitilizedFlag[ getLayerId() ];
    14121363#else
     
    14551406}
    14561407
    1457 #if H_MV_LAYER_WISE_STARTUP
     1408#if H_MV
    14581409Void TDecTop::xCeckNoClrasOutput()
    14591410{
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r738 r773  
    7878  Int**** getBaseViewShiftLUTI()  { return m_aiBaseViewShiftLUT;   }
    7979
    80 #if QC_DEPTH_IV_MRG_F0125
     80#if H_3D_IV_MERGE
    8181  Void  copyCamParamForSlice( TComSlice* pcSlice );
    8282#endif
     
    186186  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
    187187#if H_MV
    188 #if H_MV_LAYER_WISE_STARTUP
    189188  Bool*                    m_layerInitilizedFlag; // initialization Layers
    190 #endif
    191189  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
    192190#else
     
    246244  Void  init();
    247245#if H_MV 
    248 #if H_MV_FIX_SKIP_PICTURES
    249246  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag );
    250 #else
    251   Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
    252 #endif
    253247  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
    254248#else 
     
    268262  TComList<TComPic*>*     getListPic            ()               { return &m_cListPic;  } 
    269263  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    270 #if H_MV_LAYER_WISE_STARTUP
    271264  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
    272 #endif
    273 #if H_MV_6_HRD_O0217_13
    274265  TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
    275 #endif
    276266  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
    277267  Void                    setLayerId            ( Int layer)     { m_layerId = layer;   }
     
    294284#if H_MV 
    295285  TComPic*  xGetPic( Int layerId, Int poc );
    296 #if H_MV_FIX_SKIP_PICTURES
    297286  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 
    298 #else
    299   Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 
    300 #endif
    301287  Void      xResetPocInPicBuffer();
    302 #if H_MV_LAYER_WISE_STARTUP
    303288  Void      xCeckNoClrasOutput();
    304289
    305290  Bool      xAllRefLayersInitilized();
    306 #endif
    307291#else
    308292  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r758 r773  
    176176  WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" );
    177177  WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0,   "cabac_init_present_flag" );
     178#if PPS_FIX_DEPTH
     179  if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
     180  {
     181    WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive(),     "num_ref_idx_l0_default_active_minus1");
     182    WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive(),     "num_ref_idx_l1_default_active_minus1");
     183  }
     184  else
     185  {
     186#endif
    178187  WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive()-1,     "num_ref_idx_l0_default_active_minus1");
    179188  WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive()-1,     "num_ref_idx_l1_default_active_minus1");
    180 
     189#if PPS_FIX_DEPTH
     190  }
     191#endif
    181192  WRITE_SVLC( pcPPS->getPicInitQPMinus26(),                  "init_qp_minus26");
    182193  WRITE_FLAG( pcPPS->getConstrainedIntraPred() ? 1 : 0,      "constrained_intra_pred_flag" );
     
    253264  }
    254265#endif
     266#if PPS_FIX_DEPTH
     267  if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
     268  {
     269    WRITE_FLAG( 1, "lists_modification_present_flag" );
     270  }
     271  else
     272#endif
    255273  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
    256274  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
     275#if PPS_FIX_DEPTH
     276  if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
     277  {
     278    WRITE_FLAG( 1, "slice_segment_header_extension_present_flag" );
     279  }
     280  else
     281#endif
    257282  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
    258283
    259 #if !DLT_DIFF_CODING_IN_PPS
     284#if !H_3D
    260285  WRITE_FLAG( 0, "pps_extension_flag" );
    261286#else
     
    266291}
    267292
    268 #if DLT_DIFF_CODING_IN_PPS
     293#if H_3D
    269294Void  TEncCavlc::codePPSExtension        ( TComPPS* pcPPS )
    270295{
     
    275300  //   Step 1) decoding DLT tables based on the number of depth layers, and
    276301  //   Step 2) mapping DLT tables to the depth layers
    277   // as descripted in the 3D-HEVC WD.
     302  // as described in the 3D-HEVC WD.
    278303  TComVPS* pcVPS = pcPPS->getSPS()->getVPS();
    279304
     
    470495  }
    471496  WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(),            "video_signal_type_present_flag");
    472 #if H_MV_6_PS_O0118_33
     497#if H_MV
    473498  assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() );
    474499#endif
     
    636661  {
    637662    WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" );
    638 #if H_MV_6_PS_REP_FORM_18_19_20   
    639663    if ( pcSPS->getUpdateRepFormatFlag() )
    640664    {
     
    644668  else
    645669  {
    646 #else
    647   }
    648 
    649   if ( pcSPS->getUpdateRepFormatFlag() )
    650   {
    651 #endif
    652670#endif
    653671  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
     
    675693  }
    676694#if H_MV
    677 #if H_MV_6_PS_REP_FORM_18_19_20
    678695  if ( pcSPS->getLayerId() == 0 )
    679 #else
    680   if ( pcSPS->getUpdateRepFormatFlag() )
    681 #endif
    682696  {
    683697#endif
     
    784798  WRITE_FLAG( 0, "sps_extension_flag" );
    785799#else
    786 #if H_MV_6_PSEM_O0142_3
    787800  WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" );
    788801
     
    811824#endif
    812825  }
    813 #else
    814   WRITE_FLAG( 1, "sps_extension_flag" );
    815   codeSPSExtension( pcSPS );
    816 #if !H_3D
    817   WRITE_FLAG( 0, "sps_extension2_flag" );
    818 #else
    819   WRITE_FLAG( 1, "sps_extension2_flag" );
    820   codeSPSExtension2( pcSPS, viewIndex, depthFlag );
    821   WRITE_FLAG( 0, "sps_extension3_flag" );
    822 #endif 
    823 #endif
    824826#endif
    825827}
     
    830832  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
    831833
    832 #if !H_MV_6_SHVC_O0098_36
    833   WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );
    834 #else
    835834  WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" );
    836835
     
    846845    WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" );
    847846  }
    848 #endif 
    849847}
    850848#endif
     
    859857  WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag");
    860858  WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
    861 }
    862 #endif
    863 #if !CAM_HLS_F0136_F0045_F0082
    864 if (!depthFlag )
    865 {
    866   WRITE_UVLC( pcSPS->getCamParPrecision(), "cp_precision" );
    867   WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "cp_in_slice_header_flag" );
    868   if( !pcSPS->hasCamParInSliceHeader() )
    869   {
    870     for( UInt uiIndex = 0; uiIndex < viewIndex; uiIndex++ )
    871     {
    872       WRITE_SVLC( pcSPS->getCodedScale    ()[ uiIndex ],                                      "cp_scale" );
    873       WRITE_SVLC( pcSPS->getCodedOffset   ()[ uiIndex ],                                      "cp_off" );
    874       WRITE_SVLC( pcSPS->getInvCodedScale ()[ uiIndex ] + pcSPS->getCodedScale ()[ uiIndex ], "cp_inv_scale_plus_scale" );
    875       WRITE_SVLC( pcSPS->getInvCodedOffset()[ uiIndex ] + pcSPS->getCodedOffset()[ uiIndex ], "cp_inv_off_plus_off" );
    876     }
    877   }
    878859}
    879860#endif
     
    995976{
    996977  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
    997 #if H_MV_6_PS_O0109_24
    998978  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
    999979  if ( pcVPS->getVpsVuiPresentFlag() )
    1000980  { 
    1001 #endif
    1002981  WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16,                 "vps_vui_offset" );  // TBD
    1003 #if H_MV_6_PS_O0109_24
    1004   }
    1005 #endif
     982  }
    1006983  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    1007984 
     
    10501027
    10511028
    1052 #if H_MV_6_PS_O0109_22
    10531029    WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
    10541030   
     
    10671043      }
    10681044    }
    1069 #else
    1070   // GT spec says: trac #39
    1071   // if ( pcVPS->getNumViews() > 1 ) 
    1072   //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    1073   {
    1074     WRITE_CODE( pcVPS->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
    1075   }
    1076 
    1077   for( Int i = 0; i < pcVPS->getNumViews(); i++ )
    1078   {
    1079     WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
    1080   }
    1081 #endif
    10821045
    10831046
     
    10891052    }
    10901053  }
    1091 #if H_MV_6_ILDSD_O0120_26
    10921054  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
    10931055  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    11061068    }
    11071069  }
    1108 #endif
    11091070  WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" );
    11101071
     
    11131074    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
    11141075    {
    1115 #if H_MV_6_ILDDS_O0225_30
    11161076      for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ )
    11171077      {
     
    11211081        }
    11221082      }
    1123 #else
    1124       WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
    1125 #endif
    11261083    }
    11271084  }
     
    11371094    {   
    11381095      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
    1139 #if H_MV_6_PS_O0109_23
    11401096      pcVPS->checkProfileRefMinus1( i );     
    1141 #endif
    11421097    }
    11431098    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     
    11561111  if( numOutputLayerSets > 1)
    11571112  {
    1158 #if H_MV_6_PS_0109_25
    11591113    WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" );
    11601114    pcVPS->checkDefaultOneTargetOutputLayerIdc();
    1161 #else
    1162     WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
    1163 #endif       
    11641115  } 
    11651116
    1166 #if H_MV_6_HRD_O0217_13
    11671117  assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 ));
    11681118  assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 );
    1169 #endif
    11701119  for( Int i = 1; i < numOutputLayerSets; i++ )
    11711120  {
     
    11781127      }     
    11791128    }
    1180 #if H_MV_6_HRD_O0217_13
    11811129    else
    11821130    { // These inference rules would also be helpful in spec text
     
    11871135      }
    11881136    }
    1189 #endif
    11901137
    11911138    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     
    11951142  }
    11961143
    1197 #if H_MV_6_GEN_0153_28
    11981144  if( pcVPS->getMaxLayersMinus1() > 0 )
    11991145  {
    12001146    WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" );
    12011147  }
    1202 #endif
    12031148
    12041149  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
     
    12101155  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    12111156  {   
    1212 #if H_MV_6_PS_REP_FORM_18_19_20
    12131157    TComRepFormat* curRepFormat = pcVPS->getRepFormat(i);     
    12141158    TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL;
    12151159    codeRepFormat( i, curRepFormat ,  prevRepFormat);
    1216 #else
    1217     TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i);     
    1218     codeRepFormat( pcRepFormat );
    1219 #endif
    12201160  }
    12211161
     
    12261166      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    12271167      {
    1228 #if H_MV_6_PS_REP_FORM_18_19_20
    12291168        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" );
    1230 #else
    1231         WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" );
    1232 #endif
    12331169      }
    12341170    }
     
    12361172
    12371173  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
    1238 #if H_MV_6_MISC_O0062_31
    12391174  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    12401175  {
     
    12441179    }
    12451180  }
    1246 #endif
    1247 #if H_MV_6_HRD_O0217_13
    12481181  codeDpbSize( pcVPS );
    1249 #endif
    1250 
    1251 #if !H_MV_6_PS_O0223_29
    1252   WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
    1253 #endif
     1182
    12541183  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
    12551184
    1256 #if H_MV_6_PS_O0096_21
    12571185  WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" );
    12581186
     
    12801208    }
    12811209  } 
    1282 #else
    1283     for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    1284     {
    1285       for( Int j = 0; j < i; j++ )
    1286       {
    1287         if (pcVPS->getDirectDependencyFlag( i, j) )
    1288         {       
    1289           assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );
    1290           WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
    1291         }
    1292       }
    1293     }
    1294 #endif
    12951210    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" );
    1296 #if !H_MV_6_PS_O0109_24
    1297     WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" );
    1298 #endif
    12991211
    13001212    if( pcVPS->getVpsVuiPresentFlag() )
     
    13041216    }     
    13051217}
    1306 #if H_MV_6_PS_O0118_33
    13071218Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
    13081219{
     
    13141225  WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" );
    13151226}
    1316 #endif
    1317 
    1318 #if H_MV_6_HRD_O0217_13
     1227
    13191228Void TEncCavlc::codeDpbSize( TComVPS* vps )
    13201229{
     
    13561265  } 
    13571266}
    1358 #endif
    1359 
    1360 #if H_MV_6_PS_REP_FORM_18_19_20
     1267
    13611268Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat )
    1362 #else
    1363 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat )
    1364 #endif
    13651269{
    13661270  assert( pcRepFormat );
    13671271
    1368 #if H_MV_6_PS_REP_FORM_18_19_20
    13691272  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
    13701273  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     
    13751278  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
    13761279  { 
    1377 #endif
    13781280  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
    13791281
     
    13821284    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
    13831285  }
    1384 #if !H_MV_6_PS_REP_FORM_18_19_20
    1385   WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
    1386   WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
    1387 #endif
    13881286  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
    13891287  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
    1390 #if H_MV_6_PS_REP_FORM_18_19_20
    13911288  }
    13921289  else
     
    13941291    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true );
    13951292  }
    1396 #endif
    13971293}
    13981294
     
    14051301  assert( pcVPSVUI );
    14061302
    1407 #if H_MV_6_PS_O0223_29
    14081303  WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" );
    14091304  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     
    14111306    WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
    14121307  }
    1413 #endif
    14141308
    14151309  WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
     
    14431337  }
    14441338
    1445 #if H_MV_6_O0226_37
    14461339  WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
    14471340  if( !pcVPSVUI->getTilesNotInUseFlag() )
     
    14781371    }
    14791372  }
    1480 #else
    1481   for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1482   {
    1483     for( Int  j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    1484     {
    1485       WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
    1486     }
    1487   }
    1488 #endif
    14891373  WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
    14901374
     
    15071391    }
    15081392  }
    1509 #if H_MV_6_PS_O0118_33
    15101393  WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
    15111394  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     
    15401423    }
    15411424  }
    1542 #endif
    1543 #if H_MV_6_HRD_O0164_15
    15441425  WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" );
    15451426  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     
    15471428    codeVpsVuiBspHrdParameters( pcVPS );
    15481429  }
    1549 #endif
    1550 }
    1551 #if H_MV_6_HRD_O0164_15
     1430}
    15521431Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS )
    15531432{
     
    16061485  } 
    16071486
    1608 #endif
    16091487
    16101488#endif
     
    16211499#if H_3D_IV_MERGE
    16221500        WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
    1623 #if MTK_SPIVMP_F0110
     1501#if H_3D_SPIVMP
    16241502        WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]");
    16251503#endif
     
    16371515      else
    16381516      {
    1639 #if QC_DEPTH_IV_MRG_F0125
    16401517        if(i!=1)
    16411518        {
    16421519          WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
    16431520        }
    1644 #endif
    1645 #if MTK_SPIVMP_F0110
     1521#if H_3D_SPIVMP
    16461522        if (i!=1)
    16471523        {
     
    16491525        }
    16501526#endif
    1651 #if SEC_MPI_ENABLING_MERGE_F0150
     1527#if H_3D_IV_MERGE
    16521528        WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 ,          "mpi_flag[i]" );
    16531529#endif
    16541530        WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
    16551531        //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     );
    1656 #if H_3D_DIM_DLT
    1657 #if !DLT_DIFF_CODING_IN_PPS
    1658         if( pcVPS->getVpsDepthModesFlag( i ) )
    1659         {
    1660           WRITE_FLAG( pcVPS->getUseDLTFlag( i ) ? 1 : 0, "dlt_flag[i]" );
    1661         }
    1662         if( pcVPS->getUseDLTFlag( i ) )
    1663         {
    1664           // code mapping
    1665           WRITE_UVLC(pcVPS->getNumDepthValues(i), "num_depth_values_in_dlt[i]");
    1666           for(Int d=0; d<pcVPS->getNumDepthValues(i); d++)
    1667           {
    1668             WRITE_UVLC( pcVPS->idx2DepthValue(i, d), "dlt_depth_value[i][d]" );
    1669           }
    1670         }
    1671 #endif
    1672 #endif
    16731532#if H_3D_INTER_SDC
    16741533        WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );
     
    16771536    } 
    16781537  }
    1679 #if CAM_HLS_F0136_F0045_F0082
    16801538  WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
    16811539  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
     
    16971555    }
    16981556  }
    1699 #endif
    17001557#if H_3D_TMVP
    17011558  WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
     
    17391596    WRITE_FLAG( 0, "no_output_of_prior_pics_flag" );
    17401597  }
     1598#if PPS_FIX_DEPTH
     1599  if( pcSlice->getIsDepth() )
     1600  {
     1601    WRITE_UVLC( 1, "slice_pic_parameter_set_id" );
     1602  }
     1603  else
     1604#endif
    17411605  WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" );
    17421606  pcSlice->setDependentSliceSegmentFlag(!pcSlice->isNextSlice());
     
    17531617#if H_MV   
    17541618    Int esb = 0;  //Don't use i, otherwise will shadow something below
    1755 #if !H_MV_6_RALS_O0149_11
     1619
     1620    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1621    {
     1622      esb++;
     1623      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
     1624    }
     1625
     1626    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1627    {
     1628      esb++;
     1629      WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" );
     1630    }
     1631    pcSlice->checkCrossLayerBlaFlag( );
     1632
    17561633    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    17571634    {
     
    17591636      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
    17601637    }
    1761 #endif
    1762 
    1763     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    1764     {
    1765       esb++;
    1766       WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
    1767     }
    1768 
    1769 #if H_MV_6_RALS_O0149_11
    1770     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    1771     {
    1772       esb++;
    1773       WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" );
    1774     }
    1775     pcSlice->checkCrossLayerBlaFlag( );
    1776 
    1777     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    1778     {
    1779       esb++;
    1780       WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
    1781     }
    1782 #endif
    17831638
    17841639
     
    18041659    // if( separate_colour_plane_flag  ==  1 )
    18051660    //   colour_plane_id                                      u(2)
    1806 
    1807 #if H_MV_6_POC_31_35_38
     1661#if H_MV
    18081662    if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() )
    18091663    {
     
    18141668    if( !pcSlice->getIdrPicFlag() )
    18151669    {
    1816 #if !H_MV_6_POC_31_35_38
     1670#if !H_MV
    18171671      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    18181672      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
     
    19311785    }
    19321786#if H_MV
    1933 #if H_MV_6_ILDDS_ILREFPICS_27_34
    19341787    Bool interLayerPredLayerIdcPresentFlag = false;
    1935 #endif
    19361788    Int layerId = pcSlice->getLayerId();
    19371789    if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     
    19461798        if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    19471799        {       
    1948 #if H_MV_6_ILDDS_ILREFPICS_27_34
    19491800          interLayerPredLayerIdcPresentFlag = true;
    1950 #endif
    19511801          for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ )   
    19521802          {
     
    19561806      } 
    19571807    }
    1958 #if H_MV_6_ILDDS_ILREFPICS_27_34
    19591808    if ( !interLayerPredLayerIdcPresentFlag )
    19601809    {
     
    19641813      }
    19651814    }
    1966 #endif
    19671815#endif
    19681816    if(pcSlice->getSPS()->getUseSAO())
     
    19831831    {
    19841832      Bool overrideFlag = (pcSlice->getNumRefIdx( REF_PIC_LIST_0 )!=pcSlice->getPPS()->getNumRefIdxL0DefaultActive()||(pcSlice->isInterB()&&pcSlice->getNumRefIdx( REF_PIC_LIST_1 )!=pcSlice->getPPS()->getNumRefIdxL1DefaultActive()));
     1833#if PPS_FIX_DEPTH
     1834      overrideFlag |= (pcSlice->getIsDepth() && !pcSlice->getViewIndex());
     1835#endif
    19851836      WRITE_FLAG( overrideFlag ? 1 : 0,                               "num_ref_idx_active_override_flag");
    19861837      if (overrideFlag)
     
    20021853      pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0);
    20031854    }
    2004 
     1855#if PPS_FIX_DEPTH
     1856    if( (pcSlice->getPPS()->getListsModificationPresentFlag() || (pcSlice->getIsDepth() && !pcSlice->getViewIndex())) && pcSlice->getNumRpsCurrTempList() > 1)
     1857#else
    20051858    if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList() > 1)
     1859#endif
    20061860    {
    20071861      TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     
    20861940    }
    20871941#if H_3D_IC
    2088 #if SEC_ONLY_TEXTURE_IC_F0151
    20891942    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth())
    2090 #else
    2091     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) )
    2092 #endif
    20931943    {
    20941944      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
     
    21081958    {
    21091959#if H_3D_IV_MERGE
    2110 #if SEC_MPI_ENABLING_MERGE_F0150
    21111960      if(pcSlice->getIsDepth())
    21121961      {
     
    21201969        WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
    21211970      }
    2122 #else
    2123       Bool ivMvPredFlag = pcSlice->getVPS()->getIvMvPredFlag( pcSlice->getLayerIdInVps() ) ;
    2124       WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
    2125 #endif
    21261971#else
    21271972      WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
     
    21622007    }
    21632008  }
    2164 #if CAM_HLS_F0044
    2165 #if QC_DEPTH_IV_MRG_F0125
    2166 #if CAM_HLS_F0136_F0045_F0082
     2009#if H_3D
    21672010  if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && !pcSlice->getIsDepth() )
    2168 #else
    2169   if( pcSlice->getSPS()->hasCamParInSliceHeader() && !pcSlice->getIsDepth() )
    2170 #endif
    2171 #else
    2172   if( pcSlice->getSPS()->hasCamParInSliceHeader() )
    2173 #endif
    21742011  {
    21752012    for( UInt uiId = 0; uiId < pcSlice->getViewIndex(); uiId++ )
     
    21832020#endif
    21842021
     2022#if PPS_FIX_DEPTH
     2023  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag() || pcSlice->getIsDepth() )
     2024#else
    21852025  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
    2186   {
    2187 #if !H_3D || CAM_HLS_F0044
     2026#endif
     2027  {
    21882028    WRITE_UVLC(0,"slice_header_extension_length");
    2189 #else
    2190     WRITE_UVLC(0,"slice_header_extension_length"); //<- this element needs to be set to the correct value!!
    2191 #if QC_DEPTH_IV_MRG_F0125
    2192 #if CAM_HLS_F0136_F0045_F0082
    2193     if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && !pcSlice->getIsDepth() )
    2194 #else
    2195     if( pcSlice->getSPS()->hasCamParInSliceHeader() && !pcSlice->getIsDepth() )
    2196 #endif
    2197 #else
    2198     if( pcSlice->getSPS()->hasCamParInSliceHeader() )
    2199 #endif
    2200     {
    2201       for( UInt uiId = 0; uiId < pcSlice->getViewIndex(); uiId++ )
    2202       {
    2203         WRITE_SVLC( pcSlice->getCodedScale    ()[ uiId ],                                     "cp_scale" );
    2204         WRITE_SVLC( pcSlice->getCodedOffset   ()[ uiId ],                                     "cp_off" );
    2205         WRITE_SVLC( pcSlice->getInvCodedScale ()[ uiId ] + pcSlice->getCodedScale ()[ uiId ], "cp_inv_scale_plus_scale" );
    2206         WRITE_SVLC( pcSlice->getInvCodedOffset()[ uiId ] + pcSlice->getCodedOffset()[ uiId ], "cp_inv_off_plus_off" );
    2207       }
    2208     }
    2209 
    2210     Bool sliceSegmentHeaderExtension2Flag = false;
    2211     WRITE_FLAG( sliceSegmentHeaderExtension2Flag ? 1 : 0 , "slice_segment_header_extension2_flag" );
    2212     if ( sliceSegmentHeaderExtension2Flag )
    2213     {
    2214       WRITE_UVLC(0,"slice_header_extension2_length");
    2215     }
    2216 #endif
    22172029  }
    22182030}
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r758 r773  
    8686#if H_MV
    8787  Void  codeVPSExtension       ( TComVPS *pcVPS );
    88 #if H_MV_6_PS_O0118_33
    8988  Void  codeVideoSignalInfo     ( TComVideoSignalInfo* pcVideoSignalInfo );
    90 #endif
    9189
    92 #if H_MV_6_HRD_O0217_13
    9390  Void  codeDpbSize   ( TComVPS* vps );
    94 #endif
    9591
    96 #if H_MV_6_PS_REP_FORM_18_19_20
    9792  Void  codeRepFormat           ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
    98 #else
    99   Void  codeRepFormat          ( TComRepFormat* pcRepFormat );
    100 #endif
    10193  Void  codeVPSVUI             ( TComVPS* pcVPS );
    102 #if H_MV_6_HRD_O0164_15
    10394  Void  codeVpsVuiBspHrdParameters( TComVPS* pcVPS );
    104 #endif
    10595#endif
    10696  Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
     
    117107  Void  codePPS                 ( TComPPS* pcPPS );
    118108
    119 #if DLT_DIFF_CODING_IN_PPS
     109#if H_3D
    120110  Void  codePPSExtension        ( TComPPS* pcPPS );
    121111#endif
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r758 r773  
    331331#endif
    332332
    333 #if DLT_DIFF_CODING_IN_PPS
     333#if H_3D
    334334  TComDLT*  m_cDLT;
    335335#endif
     
    408408  UInt      m_uiARPStepNum;
    409409#endif
    410 #if MTK_SPIVMP_F0110
     410#if H_3D_SPIVMP
    411411  Int      m_iSubPULog2Size;
    412412#endif
     
    420420#if H_3D_DIM
    421421  Bool      m_useDMM;
    422 #if !SEC_DMM3_RBC_F0147
    423   Bool      m_useRBC;
    424 #endif
    425422  Bool      m_useSDC;
    426423  Bool      m_useDLT;
    427424#endif
    428 #if SEC_MPI_ENABLING_MERGE_F0150
     425#if H_3D_IV_MERGE
    429426  Bool      m_useMPI;
    430427#endif
     
    514511  Void       setARPStepNum                  ( UInt  u )      { m_uiARPStepNum = u;       }
    515512#endif
    516 #if MTK_SPIVMP_F0110
     513#if H_3D_SPIVMP
    517514  Int        getSubPULog2Size                   ()                   { return m_iSubPULog2Size;}
    518515  Void       setSubPULog2Size                   (Int u)              { m_iSubPULog2Size = u; }     
     
    873870#endif
    874871
    875 #if DLT_DIFF_CODING_IN_PPS
     872#if H_3D
    876873  Void      setDLT           ( TComDLT *p ) { m_cDLT = p; }
    877874  TComDLT*  getDLT           ()             { return m_cDLT; }
     
    10031000  Bool      getUseDMM                       ()        { return m_useDMM; }
    10041001  Void      setUseDMM                       ( Bool b) { m_useDMM = b;    }
    1005 #if !SEC_DMM3_RBC_F0147
    1006   Bool      getUseRBC                       ()        { return m_useRBC; }
    1007   Void      setUseRBC                       ( Bool b) { m_useRBC = b;    }
    1008 #endif
    10091002  Bool      getUseSDC                       ()        { return m_useSDC; }
    10101003  Void      setUseSDC                       ( Bool b) { m_useSDC = b;    }
     
    10181011  Bool      getUsePC                        ()         { return m_bUsePC;  }
    10191012#endif
    1020 #if SEC_MPI_ENABLING_MERGE_F0150
     1013#if H_3D_IV_MERGE
    10211014  Void      setUseMPI                       ( Bool b ) { m_useMPI = b;    }
    10221015  Bool      getUseMPI                       ()         { return m_useMPI; }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r735 r773  
    497497#endif
    498498#if H_3D_IC
    499 #if SEC_ONLY_TEXTURE_IC_F0151
    500499  Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth();
    501 #else
    502   Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE );
    503 #endif
    504500  bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC();
    505501#endif
     
    571567          PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
    572568          rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );     
    573 #if QC_DEPTH_IV_MRG_F0125
     569#if H_3D_IV_MERGE
    574570          if (rpcTempCU->getSlice()->getIsDepth() )
    575571          {
     
    586582            DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo);
    587583
    588 #if QC_DEPTH_IV_MRG_F0125
     584#if H_3D_IV_MERGE
    589585          }
    590586#endif
     
    17791775#endif
    17801776
    1781 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104
     1777#if H_3D_ARP
    17821778  DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
    17831779#else
     
    17871783
    17881784#if H_3D_VSP
    1789 #if !(H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104)
     1785#if !H_3D_ARP
    17901786  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    17911787  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    17921788  InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    1793 #if ETRIKHU_MERGE_REUSE_F0093
    17941789  rpcTempCU->m_bAvailableFlagA1 = 0;
    17951790  rpcTempCU->m_bAvailableFlagB1 = 0;
     
    17991794  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18001795  rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand );
    1801 #else
    1802   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
    1803 #endif
    1804 #endif
    1805 #else
    1806 #if ETRIKHU_MERGE_REUSE_F0093
     1796#endif
     1797#else
     1798#if H_3D
    18071799  rpcTempCU->m_bAvailableFlagA1 = 0;
    18081800  rpcTempCU->m_bAvailableFlagB1 = 0;
     
    18221814  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    18231815#endif
    1824 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104
     1816#if H_3D_ARP
    18251817for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    18261818#else
     
    18511843  for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- )
    18521844  {
    1853 #if FIX_MISSING_MACRO_R690
    18541845    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
    1855 #else
    1856     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) );
    1857 #endif
    1858 #if LGE_SHARP_VSP_INHERIT_F0104
    18591846    rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    18601847    rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth );
     
    18681855    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    18691856    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    1870 #if MTK_SPIVMP_F0110
     1857#if H_3D_SPIVMP
    18711858    Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    18721859    memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    18761863    puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()];
    18771864#endif
    1878 #if ETRIKHU_MERGE_REUSE_F0093
     1865#if H_3D
    18791866    rpcTempCU->initAvailableFlags();
    18801867    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18811868    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo
    1882 #if MTK_SPIVMP_F0110
     1869#if H_3D_SPIVMP
    18831870      , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    18841871#endif
     
    18881875    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
    18891876#endif
    1890 #endif
     1877
    18911878#endif
    18921879  for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual )
     
    19231910          rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
    19241911#endif
    1925 #if MTK_SPIVMP_F0110
     1912#if H_3D_SPIVMP
    19261913          rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth);
    19271914          if (bSPIVMPFlag[uiMergeCand])
     
    19491936            rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    19501937            rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1951 #if MTK_SPIVMP_F0110
    1952           }
    1953 #endif
    1954 #if H_3D_ARP && !QC_MTK_INTERVIEW_ARP_F0123_F0108
    1955           if( nARPW )
    1956           {
    1957             Bool bSignalflag[2] = { true, true };
    1958             for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
    1959             {
    1960               Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx();
    1961               RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    1962               if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
    1963               {
    1964                 bSignalflag[uiRefListIdx] = false;
    1965               }
    1966             }
    1967             if( !bSignalflag[0] && !bSignalflag[1] )
    1968             {
    1969 #if LGE_SHARP_VSP_INHERIT_F0104
    1970               continue;
    1971 #else
    1972               rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
    1973 #endif
    1974             }
     1938#if H_3D_SPIVMP
    19751939          }
    19761940#endif
     
    20932057  }
    20942058 }
    2095 #if MTK_SPIVMP_F0110
    2096 #if MTK_F0110_FIX
     2059#if H_3D_SPIVMP
    20972060 delete[] pcMvFieldSP;
    20982061 delete[] puhInterDirSP;
    2099 #else
    2100  delete pcMvFieldSP;
    2101  delete puhInterDirSP;
    2102 #endif
    21032062#endif
    21042063#if H_3D_ARP
     
    21702129
    21712130    m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
    2172 
    2173 #if !QC_MTK_INTERVIEW_ARP_F0123_F0108
    2174     if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N)
    2175     {
    2176       Bool bSignalflag[2] = { true, true };
    2177       for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
    2178       {
    2179         RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    2180         Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0);
    2181         if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
    2182         {
    2183           bSignalflag[uiRefListIdx] = false;
    2184         }
    2185       }
    2186       if( !bSignalflag[0] && !bSignalflag[1] )
    2187       {
    2188         rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
    2189       }
    2190     }
    2191 #endif
    21922131  }
    21932132  else
     
    22092148   {
    22102149     m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
    2211 
    2212 #if !QC_MTK_INTERVIEW_ARP_F0123_F0108
    2213      Bool bSignalflag[2] = { true, true };
    2214      for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
    2215      {
    2216        RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    2217        Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0);
    2218        if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
    2219        {
    2220          bSignalflag[uiRefListIdx] = false;
    2221        }
    2222      }
    2223      if( !bSignalflag[0] && !bSignalflag[1])
    2224      {
    2225        rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
    2226      }
    2227 #endif
    22282150   }
    22292151  }
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r724 r773  
    160160Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    161161{
    162 #if SEC_ONLY_TEXTURE_IC_F0151
    163162  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
    164 #else
    165   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )
    166 #endif
    167163  {
    168164    return;
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r738 r773  
    664664    refPicListModification->setRefPicListModificationFlagL1(0);
    665665#if H_MV
    666 #if H_MV_6_RALS_O0149_11
    667666    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    668 #else
    669     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 )
    670 #endif
    671667    {
    672668      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     
    678674    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    679675   
    680 #if H_MV_6_ILDDS_ILREFPICS_27_34
    681676    Bool interLayerPredLayerIdcPresentFlag = false;
    682 #endif
    683677    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
    684678    {         
     
    692686        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
    693687        {       
    694 #if H_MV_6_ILDDS_ILREFPICS_27_34
    695688          interLayerPredLayerIdcPresentFlag = true;
    696 #endif
    697689          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
    698690          {
     
    702694      }
    703695    }
    704 #if H_MV_6_ILDDS_ILREFPICS_27_34
    705696    if ( !interLayerPredLayerIdcPresentFlag )
    706697    {
     
    710701      }
    711702    }
    712 #endif
    713703
    714704
     
    745735#if H_3D_ARP
    746736    //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
    747 #if SHARP_ARP_REF_CHECK_F0105
    748737    pcSlice->setARPStepNum(m_ivPicLists);
    749 #else
    750     pcSlice->setARPStepNum();
    751 #endif
    752738    if(pcSlice->getARPStepNum() > 1)
    753739    {
     
    13191305      nalu = NALUnit(NAL_UNIT_PPS);
    13201306#endif
     1307#if PPS_FIX_DEPTH
     1308      if(!pcSlice->getIsDepth() || !pcSlice->getViewIndex() )
     1309      {
     1310#endif
    13211311      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    13221312      m_pcEntropyCoder->encodePPS(pcSlice->getPPS());
     
    13261316      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    13271317#endif
    1328 
     1318#if PPS_FIX_DEPTH
     1319      }
     1320#endif
    13291321      xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS());
    13301322
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r758 r773  
    9595#if H_3D_DIM_DMM
    9696, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    97 #if !SEC_DMM3_RBC_F0147
    98 , m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    99 #endif
    100 #endif
    101 #if H_3D_DIM_RBC
    102 , m_cRbcDataSCModel           ( 1,             1,               NUM_RBC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    10397#endif
    10498#if H_3D_DIM_SDC
     
    176170#if H_3D_DIM_DMM
    177171  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    178 #if !SEC_DMM3_RBC_F0147
    179   m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
    180 #endif
    181 #endif
    182 #if H_3D_DIM_RBC
    183   m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
    184172#endif
    185173#if H_3D_DIM_SDC
     
    266254#if H_3D_DIM_DMM
    267255      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
    268 #if !SEC_DMM3_RBC_F0147
    269       curCost += m_cDmm3DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM3_DATA );
    270 #endif
    271 #endif
    272 #if H_3D_DIM_RBC
    273       curCost += m_cRbcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_RBC_DATA );
    274256#endif
    275257    }
     
    337319#if H_3D_DIM_DMM
    338320  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    339 #if !SEC_DMM3_RBC_F0147
    340   m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
    341 #endif
    342 #endif
    343 #if H_3D_DIM_RBC
    344   m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
    345321#endif
    346322#if H_3D_DIM_SDC
     
    526502}
    527503
    528 #if QC_DIM_DELTADC_UNIFY_F0132
    529504Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
    530505{
     
    536511  }
    537512}
    538 #else
    539 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt dimType )
    540 {
    541   xWriteExGolombLevel( UInt( abs( valDeltaDC ) ), m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
    542   if( valDeltaDC != 0 )
    543   {
    544     UInt uiSign = valDeltaDC > 0 ? 0 : 1;
    545     m_pcBinIf->encodeBinEP( uiSign );
    546   }
    547 }
    548 #endif
    549513
    550514#if H_3D_DIM_DMM
     
    557521}
    558522
    559 #if !SEC_DMM3_RBC_F0147
    560 Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit )
    561 {
    562   for( Int i = 0; i < iNumBit; i++ )
    563   {
    564     m_pcBinIf->encodeBin( ( uiIntraIdx >> i ) & 1, m_cDmm3DataSCModel.get(0, 0, 0) );
    565   }
    566 }
    567 #endif
    568 #endif
    569 #if H_3D_DIM_RBC
    570 Void TEncSbac::xCodeRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx )
    571 {
    572   UInt   uiDepth        = pcCU->getDepth( uiAbsPartIdx ) + (pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 1 : 0);
    573   UChar* pucSymbolList  = pcCU->getEdgeCode     ( uiAbsPartIdx );
    574   UChar  ucEdgeNumber   = pcCU->getEdgeNumber   ( uiAbsPartIdx );
    575   Bool   bLeft          = pcCU->getEdgeLeftFirst( uiAbsPartIdx );
    576   UChar  ucStart        = pcCU->getEdgeStartPos ( uiAbsPartIdx );
    577   UInt   uiSymbol;
    578 
    579   // 1. Top(0) or Left(1)
    580   uiSymbol = (bLeft == false) ? 0 : 1;
    581   m_pcBinIf->encodeBinEP( uiSymbol );
    582 
    583   // 2. Start position (lowest bit first)
    584   uiSymbol = ucStart;
    585   for( UInt ui = 6; ui > uiDepth; ui-- ) // 64(0)->6, 32(1)->5, 16(2)->4, 8(3)->3, 4(4)->2
    586   {
    587     m_pcBinIf->encodeBinEP( uiSymbol & 0x1 );
    588     uiSymbol >>= 1;
    589   }
    590 
    591   // 3. Number of edges
    592   uiSymbol = ucEdgeNumber > 0 ? ucEdgeNumber - 1 : 0;
    593   for( UInt ui = 7; ui > uiDepth; ui-- ) // 64(0)->7, 32(1)->6, 16(2)->5, 8(3)->4, 4(4)->3
    594   {
    595     m_pcBinIf->encodeBinEP( uiSymbol & 0x1 );
    596     uiSymbol >>= 1;
    597   }
    598 
    599   if(uiSymbol != 0)
    600   {
    601     printf(" ucEdgeNumber %d at depth %d\n",ucEdgeNumber, uiDepth);
    602     assert(false);
    603   }
    604 
    605   // 4. Edges
    606   for( Int iPtr2 = 0; iPtr2 < ucEdgeNumber; iPtr2++ )
    607   {
    608     UInt uiReorderSymbol = pucSymbolList[iPtr2];
    609     for( UInt ui = 0; ui < uiReorderSymbol; ui++ )
    610     {
    611       m_pcBinIf->encodeBin( 1, m_cRbcDataSCModel.get( 0, 0, 0 ) );
    612     }
    613 
    614     if( uiReorderSymbol != 6 )
    615       m_pcBinIf->encodeBin( 0, m_cRbcDataSCModel.get( 0, 0, 0 ) );
    616   }
    617 }
    618 #endif
     523#endif
     524
    619525#if H_3D_DIM_SDC
    620526Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     
    632538
    633539#if H_3D_DIM_DLT
    634 #if DLT_DIFF_CODING_IN_PPS
    635540  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    636 #else
    637   UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    638 #endif
    639541#else
    640542  UInt uiMaxResidualBits = g_bitDepthY;
     
    655557    DTRACE_CU("sdc_residual_sign_flag[i]", uiSign)
    656558#endif
    657    
    658 #if H_3D_DIM_DLT
    659 #if DLT_DIFF_CODING_IN_PPS
    660       UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    661 #else
    662       UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    663 #endif
     559#if H_3D_DIM_DLT   
     560    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    664561#else
    665562    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
    666563#endif
     564
    667565    assert(uiAbsIdx <= uiNumDepthValues);
    668566   
     
    12391137      xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    12401138    } break;
    1241 #if !SEC_DMM3_RBC_F0147
    1242   case( DMM3_IDX ):
    1243     {
    1244       xCodeDmm3WedgeIdx( pcCU->getDmm3IntraTabIdx( absPartIdx ), g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    1245     } break;
    1246 #endif
    12471139  case( DMM4_IDX ): break;
    12481140#endif
    1249 #if H_3D_DIM_RBC
    1250   case( RBC_IDX ):
    1251     {
    1252       assert( pcCU->getWidth( absPartIdx ) < 64 );
    1253       xCodeRbcEdge( pcCU, absPartIdx );
    1254     } break;
    1255 #endif
    12561141  default: break;
    12571142  }
    12581143
    1259 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    1260   if( pcCU->getSDCFlag( absPartIdx ) )
    1261   {
    1262     assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
    1263     UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2;
    1264     for(UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
    1265     {
    1266       xCodeSDCResidualData(pcCU, absPartIdx, uiSeg);
    1267     }
    1268   }
    1269   else
    1270   {
    1271 #endif
    1272 #if QC_DIM_DELTADC_UNIFY_F0132
    1273     if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
    1274 #else
    1275     if( dimType < DIM_NUM_TYPE )
    1276 #endif
    1277     {
    1278 #if QC_DIM_DELTADC_UNIFY_F0132
    1279       UInt dimDeltaDC;
    1280       Pel  deltaDC;
    1281       UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
    1282       if( pcCU->getSDCFlag( absPartIdx ) )
    1283     {
    1284         if( uiNumSegments==1 )
    1285         {
    1286           dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
    1287         }
    1288         else
    1289         {
    1290           dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
    1291         }
     1144  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
     1145  {
     1146    UInt dimDeltaDC;
     1147    Pel  deltaDC;
     1148    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1149    if( pcCU->getSDCFlag( absPartIdx ) )
     1150    {
     1151      if( uiNumSegments==1 )
     1152      {
     1153        dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
    12921154      }
    12931155      else
    12941156      {
    1295         dimDeltaDC = isDimDeltaDC( dir );
    1296       }
    1297 
    1298       m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
    1299 
    1300       if( dimDeltaDC )
    1301       {
    1302         for( UInt segment = 0; segment < uiNumSegments; segment++ )
    1303         {
    1304           deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
    1305           xCodeDimDeltaDC( deltaDC, uiNumSegments );
    1306         }
    1307       }
    1308 #else
    1309       UInt dimDeltaDC = isDimDeltaDC( dir );
    1310       m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
    1311       if( dimDeltaDC )
    1312       {
    1313         for( UInt segment = 0; segment < 2; segment++ )
    1314         {
    1315           xCodeDimDeltaDC( pcCU->getDimDeltaDC( dimType, segment, absPartIdx ), dimType );
    1316         }
    1317       }
    1318 #endif
    1319     }
    1320 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    1321   }
    1322 #endif
     1157        dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
     1158      }
     1159    }
     1160    else
     1161    {
     1162      dimDeltaDC = isDimDeltaDC( dir );
     1163    }
     1164
     1165    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
     1166
     1167    if( dimDeltaDC )
     1168    {
     1169      for( UInt segment = 0; segment < uiNumSegments; segment++ )
     1170      {
     1171        deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
     1172        xCodeDimDeltaDC( deltaDC, uiNumSegments );
     1173      }
     1174    }
     1175  }
    13231176}
    13241177
    13251178Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    13261179{
    1327 #if SEC_DMM3_RBC_F0147
    13281180  UInt codeWordTable[3][7] =    {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};
    13291181  UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3,  4,  4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};
    1330 #else
    1331     UInt codeWordTable[3][7] =    {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}};
    1332     UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}};
    1333 #endif
    13341182  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
    13351183  UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
     
    13461194    case DMM1_IDX: codeIdx = 3; break;
    13471195    case DMM4_IDX: codeIdx = 4; break;
    1348 #if !SEC_DMM3_RBC_F0147
    1349     case DMM3_IDX: codeIdx = 5; break;
    1350     case  RBC_IDX: codeIdx = 6; break;
    1351 #endif
    13521196    default:                    break;
    13531197    }
     
    13621206      default:          codeIdx = 2; break;
    13631207    }
    1364   }
    1365 #endif
    1366 #if !SEC_DMM3_RBC_F0147
    1367   if( puIdx==1 )
    1368   {
    1369       if( codeIdx==1 || codeIdx==2 || codeIdx==4 )
    1370       {
    1371           m_pcBinIf->encodeBinEP( 0 );
    1372       }
    1373       else
    1374       {
    1375           m_pcBinIf->encodeBinEP( 1 );
    1376       }
    13771208  }
    13781209#endif
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r724 r773  
    116116  Void  xWriteEpExGolomb     ( UInt uiSymbol, UInt uiCount );
    117117  Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam );
    118   #if H_3D_DIM
     118#if H_3D_DIM
    119119  Void  xWriteExGolombLevel  ( UInt uiSymbol, ContextModel& rcSCModel  );
    120 #if QC_DIM_DELTADC_UNIFY_F0132
    121120  Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt uiNumSeg );
    122 #else
    123   Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt dimType );
    124 #endif
    125121#if H_3D_DIM_DMM
    126122  Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
    127 #if !SEC_DMM3_RBC_F0147
    128   Void  xCodeDmm3WedgeIdx    ( UInt uiIntraIdx, Int iNumBit );
    129 #endif
    130 #endif
    131 #if H_3D_DIM_RBC
    132   Void  xCodeRbcEdge         ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    133123#endif
    134124#if H_3D_DIM_SDC
     
    259249#if H_3D_DIM_DMM
    260250  ContextModel3DBuffer m_cDmm1DataSCModel;
    261 #if !SEC_DMM3_RBC_F0147
    262   ContextModel3DBuffer m_cDmm3DataSCModel;
    263 #endif
    264 #endif
    265 #if H_3D_DIM_RBC
    266   ContextModel3DBuffer m_cRbcDataSCModel;
    267251#endif
    268252#if H_3D_DIM_SDC 
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r758 r773  
    11241124      {
    11251125#endif
    1126       for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    1127       {
    1128 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    1129 #if DLT_DIFF_CODING_IN_PPS
    1130         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1131 #else
    1132         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1133 #endif
     1126        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1127        {
     1128#if H_3D_DIM
     1129          if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    11341130          {
    1135 #if DLT_DIFF_CODING_IN_PPS
    11361131            pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
    1137 #else
    1138             pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
    1139 #endif
    11401132          }
    11411133          else
    11421134          {
    1143               pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
     1135            pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
    11441136          }
    11451137#else
    1146         pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
    1147 #endif
    1148       }
    1149       pOrg  += uiStride;
    1150       pResi += uiStride;
    1151       pPred += uiStride;
     1138          pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
     1139#endif
     1140        }
     1141        pOrg  += uiStride;
     1142        pResi += uiStride;
     1143        pPred += uiStride;
    11521144#if H_3D_DIM_ENC
    11531145      }
     
    12091201      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    12101202      {
    1211 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    1212 #if DLT_DIFF_CODING_IN_PPS
     1203#if H_3D_DIM
    12131204        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1214 #else
    1215         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1216 #endif
    1217           {
    1218 #if DLT_DIFF_CODING_IN_PPS
    1219             pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    1220 #else
    1221             pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    1222 #endif
    1223           }
    1224           else
    1225           {
    1226               pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    1227           }
     1205        {
     1206          pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     1207        }
     1208        else
     1209        {
     1210          pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     1211        }
    12281212#else
    12291213        pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     
    19511935    // get residual (idx)
    19521936#if H_3D_DIM_DLT
    1953 #if DLT_DIFF_CODING_IN_PPS
    19541937    Pel pResidualIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1955 #else
    1956     Pel pResidualIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1957 #endif
    19581938#else
    19591939    Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
     
    19691949  {
    19701950#if H_3D_DIM_DLT
    1971 #if DLT_DIFF_CODING_IN_PPS
    19721951    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    19731952    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    19741953    Pel   pRecoValue  = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1975 #else
    1976     Pel   pPredIdx    = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1977     Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    1978     Pel   pRecoValue  = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1979 #endif
    19801954
    19811955    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
     
    29242898              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
    29252899            } break;
    2926 #if !SEC_DMM3_RBC_F0147
    2927           case( DMM3_IDX ):
    2928             {
    2929 
    2930               TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
    2931               TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() );
    2932               UInt      uiTexPartIdx = pcCU->getZorderIdxInCU() + uiPartOffset;
    2933               Int   uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
    2934 
    2935               if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
    2936               {
    2937              UInt uiIntraTabIdx = 0;
    2938               xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir );
    2939               pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );
    2940               pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth );
    2941               biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
    2942               }
    2943             } break;
    2944 #endif
     2900
    29452901          case( DMM4_IDX ):
    29462902            {
     
    29682924      }
    29692925#endif
    2970 #if H_3D_DIM_RBC
    2971       if( m_pcEncCfg->getUseRBC()
    2972 #if H_3D_FAST_DEPTH_INTRA
    2973           && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
    2974 #endif
    2975         )
    2976       {
    2977         if( xSearchRbcEdge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ) )
    2978         {
    2979           Pel deltaDC1 = 0; Pel deltaDC2 = 0;
    2980 #if QC_DIM_DELTADC_UNIFY_F0132
    2981           xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
    2982 #else
    2983           xSearchRbcDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
    2984 #endif
    2985           pcCU->setDimDeltaDC( RBC_IDX, 0, uiPartOffset, deltaDC1 );
    2986           pcCU->setDimDeltaDC( RBC_IDX, 1, uiPartOffset, deltaDC2 );
    2987 
    2988           uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX  +DIM_OFFSET);
    2989           uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX+1+DIM_OFFSET);
    2990         }
    2991       }
    2992 #endif
    29932926    }
    29942927#endif
     
    30292962      Bool bTestZeroResi = false;
    30302963#if H_3D_DIM_ENC
    3031 #if LGE_BUGFIX_F0158
    30322964      bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP();
    3033 #else
    3034       bTestZeroResi |= pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->isIRAP();
    3035 #endif
    30362965#endif
    30372966#if H_3D_DIM_SDC
     
    36423571                                 , InheritedVSPDisInfo*  inheritedVSPDisInfo
    36433572#endif
    3644 #if MTK_SPIVMP_F0110
     3573#if H_3D_SPIVMP
    36453574                                 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    36463575#endif
     
    36603589    if ( iPUIdx == 0 )
    36613590    {
    3662 #if ETRIKHU_MERGE_REUSE_F0093
     3591#if H_3D
    36633592      pcCU->initAvailableFlags();
    36643593      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
     
    36683597                                        , inheritedVSPDisInfo
    36693598#endif
    3670 #if MTK_SPIVMP_F0110
     3599#if H_3D_SPIVMP
    36713600                                        , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    36723601#endif
     
    36743603        );
    36753604#else
    3676       pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    3677 #if H_3D_VSP
    3678                                    , vspFlag
    3679                                    , inheritedVSPDisInfo
    3680 #endif
    3681                                    , numValidMergeCand
    3682                                    );
     3605      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    36833606#endif
    36843607    }
     
    36873610  else
    36883611  {
    3689 #if ETRIKHU_MERGE_REUSE_F0093
     3612#if H_3D
    36903613    pcCU->initAvailableFlags();
    36913614    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
     
    36953618                                      , inheritedVSPDisInfo
    36963619#endif
    3697 #if MTK_SPIVMP_F0110
     3620#if H_3D_SPIVMP
    36983621                                      , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    36993622#endif
     
    37013624      );
    37023625#else
    3703     pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    3704 #if H_3D_VSP
    3705                                  , vspFlag
    3706                                  , inheritedVSPDisInfo
    3707 #endif
    3708                                  , numValidMergeCand
     3626    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
    37093627                                 );
    37103628#endif
     
    37263644      PartSize ePartSize = pcCU->getPartitionSize( 0 );
    37273645
    3728 #if MTK_SPIVMP_F0110
     3646#if H_3D_SPIVMP
    37293647      pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ));
    37303648      if (pbSPIVMPFlag[uiMergeCand])
     
    37483666        pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    37493667        pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    3750 #if MTK_SPIVMP_F0110
     3668#if H_3D_SPIVMP
    37513669      }
    37523670#endif
     
    44274345      DisInfo OriginalDvInfo = pcCU->getDvInfo(uiAbsPartIdx);
    44284346#endif
    4429 #if MTK_SPIVMP_F0110
     4347#if H_3D_SPIVMP
    44304348      Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    44314349      memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    44404358                      , inheritedVSPDisInfo
    44414359#endif
    4442 #if MTK_SPIVMP_F0110
     4360#if H_3D_SPIVMP
    44434361                      , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    44444362#endif
     
    44544372        pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    44554373#endif
    4456 #if MTK_SPIVMP_F0110
     4374#if H_3D_SPIVMP
    44574375        pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 
    44584376        if (bSPIVMPFlag[uiMRGIndex]!=0)
     
    44884406            pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx );
    44894407          }
    4490 #if MTK_SPIVMP_F0110
     4408#if H_3D_SPIVMP
    44914409        }
    44924410#endif
     
    45024420      else
    45034421      {
    4504 #if MTK_SPIVMP_F0110       
     4422#if H_3D_SPIVMP       
    45054423        pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    45064424#endif
     
    45174435        }
    45184436      }
    4519 #if MTK_SPIVMP_F0110
    4520 #if MTK_F0110_FIX
     4437#if H_3D_SPIVMP
    45214438      delete[] pcMvFieldSP;
    45224439      delete[] puhInterDirSP;
    4523 #else
    4524       delete pcMvFieldSP;
    4525       delete puhInterDirSP;
    4526 #endif
    45274440#endif
    45284441    }
     
    54385351      dZeroCost = dCost + 1;
    54395352    }
    5440 #if MTK_SPIVMP_F0110
     5353#if H_3D_SPIVMP
    54415354    if ( dZeroCost < dCost || pcCU->getQtRootCbf(0)==0)
    54425355#else
     
    73727285
    73737286#if H_3D_DIM_DLT
    7374 #if DLT_DIFF_CODING_IN_PPS
    73757287  rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );
    73767288  rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );
    7377 #else
    7378   rDeltaDC1 = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );
    7379   rDeltaDC2 = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );
    7380 #endif
    73817289#endif
    73827290}
     
    74777385}
    74787386
    7479 #if !SEC_DMM3_RBC_F0147
    7480 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir )
    7481 {
    7482   ruiTabIdx       = 0;
    7483   ruiIntraTabIdx  = 0;
    7484 
    7485   // local pred buffer
    7486   TComYuv cPredYuv;
    7487   cPredYuv.create( uiWidth, uiHeight );
    7488   cPredYuv.clear();
    7489   Pel* piPred = cPredYuv.getLumaAddr();
    7490   UInt uiPredStride = cPredYuv.getStride();
    7491 
    7492   // wedge search
    7493   UInt uiBestDist = MAX_UINT;
    7494   WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
    7495   Pel refDC1 = 0; Pel refDC2 = 0;
    7496 
    7497   std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
    7498   std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[colTexIntraDir-2];
    7499   for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
    7500   {
    7501     UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
    7502     TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx));
    7503     xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    7504     xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    7505 
    7506     UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
    7507     if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
    7508     {
    7509       uiBestDist     = uiActDist;
    7510       ruiTabIdx      = uiIdx;
    7511       ruiIntraTabIdx = uiIdxW;
    7512     }
    7513   }
    7514   cPredYuv.destroy();
    7515 }
    7516 #endif
    7517 #endif
    7518 #if H_3D_DIM_RBC
    7519 Void TEncSearch::xSearchRbcDeltaDCs( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 )
    7520 {
    7521   assert( biSegPattern );
    7522   Pel origDC1 = 0; Pel origDC2 = 0;
    7523   xCalcBiSegDCs  ( piOrig,   uiStride, biSegPattern, patternStride, origDC1, origDC2 );
    7524   xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 );
    7525 
    7526   Int* piMask = pcCU->getPattern()->getAdiOrgBuf( uiWidth, uiHeight, m_piYuvExt ); // no filtering for DMM
    7527   Int  maskStride = 2*uiWidth + 1;
    7528   Int* ptrSrc = piMask+maskStride+1;
    7529   Pel  predDC1 = 0; Pel predDC2 = 0;
    7530   xPredBiSegDCs( ptrSrc, maskStride, biSegPattern, patternStride, predDC1, predDC2 );
    7531 
    7532   rDeltaDC1 = origDC1 - predDC1;
    7533   rDeltaDC2 = origDC2 - predDC2;
    7534 
    7535 #if H_3D_VSO
    7536   if( m_pcRdCost->getUseVSO() )
    7537   {
    7538     Pel fullDeltaDC1 = rDeltaDC1;
    7539     Pel fullDeltaDC2 = rDeltaDC2;
    7540 
    7541     xDeltaDCQuantScaleDown( pcCU, fullDeltaDC1 );
    7542     xDeltaDCQuantScaleDown( pcCU, fullDeltaDC2 );
    7543 
    7544     Dist uiBestDist     = RDO_DIST_MAX;
    7545     UInt uiBestQStepDC1 = 0;
    7546     UInt uiBestQStepDC2 = 0;
    7547 
    7548     UInt uiDeltaDC1Max = abs(fullDeltaDC1);
    7549     UInt uiDeltaDC2Max = abs(fullDeltaDC2);
    7550 
    7551     //VSO Level delta DC check range extension
    7552     uiDeltaDC1Max += (uiDeltaDC1Max>>1);
    7553     uiDeltaDC2Max += (uiDeltaDC2Max>>1);
    7554 
    7555     for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++  )
    7556     {
    7557       Pel iLevelDeltaDC1 = (Pel)(uiQStepDC1) * (Pel)(( fullDeltaDC1 < 0 ) ? -1 : 1);
    7558       xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 );
    7559       Pel testDC1 = ClipY( predDC1 + iLevelDeltaDC1 );
    7560 
    7561       for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++  )
    7562       {
    7563         Pel iLevelDeltaDC2 = (Pel)(uiQStepDC2) * (Pel)(( fullDeltaDC2 < 0 ) ? -1 : 1);
    7564         xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 );
    7565         Pel testDC2 = ClipY( predDC2 + iLevelDeltaDC2 );
    7566 
    7567         xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 );
    7568 
    7569         Dist uiActDist = RDO_DIST_MAX;
    7570         if( m_pcRdCost->getUseEstimatedVSD() )
    7571         {
    7572           uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );
    7573         }
    7574         else
    7575         {
    7576           uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );
    7577         }
    7578 
    7579         if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
    7580         {
    7581           uiBestDist     = uiActDist;
    7582           uiBestQStepDC1 = uiQStepDC1;
    7583           uiBestQStepDC2 = uiQStepDC2;
    7584         }
    7585       }
    7586     }
    7587 
    7588     fullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( fullDeltaDC1 < 0 ) ? -1 : 1);
    7589     fullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( fullDeltaDC2 < 0 ) ? -1 : 1);
    7590     xDeltaDCQuantScaleUp( pcCU, fullDeltaDC1 );
    7591     xDeltaDCQuantScaleUp( pcCU, fullDeltaDC2 );
    7592     rDeltaDC1 = fullDeltaDC1;
    7593     rDeltaDC2 = fullDeltaDC2;
    7594   }
    7595 #endif
    7596 
    7597   xDeltaDCQuantScaleDown( pcCU, rDeltaDC1 );
    7598   xDeltaDCQuantScaleDown( pcCU, rDeltaDC2 );
    7599 }
    7600 
    7601 Bool TEncSearch::xSearchRbcEdge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, Int iWidth, Int iHeight )
    7602 {
    7603   Bool* pbEdge  = (Bool*) xMalloc( Bool, iWidth * iHeight * 4 );
    7604 
    7605   Short* psDiffX = new Short[ iWidth * iHeight ];
    7606   Short* psDiffY = new Short[ iWidth * iHeight ];
    7607   Bool*  pbEdgeX = new Bool [ iWidth * iHeight ];
    7608   Bool*  pbEdgeY = new Bool [ iWidth * iHeight ];
    7609 
    7610   // Find Horizontal Gradient & Edge Detection ((x+1, y) - (x,y))
    7611   for( Int y=0; y<iHeight; y++ )
    7612   {
    7613     Short* psDiffXPtr = &psDiffX[ y * iHeight ];
    7614     Bool*  pbEdgeXPtr = &pbEdgeX[ y * iHeight ];
    7615     for(Int x=0; x<iWidth-1; x++ )
    7616     {
    7617       *psDiffXPtr = piRef[ x+1 + y*uiRefStride ] - piRef[ x + y*uiRefStride ];
    7618       if(*psDiffXPtr >= RBC_THRESHOLD || *psDiffXPtr <= (-1)*RBC_THRESHOLD)
    7619       {
    7620         *pbEdgeXPtr = true;
    7621       }
    7622       else
    7623       {
    7624         *pbEdgeXPtr = false;
    7625       }
    7626 
    7627       psDiffXPtr++;
    7628       pbEdgeXPtr++;
    7629     }
    7630   }
    7631 
    7632   // Find Vertical Gradient & Edge Detection((x,y+1) - (x,y))
    7633   for( Int y=0; y<iHeight-1; y++ )
    7634   {
    7635     Short* psDiffYPtr = &psDiffY[ y * iHeight ];
    7636     Bool*  pbEdgeYPtr = &pbEdgeY[ y * iHeight ];
    7637     for(Int x=0; x<iWidth; x++ )
    7638     {
    7639       *psDiffYPtr = piRef[ x + (y+1)*uiRefStride ] - piRef[ x + y*uiRefStride ];
    7640       if(*psDiffYPtr >= RBC_THRESHOLD || *psDiffYPtr <= (-1)*RBC_THRESHOLD)
    7641       {
    7642         *pbEdgeYPtr = true;
    7643       }
    7644       else
    7645       {
    7646         *pbEdgeYPtr = false;
    7647       }
    7648 
    7649       psDiffYPtr++;
    7650       pbEdgeYPtr++;
    7651     }
    7652   }
    7653 
    7654   // Eliminate local maximum
    7655   for( Int y=0; y<iHeight; y++ )
    7656   {
    7657     Short* psDiffXPtr = &psDiffX[ y * iHeight ];
    7658     Bool*  pbEdgeXPtr = &pbEdgeX[ y * iHeight ];
    7659     for( Int x=0; x<iWidth-1; x++ )
    7660     {
    7661       UShort usAbs0=0, usAbs1=0, usAbs2=0;  // 0 : left, 1 : current, 2 : right
    7662 
    7663       if( x > 0 && *(pbEdgeXPtr-1) == true )
    7664       {
    7665         if( *(psDiffXPtr-1) >= 0)
    7666         {
    7667           usAbs0 = *(psDiffXPtr-1);
    7668 
    7669         }
    7670         else
    7671         {
    7672           usAbs0 = (-1) * *(psDiffXPtr-1);
    7673         }
    7674       }
    7675       if( *pbEdgeXPtr == true )
    7676       {
    7677         if( *(psDiffXPtr) >= 0)
    7678         {
    7679           usAbs1 = *(psDiffXPtr);
    7680         }
    7681         else
    7682         {
    7683           usAbs1 = (-1) * *(psDiffXPtr);
    7684         }
    7685       }
    7686       if( x < iWidth-2 && *(pbEdgeXPtr+1) == true )
    7687       {
    7688         if( *(psDiffXPtr+1) >= 0)
    7689         {
    7690           usAbs2 = *(psDiffXPtr+1);
    7691           //bSign2 = true;
    7692         }
    7693         else
    7694         {
    7695           usAbs2 = (-1) * *(psDiffXPtr+1);
    7696         }
    7697       }
    7698 
    7699       if( x == 0 )
    7700       {
    7701         if( usAbs1 < usAbs2 )
    7702         {
    7703           *pbEdgeXPtr = false;
    7704         }
    7705       }
    7706       else if( x == iWidth-2 )
    7707       {
    7708         if( usAbs1 <= usAbs0 )
    7709           *pbEdgeXPtr = false;
    7710       }
    7711       else
    7712       {
    7713         if( usAbs2 > usAbs0 )
    7714         {
    7715           if( usAbs1 < usAbs2 )
    7716             *pbEdgeXPtr = false;
    7717         }
    7718         else
    7719         {
    7720           if( usAbs1 <= usAbs0 )
    7721             *pbEdgeXPtr = false;
    7722         }
    7723       }
    7724 
    7725       psDiffXPtr++;
    7726       pbEdgeXPtr++;
    7727     }
    7728   }
    7729 
    7730   for( Int y=0; y<iHeight-1; y++ )
    7731   {
    7732     Short* psDiffYPtr = &psDiffY[ y * iWidth ];
    7733     Bool*  pbEdgeYPtr = &pbEdgeY[ y * iWidth ];
    7734     for( Int x=0; x<iWidth; x++ )
    7735     {
    7736       UShort usAbs0=0, usAbs1=0, usAbs2=0;  // 0 : upper, 1 : current, 2 : bottom
    7737       if( y > 0 && *(pbEdgeYPtr-iWidth) == true )
    7738       {
    7739         if( *(psDiffYPtr-iWidth) >= 0)
    7740         {
    7741           usAbs0 = *(psDiffYPtr-iWidth);
    7742         }
    7743         else
    7744         {
    7745           usAbs0 = (-1) * *(psDiffYPtr-iWidth);         
    7746         }
    7747       }
    7748       if( *pbEdgeYPtr == true )
    7749       {
    7750         if( *(psDiffYPtr) >= 0)
    7751         {
    7752           usAbs1 = *(psDiffYPtr);
    7753         }
    7754         else
    7755         {
    7756           usAbs1 = (-1) * *(psDiffYPtr);
    7757         }
    7758       }
    7759       if( y < iHeight-2 && *(pbEdgeYPtr+iWidth) == true )
    7760       {
    7761         if( *(psDiffYPtr+iWidth) >= 0)
    7762         {
    7763           usAbs2 = *(psDiffYPtr+iWidth);         
    7764         }
    7765         else
    7766         {
    7767           usAbs2 = (-1) * *(psDiffYPtr+iWidth);
    7768         }
    7769       }
    7770 
    7771       if( y == 0 )
    7772       {
    7773         if( usAbs1 < usAbs2 )
    7774           *pbEdgeYPtr = false;
    7775       }
    7776       else if( y == iHeight-2 )
    7777       {
    7778         if( usAbs1 <= usAbs0 )
    7779           *pbEdgeYPtr = false;
    7780       }
    7781       else
    7782       {
    7783         if( usAbs2 > usAbs0 )
    7784         {
    7785           if( usAbs1 < usAbs2 )
    7786             *pbEdgeYPtr = false;
    7787         }
    7788         else
    7789         {
    7790           if( usAbs1 <= usAbs0 )
    7791             *pbEdgeYPtr = false;
    7792         }
    7793       }
    7794 
    7795       psDiffYPtr++;
    7796       pbEdgeYPtr++;
    7797     }
    7798   }
    7799 
    7800   // Edge Merging
    7801   for( Int i=0; i< 4 * iWidth * iHeight; i++ )
    7802     pbEdge[ i ] = false;
    7803   /// Even Line (0,2,4,6,...) => Vertical Edge
    7804   for( Int i=0; i<iHeight; i++)
    7805   {
    7806     for( Int j=0; j<iWidth-1; j++)
    7807     {
    7808       pbEdge[ (2 * j + 1) + (2 * i) * 2 * iWidth ] = pbEdgeX[ j + i * iHeight ];
    7809     }
    7810   }
    7811   /// Odd Line (1,3,5,7,...) => Horizontal Edge
    7812   for( Int i=0; i<iHeight-1; i++)
    7813   {
    7814     for( Int j=0; j<iWidth; j++)
    7815     {
    7816       pbEdge[ (2 * j) + (2 * i + 1) * 2 * iWidth ] = pbEdgeY[ j + i * iHeight ];
    7817     }
    7818   }
    7819 
    7820   // Intersection Filling
    7821   /// Vertical Edge between Horizontal Edges
    7822   for( Int i = 1; i < 2 * iHeight - 3; i += 2)
    7823   {
    7824     for( Int j = 0; j < 2 * iWidth - 1; j += 2)
    7825     {
    7826       if( pbEdge[ j + i * 2 * iWidth ] )
    7827       {
    7828         if( j != 0 && pbEdge[ (j - 2) + ((i + 2) * 2 * iWidth) ] )
    7829         {
    7830           if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j - 1) + ((i + 3) * 2 * iWidth) ] )
    7831             pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] = true;
    7832         }
    7833         if( j != 2 * iWidth - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] )
    7834         {
    7835           if( !pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 1) + ((i + 3) * 2 * iWidth) ] )
    7836             pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true;
    7837         }
    7838       }
    7839     }
    7840   }
    7841   /// Horizontal Edge between Vertical Edges
    7842   for( Int j = 1; j < 2 * iWidth - 3; j += 2)
    7843   {
    7844     for( Int i = 0; i < 2 * iHeight - 1; i += 2)
    7845     {
    7846       if( pbEdge[ j + i * 2 * iWidth ] )
    7847       {
    7848         if( i != 0 && pbEdge[ (j + 2) + ((i - 2) * 2 * iWidth) ] )
    7849         {
    7850           if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i - 1) * 2 * iWidth) ] )
    7851             pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] = true;
    7852         }
    7853         if( i != 2 * iHeight - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] )
    7854         {
    7855           if( !pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i + 1) * 2 * iWidth) ] )
    7856             pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true;
    7857         }
    7858       }
    7859     }
    7860   }
    7861 
    7862   // Static Pruning Unnecessary Edges
    7863   /// Step1. Stack push the unconnected edges
    7864   UShort* pusUnconnectedEdgeStack = new UShort[ 4 * iWidth * iHeight ]; // approximate size calculation
    7865   Int iUnconnectedEdgeStackPtr = 0;
    7866   //// Vertical Edges
    7867   for( Int i = 0; i < 2 * iHeight - 1; i += 2 )
    7868   {
    7869     for( Int j = 1; j < 2 * iWidth - 2; j += 2 )
    7870     {
    7871       if( pbEdge[ j + i * 2 * iWidth ] )
    7872       {
    7873         if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) )
    7874         {
    7875           pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j);
    7876           iUnconnectedEdgeStackPtr++;
    7877         }
    7878       }
    7879     }
    7880   }
    7881 
    7882   //// Horizontal Edges
    7883   for( Int i = 1; i < 2 * iHeight - 2; i += 2 )
    7884   {
    7885     for( Int j = 0; j < 2 * iWidth - 1; j += 2 )
    7886     {
    7887       if( pbEdge[ j + i * 2 * iWidth ] )
    7888       {
    7889         if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) )
    7890         {
    7891           pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j);
    7892           iUnconnectedEdgeStackPtr++;
    7893         }
    7894       }
    7895     }
    7896   }
    7897 
    7898   /// Step2. Remove the edges from the stack and push the new unconnected edges
    7899   //// (This step may contain duplicated edges already in the stack)
    7900   //// (But it doesn't cause any functional problems)
    7901   while( iUnconnectedEdgeStackPtr != 0 )
    7902   {
    7903     iUnconnectedEdgeStackPtr--;
    7904     Int iX = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] & 0xff;
    7905     Int iY = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] >> 8;
    7906 
    7907     pbEdge[ iX + iY * 2 * iWidth ] = false;
    7908 
    7909     if( iY % 2 == 1 && iX > 0 && pbEdge[ iX - 2 + iY * 2 * iWidth ] &&
    7910       !xCheckTerminatedEdge( pbEdge, iX - 2, iY, iWidth, iHeight ) ) // left
    7911     {
    7912       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX - 2);
    7913       iUnconnectedEdgeStackPtr++;
    7914     }
    7915     if( iY % 2 == 1 && iX < 2 * iWidth - 2 && pbEdge[ iX + 2 + iY * 2 * iWidth ] &&
    7916       !xCheckTerminatedEdge( pbEdge, iX + 2, iY, iWidth, iHeight ) ) // right
    7917     {
    7918       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX + 2);
    7919       iUnconnectedEdgeStackPtr++;
    7920     }
    7921     if( iY % 2 == 0 && iY > 0 && pbEdge[ iX + (iY - 2) * 2 * iWidth ] &&
    7922       !xCheckTerminatedEdge( pbEdge, iX, iY - 2, iWidth, iHeight ) ) // top
    7923     {
    7924       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 2) << 8) | (iX + 0);
    7925       iUnconnectedEdgeStackPtr++;
    7926     }
    7927     if( iY % 2 == 0 && iY < 2 * iHeight - 2 && pbEdge[ iX + (iY + 2) * 2 * iWidth ] &&
    7928       !xCheckTerminatedEdge( pbEdge, iX, iY + 2, iWidth, iHeight ) ) // bottom
    7929     {
    7930       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 2) << 8) | (iX + 0);
    7931       iUnconnectedEdgeStackPtr++;
    7932     }
    7933     if( iX > 0 && iY > 0 && pbEdge[ iX - 1 + (iY - 1) * 2 * iWidth ] &&
    7934       !xCheckTerminatedEdge( pbEdge, iX - 1, iY - 1, iWidth, iHeight ) ) // left-top
    7935     {
    7936       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX - 1);
    7937       iUnconnectedEdgeStackPtr++;
    7938     }
    7939     if( iX < 2 * iWidth - 1 && iY > 0 && pbEdge[ iX + 1 + (iY - 1) * 2 * iWidth ] &&
    7940       !xCheckTerminatedEdge( pbEdge, iX + 1, iY - 1, iWidth, iHeight ) ) // right-top
    7941     {
    7942       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX + 1);
    7943       iUnconnectedEdgeStackPtr++;
    7944     }
    7945     if( iX > 0 && iY < 2 * iHeight - 1 && pbEdge[ iX - 1 + (iY + 1) * 2 * iWidth ] &&
    7946       !xCheckTerminatedEdge( pbEdge, iX - 1, iY + 1, iWidth, iHeight ) ) // left-bottom
    7947     {
    7948       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX - 1);
    7949       iUnconnectedEdgeStackPtr++;
    7950     }
    7951     if( iX < 2 * iWidth - 1 && iY < 2 * iHeight - 1 && pbEdge[ iX + 1 + (iY + 1) * 2 * iWidth ] &&
    7952       !xCheckTerminatedEdge( pbEdge, iX + 1, iY + 1, iWidth, iHeight ) ) // right-bottom
    7953     {
    7954       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX + 1);
    7955       iUnconnectedEdgeStackPtr++;
    7956     }
    7957   }
    7958 
    7959 
    7960   // Region Generation ( edge -> region )
    7961   Bool* pbRegion = pcCU->getEdgePartition( uiAbsPtIdx );
    7962   Bool* pbVisit  = new Bool[ iWidth * iHeight ];
    7963 
    7964   for( UInt ui = 0; ui < iWidth * iHeight; ui++ )
    7965   {
    7966     pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)
    7967     pbVisit [ ui ] = false;
    7968   }
    7969 
    7970   Int* piStack = new Int[ iWidth * iHeight ];
    7971 
    7972   Int iPtr = 0;
    7973 
    7974   piStack[iPtr++] = (0 << 8) | (0);
    7975   pbRegion[ 0 ] = false;
    7976 
    7977   while(iPtr > 0)
    7978   {
    7979     Int iTmp = piStack[--iPtr];
    7980     Int iX1, iY1;
    7981     iX1 = iTmp & 0xff;
    7982     iY1 = (iTmp >> 8) & 0xff;
    7983 
    7984     pbVisit[ iX1 + iY1 * iWidth ] = true;
    7985 
    7986     assert( iX1 >= 0 && iX1 < iWidth );
    7987     assert( iY1 >= 0 && iY1 < iHeight );
    7988 
    7989     if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )
    7990     {
    7991       piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);
    7992       pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;
    7993     }
    7994     if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )
    7995     {
    7996       piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);
    7997       pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;
    7998     }
    7999     if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )
    8000     {
    8001       piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;
    8002       pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;
    8003     }
    8004     if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )
    8005     {
    8006       piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;
    8007       pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;
    8008     }
    8009   }
    8010 
    8011   ///////////
    8012   iPtr = 0;
    8013   for( Int i = 0; i < iWidth * iHeight; i++ )
    8014     pbVisit[ i ] = false;
    8015   piStack[ iPtr++ ] = (0 << 8) | (0); // initial seed
    8016   while( iPtr > 0 && iPtr < iWidth * iHeight )
    8017   {
    8018     Int iX;
    8019     Int iY;
    8020     iPtr--;
    8021     iX = piStack[ iPtr ] & 0xff;
    8022     iY = piStack[ iPtr ] >> 8;
    8023     pbVisit[ iY * iWidth + iX ] = true;
    8024 
    8025     if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] )
    8026     {
    8027       piStack[ iPtr++ ] = ((iY - 1) << 8) | iX;
    8028     }
    8029     if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] )
    8030     {
    8031       piStack[ iPtr++ ] = ((iY + 1) << 8) | iX;
    8032     }
    8033     if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] )
    8034     {
    8035       piStack[ iPtr++ ] = (iY << 8) | (iX - 1);
    8036     }
    8037     if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] )
    8038     {
    8039       piStack[ iPtr++ ] = (iY << 8) | (iX + 1);
    8040     }
    8041   }
    8042   assert( iPtr == 0 || iPtr == iWidth * iHeight );
    8043 
    8044   Bool bBipartition;
    8045   if( iPtr == iWidth * iHeight )
    8046   {
    8047     bBipartition = false; // single partition
    8048   }
    8049   else
    8050   {
    8051     for( Int i = 0; i < iWidth * iHeight; i++ )
    8052     {
    8053       if( !pbVisit[ i ] )
    8054       {
    8055         piStack[ iPtr++ ] = (( i / iWidth ) << 8) | ( i % iWidth );
    8056         pbVisit[ i ] = true;
    8057         break;
    8058       }
    8059     }
    8060     while( iPtr > 0 )
    8061     {
    8062       Int iX;
    8063       Int iY;
    8064       iPtr--;
    8065       iX = piStack[ iPtr ] & 0xff;
    8066       iY = piStack[ iPtr ] >> 8;
    8067       pbVisit[ iY * iWidth + iX ] = true;
    8068 
    8069       if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] )
    8070       {
    8071         piStack[ iPtr++ ] = ((iY - 1) << 8) | iX;
    8072       }
    8073       if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] )
    8074       {
    8075         piStack[ iPtr++ ] = ((iY + 1) << 8) | iX;
    8076       }
    8077       if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] )
    8078       {
    8079         piStack[ iPtr++ ] = (iY << 8) | (iX - 1);
    8080       }
    8081       if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] )
    8082       {
    8083         piStack[ iPtr++ ] = (iY << 8) | (iX + 1);
    8084       }
    8085     }
    8086     bBipartition = true;
    8087     for( Int i = 0; i < iWidth * iHeight; i++ )
    8088     {
    8089       if( !pbVisit[ i ] )
    8090       {
    8091         bBipartition = false;
    8092         break;
    8093       }
    8094     }
    8095   }
    8096 
    8097   xFree( pbEdge );
    8098   delete[] pbEdgeX; pbEdgeX = NULL;
    8099   delete[] pbEdgeY; pbEdgeY = NULL;
    8100   delete[] psDiffX; psDiffX = NULL;
    8101   delete[] psDiffY; psDiffY = NULL;
    8102   delete[] pusUnconnectedEdgeStack; pusUnconnectedEdgeStack = NULL;
    8103   delete[] pbVisit; pbVisit = NULL;
    8104   delete[] piStack; piStack = NULL;
    8105 
    8106   if( bBipartition )
    8107   {
    8108     return xConstructChainCode( pcCU, uiAbsPtIdx, (UInt)iWidth, (UInt)iHeight );
    8109   }
    8110   else
    8111   {
    8112     return false;
    8113   }
    8114 }
    8115 
    8116 Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight )
    8117 {
    8118   if( (iY % 2) == 0 ) // vertical edge
    8119   {
    8120     Bool bTopConnected = false;
    8121     Bool bBottomConnected = false;
    8122 
    8123     if( iY != 0 )
    8124     {
    8125       if( pbEdge[ iX + (iY - 2) * 2 * iWidth ] )
    8126         bTopConnected = true;
    8127       if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] )
    8128         bTopConnected = true;
    8129       if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] )
    8130         bTopConnected = true;
    8131     }
    8132     else
    8133     {
    8134       bTopConnected = true;
    8135     }
    8136 
    8137 
    8138     if( iY != 2 * iHeight - 2 )
    8139     {
    8140       if( pbEdge[ iX + (iY + 2) * 2 * iWidth ] )
    8141         bBottomConnected = true;
    8142       if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] )
    8143         bBottomConnected = true;
    8144       if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] )
    8145         bBottomConnected = true;
    8146     }
    8147     else
    8148     {
    8149       bBottomConnected = true;
    8150     }
    8151 
    8152 
    8153     if( bTopConnected && bBottomConnected )
    8154     {
    8155       return true;
    8156     }
    8157     else
    8158     {
    8159       return false;
    8160     }
    8161   }
    8162   else
    8163   {
    8164     Bool bLeftConnected = false;
    8165     Bool bRightConnected = false;
    8166 
    8167     if( iX != 0 )
    8168     {
    8169       if( pbEdge[ (iX - 2) + iY * 2 * iWidth ] )
    8170         bLeftConnected = true;
    8171       if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] )
    8172         bLeftConnected = true;
    8173       if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] )
    8174         bLeftConnected = true;
    8175     }
    8176     else
    8177     {
    8178       bLeftConnected = true;
    8179     }
    8180 
    8181     if( iX != 2 * iWidth - 2 )
    8182     {
    8183       if( pbEdge[ (iX + 2) + iY * 2 * iWidth ] )
    8184         bRightConnected = true;
    8185       if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] )
    8186         bRightConnected = true;
    8187       if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] )
    8188         bRightConnected = true;
    8189     }
    8190     else
    8191     {
    8192       bRightConnected = true;
    8193     }
    8194 
    8195 
    8196     if( bLeftConnected && bRightConnected )
    8197     {
    8198       return true;
    8199     }
    8200     else
    8201     {
    8202       return false;
    8203     }
    8204   }
    8205 }
    8206 Bool TEncSearch::xConstructChainCode( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight )
    8207 {
    8208   //UInt   uiWidth    = pcCU->getWidth( uiPartIdx ) >> (bPU4x4 ? 1 : 0);
    8209   //UInt   uiHeight   = pcCU->getHeight( uiPartIdx ) >> (bPU4x4 ? 1 : 0);
    8210   Bool*  pbEdge     = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 );
    8211   Bool*  pbVisit    = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 );
    8212   UInt   uiMaxEdge  = uiWidth * (RBC_MAX_EDGE_NUM_PER_4x4 / 4);
    8213   Bool*  pbRegion   = pcCU->getEdgePartition( uiAbsPtIdx );
    8214   UChar* piEdgeCode = pcCU->getEdgeCode( uiAbsPtIdx );
    8215   Bool   bStartLeft = false;
    8216   Bool   bPossible  = false;
    8217   Bool   bFinish    = false;
    8218   Int    iStartPosition = -1;
    8219   Int    iPtr = 0;
    8220   Int    iDir = -1, iNextDir = -1;
    8221   Int    iArrow = -1, iNextArrow = -1;
    8222   Int    iX = -1, iY = -1;
    8223   Int    iDiffX = 0, iDiffY = 0;
    8224   UChar  iCode = 255;
    8225   UInt   uiWidth2 = uiWidth * 2;
    8226 
    8227   for( Int i = 0; i < uiWidth * uiHeight * 4; i++ )
    8228     pbEdge[ i ] = false;
    8229 
    8230   for( Int i = 0; i < uiHeight; i++ )
    8231   {
    8232     for( Int j = 0; j < uiWidth - 1; j++ )
    8233     {
    8234       if( pbRegion[ i * uiWidth + j ] != pbRegion[ i * uiWidth + j + 1 ] )
    8235         pbEdge[ i * uiWidth * 4 + j * 2 + 1 ] = true;
    8236     }
    8237   }
    8238 
    8239   for( Int i = 0; i < uiHeight - 1; i++ )
    8240   {
    8241     for( Int j = 0; j < uiWidth; j++ )
    8242     {
    8243       if( pbRegion[ (i + 0) * uiWidth + j ] != pbRegion[ (i + 1) * uiWidth + j ] )
    8244         pbEdge[ (2 * i + 1) * 2 * uiWidth + j * 2 ] = true;
    8245     }
    8246   }
    8247 
    8248   for( Int i = 1; i < uiWidth2 - 2; i+=2 )
    8249   {
    8250     if(pbEdge[ i ])
    8251     {
    8252       bPossible  = true;
    8253       bStartLeft = false;
    8254       iStartPosition = iX = i;
    8255       iY = 0;
    8256       iDir = 3;
    8257       iArrow = 3;
    8258       break;
    8259     }
    8260   }
    8261 
    8262   if( !bPossible )
    8263   {
    8264     for( Int i = 1; i < uiWidth2 - 2; i+=2 )
    8265     {
    8266       if(pbEdge[ i * uiWidth2 ])
    8267       {
    8268         bPossible  = true;
    8269         bStartLeft = true;
    8270         iX = 0;
    8271         iStartPosition = iY = i;
    8272         iDir = 1;
    8273         iArrow = 1;
    8274         break;
    8275       }
    8276     }
    8277   }
    8278 
    8279   if( bPossible )
    8280   {
    8281     for( Int i = 0; i < 4 * uiWidth * uiHeight; i++ )
    8282       pbVisit[ i ] = false;
    8283 
    8284     while( !bFinish )
    8285     {
    8286       Bool bArrowSkip = false;
    8287       pbVisit[ iX + iY * uiWidth2 ] = true;
    8288 
    8289       switch( iDir )
    8290       {
    8291       case 0: // left
    8292         if( iX > 0 && !pbVisit[ (iX - 2) + iY * uiWidth2 ] && pbEdge[ (iX - 2) + iY * uiWidth2 ] ) // left
    8293         {
    8294           iDiffX = -2;
    8295           iDiffY =  0;
    8296           iNextDir = 0;
    8297           iNextArrow = 0;
    8298         }
    8299         else if( iX > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // top
    8300         {
    8301           iDiffX = -1;
    8302           iDiffY = -1;
    8303           iNextDir = 2;
    8304           iNextArrow = 4;
    8305         }
    8306         else if( iX > 0 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // bottom
    8307         {
    8308           iDiffX = -1;
    8309           iDiffY = +1;
    8310           iNextDir = 3;
    8311           iNextArrow = iArrow;
    8312           if( !(iPtr == 0 && iX == uiWidth2 - 2 && iY == uiHeight * 2 - 3) )
    8313             bArrowSkip = true;
    8314           else
    8315             iNextArrow = 3;
    8316         }
    8317         else if( iX == 0 )
    8318         {
    8319           iDiffX = 0;
    8320           iDiffY = 0;
    8321           iNextDir = iDir;
    8322           iNextArrow = iArrow;
    8323           bFinish = true;
    8324           continue;
    8325         }
    8326         else
    8327         {
    8328           iPtr = 0; // edge loop or unwanted case
    8329           bFinish = true;
    8330           //continue;
    8331           assert(false);
    8332         }
    8333         break;
    8334       case 1: // right
    8335         if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 2) + iY * uiWidth2 ] && pbEdge[ (iX + 2) + iY * uiWidth2 ] ) // right
    8336         {
    8337           iDiffX = +2;
    8338           iDiffY =  0;
    8339           iNextDir = 1;
    8340           iNextArrow = 1;
    8341         }
    8342         else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // top
    8343         {
    8344           iDiffX = +1;
    8345           iDiffY = -1;
    8346           iNextDir = 2;
    8347           iNextArrow = iArrow;
    8348           if( !(iPtr == 0 && iX == 0 && iY == 1) )
    8349             bArrowSkip = true;
    8350           else
    8351             iNextArrow = 2;
    8352         }
    8353         else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // bottom
    8354         {
    8355           iDiffX = +1;
    8356           iDiffY = +1;
    8357           iNextDir = 3;
    8358           iNextArrow = 7;
    8359         }
    8360         else if( iX == uiWidth2 - 2 )
    8361         {
    8362           iDiffX = 0;
    8363           iDiffY = 0;
    8364           iNextDir = iDir;
    8365           iNextArrow = iArrow;
    8366           bFinish = true;
    8367           continue;
    8368         }
    8369         else
    8370         {
    8371           iPtr = 0; // edge loop or unwanted case
    8372           bFinish = true;
    8373           //continue;
    8374           assert(false);
    8375         }
    8376         break;
    8377       case 2: // top
    8378         if( iY > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // left
    8379         {
    8380           iDiffX = -1;
    8381           iDiffY = -1;
    8382           iNextDir = 0;
    8383           iNextArrow = iArrow;
    8384           if( !(iPtr == 0 && iX == 1 && iY == uiHeight * 2 - 2) )
    8385             bArrowSkip = true;
    8386           else
    8387             iNextArrow = 0;
    8388         }
    8389         else if( iY > 0 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // right
    8390         {
    8391           iDiffX = +1;
    8392           iDiffY = -1;
    8393           iNextDir = 1;
    8394           iNextArrow = 5;
    8395         }
    8396         else if( iY > 0 && !pbVisit[ iX + (iY - 2) * uiWidth2 ] && pbEdge[ iX + (iY - 2) * uiWidth2 ] ) // top
    8397         {
    8398           iDiffX =  0;
    8399           iDiffY = -2;
    8400           iNextDir = 2;
    8401           iNextArrow = 2;
    8402         }
    8403         else if( iY == 0 )
    8404         {
    8405           iDiffX = 0;
    8406           iDiffY = 0;
    8407           iNextDir = iDir;
    8408           iNextArrow = iArrow;
    8409           bFinish = true;
    8410           continue;
    8411         }
    8412         else
    8413         {
    8414           iPtr = 0; // edge loop or unwanted case
    8415           bFinish = true;
    8416           //continue;
    8417           assert(false);
    8418         }
    8419         break;
    8420       case 3: // bottom
    8421         if( iY < uiWidth2 - 2 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // left
    8422         {
    8423           iDiffX = -1;
    8424           iDiffY = +1;
    8425           iNextDir = 0;
    8426           iNextArrow = 6;
    8427         }
    8428         else if( iY < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // right
    8429         {
    8430           iDiffX = +1;
    8431           iDiffY = +1;
    8432           iNextDir = 1;
    8433           iNextArrow = iArrow;
    8434           if( !(iPtr == 0 && iX == uiWidth * 2 - 3 && iY == 0) )
    8435             bArrowSkip = true;
    8436           else
    8437             iNextArrow = 1;
    8438         }
    8439         else if( iY < uiWidth2 - 2 && !pbVisit[ iX + (iY + 2) * uiWidth2 ] && pbEdge[ iX + (iY + 2) * uiWidth2 ] ) // bottom
    8440         {
    8441           iDiffX =  0;
    8442           iDiffY = +2;
    8443           iNextDir = 3;
    8444           iNextArrow = 3;
    8445         }
    8446         else if( iY == uiWidth2 - 2 )
    8447         {
    8448           iDiffX = 0;
    8449           iDiffY = 0;
    8450           iNextDir = iDir;
    8451           iNextArrow = iArrow;
    8452           bFinish = true;
    8453           continue;
    8454         }
    8455         else
    8456         {
    8457           iPtr = 0; // edge loop or unwanted case
    8458           bFinish = true;
    8459           //continue;
    8460           assert(false);
    8461         }
    8462         break;
    8463       }
    8464 
    8465       const UChar tableCode[8][8] = { { 0, -1, 4, 3, 2, 6, 1, 5 }, // iArrow(current direction), iNextArrow(next direction)
    8466       { -1, 0, 3, 4, 5, 1, 6, 2 },
    8467       { 3, 4, 0, -1, 1, 2, 5, 6 },
    8468       { 4, 3, -1, 0, 6, 5, 2, 1 },
    8469       { 1, 6, 2, 5, 0, 4, 3, -1 },
    8470       { 5, 2, 1, 6, 3, 0, -1, 4 },
    8471       { 2, 5, 6, 1, 4, -1, 0, 3 },
    8472       { 6, 1, 5, 2, -1, 3, 4, 0 } };
    8473 
    8474       iCode = tableCode[iArrow][iNextArrow];
    8475 
    8476       if(iPtr >= uiMaxEdge)
    8477       {
    8478         iPtr = 0; // over the maximum number of edge
    8479         bPossible = false;
    8480         break;
    8481       }
    8482 
    8483       if( !bArrowSkip )
    8484       {
    8485         piEdgeCode[iPtr++] = iCode; // first edge coding
    8486         //printf("xEdgeCoding: (%d,%d)->(%d,%d) code %d\n",iX,iY, iX+iDiffX, iY+iDiffY, iCode);
    8487       }
    8488 
    8489       iX += iDiffX;
    8490       iY += iDiffY;
    8491       iDir = iNextDir;
    8492       iArrow = iNextArrow;
    8493     }
    8494   }
    8495 
    8496   pcCU->setEdgeLeftFirst( uiAbsPtIdx, bStartLeft );
    8497   pcCU->setEdgeStartPos ( uiAbsPtIdx, bStartLeft ? (iStartPosition - 1) >> 1 : (iStartPosition + 1) >> 1);
    8498   pcCU->setEdgeNumber   ( uiAbsPtIdx, iPtr );
    8499 
    8500   xFree( pbEdge );
    8501   xFree( pbVisit );
    8502 
    8503   return (iPtr != 0);
    8504 }
    8505 #endif
     7387
     7388#endif
     7389
    85067390#endif
    85077391//! \}
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r724 r773  
    351351  Void xSearchDmmDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
    352352  Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
    353 #if !SEC_DMM3_RBC_F0147
    354   Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );
    355 #endif
    356 #endif
    357 #if H_3D_DIM_RBC
    358   Void xSearchRbcDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
    359   Bool xSearchRbcEdge             ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride,  Int  iWidth,  Int  iHeight );
    360  
    361   Bool xCheckTerminatedEdge       ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight );
    362   Bool xConstructChainCode        ( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight );
    363353#endif
    364354#if H_3D_DIM_SDC
     
    427417                                  , InheritedVSPDisInfo*  inheritedVSPDisInfo
    428418#endif
    429 #if MTK_SPIVMP_F0110
     419#if H_3D_SPIVMP
    430420                                  , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    431421#endif
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r724 r773  
    556556  rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
    557557#if H_3D_IV_MERGE
    558 #if SEC_MPI_ENABLING_MERGE_F0150
    559558  if(rpcSlice->getIsDepth())
    560559  {
     
    565564    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );
    566565  }
    567 #else
    568    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );
    569 #endif
    570566#else
    571567  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r758 r773  
    299299{
    300300  // initialize SPS
    301 #if DLT_DIFF_CODING_IN_PPS
     301#if H_3D
    302302  // Assuming that all PPS indirectly refer to the same VPS via different SPS
    303303  m_cSPS.setVPS(m_cVPS);
     
    723723
    724724#if H_MV 
    725 #if H_MV_6_PS_REP_FORM_18_19_20
    726725  m_cSPS.setUpdateRepFormatFlag           ( false );   
    727 #else
    728   m_cSPS.setUpdateRepFormatFlag           ( m_layerId == 0 );   
    729 #endif
    730726  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) );
    731727  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
    732 #if H_MV_6_PSEM_O0142_3
    733728  m_cSPS.setSpsExtensionFlag              ( true );
    734729  m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_MV ,true );
    735730#if H_3D
    736731  m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_3D ,true );
    737 #endif
    738732#endif
    739733#endif
     
    823817    pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
    824818    pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
    825 #if H_MV_6_PS_O0118_33
     819#if H_MV
    826820    pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 );
    827821#else
    828     pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
     822   pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
    829823#endif
    830824    pcVUI->setVideoFormat(getVideoFormat());
     
    853847    pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical());
    854848  }
    855 #if H_3D
    856 #if !CAM_HLS_F0136_F0045_F0082
    857 #if !QC_DEPTH_IV_MRG_F0125
    858   if ( !m_isDepth )
    859 #endif
    860   {
    861     m_cSPS.initCamParaSPS           ( m_viewIndex, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
    862   }
    863 #endif
    864 #endif
    865849}
    866850
     
    877861#endif
    878862
    879 #if DLT_DIFF_CODING_IN_PPS
     863#if H_3D
    880864  m_cPPS.setDLT( getDLT() );
    881865#endif
     
    948932  m_cPPS.setOutputFlagPresentFlag( false );
    949933#if H_MV
    950 #if H_MV_6_RALS_O0149_11
    951934  m_cPPS.setNumExtraSliceHeaderBits( 3 );
    952 #else
    953   m_cPPS.setNumExtraSliceHeaderBits( 2 );
    954 #endif
    955935#endif
    956936  m_cPPS.setSignHideFlag(getSignHideFlag());
     
    1012992  }
    1013993#if H_3D
    1014 #if CAM_HLS_F0136_F0045_F0082
    1015994  if( m_cVPS->hasCamParInSliceHeader( getViewIndex() ) )
    1016 #else
    1017   if( m_cSPS.hasCamParInSliceHeader() )
    1018 #endif
    1019995  {
    1020996    m_cPPS.setSliceHeaderExtensionPresentFlag( true );
Note: See TracChangeset for help on using the changeset viewer.