Changeset 552 in 3DVCSoftware
- Timestamp:
- 5 Aug 2013, 09:49:41 (11 years ago)
- Location:
- branches/HTM-DEV-2.0-dev2-Sharp
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.cpp
r537 r552 39 39 #include "TComPrediction.h" 40 40 41 #if SHARP_ILLUCOMP_REFINE_E0046 42 #define IC_REG_COST_SHIFT 7 43 #define IC_CONST_SHIFT 5 44 #define IC_SHIFT_DIFF 12 45 #endif 46 41 47 //! \ingroup TLibCommon 42 48 //! \{ … … 131 137 } 132 138 #if H_3D_IC 139 #if SHARP_ILLUCOMP_REFINE_E0046 140 m_uiaShift[0] = 0; 133 141 for( Int i = 1; i < 64; i++ ) 134 142 { 143 m_uiaShift[i] = ( (1 << 15) + i/2 ) / i; 144 } 145 #else 146 for( Int i = 1; i < 64; i++ ) 147 { 135 148 m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i; 136 149 } 150 #endif 137 151 #endif 138 152 } … … 679 693 #endif 680 694 , bICFlag ); 695 #if SHARP_ILLUCOMP_REFINE_E0046 696 bICFlag = bICFlag && (iWidth > 8); 697 #endif 681 698 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 682 699 #if H_3D_ARP … … 973 990 if( bICFlag ) 974 991 { 992 #if SHARP_ILLUCOMP_REFINE_E0046 993 Int a, b, i, j; 994 const Int iShift = IC_CONST_SHIFT; 995 996 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 997 #else 975 998 Int a, b, iShift, i, j; 976 999 977 1000 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA ); 1001 #endif 1002 978 1003 979 1004 for ( i = 0; i < height; i++ ) … … 1093 1118 if( bICFlag ) 1094 1119 { 1120 #if SHARP_ILLUCOMP_REFINE_E0046 1121 Int a, b, i, j; 1122 const Int iShift = IC_CONST_SHIFT; 1123 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb 1124 #else 1095 1125 Int a, b, iShift, i, j; 1096 1126 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb 1127 #endif 1097 1128 for ( i = 0; i < cxHeight; i++ ) 1098 1129 { … … 1109 1140 dstCb += dstStride; 1110 1141 } 1142 #if SHARP_ILLUCOMP_REFINE_E0046 1143 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr 1144 #else 1111 1145 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr 1146 #endif 1112 1147 for ( i = 0; i < cxHeight; i++ ) 1113 1148 { … … 1316 1351 /** Function for deriving LM illumination compensation. 1317 1352 */ 1353 #if SHARP_ILLUCOMP_REFINE_E0046 1354 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ) 1355 #else 1318 1356 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType ) 1357 #endif 1319 1358 { 1320 1359 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); … … 1344 1383 1345 1384 Int x = 0, y = 0, xx = 0, xy = 0; 1385 #if SHARP_ILLUCOMP_REFINE_E0046 1386 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 1387 #endif 1346 1388 1347 1389 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) … … 1365 1407 } 1366 1408 1409 #if SHARP_ILLUCOMP_REFINE_E0046 1410 for( j = 0; j < uiWidth; j+=2 ) 1411 #else 1367 1412 for( j = 0; j < uiWidth; j++ ) 1413 #endif 1368 1414 { 1369 1415 x += pRef[j]; 1370 1416 y += pRec[j]; 1417 #if SHARP_ILLUCOMP_REFINE_E0046 1418 xx += (pRef[j] * pRef[j])>>precShift; 1419 xy += (pRef[j] * pRec[j])>>precShift; 1420 #else 1371 1421 xx += pRef[j] * pRef[j]; 1372 1422 xy += pRef[j] * pRec[j]; 1373 } 1423 #endif 1424 } 1425 #if SHARP_ILLUCOMP_REFINE_E0046 1426 iCountShift += g_aucConvertToBit[ uiWidth ] + 1; 1427 #else 1374 1428 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1429 #endif 1375 1430 } 1376 1431 … … 1396 1451 } 1397 1452 1453 #if SHARP_ILLUCOMP_REFINE_E0046 1454 for( i = 0; i < uiHeight; i+=2 ) 1455 #else 1398 1456 for( i = 0; i < uiHeight; i++ ) 1457 #endif 1399 1458 { 1400 1459 x += pRef[0]; 1401 1460 y += pRec[0]; 1461 #if SHARP_ILLUCOMP_REFINE_E0046 1462 xx += (pRef[0] * pRef[0])>>precShift; 1463 xy += (pRef[0] * pRec[0])>>precShift; 1464 1465 pRef += iRefStride*2; 1466 pRec += iRecStride*2; 1467 #else 1402 1468 xx += pRef[0] * pRef[0]; 1403 1469 xy += pRef[0] * pRec[0]; … … 1405 1471 pRef += iRefStride; 1406 1472 pRec += iRecStride; 1407 } 1473 #endif 1474 } 1475 #if SHARP_ILLUCOMP_REFINE_E0046 1476 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 ); 1477 #else 1408 1478 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1409 } 1410 1479 #endif 1480 } 1481 1482 #if SHARP_ILLUCOMP_REFINE_E0046 1483 xy += xx >> IC_REG_COST_SHIFT; 1484 xx += xx >> IC_REG_COST_SHIFT; 1485 Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift); 1486 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 1487 const Int iShift = IC_CONST_SHIFT; 1488 { 1489 #else 1411 1490 Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1412 1491 … … 1432 1511 Int a1 = ( xy << iCountShift ) - y * x; 1433 1512 Int a2 = ( xx << iCountShift ) - x * x; 1434 1513 #endif 1435 1514 { 1436 1515 const Int iShiftA2 = 6; 1516 #if !SHARP_ILLUCOMP_REFINE_E0046 1437 1517 const Int iShiftA1 = 15; 1518 #endif 1438 1519 const Int iAccuracyShift = 15; 1439 1520 … … 1443 1524 Int a2s = a2; 1444 1525 1526 #if SHARP_ILLUCOMP_REFINE_E0046 1527 a1 = Clip3(0, 2*a2, a1); 1528 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1529 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 1530 #else 1445 1531 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1446 1532 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1533 #endif 1447 1534 1448 1535 if( iScaleShiftA1 < 0 ) … … 1458 1545 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1459 1546 1547 1460 1548 a2s = a2 >> iScaleShiftA2; 1461 1549 1462 1550 a1s = a1 >> iScaleShiftA1; 1463 1551 1552 #if SHARP_ILLUCOMP_REFINE_E0046 1553 a = a1s * m_uiaShift[ a2s ]; 1554 a = a >> iScaleShiftA; 1555 #else 1464 1556 if (a2s >= 1) 1465 1557 { … … 1494 1586 iShift -= (9-n); 1495 1587 } 1496 1588 #endif 1497 1589 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1498 1590 } -
branches/HTM-DEV-2.0-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.h
r531 r552 76 76 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 77 77 #if H_3D_IC 78 #if SHARP_ILLUCOMP_REFINE_E0046 79 UInt m_uiaShift[ 64 ]; // Table for multiplication to substitue of division operation 80 #else 78 81 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation 82 #endif 79 83 #endif 80 84 … … 127 131 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 128 132 #if H_3D_IC 133 #if SHARP_ILLUCOMP_REFINE_E0046 134 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ); 135 #else 129 136 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType ); 137 #endif 130 138 #endif 131 139 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); -
branches/HTM-DEV-2.0-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h
r543 r552 96 96 // Unifying rounding offset, for IC part, JCT3V-D0135 97 97 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 98 #define SHARP_ILLUCOMP_REFINE_E0046 1 99 100 98 101 #if H_3D_NBDV 99 102 #define H_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation
Note: See TracChangeset for help on using the changeset viewer.