Changeset 1191 in 3DVCSoftware for branches/HTM-14.0-MV-draft-3/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 15 Apr 2015, 11:36:33 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.0-MV-draft-3/source/Lib/TLibCommon/TComSlice.cpp
r1179 r1191 110 110 , m_viewId (0) 111 111 , m_viewIndex (0) 112 #if H_3D113 , m_isDepth (false)114 #endif115 112 #if !H_MV_HLS7_GEN 116 113 , m_pocResetFlag (false) … … 132 129 , m_pocMsbValRequiredFlag ( false ) 133 130 #endif 134 #if H_3D_IC135 , m_bApplyIC ( false )136 , m_icSkipParseFlag ( false )137 #endif138 #if H_3D139 #if HHI_INTER_COMP_PRED_K0052140 , m_inCmpPredFlag ( false )141 #endif142 #if HHI_CAM_PARA_K0052143 , m_numViews ( 0 )144 #endif145 , m_depthToDisparityB ( NULL )146 , m_depthToDisparityF ( NULL )147 #endif148 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033149 , m_bApplyDIS (false)150 #else151 #if H_3D_SINGLE_DEPTH152 , m_bApplySingleDepthMode (false)153 #endif154 #endif155 131 #endif 156 132 { … … 191 167 m_iDefaultRefViewIdx = -1; 192 168 m_bDefaultRefViewIdxAvailableFlag = false; 193 #if HHI_INTER_COMP_PRED_K0052194 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 #endif209 169 } 210 170 … … 213 173 delete[] m_puiSubstreamSizes; 214 174 m_puiSubstreamSizes = NULL; 215 #if H_3D216 #if HHI_CAM_PARA_K0052217 for( UInt i = 0; i < m_numViews; i++ )218 #else219 for( UInt i = 0; i < getViewIndex(); i++ )220 #endif221 {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 #endif245 175 } 246 176 … … 259 189 m_iSliceQpDeltaCr = 0; 260 190 261 #if H_3D_IV_MERGE262 m_maxNumMergeCand = MRG_MAX_NUM_CANDS_MEM;263 #else264 191 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; 265 #endif266 192 267 193 m_bFinalized=false; … … 271 197 m_numEntryPointOffsets = 0; 272 198 m_enableTMVPFlag = true; 273 #if H_3D_TMVP274 m_aiAlterRefIdx[0] = -1;275 m_aiAlterRefIdx[1] = -1;276 #endif277 199 } 278 200 … … 605 527 Int i; 606 528 607 #if HHI_RES_PRED_K0052608 m_pocsInCurrRPSs.clear();609 #endif610 529 611 530 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) … … 619 538 NumPocStCurr0++; 620 539 pcRefPic->setCheckLTMSBPresent(false); 621 #if HHI_RES_PRED_K0052622 m_pocsInCurrRPSs.push_back( pcRefPic->getPOC() );623 #endif624 540 } 625 541 } … … 635 551 NumPocStCurr1++; 636 552 pcRefPic->setCheckLTMSBPresent(false); 637 #if HHI_RES_PRED_K0052638 m_pocsInCurrRPSs.push_back( pcRefPic->getPOC() );639 #endif640 553 } 641 554 } … … 650 563 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic; 651 564 NumPocLtCurr++; 652 #if HHI_RES_PRED_K0052653 m_pocsInCurrRPSs.push_back( pcRefPic->getPOC() );654 #endif655 565 } 656 566 if(pcRefPic==NULL) … … 662 572 663 573 Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 664 #if HHI_RES_PRED_K0052665 assert( numPocInterCurr == (Int) m_pocsInCurrRPSs.size() );666 #endif667 574 numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( ); 668 575 assert( numPocTotalCurr == getNumRpsCurrTempList() ); … … 812 719 } 813 720 } 814 #if H_3D815 #if H_3D_TMVP816 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 #endif837 Void TComSlice::setCamparaSlice( Int** aaiScale, Int** aaiOffset )838 {839 #if HHI_CAM_PARA_K0052840 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 #else858 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 #endif869 }870 #endif871 721 872 722 Void TComSlice::checkColRefIdx(UInt curSliceIdx, TComPic* pic) … … 1164 1014 m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 1165 1015 } 1166 #endif1167 #if SEC_DEPTH_INTRA_SKIP_MODE_K00331168 m_bApplyDIS = pSrc->m_bApplyDIS;1169 #else1170 #if H_3D_SINGLE_DEPTH1171 m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode;1172 #endif1173 #endif1174 #if H_3D_IC1175 m_bApplyIC = pSrc->m_bApplyIC;1176 m_icSkipParseFlag = pSrc->m_icSkipParseFlag;1177 1016 #endif 1178 1017 } … … 2020 1859 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 2021 1860 m_numDirectRefLayers[i] = 0; 2022 #if H_3D2023 m_numRefListLayers[i] = 0;2024 #endif2025 1861 m_vpsRepFormatIdx [i] = 0; 2026 1862 m_pocLsbNotPresentFlag[i] = 0; … … 2028 1864 m_viewIdVal [i] = 0; 2029 1865 2030 #if H_3D2031 m_viewIndex [i] = -1;2032 #endif2033 1866 2034 1867 for( Int j = 0; j < MAX_NUM_LAYERS; j++ ) … … 2038 1871 m_dependencyFlag [i][j] = false; 2039 1872 m_idDirectRefLayer[i][j] = -1; 2040 #if H_3D2041 m_idRefListLayer[i][j] = -1;2042 #endif2043 1873 m_idPredictedLayer[i][j] = -1; 2044 1874 m_idRefLayer [i][j] = -1; … … 2050 1880 m_dimensionId[i][j] = 0; 2051 1881 } 2052 #if H_3D_ARP2053 #endif2054 1882 } 2055 1883 m_vpsVUI = new TComVPSVUI; … … 2074 1902 } 2075 1903 #endif 2076 #if H_3D2077 deleteCamPars();2078 #endif2079 1904 } 2080 1905 … … 2146 1971 Int iNuhLId = getLayerIdInNuh( i ); 2147 1972 Int d = 0; 2148 #if H_3D2149 Int l = 0;2150 #endif2151 1973 Int r = 0; 2152 1974 Int p = 0; … … 2159 1981 m_idDirectRefLayer[iNuhLId][d++] = jNuhLid; 2160 1982 } 2161 #if H_3D2162 if( getDirectDependencyFlag( i , j ) && ( getDepthId( iNuhLId ) == getDepthId( jNuhLid ) ))2163 {2164 m_idRefListLayer [iNuhLId][l++] = jNuhLid;2165 }2166 #endif2167 1983 2168 1984 if( getDependencyFlag( i , j ) ) … … 2176 1992 } 2177 1993 m_numDirectRefLayers[ iNuhLId ] = d; 2178 #if H_3D2179 m_numRefListLayers[ iNuhLId ] = l;2180 #endif2181 1994 2182 1995 m_numRefLayers [ iNuhLId ] = r; … … 2217 2030 { 2218 2031 m_numViews = 1; 2219 #if HHI_VIEW_ID_LIST_I5_J0107 || HHI_INTER_COMP_PRED_K00522220 #if H_3D2221 AOF( m_viewOIdxList.size() == 0 );2222 2223 m_viewOIdxList.push_back( 0 );2224 #endif2225 #endif2226 2032 2227 2033 for( Int i = 0; i <= getMaxLayersMinus1(); i++ ) … … 2241 2047 { 2242 2048 m_numViews++; 2243 #if HHI_VIEW_ID_LIST_I5_J0107 || HHI_INTER_COMP_PRED_K00522244 #if H_3D2245 m_viewOIdxList.push_back( getViewOrderIdx( lId ) );2246 #endif2247 #endif2248 2049 } 2249 2050 } … … 2257 2058 } 2258 2059 2259 #if H_3D2260 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_TK652274 assert( foundLayerIdinNuh != -1 );2275 #endif2276 return foundLayerIdinNuh;2277 }2278 2279 Void TComVPS::createCamPars(Int iNumViews)2280 {2281 Int i = 0, j = 0;2282 2283 #if HHI_CAM_PARA_K00522284 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 #else2290 m_bCamParPresent = new Bool[ iNumViews ];2291 m_bCamParInSliceHeader = new Bool[ iNumViews ];2292 #endif2293 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_K00522300 m_cpInSliceSegmentHeaderFlag[i] = false;2301 #else2302 m_bCamParPresent[i] = false;2303 m_bCamParInSliceHeader[i] = false;2304 #endif2305 2306 m_aaaiCodedScale[i] = new Int*[ 2 ];2307 m_aaaiCodedOffset[i] = new Int*[ 2 ];2308 2309 #if HHI_CAM_PARA_K00522310 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 #endif2319 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_K00522338 if ( m_bCamParPresent != NULL )2339 {2340 delete [] m_bCamParPresent;2341 }2342 if ( m_bCamParInSliceHeader != NULL )2343 {2344 delete [] m_bCamParInSliceHeader;2345 }2346 #else2347 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 #endif2376 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_K00522407 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 #endif2427 2428 #endif // H_3D2429 2060 2430 2061 … … 2679 2310 vector<Int> range; 2680 2311 2681 #if H_3D2682 vector<Int> depthId;2683 #endif2684 2312 2685 2313 vector<Int> viewOrderIndex; … … 2695 2323 auxId .push_back( getAuxId ( i ) ); 2696 2324 viewId .push_back( getViewId ( getLayerIdInNuh( i ) ) ); 2697 #if H_3D2698 depthId.push_back( getDepthId( i ) );2699 #endif2700 2325 } 2701 2326 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Dependencies" << std::endl; … … 2706 2331 xPrintArray( "IdRefLayer" , getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefLayers, m_idRefLayer, true ); 2707 2332 xPrintArray( "IdDirectRefLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numDirectRefLayers, m_idDirectRefLayer, true ); 2708 #if H_3D2709 xPrintArray( "IdRefListLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefListLayers, m_idRefListLayer, true );2710 #endif2711 2333 2712 2334 std::cout << std::endl; … … 2717 2339 vector<Int> layerIdxInVps; 2718 2340 2719 #if H_3D2720 vector<Int> depthId;2721 #endif2722 2341 2723 2342 vector<Int> viewOrderIndex; … … 2734 2353 auxId .push_back( getAuxId ( layerIdInNuh ) ); 2735 2354 viewId .push_back( getViewId ( layerIdInNuh ) ); 2736 #if H_3D2737 depthId .push_back( getDepthId ( layerIdInNuh ) );2738 #endif2739 2355 } 2740 2356 … … 2858 2474 , m_interViewMvVertConstraintFlag (false) 2859 2475 #endif 2860 #if H_3D2861 #if !HHI_CAM_PARA_K00522862 , m_bCamParInSliceHeader (false)2863 #endif2864 #endif2865 2476 { 2866 2477 for ( Int i = 0; i < MAX_TLAYER; i++ ) … … 2876 2487 m_spsRangeExtensionsFlag = false; 2877 2488 m_spsMultilayerExtensionFlag = false; 2878 #if H_3D2879 m_spsExtension5bits = 0;2880 m_sps3dExtensionFlag = false;2881 #else2882 2489 m_spsExtension6bits = 0; 2883 #endif2884 2490 2885 2491 #endif … … 3038 2644 , m_ppsScalingListRefLayerId(0) 3039 2645 , m_pocResetInfoPresentFlag(false) 3040 #if H_3D3041 , m_pcDLT(NULL)3042 #endif3043 2646 #endif 3044 2647 { … … 3048 2651 m_ppsRangeExtensionsFlag = false; 3049 2652 m_ppsMultilayerExtensionFlag = false; 3050 #if !H_3D3051 2653 m_ppsExtension6bits = 0; 3052 #else3053 m_pps3dExtensionFlag = false;3054 m_ppsExtension5bits = 0;3055 #endif3056 2654 #endif 3057 2655 } … … 3062 2660 } 3063 2661 3064 #if H_3D3065 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 mapping3078 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 mapping3083 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 only3112 return;3113 3114 // copy idx2DepthValue to internal array3115 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 depth3125 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/idx3139 if( abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxDown]) < abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxUp]) )3140 {3141 m_iDepthValue2Idx[layerIdInVps][p] = iIdxDown;3142 }3143 else3144 {3145 m_iDepthValue2Idx[layerIdInVps][p] = iIdxUp;3146 }3147 3148 }3149 3150 // update DLT variables3151 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 string3163 for( Int i = 0; i < uiDLTInRefNum; i++ )3164 {3165 abBM0[ piDLTInRef[ i ] ] = true;3166 }3167 // convert internal DLT to bit string3168 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 string3193 for( Int i = 0; i < uiDLTInRefNum; i++ )3194 {3195 abBM0[ piDLTInRef[ i ] ] = true;3196 }3197 // convert delta DLT to bit string3198 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 tables3216 setDepthLUTs(layerIdInVps, aiIdx2DepthValue, uiNumDepthValues);3217 }3218 3219 #endif3220 2662 3221 2663 #if H_MV … … 3715 3157 { 3716 3158 TComVPS* vps = getVPS(); 3717 #if H_3D3718 Int refLayerIdx = vps->getLayerIdInVps( vps->getIdRefListLayer( getLayerId(), i ) );3719 #else3720 3159 Int refLayerIdx = vps->getLayerIdInVps( vps->getIdDirectRefLayer( getLayerId(), i ) ); 3721 #endif3722 3160 3723 3161 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() && ( getTLayer() == 0 || … … 3730 3168 Int refLayerPicIdc = -1; 3731 3169 Int curj = 0; 3732 #if H_3D3733 for( Int i = 0; i < getVPS()->getNumRefListLayers( getLayerId()) ; i++ )3734 #else3735 3170 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 3736 #endif3737 3171 { 3738 3172 if( getRefLayerPicFlag( i ) ) … … 3755 3189 { 3756 3190 Int numRefLayerPics = 0; 3757 #if H_3D3758 for( Int i = 0; i < getVPS()->getNumRefListLayers( getLayerId()) ; i++ )3759 #else3760 3191 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 3761 #endif3762 3192 { 3763 3193 numRefLayerPics += getRefLayerPicFlag( i ); … … 3784 3214 numActiveRefLayerPics = 0; 3785 3215 } 3786 #if H_3D3787 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumRefListLayers( getLayerId() ) == 1 )3788 #else3789 3216 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 3790 #endif3791 3217 { 3792 3218 numActiveRefLayerPics = 1; … … 3801 3227 Int TComSlice::getRefPicLayerId( Int i ) 3802 3228 { 3803 #if H_3D3804 return getVPS()->getIdRefListLayer( getLayerId(), getInterLayerPredLayerIdc( i ) );3805 #else3806 3229 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 4183 3232 #endif 4184 3233 … … 4217 3266 4218 3267 4219 #if H_3D4220 Void TComSlice::init3dToolParameters()4221 {4222 Bool depthFlag = getIsDepth();4223 4224 #if !HHI_INTER_COMP_PRED_K00524225 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 ) ) == 14240 && vps->getViewOrderIdx( vps->getLayerIdInNuh( j ) ) == vps->getViewOrderIdx( vps->getIdRefListLayer( getLayerId(), i ) )4241 && vps->getDependencyId( vps->getLayerIdInNuh( j ) ) == 04242 && vps->getAuxId ( vps->getLayerIdInNuh( j ) ) == 04243 )4244 {4245 curDepthAvailableFlag = true;4246 }4247 }4248 if ( !curDepthAvailableFlag )4249 {4250 depthOfRefViewsAvailFlag = false;4251 }4252 }4253 }4254 else4255 {4256 for (Int j = 0; j <= vps->getMaxLayersMinus1(); j++ )4257 {4258 if ( vps->getDirectDependencyFlag( vps->getLayerIdInVps( getLayerId() ), j )4259 && vps->getVpsDepthFlag( vps->getLayerIdInNuh( j ) ) == 04260 && vps->getViewOrderIdx( vps->getLayerIdInNuh( j ) ) == getViewIndex()4261 && vps->getDependencyId( vps->getLayerIdInNuh( j ) ) == 04262 && vps->getAuxId ( vps->getLayerIdInNuh( j ) ) == 04263 )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_K00334288 m_depthIntraSkipFlag = sps3dExt->getDepthIntraSkipFlag ( depthFlag ) && lidG0 ;4289 #else4290 m_intraSingleFlag = sps3dExt->getIntraSingleFlag ( depthFlag ) && lidG0 ;4291 #endif4292 4293 m_subPbSize = lidG0 ? ( 1 << ( sps3dExt->getLog2SubPbSizeMinus3 ( depthFlag ) + 3 ) ) : getSPS()->getMaxCUWidth();4294 m_mpiSubPbSize = 1 << ( sps3dExt->getLog2MpiSubPbSizeMinus3( depthFlag ) + 3 );4295 #else4296 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_K00524304 m_depthRefinementFlag = sps3dExt->getDepthRefinementFlag ( depthFlag ) && getInCompPredFlag() && m_cpAvailableFlag;4305 m_viewSynthesisPredFlag = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag() && m_cpAvailableFlag;4306 #else4307 m_depthRefinementFlag = sps3dExt->getDepthRefinementFlag ( depthFlag ) && getInCompPredFlag();4308 m_viewSynthesisPredFlag = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag();4309 #endif4310 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 #endif4322 4323 #if H_3D_OUTPUT_ACTIVE_TOOLS4324 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_K00524328 std::cout << "InterCmpPredAvailableFlag:" << getInCmpPredAvailFlag() << std::endl;4329 std::cout << "InterCompPredFlag :" << getInCompPredFlag() << std::endl;4330 //std::cout << "TextOfCurViewAvailFlag :" << textOfCurViewAvailFlag << std::endl;4331 #else4332 std::cout << "DepthOfRefViewsAvailFlag:" << depthOfRefViewsAvailFlag << std::endl;4333 std::cout << "TextOfCurViewAvailFlag :" << textOfCurViewAvailFlag << std::endl;4334 #endif4335 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_K00334348 std::cout << "depthIntraSkipFlag :" << m_depthIntraSkipFlag << std::endl;4349 #else4350 std::cout << "intraSingleFlag :" << m_intraSingleFlag << std::endl;4351 #endif4352 std::cout << "subPbSize :" << m_subPbSize << std::endl;4353 std::cout << "mpiSubPbSize :" << m_mpiSubPbSize << std::endl;4354 #endif4355 }4356 #endif4357 3268 4358 3269
Note: See TracChangeset for help on using the changeset viewer.