[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 | * |
---|
| 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 | */ |
---|
[2] | 33 | |
---|
| 34 | |
---|
[5] | 35 | |
---|
[2] | 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 | #include "TAppDecCfg.h" |
---|
| 55 | |
---|
| 56 | // ==================================================================================================================== |
---|
| 57 | // Class definition |
---|
| 58 | // ==================================================================================================================== |
---|
| 59 | |
---|
| 60 | /// decoder application class |
---|
| 61 | class TAppDecTop : public TAppDecCfg |
---|
| 62 | { |
---|
| 63 | private: |
---|
| 64 | // class interface |
---|
| 65 | std::vector<TDecTop*> m_acTDecTopList; |
---|
| 66 | std::vector<TDecTop*> m_acTDecDepthTopList; |
---|
| 67 | TComBitstream* m_apcBitstream; ///< bitstream class |
---|
| 68 | TVideoIOBitsStartCode m_cTVideoIOBitstreamFile; ///< file I/O class |
---|
| 69 | std::vector<TVideoIOYuv*> m_acTVideoIOYuvReconFileList; |
---|
| 70 | std::vector<TVideoIOYuv*> m_acTVideoIOYuvDepthReconFileList; |
---|
[5] | 71 | |
---|
[2] | 72 | Bool m_bUsingDepth; |
---|
| 73 | |
---|
| 74 | // for output control |
---|
| 75 | Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP |
---|
| 76 | // Int m_iPOCLastDisplay; ///< last POC in display order |
---|
| 77 | |
---|
| 78 | std::vector<Bool> m_abDecFlagList; ///< decoded flag in one GOP |
---|
| 79 | std::vector<Int> m_aiPOCLastDisplayList; |
---|
| 80 | std::vector<Int> m_aiDepthPOCLastDisplayList; |
---|
| 81 | |
---|
| 82 | FILE* m_pScaleOffsetFile; |
---|
| 83 | CamParsCollector m_cCamParsCollector; |
---|
[5] | 84 | #if DEPTH_MAP_GENERATION |
---|
[2] | 85 | TComSPSAccess m_cSPSAccess; |
---|
| 86 | TComAUPicAccess m_cAUPicAccess; |
---|
[5] | 87 | #endif |
---|
| 88 | |
---|
[2] | 89 | public: |
---|
| 90 | TAppDecTop(); |
---|
| 91 | virtual ~TAppDecTop() {} |
---|
[5] | 92 | |
---|
[2] | 93 | Void create (); ///< create internal members |
---|
| 94 | Void destroy (); ///< destroy internal members |
---|
| 95 | Void decode (); ///< main decoding function |
---|
| 96 | Void increaseNumberOfViews (Int iNewNumberOfViews); |
---|
| 97 | Void startUsingDepth() ; |
---|
| 98 | |
---|
| 99 | // GT FIX |
---|
| 100 | std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepth ); |
---|
| 101 | TComPic* getPicFromView( Int iViewIdx, Int iPoc, bool bDepth ); |
---|
| 102 | // GT FIX END |
---|
| 103 | |
---|
[5] | 104 | #if DEPTH_MAP_GENERATION |
---|
[2] | 105 | TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; } |
---|
| 106 | TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } |
---|
[20] | 107 | TDecTop* getDecTop0 () { return m_acTDecTopList[0]; } |
---|
[5] | 108 | #endif |
---|
| 109 | |
---|
[2] | 110 | protected: |
---|
| 111 | Void xCreateDecLib (); ///< create internal classes |
---|
| 112 | Void xDestroyDecLib (); ///< destroy internal classes |
---|
| 113 | Void xInitDecLib (); ///< initialize decoder class |
---|
[5] | 114 | |
---|
[2] | 115 | Void xWriteOutput ( TComList<TComPic*>* pcListPic ); ///< write YUV to file |
---|
| 116 | }; |
---|
| 117 | |
---|
| 118 | #endif |
---|
| 119 | |
---|