source: 3DVCSoftware/branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.h @ 166

Last change on this file since 166 was 166, checked in by mitsubishi-htm, 12 years ago

Initial integration of VSP into HTM 4.0.1. The version used for JCT3V-B0102 at Shanghai meeting.

  • VC9 project/solution files updated. Other Visual C++ project/solution files are not updated.
  • Linux make file updated.

TODO

  • A second release is expected to include some bug fix and improvements on the interface, e.g. to move switches from macro definition to the configuration file.
  • A third release is expected after being integrated within HTM 5.x, which is to be used for CE1.h anchor.
  • Property svn:eol-style set to native
File size: 6.6 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-2012, 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 ITU/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/** \file     TAppEncTop.h
35    \brief    Encoder application class (header)
36*/
37
38#ifndef __TAPPENCTOP__
39#define __TAPPENCTOP__
40
41#include <list>
42#include <ostream>
43
44#include "TLibEncoder/TEncTop.h"
45#include "TLibVideoIO/TVideoIOYuv.h"
46#include "TLibCommon/AccessUnit.h"
47#include "TAppEncCfg.h"
48#include "TLibCommon/TComDepthMapGenerator.h"
49#if HHI_VSO || HHI_INTERVIEW_SKIP
50#include "../../Lib/TLibRenderer/TRenTop.h"
51#endif
52
53//! \ingroup TAppEncoder
54//! \{
55
56// ====================================================================================================================
57// Class definition
58// ====================================================================================================================
59
60/// encoder application class
61class TAppEncTop : public TAppEncCfg
62{
63private:
64  // class interface
65  std::vector<TEncTop*>      m_acTEncTopList ;
66  std::vector<TEncTop*>      m_acTEncDepthTopList ;
67  std::vector<TVideoIOYuv*>  m_acTVideoIOYuvInputFileList;  ///< input YUV file
68  std::vector<TVideoIOYuv*>  m_acTVideoIOYuvDepthInputFileList;
69  std::vector<TVideoIOYuv*>  m_acTVideoIOYuvReconFileList;  ///< output reconstruction file
70  std::vector<TVideoIOYuv*>  m_acTVideoIOYuvDepthReconFileList;
71
72  std::vector< TComList<TComPicYuv*>* >  m_picYuvRec;       ///< list of reconstruction YUV files
73  std::vector< TComList<TComPicYuv*>* >  m_picYuvDepthRec;         
74
75  std::vector<Int>           m_frameRcvd;                  ///< number of received frames
76  std::vector<Int>           m_depthFrameRcvd;   
77
78  unsigned                   m_essentialBytes;
79  unsigned                   m_totalBytes;
80
81#if DEPTH_MAP_GENERATION
82#if VIDYO_VPS_INTEGRATION
83  TComVPSAccess               m_cVPSAccess;
84#endif
85  TComSPSAccess               m_cSPSAccess;
86  TComAUPicAccess             m_cAUPicAccess;
87#endif
88
89#if VIDYO_VPS_INTEGRATION
90  TComVPS                     m_cVPS;
91#endif
92 
93#if HHI_VSO
94  TRenTop                     m_cRendererTop; 
95  TRenModel                   m_cRendererModel;   
96#endif
97
98#if HHI_INTERVIEW_SKIP
99  TRenTop  m_cUsedPelsRenderer;                               ///< renderer for used pels map
100#endif
101
102#if VSP_N
103  TRenTop                     m_cVSPRendererTop;
104#endif
105
106protected:
107  // initialization
108  Void  xCreateLib        ();                               ///< create files & encoder class
109  Void  xInitLibCfg       ();                               ///< initialize internal variables
110  Void  xInitLib          ();                               ///< initialize encoder class
111  Void  xDestroyLib       ();                               ///< destroy encoder class
112 
113  /// obtain required buffers
114  Void xGetBuffer(TComPicYuv*& rpcPicYuvRec, Int iViewIdx, Bool isDepth);
115 
116  /// delete allocated buffers
117  Void  xDeleteBuffer     ();
118 
119  // file I/O
120  Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, std::list<AccessUnit>& accessUnits, Int iViewIdx, Bool isDepth); ///< write bitstream to file
121  void rateStatsAccum(const AccessUnit& au, const std::vector<unsigned>& stats);
122  // void printRateSummary();
123 
124  TComPic* xGetPicFromView( Int viewId, Int iPoc, Bool isDepth );
125  TComPicYuv* xGetPicYuvFromView( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon );
126 
127public:
128  TAppEncTop();
129  virtual ~TAppEncTop();
130
131
132  Void        encode      ();                               ///< main encoding function
133  TEncTop*    getTEncTop( Int viewId, Bool isDepth );   
134
135  std::vector<TComPic*> getInterViewRefPics( Int viewId, Int poc, Bool isDepth, TComSPS* sps );
136  TComPic*              getPicFromView     ( Int viewId, Int poc, Bool isDepth ) { return xGetPicFromView( viewId, poc, isDepth ); }
137  TComPicYuv*           getPicYuvFromView  ( Int iViewIdx, Int iPoc, bool bDepth, Bool bRecon ) { return xGetPicYuvFromView( iViewIdx, iPoc, bDepth, bRecon ); }
138
139#if HHI_INTERVIEW_SKIP
140  Void                  getUsedPelsMap   ( Int iViewIdx, Int iPoc, TComPicYuv* pcPicYuvUsedPelsMap );
141#endif
142#if HHI_VSO
143#if HHI_VSO_SPEEDUP_A0033
144  Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset );
145#else
146  Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent );
147#endif
148#endif
149 
150#if VIDYO_VPS_INTEGRATION
151  TComVPS*          getVPS()  { return &m_cVPS; }
152  TComVPSAccess*    getVPSAccess  () { return &m_cVPSAccess;   }
153#endif
154 
155#if DEPTH_MAP_GENERATION
156  TComSPSAccess*    getSPSAccess  () { return &m_cSPSAccess;   }
157  TComAUPicAccess*  getAUPicAccess() { return &m_cAUPicAccess; }
158#endif
159
160#if HHI_VSO
161  TRenModel* getRenModel    () { return  &m_cRendererModel ; }; 
162#endif
163
164#if HHI_VSO
165private:
166  Void  xStoreVSORefPicsInBuffer();                                                   ///< read in External Ref pic from file and store in buffer
167#endif
168
169#if VSP_N
170  Void xStoreVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Bool bDepth, Int gopId);
171#endif
172};// END CLASS DEFINITION TAppEncTop
173
174//! \}
175
176#endif // __TAPPENCTOP__
177
Note: See TracBrowser for help on using the repository browser.