Changeset 1396 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenSingleModel.h
- Timestamp:
- 11 Mar 2016, 16:54:51 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibRenderer/TRenSingleModel.h
r1313 r1396 70 70 virtual ~TRenSingleModel() { } 71 71 #if H_3D_VSO_EARLY_SKIP 72 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0; 73 #else 74 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0; 75 #endif 76 77 // Set Frame dependent data 78 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 79 virtual Void setupPart ( UInt uiHorOffset, Int iUsedHeight ) = 0; 80 virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) = 0; 72 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput, Bool bEarlySkip ) = 0; 73 #else 74 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput ) = 0; 75 #endif 76 77 // Setup 78 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 79 virtual Void setupPart ( UInt uiHorOffset, Int iUsedHeight ) = 0; 80 #if RM_FIX_SETUP 81 virtual Void setupLut ( Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft ) = 0; 82 virtual Void setupRefView ( TComPicYuv* pcOrgVideo ) = 0; 83 84 virtual Void renderAll () = 0; 85 virtual Void setStructSynthViewAsRefView () = 0; 86 virtual Void resetStructError () = 0; 87 virtual Void setLimOutStruct ( Int iSourceViewPos ) = 0; 88 #else 89 virtual Void setupLutAndRef ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bRenderRef ) = 0; 90 virtual Void setupInitialState ( Int curViewPosInModel ) = 0; 91 #endif 81 92 82 93 // Set Data … … 114 125 // depth 115 126 Pel iD ; // depth 116 117 // state 118 Bool bOccluded; // Occluded 127 Int aiOccludedPos; // Occluded 128 129 }; 130 131 struct RenModelLimOutPels 132 { 133 Pel iDOther; 134 Int iFilledOther; 135 // video 136 Pel iYOther; 137 Pel iYRef ; 138 #if H_3D_VSO_COLOR_PLANES 139 Pel iUOther; 140 Pel iURef ; 141 Pel iVOther; 142 Pel iVRef ; 143 #endif 144 Int iError ; 119 145 }; 120 146 … … 161 187 // Create Model 162 188 #if H_3D_VSO_EARLY_SKIP 163 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ); 164 #else 165 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ); 166 #endif 167 168 // Set Frame dependent data 169 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 170 Void setupPart ( UInt uiHorOffset, Int uiUsedHeight ); 171 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ); 189 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput, Bool bEarlySkip ); 190 #else 191 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput ); 192 #endif 193 194 // Setup 195 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 196 Void setupPart ( UInt uiHorOffset, Int uiUsedHeight ); 197 #if RM_FIX_SETUP 198 Void setupLut ( Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft); 199 Void setupRefView ( TComPicYuv* pcOrgVideo ); 200 201 __inline Void renderAll( ); 202 Void setStructSynthViewAsRefView (); 203 Void resetStructError (); 204 Void setLimOutStruct ( Int iSourceViewPos ); 205 #else 206 Void setupLutAndRef ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bRenderRef ); 207 Void setupInitialState ( Int curViewPosInModel ); 208 #endif 209 172 210 173 211 #if H_3D_VSO_EARLY_SKIP 174 212 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 175 #else 213 #else 176 214 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 177 #endif 215 #endif 178 216 Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 179 180 // Get Distortion 181 #if H_3D_VSO_EARLY_SKIP 217 218 // Get Distortion 219 #if H_3D_VSO_EARLY_SKIP 182 220 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride); 183 #else 221 #else 184 222 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 185 #endif 223 #endif 186 224 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 187 225 … … 191 229 192 230 private: 231 232 #if !RM_FIX_SETUP 233 __inline Void xRenderAll( ); 234 #endif 235 236 237 #if H_3D_VSO_EARLY_SKIP 238 template < Bool bL, SetMod iSM > RMDist xSetOrGet( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Pel* piOrgData, Int iOrgStride ); 239 #else 240 template < Bool bL, SetMod iSM > RMDist xSetOrGet( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 241 #endif 242 193 243 // Set and inc Current Row 194 __inline Void xSetViewRow( Int iPosY );195 __inline Void xIncViewRow();244 template< SetMod bSM > __inline Void xSetViewRow( Int iPosY ); 245 template< SetMod bSM > __inline Void xIncViewRow(); 196 246 197 247 ///// Rendering ///// 198 // Left to Right 199 #if H_3D_VSO_EARLY_SKIP 200 __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 201 __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 202 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 203 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 204 #else 205 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 206 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 207 #endif 208 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); 209 template<Bool bSet> __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 210 template<Bool bSet> __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 211 template<Bool bSet> __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 212 template<Bool bSet> __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); 213 __inline Int xRangeLeftL ( Int iPos ); 214 __inline Int xRangeRightL ( Int iPos ); 215 __inline Int xRoundL ( Int iPos ); 216 217 // Right to Left 218 __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); 219 template<Bool bSet> __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 220 template<Bool bSet> __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 221 template<Bool bSet> __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 222 template<Bool bSet> __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); 223 __inline Int xRangeLeftR ( Int iPos ); 224 __inline Int xRangeRightR ( Int iPos ); 225 __inline Int xRoundR ( Int iPos ); 226 227 // Blending 228 template<Bool bSet> __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 229 230 #if H_3D_VSO_COLOR_PLANES 231 __inline Void xGetBlendedValue ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ); 232 __inline Void xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ); 233 __inline Void xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ); 234 #else 235 __inline Void xGetBlendedValue ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); 236 __inline Void xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); 237 __inline Void xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); 248 template< typename T, Bool bL > __inline T xPlus ( T arg1, T arg2 ) { return bL ? (arg1 + arg2) : (arg1 - arg2); }; 249 template< typename T, Bool bL > __inline T xMin ( T arg1, T arg2 ) { return bL ? std::min(arg1, arg2) : std::max(arg1, arg2) ;}; 250 template< typename T, Bool bL > __inline T xMax ( T arg1, T arg2 ) { return bL ? std::max(arg1, arg2) : std::min(arg1, arg2) ;}; 251 template< typename T, Bool bL > __inline Void xInc ( T& arg1 ) { bL ? arg1++ : arg1-- ;}; 252 template< typename T, Bool bL > __inline Void xDec ( T& arg1 ) { bL ? arg1-- : arg1++ ;}; 253 template< typename T, Bool bL > __inline Bool xLess ( T arg1, T arg2 ) { return bL ? arg1 < arg2 : arg1 > arg2; }; 254 template< typename T, Bool bL > __inline Bool xGeQ ( T arg1, T arg2 ) { return bL ? arg1 >= arg2 : arg1 <= arg2; }; 255 template< Bool bL > __inline Int xZero ( ) { return bL ? 0 : m_iWidth - 1; }; 256 template< Bool bL > __inline Int xWidthMinus1( ) { return bL ? m_iWidth - 1 : 0; }; 257 #if H_3D_VSO_EARLY_SKIP 258 template< Bool bL > __inline Bool xDetectEarlySkip ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData,const Pel* piOrgData, Int iOrgStride ); 259 template< Bool bL, SetMod bSM > __inline RMDist xRender ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 260 template< SetMod bSM > __inline RMDist xGetSSE ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 261 #else 262 template< Bool bL, SetMod bSM > __inline RMDist xRender ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 263 template< SetMod bSM > __inline RMDist xGetSSE ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 264 #endif 265 template< Bool bL > __inline Void xInitRenderPart ( Int iEndChangePos, Int iLastSPos ); 266 template< Bool bL, SetMod bSM > __inline Void xRenderRange ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 267 template< Bool bL, SetMod bSM > __inline Void xRenderShiftedRange( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 268 template< Bool bL, SetMod bSM > __inline Void xFillHole ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 269 template< Bool bL, SetMod bSM > __inline Void xExtrapolateMargin ( Int iCurSPos, Int iCurPos, RMDist& riError ); 270 template< Bool bL > __inline Int xRangeLeft ( Int iPos ); 271 template< Bool bL > __inline Int xRangeRight ( Int iPos ); 272 template< Bool bL > __inline Int xRound ( Int iPos ); 273 274 #if H_3D_VSO_COLOR_PLANES 275 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValue ( Pel& riY, Pel iYL, Pel iYR, Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 276 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM1 ( Pel& riY, Pel iYL, Pel iYR, Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 277 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM2 ( Pel& riY, Pel iYL, Pel iYR, Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 278 #else 279 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValue ( Pel& riY, Pel iYL, Pel iYR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 280 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM1 ( Pel& riY, Pel iYL, Pel iYR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 281 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM2 ( Pel& riY, Pel iYL, Pel iYR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 238 282 #endif 239 283 __inline Pel xBlend ( Pel pVal1, Pel pVal2, Int iWeightVal2 ); 240 284 241 285 // General 242 template<Bool bSet> __inline Void xSetShiftedPelL (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 243 template<Bool bSet> __inline Void xSetShiftedPelBlendL (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 244 template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 245 246 template<Bool bSet> __inline Void xSetShiftedPelR (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 247 template<Bool bSet> __inline Void xSetShiftedPelBlendR (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 248 template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 249 250 __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); 251 __inline Int xShift ( Int iPos ); 252 __inline Int xShift ( Int iPos, Int iPosInNewData ); 286 template<Bool bL, SetMod bSM> __inline Void xSetShiftedPel (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 287 288 template <Bool bL> __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); 289 template <Bool bL> __inline Int xShift ( Int iPos ); 290 template <Bool bL> __inline Int xShift ( Int iPos, Int iPosInNewData ); 291 292 __inline Int xShiftDept ( Int iPosXinSubPel, Int iDepth ); 293 253 294 __inline Int xGetDist ( Int iDiffY, Int iDiffU, Int iDiffV ); 254 295 __inline Int xGetDist ( Int iDiffY ); … … 264 305 Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ); 265 306 #endif 266 Void xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); 307 Void xGetSampleStrDepthPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); 308 Void xGetSampleStrFilledPtrs( Int iViewNum, Int RenModelOutPels::*& rpiSrcFilled ); 309 267 310 268 311 Void xSetStructRefView (); 312 #if !RM_FIX_SETUP 269 313 Void xResetStructError (); 314 Void xSetLimOutStruct (Int iSourceViewPos ); 315 #endif 316 270 317 Void xInitSampleStructs (); 318 #if !RM_FIX_SETUP 271 319 Void xSetStructSynthViewAsRefView (); 320 #endif 272 321 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget ); 273 322 … … 340 389 341 390 //// Output Samples 342 RenModelOutPels* m_pcOutputSamples; 391 RenModelOutPels* m_pcOutputSamples; 392 RenModelLimOutPels* m_pcLimOutputSamples; 393 343 394 Int m_iOutputSamplesStride; 344 395 … … 349 400 Bool m_bInOcclusion; // Currently rendering in occluded area 350 401 Int m_iLastOccludedSPos; // Position of last topmost shifted position 351 Int m_iLastOccludedSPosFP; // Position of last topmost shifted position in FullPels 352 353 Int m_ iCurViewPos; // Current View Position 0: Left, 1: Right354 Int m_iOtherViewPos; // Other View Position 0: Left, 1: Right 402 403 Int m_curRangeStart; 404 Int m_lastRangeStart; 405 355 406 const Pel* m_piNewDepthData; // Pointer to new depth data 356 407 Int m_iStartChangePosX; // Start Position of new data … … 377 428 //// Current Pointers //// 378 429 379 RenModelInPels* m_pcInputSamplesRow [2]; 380 RenModelOutPels* m_pcOutputSamplesRow; 430 RenModelInPels* m_pcInputSamplesRow [2]; 431 RenModelOutPels* m_pcOutputSamplesRow; 432 RenModelLimOutPels* m_pcLimOutputSamplesRow; 381 433 382 434 //// MISC //// 383 const Int m_iDistShift; // Shift in Distortion computation 435 const Int m_iDistShift; // Shift in Distortion computation 436 Bool m_bLimOutput; // Save distortion only 384 437 385 438 //// Early Skip … … 389 442 }; 390 443 391 #endif // NH_3D444 #endif // H_3D 392 445 #endif //__TRENSINGLEMODEL__ 393 446
Note: See TracChangeset for help on using the changeset viewer.