[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2011, ISO/IEC |
---|
| 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
[2] | 33 | |
---|
| 34 | |
---|
| 35 | #ifndef __TRENSINGLEMODEL__ |
---|
| 36 | #define __TRENSINGLEMODEL__ |
---|
| 37 | |
---|
| 38 | #include "TRenImage.h" |
---|
| 39 | #include "../TLibCommon/CommonDef.h" |
---|
| 40 | #include "../TLibCommon/TComPicYuv.h" |
---|
| 41 | #include "../TLibCommon/TypeDef.h" |
---|
[56] | 42 | #include "../TAppCommon/TAppComCamPara.h" |
---|
[2] | 43 | |
---|
| 44 | |
---|
| 45 | #include <math.h> |
---|
| 46 | #include <errno.h> |
---|
| 47 | #include <iostream> |
---|
| 48 | |
---|
| 49 | #include <string> |
---|
| 50 | #include <cstdio> |
---|
| 51 | #include <cstring> |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | using namespace std; |
---|
| 55 | |
---|
| 56 | |
---|
[100] | 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 | |
---|
[2] | 67 | class TRenSingleModel |
---|
| 68 | { |
---|
[100] | 69 | public: |
---|
[105] | 70 | |
---|
| 71 | #if FIX_VIRT_DESTRUCTOR |
---|
| 72 | virtual ~TRenSingleModel() { } |
---|
| 73 | #endif |
---|
[100] | 74 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 75 | virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0; |
---|
| 76 | #else |
---|
| 77 | virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0; |
---|
| 78 | #endif |
---|
[2] | 79 | |
---|
[100] | 80 | // Set Frame dependent data |
---|
| 81 | virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; |
---|
| 82 | virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ) = 0; |
---|
| 83 | |
---|
| 84 | // Set Data |
---|
| 85 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 86 | virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ) = 0; |
---|
| 87 | #else |
---|
| 88 | virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; |
---|
| 89 | #endif |
---|
| 90 | virtual Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; |
---|
| 91 | |
---|
| 92 | // Get Distortion |
---|
| 93 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 94 | virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride)=0; |
---|
| 95 | #else |
---|
| 96 | virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; |
---|
| 97 | #endif |
---|
| 98 | virtual RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; |
---|
| 99 | |
---|
| 100 | virtual Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; |
---|
| 101 | virtual Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; |
---|
| 102 | virtual Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; |
---|
| 103 | }; |
---|
| 104 | |
---|
| 105 | template < BlenMod iBM, Bool bBitInc > |
---|
| 106 | class TRenSingleModelC : public TRenSingleModel |
---|
| 107 | { |
---|
| 108 | struct RenModelInPels |
---|
| 109 | { |
---|
| 110 | // video |
---|
| 111 | Pel aiY[5] ; // y-value |
---|
| 112 | #if HHI_VSO_COLOR_PLANES |
---|
| 113 | Pel aiU[5] ; // u-value |
---|
| 114 | Pel aiV[5] ; // v-value |
---|
| 115 | #endif |
---|
| 116 | // depth |
---|
| 117 | Pel iD ; // depth |
---|
| 118 | |
---|
| 119 | // state |
---|
| 120 | Bool bOccluded; // Occluded |
---|
| 121 | }; |
---|
| 122 | |
---|
| 123 | struct RenModelOutPels |
---|
| 124 | { |
---|
| 125 | // video |
---|
| 126 | Pel iYLeft ; |
---|
| 127 | Pel iYRight ; |
---|
| 128 | Pel iYBlended ; |
---|
| 129 | #if HHI_VSO_COLOR_PLANES |
---|
| 130 | Pel iULeft ; |
---|
| 131 | Pel iURight ; |
---|
| 132 | Pel iUBlended ; |
---|
| 133 | Pel iVLeft ; |
---|
| 134 | Pel iVRight ; |
---|
| 135 | Pel iVBlended ; |
---|
| 136 | #endif |
---|
| 137 | // depth |
---|
| 138 | Pel iDLeft ; |
---|
| 139 | Pel iDRight ; |
---|
| 140 | Pel iDBlended ; |
---|
| 141 | |
---|
| 142 | // state |
---|
| 143 | Int iFilledLeft ; |
---|
| 144 | Int iFilledRight; |
---|
| 145 | |
---|
| 146 | // error |
---|
| 147 | Int iError ; |
---|
| 148 | |
---|
| 149 | // reference |
---|
| 150 | Pel iYRef ; |
---|
| 151 | #if HHI_VSO_COLOR_PLANES |
---|
| 152 | Pel iURef ; |
---|
| 153 | Pel iVRef ; |
---|
| 154 | #endif |
---|
| 155 | }; |
---|
| 156 | |
---|
| 157 | |
---|
| 158 | |
---|
[2] | 159 | public: |
---|
[100] | 160 | TRenSingleModelC(); |
---|
| 161 | ~TRenSingleModelC(); |
---|
[2] | 162 | |
---|
| 163 | // Create Model |
---|
[100] | 164 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 165 | Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ); |
---|
| 166 | #else |
---|
[2] | 167 | Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ); |
---|
[100] | 168 | #endif |
---|
[2] | 169 | |
---|
[5] | 170 | // Set Frame dependent data |
---|
[2] | 171 | Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); |
---|
[100] | 172 | Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ); |
---|
[2] | 173 | |
---|
[100] | 174 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 175 | Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ); |
---|
| 176 | #else |
---|
[2] | 177 | Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); |
---|
[100] | 178 | #endif |
---|
[2] | 179 | Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); |
---|
| 180 | |
---|
| 181 | // Get Distortion |
---|
[100] | 182 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 183 | RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride); |
---|
| 184 | #else |
---|
[2] | 185 | RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); |
---|
[100] | 186 | #endif |
---|
[2] | 187 | RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); |
---|
| 188 | |
---|
[100] | 189 | Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); |
---|
| 190 | Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); |
---|
| 191 | Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); |
---|
[2] | 192 | |
---|
| 193 | private: |
---|
| 194 | // Set and inc Current Row |
---|
| 195 | __inline Void xSetViewRow( Int iPosY ); |
---|
| 196 | __inline Void xIncViewRow(); |
---|
| 197 | |
---|
| 198 | ///// Rendering ///// |
---|
| 199 | // Left to Right |
---|
[100] | 200 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 201 | __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ); |
---|
| 202 | __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ); |
---|
| 203 | template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast ); |
---|
| 204 | template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast ); |
---|
| 205 | #else |
---|
| 206 | template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); |
---|
| 207 | template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); |
---|
| 208 | #endif |
---|
| 209 | __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); |
---|
| 210 | template<Bool bSet> __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); |
---|
| 211 | template<Bool bSet> __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); |
---|
| 212 | template<Bool bSet> __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); |
---|
| 213 | template<Bool bSet> __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); |
---|
| 214 | __inline Int xRangeLeftL ( Int iPos ); |
---|
| 215 | __inline Int xRangeRightL ( Int iPos ); |
---|
| 216 | __inline Int xRoundL ( Int iPos ); |
---|
[2] | 217 | |
---|
| 218 | // Right to Left |
---|
[100] | 219 | __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); |
---|
| 220 | template<Bool bSet> __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); |
---|
| 221 | template<Bool bSet> __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); |
---|
| 222 | template<Bool bSet> __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); |
---|
| 223 | template<Bool bSet> __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); |
---|
| 224 | __inline Int xRangeLeftR ( Int iPos ); |
---|
| 225 | __inline Int xRangeRightR ( Int iPos ); |
---|
| 226 | __inline Int xRoundR ( Int iPos ); |
---|
[2] | 227 | |
---|
| 228 | // Blending |
---|
[100] | 229 | template<Bool bSet> __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); |
---|
[5] | 230 | |
---|
| 231 | #if HHI_VSO_COLOR_PLANES |
---|
| 232 | __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 ); |
---|
[2] | 233 | __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 ); |
---|
| 234 | __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 ); |
---|
| 235 | #else |
---|
| 236 | __inline Void xGetBlendedValue ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); |
---|
[5] | 237 | __inline Void xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); |
---|
| 238 | __inline Void xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); |
---|
[2] | 239 | #endif |
---|
| 240 | __inline Pel xBlend ( Pel pVal1, Pel pVal2, Int iWeightVal2 ); |
---|
| 241 | |
---|
[100] | 242 | // General |
---|
| 243 | template<Bool bSet> __inline Void xSetShiftedPelL (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); |
---|
| 244 | template<Bool bSet> __inline Void xSetShiftedPelBlendL (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); |
---|
| 245 | template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); |
---|
| 246 | |
---|
| 247 | template<Bool bSet> __inline Void xSetShiftedPelR (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); |
---|
| 248 | template<Bool bSet> __inline Void xSetShiftedPelBlendR (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); |
---|
| 249 | template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); |
---|
| 250 | |
---|
[2] | 251 | __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); |
---|
| 252 | __inline Int xShift ( Int iPos ); |
---|
| 253 | __inline Int xShift ( Int iPos, Int iPosInNewData ); |
---|
| 254 | __inline Int xGetDist ( Int iDiffY, Int iDiffU, Int iDiffV ); |
---|
| 255 | __inline Int xGetDist ( Int iDiffY ); |
---|
| 256 | |
---|
| 257 | // Utilities |
---|
| 258 | __inline Void xSetPels ( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal ); |
---|
| 259 | __inline Void xSetBools ( Bool* pbSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal ); |
---|
| 260 | __inline Void xSetInts ( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal ); |
---|
| 261 | |
---|
[100] | 262 | #if HHI_VSO_COLOR_PLANES |
---|
| 263 | Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV ); |
---|
| 264 | #else |
---|
| 265 | Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ); |
---|
| 266 | #endif |
---|
| 267 | Void xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); |
---|
| 268 | |
---|
| 269 | Void xSetStructRefView (); |
---|
| 270 | Void xResetStructError (); |
---|
| 271 | Void xInitSampleStructs (); |
---|
| 272 | Void xSetStructSynthViewAsRefView (); |
---|
| 273 | Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset ); |
---|
| 274 | |
---|
| 275 | |
---|
| 276 | template< typename S, typename T> |
---|
| 277 | Void xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight ) |
---|
| 278 | { |
---|
| 279 | for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) |
---|
| 280 | { |
---|
| 281 | for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) |
---|
| 282 | { |
---|
| 283 | ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement; |
---|
| 284 | } |
---|
| 285 | ptSource += iSourceStride; |
---|
| 286 | ptTarget += iTargetStride; |
---|
| 287 | } |
---|
| 288 | } |
---|
| 289 | |
---|
| 290 | template< typename S, typename T> |
---|
| 291 | Void xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight ) |
---|
| 292 | { |
---|
| 293 | for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) |
---|
| 294 | { |
---|
| 295 | for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) |
---|
| 296 | { |
---|
| 297 | ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement; |
---|
| 298 | } |
---|
| 299 | ptSource += iSourceStride; |
---|
| 300 | ptTarget += iTargetStride; |
---|
| 301 | } |
---|
| 302 | } |
---|
| 303 | |
---|
[2] | 304 | private: |
---|
| 305 | |
---|
| 306 | // Image sizes |
---|
| 307 | Int m_iWidth; |
---|
| 308 | Int m_iHeight; |
---|
| 309 | Int m_iStride; |
---|
| 310 | Int m_iPad; |
---|
| 311 | |
---|
| 312 | Int m_iSampledWidth; |
---|
| 313 | Int m_iSampledHeight; |
---|
| 314 | Int m_iSampledStride; |
---|
| 315 | |
---|
[100] | 316 | RenModelInPels* m_pcInputSamples[2]; |
---|
| 317 | Int m_iInputSamplesStride; |
---|
| 318 | |
---|
[2] | 319 | // Base |
---|
| 320 | Pel** m_aapiBaseVideoPel [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane 0-> Y, 1->U, 2->V |
---|
| 321 | Int* m_aaiBaseVideoStrides [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane 0-> Y, 1->U, 2->V |
---|
| 322 | |
---|
| 323 | Pel* m_apiBaseDepthPel [2]; // Dim1: ViewPosition |
---|
| 324 | Int m_aiBaseDepthStrides [2]; // Dim1: ViewPosition |
---|
| 325 | |
---|
[100] | 326 | |
---|
[2] | 327 | // LUT |
---|
| 328 | Int** m_appiShiftLut [2]; |
---|
| 329 | Int** m_ppiCurLUT; |
---|
| 330 | Int** m_aaiSubPelShiftL; |
---|
| 331 | Int** m_aaiSubPelShiftR; |
---|
| 332 | |
---|
| 333 | Int* m_piInvZLUTLeft; |
---|
| 334 | Int* m_piInvZLUTRight; |
---|
| 335 | |
---|
| 336 | |
---|
| 337 | //// Reference Data //// |
---|
| 338 | TComPicYuv* m_pcPicYuvRef ; // Reference PIcYuv |
---|
[100] | 339 | |
---|
| 340 | //// Output Samples |
---|
| 341 | RenModelOutPels* m_pcOutputSamples; |
---|
| 342 | Int m_iOutputSamplesStride; |
---|
| 343 | |
---|
[2] | 344 | Pel* m_aapiRefVideoPel [3]; // Dim1: Plane 0-> Y, 1->U, 2->V |
---|
| 345 | Int m_aiRefVideoStrides [3]; // Dim1: Plane 0-> Y, 1->U, 2->V |
---|
| 346 | |
---|
| 347 | // Rendering State |
---|
| 348 | Bool m_bInOcclusion; // Currently rendering in occluded area |
---|
| 349 | Int m_iLastOccludedSPos; // Position of last topmost shifted position |
---|
| 350 | Int m_iLastOccludedSPosFP; // Position of last topmost shifted position in FullPels |
---|
| 351 | |
---|
| 352 | Int m_iCurViewPos; // Current View Position 0: Left, 1: Right |
---|
| 353 | Int m_iOtherViewPos; // Other View Position 0: Left, 1: Right |
---|
| 354 | Pel* m_piNewDepthData; // Pointer to new depth data |
---|
| 355 | Int m_iStartChangePosX; // Start Position of new data |
---|
| 356 | Int m_iNewDataWidth; // Width of new data |
---|
| 357 | Pel m_iCurDepth; // Current Depth Value |
---|
| 358 | Pel m_iLastDepth; // Last Depth Value |
---|
| 359 | Pel m_iThisDepth; // Depth value to use for setting |
---|
| 360 | |
---|
| 361 | //// Settings //// |
---|
| 362 | // Input |
---|
| 363 | Int m_iMode; // 0: Left to Right, 1: Right to Left, 2: Merge |
---|
| 364 | Bool m_bUseOrgRef; |
---|
| 365 | Int m_iShiftPrec; |
---|
| 366 | Int m_iHoleMargin; |
---|
[100] | 367 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 368 | Bool m_bEarlySkip; |
---|
| 369 | #endif |
---|
[2] | 370 | |
---|
| 371 | // Derived settings |
---|
| 372 | Int m_iGapTolerance; |
---|
| 373 | Int m_iBlendZThres; |
---|
| 374 | Int m_iBlendDistWeight; |
---|
| 375 | |
---|
| 376 | //// Current Pointers //// |
---|
| 377 | |
---|
[100] | 378 | RenModelInPels* m_pcInputSamplesRow [2]; |
---|
| 379 | RenModelOutPels* m_pcOutputSamplesRow; |
---|
[2] | 380 | |
---|
| 381 | //// MISC //// |
---|
| 382 | const Int m_iDistShift; // Shift in Distortion computation |
---|
[100] | 383 | |
---|
| 384 | //// Early Skip |
---|
| 385 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 386 | Bool* m_pbHorSkip; |
---|
| 387 | #endif |
---|
[2] | 388 | }; |
---|
| 389 | |
---|
| 390 | #endif //__TRENSINGLEMODEL__ |
---|