Ignore:
Timestamp:
15 Apr 2015, 11:36:33 (10 years ago)
Author:
tech
Message:

Removed 3D-HEVC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.0-MV-draft-3/source/Lib/TLibCommon/TComSlice.cpp

    r1179 r1191  
    110110, m_viewId                        (0)
    111111, m_viewIndex                     (0)
    112 #if H_3D
    113 , m_isDepth                       (false)
    114 #endif
    115112#if !H_MV_HLS7_GEN
    116113, m_pocResetFlag                  (false)
     
    132129, m_pocMsbValRequiredFlag         ( false )
    133130#endif
    134 #if H_3D_IC
    135 , m_bApplyIC                      ( false )
    136 , m_icSkipParseFlag               ( false )
    137 #endif
    138 #if H_3D
    139 #if HHI_INTER_COMP_PRED_K0052
    140 , m_inCmpPredFlag                 ( false )
    141 #endif
    142 #if HHI_CAM_PARA_K0052
    143 , m_numViews                        ( 0    )
    144 #endif
    145 , m_depthToDisparityB             ( NULL )
    146 , m_depthToDisparityF             ( NULL )
    147 #endif
    148 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
    149 , m_bApplyDIS                     (false)
    150 #else
    151 #if H_3D_SINGLE_DEPTH
    152 , m_bApplySingleDepthMode         (false)
    153 #endif
    154 #endif
    155131#endif
    156132{
     
    191167  m_iDefaultRefViewIdx = -1;
    192168  m_bDefaultRefViewIdxAvailableFlag = false;
    193 #if HHI_INTER_COMP_PRED_K0052
    194   m_ivMvPredFlag           = false;
    195   m_ivMvScalingFlag        = false;
    196   m_ivResPredFlag          = false; 
    197   m_depthRefinementFlag    = false;
    198   m_viewSynthesisPredFlag  = false;
    199   m_depthBasedBlkPartFlag  = false;
    200   m_mpiFlag                = false;
    201   m_intraContourFlag       = false;
    202   m_intraSdcWedgeFlag      = false;
    203   m_qtPredFlag             = false;
    204   m_interSdcFlag           = false;
    205   m_depthIntraSkipFlag     = false;
    206   m_subPbSize              =  1 << 6;
    207   m_mpiSubPbSize           =  1 << 6;
    208 #endif
    209169}
    210170
     
    213173  delete[] m_puiSubstreamSizes;
    214174  m_puiSubstreamSizes = NULL;
    215 #if H_3D
    216 #if HHI_CAM_PARA_K0052   
    217   for( UInt i = 0; i < m_numViews; i++ )
    218 #else
    219   for( UInt i = 0; i < getViewIndex(); i++ )
    220 #endif
    221   {
    222     if ( m_depthToDisparityB && m_depthToDisparityB[ i ] )
    223     {
    224       delete[] m_depthToDisparityB [ i ];
    225     }
    226 
    227     if ( m_depthToDisparityF && m_depthToDisparityF[ i ] )
    228     {
    229       delete[] m_depthToDisparityF [ i ];
    230     }
    231   }
    232 
    233   if ( m_depthToDisparityF )
    234   {
    235     delete[] m_depthToDisparityF;
    236   }
    237 
    238   m_depthToDisparityF = NULL;
    239 
    240   if ( m_depthToDisparityB )
    241     delete[] m_depthToDisparityB;
    242 
    243   m_depthToDisparityB = NULL;
    244 #endif
    245175}
    246176
     
    259189  m_iSliceQpDeltaCr = 0;
    260190
    261 #if H_3D_IV_MERGE
    262   m_maxNumMergeCand = MRG_MAX_NUM_CANDS_MEM;
    263 #else
    264191  m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
    265 #endif
    266192
    267193  m_bFinalized=false;
     
    271197  m_numEntryPointOffsets = 0;
    272198  m_enableTMVPFlag = true;
    273 #if H_3D_TMVP
    274   m_aiAlterRefIdx[0]                  = -1;
    275   m_aiAlterRefIdx[1]                  = -1;
    276 #endif
    277199}
    278200
     
    605527  Int i;
    606528
    607 #if HHI_RES_PRED_K0052
    608   m_pocsInCurrRPSs.clear();
    609 #endif
    610529
    611530  for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
     
    619538      NumPocStCurr0++;
    620539      pcRefPic->setCheckLTMSBPresent(false); 
    621 #if HHI_RES_PRED_K0052
    622       m_pocsInCurrRPSs.push_back( pcRefPic->getPOC() );
    623 #endif
    624540    }
    625541  }
     
    635551      NumPocStCurr1++;
    636552      pcRefPic->setCheckLTMSBPresent(false); 
    637 #if HHI_RES_PRED_K0052
    638       m_pocsInCurrRPSs.push_back( pcRefPic->getPOC() );
    639 #endif
    640553    }
    641554  }
     
    650563      RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;
    651564      NumPocLtCurr++;
    652 #if HHI_RES_PRED_K0052
    653       m_pocsInCurrRPSs.push_back( pcRefPic->getPOC() );
    654 #endif
    655565    }
    656566    if(pcRefPic==NULL)
     
    662572
    663573  Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
    664 #if HHI_RES_PRED_K0052
    665   assert( numPocInterCurr == (Int) m_pocsInCurrRPSs.size() );
    666 #endif
    667574  numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( );
    668575  assert( numPocTotalCurr == getNumRpsCurrTempList() );
     
    812719  }
    813720}
    814 #if H_3D
    815 #if H_3D_TMVP
    816 Void TComSlice::generateAlterRefforTMVP()
    817 {
    818   for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    819   {       
    820     if ( this->getNumRefIdx( RefPicList( uiRefListIdx ) ) == 0)
    821     {
    822         continue;
    823     }
    824     Bool bZeroIdxLtFlag = this->getRefPic(RefPicList(uiRefListIdx), 0)->getIsLongTerm();
    825     for(Int i = 1; i < this->getNumRefIdx(RefPicList(uiRefListIdx)); i++ )
    826     {
    827       if ( ( bZeroIdxLtFlag && !this->getRefPic(RefPicList(uiRefListIdx), i)->getIsLongTerm() ) ||
    828            (!bZeroIdxLtFlag &&  this->getRefPic(RefPicList(uiRefListIdx), i)->getIsLongTerm() ) )
    829       {
    830         this->setAlterRefIdx(RefPicList(uiRefListIdx),i);
    831         break;
    832       }
    833     }
    834   }
    835 }
    836 #endif
    837 Void TComSlice::setCamparaSlice( Int** aaiScale, Int** aaiOffset )
    838 
    839 #if HHI_CAM_PARA_K0052
    840   Int voiInVps      = m_pcVPS->getVoiInVps(getViewIndex() );
    841   if( m_pcVPS->getNumCp( voiInVps ) > 0 )
    842   {   
    843     if( m_pcVPS->getCpInSliceSegmentHeaderFlag( voiInVps ) )
    844     {
    845       for( Int m = 0; m < m_pcVPS->getNumCp( voiInVps ); m++ )
    846       {     
    847         Int j      = m_pcVPS->getCpRefVoi( voiInVps, m );
    848         Int jInVps = m_pcVPS->getVoiInVps( j );
    849 
    850         setCpScale   ( jInVps , aaiScale [ jInVps   ][ voiInVps ]);
    851         setCpInvScale( jInVps , aaiScale [ voiInVps ][ jInVps   ]);
    852         setCpOff     ( jInVps , aaiOffset[ jInVps   ][ voiInVps ]);
    853         setCpInvOff  ( jInVps , aaiOffset[ voiInVps ][ jInVps   ]);
    854       }
    855     }
    856   }
    857 #else
    858   if( m_pcVPS->hasCamParInSliceHeader( m_viewIndex ) )
    859   {   
    860     for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < m_viewIndex; uiBaseViewIndex++ )
    861     {
    862       m_aaiCodedScale [ 0 ][ uiBaseViewIndex ] = aaiScale [ uiBaseViewIndex ][     m_viewIndex ];
    863       m_aaiCodedScale [ 1 ][ uiBaseViewIndex ] = aaiScale [     m_viewIndex ][ uiBaseViewIndex ];
    864       m_aaiCodedOffset[ 0 ][ uiBaseViewIndex ] = aaiOffset[ uiBaseViewIndex ][     m_viewIndex ];
    865       m_aaiCodedOffset[ 1 ][ uiBaseViewIndex ] = aaiOffset[     m_viewIndex ][ uiBaseViewIndex ];
    866     }
    867   }
    868 #endif
    869 }
    870 #endif
    871721
    872722Void TComSlice::checkColRefIdx(UInt curSliceIdx, TComPic* pic)
     
    11641014    m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ];
    11651015  }
    1166 #endif
    1167 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
    1168   m_bApplyDIS = pSrc->m_bApplyDIS;
    1169 #else
    1170 #if H_3D_SINGLE_DEPTH
    1171   m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode;
    1172 #endif
    1173 #endif
    1174 #if H_3D_IC
    1175   m_bApplyIC = pSrc->m_bApplyIC;
    1176   m_icSkipParseFlag = pSrc->m_icSkipParseFlag;
    11771016#endif
    11781017}
     
    20201859    m_layerIdInNuh      [i] = ( i == 0 ) ? 0 : -1;
    20211860    m_numDirectRefLayers[i] = 0;
    2022 #if H_3D
    2023     m_numRefListLayers[i] = 0;
    2024 #endif
    20251861    m_vpsRepFormatIdx    [i] = 0;
    20261862    m_pocLsbNotPresentFlag[i] = 0;
     
    20281864    m_viewIdVal          [i] = 0;
    20291865
    2030 #if H_3D
    2031     m_viewIndex         [i] = -1;
    2032 #endif
    20331866
    20341867    for( Int j = 0; j < MAX_NUM_LAYERS; j++ )
     
    20381871      m_dependencyFlag  [i][j]    = false;
    20391872      m_idDirectRefLayer[i][j]    = -1;
    2040 #if H_3D
    2041       m_idRefListLayer[i][j]    = -1;
    2042 #endif
    20431873      m_idPredictedLayer[i][j]    = -1;
    20441874      m_idRefLayer      [i][j]    = -1;
     
    20501880      m_dimensionId[i][j] = 0;
    20511881    }
    2052 #if H_3D_ARP
    2053 #endif
    20541882  }
    20551883  m_vpsVUI = new TComVPSVUI;
     
    20741902  }
    20751903#endif
    2076 #if H_3D
    2077   deleteCamPars();
    2078 #endif
    20791904}
    20801905
     
    21461971    Int iNuhLId = getLayerIdInNuh( i );
    21471972    Int d = 0;
    2148 #if H_3D
    2149     Int l = 0;
    2150 #endif
    21511973    Int r = 0;
    21521974    Int p = 0;
     
    21591981        m_idDirectRefLayer[iNuhLId][d++] = jNuhLid;
    21601982      }
    2161 #if H_3D
    2162       if( getDirectDependencyFlag( i , j ) && ( getDepthId( iNuhLId ) == getDepthId( jNuhLid ) ))
    2163       {
    2164         m_idRefListLayer [iNuhLId][l++] = jNuhLid;
    2165       }
    2166 #endif
    21671983
    21681984      if( getDependencyFlag( i , j ) )
     
    21761992    }
    21771993    m_numDirectRefLayers[ iNuhLId ] = d;
    2178 #if H_3D
    2179     m_numRefListLayers[ iNuhLId ] = l;
    2180 #endif
    21811994
    21821995    m_numRefLayers      [ iNuhLId ] = r;
     
    22172030{
    22182031  m_numViews = 1;
    2219 #if HHI_VIEW_ID_LIST_I5_J0107 || HHI_INTER_COMP_PRED_K0052
    2220 #if H_3D
    2221   AOF( m_viewOIdxList.size() == 0 );
    2222  
    2223   m_viewOIdxList.push_back( 0 );       
    2224 #endif
    2225 #endif
    22262032
    22272033  for( Int i = 0; i <=  getMaxLayersMinus1(); i++ )
     
    22412047      {
    22422048        m_numViews++;
    2243 #if HHI_VIEW_ID_LIST_I5_J0107  || HHI_INTER_COMP_PRED_K0052
    2244 #if H_3D
    2245         m_viewOIdxList.push_back( getViewOrderIdx( lId ) );       
    2246 #endif
    2247 #endif
    22482049      }
    22492050    }
     
    22572058}
    22582059
    2259 #if H_3D
    2260 Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag )
    2261 {
    2262   Int foundLayerIdinNuh = -1;
    2263 
    2264   for (Int layerIdInVps = 0 ; layerIdInVps <= getMaxLayersMinus1(); layerIdInVps++ )
    2265   {
    2266     Int layerIdInNuh = getLayerIdInNuh( layerIdInVps );
    2267     if( ( getViewIndex( layerIdInNuh ) == viewIndex ) && ( getDepthId( layerIdInNuh ) == ( depthFlag ? 1 : 0 ) )  )
    2268     {
    2269       foundLayerIdinNuh = layerIdInNuh;
    2270       break;
    2271     }
    2272   }
    2273 #if !BUG_FIX_TK65
    2274   assert( foundLayerIdinNuh != -1 );
    2275 #endif
    2276   return foundLayerIdinNuh;
    2277 }
    2278 
    2279 Void TComVPS::createCamPars(Int iNumViews)
    2280 {
    2281   Int i = 0, j = 0;
    2282 
    2283 #if HHI_CAM_PARA_K0052
    2284   m_numCp    = new Int [ iNumViews ];
    2285   m_cpRefVoi = new Int*[ iNumViews ];
    2286   m_cpInSliceSegmentHeaderFlag = new Bool[ iNumViews ];
    2287 
    2288   m_cpPresentFlag  = new Bool*[ iNumViews ];
    2289 #else
    2290   m_bCamParPresent = new Bool[ iNumViews ];
    2291   m_bCamParInSliceHeader = new Bool[ iNumViews ];
    2292 #endif
    2293  
    2294 
    2295   m_aaaiCodedScale = new Int**[ iNumViews ];
    2296   m_aaaiCodedOffset = new Int**[ iNumViews ];
    2297   for ( i = 0; i < iNumViews ; i++ )
    2298   {
    2299 #if HHI_CAM_PARA_K0052
    2300     m_cpInSliceSegmentHeaderFlag[i] = false;     
    2301 #else
    2302     m_bCamParPresent[i] = false;
    2303     m_bCamParInSliceHeader[i] = false;
    2304 #endif
    2305    
    2306     m_aaaiCodedScale[i] = new Int*[ 2 ];
    2307     m_aaaiCodedOffset[i] = new Int*[ 2 ];
    2308 
    2309 #if HHI_CAM_PARA_K0052
    2310     m_numCp   [i] = 0;
    2311     m_cpRefVoi[i] = new Int[ iNumViews ];
    2312     m_cpPresentFlag[i] = new Bool[ iNumViews ];
    2313     for ( j = 0; j < iNumViews; j++)
    2314     {
    2315       m_cpRefVoi[i][j] = 0;
    2316       m_cpPresentFlag[i][j] = false;
    2317     }
    2318 #endif
    2319     for ( j = 0; j < 2; j++ )
    2320     {
    2321       m_aaaiCodedScale[i][j] = new Int[ MAX_NUM_LAYERS ];
    2322       m_aaaiCodedOffset[i][j] = new Int[ MAX_NUM_LAYERS ];
    2323       for ( Int k = 0; k < MAX_NUM_LAYERS; k++ )
    2324       {
    2325         m_aaaiCodedScale[i][j][k] = 0;
    2326         m_aaaiCodedOffset[i][j][k] = 0;
    2327       }
    2328     }
    2329   }
    2330 }
    2331 
    2332 Void TComVPS::deleteCamPars()
    2333 {
    2334   Int iNumViews = getNumViews();
    2335   Int i = 0, j = 0;
    2336 
    2337 #if !HHI_CAM_PARA_K0052
    2338   if ( m_bCamParPresent != NULL )
    2339   {
    2340     delete [] m_bCamParPresent;
    2341   }
    2342   if ( m_bCamParInSliceHeader != NULL )
    2343   {
    2344     delete [] m_bCamParInSliceHeader;
    2345   }
    2346 #else
    2347   if ( m_numCp != NULL )
    2348   {
    2349     delete [] m_numCp;
    2350   }
    2351 
    2352   if ( m_cpRefVoi != NULL )
    2353   {
    2354     for ( i = 0; i < iNumViews ; i++ )
    2355     {
    2356       delete [] m_cpRefVoi[i];
    2357     }
    2358     delete[] m_cpRefVoi;
    2359   }
    2360 
    2361   if ( m_cpPresentFlag != NULL )
    2362   {
    2363     for ( i = 0; i < iNumViews ; i++ )
    2364     {
    2365       delete [] m_cpPresentFlag[i];
    2366     }
    2367     delete[] m_cpPresentFlag;
    2368   }
    2369 
    2370 
    2371   if ( m_cpInSliceSegmentHeaderFlag != NULL )
    2372   {
    2373     delete [] m_cpInSliceSegmentHeaderFlag;
    2374   }
    2375 #endif
    2376 
    2377 
    2378   if ( m_aaaiCodedScale != NULL )
    2379   {
    2380     for ( i = 0; i < iNumViews ; i++ )
    2381     {
    2382       for ( j = 0; j < 2; j++ )
    2383       {
    2384         delete [] m_aaaiCodedScale[i][j];
    2385       }
    2386       delete [] m_aaaiCodedScale[i];
    2387     }
    2388     delete [] m_aaaiCodedScale;
    2389   }
    2390 
    2391   if ( m_aaaiCodedOffset != NULL )
    2392   {
    2393     for ( i = 0; i < iNumViews ; i++ )
    2394     {
    2395       for ( j = 0; j < 2; j++ )
    2396       {
    2397         delete [] m_aaaiCodedOffset[i][j];
    2398       }
    2399       delete [] m_aaaiCodedOffset[i];
    2400     }
    2401     delete [] m_aaaiCodedOffset;
    2402   }
    2403 }
    2404 
    2405 
    2406 #if !HHI_CAM_PARA_K0052
    2407 Void TComVPS::initCamParaVPS( UInt uiViewIndex, Bool bCamParPresent, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
    2408 {
    2409   AOT( uiViewIndex != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) ); 
    2410 
    2411   m_uiCamParPrecision = ( ( uiViewIndex != 0 )? uiCamParPrecision : 0 );
    2412   m_bCamParPresent[ uiViewIndex ] = (( uiViewIndex != 0 )? bCamParPresent  : false );
    2413   m_bCamParInSliceHeader[ uiViewIndex ]  = ( (uiViewIndex != 0)? bCamParSlice  : false );
    2414 
    2415   if( !m_bCamParInSliceHeader[ uiViewIndex ] )
    2416   {
    2417     for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < uiViewIndex; uiBaseViewIndex++ )
    2418     {
    2419       m_aaaiCodedScale [ uiViewIndex ][ 0 ][ uiBaseViewIndex ] = aaiScale [ uiBaseViewIndex ][     uiViewIndex ];
    2420       m_aaaiCodedScale [ uiViewIndex ][ 1 ][ uiBaseViewIndex ] = aaiScale [     uiViewIndex ][ uiBaseViewIndex ];
    2421       m_aaaiCodedOffset[ uiViewIndex ][ 0 ][ uiBaseViewIndex ] = aaiOffset[ uiBaseViewIndex ][     uiViewIndex ];
    2422       m_aaaiCodedOffset[ uiViewIndex ][ 1 ][ uiBaseViewIndex ] = aaiOffset[     uiViewIndex ][ uiBaseViewIndex ];
    2423     }
    2424   }
    2425 }
    2426 #endif
    2427 
    2428 #endif // H_3D
    24292060
    24302061
     
    26792310  vector<Int> range;
    26802311
    2681 #if H_3D
    2682   vector<Int> depthId;
    2683 #endif
    26842312
    26852313  vector<Int> viewOrderIndex;
     
    26952323    auxId         .push_back( getAuxId       ( i ) );     
    26962324    viewId        .push_back( getViewId      ( getLayerIdInNuh( i ) ) );
    2697 #if H_3D 
    2698     depthId.push_back( getDepthId( i ) );
    2699 #endif
    27002325  }
    27012326  std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Dependencies" << std::endl;
     
    27062331  xPrintArray( "IdRefLayer"      , getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefLayers, m_idRefLayer, true );
    27072332  xPrintArray( "IdDirectRefLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numDirectRefLayers, m_idDirectRefLayer, true );
    2708 #if H_3D
    2709   xPrintArray( "IdRefListLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefListLayers, m_idRefListLayer, true );
    2710 #endif
    27112333
    27122334  std::cout << std::endl;
     
    27172339  vector<Int> layerIdxInVps;
    27182340
    2719 #if H_3D
    2720   vector<Int> depthId;
    2721 #endif
    27222341
    27232342  vector<Int> viewOrderIndex;
     
    27342353    auxId         .push_back( getAuxId       ( layerIdInNuh ) );     
    27352354    viewId        .push_back( getViewId      ( layerIdInNuh ) );
    2736 #if H_3D 
    2737     depthId       .push_back( getDepthId     ( layerIdInNuh ) );
    2738 #endif
    27392355  }
    27402356
     
    28582474, m_interViewMvVertConstraintFlag (false)
    28592475#endif
    2860 #if H_3D
    2861 #if !HHI_CAM_PARA_K0052
    2862 , m_bCamParInSliceHeader      (false)
    2863 #endif
    2864 #endif
    28652476{
    28662477  for ( Int i = 0; i < MAX_TLAYER; i++ )
     
    28762487  m_spsRangeExtensionsFlag     = false;
    28772488  m_spsMultilayerExtensionFlag = false;
    2878 #if H_3D
    2879   m_spsExtension5bits          = 0;
    2880   m_sps3dExtensionFlag         = false;
    2881 #else
    28822489  m_spsExtension6bits          = 0;
    2883 #endif
    28842490
    28852491#endif
     
    30382644, m_ppsScalingListRefLayerId(0)
    30392645, m_pocResetInfoPresentFlag(false)
    3040 #if H_3D
    3041 , m_pcDLT(NULL)
    3042 #endif
    30432646#endif
    30442647{
     
    30482651  m_ppsRangeExtensionsFlag     = false;
    30492652  m_ppsMultilayerExtensionFlag = false;
    3050 #if !H_3D
    30512653  m_ppsExtension6bits          = 0;
    3052 #else
    3053   m_pps3dExtensionFlag         = false;
    3054   m_ppsExtension5bits          = 0;
    3055 #endif
    30562654#endif
    30572655}
     
    30622660}
    30632661
    3064 #if H_3D
    3065 TComDLT::TComDLT()
    3066 : m_bDltPresentFlag(false)
    3067 , m_iNumDepthViews(0)
    3068 , m_uiDepthViewBitDepth(8)
    3069 {
    3070   m_uiDepthViewBitDepth = g_bitDepthY;
    3071 
    3072   for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
    3073   {
    3074     m_bUseDLTFlag                 [i] = false;
    3075     m_bInterViewDltPredEnableFlag [i] = false;
    3076 
    3077     // allocate some memory and initialize with default mapping
    3078     m_iNumDepthmapValues[i] = ((1 << m_uiDepthViewBitDepth)-1)+1;
    3079     m_iDepthValue2Idx[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
    3080     m_iIdx2DepthValue[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
    3081 
    3082     //default mapping
    3083     for (Int d=0; d<m_iNumDepthmapValues[i]; d++)
    3084     {
    3085       m_iDepthValue2Idx[i][d] = d;
    3086       m_iIdx2DepthValue[i][d] = d;
    3087     }
    3088   }
    3089 }
    3090 
    3091 TComDLT::~TComDLT()
    3092 {
    3093   for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
    3094   {
    3095     if ( m_iDepthValue2Idx[i] != NULL )
    3096     {
    3097       xFree( m_iDepthValue2Idx[i] );
    3098       m_iDepthValue2Idx[i] = NULL;
    3099     }
    3100 
    3101     if ( m_iIdx2DepthValue[i] != NULL )
    3102     {
    3103       xFree( m_iIdx2DepthValue[i] );
    3104       m_iIdx2DepthValue[i] = NULL;
    3105     }
    3106   }
    3107 }
    3108 
    3109 Void TComDLT::setDepthLUTs(Int layerIdInVps, Int* idxToDepthValueTable, Int iNumDepthValues)
    3110 {
    3111   if( idxToDepthValueTable == NULL || iNumDepthValues == 0 ) // default mapping only
    3112     return;
    3113 
    3114   // copy idx2DepthValue to internal array
    3115   memcpy(m_iIdx2DepthValue[layerIdInVps], idxToDepthValueTable, iNumDepthValues*sizeof(UInt));
    3116 
    3117   UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);
    3118   for(Int p=0; p<=uiMaxDepthValue; p++)
    3119   {
    3120     Int iIdxDown    = 0;
    3121     Int iIdxUp      = iNumDepthValues-1;
    3122     Bool bFound     = false;
    3123 
    3124     // iterate over indices to find lower closest depth
    3125     Int i = 1;
    3126     while(!bFound && i<iNumDepthValues)
    3127     {
    3128       if( m_iIdx2DepthValue[layerIdInVps][i] > p )
    3129       {
    3130         iIdxDown  = i-1;
    3131         bFound    = true;
    3132       }
    3133 
    3134       i++;
    3135     }
    3136     iIdxUp = bFound ?  iIdxDown + 1 : iNumDepthValues-1;
    3137 
    3138     // assign closer depth value/idx
    3139     if( abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxDown]) < abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxUp]) )
    3140     {
    3141       m_iDepthValue2Idx[layerIdInVps][p] = iIdxDown;
    3142     }
    3143     else
    3144     {
    3145       m_iDepthValue2Idx[layerIdInVps][p] = iIdxUp;
    3146     }
    3147 
    3148   }
    3149 
    3150   // update DLT variables
    3151   m_iNumDepthmapValues[layerIdInVps] = iNumDepthValues;
    3152 }
    3153 
    3154 Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum )
    3155 {
    3156   Bool abBM0[ 256 ];
    3157   Bool abBM1[ 256 ];
    3158  
    3159   memset( abBM0, 0, sizeof( abBM0 ));
    3160   memset( abBM1, 0, sizeof( abBM1 ));
    3161  
    3162   // convert reference DLT to bit string
    3163   for( Int i = 0; i < uiDLTInRefNum; i++ )
    3164   {
    3165     abBM0[ piDLTInRef[ i ] ] = true;
    3166   }
    3167   // convert internal DLT to bit string
    3168   for( Int i = 0; i < m_iNumDepthmapValues[ layerIdInVps ]; i++ )
    3169   {
    3170     abBM1[ m_iIdx2DepthValue[ layerIdInVps ][ i ] ] = true;
    3171   }
    3172  
    3173   *puiDeltaDLTOutNum = 0;
    3174   for( Int i = 0; i < 256; i++ )
    3175   {
    3176     if( abBM0[ i ] ^ abBM1[ i ] )
    3177     {
    3178       piDeltaDLTOut[ *puiDeltaDLTOutNum ] = i;
    3179       *puiDeltaDLTOutNum = *puiDeltaDLTOutNum + 1;
    3180     }
    3181   }
    3182 }
    3183 
    3184 Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum )
    3185 {
    3186   Bool abBM0[ 256 ];
    3187   Bool abBM1[ 256 ];
    3188  
    3189   memset( abBM0, 0, sizeof( abBM0 ));
    3190   memset( abBM1, 0, sizeof( abBM1 ));
    3191  
    3192   // convert reference DLT to bit string
    3193   for( Int i = 0; i < uiDLTInRefNum; i++ )
    3194   {
    3195     abBM0[ piDLTInRef[ i ] ] = true;
    3196   }
    3197   // convert delta DLT to bit string
    3198   for( Int i = 0; i < uiDeltaDLTInNum; i++ )
    3199   {
    3200     abBM1[ piDeltaDLTIn[ i ] ] = true;
    3201   }
    3202  
    3203   Int aiIdx2DepthValue[256];
    3204   UInt uiNumDepthValues = 0;
    3205   memset( aiIdx2DepthValue, 0, sizeof( aiIdx2DepthValue ));
    3206  
    3207   for( Int i = 0; i < 256; i++ )
    3208   {
    3209     if( abBM0[ i ] ^ abBM1[ i ] )
    3210     {
    3211       aiIdx2DepthValue[ uiNumDepthValues++ ] = i;
    3212     }
    3213   }
    3214  
    3215   // update internal tables
    3216   setDepthLUTs(layerIdInVps, aiIdx2DepthValue, uiNumDepthValues);
    3217 }
    3218 
    3219 #endif
    32202662
    32212663#if H_MV
     
    37153157{
    37163158  TComVPS* vps = getVPS();
    3717 #if H_3D
    3718   Int refLayerIdx = vps->getLayerIdInVps( vps->getIdRefListLayer( getLayerId(), i ) );
    3719 #else
    37203159  Int refLayerIdx = vps->getLayerIdInVps( vps->getIdDirectRefLayer( getLayerId(), i ) );
    3721 #endif
    37223160
    37233161  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer()  && ( getTLayer() == 0   ||
     
    37303168  Int refLayerPicIdc = -1;
    37313169  Int curj = 0;
    3732 #if H_3D
    3733   for( Int i = 0;  i < getVPS()->getNumRefListLayers( getLayerId()) ; i++ )
    3734 #else
    37353170  for( Int i = 0;  i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )
    3736 #endif
    37373171  {
    37383172    if( getRefLayerPicFlag( i ) )
     
    37553189
    37563190  Int numRefLayerPics = 0;
    3757 #if H_3D
    3758   for( Int i = 0;  i < getVPS()->getNumRefListLayers( getLayerId()) ; i++ )
    3759 #else
    37603191  for( Int i = 0;  i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )
    3761 #endif
    37623192  {
    37633193    numRefLayerPics += getRefLayerPicFlag( i );
     
    37843214    numActiveRefLayerPics = 0;
    37853215  }
    3786 #if H_3D
    3787   else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumRefListLayers( getLayerId() ) == 1 )
    3788 #else
    37893216  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
    3790 #endif
    37913217  {
    37923218    numActiveRefLayerPics = 1;
     
    38013227Int TComSlice::getRefPicLayerId( Int i )
    38023228{
    3803 #if H_3D
    3804   return getVPS()->getIdRefListLayer( getLayerId(), getInterLayerPredLayerIdc( i ) );
    3805 #else
    38063229  return getVPS()->getIdDirectRefLayer( getLayerId(), getInterLayerPredLayerIdc( i ) );
    3807 #endif
    3808 }
    3809 #if H_3D
    3810 Void TComSlice::setDefaultRefView( )
    3811 {
    3812   setDefaultRefViewIdx( -1 );
    3813   setDefaultRefViewIdxAvailableFlag( false );
    3814 
    3815   Int valid = 0;
    3816   Int DefaultRefViewIdx = -1;
    3817   for( UInt curViewIdx = 0; curViewIdx < getViewIndex() && valid == 0; curViewIdx++ )
    3818   {
    3819     for( Int iRefListId = 0; ( iRefListId < (isInterB() ? 2 : 1) ) && !isIntra() && valid == 0; iRefListId++ )
    3820     {
    3821       RefPicList eRefPicList = RefPicList( iRefListId );
    3822       Int        iNumRefPics = getNumRefIdx( eRefPicList );
    3823       for( Int i = 0; i < iNumRefPics; i++ )
    3824       {
    3825         if(getPOC() == getRefPic( eRefPicList, i )->getPOC() && curViewIdx == getRefPic( eRefPicList, i )->getViewIndex())
    3826         {
    3827           valid = 1;
    3828           DefaultRefViewIdx = curViewIdx;
    3829           break;
    3830         }
    3831       }
    3832     }
    3833   }
    3834   if( valid )
    3835   {
    3836     setDefaultRefViewIdx( DefaultRefViewIdx );
    3837     setDefaultRefViewIdxAvailableFlag( true );   
    3838   }
    3839 }
    3840 #endif
    3841 
    3842 #if H_3D_ARP
    3843 Void TComSlice::setARPStepNum( TComPicLists*ivPicLists )
    3844 {
    3845   Bool tempRefPicInListsFlag = false;
    3846   if( !getIvResPredFlag() || this->isIRAP())
    3847   {
    3848     m_nARPStepNum = 0;
    3849   }
    3850   else
    3851   {
    3852     setFirstTRefIdx (REF_PIC_LIST_0, -1);
    3853     setFirstTRefIdx (REF_PIC_LIST_1, -1);
    3854     for ( Int refListIdx = 0; refListIdx < ((m_eSliceType==B_SLICE) ? 2 : 1); refListIdx++ )
    3855     {
    3856       Int diffPOC=MAX_INT;
    3857       Int idx=-1;
    3858       for(Int i = 0; i < getNumRefIdx(RefPicList(refListIdx)); i++ )
    3859       {
    3860         if ( getRefPic(RefPicList(refListIdx), i)->getPOC() != getPOC() )
    3861         {
    3862           if( abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC()) < diffPOC)
    3863           {
    3864             diffPOC=abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC());
    3865             idx=i;
    3866           }
    3867         }
    3868         if(idx>=0)
    3869         {
    3870           setFirstTRefIdx (RefPicList(refListIdx), idx);
    3871         }
    3872       }
    3873     }
    3874     tempRefPicInListsFlag = (getFirstTRefIdx(REF_PIC_LIST_0) >= 0 || getFirstTRefIdx(REF_PIC_LIST_1) >= 0) && getDefaultRefViewIdxAvailableFlag();
    3875     m_nARPStepNum = tempRefPicInListsFlag ?  H_3D_ARP_WFNR : 0;
    3876   }
    3877 
    3878   if (tempRefPicInListsFlag)
    3879   {
    3880     for ( Int refListIdx = 0; refListIdx < ((m_eSliceType==B_SLICE) ? 2 : 1); refListIdx++ )
    3881     {
    3882       RefPicList eRefPicList = RefPicList( refListIdx );
    3883       Int prevPOC = getRefPic(eRefPicList, getFirstTRefIdx(eRefPicList) )->getPOC();
    3884       for( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
    3885       {
    3886         Int layerIdInNuh = getRefPicLayerId( i );
    3887 #if HHI_RES_PRED_K0052
    3888         TComPic* picV = getIvPic( getIsDepth(), getVPS()->getViewIndex( layerIdInNuh ) );
    3889         assert( picV != NULL );
    3890         std::vector<Int> pocsInCurrRPSsPicV = picV->getSlice(0)->getPocsInCurrRPSs();
    3891         Bool refRpRefAvailFlag = false;
    3892         for (Int idx = 0; idx < pocsInCurrRPSsPicV.size(); idx++)
    3893         {
    3894           if ( pocsInCurrRPSsPicV[idx] == prevPOC )
    3895           {
    3896             refRpRefAvailFlag = true;
    3897             break;
    3898           }
    3899         }
    3900 
    3901         if (getFirstTRefIdx(eRefPicList) >= 0 && refRpRefAvailFlag )
    3902 #else
    3903         Int viewIdx = getVPS()->getViewId( layerIdInNuh );
    3904         TComPic*pcPicPrev = ivPicLists->getPic(viewIdx, 0, prevPOC);
    3905         if (getFirstTRefIdx(eRefPicList) >= 0 && pcPicPrev && pcPicPrev->getSlice( 0 )->isReferenced())
    3906 #endif
    3907         {
    3908           m_arpRefPicAvailable[eRefPicList][layerIdInNuh] = true;
    3909         }
    3910         else
    3911         {
    3912           m_arpRefPicAvailable[eRefPicList][layerIdInNuh] = false;
    3913         }
    3914       }
    3915     }
    3916   }
    3917 }
    3918 #endif
    3919 #if H_3D_IC
    3920 Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc)
    3921 {
    3922   if(bUseLowLatencyICEnc)
    3923   {
    3924     Bool existInterViewRef=false;
    3925     TComPic* pcCurrPic = getPic();
    3926     TComPic* pcRefPic = NULL;
    3927     for ( Int i = 0; (i < getNumRefIdx( REF_PIC_LIST_0 )) && !existInterViewRef; i++ )
    3928     {
    3929       pcRefPic = getRefPic( REF_PIC_LIST_0, i );
    3930       if ( pcRefPic != NULL )
    3931       {
    3932         if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
    3933         {
    3934           existInterViewRef = true;       
    3935         }
    3936       }
    3937     }
    3938 
    3939     for ( Int i = 0; (i < getNumRefIdx( REF_PIC_LIST_1 )) && !existInterViewRef; i++ )
    3940     {
    3941       pcRefPic = getRefPic( REF_PIC_LIST_1, i );
    3942       if ( pcRefPic != NULL )
    3943       {
    3944         if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
    3945         {
    3946           existInterViewRef = true;       
    3947         }
    3948       }
    3949     }
    3950 
    3951     if(!existInterViewRef)
    3952     {
    3953       m_bApplyIC = false;
    3954     }
    3955     else
    3956     {
    3957       Int curLayer=getDepth();
    3958       if( curLayer>9) curLayer=9; // Max layer is 10
    3959 
    3960       m_bApplyIC = true;
    3961       Int refLayer = curLayer-1;
    3962 
    3963       Int ICEnableCandidate = getICEnableCandidate(refLayer);
    3964       Int ICEnableNum = getICEnableNum(refLayer);
    3965       if( (refLayer>=0) && (ICEnableCandidate>0) )
    3966       {   
    3967         Double ratio=Double(ICEnableNum/Double(ICEnableCandidate));
    3968 
    3969         if( ratio > IC_LOW_LATENCY_ENCODING_THRESHOLD)
    3970         {
    3971           m_bApplyIC=true;
    3972         }
    3973         else
    3974         {
    3975           m_bApplyIC=false;
    3976         }
    3977       }
    3978       setICEnableCandidate(curLayer, 0);
    3979       setICEnableNum(curLayer, 0);
    3980     }
    3981   }
    3982   else
    3983   {
    3984   Int iMaxPelValue = ( 1 << g_bitDepthY );
    3985   Int *aiRefOrgHist;
    3986   Int *aiCurrHist;
    3987   aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue );
    3988   aiCurrHist   = (Int *) xMalloc( Int,iMaxPelValue );
    3989   memset( aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) );
    3990   memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) );
    3991   // Reference Idx Number
    3992   Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 );
    3993   TComPic* pcCurrPic = NULL;
    3994   TComPic* pcRefPic = NULL;
    3995   TComPicYuv* pcCurrPicYuv = NULL;
    3996   TComPicYuv* pcRefPicYuvOrg = NULL;
    3997   pcCurrPic = getPic();
    3998   pcCurrPicYuv = pcCurrPic->getPicYuvOrg();
    3999   Int iWidth = pcCurrPicYuv->getWidth();
    4000   Int iHeight = pcCurrPicYuv->getHeight();
    4001 
    4002 
    4003   // Get InterView Reference picture
    4004   // !!!!! Assume only one Interview Reference Picture in L0
    4005   for ( Int i = 0; i < iNumRefIdx; i++ )
    4006   {
    4007     pcRefPic = getRefPic( REF_PIC_LIST_0, i );
    4008     if ( pcRefPic != NULL )
    4009     {
    4010       if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
    4011       {
    4012         pcRefPicYuvOrg = pcRefPic->getPicYuvOrg();
    4013       }
    4014     }
    4015   }
    4016 
    4017   if ( pcRefPicYuvOrg != NULL )
    4018   {
    4019     Pel* pCurrY = pcCurrPicYuv ->getLumaAddr();
    4020     Pel* pRefOrgY = pcRefPicYuvOrg  ->getLumaAddr();
    4021     Int iCurrStride = pcCurrPicYuv->getStride();
    4022     Int iRefStride = pcRefPicYuvOrg->getStride();
    4023     Int iSumOrgSAD = 0;
    4024     Double dThresholdOrgSAD = getIsDepth() ? 0.1 : 0.05;
    4025 
    4026     // Histogram building - luminance
    4027     for ( Int y = 0; y < iHeight; y++ )
    4028     {
    4029       for ( Int x = 0; x < iWidth; x++ )
    4030       {
    4031         aiCurrHist[pCurrY[x]]++;
    4032         aiRefOrgHist[pRefOrgY[x]]++;
    4033       }
    4034       pCurrY += iCurrStride;
    4035       pRefOrgY += iRefStride;
    4036     }
    4037     // Histogram SAD
    4038     for ( Int i = 0; i < iMaxPelValue; i++ )
    4039     {
    4040       iSumOrgSAD += abs( aiCurrHist[i] - aiRefOrgHist[i] );
    4041     }
    4042     // Setting
    4043     if ( iSumOrgSAD > Int( dThresholdOrgSAD * iWidth * iHeight ) )
    4044     {
    4045       m_bApplyIC = true;
    4046     }
    4047     else
    4048     {
    4049       m_bApplyIC = false;
    4050     }
    4051   }
    4052 
    4053   xFree( aiCurrHist   );
    4054   xFree( aiRefOrgHist );
    4055   aiCurrHist = NULL;
    4056   aiRefOrgHist = NULL;
    4057   }//if(bUseLowLatencyICEnc)
    4058 }
    4059 #endif
    4060 #if H_3D
    4061 Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists )
    4062 {
    4063   for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    4064   {     
    4065     for ( Int depthId = 0; depthId < 2; depthId++ )
    4066     {
    4067       m_ivPicsCurrPoc[ depthId ][ i ] = ( i <= m_viewIndex ) ? m_ivPicLists->getPic( i, ( depthId == 1) , getPOC() ) : NULL;
    4068     }       
    4069   } 
    4070 }
    4071 Void TComSlice::setDepthToDisparityLUTs()
    4072 {
    4073   Bool setupLUT = false;
    4074  
    4075   setupLUT = setupLUT || getViewSynthesisPredFlag( );
    4076 
    4077 #if H_3D_NBDV_REF
    4078   setupLUT = setupLUT || getDepthRefinementFlag( );
    4079 #endif 
    4080 
    4081 #if H_3D_IV_MERGE
    4082   setupLUT = setupLUT || ( getIvMvPredFlag() && getIsDepth() );
    4083 #endif
    4084 
    4085 
    4086   if( !setupLUT )
    4087     return;
    4088 
    4089 #if HHI_CAM_PARA_K0052
    4090   m_numViews = getVPS()->getNumViews();
    4091 #endif
    4092   /// GT: Allocation should be moved to a better place later;
    4093   if ( m_depthToDisparityB == NULL )
    4094   {
    4095 #if HHI_CAM_PARA_K0052   
    4096     m_depthToDisparityB = new Int*[ m_numViews ];
    4097     for ( Int i = 0; i < getVPS()->getNumViews(); i++ )
    4098 #else
    4099     m_depthToDisparityB = new Int*[ getViewIndex() ];
    4100     for ( Int i = 0; i < getViewIndex(); i++ )
    4101 #endif
    4102     {
    4103       m_depthToDisparityB[ i ] = new Int[ Int(1 << g_bitDepthY) ];
    4104     }
    4105   }
    4106 
    4107  
    4108   if ( m_depthToDisparityF == NULL )
    4109   {
    4110 #if HHI_CAM_PARA_K0052   
    4111     m_depthToDisparityF = new Int*[ m_numViews ];
    4112     for ( Int i = 0; i < m_numViews; i++ )
    4113 #else
    4114     m_depthToDisparityF= new Int*[ getViewIndex() ];
    4115     for ( Int i = 0; i < getViewIndex(); i++ )
    4116 #endif
    4117     {
    4118       m_depthToDisparityF[ i ] = new Int[ Int(1 << g_bitDepthY) ];
    4119     }
    4120   }
    4121 
    4122   assert( m_depthToDisparityB != NULL );
    4123   assert( m_depthToDisparityF != NULL );
    4124 
    4125   TComVPS* vps = getVPS();
    4126 
    4127 #if HHI_CAM_PARA_K0052
    4128   Int log2Div = g_bitDepthY - 1 + vps->getCpPrecision();
    4129   Int voiInVps = vps->getVoiInVps( getViewIndex() );
    4130   Bool camParaSH = vps->getCpInSliceSegmentHeaderFlag( voiInVps ); 
    4131 
    4132   Int* codScale     = camParaSH ? m_aaiCodedScale [ 0 ] : vps->getCodedScale    ( voiInVps );
    4133   Int* codOffset    = camParaSH ? m_aaiCodedOffset[ 0 ] : vps->getCodedOffset   ( voiInVps );
    4134   Int* invCodScale  = camParaSH ? m_aaiCodedScale [ 1 ] : vps->getInvCodedScale ( voiInVps );
    4135   Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : vps->getInvCodedOffset( voiInVps );
    4136 
    4137 
    4138   for (Int i = 0; i < voiInVps; i++)
    4139   {
    4140     Int iInVoi = vps->getVoiInVps( i );
    4141 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
    4142     if ( g_traceCameraParameters )
    4143     {
    4144       std::cout << std::endl << "Cp: " << codScale   [ iInVoi ] << " " <<    codOffset[ iInVoi ] << " "
    4145                 << invCodScale[ iInVoi ] << " " << invCodOffset[ iInVoi ] << " " << log2Div;
    4146     }
    4147 #endif
    4148     for ( Int d = 0; d <= ( ( 1 << g_bitDepthY ) - 1 ); d++ )
    4149     {     
    4150       Int offset =    ( codOffset  [ iInVoi ] << g_bitDepthY ) + ( ( 1 << log2Div ) >> 1 );         
    4151       m_depthToDisparityB[ iInVoi ][ d ] = ( codScale [ iInVoi ] * d + offset ) >> log2Div;
    4152 
    4153       Int invOffset = ( invCodOffset[ iInVoi ] << g_bitDepthY ) + ( ( 1 << log2Div ) >> 1 );         
    4154       m_depthToDisparityF[ iInVoi ][ d ] = ( invCodScale[ iInVoi ] * d + invOffset ) >> log2Div;
    4155     }
    4156   }
    4157 #else
    4158   Int log2Div = g_bitDepthY - 1 + vps->getCamParPrecision();
    4159 
    4160   Int viewIndex = getViewIndex();
    4161 
    4162   Bool camParaSH = vps->hasCamParInSliceHeader( viewIndex );
    4163 
    4164   Int* codScale     = camParaSH ? m_aaiCodedScale [ 0 ] : vps->getCodedScale    ( viewIndex );
    4165   Int* codOffset    = camParaSH ? m_aaiCodedOffset[ 0 ] : vps->getCodedOffset   ( viewIndex );
    4166   Int* invCodScale  = camParaSH ? m_aaiCodedScale [ 1 ] : vps->getInvCodedScale ( viewIndex );
    4167   Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : vps->getInvCodedOffset( viewIndex );
    4168 
    4169   for (Int i = 0; i <= ( getViewIndex() - 1); i++)
    4170   {
    4171     for ( Int d = 0; d <= ( ( 1 << g_bitDepthY ) - 1 ); d++ )
    4172     {
    4173       Int offset =    ( codOffset  [ i ] << g_bitDepthY ) + ( ( 1 << log2Div ) >> 1 );         
    4174       m_depthToDisparityB[ i ][ d ] = ( codScale [ i ] * d + offset ) >> log2Div;
    4175 
    4176       Int invOffset = ( invCodOffset[ i ] << g_bitDepthY ) + ( ( 1 << log2Div ) >> 1 );         
    4177       m_depthToDisparityF[ i ][ d ] = ( invCodScale[ i ] * d + invOffset ) >> log2Div;
    4178     }
    4179   }
    4180 #endif
    4181 }
    4182 #endif
     3230}
     3231
    41833232#endif
    41843233
     
    42173266
    42183267
    4219 #if H_3D
    4220 Void TComSlice::init3dToolParameters()
    4221 {
    4222   Bool depthFlag = getIsDepth();
    4223 
    4224 #if !HHI_INTER_COMP_PRED_K0052
    4225   Bool depthOfRefViewsAvailFlag = false;
    4226   Bool textOfCurViewAvailFlag = false;
    4227 
    4228   TComVPS* vps = getVPS();
    4229 
    4230   if( !depthFlag )
    4231   {
    4232     depthOfRefViewsAvailFlag = true;
    4233     for( Int i = 0; i <= vps->getNumRefListLayers( getLayerId() ) - 1; i++)
    4234     {
    4235       Bool curDepthAvailableFlag = false;   
    4236       for (Int j = 0; j <= vps->getMaxLayersMinus1(); j++ )
    4237       {
    4238         if ( vps->getDirectDependencyFlag( vps->getLayerIdInVps( getLayerId() ), j )
    4239           && vps->getVpsDepthFlag        ( vps->getLayerIdInNuh( j ) ) == 1
    4240           && vps->getViewOrderIdx( vps->getLayerIdInNuh( j ) ) == vps->getViewOrderIdx( vps->getIdRefListLayer( getLayerId(), i ) )
    4241           && vps->getDependencyId( vps->getLayerIdInNuh( j ) ) == 0
    4242           && vps->getAuxId       ( vps->getLayerIdInNuh( j ) ) == 0
    4243           )
    4244         {
    4245           curDepthAvailableFlag = true;
    4246         }
    4247       }
    4248       if ( !curDepthAvailableFlag )
    4249       {
    4250         depthOfRefViewsAvailFlag = false;
    4251       }   
    4252     }
    4253   }
    4254   else
    4255   {
    4256     for (Int j = 0; j <= vps->getMaxLayersMinus1(); j++ )
    4257     {
    4258       if ( vps->getDirectDependencyFlag( vps->getLayerIdInVps( getLayerId() ), j )
    4259         && vps->getVpsDepthFlag( vps->getLayerIdInNuh( j ) ) == 0
    4260         && vps->getViewOrderIdx( vps->getLayerIdInNuh( j ) ) == getViewIndex()
    4261         && vps->getDependencyId( vps->getLayerIdInNuh( j ) ) == 0
    4262         && vps->getAuxId       ( vps->getLayerIdInNuh( j ) ) == 0
    4263         )
    4264       {       
    4265         textOfCurViewAvailFlag = true;
    4266       }
    4267     }
    4268   }
    4269 
    4270 
    4271   Bool lidG0  = ( getLayerId() > 0 );
    4272   Bool nRLLG0 =  ( getVPS()->getNumRefListLayers( getLayerId() ) > 0 );     
    4273 
    4274   TComSps3dExtension* sps3dExt = getSPS()->getSps3dExtension();
    4275 
    4276   m_ivMvPredFlag           = sps3dExt->getIvMvPredFlag         ( depthFlag ) && lidG0 && nRLLG0                           ;                             
    4277   m_ivMvScalingFlag        = sps3dExt->getIvMvScalingFlag      ( depthFlag ) && lidG0                                    ;                             
    4278   m_ivResPredFlag          = sps3dExt->getIvResPredFlag        ( depthFlag ) && lidG0 && nRLLG0                           ;                               
    4279   m_depthRefinementFlag    = sps3dExt->getDepthRefinementFlag  ( depthFlag ) && lidG0           && depthOfRefViewsAvailFlag;                           
    4280   m_viewSynthesisPredFlag  = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && lidG0 && nRLLG0 && depthOfRefViewsAvailFlag;                         
    4281   m_depthBasedBlkPartFlag  = sps3dExt->getDepthBasedBlkPartFlag( depthFlag ) && lidG0           && depthOfRefViewsAvailFlag;                         
    4282   m_mpiFlag                = sps3dExt->getMpiFlag              ( depthFlag ) && lidG0           &&   textOfCurViewAvailFlag;
    4283   m_intraContourFlag       = sps3dExt->getIntraContourFlag     ( depthFlag ) && lidG0           &&   textOfCurViewAvailFlag;
    4284   m_intraSdcWedgeFlag      = sps3dExt->getIntraSdcWedgeFlag    ( depthFlag ) && lidG0                                     ;                         
    4285   m_qtPredFlag             = sps3dExt->getQtPredFlag           ( depthFlag ) && lidG0           &&   textOfCurViewAvailFlag;
    4286   m_interSdcFlag           = sps3dExt->getInterSdcFlag         ( depthFlag ) && lidG0                                    ; 
    4287 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
    4288   m_depthIntraSkipFlag     = sps3dExt->getDepthIntraSkipFlag   ( depthFlag ) && lidG0                                    ;                         
    4289 #else
    4290   m_intraSingleFlag        = sps3dExt->getIntraSingleFlag      ( depthFlag ) && lidG0                                    ;                         
    4291 #endif
    4292 
    4293   m_subPbSize              = lidG0 ? ( 1 << ( sps3dExt->getLog2SubPbSizeMinus3   ( depthFlag ) + 3 ) ) : getSPS()->getMaxCUWidth(); 
    4294   m_mpiSubPbSize           = 1 << ( sps3dExt->getLog2MpiSubPbSizeMinus3( depthFlag ) + 3 );
    4295 #else
    4296   Bool nRLLG0 =  ( getVPS()->getNumRefListLayers( getLayerId() ) > 0 );     
    4297 
    4298   TComSps3dExtension* sps3dExt = getSPS()->getSps3dExtension();
    4299 
    4300   m_ivMvPredFlag           = sps3dExt->getIvMvPredFlag         ( depthFlag ) && nRLLG0                       ;                             
    4301   m_ivMvScalingFlag        = sps3dExt->getIvMvScalingFlag      ( depthFlag )                                 ;                             
    4302   m_ivResPredFlag          = sps3dExt->getIvResPredFlag        ( depthFlag ) && nRLLG0                       ;                               
    4303 #if HHI_CAM_PARA_K0052
    4304   m_depthRefinementFlag    = sps3dExt->getDepthRefinementFlag  ( depthFlag )           && getInCompPredFlag() && m_cpAvailableFlag;
    4305   m_viewSynthesisPredFlag  = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag() && m_cpAvailableFlag;
    4306 #else
    4307   m_depthRefinementFlag    = sps3dExt->getDepthRefinementFlag  ( depthFlag )           && getInCompPredFlag();                           
    4308   m_viewSynthesisPredFlag  = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag();                           
    4309 #endif
    4310   m_depthBasedBlkPartFlag  = sps3dExt->getDepthBasedBlkPartFlag( depthFlag )           && getInCompPredFlag();                         
    4311   m_mpiFlag                = sps3dExt->getMpiFlag              ( depthFlag )           && getInCompPredFlag();
    4312   m_intraContourFlag       = sps3dExt->getIntraContourFlag     ( depthFlag )           && getInCompPredFlag();
    4313   m_intraSdcWedgeFlag      = sps3dExt->getIntraSdcWedgeFlag    ( depthFlag )                                 ;                         
    4314   m_qtPredFlag             = sps3dExt->getQtPredFlag           ( depthFlag )           && getInCompPredFlag();
    4315   m_interSdcFlag           = sps3dExt->getInterSdcFlag         ( depthFlag )                                 ; 
    4316   m_depthIntraSkipFlag     = sps3dExt->getDepthIntraSkipFlag   ( depthFlag )                                 ;                         
    4317 
    4318   m_subPbSize              =  1 << ( sps3dExt->getLog2SubPbSizeMinus3   ( depthFlag ) + 3 ); 
    4319   m_mpiSubPbSize           =  1 << ( sps3dExt->getLog2MpiSubPbSizeMinus3( depthFlag ) + 3 );
    4320 
    4321 #endif
    4322 
    4323 #if H_3D_OUTPUT_ACTIVE_TOOLS
    4324   std::cout << "Layer:                  :" << getLayerId()             << std::endl;
    4325   std::cout << "DepthFlag:              :" << getIsDepth()             << std::endl;
    4326   std::cout << "ViewOrderIdx:           :" << getViewIndex()           << std::endl;
    4327 #if HHI_INTER_COMP_PRED_K0052
    4328   std::cout << "InterCmpPredAvailableFlag:" << getInCmpPredAvailFlag() << std::endl;
    4329   std::cout << "InterCompPredFlag       :"  << getInCompPredFlag()     << std::endl;
    4330   //std::cout << "TextOfCurViewAvailFlag  :" << textOfCurViewAvailFlag   << std::endl;
    4331 #else
    4332   std::cout << "DepthOfRefViewsAvailFlag:" << depthOfRefViewsAvailFlag << std::endl;
    4333   std::cout << "TextOfCurViewAvailFlag  :" << textOfCurViewAvailFlag   << std::endl;
    4334 #endif
    4335  
    4336   std::cout << "ivMvPredFlag            :" << m_ivMvPredFlag           << std::endl;
    4337   std::cout << "ivMvScalingFlag         :" << m_ivMvScalingFlag        << std::endl;
    4338   std::cout << "ivResPredFlag           :" << m_ivResPredFlag          << std::endl;
    4339   std::cout << "depthRefinementFlag     :" << m_depthRefinementFlag    << std::endl;
    4340   std::cout << "viewSynthesisPredFlag   :" << m_viewSynthesisPredFlag  << std::endl;
    4341   std::cout << "depthBasedBlkPartFlag   :" << m_depthBasedBlkPartFlag  << std::endl;
    4342   std::cout << "mpiFlag                 :" << m_mpiFlag                << std::endl;
    4343   std::cout << "intraContourFlag        :" << m_intraContourFlag       << std::endl;
    4344   std::cout << "intraSdcWedgeFlag       :" << m_intraSdcWedgeFlag      << std::endl;
    4345   std::cout << "qtPredFlag              :" << m_qtPredFlag             << std::endl;
    4346   std::cout << "interSdcFlag            :" << m_interSdcFlag           << std::endl;
    4347 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033
    4348   std::cout << "depthIntraSkipFlag      :" << m_depthIntraSkipFlag     << std::endl;   
    4349 #else
    4350   std::cout << "intraSingleFlag         :" << m_intraSingleFlag        << std::endl;   
    4351 #endif
    4352   std::cout << "subPbSize               :" << m_subPbSize              << std::endl;
    4353   std::cout << "mpiSubPbSize            :" << m_mpiSubPbSize           << std::endl;
    4354 #endif
    4355 }
    4356 #endif
    43573268
    43583269
Note: See TracChangeset for help on using the changeset viewer.