Changeset 1390 in 3DVCSoftware for branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.h
- Timestamp:
- 13 Nov 2015, 17:00:20 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.h
r1386 r1390 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 41 #if NH_3D_VSO42 #include <list>43 #include <vector>44 45 using namespace std;46 47 class TRenTop48 {49 // ENUM Modes50 51 52 // Interpolation Modes53 54 enum { eRenIntFullPel = 0, eRenIntLinInt = 1, eRenIntLinReal = 2, eRenIntFEM = 3, eRenInt8Tap = 4 };55 56 // HoleFilling57 enum { eRenHFNone = 0, eRenHFLWBackExt = 1};58 59 // Pre-Processing60 enum { eRenPreProNone = 0, eRenPreProBinom = 1};61 62 // Post-Processing63 enum { eRenPostProNone = 0, eRenPostProMed = 1};64 65 // Merging66 enum { eRenBlendAverg = 0, eRenBlendLeft = 1, eRenBlendRight = 2, eRenBlendDepthFirst = 5 };67 68 public:69 TRenTop();70 ~TRenTop();71 72 // Init73 Void init ( UInt uiImageWitdh,74 UInt uiImageHeight,75 Bool bExtrapolate,76 UInt uiLog2SamplingFactor,77 Int iLUTPrec,78 Bool bUVUp,79 Int iPreProcMode,80 Int iPreFilterKernelSize,81 Int iBlendMode,82 Int iBlendZThresPerc,83 Bool bBlendUseDistWeight,84 Int iBlendHoleMargin,85 Int iInterpolationMode,86 Int iHoleFillingMode,87 Int iPostProcMode,88 Int iUsedPelMapMarExt );89 90 Void setShiftLUTs ( Double** ppdShiftLUTLeft,91 Int** ppiShiftLUTLeft,92 Int** ppiBaseShiftLUTLeft,93 Double** ppdShiftLUTRight,94 Int** ppiShiftLUTRight,95 Int** ppiBaseShiftLUTRight,96 Int iRelDistLeft );97 98 // View Synthesis99 Void extrapolateView ( TComPicYuv* pcPicYuvVideo,100 TComPicYuv* pcPicYuvDepth,101 TComPicYuv* pcPicYuvSynthOut,102 Bool bRenderFromLeft );103 104 Void interpolateView ( TComPicYuv* pcPicYuvVideoLeft,105 TComPicYuv* pcPicYuvDepthLeft,106 TComPicYuv* pcPicYuvVideoRight,107 TComPicYuv* pcPicYuvDepthRight,108 TComPicYuv* pcPicYuvSynthOut,109 Int iBlendMode,110 Int iSimEnhBaseView );111 // Tools112 Void getUsedSamplesMap ( TComPicYuv* pcPicYuvDepth,113 TComPicYuv* pcUsedSampleMap,114 Bool bRenderFromLeft );115 116 // Zhejiang Temporal Improvement117 Void temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur,118 TComPicYuv* pcPicYuvDepthCur,119 TComPicYuv* pcPicYuvVideoLast,120 TComPicYuv* pcPicYuvDepthLast,121 Bool bFirstFrame );122 123 private:124 // Depth PreProcessing125 Void xPreProcessDepth(PelImage* pcInImage, PelImage* pcOutImage);126 127 // Pixel Shifting128 Void xShiftPixels ( PelImage* pcInImage, PelImage* pcDepth , PelImage* pcOutImage , PelImage* pcFilledImage, Bool bShiftFromLeft );129 Void xShiftPlanePixels ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes);130 Void xShiftPlanePixelsLinReal ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes);131 Void xShiftPlanePixelsFullPel ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes);132 Void xShiftPlanePixelsLinInt ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes);133 Void xShiftPlanePixels8Tap ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes);134 135 Void xBackShiftPixels ( PelImage* pcInImage, PelImage* pcDepth , PelImage* pcOutImage, PelImage* pcFilledImage, Bool bShiftFromLeft );136 Void xBackShiftPlanePixels ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes );137 138 Int xCeil ( Int iVal ) { return (( iVal + ( (1 << m_iRelShiftLUTPrec) - 1 ) ) >> m_iRelShiftLUTPrec); }139 140 // Hole Filling141 Void xFillHoles ( PelImage* pcInImage, PelImage* pcFilled, PelImage* pcOutImage , Bool bRenderFromLeft );142 Void xFillLWBackExt ( PelImage* pcInImage, PelImage* pcFilled, PelImage* pcOutImage , Bool bRenderFromLeft );143 Void xFillPlaneHoles ( PelImagePlane** apcInputPlanes, PelImagePlane* pcPlaneFilled, PelImagePlane** apcOutputPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft );144 145 // Alpha Map Creation146 Void xCreateAlphaMap (PelImage* pcFilledImage, PelImage* pcAlphaMapImage, Bool bRenderFromLeft );147 Void xCreateAlphaMapPlane (PelImagePlane** apcFilledPlanes, PelImagePlane** apcAlphaPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft);148 149 // BoundaryNoiseErosion150 Void xRemBoundaryNoise ( PelImage* pcInImage, PelImage* pcFilled, PelImage* pcOutImage , Bool bRenderFromLeft );151 Void xRemBoundaryNoisePlane ( PelImagePlane** apcInputPlanes, PelImagePlane* pcPlaneFilled, PelImagePlane** apcOutputPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft );152 153 // Similarity Enhancement154 Void xEnhSimilarity ( PelImage* pcLeftImage, PelImage* pcRightImage, PelImage* pcFilledLeft, PelImage* pcFilledRight );155 Void xEnhSimilarityPlane ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uNumPlanes );156 157 // View Blending158 Void xBlend ( PelImage* pcLeftImage, PelImage* pcRightImage, PelImage* pcFilledLeft, PelImage* pcFilledRight, PelImage* pcLeftDepth, PelImage* pcRightDepth, PelImage* pcOutputImage);159 Void xBlendPlanesAvg ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, PelImagePlane* pcLeftDepthPlane, PelImagePlane* pcRightDepthPlane, PelImagePlane** apcOutputImagePlane, UInt uNumPlanes );160 Void xBlendPlanesOneView ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, PelImagePlane* pcLeftDepthPlane, PelImagePlane* pcRightDepthPlane, PelImagePlane** apcOutputImagePlane, UInt uNumPlanes );161 162 // PostProcessing163 Void xCutMargin ( PelImage* pcInputImage );164 Void xCutPlaneMargin ( PelImagePlane* pcImagePlane, Pel cFill, UInt uiScale);165 Void xPostProcessImage ( PelImage* pcInImage, PelImage* pCOutImage);166 167 // Input Output Data Conversion168 Void xConvertInputData ( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror);169 Void xConvertOutputData ( PelImage* pOrgOutputImage, PelImage* pConvOutputImage, Bool bMirror);170 171 Void xGetDataPointers ( PelImage*& rpcInputImage, PelImage*& rpcOutputImage, PelImage*& rpcInputDepth, PelImage*& rpcOutputDepth, PelImage*& rpcFilled, Bool bRenderDepth );172 Void xGetDataPointerOutputImage( PelImage*& rpcOutputImage, PelImage*& rpcOutputDepth );173 174 Void xConvertInputVideo ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage);175 Void xConvertInputDepth ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage);176 177 178 // Data179 UInt m_uiSampledWidth; // Width after UPsampling180 181 // Resolution of input view182 UInt m_auiInputResolution[2];183 184 // Extrapolation185 Bool m_bExtrapolate;186 187 // Input Conversion188 Int m_iLog2SamplingFactor;189 Bool m_bUVUp;190 191 // PreProcessing192 Int m_iPreProcMode; //0: none, 1: binominal193 Int m_iPreFilterSize; // Half size194 195 // Similarity Enhancement196 Int m_iSimEnhBaseView; // 0: none, 1: left, 2: right197 198 // Blending199 Int m_iBlendMode; // 0: average;200 Int m_iBlendZThresPerc; // in percent of total depth201 Bool m_bBlendUseDistWeight; // use weighting depending on viewing distance202 Int m_iBlendHoleMargin; // blending margin next to holes203 204 Int m_iBlendZThres; // absoluteInt m_iBlendWeight;205 Int m_iBlendDistWeight; // Weight for view distance depending blending206 207 // Interpolation208 Int m_iInterpolationMode; //0: none; 1: Linear (Double), 2: FEM (Double)209 210 // Hole Filling211 Int m_iHoleFillingMode; //0: none; 1: LW Background extension212 Int m_bInstantHoleFilling; // perform hole filling while pixel shifting ( only supported for interpolation mode 4 )213 214 // Post Processing215 Int m_iPostProcMode; //0: none; 1: Median216 217 // Precision in LUT218 Int m_iRelShiftLUTPrec;219 220 // Cut221 UInt m_auiCut[2];222 223 // Look up tables Shift224 Double** m_ppdShiftLUTLeft;225 Double** m_ppdShiftLUTRight;226 Double** m_ppdShiftLUTRightMirror; // For rendering the mirrored view227 Double* m_adShiftLUTCur;228 229 Int** m_ppiShiftLUTLeft;230 Int** m_ppiShiftLUTRight;231 Int** m_ppiShiftLUTRightMirror; // For rendering the mirrored view232 Int* m_aiShiftLUTCur;233 234 // Look up tables Z235 Int* m_piInvZLUTLeft; // Look up table entry is proportional to Z236 Int* m_piInvZLUTRight;237 238 // Look up tables sub pel shift239 Int** m_aaiSubPelShift;240 241 // Zhejiang Temporal Improvement242 Int* m_aiBlkMoving;243 244 // Used pel map generation245 Int m_iUsedPelMapMarExt;246 247 // Buffers248 249 // Interpolation250 PelImage* m_pcLeftInputImage ;251 PelImage* m_pcLeftInputDepth ;252 PelImage* m_pcLeftOutputImage ;253 PelImage* m_pcLeftOutputDepth ;254 PelImage* m_pcLeftFilled ;255 PelImage* m_pcRightInputImage ;256 PelImage* m_pcRightInputDepth ;257 PelImage* m_pcRightOutputImage;258 PelImage* m_pcRightOutputDepth;259 PelImage* m_pcRightFilled ;260 PelImage* m_pcOutputImage ;261 PelImage* m_pcOutputDepth ;262 263 // Extrapolation264 PelImage* m_pcInputImage ;265 PelImage* m_pcInputDepth ;266 PelImage* m_pcFilled ;267 268 //Temp269 PelImage* m_pcTempImage ;270 };271 272 #endif // NH_3D273 41 #endif //__TRENTOP__
Note: See TracChangeset for help on using the changeset viewer.