Changeset 189 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 18 Nov 2012, 22:11:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComSlice.cpp
r116 r189 112 112 , m_iViewOrderIdx ( 0 ) 113 113 #endif 114 #if LGE_ILLUCOMP_B0045 115 , m_bApplyIC ( false ) 116 #endif 114 117 { 115 118 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; … … 1305 1308 } 1306 1309 1310 #if LGE_ILLUCOMP_B0045 1311 Void TComSlice::xSetApplyIC() 1312 { 1313 Int iMaxPelValue = (1<<g_uiBitDepth); 1314 Int *aiRefOrgHist; 1315 Int *aiCurrHist; 1316 aiRefOrgHist = new Int; 1317 aiCurrHist = new Int; 1318 aiRefOrgHist = (Int *)xMalloc(Int,iMaxPelValue); 1319 aiCurrHist = (Int *)xMalloc(Int,iMaxPelValue); 1320 memset(aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) ); 1321 memset(aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 1322 // Reference Idx Number 1323 Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 ); 1324 TComPic* pcCurrPic = NULL; 1325 TComPic* pcRefPic = NULL; 1326 TComPicYuv* pcCurrPicYuv = NULL; 1327 TComPicYuv* pcRefPicYuvOrg = NULL; 1328 pcCurrPic = getPic(); 1329 pcCurrPicYuv = pcCurrPic->getPicYuvOrg(); 1330 Int iWidth = pcCurrPicYuv->getWidth(); 1331 Int iHeight = pcCurrPicYuv->getHeight(); 1332 1333 1334 // Get InterView Reference picture 1335 // !!!!! Assume only one Interview Reference Picture in L0 1336 for (Int i = 0; i < iNumRefIdx; i++) 1337 { 1338 pcRefPic = getRefPic( REF_PIC_LIST_0, i); 1339 if (pcRefPic != NULL) 1340 { 1341 // Current Picture 1342 if (pcCurrPic->getViewId() != pcRefPic->getViewId()) 1343 { 1344 pcRefPicYuvOrg = pcRefPic->getPicYuvOrg(); 1345 } 1346 } 1347 } 1348 if (pcRefPicYuvOrg != NULL) 1349 { 1350 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 1351 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 1352 Int iCurrStride = pcCurrPicYuv->getStride(); 1353 Int iRefStride = pcRefPicYuvOrg->getStride(); 1354 Int iSumOrgSAD = 0; 1355 double dThresholdOrgSAD = 0.05; 1356 // Histogram building - luminance 1357 for ( Int y = 0; y < iHeight; y++) 1358 { 1359 for ( Int x = 0; x < iWidth; x++) 1360 { 1361 aiCurrHist[pCurrY[x]]++; 1362 aiRefOrgHist[pRefOrgY[x]]++; 1363 } 1364 pCurrY += iCurrStride; 1365 pRefOrgY += iRefStride; 1366 } 1367 // Calc SAD 1368 for (Int i = 0; i < iMaxPelValue; i++) 1369 { 1370 iSumOrgSAD += abs(aiCurrHist[i] - aiRefOrgHist[i]); 1371 } 1372 // Setting 1373 if ( iSumOrgSAD > Int(dThresholdOrgSAD * iWidth * iHeight) ) 1374 { 1375 m_bApplyIC = true; 1376 } 1377 else 1378 { 1379 m_bApplyIC = false; 1380 } 1381 } 1382 xFree(aiCurrHist); 1383 xFree(aiRefOrgHist); 1384 aiCurrHist = NULL; 1385 aiRefOrgHist = NULL; 1386 } 1387 #endif 1388 1307 1389 // ------------------------------------------------------------------------------------------------ 1308 1390 // Video parameter set (VPS) … … 1441 1523 , m_bUseDMM (false) 1442 1524 #endif 1443 #if OL_ DEPTHLIMIT_A00441444 , m_b DepthPartitionLimiting(false)1525 #if OL_QTLIMIT_PREDCODING_B0068 1526 , m_bUseQTLPC (false) 1445 1527 #endif 1446 1528 { … … 1475 1557 1476 1558 ::memset( m_aiUsableInterViewRefs, 0, sizeof( m_aiUsableInterViewRefs ) ); 1559 1560 #if RWTH_SDC_DLT_B0036 1561 m_bUseDLT = false; 1562 1563 m_uiBitsPerDepthValue = g_uiBitDepth; 1564 m_uiNumDepthmapValues = 0; 1565 m_uiDepthValue2Idx = NULL; 1566 m_uiIdx2DepthValue = NULL; 1567 #endif 1477 1568 } 1478 1569 … … 1490 1581 } 1491 1582 } 1583 1584 #if RWTH_SDC_DLT_B0036 1585 Void TComSPS::setDepthLUTs(UInt* uidx2DepthValue, UInt uiNumDepthValues) 1586 { 1587 UInt uiMaxDepthValue = g_uiIBDI_MAX; 1588 1589 // allocate some memory 1590 if( m_uiNumDepthmapValues == 0 ) 1591 { 1592 m_uiNumDepthmapValues = uiMaxDepthValue+1; 1593 m_uiBitsPerDepthValue = (UInt)ceil(Log2(m_uiNumDepthmapValues)); 1594 1595 m_uiDepthValue2Idx = (UInt*) xMalloc(UInt, m_uiNumDepthmapValues); 1596 m_uiIdx2DepthValue = (UInt*) xMalloc(UInt, m_uiNumDepthmapValues); 1597 1598 //default mapping 1599 for (Int i=0; i<m_uiNumDepthmapValues; i++) 1600 { 1601 m_uiDepthValue2Idx[i] = i; 1602 m_uiIdx2DepthValue[i] = i; 1603 } 1604 } 1605 1606 if( uidx2DepthValue == NULL || uiNumDepthValues == 0 ) // default mapping only 1607 return; 1608 1609 // copy idx2DepthValue to internal array 1610 memcpy(m_uiIdx2DepthValue, uidx2DepthValue, uiNumDepthValues*sizeof(UInt)); 1611 1612 for(Int p=0; p<=uiMaxDepthValue; p++) 1613 { 1614 Int iIdxDown = 0; 1615 Int iIdxUp = uiNumDepthValues-1; 1616 Bool bFound = false; 1617 1618 // iterate over indices to find lower closest depth 1619 Int i = 1; 1620 while(!bFound && i<uiNumDepthValues) 1621 { 1622 if( m_uiIdx2DepthValue[i] > p ) 1623 { 1624 iIdxDown = i-1; 1625 bFound = true; 1626 } 1627 1628 i++; 1629 } 1630 // iterate over indices to find upper closest depth 1631 i = uiNumDepthValues-2; 1632 bFound = false; 1633 while(!bFound && i>=0) 1634 { 1635 if( m_uiIdx2DepthValue[i] < p ) 1636 { 1637 iIdxUp = i+1; 1638 bFound = true; 1639 } 1640 1641 i--; 1642 } 1643 1644 // assert monotony 1645 assert(iIdxDown<=iIdxUp); 1646 1647 // assign closer depth value/idx 1648 if( abs(p-(Int)m_uiIdx2DepthValue[iIdxDown]) < abs(p-(Int)m_uiIdx2DepthValue[iIdxUp]) ) 1649 { 1650 m_uiDepthValue2Idx[p] = iIdxDown; 1651 } 1652 else 1653 { 1654 m_uiDepthValue2Idx[p] = iIdxUp; 1655 } 1656 1657 } 1658 1659 // update globals 1660 m_uiNumDepthmapValues = uiNumDepthValues; 1661 m_uiBitsPerDepthValue = (UInt)ceil(Log2(m_uiNumDepthmapValues)); 1662 } 1663 #endif 1492 1664 1493 1665 TComPPS::TComPPS() … … 1532 1704 , m_cabacInitPresentFlag (false) 1533 1705 , m_encCABACTableIdx (0) 1534 #if POZNAN_CABAC_INIT_FLAG_FIX1706 #if FIX_POZNAN_CABAC_INIT_FLAG 1535 1707 , m_encPrevPOC (0) 1536 1708 #endif
Note: See TracChangeset for help on using the changeset viewer.