source: 3DVCSoftware/branches/0.3-nokia/source/Lib/TLibRenderer/TRenModel.h @ 193

Last change on this file since 193 was 5, checked in by hhi, 13 years ago

Clean version with cfg-files

  • Property svn:eol-style set to native
File size: 5.7 KB
Line 
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 */
33
34
35
36
37#ifndef __TRENMODEL__
38#define __TRENMODEL__
39
40#include "TRenImage.h"
41#include "TRenSingleModel.h"
42#include "../TLibCommon/CommonDef.h"
43#include "../TLibCommon/TComPicYuv.h"
44#include "../TLibCommon/TypeDef.h"
45
46class TRenModel
47{
48public:
49
50  TRenModel();
51  ~TRenModel();
52
53  // Creation
54  Void  create           ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin );
55  Void  createSingleModel( Int iBaseViewNum, Int iContent, Int iModelNum, Int iLeftViewNum, Int iRightViewNum, Bool bUseOrgRef, Int iBlendMode );
56
57  // Set new Frame
58  Void  setBaseView      ( Int iViewNum, TComPicYuv* pcPicYuvVideoData, TComPicYuv* pcPicYuvDepthData, TComPicYuv* pcPicYuvOrgVideoData, TComPicYuv* pcPicYuvOrgDepthData  );
59  Void  setSingleModel   ( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView );
60
61  // Set Mode
62  Void  setErrorMode     ( Int iView, Int iContent, int iPlane );
63
64  // Get Distortion, set Data
65  Int64 getDist          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData  );
66  Void  setData          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData  );
67
68  // Get Rendered View
69  Void  getSynthVideo    ( Int iModelNum, Int iViewNum, TComPicYuv*& rpcPicYuvSynthVideo );
70  Void  getSynthDepth    ( Int iModelNum, Int iViewNum, TComPicYuv*& rpcPicYuvSynthDepth );
71
72  // Get Total Distortion
73  Void  getTotalSSE      (Int64& riSSEY, Int64& riSSEU, Int64& riSSEV );
74
75private:
76  // helpers
77  Void xSetLRViewAndAddModel( Int iModelNum, Int iBaseViewNum, Int iContent, Int iViewPos, Bool bAdd );
78  Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget );
79
80  // Settings
81  Int    m_iShiftPrec;
82  Int**  m_aaaiSubPelShiftLut[2];
83  Int    m_iHoleMargin;
84
85  /// Size of Video and Depth
86  Int m_iWidth;
87  Int m_iHeight;
88  Int m_iSampledWidth;
89  Int m_iPad;
90
91  Int m_iNumOfBaseViews;
92
93  /// Current Error Type ///
94  Int m_iCurrentView;
95  Int m_iCurrentContent;
96  Int m_iCurrentPlane;
97
98  /// Array of Models used to determine the Current Error ///
99  Int                m_iNumOfCurRenModels;
100  TRenSingleModel**  m_apcCurRenModels;   // Array of pointers used for determination of current error
101  Int*               m_aiCurPosInModels;  // Position of Current View in Model
102
103  /// Array of Models ///
104  Int                m_iNumOfRenModels;
105  TRenSingleModel**  m_apcRenModels;   // Array of pointers to all created models
106
107  /// Mapping from View number and Content type to models ///
108  Int*               m_aiNumOfModelsForDepthView;
109  TRenSingleModel*** m_aapcRenModelForDepthView;   // Dim1: ViewNumber
110  Int**              m_aaePosInModelForDepthView; // Position in Model ( Left or Right)
111
112  Int*               m_aiNumOfModelsForVideoView;
113  TRenSingleModel*** m_aapcRenModelForVideoView;   // Dim1: ViewNumber
114  Int**              m_aaePosInModelForVideoView; // Position in Model ( Left or Right) (local model numbering)
115
116  /// Position of Base Views in Models ( global model numbering )
117  Int**              m_aaeBaseViewPosInModel;
118
119  /// Current Setup data ///
120  Bool*              m_abSetupVideoFromOrgForView;  //: Dim1: ViewNumber, 0 ... use org; 1 ... use coded; 2; use org ref and coded in RDO
121  Bool*              m_abSetupDepthFromOrgForView;
122
123  /// DATA //
124  // Cur
125
126  /// Number of Base Views
127  Pel*** m_aapiCurVideoPel   ; // Dim1: ViewNumber: Plane  0-> Y, 1->U, 2->V
128  Int**  m_aaiCurVideoStrides; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane  0-> Y, 1->U, 2->V
129
130  Pel**  m_apiCurDepthPel    ; // Dim1: ViewPosition
131  Int*   m_aiCurDepthStrides ; // Dim1: ViewPosition
132
133  Pel*** m_aapiOrgVideoPel   ; // Dim1: ViewPosition  Dim2: Plane  0-> Y, 1->U, 2->V
134  Int**  m_aaiOrgVideoStrides; // Dim1: ViewPosition  Dim2: Plane  0-> Y, 1->U, 2->V
135
136  Pel**  m_apiOrgDepthPel    ;    // Dim1: ViewPosition
137  Int*   m_aiOrgDepthStrides ;    // Dim1: ViewPosition
138};
139
140#endif //__TRENMODEL__
Note: See TracBrowser for help on using the repository browser.