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-2015, ITU/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 | #ifndef __TRENMODSETUPSTRPARSER__ |
---|
35 | #define __TRENMODSETUPSTRPARSER__ |
---|
36 | |
---|
37 | #include "../TLibCommon/CommonDef.h" |
---|
38 | #include "../TLibCommon/TComPicYuv.h" |
---|
39 | #include "../TLibCommon/TypeDef.h" |
---|
40 | #include "../TAppCommon/TAppComCamPara.h" |
---|
41 | #if H_3D |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | #include <list> |
---|
46 | #include <vector> |
---|
47 | #include <math.h> |
---|
48 | #include <errno.h> |
---|
49 | #include <vector> |
---|
50 | #include <iostream> |
---|
51 | #include <algorithm> |
---|
52 | #include <functional> |
---|
53 | #include <string> |
---|
54 | #include <cstdio> |
---|
55 | #include <cstring> |
---|
56 | |
---|
57 | |
---|
58 | using namespace std; |
---|
59 | |
---|
60 | class TRenModSetupStrParser |
---|
61 | { |
---|
62 | public: |
---|
63 | |
---|
64 | Int getNumOfModels (); |
---|
65 | Int getNumOfBaseViews (); |
---|
66 | |
---|
67 | Int getNumOfModelsForView ( Int iViewIdx, Int iContent ); |
---|
68 | Int getNumOfBaseViewsForView( Int iViewIdx, Int iContent ); |
---|
69 | |
---|
70 | Void getSingleModelData ( Int iSrcViewIdx, |
---|
71 | Int iSrcCnt, |
---|
72 | Int iCurModel, |
---|
73 | Int& riModelNum, |
---|
74 | Int& riInterpolationType, |
---|
75 | Int& riLeftBaseViewIdx, |
---|
76 | Int& riRightBaseViewIdx, |
---|
77 | Int& riOrgRefBaseViewIdx, |
---|
78 | Int& riSynthViewRelNum |
---|
79 | ); |
---|
80 | |
---|
81 | Void getBaseViewData ( Int iSourceViewIdx, |
---|
82 | Int iSourceContent, |
---|
83 | Int iCurView, |
---|
84 | Int& riBaseViewSIdx, |
---|
85 | Int& riVideoDistMode, |
---|
86 | Int& riDepthDistMode |
---|
87 | ); |
---|
88 | |
---|
89 | std::vector<Int>* getSynthViews() { return &m_aiAllSynthViewNums; } |
---|
90 | std::vector<Int>* getBaseViews() { return &m_aiAllBaseViewIdx; } |
---|
91 | |
---|
92 | TRenModSetupStrParser(); |
---|
93 | |
---|
94 | Void setString( Int iNumOfBaseViews, Char* pchSetStr ); |
---|
95 | |
---|
96 | private: |
---|
97 | std::vector< std::vector<Int > > m_aaaiBaseViewsIdx [2]; |
---|
98 | std::vector< std::vector<Int > > m_aaaiVideoDistMode [2]; |
---|
99 | std::vector< std::vector<Int > > m_aaaiDepthDistMode [2]; |
---|
100 | std::vector< std::vector<Int > > m_aaaiModelNums [2]; |
---|
101 | std::vector< std::vector<Int > > m_aaaiSynthViewNums [2]; |
---|
102 | std::vector< std::vector<Bool> > m_aaabOrgRef [2]; |
---|
103 | std::vector< std::vector<Bool> > m_aaabExtrapolate [2]; |
---|
104 | std::vector< std::vector<Int > > m_aaaiBlendMode [2]; |
---|
105 | |
---|
106 | std::vector<Int> m_aiAllBaseViewIdx; |
---|
107 | std::vector<Int> m_aiAllSynthViewNums; |
---|
108 | |
---|
109 | Bool m_bCurrentViewSet; |
---|
110 | Int m_iCurrentView; |
---|
111 | Int m_iCurrentContent; |
---|
112 | Int m_iNumberOfModels; |
---|
113 | |
---|
114 | Char* m_pchSetStr; |
---|
115 | size_t m_iPosInStr; |
---|
116 | |
---|
117 | private: |
---|
118 | Void xParseString(); |
---|
119 | Void xParseSourceView(); |
---|
120 | Void xReadViews ( Char cType ); |
---|
121 | Void xReadViewInfo ( Char cType ); |
---|
122 | Void xAddBaseView ( Int iViewIdx, Char cVideoType, Char cDepthType ); |
---|
123 | Void xAddSynthView ( Int iViewNum, Char cType, Char cRefType ); |
---|
124 | Void xError ( Bool bIsError ); |
---|
125 | Void xGetViewNumberRange( std::vector<Int>& raiViewNumbers ); |
---|
126 | Void xGetNextCharGoOn ( Char& rcNextChar ); |
---|
127 | Void xGetNextChar ( Char& rcNextChar ); |
---|
128 | }; |
---|
129 | |
---|
130 | #endif // H_3D |
---|
131 | #endif //__TRENMODEL__ |
---|
132 | |
---|
133 | |
---|