[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 |
---|
[1313] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[1313] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[5] | 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. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 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 | /** \file TDecCAVLC.h |
---|
| 35 | \brief CAVLC decoder class (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TDECCAVLC__ |
---|
| 39 | #define __TDECCAVLC__ |
---|
| 40 | |
---|
| 41 | #if _MSC_VER > 1000 |
---|
| 42 | #pragma once |
---|
| 43 | #endif // _MSC_VER > 1000 |
---|
| 44 | |
---|
| 45 | #include "TDecEntropy.h" |
---|
[608] | 46 | #include "SyntaxElementParser.h" |
---|
[2] | 47 | |
---|
[56] | 48 | //! \ingroup TLibDecoder |
---|
| 49 | //! \{ |
---|
| 50 | |
---|
[2] | 51 | // ==================================================================================================================== |
---|
| 52 | // Class definition |
---|
| 53 | // ==================================================================================================================== |
---|
[1313] | 54 | #if NH_MV |
---|
[1179] | 55 | class TDecTop; |
---|
| 56 | #endif |
---|
[2] | 57 | /// CAVLC decoder class |
---|
[608] | 58 | class TDecCavlc : public SyntaxElementParser, public TDecEntropyIf |
---|
[2] | 59 | { |
---|
| 60 | public: |
---|
| 61 | TDecCavlc(); |
---|
| 62 | virtual ~TDecCavlc(); |
---|
[1313] | 63 | |
---|
[2] | 64 | protected: |
---|
[1313] | 65 | |
---|
[1321] | 66 | #if NH_MV |
---|
| 67 | Void parseShortTermRefPicSet (TComSPS* pcSPS, TComStRefPicSet* pcRPS, Int stRpsIdx ); |
---|
| 68 | #else |
---|
[1313] | 69 | Void parseShortTermRefPicSet (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx); |
---|
[1321] | 70 | #endif |
---|
[1313] | 71 | |
---|
| 72 | #if NH_MV |
---|
[1179] | 73 | TDecTop* m_decTop; |
---|
| 74 | #endif |
---|
[2] | 75 | public: |
---|
[56] | 76 | |
---|
| 77 | /// rest entropy coder by intial QP and IDC in CABAC |
---|
[608] | 78 | Void resetEntropy ( TComSlice* /*pcSlice*/ ) { assert(0); }; |
---|
[56] | 79 | Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; } |
---|
[2] | 80 | Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); |
---|
[1313] | 81 | Void parseQtCbf ( class TComTU &rTu, const ComponentID compID, const Bool lowestLevel ); |
---|
[608] | 82 | Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); |
---|
[77] | 83 | Void parseVPS ( TComVPS* pcVPS ); |
---|
[1313] | 84 | #if NH_MV |
---|
[622] | 85 | Void parseVPSExtension ( TComVPS* pcVPS ); |
---|
[1313] | 86 | Void parseRepFormat ( Int i, TComRepFormat* curRepFormat, const TComRepFormat* prevRepFormat ); |
---|
| 87 | Void parseVPSVUI ( const TComVPS* pcVPS, TComVPSVUI* vpsVui ); |
---|
[964] | 88 | Void parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ); |
---|
[738] | 89 | Void parseDpbSize ( TComVPS* pcVPS ); |
---|
[1313] | 90 | Void parseVpsVuiBspHrdParameters( const TComVPS* vps, TComVPSVUI* vpsVui ); |
---|
[622] | 91 | |
---|
[1313] | 92 | Void parseSpsMultilayerExtension( TComSPS* pcSPS ); |
---|
| 93 | Void parsePpsMultilayerExtension( TComPPS* pcPPS ); |
---|
| 94 | Void setDecTop ( TDecTop* decTop ) { m_decTop = decTop; }; |
---|
[622] | 95 | #endif |
---|
[1313] | 96 | #if NH_3D |
---|
| 97 | Void parseVps3dExtension ( TComVPS* pcVPS ); |
---|
| 98 | Void parseSps3dExtension ( TComSPS* pcSPS ); |
---|
| 99 | Void parsePps3dExtension ( TComPPS* pcPPS ); |
---|
[2] | 100 | #endif |
---|
[758] | 101 | |
---|
[1313] | 102 | Void parseSPS ( TComSPS* pcSPS ); |
---|
| 103 | Void parsePPS ( TComPPS* pcPPS ); |
---|
[1066] | 104 | |
---|
[608] | 105 | Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); |
---|
| 106 | Void parseSEI ( SEIMessages& ); |
---|
| 107 | Void parsePTL ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ); |
---|
[1313] | 108 | Void parseProfileTier (ProfileTierLevel *ptl, const Bool bIsSubLayer); |
---|
[608] | 109 | Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); |
---|
[1321] | 110 | #if NH_MV |
---|
| 111 | Void parseFirstSliceSegmentInPicFlag( TComSlice* pcSlice ); |
---|
| 112 | Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager ); |
---|
| 113 | #else |
---|
[1313] | 114 | Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC); |
---|
[1321] | 115 | #endif |
---|
| 116 | |
---|
[2] | 117 | Void parseTerminatingBit ( UInt& ruiBit ); |
---|
[1313] | 118 | Void parseRemainingBytes ( Bool noTrailingBytesExpected ); |
---|
| 119 | |
---|
| 120 | Void parseMVPIdx ( Int& riMVPIdx ); |
---|
| 121 | |
---|
| 122 | Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 123 | #if NH_3D_DIS |
---|
| 124 | Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1179] | 125 | #endif |
---|
[1313] | 126 | Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 127 | Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); |
---|
| 128 | Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); |
---|
[1313] | 129 | #if NH_3D_ARP |
---|
[608] | 130 | Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 131 | #endif |
---|
[1313] | 132 | #if NH_3D_IC |
---|
[189] | 133 | Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 134 | #endif |
---|
[1313] | 135 | #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER |
---|
| 136 | Void parseDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); }; |
---|
| 137 | #endif |
---|
| 138 | #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER |
---|
[833] | 139 | Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[5] | 140 | #endif |
---|
[1313] | 141 | #if NH_3D_DBBP |
---|
[833] | 142 | Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 143 | #endif |
---|
[2] | 144 | Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 145 | Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 146 | Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1313] | 147 | |
---|
[2] | 148 | Void parseIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 149 | Void parseIntraDirChroma ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1313] | 150 | |
---|
[608] | 151 | Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ); |
---|
[1313] | 152 | Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ); |
---|
[2] | 153 | Void parseMvd ( TComDataCU* pcCU, UInt uiAbsPartAddr,UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ); |
---|
[1313] | 154 | |
---|
| 155 | Void parseCrossComponentPrediction( class TComTU &rTu, ComponentID compID ); |
---|
| 156 | |
---|
[2] | 157 | Void parseDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1313] | 158 | Void parseChromaQpAdjustment( TComDataCU* cu, UInt absPartIdx, UInt depth); |
---|
[608] | 159 | |
---|
[1313] | 160 | Void parseCoeffNxN ( class TComTU &rTu, ComponentID compID ); |
---|
| 161 | |
---|
| 162 | Void parseTransformSkipFlags ( class TComTU &rTu, ComponentID component ); |
---|
| 163 | |
---|
[56] | 164 | Void parseIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 165 | |
---|
[1313] | 166 | Void xParsePredWeightTable ( TComSlice* pcSlice, const TComSPS *sps ); |
---|
| 167 | Void parseScalingList ( TComScalingList* scalingList ); |
---|
| 168 | Void xDecodeScalingList ( TComScalingList *scalingList, UInt sizeId, UInt listId); |
---|
[2] | 169 | |
---|
[1313] | 170 | Void parseExplicitRdpcmMode( TComTU &rTu, ComponentID compID ); |
---|
| 171 | #if NH_MV |
---|
[1179] | 172 | TDecTop* getDecTop() { return m_decTop; }; |
---|
| 173 | #endif |
---|
| 174 | |
---|
[56] | 175 | protected: |
---|
| 176 | Bool xMoreRbspData(); |
---|
| 177 | }; |
---|
[2] | 178 | |
---|
[56] | 179 | //! \} |
---|
| 180 | |
---|
[2] | 181 | #endif // !defined(AFX_TDECCAVLC_H__9732DD64_59B0_4A41_B29E_1A5B18821EAD__INCLUDED_) |
---|