Changeset 468 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 16 Jun 2013, 05:33:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComSlice.cpp
r464 r468 114 114 , m_isDepth (false) 115 115 #endif 116 #if H_3D_IC 117 , m_bApplyIC ( false ) 118 , m_icSkipParseFlag ( false ) 119 #endif 116 120 #endif 117 121 { … … 966 970 m_enableTMVPFlag = pSrc->m_enableTMVPFlag; 967 971 m_maxNumMergeCand = pSrc->m_maxNumMergeCand; 972 #if H_3D_IC 973 m_bApplyIC = pSrc->m_bApplyIC; 974 m_icSkipParseFlag = pSrc->m_icSkipParseFlag; 975 #endif 968 976 } 969 977 … … 2300 2308 #endif 2301 2309 #endif 2310 2311 #if H_3D_IC 2312 Void TComSlice::xSetApplyIC() 2313 { 2314 Int iMaxPelValue = ( 1 << g_bitDepthY ); 2315 Int *aiRefOrgHist; 2316 Int *aiCurrHist; 2317 aiRefOrgHist = new Int; 2318 aiCurrHist = new Int; 2319 aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue ); 2320 aiCurrHist = (Int *) xMalloc( Int,iMaxPelValue ); 2321 memset( aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) ); 2322 memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 2323 // Reference Idx Number 2324 Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 ); 2325 TComPic* pcCurrPic = NULL; 2326 TComPic* pcRefPic = NULL; 2327 TComPicYuv* pcCurrPicYuv = NULL; 2328 TComPicYuv* pcRefPicYuvOrg = NULL; 2329 pcCurrPic = getPic(); 2330 pcCurrPicYuv = pcCurrPic->getPicYuvOrg(); 2331 Int iWidth = pcCurrPicYuv->getWidth(); 2332 Int iHeight = pcCurrPicYuv->getHeight(); 2333 2334 2335 // Get InterView Reference picture 2336 // !!!!! Assume only one Interview Reference Picture in L0 2337 for ( Int i = 0; i < iNumRefIdx; i++ ) 2338 { 2339 pcRefPic = getRefPic( REF_PIC_LIST_0, i ); 2340 if ( pcRefPic != NULL ) 2341 { 2342 if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() ) 2343 { 2344 pcRefPicYuvOrg = pcRefPic->getPicYuvOrg(); 2345 } 2346 } 2347 } 2348 2349 if ( pcRefPicYuvOrg != NULL ) 2350 { 2351 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 2352 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 2353 Int iCurrStride = pcCurrPicYuv->getStride(); 2354 Int iRefStride = pcRefPicYuvOrg->getStride(); 2355 Int iSumOrgSAD = 0; 2356 Double dThresholdOrgSAD = getIsDepth() ? 0.1 : 0.05; 2357 2358 // Histogram building - luminance 2359 for ( Int y = 0; y < iHeight; y++ ) 2360 { 2361 for ( Int x = 0; x < iWidth; x++ ) 2362 { 2363 aiCurrHist[pCurrY[x]]++; 2364 aiRefOrgHist[pRefOrgY[x]]++; 2365 } 2366 pCurrY += iCurrStride; 2367 pRefOrgY += iRefStride; 2368 } 2369 // Histogram SAD 2370 for ( Int i = 0; i < iMaxPelValue; i++ ) 2371 { 2372 iSumOrgSAD += abs( aiCurrHist[i] - aiRefOrgHist[i] ); 2373 } 2374 // Setting 2375 if ( iSumOrgSAD > Int( dThresholdOrgSAD * iWidth * iHeight ) ) 2376 { 2377 m_bApplyIC = true; 2378 } 2379 else 2380 { 2381 m_bApplyIC = false; 2382 } 2383 } 2384 2385 xFree( aiCurrHist ); 2386 xFree( aiRefOrgHist ); 2387 aiCurrHist = NULL; 2388 aiRefOrgHist = NULL; 2389 } 2390 #endif 2391 2302 2392 /** get scaling matrix from RefMatrixID 2303 2393 * \param sizeId size index
Note: See TracChangeset for help on using the changeset viewer.