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 | /** \file TAppDecTop.h |
---|
37 | \brief Decoder application class (header) |
---|
38 | */ |
---|
39 | |
---|
40 | #ifndef __TAPPDECTOP__ |
---|
41 | #define __TAPPDECTOP__ |
---|
42 | |
---|
43 | #if _MSC_VER > 1000 |
---|
44 | #pragma once |
---|
45 | #endif // _MSC_VER > 1000 |
---|
46 | |
---|
47 | #include "../../Lib/TLibVideoIO/TVideoIOYuv.h" |
---|
48 | #include "../../Lib/TLibVideoIO/TVideoIOBits.h" |
---|
49 | #include "../../Lib/TLibCommon/TComList.h" |
---|
50 | #include "../../Lib/TLibCommon/TComPicYuv.h" |
---|
51 | #include "../../Lib/TLibCommon/TComBitStream.h" |
---|
52 | #include "../../Lib/TLibCommon/TComDepthMapGenerator.h" |
---|
53 | #include "../../Lib/TLibDecoder/TDecTop.h" |
---|
54 | #if POZNAN_SYNTH |
---|
55 | #include "../../Lib/TLibRenderer/TRenTop.h" |
---|
56 | #endif |
---|
57 | #include "TAppDecCfg.h" |
---|
58 | |
---|
59 | #if POZNAN_MP |
---|
60 | #include "../../Lib/TLibCommon/TComMP.h" |
---|
61 | #endif |
---|
62 | |
---|
63 | // ==================================================================================================================== |
---|
64 | // Class definition |
---|
65 | // ==================================================================================================================== |
---|
66 | |
---|
67 | /// decoder application class |
---|
68 | class TAppDecTop : public TAppDecCfg |
---|
69 | { |
---|
70 | private: |
---|
71 | // class interface |
---|
72 | std::vector<TDecTop*> m_acTDecTopList; |
---|
73 | std::vector<TDecTop*> m_acTDecDepthTopList; |
---|
74 | TComBitstream* m_apcBitstream; ///< bitstream class |
---|
75 | TVideoIOBitsStartCode m_cTVideoIOBitstreamFile; ///< file I/O class |
---|
76 | std::vector<TVideoIOYuv*> m_acTVideoIOYuvReconFileList; |
---|
77 | std::vector<TVideoIOYuv*> m_acTVideoIOYuvDepthReconFileList; |
---|
78 | |
---|
79 | Bool m_bUsingDepth; |
---|
80 | |
---|
81 | // for output control |
---|
82 | Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP |
---|
83 | // Int m_iPOCLastDisplay; ///< last POC in display order |
---|
84 | |
---|
85 | std::vector<Bool> m_abDecFlagList; ///< decoded flag in one GOP |
---|
86 | std::vector<Int> m_aiPOCLastDisplayList; |
---|
87 | std::vector<Int> m_aiDepthPOCLastDisplayList; |
---|
88 | |
---|
89 | FILE* m_pScaleOffsetFile; |
---|
90 | CamParsCollector m_cCamParsCollector; |
---|
91 | #if DEPTH_MAP_GENERATION |
---|
92 | TComSPSAccess m_cSPSAccess; |
---|
93 | TComAUPicAccess m_cAUPicAccess; |
---|
94 | #endif |
---|
95 | |
---|
96 | #if POZNAN_SYNTH |
---|
97 | TRenTop m_cAvailabilityRenderer; |
---|
98 | #endif |
---|
99 | |
---|
100 | #if POZNAN_MP |
---|
101 | TComMP* m_pcMP; |
---|
102 | #endif |
---|
103 | |
---|
104 | public: |
---|
105 | TAppDecTop(); |
---|
106 | virtual ~TAppDecTop() {} |
---|
107 | |
---|
108 | Void create (); ///< create internal members |
---|
109 | Void destroy (); ///< destroy internal members |
---|
110 | Void decode (); ///< main decoding function |
---|
111 | Void increaseNumberOfViews (Int iNewNumberOfViews); |
---|
112 | Void startUsingDepth() ; |
---|
113 | |
---|
114 | #if POZNAN_SYNTH |
---|
115 | Void initRenderer(TComSPS &cComSPS); |
---|
116 | Void storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx,Int iCurPoc,Bool bDepth); |
---|
117 | #endif |
---|
118 | |
---|
119 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
120 | Void storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc); |
---|
121 | #endif |
---|
122 | |
---|
123 | // GT FIX |
---|
124 | std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepth ); |
---|
125 | TComPic* getPicFromView( Int iViewIdx, Int iPoc, bool bDepth ); |
---|
126 | // GT FIX END |
---|
127 | |
---|
128 | #if DEPTH_MAP_GENERATION |
---|
129 | TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; } |
---|
130 | TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } |
---|
131 | TDecTop* getDecTop0 () { return m_acTDecTopList[0]; } |
---|
132 | #endif |
---|
133 | |
---|
134 | #if POZNAN_MP |
---|
135 | TComMP* getMP() { return m_pcMP; } |
---|
136 | #endif |
---|
137 | |
---|
138 | protected: |
---|
139 | Void xCreateDecLib (); ///< create internal classes |
---|
140 | Void xDestroyDecLib (); ///< destroy internal classes |
---|
141 | Void xInitDecLib (); ///< initialize decoder class |
---|
142 | |
---|
143 | Void xWriteOutput ( TComList<TComPic*>* pcListPic ); ///< write YUV to file |
---|
144 | }; |
---|
145 | |
---|
146 | #endif |
---|
147 | |
---|