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