Changeset 100 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenSingleModel.h
- Timestamp:
- 9 Aug 2012, 12:53:16 (14 years ago)
- File:
-
- 1 edited
-
trunk/source/Lib/TLibRenderer/TRenSingleModel.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibRenderer/TRenSingleModel.h
r56 r100 55 55 56 56 57 #if HHI_VSO_RM_ASSERTIONS 58 #define RM_AOT( exp ) AOT ( exp ) 59 #define RM_AOF( exp ) AOF ( exp ) 60 #else 61 #define RM_AOT( exp ) ((void)0) 62 #define RM_AOF( exp ) ((void)0) 63 #endif 64 65 #define RenModRemoveBitInc( exp ) bBitInc ? ( RemoveBitIncrement( exp ) ) : ( exp ) 66 57 67 class TRenSingleModel 58 68 { 69 public: 70 #if LGE_VSO_EARLY_SKIP_A0093 71 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0; 72 #else 73 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0; 74 #endif 75 76 // Set Frame dependent data 77 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 78 virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ) = 0; 79 80 // Set Data 81 #ifdef LGE_VSO_EARLY_SKIP_A0093 82 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ) = 0; 83 #else 84 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 85 #endif 86 virtual Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 87 88 // Get Distortion 89 #ifdef LGE_VSO_EARLY_SKIP_A0093 90 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride)=0; 91 #else 92 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 93 #endif 94 virtual RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 95 96 virtual Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; 97 virtual Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; 98 virtual Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; 99 }; 100 101 template < BlenMod iBM, Bool bBitInc > 102 class TRenSingleModelC : public TRenSingleModel 103 { 104 struct RenModelInPels 105 { 106 // video 107 Pel aiY[5] ; // y-value 108 #if HHI_VSO_COLOR_PLANES 109 Pel aiU[5] ; // u-value 110 Pel aiV[5] ; // v-value 111 #endif 112 // depth 113 Pel iD ; // depth 114 115 // state 116 Bool bOccluded; // Occluded 117 }; 118 119 struct RenModelOutPels 120 { 121 // video 122 Pel iYLeft ; 123 Pel iYRight ; 124 Pel iYBlended ; 125 #if HHI_VSO_COLOR_PLANES 126 Pel iULeft ; 127 Pel iURight ; 128 Pel iUBlended ; 129 Pel iVLeft ; 130 Pel iVRight ; 131 Pel iVBlended ; 132 #endif 133 // depth 134 Pel iDLeft ; 135 Pel iDRight ; 136 Pel iDBlended ; 137 138 // state 139 Int iFilledLeft ; 140 Int iFilledRight; 141 142 // error 143 Int iError ; 144 145 // reference 146 Pel iYRef ; 147 #if HHI_VSO_COLOR_PLANES 148 Pel iURef ; 149 Pel iVRef ; 150 #endif 151 }; 152 153 59 154 60 155 public: 61 TRenSingleModel ();62 ~TRenSingleModel ();156 TRenSingleModelC(); 157 ~TRenSingleModelC(); 63 158 64 159 // Create Model 160 #if LGE_VSO_EARLY_SKIP_A0093 161 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ); 162 #else 65 163 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ); 164 #endif 66 165 67 166 // Set Frame dependent data 68 167 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 69 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ); 70 71 // Set Data 168 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ); 169 170 #if LGE_VSO_EARLY_SKIP_A0093 171 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ); 172 #else 72 173 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 174 #endif 73 175 Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 74 176 75 177 // Get Distortion 178 #ifdef LGE_VSO_EARLY_SKIP_A0093 179 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride); 180 #else 76 181 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 182 #endif 77 183 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 78 184 79 // Get Rendered Data 80 Void getSynthView( Int iViewPos, Pel**& rppiRenVideoPel, Pel*& rpiRenDepthPel, Int& riStride ); 81 82 // Get Reference Data 83 Void getRefView ( TComPicYuv*& rpcPicYuvRefView, Pel**& rppiRefVideoPel, Int*& raiStrides ); 185 Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 186 Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 187 Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 84 188 85 189 private: … … 90 194 ///// Rendering ///// 91 195 // Left to Right 92 __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bSet); 93 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); 94 __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 95 __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 96 __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 97 __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); 98 __inline Int xRangeLeftL ( Int iPos ); 99 __inline Int xRangeRightL ( Int iPos ); 100 __inline Int xRoundL ( Int iPos ); 196 #ifdef LGE_VSO_EARLY_SKIP_A0093 197 __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ); 198 __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ); 199 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast ); 200 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast ); 201 #else 202 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 203 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 204 #endif 205 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); 206 template<Bool bSet> __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 207 template<Bool bSet> __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 208 template<Bool bSet> __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 209 template<Bool bSet> __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); 210 __inline Int xRangeLeftL ( Int iPos ); 211 __inline Int xRangeRightL ( Int iPos ); 212 __inline Int xRoundL ( Int iPos ); 101 213 102 214 // Right to Left 103 __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bSet ); 104 __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); 105 __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 106 __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 107 __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 108 __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); 109 __inline Int xRangeLeftR ( Int iPos ); 110 __inline Int xRangeRightR ( Int iPos ); 111 __inline Int xRoundR ( Int iPos ); 215 __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); 216 template<Bool bSet> __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 217 template<Bool bSet> __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 218 template<Bool bSet> __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 219 template<Bool bSet> __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); 220 __inline Int xRangeLeftR ( Int iPos ); 221 __inline Int xRangeRightR ( Int iPos ); 222 __inline Int xRoundR ( Int iPos ); 112 223 113 224 // Blending 114 __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );225 template<Bool bSet> __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 115 226 116 227 #if HHI_VSO_COLOR_PLANES … … 125 236 __inline Pel xBlend ( Pel pVal1, Pel pVal2, Int iWeightVal2 ); 126 237 127 // General 128 __inline Void xSetShiftedPel ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 238 // General 239 template<Bool bSet> __inline Void xSetShiftedPelL (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 240 template<Bool bSet> __inline Void xSetShiftedPelBlendL (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 241 template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 242 243 template<Bool bSet> __inline Void xSetShiftedPelR (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 244 template<Bool bSet> __inline Void xSetShiftedPelBlendR (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 245 template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 246 129 247 __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); 130 248 __inline Int xShift ( Int iPos ); … … 134 252 135 253 // Utilities 136 __inline Void xInitView ( Int iViewPos );137 254 __inline Void xSetPels ( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal ); 138 255 __inline Void xSetBools ( Bool* pbSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal ); 139 256 __inline Void xSetInts ( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal ); 257 258 #if HHI_VSO_COLOR_PLANES 259 Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV ); 260 #else 261 Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ); 262 #endif 263 Void xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); 264 265 Void xSetStructRefView (); 266 Void xResetStructError (); 267 Void xInitSampleStructs (); 268 Void xSetStructSynthViewAsRefView (); 269 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset ); 270 271 272 template< typename S, typename T> 273 Void xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight ) 274 { 275 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) 276 { 277 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) 278 { 279 ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement; 280 } 281 ptSource += iSourceStride; 282 ptTarget += iTargetStride; 283 } 284 } 285 286 template< typename S, typename T> 287 Void xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight ) 288 { 289 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) 290 { 291 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) 292 { 293 ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement; 294 } 295 ptSource += iSourceStride; 296 ptTarget += iTargetStride; 297 } 298 } 140 299 141 300 private: … … 151 310 Int m_iSampledStride; 152 311 312 RenModelInPels* m_pcInputSamples[2]; 313 Int m_iInputSamplesStride; 314 153 315 // Base 154 316 Pel** m_aapiBaseVideoPel [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane 0-> Y, 1->U, 2->V … … 157 319 Pel* m_apiBaseDepthPel [2]; // Dim1: ViewPosition 158 320 Int m_aiBaseDepthStrides [2]; // Dim1: ViewPosition 321 159 322 160 323 // LUT … … 170 333 //// Reference Data //// 171 334 TComPicYuv* m_pcPicYuvRef ; // Reference PIcYuv 335 336 //// Output Samples 337 RenModelOutPels* m_pcOutputSamples; 338 Int m_iOutputSamplesStride; 339 172 340 Pel* m_aapiRefVideoPel [3]; // Dim1: Plane 0-> Y, 1->U, 2->V 173 341 Int m_aiRefVideoStrides [3]; // Dim1: Plane 0-> Y, 1->U, 2->V 174 175 // Renderer State176 Int* m_piError ;177 Pel* m_apiFilled [2]; // Dim1: ViewPosition178 Bool* m_apbOccluded [2]; // Dim1: ViewPosition179 Pel* m_aapiSynthVideoPel [3][3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane 0-> Y, 1->U, 2->V180 Pel* m_apiSynthDepthPel [3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane 0-> Y, 1->U, 2->V181 342 182 343 // Rendering State … … 185 346 Int m_iLastOccludedSPosFP; // Position of last topmost shifted position in FullPels 186 347 187 Bool m_bSet; // Set Data, or get Error188 348 Int m_iCurViewPos; // Current View Position 0: Left, 1: Right 189 349 Int m_iOtherViewPos; // Other View Position 0: Left, 1: Right … … 201 361 Int m_iShiftPrec; 202 362 Int m_iHoleMargin; 203 Int m_iBlendMode; 363 #ifdef LGE_VSO_EARLY_SKIP_A0093 364 Bool m_bEarlySkip; 365 #endif 204 366 205 367 // Derived settings … … 209 371 210 372 //// Current Pointers //// 211 Pel* m_aapiBaseVideoPelRow [2][3]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane 0-> Y, 1->U, 2->V 212 Pel* m_apiBaseDepthPelRow [2]; // Dim1: ViewPosition 213 Bool* m_apbOccludedRow [2]; // Dim1: ViewPosition 214 Pel* m_apiFilledRow [2]; // Dim1: ViewPosition 215 Int* m_apiErrorRow ; 216 217 Pel* m_aapiRefVideoPelRow [3]; // Dim1: Plane 0-> Y, 1->U, 2->V 218 Pel* m_aapiSynthVideoPelRow [3][3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane 0-> Y, 1->U, 2->V 219 Pel* m_apiSynthDepthPelRow [3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged 220 373 374 RenModelInPels* m_pcInputSamplesRow [2]; 375 RenModelOutPels* m_pcOutputSamplesRow; 221 376 222 377 //// MISC //// 223 378 const Int m_iDistShift; // Shift in Distortion computation 379 380 //// Early Skip 381 #ifdef LGE_VSO_EARLY_SKIP_A0093 382 Bool* m_pbHorSkip; 383 #endif 224 384 }; 225 385
Note: See TracChangeset for help on using the changeset viewer.