Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp
- Timestamp:
- 24 Feb 2012, 20:22:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp
r21 r28 76 76 77 77 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 78 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257];79 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257];78 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ SizeOfLUT+1 ]; 79 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ SizeOfLUT+1 ]; 80 80 81 81 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 82 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257];83 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257];82 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ SizeOfLUT+1 ]; 83 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ SizeOfLUT+1 ]; 84 84 } 85 85 } … … 877 877 radShiftParams[ uiSourceView][ uiTargetView ][ 1 ] = dOffset; 878 878 879 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 880 { 879 #if POZNAN_NONLINEAR_DEPTH 880 TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0); 881 #endif 882 883 for( UInt uiDepthValue = 0; uiDepthValue < SizeOfLUT; uiDepthValue++ ) 884 { 885 Double dDepthValue = (Double)uiDepthValue; 886 Int64 iDepthValue = (Int64)uiDepthValue; 887 #if POZNAN_NONLINEAR_DEPTH 888 dDepthValue = cNonlinearDepthBwd(dDepthValue); 889 iDepthValue = (Int64)(dDepthValue+0.5); 890 #endif 891 #if POZNAN_LUT_INCREASED_PRECISION 892 dDepthValue /= (1<<g_uiBitIncrement); 893 #endif 881 894 // real-valued look-up tables 882 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 895 896 Double dShiftLuma = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 883 897 Double dShiftChroma = dShiftLuma / 2; 884 898 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; … … 886 900 887 901 // integer-valued look-up tables 888 Int64 iTempScale = (Int64)uiDepthValue * iScale; 902 Int64 iTempScale = iDepthValue * iScale; 903 #if POZNAN_LUT_INCREASED_PRECISION 904 iTempScale >>= g_uiBitIncrement; 905 #endif 889 906 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters 890 907 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; … … 899 916 } 900 917 901 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255];902 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255];903 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255];904 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255];918 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ]; 919 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ]; 920 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ]; 921 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ]; 905 922 } 906 923 } … … 1235 1252 Char* pchSynthViewNumbers, 1236 1253 std::vector<Int>* paiSynthViewNumbers, 1237 Int iLog2Precision ) 1254 Int iLog2Precision 1255 #if POZNAN_NONLINEAR_DEPTH 1256 ,Float fDepthPower 1257 #endif 1258 ) 1238 1259 { 1239 1260 //===== set miscellaneous variables ===== … … 1243 1264 m_uiCamParsCodedPrecision = uiCodedCamParsPrecision; 1244 1265 m_iLog2Precision = iLog2Precision; 1266 1267 #if POZNAN_NONLINEAR_DEPTH 1268 m_fDepthPower = fDepthPower; 1269 #endif 1245 1270 1246 1271 xReadCameraParameterFile( pchCfgFileName ); … … 1460 1485 } 1461 1486 1487 #if POZNAN_SYNTH 1488 Bool 1489 TAppComCamPara::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 1490 { 1491 riNearestViewIdx = 0; 1492 1493 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 1494 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 1495 1496 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 1497 { 1498 rbRenderFromLeft = true; 1499 } 1500 else 1501 { 1502 rbRenderFromLeft = false; 1503 } 1504 1505 riRelDistToLeft = 128; //Not used for now; 1506 1507 return true; 1508 } 1509 #endif 1510 1511 1512 1462 1513 Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ) 1463 1514 { … … 1474 1525 return xGetViewId(m_aiRelSynthViewsNum, iRelNum ); 1475 1526 } 1527 1528 1529 #if POZNAN_MP 1530 Bool 1531 TAppComCamPara::isLeftView( Int iSynthViewIdx, Int iNearestViewIdx) 1532 { 1533 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 1534 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 1535 1536 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[iNearestViewIdx] ) * iFactor <= 0 ) return true; 1537 else return false; 1538 } 1539 #endif
Note: See TracChangeset for help on using the changeset viewer.