Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon
- Timestamp:
- 1 Nov 2012, 19:22:41 (12 years ago)
- Location:
- branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.cpp
r165 r166 89 89 } 90 90 91 #if NTT_SUBPEL 92 Void 93 TAppComCamPara::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ) 94 { 95 AOF( m_uiBitDepthForLUT == 8 ); 96 AOF( raiLUT0 == NULL && raiLUT1 == NULL ); 97 98 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 99 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 100 101 raiLUT0 = new Int ***[ uiNumberSourceViews ]; 102 raiLUT1 = new Int ***[ uiNumberSourceViews ]; 103 104 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 105 { 106 raiLUT0 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 107 raiLUT1 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 108 109 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 110 { 111 raiLUT0 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 112 raiLUT0 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 113 raiLUT0 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 114 raiLUT1 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 115 raiLUT1 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 116 raiLUT1 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 117 } 118 } 119 } 120 #endif 91 121 92 122 Void … … 928 958 } 929 959 960 #if NTT_SUBPEL 961 Void 962 TAppComCamPara::xSetShiftParametersAndLUT( UInt uiNumberSourceViews, UInt uiNumberTargetViews, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos ) 963 { 964 if( uiNumberSourceViews <= 1 || uiNumberTargetViews == 0 ) 965 { 966 return; 967 } 968 AOF( raiLUT_Disp != NULL && raiLUT_Fracpos != NULL ); 969 AOF( m_uiBitDepthForLUT == 8 ); 970 971 Int iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2Div > 0 ); 972 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 973 { 974 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 975 { 976 // integer-valued scale and offset 977 Int64 iScale, iOffset; 978 xGetShiftParameterInt ( uiSourceView, uiTargetView, uiFrame, false, true, iScale, iOffset ); 979 980 // offsets including rounding offsets 981 iOffset += ( 1 << iLog2Div ) >> 1; 982 983 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 984 { 985 Int64 iTempScale = (Int64)uiDepthValue * iScale; 986 Int iShiftSubpel = (Int) (( iTempScale + iOffset ) >> iLog2Div); 987 Int iShiftPelLuma = iShiftSubpel >> m_iLog2Precision; // better to have rounding ? 988 Int iShiftPelChroma = iShiftPelLuma >> 1; 989 990 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma; 991 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma; 992 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision ); 993 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) ); 994 995 #if 0 // NTT bugfix 996 if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 ) 997 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]; 998 if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 ) 999 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]; 1000 #endif 1001 1002 #if _DEBUG 1003 AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision ) == 0 ); 1004 AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 ); 1005 #endif 1006 } 1007 1008 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 1009 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 1010 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 1011 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 1012 } 1013 } 1014 } 1015 #endif 930 1016 931 1017 Void … … 936 1022 xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, uiFrame, false, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT, m_adBaseViewShiftParameter, m_aiBaseViewShiftParameter ); 937 1023 xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfSynthViews, uiFrame, true, m_adSynthViewShiftLUT, m_aiSynthViewShiftLUT, m_adSynthViewShiftParameter, m_aiSynthViewShiftParameter ); 1024 #if NTT_SUBPEL 1025 xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, uiFrame, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 1026 #endif 938 1027 }; 939 1028 … … 1066 1155 m_aiSynthViewShiftLUT = 0; 1067 1156 1157 #if NTT_SUBPEL 1158 m_aiBaseViewShiftLUT_ipel = 0; 1159 m_aiBaseViewShiftLUT_fpos = 0; 1160 #endif 1161 1068 1162 m_bSetupFromCoded = false; 1069 1163 m_bCamParsCodedPrecSet = false; … … 1091 1185 xDeleteArray( m_aaiPdmScaleNomDelta, m_iNumberOfBaseViews ); 1092 1186 xDeleteArray( m_aaiPdmOffset, m_iNumberOfBaseViews ); 1187 1188 #if NTT_SUBPEL 1189 xDeleteArray( m_aiBaseViewShiftLUT_ipel, m_iNumberOfBaseViews, m_iNumberOfBaseViews, 2 ); 1190 xDeleteArray( m_aiBaseViewShiftLUT_fpos, m_iNumberOfBaseViews, m_iNumberOfBaseViews, 2 ); 1191 #endif 1093 1192 } 1094 1193 … … 1337 1436 xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiPdmOffset ); 1338 1437 1438 #if NTT_SUBPEL 1439 xCreateLUTs_Subpel( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos); 1440 #endif 1441 1339 1442 //===== init disparity to virtual depth conversion parameters ===== 1340 1443 xSetPdmConversionParams(); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.h
r165 r166 107 107 Int**** m_aiSynthViewShiftLUT; ///< Disparity LUT 108 108 109 #if NTT_SUBPEL 110 Int**** m_aiBaseViewShiftLUT_ipel; ///< Disparity LUT 111 Int**** m_aiBaseViewShiftLUT_fpos; ///< Disparity LUT 112 #endif 109 113 110 114 protected: … … 117 121 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 118 122 123 #if NTT_SUBPEL 124 Void xCreateLUTs_Subpel ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ); 125 #endif 126 119 127 // functions for reading, initialization, sorting, getting data, etc. 120 128 Void xReadCameraParameterFile ( Char* pchCfgFileName ); … … 143 151 Void xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Bool bExternalReference, Double****& radLUT, Int****& raiLUT, Double***& radShiftParams, Int64***& raiShiftParams ); 144 152 Void xSetShiftParametersAndLUT ( UInt uiFrame ); 145 153 #if NTT_SUBPEL 154 Void xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos ); 155 #endif 146 156 147 157 // getting conversion parameters for disparity to virtual depth conversion … … 211 221 Int**** getSynthViewShiftLUTI () { return m_aiSynthViewShiftLUT; } 212 222 Int**** getBaseViewShiftLUTI () { return m_aiBaseViewShiftLUT; } 223 224 #if NTT_SUBPEL 225 Int**** getBaseViewIPelLUT () { return m_aiBaseViewShiftLUT_ipel; } 226 Int**** getBaseViewFPosLUT () { return m_aiBaseViewShiftLUT_fpos; } 227 #endif 213 228 214 229 Bool getVaryingCameraParameters() { return m_bCamParsVaryOverTime; }
Note: See TracChangeset for help on using the changeset viewer.