source: 3DVCSoftware/branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncTop.h @ 11

Last change on this file since 11 was 11, checked in by poznan-univ, 12 years ago

Poznan disocclusion coding - CU Skip

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