[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" |
---|
[12] | 54 | #if POZNAN_CU_SKIP || POZNAN_CU_SYNTH |
---|
[11] | 55 | #include "../../Lib/TLibRenderer/TRenTop.h" |
---|
| 56 | #endif |
---|
[2] | 57 | #include "TAppDecCfg.h" |
---|
| 58 | |
---|
[12] | 59 | #if POZNAN_MP |
---|
| 60 | #include "../../Lib/TLibCommon/TComMP.h" |
---|
| 61 | #endif |
---|
| 62 | |
---|
[2] | 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; |
---|
[5] | 78 | |
---|
[2] | 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; |
---|
[5] | 91 | #if DEPTH_MAP_GENERATION |
---|
[2] | 92 | TComSPSAccess m_cSPSAccess; |
---|
| 93 | TComAUPicAccess m_cAUPicAccess; |
---|
[5] | 94 | #endif |
---|
| 95 | |
---|
[12] | 96 | #if POZNAN_CU_SKIP || POZNAN_CU_SYNTH |
---|
[11] | 97 | TRenTop m_cAvailabilityRenderer; |
---|
| 98 | #endif |
---|
| 99 | |
---|
[12] | 100 | #if POZNAN_MP |
---|
| 101 | TComMP* m_pcMP; |
---|
| 102 | #endif |
---|
[11] | 103 | |
---|
[2] | 104 | public: |
---|
| 105 | TAppDecTop(); |
---|
| 106 | virtual ~TAppDecTop() {} |
---|
[5] | 107 | |
---|
[2] | 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 | |
---|
[12] | 114 | #if POZNAN_CU_SKIP || POZNAN_CU_SYNTH |
---|
[11] | 115 | Void initRenderer(TComSPS &cComSPS); |
---|
| 116 | Void storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx,Int iCurPoc,Bool bDepth); |
---|
| 117 | #endif |
---|
| 118 | |
---|
[2] | 119 | // GT FIX |
---|
| 120 | std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepth ); |
---|
| 121 | TComPic* getPicFromView( Int iViewIdx, Int iPoc, bool bDepth ); |
---|
| 122 | // GT FIX END |
---|
| 123 | |
---|
[5] | 124 | #if DEPTH_MAP_GENERATION |
---|
[2] | 125 | TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; } |
---|
| 126 | TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } |
---|
[5] | 127 | #endif |
---|
| 128 | |
---|
[12] | 129 | #if POZNAN_MP |
---|
| 130 | TComMP* getMP() { return m_pcMP; } |
---|
| 131 | #endif |
---|
| 132 | |
---|
[2] | 133 | protected: |
---|
| 134 | Void xCreateDecLib (); ///< create internal classes |
---|
| 135 | Void xDestroyDecLib (); ///< destroy internal classes |
---|
| 136 | Void xInitDecLib (); ///< initialize decoder class |
---|
[5] | 137 | |
---|
[2] | 138 | Void xWriteOutput ( TComList<TComPic*>* pcListPic ); ///< write YUV to file |
---|
| 139 | }; |
---|
| 140 | |
---|
| 141 | #endif |
---|
| 142 | |
---|