source: 3DVCSoftware/branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.h @ 1417

Last change on this file since 1417 was 28, checked in by poznan-univ, 13 years ago

Poznan Tools

  • Encoding only disoccluded CUs in depended views
  • Depth based motion prediction
  • Texture QP adjustment based on depth data
  • Nonlinear depth representation
  • Property svn:eol-style set to native
File size: 7.4 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/** \file     TAppEncTop.h
37    \brief    Encoder application class (header)
38*/
39
40#ifndef __TAPPENCTOP__
41#define __TAPPENCTOP__
42
43#include "../../Lib/TLibEncoder/TEncTop.h"
44#include "../../Lib/TLibVideoIO/TVideoIOYuv.h"
45#include "../../Lib/TLibVideoIO/TVideoIOBits.h"
46#include "../../Lib/TLibCommon/TComBitStream.h"
47#include "../../Lib/TLibCommon/TComDepthMapGenerator.h"
48#include "TAppEncCfg.h"
49//GT VSO
50#include "../../Lib/TLibRenderer/TRenTop.h"
51//GT VSO end
52
53#if POZNAN_MP
54#include "../../Lib/TLibCommon/TComMP.h"
55#endif 
56
57// ====================================================================================================================
58// Class definition
59// ====================================================================================================================
60
61/// encoder application class
62class TAppEncTop : public TAppEncCfg
63{
64private:
65  // class interface
66
67  std::vector<TEncTop*>                          m_acTEncTopList ;
68  std::vector<TEncTop*>        m_acTEncDepthTopList ;
69  std::vector<TVideoIOYuv*>              m_acTVideoIOYuvInputFileList;
70  std::vector<TVideoIOYuv*>    m_acTVideoIOYuvDepthInputFileList;
71  std::vector<TVideoIOYuv*>              m_acTVideoIOYuvReconFileList;
72  std::vector<TVideoIOYuv*>    m_acTVideoIOYuvDepthReconFileList;
73
74  TVideoIOBitsStartCode      m_cTVideoIOBitsFile;           ///< output bitstream file
75 
76  std::vector< TComList<TComPicYuv*>* >  m_cListPicYuvRecList;              ///< list of reconstruction YUV files
77  std::vector< TComList<TComPicYuv*>* >  m_cListPicYuvDepthRecList;         ///< list of reconstruction YUV files
78  std::vector<PicOrderCnt> m_aiNextPocToDump;
79  std::vector<PicOrderCnt> m_aiNextDepthPocToDump;
80  std::vector< std::map<PicOrderCnt, TComPicYuv*> > m_cListPicYuvRecMap;
81  std::vector< std::map<PicOrderCnt, TComPicYuv*> > m_cListPicYuvDepthRecMap;
82
83  TComList<TComBitstream*>   m_cListBitstream;              ///< list of bitstreams
84 
85  std::vector<Int>              m_iFrameRcvdVector;                  ///< number of received frames
86  std::vector<Int>            m_iDepthFrameRcvdVector;             ///< number of received frames
87
88#if DEPTH_MAP_GENERATION
89  TComSPSAccess               m_cSPSAccess;
90  TComAUPicAccess             m_cAUPicAccess;
91#endif
92 
93#if HHI_VSO
94  TRenTop                     m_cRendererTop; 
95  TRenModel                   m_cRendererModel;   
96#endif
97
98#if POZNAN_SYNTH
99  TRenTop                     m_cAvailabilityRenderer;
100#endif
101
102#if POZNAN_MP
103  TComMP*                                 m_pcMP;
104#endif
105protected:
106  // initialization
107  Void  xCreateLib        ();                               ///< create files & encoder class
108  Void  xInitLibCfg       ();                               ///< initialize internal variables
109  Void  xInitLib          ();                               ///< initialize encoder class
110  Void  xDestroyLib       ();                               ///< destroy encoder class
111 
112  /// obtain required buffers
113  Void  xGetBuffer        ( TComPicYuv*& rpcPicYuvRec,                  //GT: unused?
114                           TComBitstream*& rpcBitStream );
115 
116  Void  xGetBuffer        ( TComPicYuv*& rpcPicYuvRec, Int iViewIdx, std::vector< TComList<TComPicYuv*>*>& racBuffer  );
117
118  /// delete allocated buffers
119  Void  xDeleteBuffer     ();
120 
121  // file I/O
122  Void  xWriteOutput      ( Int iViewIdx, Bool isDepth = false );              ///< write bitstream to file
123
124
125  // util 
126  TComPic*    xGetPicFromView   ( Int iViewIdx, Int iPoc, Bool bDepth );
127  TComPicYuv* xGetPicYuvFromView( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon );
128
129
130  // Ref Data
131#if HHI_VSO
132  Void  xSetBaseLUT   ( Int iViewIdxSource, Int iViewIdxTarget, TComMVDRefData* pcRefInfo, InterViewReference eView );
133  Void  xSetBasePicYuv( Int iViewIdx, Int iPoc, TComMVDRefData* pcRefInfo, InterViewReference eView, bool bDepth ); ///< store pics from buffers in pcRefInfo
134#endif
135 
136public:
137  TAppEncTop();
138  virtual ~TAppEncTop();
139 
140  Void        encode      ();                               ///< main encoding function
141#if HHI_VSO
142  Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent );
143  Void                  setMVDPic        ( Int iViewIdx, Int iPoc, TComMVDRefData* pcReferenceInfo ); // set MultiView References
144#endif
145  Void                  getUsedPelsMap   ( Int iViewIdx, Int iPoc, TComPicYuv* pcPicYuvUsedPelsMap );
146  std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepthCoder );              // only for mvc functionality yet
147  TComPic*              getPicFromView   ( Int iViewIdx, Int iPoc, Bool bDepth ) { return xGetPicFromView( iViewIdx, iPoc, bDepth ); }
148
149#if HHI_VSO
150  TRenModel* getRenModel    () { return  &m_cRendererModel ; }; 
151#endif
152
153#if DEPTH_MAP_GENERATION
154  TComSPSAccess*    getSPSAccess  () { return &m_cSPSAccess;   }
155  TComAUPicAccess*  getAUPicAccess() { return &m_cAUPicAccess; }
156#endif
157
158#if POZNAN_MP
159  TComMP* getMP() {return m_pcMP;}
160#endif
161
162#if HHI_VSO
163private:
164  std::vector<TVideoIOYuv*>                            m_acTVideoIOYuvERFileList;
165  std::map< Int, std::vector< TComPicYuv*> > m_cMapPicExtRefView;             /// Buffer for external Reference files
166
167  Int                                        m_iLastFramePutInERViewBuffer;   ///< Poc of last frame put to ERView Buffer
168  Void  xSetERPicYuvs(  Int iViewIdx, Int iPoc, TComMVDRefData* pcReferenceInfo );    ///< store pic from buffer in pcReferenceInfo   
169  Void  xStoreVSORefPicsInBuffer();                                                   ///< read in External Ref pic from file and store in buffer
170#endif
171 
172
173#if POZNAN_SYNTH
174private:
175  Void  xStoreSynthPicsInBuffer(Int iCoddedViewIdx, Bool bDepth);
176#endif
177
178#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
179private:
180  Void xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx);
181#endif
182
183};// END CLASS DEFINITION TAppEncTop
184
185#endif // __TAPPENCTOP__
186
Note: See TracBrowser for help on using the repository browser.