Changeset 1235 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 13 Jul 2015, 20:38:11 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h
r1029 r1235 222 222 Void clearEmulationPreventionByteLocation() { m_emulationPreventionByteLocation.clear(); } 223 223 Void setEmulationPreventionByteLocation ( std::vector<UInt> vec ) { m_emulationPreventionByteLocation = vec; } 224 225 const std::vector<uint8_t> *getFifo() const { return m_fifo; } 224 226 }; 225 227 -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r1226 r1235 50 50 , m_bUsedByCurr (false) 51 51 , m_bIsLongTerm (false) 52 , m_apcPicSym (NULL)53 52 , m_pcPicYuvPred (NULL) 54 53 , m_pcPicYuvResi (NULL) … … 76 75 } 77 76 #if SVC_EXTENSION 78 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 79 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 80 { 81 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( chromaFormatIDC, iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual, const UInt layerId ) 78 { 79 const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId); 80 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 81 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 82 83 const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId ); 84 85 m_picSym.create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, layerId ); 86 82 87 if (!bIsVirtual) 83 88 { … … 93 98 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow ); 94 99 } 95 } 96 97 m_layerId = pcSps ? pcSps->getLayerId() : 0; 100 } 98 101 99 102 // there are no SEI messages associated with this picture initially … … 103 106 } 104 107 m_bUsedByCurr = false; 105 106 /* store conformance window parameters with picture */107 m_conformanceWindow = conformanceWindow;108 109 /* store display window parameters with picture */110 m_defaultDisplayWindow = defaultDisplayWindow;111 112 /* store number of reorder pics with picture */113 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int));114 115 return;116 108 } 117 109 #else 118 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 119 Int *numReorderPics, Bool bIsVirtual) 120 { 121 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( chromaFormatIDC, iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 110 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual) 111 { 112 const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc(); 113 const Int iWidth = sps.getPicWidthInLumaSamples(); 114 const Int iHeight = sps.getPicHeightInLumaSamples(); 115 116 m_picSym.create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 122 117 if (!bIsVirtual) 123 118 { 124 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );119 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 125 120 m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 126 121 } … … 133 128 } 134 129 m_bUsedByCurr = false; 135 136 /* store conformance window parameters with picture */137 m_conformanceWindow = conformanceWindow;138 139 /* store display window parameters with picture */140 m_defaultDisplayWindow = defaultDisplayWindow;141 142 /* store number of reorder pics with picture */143 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int));144 145 return;146 130 } 147 131 #endif … … 149 133 Void TComPic::destroy() 150 134 { 151 if (m_apcPicSym) 152 { 153 m_apcPicSym->destroy(); 154 delete m_apcPicSym; 155 m_apcPicSym = NULL; 156 } 135 m_picSym.destroy(); 157 136 158 137 for(UInt i=0; i<NUM_PIC_YUV; i++) … … 200 179 { 201 180 UInt subStrm; 202 203 if (pcSlice->getPPS()->getNumSubstreams() > 1) // wavefronts, and possibly tiles being used. 204 { 205 if (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) 206 { 207 const TComPicSym &picSym = *(getPicSym()); 181 const bool bWPPEnabled=pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag(); 182 const TComPicSym &picSym = *(getPicSym()); 183 184 if ((bWPPEnabled && picSym.getFrameHeightInCtus()>1) || (picSym.getNumTiles()>1)) // wavefronts, and possibly tiles being used. 185 { 186 if (bWPPEnabled) 187 { 208 188 const UInt ctuRsAddr = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr); 209 189 const UInt frameWidthInCtus = picSym.getFrameWidthInCtus(); … … 220 200 else 221 201 { 222 const TComPicSym &picSym = *(getPicSym());223 202 const UInt ctuRsAddr = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr); 224 203 const UInt tileIndex = picSym.getTileIdxMap(ctuRsAddr); -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1226 r1235 68 68 Bool m_bUsedByCurr; // Used by current picture 69 69 Bool m_bIsLongTerm; // IS long term picture 70 TComPicSym * m_apcPicSym;// Symbol70 TComPicSym m_picSym; // Symbol 71 71 TComPicYuv* m_apcPicYuv[NUM_PIC_YUV]; 72 72 … … 77 77 UInt m_uiCurrSliceIdx; // Index of current slice 78 78 Bool m_bCheckLTMSB; 79 80 Int m_numReorderPics[MAX_TLAYER];81 Window m_conformanceWindow;82 Window m_defaultDisplayWindow;83 79 84 80 Bool m_isTop; … … 101 97 TComPic(); 102 98 virtual ~TComPic(); 103 99 104 100 #if SVC_EXTENSION 105 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 106 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 101 Void create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/, const UInt layerId ); 107 102 #else 108 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 109 Int *numReorderPics,Bool bIsVirtual /*= false*/ ); 110 #endif //SVC_EXTENSION 103 Void create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ ); 104 #endif 111 105 112 106 virtual Void destroy(); … … 122 116 Bool getCheckLTMSBPresent () { return m_bCheckLTMSB;} 123 117 124 TComPicSym* getPicSym() { return m_apcPicSym; } 125 TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } 126 Int getPOC() const { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } 127 TComDataCU* getCtu( UInt ctuRsAddr ) { return m_apcPicSym->getCtu( ctuRsAddr ); } 128 const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_apcPicSym->getCtu( ctuRsAddr ); } 118 TComPicSym* getPicSym() { return &m_picSym; } 119 TComSlice* getSlice(Int i) { return m_picSym.getSlice(i); } 120 Int getPOC() const { return m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC(); } 121 TComDataCU* getCtu( UInt ctuRsAddr ) { return m_picSym.getCtu( ctuRsAddr ); } 122 const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_picSym.getCtu( ctuRsAddr ); } 123 129 124 130 125 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[PIC_YUV_ORG]; } … … 136 131 Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; } 137 132 138 UInt getNumberOfCtusInFrame() const { return m_ apcPicSym->getNumberOfCtusInFrame(); }139 UInt getNumPartInCtuWidth() const { return m_ apcPicSym->getNumPartInCtuWidth(); }140 UInt getNumPartInCtuHeight() const { return m_ apcPicSym->getNumPartInCtuHeight(); }141 UInt getNumPartitionsInCtu() const { return m_ apcPicSym->getNumPartitionsInCtu(); }142 UInt getFrameWidthInCtus() const { return m_ apcPicSym->getFrameWidthInCtus(); }143 UInt getFrameHeightInCtus() const { return m_ apcPicSym->getFrameHeightInCtus(); }144 UInt getMinCUWidth() const { return m_ apcPicSym->getMinCUWidth(); }145 UInt getMinCUHeight() const { return m_ apcPicSym->getMinCUHeight(); }133 UInt getNumberOfCtusInFrame() const { return m_picSym.getNumberOfCtusInFrame(); } 134 UInt getNumPartInCtuWidth() const { return m_picSym.getNumPartInCtuWidth(); } 135 UInt getNumPartInCtuHeight() const { return m_picSym.getNumPartInCtuHeight(); } 136 UInt getNumPartitionsInCtu() const { return m_picSym.getNumPartitionsInCtu(); } 137 UInt getFrameWidthInCtus() const { return m_picSym.getFrameWidthInCtus(); } 138 UInt getFrameHeightInCtus() const { return m_picSym.getFrameHeightInCtus(); } 139 UInt getMinCUWidth() const { return m_picSym.getMinCUWidth(); } 140 UInt getMinCUHeight() const { return m_picSym.getMinCUHeight(); } 146 141 147 142 Int getStride(const ComponentID id) const { return m_apcPicYuv[PIC_YUV_REC]->getStride(id); } … … 156 151 Bool getOutputMark () const { return m_bNeededForOutput; } 157 152 158 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; }159 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; }160 161 153 Void compressMotion(); 162 154 UInt getCurrSliceIdx() const { return m_uiCurrSliceIdx; } 163 155 Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } 164 UInt getNumAllocatedSlice() const {return m_ apcPicSym->getNumAllocatedSlice();}165 Void allocateNewSlice() {m_ apcPicSym->allocateNewSlice(); }166 Void clearSliceBuffer() {m_ apcPicSym->clearSliceBuffer(); }167 168 Window& getConformanceWindow() { return m_conformanceWindow; }169 Window & getDefDisplayWindow() { return m_defaultDisplayWindow; }156 UInt getNumAllocatedSlice() const {return m_picSym.getNumAllocatedSlice();} 157 Void allocateNewSlice() {m_picSym.allocateNewSlice(); } 158 Void clearSliceBuffer() {m_picSym.clearSliceBuffer(); } 159 160 const Window& getConformanceWindow() const { return m_picSym.getSPS().getConformanceWindow(); } 161 Window getDefDisplayWindow() const { return m_picSym.getSPS().getVuiParametersPresentFlag() ? m_picSym.getSPS().getVuiParameters()->getDefaultDisplayWindow() : Window(); } 170 162 171 163 Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr); -
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp
r1029 r1235 59 59 ,m_numPartInCtuHeight(0) 60 60 ,m_numCtusInFrame(0) 61 ,m_apcTComSlice(NULL) 62 ,m_uiNumAllocatedSlice(0) 61 ,m_apSlices() 63 62 ,m_pictureCtuArray(NULL) 64 63 ,m_numTileColumnsMinus1(0) … … 68 67 ,m_ctuRsToTsAddrMap(NULL) 69 68 ,m_saoBlkParams(NULL) 69 #if SVC_EXTENSION 70 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 71 , m_piTileSetIdxMap(NULL) 72 , m_pucTileSetType(NULL) 73 , m_pbSkippedTileSetFlag(NULL) 74 #endif 75 #endif 70 76 {} 71 77 72 73 Void TComPicSym::create ( ChromaFormat chromaFormatIDC, Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth)78 #if SVC_EXTENSION 79 Void TComPicSym::create ( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, const UInt layerId ) 74 80 { 75 81 UInt i; 82 m_sps = sps; 83 m_pps = pps; 84 m_vps = &vps; 85 86 const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId); 87 const Int iPicWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 88 const Int iPicHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 89 #else 90 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ) 91 { 92 UInt i; 93 m_sps = sps; 94 m_pps = pps; 95 96 const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc(); 97 const Int iPicWidth = sps.getPicWidthInLumaSamples(); 98 const Int iPicHeight = sps.getPicHeightInLumaSamples(); 99 #endif 76 100 77 101 m_uhTotalDepth = uiMaxDepth; … … 93 117 m_pictureCtuArray = new TComDataCU*[m_numCtusInFrame]; 94 118 95 if (m_uiNumAllocatedSlice>0) 96 { 97 for ( i=0; i<m_uiNumAllocatedSlice ; i++ ) 98 { 99 delete m_apcTComSlice[i]; 100 } 101 delete [] m_apcTComSlice; 102 } 103 m_apcTComSlice = new TComSlice*[m_numCtusInFrame]; 104 m_apcTComSlice[0] = new TComSlice; 105 m_uiNumAllocatedSlice = 1; 119 clearSliceBuffer(); 120 allocateNewSlice(); 121 106 122 for ( i=0; i<m_numCtusInFrame ; i++ ) 107 123 { … … 131 147 132 148 m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame]; 149 150 xInitTiles(); 151 xInitCtuTsRsAddrMaps(); 133 152 } 134 153 135 154 Void TComPicSym::destroy() 136 155 { 137 if (m_uiNumAllocatedSlice>0) 138 { 139 for (Int i = 0; i<m_uiNumAllocatedSlice ; i++ ) 140 { 141 delete m_apcTComSlice[i]; 142 } 143 delete [] m_apcTComSlice; 144 } 145 m_apcTComSlice = NULL; 156 clearSliceBuffer(); 146 157 147 158 for (Int i = 0; i < m_numCtusInFrame; i++) … … 179 190 Void TComPicSym::allocateNewSlice() 180 191 { 181 assert ((m_uiNumAllocatedSlice + 1) <= m_numCtusInFrame); 182 m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice; 183 if (m_uiNumAllocatedSlice>=2) 184 { 185 m_apcTComSlice[m_uiNumAllocatedSlice-1]->copySliceInfo( m_apcTComSlice[m_uiNumAllocatedSlice-2] ); 192 m_apSlices.push_back(new TComSlice); 193 m_apSlices.back()->setPPS(&m_pps); 194 m_apSlices.back()->setSPS(&m_sps); 186 195 #if SVC_EXTENSION 187 m_apcTComSlice[m_uiNumAllocatedSlice-1]->initSlice( m_apcTComSlice[m_uiNumAllocatedSlice-1]->getLayerId() ); 196 m_apSlices.back()->setVPS(m_vps); 197 #endif 198 if (m_apSlices.size()>=2) 199 { 200 m_apSlices.back()->copySliceInfo( m_apSlices[m_apSlices.size()-2] ); 201 #if SVC_EXTENSION 202 m_apSlices.back()->initSlice( m_apSlices[m_apSlices.size()-1]->getLayerId() ); 188 203 #else 189 m_ap cTComSlice[m_uiNumAllocatedSlice-1]->initSlice();204 m_apSlices.back()->initSlice(); 190 205 #endif 191 206 } … … 194 209 Void TComPicSym::clearSliceBuffer() 195 210 { 196 UInt i; 197 for (i = 1; i < m_uiNumAllocatedSlice; i++) 198 { 199 delete m_apcTComSlice[i]; 200 } 201 m_uiNumAllocatedSlice = 1; 202 } 203 204 Void TComPicSym::initCtuTsRsAddrMaps() 211 for (UInt i = 0; i < UInt(m_apSlices.size()); i++) 212 { 213 delete m_apSlices[i]; 214 } 215 m_apSlices.clear(); 216 } 217 218 Void TComPicSym::xInitCtuTsRsAddrMaps() 205 219 { 206 220 //generate the Coding Order Map and Inverse Coding Order Map … … 214 228 } 215 229 216 Void TComPicSym:: initTiles(TComPPS *pps)230 Void TComPicSym::xInitTiles() 217 231 { 218 232 //set NumColumnsMinus1 and NumRowsMinus1 219 setNumTileColumnsMinus1( pps->getNumTileColumnsMinus1() );220 setNumTileRowsMinus1( pps->getNumTileRowsMinus1() );221 222 const Int numCols = pps->getNumTileColumnsMinus1() + 1;223 const Int numRows = pps->getNumTileRowsMinus1() + 1;233 setNumTileColumnsMinus1( m_pps.getNumTileColumnsMinus1() ); 234 setNumTileRowsMinus1( m_pps.getNumTileRowsMinus1() ); 235 236 const Int numCols = m_pps.getNumTileColumnsMinus1() + 1; 237 const Int numRows = m_pps.getNumTileRowsMinus1() + 1; 224 238 const Int numTiles = numRows * numCols; 225 239 … … 227 241 m_tileParameters.resize(numTiles); 228 242 229 if( pps->getTileUniformSpacingFlag() )243 if( m_pps.getTileUniformSpacingFlag() ) 230 244 { 231 245 //set width and height for each (uniform) tile … … 248 262 for(Int col=0; col < getNumTileColumnsMinus1(); col++) 249 263 { 250 m_tileParameters[row * numCols + col].setTileWidthInCtus( pps->getTileColumnWidth(col) );251 cumulativeTileWidth += pps->getTileColumnWidth(col);264 m_tileParameters[row * numCols + col].setTileWidthInCtus( m_pps.getTileColumnWidth(col) ); 265 cumulativeTileWidth += m_pps.getTileColumnWidth(col); 252 266 } 253 267 m_tileParameters[row * numCols + getNumTileColumnsMinus1()].setTileWidthInCtus( getFrameWidthInCtus()-cumulativeTileWidth ); … … 260 274 for(Int row=0; row < getNumTileRowsMinus1(); row++) 261 275 { 262 m_tileParameters[row * numCols + col].setTileHeightInCtus( pps->getTileRowHeight(row) );263 cumulativeTileHeight += pps->getTileRowHeight(row);276 m_tileParameters[row * numCols + col].setTileHeightInCtus( m_pps.getTileRowHeight(row) ); 277 cumulativeTileHeight += m_pps.getTileRowHeight(row); 264 278 } 265 279 m_tileParameters[getNumTileRowsMinus1() * numCols + col].setTileHeightInCtus( getFrameHeightInCtus()-cumulativeTileHeight ); … … 270 284 Int minWidth = 1; 271 285 Int minHeight = 1; 272 const Int profileIdc = pps->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc();286 const Int profileIdc = m_sps.getPTL()->getGeneralPTL()->getProfileIdc(); 273 287 if ( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10) //TODO: add more profiles to the tile-size check... 274 288 { 275 if ( pps->getTilesEnabledFlag())289 if (m_pps.getTilesEnabledFlag()) 276 290 { 277 291 minHeight = 64 / g_uiMaxCUHeight; -
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h
r1029 r1235 41 41 42 42 // Include files 43 #include <deque> 43 44 #include "CommonDef.h" 44 45 #include "TComSlice.h" … … 97 98 UInt m_numCtusInFrame; 98 99 100 std::deque<TComSlice*> m_apSlices; 101 99 102 TComSlice** m_apcTComSlice; 100 103 UInt m_uiNumAllocatedSlice; … … 108 111 UInt* m_ctuRsToTsAddrMap; ///< for a given RS (Raster-Scan) address, returns the TS (Tile-Scan; coding order) address. cf CtbAddrRsToTs in specification. 109 112 110 SAOBlkParam *m_saoBlkParams; 111 113 SAOBlkParam *m_saoBlkParams; 114 TComSPS m_sps; 115 TComPPS m_pps; 116 117 Void xInitTiles( ); 118 Void xInitCtuTsRsAddrMaps(); 119 Void setNumTileColumnsMinus1( Int i ) { m_numTileColumnsMinus1 = i; } 120 Void setNumTileRowsMinus1( Int i ) { m_numTileRowsMinus1 = i; } 121 Void setCtuTsToRsAddrMap( Int ctuTsAddr, Int ctuRsAddr ) { *(m_ctuTsToRsAddrMap + ctuTsAddr) = ctuRsAddr; } 122 Void setCtuRsToTsAddrMap( Int ctuRsAddr, Int ctuTsOrder ) { *(m_ctuRsToTsAddrMap + ctuRsAddr) = ctuTsOrder; } 123 112 124 #if SVC_EXTENSION 125 const TComVPS* m_vps; 113 126 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 114 Int* m_piTileSetIdxMap; //the map of the tile set index relative to LCU raster scan address115 UChar* m_pucTileSetType;116 Bool* m_pbSkippedTileSetFlag;127 Int* m_piTileSetIdxMap; //the map of the tile set index relative to LCU raster scan address 128 UChar* m_pucTileSetType; 129 Bool* m_pbSkippedTileSetFlag; 117 130 #endif 118 131 #endif 119 132 120 133 public: 121 Void create ( ChromaFormat chromaFormatIDC, Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); 134 #if SVC_EXTENSION 135 Void create ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, const UInt layerId ); 136 #if CGS_3D_ASYMLUT 137 TComPPS* getPPSToUpdate() { return &m_pps; } 138 #endif 139 #else 140 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); 141 #endif 122 142 Void destroy (); 123 143 124 144 TComPicSym (); 125 TComSlice* getSlice(UInt i) { return m_ap cTComSlice[i]; }126 const TComSlice* getSlice(UInt i) const { return m_ap cTComSlice[i]; }145 TComSlice* getSlice(UInt i) { return m_apSlices[i]; } 146 const TComSlice* getSlice(UInt i) const { return m_apSlices[i]; } 127 147 UInt getFrameWidthInCtus() const { return m_frameWidthInCtus; } 128 148 UInt getFrameHeightInCtus() const { return m_frameHeightInCtus; } … … 132 152 TComDataCU* getCtu( UInt ctuRsAddr ) { return m_pictureCtuArray[ctuRsAddr]; } 133 153 const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_pictureCtuArray[ctuRsAddr]; } 134 135 Void setSlice(TComSlice* p, UInt i) { m_apcTComSlice[i] = p; } 136 UInt getNumAllocatedSlice() const { return m_uiNumAllocatedSlice; } 154 const TComSPS& getSPS() const { return m_sps; } 155 const TComPPS& getPPS() const { return m_pps; } 156 157 TComSlice * swapSliceObject(TComSlice* p, UInt i) { p->setSPS(&m_sps); p->setPPS(&m_pps); TComSlice *pTmp=m_apSlices[i];m_apSlices[i] = p; pTmp->setSPS(0); pTmp->setPPS(0); return pTmp; } 158 UInt getNumAllocatedSlice() const { return UInt(m_apSlices.size()); } 137 159 Void allocateNewSlice(); 138 160 Void clearSliceBuffer(); … … 140 162 UInt getNumPartInCtuWidth() const { return m_numPartInCtuWidth; } 141 163 UInt getNumPartInCtuHeight() const { return m_numPartInCtuHeight; } 142 Void setNumTileColumnsMinus1( Int i ) { m_numTileColumnsMinus1 = i; }143 164 Int getNumTileColumnsMinus1() const { return m_numTileColumnsMinus1; } 144 Void setNumTileRowsMinus1( Int i ) { m_numTileRowsMinus1 = i; }145 165 Int getNumTileRowsMinus1() const { return m_numTileRowsMinus1; } 146 166 Int getNumTiles() const { return (m_numTileRowsMinus1+1)*(m_numTileColumnsMinus1+1); } 147 167 TComTile* getTComTile ( UInt tileIdx ) { return &(m_tileParameters[tileIdx]); } 148 168 const TComTile* getTComTile ( UInt tileIdx ) const { return &(m_tileParameters[tileIdx]); } 149 Void setCtuTsToRsAddrMap( Int ctuTsAddr, Int ctuRsAddr ) { *(m_ctuTsToRsAddrMap + ctuTsAddr) = ctuRsAddr; }150 169 UInt getCtuTsToRsAddrMap( Int ctuTsAddr ) const { return *(m_ctuTsToRsAddrMap + (ctuTsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuTsAddr)); } 151 170 UInt getTileIdxMap( Int ctuRsAddr ) const { return *(m_puiTileIdxMap + ctuRsAddr); } 152 Void setCtuRsToTsAddrMap( Int ctuRsAddr, Int ctuTsOrder ) { *(m_ctuRsToTsAddrMap + ctuRsAddr) = ctuTsOrder; }153 171 UInt getCtuRsToTsAddrMap( Int ctuRsAddr ) const { return *(m_ctuRsToTsAddrMap + (ctuRsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuRsAddr)); } 154 Void initTiles(TComPPS *pps);155 156 Void initCtuTsRsAddrMaps();157 172 SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;} 158 173 const SAOBlkParam* getSAOBlkParam() const { return m_saoBlkParams;} -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r1117 r1235 77 77 78 78 #if SVC_EXTENSION 79 Void TComPicYuv::create( const Int iPicWidth, const Int iPicHeight, const ChromaFormat chromaFormatIDC, const UInt uiMaxCUWidth, const UInt uiMaxCUHeight, const UInt uiMaxCUDepth, Window* conformanceWindow )79 Void TComPicYuv::create( const Int iPicWidth, const Int iPicHeight, const ChromaFormat chromaFormatIDC, const UInt uiMaxCUWidth, const UInt uiMaxCUHeight, const UInt uiMaxCUDepth, const Window* conformanceWindow ) 80 80 #else 81 81 Void TComPicYuv::create( const Int iPicWidth, const Int iPicHeight, const ChromaFormat chromaFormatIDC, -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h
r1130 r1235 96 96 // ------------------------------------------------------------------------------------------------ 97 97 #if SVC_EXTENSION 98 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, Window* conformanceWindow = NULL);98 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, const Window* conformanceWindow = NULL); 99 99 #else 100 100 Void create (const Int iPicWidth, -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1231 r1235 51 51 ParameterSetMap<TComSPS> ParameterSetManager::m_spsMap(MAX_NUM_SPS); 52 52 ParameterSetMap<TComPPS> ParameterSetManager::m_ppsMap(MAX_NUM_PPS); 53 Int ParameterSetManager::m_activeVPSId = -1;53 TComVPS ParameterSetManager::m_activeVPS; 54 54 #endif 55 55 … … 110 110 , m_sliceSegmentBits ( 0 ) 111 111 , m_bFinalized ( false ) 112 , m_bTestWeightPred ( false ) 113 , m_bTestWeightBiPred ( false ) 112 114 , m_substreamSizes ( ) 113 , m_scalingList ( NULL )114 115 , m_cabacInitFlag ( false ) 115 116 , m_bLMvdL1Zero ( false ) … … 117 118 , m_LFCrossSliceBoundaryFlag ( false ) 118 119 , m_enableTMVPFlag ( true ) 120 , m_encCABACTableIdx (I_SLICE) 119 121 #if SVC_EXTENSION 120 122 , m_firstSliceInPic ( false ) … … 190 192 { 191 193 #if SVC_EXTENSION 192 m_layerId = layerId;194 m_layerId = layerId; 193 195 m_activeNumILRRefIdx = 0; 194 196 m_interLayerPredEnabledFlag = 0; 195 m_picOrderCntLsb = 0; 197 m_picOrderCntLsb = 0; 198 m_pocResetIdc = 0; 199 m_pocResetPeriodId = 0; 200 m_fullPocResetFlag = false; 201 m_pocLsbVal = 0; 202 m_pocMsbVal = 0; 203 m_pocMsbValRequiredFlag = false; 204 m_pocMsbValPresentFlag = false; 205 m_pocMsbValNeeded = false; 206 m_pocResetDeltaPoc = 0; 196 207 #endif 197 208 … … 216 227 m_cabacInitFlag = false; 217 228 m_enableTMVPFlag = true; 218 m_pocResetIdc = 0; 219 m_pocResetPeriodId = 0; 220 m_fullPocResetFlag = false; 221 m_pocLsbVal = 0; 222 m_pocMsbVal = 0; 223 m_pocMsbValRequiredFlag = false; 224 m_pocMsbValPresentFlag = false; 225 m_pocMsbValNeeded = false; 226 m_pocResetDeltaPoc = 0; 227 } 228 229 Bool TComSlice::getRapPicFlag() 229 } 230 231 Bool TComSlice::getRapPicFlag() const 230 232 { 231 233 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL … … 677 679 } 678 680 679 Int TComSlice::getNumRpsCurrTempList() 681 Int TComSlice::getNumRpsCurrTempList() const 680 682 { 681 683 Int numRpsCurrTempList = 0; … … 752 754 } 753 755 754 Void TComSlice::checkCRA( TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic)756 Void TComSlice::checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic) 755 757 { 756 758 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 1007 1009 // access channel 1008 1010 #if SVC_EXTENSION 1009 m_pcVPS = pSrc->m_pcVPS;1010 m_layerId = pSrc->m_layerId;1011 m_pcVPS = pSrc->m_pcVPS; 1012 m_layerId = pSrc->m_layerId; 1011 1013 m_activeNumILRRefIdx = pSrc->m_activeNumILRRefIdx; 1012 1014 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1013 1015 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1014 1016 #endif 1015 m_pcSPS = pSrc->m_pcSPS;1016 m_pcPPS = pSrc->m_pcPPS;1017 1017 m_pcRPS = pSrc->m_pcRPS; 1018 1018 m_iLastIDR = pSrc->m_iLastIDR; … … 1064 1064 } 1065 1065 1066 m_cabacInitFlag = pSrc->m_cabacInitFlag;1067 1068 m_bLMvdL1Zero = pSrc->m_bLMvdL1Zero;1069 m_LFCrossSliceBoundaryFlag = pSrc->m_LFCrossSliceBoundaryFlag;1066 m_cabacInitFlag = pSrc->m_cabacInitFlag; 1067 1068 m_bLMvdL1Zero = pSrc->m_bLMvdL1Zero; 1069 m_LFCrossSliceBoundaryFlag = pSrc->m_LFCrossSliceBoundaryFlag; 1070 1070 m_enableTMVPFlag = pSrc->m_enableTMVPFlag; 1071 1071 m_maxNumMergeCand = pSrc->m_maxNumMergeCand; 1072 m_encCABACTableIdx = pSrc->m_encCABACTableIdx; 1072 1073 } 1073 1074 … … 1334 1335 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1335 1336 */ 1336 Void TComSlice::applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet)1337 Void TComSlice::applyReferencePictureSet( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet) 1337 1338 { 1338 1339 TComPic* rpcPic; … … 1423 1424 */ 1424 1425 #if ALLOW_RECOVERY_POINT_AS_RAP 1425 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)1426 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint) 1426 1427 #else 1427 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)1428 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess) 1428 1429 #endif 1429 1430 { … … 1655 1656 */ 1656 1657 #if ALLOW_RECOVERY_POINT_AS_RAP 1657 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)1658 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint) 1658 1659 #else 1659 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)1660 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1660 1661 #endif 1661 1662 { … … 1773 1774 Int rIdx = this->getRPSidx() - pReferencePictureSet->getDeltaRIdxMinus1() - 1; 1774 1775 Int deltaRPS = pReferencePictureSet->getDeltaRPS(); 1775 TComReferencePictureSet* pcRefRPS = this->getSPS()->getRPSList()->getReferencePictureSet(rIdx);1776 const TComReferencePictureSet* pcRefRPS = this->getSPS()->getRPSList()->getReferencePictureSet(rIdx); 1776 1777 Int iRefPics = pcRefRPS->getNumberOfPictures(); 1777 1778 Int iNewIdc=0; … … 1866 1867 * \returns Void 1867 1868 */ 1868 Void TComSlice::initWpScaling( )1869 { 1870 const Bool bUseHighPrecisionPredictionWeighting = getSPS()->getUseHighPrecisionPredictionWeighting();1869 Void TComSlice::initWpScaling(const TComSPS *sps) 1870 { 1871 const Bool bUseHighPrecisionPredictionWeighting = sps->getUseHighPrecisionPredictionWeighting(); 1871 1872 for ( Int e=0 ; e<NUM_REF_PIC_LIST_01 ; e++ ) 1872 1873 { … … 1904 1905 , m_bTemporalIdNestingFlag (false) 1905 1906 , m_numHrdParameters ( 0) 1906 , m_hrdParameters ( NULL)1907 , m_hrdOpSetIdx ( NULL)1908 , m_cprmsPresentFlag ( NULL)1907 , m_hrdParameters () 1908 , m_hrdOpSetIdx () 1909 , m_cprmsPresentFlag () 1909 1910 , m_baseLayerInternalFlag (true) 1910 1911 , m_baseLayerAvailableFlag (true) … … 2026 2027 , m_numHrdParameters ( 0) 2027 2028 , m_maxNuhReservedZeroLayerId ( 0) 2028 , m_hrdParameters ( NULL)2029 , m_hrdOpSetIdx ( NULL)2030 , m_cprmsPresentFlag ( NULL)2029 , m_hrdParameters () 2030 , m_hrdOpSetIdx () 2031 , m_cprmsPresentFlag () 2031 2032 { 2032 2033 … … 2042 2043 TComVPS::~TComVPS() 2043 2044 { 2044 if( m_hrdParameters != NULL ) delete[] m_hrdParameters;2045 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx;2046 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag;2047 2045 } 2048 2046 … … 2119 2117 } 2120 2118 2121 m_scalingList = new TComScalingList;2122 2119 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2123 2120 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); … … 2126 2123 TComSPS::~TComSPS() 2127 2124 { 2128 #if SVC_EXTENSION2129 if( !m_inferScalingListFlag )2130 #endif2131 delete m_scalingList;2132 2125 m_RPSList.destroy(); 2133 2126 } … … 2261 2254 , m_bConstrainedIntraPred (false) 2262 2255 , m_bSliceChromaQpFlag (false) 2263 , m_pcSPS (NULL)2264 2256 , m_uiMaxCuDQPDepth (0) 2265 , m_uiMinCuDQPSize (0)2266 2257 , m_MaxCuChromaQpAdjDepth (0) 2267 , m_MinCuChromaQpAdjSize (0)2268 2258 , m_ChromaQpAdjTableSize (0) 2269 2259 , m_chromaCbQpOffset (0) … … 2282 2272 , m_numTileColumnsMinus1 (0) 2283 2273 , m_numTileRowsMinus1 (0) 2284 , m_numSubstreams (1)2285 2274 , m_signHideFlag (false) 2286 2275 , m_cabacInitPresentFlag (false) 2287 , m_encCABACTableIdx (I_SLICE)2288 2276 , m_sliceHeaderExtensionPresentFlag (false) 2289 2277 , m_loopFilterAcrossSlicesEnabledFlag(false) … … 2305 2293 #endif //SVC_EXTENSION 2306 2294 { 2307 m_scalingList = new TComScalingList;2308 2295 for(Int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) 2309 2296 { … … 2316 2303 ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag)); 2317 2304 ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag)); 2318 ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag));2319 ::memset(m_phaseHorLuma, 0, sizeof(m_phaseHorLuma));2320 ::memset(m_phaseVerLuma, 0, sizeof(m_phaseVerLuma));2321 ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));2322 ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));2323 2305 #endif //SVC_EXTENSION 2324 2306 } … … 2326 2308 TComPPS::~TComPPS() 2327 2309 { 2328 #if SVC_EXTENSION2329 if( !m_inferScalingListFlag )2330 #endif2331 delete m_scalingList;2332 2310 } 2333 2311 … … 2371 2349 } 2372 2350 2373 Int TComReferencePictureSet::getUsed(Int bufferNum) 2351 Int TComReferencePictureSet::getUsed(Int bufferNum) const 2374 2352 { 2375 2353 return m_used[bufferNum]; 2376 2354 } 2377 2355 2378 Int TComReferencePictureSet::getDeltaPOC(Int bufferNum) 2356 Int TComReferencePictureSet::getDeltaPOC(Int bufferNum) const 2379 2357 { 2380 2358 return m_deltaPOC[bufferNum]; 2381 2359 } 2382 2360 2383 Int TComReferencePictureSet::getNumberOfPictures() 2361 Int TComReferencePictureSet::getNumberOfPictures() const 2384 2362 { 2385 2363 return m_numberOfPictures; 2386 2364 } 2387 2365 2388 Int TComReferencePictureSet::getPOC(Int bufferNum) 2366 Int TComReferencePictureSet::getPOC(Int bufferNum) const 2389 2367 { 2390 2368 return m_POC[bufferNum]; … … 2396 2374 } 2397 2375 2398 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) 2376 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) const 2399 2377 { 2400 2378 return m_bCheckLTMSB[bufferNum]; … … 2420 2398 * \returns Int 2421 2399 */ 2422 Int TComReferencePictureSet::getRefIdc(Int bufferNum) 2400 Int TComReferencePictureSet::getRefIdc(Int bufferNum) const 2423 2401 { 2424 2402 return m_refIdc[bufferNum]; … … 2466 2444 * \returns Void 2467 2445 */ 2468 Void TComReferencePictureSet::printDeltaPOC() 2446 Void TComReferencePictureSet::printDeltaPOC() const 2469 2447 { 2470 2448 printf("DeltaPOC = { "); … … 2482 2460 } 2483 2461 printf("}\n"); 2484 }2485 2486 TComRPSList::TComRPSList()2487 :m_referencePictureSets (NULL)2488 {2489 }2490 2491 TComRPSList::~TComRPSList()2492 {2493 }2494 2495 Void TComRPSList::create( Int numberOfReferencePictureSets)2496 {2497 m_numberOfReferencePictureSets = numberOfReferencePictureSets;2498 m_referencePictureSets = new TComReferencePictureSet[numberOfReferencePictureSets];2499 }2500 2501 Void TComRPSList::destroy()2502 {2503 if (m_referencePictureSets)2504 {2505 delete [] m_referencePictureSets;2506 }2507 m_numberOfReferencePictureSets = 0;2508 m_referencePictureSets = NULL;2509 }2510 2511 2512 2513 TComReferencePictureSet* TComRPSList::getReferencePictureSet(Int referencePictureSetNum)2514 {2515 return &m_referencePictureSets[referencePictureSetNum];2516 }2517 2518 Int TComRPSList::getNumberOfReferencePictureSets()2519 {2520 return m_numberOfReferencePictureSets;2521 }2522 2523 Void TComRPSList::setNumberOfReferencePictureSets(Int numberOfReferencePictureSets)2524 {2525 m_numberOfReferencePictureSets = numberOfReferencePictureSets;2526 2462 } 2527 2463 … … 2540 2476 TComScalingList::TComScalingList() 2541 2477 { 2542 init(); 2543 } 2544 2545 TComScalingList::~TComScalingList() 2546 { 2547 destroy(); 2478 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) 2479 { 2480 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId++) 2481 { 2482 m_scalingListCoef[sizeId][listId].resize(min<Int>(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2483 } 2484 } 2548 2485 } 2549 2486 2550 2487 /** set default quantization matrix to array 2551 2488 */ 2552 Void TComS lice::setDefaultScalingList()2489 Void TComScalingList::setDefaultScalingList() 2553 2490 { 2554 2491 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2556 2493 for(UInt listId=0;listId<SCALING_LIST_NUM;listId++) 2557 2494 { 2558 getScalingList()->processDefaultMatrix(sizeId, listId);2495 processDefaultMatrix(sizeId, listId); 2559 2496 } 2560 2497 } … … 2563 2500 * \returns true if use default quantization matrix in all size 2564 2501 */ 2565 Bool TComS lice::checkDefaultScalingList()2502 Bool TComScalingList::checkDefaultScalingList() 2566 2503 { 2567 2504 UInt defaultCounter=0; … … 2571 2508 for(UInt listId=0;listId<SCALING_LIST_NUM;listId++) 2572 2509 { 2573 if( !memcmp(getScalingList ()->getScalingListAddress(sizeId,listId), getScalingList()->getScalingListDefaultAddress(sizeId, listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix2574 && ((sizeId < SCALING_LIST_16x16) || (getScalingList ()->getScalingListDC(sizeId,listId) == 16))) // check DC value2510 if( !memcmp(getScalingListAddress(sizeId,listId), getScalingListDefaultAddress(sizeId, listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix 2511 && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == 16))) // check DC value 2575 2512 { 2576 2513 defaultCounter++; … … 2590 2527 { 2591 2528 ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2529 } 2530 2531 Void TComScalingList::checkPredMode(UInt sizeId, UInt listId) 2532 { 2533 Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries. 2534 2535 for(Int predListIdx = (Int)listId ; predListIdx >= 0; predListIdx-=predListStep) 2536 { 2537 if( !memcmp(getScalingListAddress(sizeId,listId),((listId == predListIdx) ? 2538 getScalingListDefaultAddress(sizeId, predListIdx): getScalingListAddress(sizeId, predListIdx)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix 2539 && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value 2540 { 2541 setRefMatrixId(sizeId, listId, predListIdx); 2542 setScalingListPredModeFlag(sizeId, listId, false); 2543 return; 2544 } 2545 } 2546 setScalingListPredModeFlag(sizeId, listId, true); 2592 2547 } 2593 2548 … … 2779 2734 } 2780 2735 2781 /** initialization process of quantization matrix array2782 */2783 Void TComScalingList::init()2784 {2785 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)2786 {2787 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId++)2788 {2789 m_scalingListCoef[sizeId][listId] = new Int [min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])];2790 }2791 }2792 }2793 2794 /** destroy quantization matrix array2795 */2796 Void TComScalingList::destroy()2797 {2798 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)2799 {2800 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId++)2801 {2802 if(m_scalingListCoef[sizeId][listId]) delete [] m_scalingListCoef[sizeId][listId];2803 }2804 }2805 }2806 2807 2736 /** get default address of quantization matrix 2808 2737 * \param sizeId size index … … 2860 2789 ParameterSetManager::ParameterSetManager() 2861 2790 #if SVC_EXTENSION 2862 : m_activeSPSId(-1) 2863 , m_activePPSId(-1) 2791 : m_activeSPS() 2864 2792 #else 2865 2793 : m_vpsMap(MAX_NUM_VPS) 2866 2794 , m_spsMap(MAX_NUM_SPS) 2867 2795 , m_ppsMap(MAX_NUM_PPS) 2868 , m_activeVPSId(-1) 2869 , m_activeSPSId(-1) 2870 , m_activePPSId(-1) 2871 #endif 2872 { 2796 , m_activeVPS() 2797 , m_activeSPS() 2798 #endif 2799 { 2800 #if !SVC_EXTENSION 2801 m_activeVPS.setVPSId(-1); 2802 #endif 2803 m_activeSPS.setSPSId(-1); 2873 2804 } 2874 2805 … … 2886 2817 { 2887 2818 Int vpsId = sps->getVPSId(); 2888 if (m_vpsMap.getPS(vpsId)) 2889 { 2890 m_activeVPSId = vpsId; 2891 m_activeSPSId = spsId; 2819 TComVPS *vps = m_vpsMap.getPS(vpsId); 2820 if (vps) 2821 { 2822 m_activeVPS = *(vps); 2823 m_activeSPS = *(sps); 2892 2824 return true; 2893 2825 } … … 2912 2844 { 2913 2845 Int spsId = pps->getSPSId(); 2914 if (!isIRAP && (spsId != m_activeSPS Id))2846 if (!isIRAP && (spsId != m_activeSPS.getSPSId() )) 2915 2847 { 2916 2848 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR."); … … 2921 2853 { 2922 2854 Int vpsId = sps->getVPSId(); 2923 if (!isIRAP && (vpsId != m_activeVPS Id))2855 if (!isIRAP && (vpsId != m_activeVPS.getVPSId() )) 2924 2856 { 2925 2857 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR."); 2926 2858 return false; 2927 2859 } 2928 if (m_vpsMap.getPS(vpsId)) 2929 { 2930 m_activePPSId = ppsId; 2931 m_activeVPSId = vpsId; 2932 m_activeSPSId = spsId; 2860 TComVPS *vps =m_vpsMap.getPS(vpsId); 2861 if (vps) 2862 { 2863 m_activeVPS = *(vps); 2864 m_activeSPS = *(sps); 2865 #if SVC_EXTENSION 2866 m_activePPS = *(pps); 2867 #endif 2933 2868 return true; 2934 2869 } … … 2969 2904 } 2970 2905 2906 Void calculateParameterSetChangedFlag(Bool &bChanged, const std::vector<UChar> *pOldData, const std::vector<UChar> *pNewData) 2907 { 2908 if (!bChanged) 2909 { 2910 if ((pOldData==0 && pOldData!=0) || (pOldData!=0 && pOldData==0)) 2911 { 2912 bChanged=true; 2913 } 2914 else if (pOldData!=0 && pOldData!=0) 2915 { 2916 // compare the two 2917 if (pOldData->size() != pOldData->size()) 2918 { 2919 bChanged=true; 2920 } 2921 else 2922 { 2923 const UChar *pNewDataArray=&(*pNewData)[0]; 2924 const UChar *pOldDataArray=&(*pOldData)[0]; 2925 if (memcmp(pOldDataArray, pNewDataArray, pOldData->size())) 2926 { 2927 bChanged=true; 2928 } 2929 } 2930 } 2931 } 2932 } 2933 2971 2934 #if SVC_EXTENSION 2972 2935 Void ProfileTierLevel::copyProfileInfo(ProfileTierLevel *ptl) … … 2985 2948 } 2986 2949 2987 Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId) 2988 { 2989 static Window win;2950 const Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId) const 2951 { 2952 static const Window win; 2990 2953 2991 2954 for( Int i = m_numRefLayerLocationOffsets-1; i >= 0; i-- ) … … 2996 2959 } 2997 2960 } 2998 2999 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 2961 3000 2962 return win; 3001 2963 } 3002 2964 3003 Window& TComPPS::getRefLayerWindowForLayer(Int layerId) 3004 { 3005 static Window win;2965 const Window& TComPPS::getRefLayerWindowForLayer(Int layerId) const 2966 { 2967 static const Window win; 3006 2968 3007 2969 for( Int i = m_numRefLayerLocationOffsets-1; i >= 0; i-- ) … … 3013 2975 } 3014 2976 3015 win.resetWindow(); // reference region offsets are inferred to be zero when not present3016 2977 return win; 3017 2978 } 3018 2979 3019 Bool TComPPS::hasZeroResamplingPhase(Int refLayerId) 3020 { 3021 Bool phaseSetPresentFlag; 3022 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 3023 3024 getResamplingPhase(refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma); 3025 3026 return ( phaseHorLuma == 0 && phaseHorChroma == 0 && phaseVerLuma == 0 && phaseVerChroma == 0); 3027 } 3028 3029 Void TComPPS::getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma) 3030 { 3031 phaseSetPresentFlag = false; 3032 phaseHorLuma = 0, phaseVerLuma = 0, phaseHorChroma = 0, phaseVerChroma = 0; 2980 Bool TComPPS::hasZeroResamplingPhase(Int refLayerId) const 2981 { 2982 const ResamplingPhase &resamplingPhase = getResamplingPhase(refLayerId); 2983 2984 return ( resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0 && resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0 ); 2985 } 2986 2987 const ResamplingPhase& TComPPS::getResamplingPhase(Int refLayerId) const 2988 { 2989 static const ResamplingPhase resamplingPhase; 3033 2990 3034 2991 for( Int i = m_numRefLayerLocationOffsets-1; i >= 0; i-- ) … … 3036 2993 if( refLayerId == m_refLocationOffsetLayerId[i] ) 3037 2994 { 3038 phaseSetPresentFlag = m_resamplePhaseSetPresentFlag[i]; 3039 phaseHorLuma = m_phaseHorLuma[i]; 3040 phaseVerLuma = m_phaseVerLuma[i]; 3041 phaseHorChroma = m_phaseHorChroma[i]; 3042 phaseVerChroma = m_phaseVerChroma[i]; 3043 3044 return; 3045 } 3046 } 2995 return m_resamplingPhase[i]; 2996 } 2997 } 2998 2999 return resamplingPhase; 3047 3000 } 3048 3001 … … 3211 3164 } 3212 3165 3213 Int TComVPS::getNumViews() 3166 Int TComVPS::getNumViews() const 3214 3167 { 3215 3168 Int numViews = 1; 3216 for( Int i = 0; i < = getMaxLayers() - 1; i++ )3217 { 3218 Int lId = getLayerIdInNuh( i );3219 if 3169 for( Int i = 0; i < m_uiMaxLayers; i++ ) 3170 { 3171 Int lId = m_layerIdInNuh[i]; 3172 if( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) ) 3220 3173 { 3221 3174 numViews++; … … 3226 3179 } 3227 3180 3228 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType ) 3181 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType ) const 3229 3182 { 3230 3183 return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0; 3231 3184 } 3232 3185 3233 Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType ) 3186 Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType ) const 3234 3187 { 3235 3188 assert( scalType >= 0 && scalType <= MAX_VPS_NUM_SCALABILITY_TYPES ); … … 3245 3198 } 3246 3199 3247 Int TComVPS::getLayerIdcForOls( Int olsIdx, Int layerId ) 3200 Int TComVPS::getLayerIdcForOls( Int olsIdx, Int layerId ) const 3248 3201 { 3249 3202 Int layerIdc = -1; 3250 3203 UInt lsIdx = m_outputLayerSetIdx[olsIdx]; 3251 3204 3252 std::vector<Int>:: iterator it = std::find( m_layerSetLayerIdList[lsIdx].begin(), m_layerSetLayerIdList[lsIdx].end(), layerId );3205 std::vector<Int>::const_iterator it = std::find( m_layerSetLayerIdList[lsIdx].begin(), m_layerSetLayerIdList[lsIdx].end(), layerId ); 3253 3206 3254 3207 if( it != m_layerSetLayerIdList[lsIdx].end() ) … … 3402 3355 } 3403 3356 3404 Void TComVPS::deriveNecessaryLayerFlag( Int const olsIdx)3357 Void TComVPS::deriveNecessaryLayerFlag(const Int olsIdx) 3405 3358 { 3406 3359 Int lsIdx = m_outputLayerSetIdx[olsIdx]; … … 3455 3408 } 3456 3409 3457 Int TComVPS::calculateLenOfSyntaxElement( Int const numVal )3410 Int TComVPS::calculateLenOfSyntaxElement( const Int numVal ) const 3458 3411 { 3459 3412 Int numBits = 1; … … 3480 3433 UInt TComSlice::getPicWidthInLumaSamples() 3481 3434 { 3482 TComSPS *sps = getSPS();3483 TComVPS *vps = getVPS();3484 3435 UInt retVal, layerId = getLayerId(); 3485 3436 3437 if ( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3438 { 3439 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3440 { 3441 retVal = m_pcVPS->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples(); 3442 } 3443 else 3444 { 3445 retVal = m_pcSPS->getPicWidthInLumaSamples(); 3446 } 3447 } 3448 else 3449 { 3450 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getPicWidthVpsInLumaSamples(); 3451 } 3452 3453 return retVal; 3454 } 3455 3456 UInt TComVPS::getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const 3457 { 3458 UInt retVal; 3459 3486 3460 if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3487 3461 { 3488 if( layerId == 0 && vps->getNonHEVCBaseLayerFlag())3489 { 3490 retVal = vps->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples();3462 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3463 { 3464 retVal = m_vpsRepFormat[layerId].getPicWidthVpsInLumaSamples(); 3491 3465 } 3492 3466 else … … 3497 3471 else 3498 3472 { 3499 retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getPicWidthVpsInLumaSamples();3473 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getPicWidthVpsInLumaSamples(); 3500 3474 } 3501 3475 … … 3505 3479 UInt TComSlice::getPicHeightInLumaSamples() 3506 3480 { 3507 TComSPS *sps = getSPS();3508 TComVPS *vps = getVPS();3509 3481 UInt retVal, layerId = getLayerId(); 3510 3482 3483 if ( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3484 { 3485 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3486 { 3487 retVal = m_pcVPS->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples(); 3488 } 3489 else 3490 { 3491 retVal = m_pcSPS->getPicHeightInLumaSamples(); 3492 } 3493 } 3494 else 3495 { 3496 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getPicHeightVpsInLumaSamples(); 3497 } 3498 3499 return retVal; 3500 } 3501 3502 UInt TComVPS::getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const 3503 { 3504 UInt retVal; 3505 3511 3506 if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3512 3507 { 3513 if( layerId == 0 && vps->getNonHEVCBaseLayerFlag())3514 { 3515 retVal = vps->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples();3508 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3509 { 3510 retVal = m_vpsRepFormat[layerId].getPicHeightVpsInLumaSamples(); 3516 3511 } 3517 3512 else … … 3522 3517 else 3523 3518 { 3524 retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getPicHeightVpsInLumaSamples();3519 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getPicHeightVpsInLumaSamples(); 3525 3520 } 3526 3521 … … 3528 3523 } 3529 3524 3530 #if AUXILIARY_PICTURES3531 3525 ChromaFormat TComSlice::getChromaFormatIdc() 3532 #else 3533 UInt TComSlice::getChromaFormatIdc() 3534 #endif 3535 { 3536 TComSPS *sps = getSPS(); 3537 TComVPS *vps = getVPS(); 3538 #if AUXILIARY_PICTURES 3526 { 3539 3527 ChromaFormat retVal; 3540 3528 UInt layerId = getLayerId(); 3541 #else 3529 3530 if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3531 { 3532 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3533 { 3534 retVal = m_pcVPS->getVpsRepFormat(layerId)->getChromaFormatVpsIdc(); 3535 } 3536 else 3537 { 3538 retVal = m_pcSPS->getChromaFormatIdc(); 3539 } 3540 } 3541 else 3542 { 3543 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getChromaFormatVpsIdc(); 3544 } 3545 3546 return retVal; 3547 } 3548 3549 ChromaFormat TComVPS::getChromaFormatIdc( const TComSPS* sps, const UInt layerId ) const 3550 { 3551 ChromaFormat retVal; 3552 3553 if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3554 { 3555 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3556 { 3557 retVal = m_vpsRepFormat[layerId].getChromaFormatVpsIdc(); 3558 } 3559 else 3560 { 3561 retVal = sps->getChromaFormatIdc(); 3562 } 3563 } 3564 else 3565 { 3566 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getChromaFormatVpsIdc(); 3567 } 3568 3569 return retVal; 3570 } 3571 3572 UInt TComSlice::getBitDepthY() 3573 { 3542 3574 UInt retVal, layerId = getLayerId(); 3543 #endif 3575 3576 if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3577 { 3578 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3579 { 3580 retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVpsLuma(); 3581 } 3582 else 3583 { 3584 retVal = m_pcSPS->getBitDepth(CHANNEL_TYPE_LUMA); 3585 } 3586 } 3587 else 3588 { 3589 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVpsLuma(); 3590 } 3591 3592 return retVal; 3593 } 3594 3595 UInt TComVPS::getBitDepthY( const TComSPS* sps, const UInt layerId ) const 3596 { 3597 UInt retVal; 3544 3598 3545 3599 if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3546 3600 { 3547 if( layerId == 0 && vps->getNonHEVCBaseLayerFlag())3548 { 3549 retVal = vps->getVpsRepFormat(layerId)->getChromaFormatVpsIdc();3601 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3602 { 3603 retVal = m_vpsRepFormat[layerId].getBitDepthVpsLuma(); 3550 3604 } 3551 3605 else 3552 3606 { 3553 retVal = sps->get ChromaFormatIdc();3607 retVal = sps->getBitDepth(CHANNEL_TYPE_LUMA); 3554 3608 } 3555 3609 } 3556 3610 else 3557 3611 { 3558 retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getChromaFormatVpsIdc();3612 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVpsLuma(); 3559 3613 } 3560 3614 … … 3562 3616 } 3563 3617 3564 UInt TComSlice::getBitDepthY() 3565 { 3566 TComSPS *sps = getSPS(); 3567 TComVPS *vps = getVPS(); 3618 UInt TComSlice::getBitDepthC() 3619 { 3568 3620 UInt retVal, layerId = getLayerId(); 3569 3621 3622 if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3623 { 3624 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3625 { 3626 retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVpsChroma(); 3627 } 3628 else 3629 { 3630 retVal = m_pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA); 3631 } 3632 } 3633 else 3634 { 3635 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVpsChroma(); 3636 } 3637 3638 return retVal; 3639 } 3640 3641 UInt TComVPS::getBitDepthC( const TComSPS* sps, const UInt layerId ) const 3642 { 3643 UInt retVal; 3644 3570 3645 if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3571 3646 { 3572 if( layerId == 0 && vps->getNonHEVCBaseLayerFlag())3573 { 3574 retVal = vps->getVpsRepFormat(layerId)->getBitDepthVpsLuma();3647 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3648 { 3649 retVal = m_vpsRepFormat[layerId].getBitDepthVpsChroma(); 3575 3650 } 3576 3651 else 3577 3652 { 3578 retVal = sps->getBitDepth(CHANNEL_TYPE_ LUMA);3653 retVal = sps->getBitDepth(CHANNEL_TYPE_CHROMA); 3579 3654 } 3580 3655 } 3581 3656 else 3582 3657 { 3583 retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getBitDepthVpsLuma();3658 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVpsChroma(); 3584 3659 } 3585 3660 … … 3587 3662 } 3588 3663 3589 UInt TComSlice::getBitDepthC() 3590 { 3591 TComSPS *sps = getSPS(); 3592 TComVPS *vps = getVPS(); 3593 UInt retVal, layerId = getLayerId(); 3594 3595 if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3596 { 3597 if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() ) 3598 { 3599 retVal = vps->getVpsRepFormat(layerId)->getBitDepthVpsChroma(); 3664 Int TComSlice::getQpBDOffsetY() 3665 { 3666 return (getBitDepthY() - 8) * 6; 3667 } 3668 3669 Int TComSlice::getQpBDOffsetC() 3670 { 3671 return (getBitDepthC() - 8) * 6; 3672 } 3673 3674 const Window& TComSlice::getConformanceWindow() const 3675 { 3676 if ( m_layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3677 { 3678 if( m_layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3679 { 3680 return m_pcVPS->getVpsRepFormat(m_layerId)->getConformanceWindowVps(); 3600 3681 } 3601 3682 else 3602 3683 { 3603 ret Val = sps->getBitDepth(CHANNEL_TYPE_CHROMA);3684 return m_pcSPS->getConformanceWindow(); 3604 3685 } 3605 3686 } 3606 3687 else 3607 3688 { 3608 retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getBitDepthVpsChroma(); 3609 } 3610 3611 return retVal; 3612 } 3613 3614 Int TComSlice::getQpBDOffsetY() 3615 { 3616 return (getBitDepthY() - 8) * 6; 3617 } 3618 3619 Int TComSlice::getQpBDOffsetC() 3620 { 3621 return (getBitDepthC() - 8) * 6; 3622 } 3623 3624 Window& TComSlice::getConformanceWindow() 3625 { 3626 TComSPS *sps = getSPS(); 3627 TComVPS *vps = getVPS(); 3628 UInt layerId = getLayerId(); 3629 3689 return m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(m_layerId)))->getConformanceWindowVps(); 3690 } 3691 } 3692 3693 const Window& TComVPS::getConformanceWindow( const TComSPS* sps, const UInt layerId ) const 3694 { 3630 3695 if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3631 3696 { 3632 if( layerId == 0 && vps->getNonHEVCBaseLayerFlag())3633 { 3634 return vps->getVpsRepFormat(layerId)->getConformanceWindowVps();3697 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3698 { 3699 return m_vpsRepFormat[layerId].getConformanceWindowVps(); 3635 3700 } 3636 3701 else … … 3641 3706 else 3642 3707 { 3643 return vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getConformanceWindowVps();3708 return m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getConformanceWindowVps(); 3644 3709 } 3645 3710 } -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1230 r1235 55 55 #if SVC_EXTENSION 56 56 class TComPicYuv; 57 class TComSPS; 57 58 #endif 58 59 // ==================================================================================================================== … … 88 89 89 90 public: 90 TComReferencePictureSet();91 TComReferencePictureSet(); 91 92 virtual ~TComReferencePictureSet(); 92 Int getPocLSBLT(Int i) { return m_pocLSBLT[i];}93 Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x;}94 Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i];}95 Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x;}96 Bool getDeltaPocMSBPresentFlag(Int i){ return m_deltaPocMSBPresentFlag[i]; }97 Void setDeltaPocMSBPresentFlag(Int i, Bool x){ m_deltaPocMSBPresentFlag[i] = x; }98 Void setUsed(Int bufferNum, Bool used);99 Void setDeltaPOC(Int bufferNum, Int deltaPOC);100 Void setPOC(Int bufferNum, Int deltaPOC);101 Void setNumberOfPictures(Int numberOfPictures);102 Void setCheckLTMSBPresent(Int bufferNum, Bool b );103 Bool getCheckLTMSBPresent(Int bufferNum);104 105 Int getUsed(Int bufferNum);106 Int getDeltaPOC(Int bufferNum);107 Int getPOC(Int bufferNum);108 Int getNumberOfPictures();109 110 Void setNumberOfNegativePictures(Int number){ m_numberOfNegativePictures = number; }111 Int getNumberOfNegativePictures() { return m_numberOfNegativePictures;}112 Void setNumberOfPositivePictures(Int number){ m_numberOfPositivePictures = number; }113 Int getNumberOfPositivePictures() { return m_numberOfPositivePictures;}114 Void setNumberOfLongtermPictures(Int number){ m_numberOfLongtermPictures = number; }115 Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures;}116 117 Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag;}118 Bool getInterRPSPrediction() { return m_interRPSPrediction;}119 Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x;}120 Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1;}121 Void setDeltaRPS(Int x) { m_deltaRPS = x;}122 Int getDeltaRPS() { return m_deltaRPS;}123 Void setNumRefIdc(Int x) { m_numRefIdc = x;}124 Int getNumRefIdc() { return m_numRefIdc;}125 126 Void setRefIdc(Int bufferNum, Int refIdc);127 Int getRefIdc(Int bufferNum);128 129 Void sortDeltaPOC();130 Void printDeltaPOC();93 Int getPocLSBLT(Int i) const { return m_pocLSBLT[i]; } 94 Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } 95 Int getDeltaPocMSBCycleLT(Int i) const { return m_deltaPOCMSBCycleLT[i]; } 96 Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } 97 Bool getDeltaPocMSBPresentFlag(Int i) const { return m_deltaPocMSBPresentFlag[i]; } 98 Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } 99 Void setUsed(Int bufferNum, Bool used); 100 Void setDeltaPOC(Int bufferNum, Int deltaPOC); 101 Void setPOC(Int bufferNum, Int deltaPOC); 102 Void setNumberOfPictures(Int numberOfPictures); 103 Void setCheckLTMSBPresent(Int bufferNum, Bool b ); 104 Bool getCheckLTMSBPresent(Int bufferNum) const; 105 106 Int getUsed(Int bufferNum) const; 107 Int getDeltaPOC(Int bufferNum) const; 108 Int getPOC(Int bufferNum) const; 109 Int getNumberOfPictures() const; 110 111 Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } 112 Int getNumberOfNegativePictures() const { return m_numberOfNegativePictures; } 113 Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } 114 Int getNumberOfPositivePictures() const { return m_numberOfPositivePictures; } 115 Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } 116 Int getNumberOfLongtermPictures() const { return m_numberOfLongtermPictures; } 117 118 Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } 119 Bool getInterRPSPrediction() const { return m_interRPSPrediction; } 120 Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } 121 Int getDeltaRIdxMinus1() const { return m_deltaRIdxMinus1; } 122 Void setDeltaRPS(Int x) { m_deltaRPS = x; } 123 Int getDeltaRPS() const { return m_deltaRPS; } 124 Void setNumRefIdc(Int x) { m_numRefIdc = x; } 125 Int getNumRefIdc() const { return m_numRefIdc; } 126 127 Void setRefIdc(Int bufferNum, Int refIdc); 128 Int getRefIdc(Int bufferNum) const ; 129 130 Void sortDeltaPOC(); 131 Void printDeltaPOC() const; 131 132 }; 132 133 … … 135 136 { 136 137 private: 137 Int m_numberOfReferencePictureSets; 138 TComReferencePictureSet* m_referencePictureSets; 138 std::vector<TComReferencePictureSet> m_referencePictureSets; 139 139 140 140 public: 141 TComRPSList(); 142 virtual ~TComRPSList(); 143 144 Void create (Int numberOfEntries); 145 Void destroy (); 146 147 148 TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); 149 Int getNumberOfReferencePictureSets(); 150 Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); 141 TComRPSList() { } 142 virtual ~TComRPSList() { } 143 144 Void create (Int numberOfEntries) { m_referencePictureSets.resize(numberOfEntries); } 145 Void destroy () { } 146 147 148 TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum) { return &m_referencePictureSets[referencePictureSetNum]; } 149 const TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum) const { return &m_referencePictureSets[referencePictureSetNum]; } 150 151 Int getNumberOfReferencePictureSets() const { return Int(m_referencePictureSets.size()); } 151 152 }; 152 153 … … 155 156 { 156 157 public: 157 TComScalingList(); 158 virtual ~TComScalingList(); 159 Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } 160 Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } 161 Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 162 const Int* getScalingListAddress (UInt sizeId, UInt listId) const { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 163 Bool checkPredMode (UInt sizeId, UInt listId); 164 Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID 165 UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID 166 Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient 167 Void processDefaultMatrix (UInt sizeId, UInt listId); 168 Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value 169 170 Int getScalingListDC (UInt sizeId, UInt listId) const { return m_scalingListDC[sizeId][listId]; } //!< get DC value 171 Void checkDcOfMatrix (); 172 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 173 Bool xParseScalingList (Char* pchFile); 158 TComScalingList(); 159 virtual ~TComScalingList() { } 160 Int* getScalingListAddress(UInt sizeId, UInt listId) { return &(m_scalingListCoef[sizeId][listId][0]); } //!< get matrix coefficient 161 const Int* getScalingListAddress(UInt sizeId, UInt listId) const { return &(m_scalingListCoef[sizeId][listId][0]); } //!< get matrix coefficient 162 Void checkPredMode(UInt sizeId, UInt listId); 163 164 Void setRefMatrixId(UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID 165 UInt getRefMatrixId(UInt sizeId, UInt listId) const { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID 166 167 Int* getScalingListDefaultAddress(UInt sizeId, UInt listId); //!< get default matrix coefficient 168 Void processDefaultMatrix(UInt sizeId, UInt listId); 169 170 Void setScalingListDC(UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value 171 Int getScalingListDC(UInt sizeId, UInt listId) const { return m_scalingListDC[sizeId][listId]; } //!< get DC value 172 173 Void setScalingListPredModeFlag(UInt sizeId, UInt listId, Bool bIsDPCM) { m_scalingListPredModeFlagIsDPCM[sizeId][listId] = bIsDPCM; } 174 Bool getScalingListPredModeFlag(UInt sizeId, UInt listId) const { return m_scalingListPredModeFlagIsDPCM[sizeId][listId]; } 175 176 Void checkDcOfMatrix(); 177 Void processRefMatrix(UInt sizeId, UInt listId , UInt refListId ); 178 Bool xParseScalingList(Char* pchFile); 179 Void setDefaultScalingList(); 180 Bool checkDefaultScalingList(); 174 181 175 182 private: 176 Void init (); 177 Void destroy (); 178 Void outputScalingLists(std::ostream &os) const; 179 Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 180 Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag 181 UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID 182 Bool m_scalingListPresentFlag; //!< flag for using default matrix 183 UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 184 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix 183 Void outputScalingLists(std::ostream &os) const; 184 Bool m_scalingListPredModeFlagIsDPCM [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 185 Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 186 UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID 187 std::vector<Int> m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix 185 188 }; 186 189 … … 203 206 204 207 public: 205 ProfileTierLevel();206 207 Int getProfileSpace() const { return m_profileSpace;}208 Void setProfileSpace(Int x) { m_profileSpace = x;}209 210 Level::Tier getTierFlag() const { return m_tierFlag;}211 Void setTierFlag(Level::Tier x) { m_tierFlag = x;}212 213 Profile::Name getProfileIdc() const { return m_profileIdc;}214 Void setProfileIdc(Profile::Name x) { m_profileIdc = x;}215 216 Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; }217 Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x;}218 219 Level::Name getLevelIdc() const { return m_levelIdc;}220 Void setLevelIdc(Level::Name x) { m_levelIdc = x;}221 222 Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag;}223 Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b;}224 225 Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag;}226 Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b;}227 228 Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag;}229 Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b;}230 231 Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag;}232 Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b;}233 234 UInt getBitDepthConstraint() const { return m_bitDepthConstraintValue;}235 Void setBitDepthConstraint(UInt bitDepth) { m_bitDepthConstraintValue=bitDepth;}236 237 ChromaFormat getChromaFormatConstraint() const{ return m_chromaFormatConstraintValue; }238 Void setChromaFormatConstraint(ChromaFormat fmt) { m_chromaFormatConstraintValue=fmt;}239 240 Bool getIntraConstraintFlag() const { return m_intraConstraintFlag;}241 Void setIntraConstraintFlag(Bool b) { m_intraConstraintFlag = b;}242 243 Bool getLowerBitRateConstraintFlag() const { return m_lowerBitRateConstraintFlag;}244 Void setLowerBitRateConstraintFlag(Bool b) { m_lowerBitRateConstraintFlag = b;}208 ProfileTierLevel(); 209 210 Int getProfileSpace() const { return m_profileSpace; } 211 Void setProfileSpace(Int x) { m_profileSpace = x; } 212 213 Level::Tier getTierFlag() const { return m_tierFlag; } 214 Void setTierFlag(Level::Tier x) { m_tierFlag = x; } 215 216 Profile::Name getProfileIdc() const { return m_profileIdc; } 217 Void setProfileIdc(Profile::Name x) { m_profileIdc = x; } 218 219 Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } 220 Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } 221 222 Level::Name getLevelIdc() const { return m_levelIdc; } 223 Void setLevelIdc(Level::Name x) { m_levelIdc = x; } 224 225 Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } 226 Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } 227 228 Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } 229 Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } 230 231 Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } 232 Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } 233 234 Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } 235 Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } 236 237 UInt getBitDepthConstraint() const { return m_bitDepthConstraintValue; } 238 Void setBitDepthConstraint(UInt bitDepth) { m_bitDepthConstraintValue=bitDepth; } 239 240 ChromaFormat getChromaFormatConstraint() const { return m_chromaFormatConstraintValue; } 241 Void setChromaFormatConstraint(ChromaFormat fmt) { m_chromaFormatConstraintValue=fmt; } 242 243 Bool getIntraConstraintFlag() const { return m_intraConstraintFlag; } 244 Void setIntraConstraintFlag(Bool b) { m_intraConstraintFlag = b; } 245 246 Bool getLowerBitRateConstraintFlag() const { return m_lowerBitRateConstraintFlag; } 247 Void setLowerBitRateConstraintFlag(Bool b) { m_lowerBitRateConstraintFlag = b; } 245 248 246 249 #if SVC_EXTENSION 247 Void copyProfileInfo(ProfileTierLevel *ptl);250 Void copyProfileInfo(ProfileTierLevel *ptl); 248 251 #endif 249 252 }; … … 258 261 259 262 public: 260 TComPTL(); 261 Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } 262 Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } 263 264 Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } 265 Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } 266 267 ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } 268 ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } 263 TComPTL(); 264 Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } 265 Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } 266 267 Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } 268 Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } 269 270 ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } 271 const ProfileTierLevel* getGeneralPTL() const { return &m_generalPTL; } 272 ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } 273 const ProfileTierLevel* getSubLayerPTL(Int i) const { return &m_subLayerPTL[i]; } 269 274 270 275 #if SVC_EXTENSION 271 Void copyProfileInfo(TComPTL *ptl);276 Void copyProfileInfo(TComPTL *ptl); 272 277 #endif 273 278 }; … … 310 315 public: 311 316 TComHRD() 312 :m_nalHrdParametersPresentFlag (0)313 ,m_vclHrdParametersPresentFlag (0)314 ,m_subPicCpbParamsPresentFlag (false)315 ,m_tickDivisorMinus2 (0)316 ,m_duCpbRemovalDelayLengthMinus1 (0)317 ,m_subPicCpbParamsInPicTimingSEIFlag (false)318 ,m_dpbOutputDelayDuLengthMinus1 (0)319 ,m_bitRateScale (0)320 ,m_cpbSizeScale (0)317 :m_nalHrdParametersPresentFlag (0) 318 ,m_vclHrdParametersPresentFlag (0) 319 ,m_subPicCpbParamsPresentFlag (false) 320 ,m_tickDivisorMinus2 (0) 321 ,m_duCpbRemovalDelayLengthMinus1 (0) 322 ,m_subPicCpbParamsInPicTimingSEIFlag (false) 323 ,m_dpbOutputDelayDuLengthMinus1 (0) 324 ,m_bitRateScale (0) 325 ,m_cpbSizeScale (0) 321 326 ,m_initialCpbRemovalDelayLengthMinus1(23) 322 ,m_cpbRemovalDelayLengthMinus1 (23)323 ,m_dpbOutputDelayLengthMinus1 (23)327 ,m_cpbRemovalDelayLengthMinus1 (23) 328 ,m_dpbOutputDelayLengthMinus1 (23) 324 329 {} 325 330 326 331 virtual ~TComHRD() {} 327 332 328 Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag;}329 Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag;}330 331 Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag;}332 Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag;}333 334 Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag;}335 Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag;}336 337 Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value;}338 UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2;}339 340 Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value;}341 UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1;}342 343 Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag;}344 Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag;}345 346 Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value;}347 UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1;}348 349 Void setBitRateScale ( UInt value ) { m_bitRateScale = value;}350 UInt getBitRateScale ( ) { return m_bitRateScale;}351 352 Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value;}353 UInt getCpbSizeScale ( ) { return m_cpbSizeScale;}354 Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value;}355 UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale;}356 357 Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value;}358 UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1;}359 360 Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value;}361 UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1;}362 363 Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value;}364 UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1;}365 366 Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag;}367 Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag;}368 369 Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag;}370 Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag;}371 372 Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value;}373 UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1;}374 375 Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag;}376 Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag;}377 378 Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value;}379 UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1;}380 381 Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ){ m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; }382 UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ){ return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; }383 384 Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ){ m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; }385 UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ){ return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; }386 Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value;}387 UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl];}388 Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value;}389 UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl];}390 Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, Bool value ){ m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; }391 Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ){ return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; }392 393 Void setNumDU ( UInt value ) { m_numDU = value;}394 UInt getNumDU ( ) { return m_numDU;}395 Bool getCpbDpbDelaysPresentFlag(){ return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); }333 Void setNalHrdParametersPresentFlag( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } 334 Bool getNalHrdParametersPresentFlag( ) const { return m_nalHrdParametersPresentFlag; } 335 336 Void setVclHrdParametersPresentFlag( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } 337 Bool getVclHrdParametersPresentFlag( ) const { return m_vclHrdParametersPresentFlag; } 338 339 Void setSubPicCpbParamsPresentFlag( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } 340 Bool getSubPicCpbParamsPresentFlag( ) const { return m_subPicCpbParamsPresentFlag; } 341 342 Void setTickDivisorMinus2( UInt value ) { m_tickDivisorMinus2 = value; } 343 UInt getTickDivisorMinus2( ) const { return m_tickDivisorMinus2; } 344 345 Void setDuCpbRemovalDelayLengthMinus1( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } 346 UInt getDuCpbRemovalDelayLengthMinus1( ) const { return m_duCpbRemovalDelayLengthMinus1; } 347 348 Void setSubPicCpbParamsInPicTimingSEIFlag( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } 349 Bool getSubPicCpbParamsInPicTimingSEIFlag( ) const { return m_subPicCpbParamsInPicTimingSEIFlag; } 350 351 Void setDpbOutputDelayDuLengthMinus1(UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } 352 UInt getDpbOutputDelayDuLengthMinus1( ) const { return m_dpbOutputDelayDuLengthMinus1; } 353 354 Void setBitRateScale( UInt value ) { m_bitRateScale = value; } 355 UInt getBitRateScale( ) const { return m_bitRateScale; } 356 357 Void setCpbSizeScale( UInt value ) { m_cpbSizeScale = value; } 358 UInt getCpbSizeScale( ) const { return m_cpbSizeScale; } 359 Void setDuCpbSizeScale( UInt value ) { m_ducpbSizeScale = value; } 360 UInt getDuCpbSizeScale( ) const { return m_ducpbSizeScale; } 361 362 Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } 363 UInt getInitialCpbRemovalDelayLengthMinus1( ) const { return m_initialCpbRemovalDelayLengthMinus1; } 364 365 Void setCpbRemovalDelayLengthMinus1( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } 366 UInt getCpbRemovalDelayLengthMinus1( ) const { return m_cpbRemovalDelayLengthMinus1; } 367 368 Void setDpbOutputDelayLengthMinus1( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } 369 UInt getDpbOutputDelayLengthMinus1( ) const { return m_dpbOutputDelayLengthMinus1; } 370 371 Void setFixedPicRateFlag( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } 372 Bool getFixedPicRateFlag( Int layer ) const { return m_HRD[layer].fixedPicRateFlag; } 373 374 Void setFixedPicRateWithinCvsFlag( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } 375 Bool getFixedPicRateWithinCvsFlag( Int layer ) const { return m_HRD[layer].fixedPicRateWithinCvsFlag; } 376 377 Void setPicDurationInTcMinus1( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } 378 UInt getPicDurationInTcMinus1( Int layer ) const { return m_HRD[layer].picDurationInTcMinus1; } 379 380 Void setLowDelayHrdFlag( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } 381 Bool getLowDelayHrdFlag( Int layer ) const { return m_HRD[layer].lowDelayHrdFlag; } 382 383 Void setCpbCntMinus1( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } 384 UInt getCpbCntMinus1( Int layer ) const { return m_HRD[layer].cpbCntMinus1; } 385 386 Void setBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } 387 UInt getBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } 388 389 Void setCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } 390 UInt getCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } 391 Void setDuCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } 392 UInt getDuCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } 393 Void setDuBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } 394 UInt getDuBitRateValueMinus1(Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } 395 Void setCbrFlag( Int layer, Int cpbcnt, Int nalOrVcl, Bool value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } 396 Bool getCbrFlag( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } 397 398 Void setNumDU( UInt value ) { m_numDU = value; } 399 UInt getNumDU( ) const { return m_numDU; } 400 Bool getCpbDpbDelaysPresentFlag( ) const { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } 396 401 397 402 #if SVC_EXTENSION … … 424 429 public: 425 430 TimingInfo() 426 : m_timingInfoPresentFlag (false)427 , m_numUnitsInTick (1001)428 , m_timeScale (60000)431 : m_timingInfoPresentFlag (false) 432 , m_numUnitsInTick (1001) 433 , m_timeScale (60000) 429 434 , m_pocProportionalToTimingFlag(false) 430 , m_numTicksPocDiffOneMinus1(0) {} 431 432 Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } 433 Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } 434 435 Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } 436 UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } 437 438 Void setTimeScale ( UInt value ) { m_timeScale = value; } 439 UInt getTimeScale ( ) { return m_timeScale; } 440 441 Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } 442 Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } 443 444 Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } 445 Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } 435 , m_numTicksPocDiffOneMinus1 (0) 436 {} 437 438 Void setTimingInfoPresentFlag( Bool flag ) { m_timingInfoPresentFlag = flag; } 439 Bool getTimingInfoPresentFlag( ) const { return m_timingInfoPresentFlag; } 440 441 Void setNumUnitsInTick( UInt value ) { m_numUnitsInTick = value; } 442 UInt getNumUnitsInTick( ) const { return m_numUnitsInTick; } 443 444 Void setTimeScale( UInt value ) { m_timeScale = value; } 445 UInt getTimeScale( ) const { return m_timeScale; } 446 447 Void setPocProportionalToTimingFlag(Bool x) { m_pocProportionalToTimingFlag = x; } 448 Bool getPocProportionalToTimingFlag( ) const { return m_pocProportionalToTimingFlag; } 449 450 Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x; } 451 Int getNumTicksPocDiffOneMinus1( ) const { return m_numTicksPocDiffOneMinus1; } 446 452 }; 447 453 … … 462 468 { 463 469 private: 464 Bool m_enabledFlag; 465 Int m_winLeftOffset; 466 Int m_winRightOffset; 467 Int m_winTopOffset; 468 Int m_winBottomOffset; 469 470 Bool m_enabledFlag; 471 Int m_winLeftOffset; 472 Int m_winRightOffset; 473 Int m_winTopOffset; 474 Int m_winBottomOffset; 470 475 public: 471 476 Window() 472 : m_enabledFlag (false)473 , m_winLeftOffset 474 , m_winRightOffset 475 , m_winTopOffset 476 , m_winBottomOffset 477 : m_enabledFlag (false) 478 , m_winLeftOffset (0) 479 , m_winRightOffset (0) 480 , m_winTopOffset (0) 481 , m_winBottomOffset(0) 477 482 { } 478 483 479 Bool getWindowEnabledFlag() const { return m_enabledFlag; } 480 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } 481 Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } 482 Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } 483 Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } 484 Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } 485 Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } 486 Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } 487 Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } 488 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 484 Bool getWindowEnabledFlag() const { return m_enabledFlag; } 485 Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } 486 Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } 487 Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } 488 Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } 489 Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } 490 Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } 491 Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } 492 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 489 493 490 494 #if SVC_EXTENSION 491 Bool 495 Bool hasEqualOffset(const Window& ref) const 492 496 { 493 497 return ( this->getWindowLeftOffset() == ref.getWindowLeftOffset() … … 498 502 #endif 499 503 500 VoidsetWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)504 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) 501 505 { 502 m_enabledFlag 503 m_winLeftOffset 504 m_winRightOffset 505 m_winTopOffset 506 m_winBottomOffset 506 m_enabledFlag = true; 507 m_winLeftOffset = offsetLeft; 508 m_winRightOffset = offsetLRight; 509 m_winTopOffset = offsetLTop; 510 m_winBottomOffset = offsetLBottom; 507 511 } 508 512 }; 509 513 510 514 #if SVC_EXTENSION 515 struct ResamplingPhase 516 { 517 Bool phasePresentFlag; 518 Int phaseHorLuma; 519 Int phaseVerLuma; 520 Int phaseHorChroma; 521 Int phaseVerChroma; 522 523 ResamplingPhase() 524 : phasePresentFlag (false) 525 , phaseHorLuma (0) 526 , phaseVerLuma (0) 527 , phaseHorChroma (0) 528 , phaseVerChroma (0) 529 { 530 } 531 }; 532 511 533 class RepFormat 512 534 { 513 535 Bool m_chromaAndBitDepthVpsPresentFlag; 514 #if AUXILIARY_PICTURES515 536 ChromaFormat m_chromaFormatVpsIdc; 516 #else517 Int m_chromaFormatVpsIdc;518 #endif519 537 Bool m_separateColourPlaneVpsFlag; 520 538 Int m_picWidthVpsInLumaSamples; … … 527 545 public: 528 546 RepFormat(); 529 Bool getChromaAndBitDepthVpsPresentFlag() { return m_chromaAndBitDepthVpsPresentFlag; } 530 void setChromaAndBitDepthVpsPresentFlag(Bool x) { m_chromaAndBitDepthVpsPresentFlag = x; } 531 532 #if AUXILIARY_PICTURES 533 ChromaFormat getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 534 Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } 535 #else 536 Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 537 Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } 538 #endif 539 540 Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } 541 Void setSeparateColourPlaneVpsFlag(Bool x) { m_separateColourPlaneVpsFlag = x; } 542 543 Int getPicWidthVpsInLumaSamples() { return m_picWidthVpsInLumaSamples; } 544 Void setPicWidthVpsInLumaSamples(Int x) { m_picWidthVpsInLumaSamples = x; } 545 546 Int getPicHeightVpsInLumaSamples() { return m_picHeightVpsInLumaSamples; } 547 Void setPicHeightVpsInLumaSamples(Int x) { m_picHeightVpsInLumaSamples = x; } 548 549 Int getBitDepthVpsLuma() { return m_bitDepthVpsLuma; } 550 Void setBitDepthVpsLuma(Int x) { m_bitDepthVpsLuma = x; } 547 Bool getChromaAndBitDepthVpsPresentFlag() const { return m_chromaAndBitDepthVpsPresentFlag; } 548 void setChromaAndBitDepthVpsPresentFlag(Bool x) { m_chromaAndBitDepthVpsPresentFlag = x; } 549 550 ChromaFormat getChromaFormatVpsIdc() const { return m_chromaFormatVpsIdc; } 551 Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } 552 553 Bool getSeparateColourPlaneVpsFlag() const { return m_separateColourPlaneVpsFlag; } 554 Void setSeparateColourPlaneVpsFlag(Bool x) { m_separateColourPlaneVpsFlag = x; } 555 556 Int getPicWidthVpsInLumaSamples() const { return m_picWidthVpsInLumaSamples; } 557 Void setPicWidthVpsInLumaSamples(Int x) { m_picWidthVpsInLumaSamples = x; } 558 559 Int getPicHeightVpsInLumaSamples() const { return m_picHeightVpsInLumaSamples; } 560 Void setPicHeightVpsInLumaSamples(Int x) { m_picHeightVpsInLumaSamples = x; } 561 562 Int getBitDepthVpsLuma() const { return m_bitDepthVpsLuma; } 563 Void setBitDepthVpsLuma(Int x) { m_bitDepthVpsLuma = x; } 551 564 552 Int getBitDepthVpsChroma() { return m_bitDepthVpsChroma; } 553 Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } 554 555 Int getBitDepthVps(ChannelType type) { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma; } 556 557 Window& getConformanceWindowVps() { return m_conformanceWindowVps; } 558 Void setConformanceWindowVps(Window& conformanceWindow ) { m_conformanceWindowVps = conformanceWindow; } 565 Int getBitDepthVpsChroma() const { return m_bitDepthVpsChroma; } 566 Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } 567 568 Int getBitDepthVps(ChannelType type) { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma; } 569 570 Window& getConformanceWindowVps() { return m_conformanceWindowVps; } 571 const Window& getConformanceWindowVps() const { return m_conformanceWindowVps; } 572 Void setConformanceWindowVps(Window& conformanceWindow ) { m_conformanceWindowVps = conformanceWindow; } 559 573 }; 560 574 #endif … … 563 577 { 564 578 private: 565 Int m_VPSId;566 UInt m_uiMaxTLayers;567 UInt m_uiMaxLayers;568 Bool m_bTemporalIdNestingFlag;569 570 UInt m_numReorderPics[MAX_TLAYER];571 UInt m_uiMaxDecPicBuffering[MAX_TLAYER];572 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit)573 574 UInt m_numHrdParameters;579 Int m_VPSId; 580 UInt m_uiMaxTLayers; 581 UInt m_uiMaxLayers; 582 Bool m_bTemporalIdNestingFlag; 583 584 UInt m_numReorderPics[MAX_TLAYER]; 585 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 586 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) 587 588 UInt m_numHrdParameters; 575 589 #if !SVC_EXTENSION 576 UInt m_maxNuhReservedZeroLayerId;577 #endif 578 TComHRD*m_hrdParameters;579 UInt*m_hrdOpSetIdx;580 Bool*m_cprmsPresentFlag;590 UInt m_maxNuhReservedZeroLayerId; 591 #endif 592 std::vector<TComHRD> m_hrdParameters; 593 std::vector<UInt> m_hrdOpSetIdx; 594 std::vector<Bool> m_cprmsPresentFlag; 581 595 #if !SVC_EXTENSION 582 UInt m_numOpSets; 583 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; 584 TComPTL m_pcPTL; 585 #endif 586 TimingInfo m_timingInfo; 596 UInt m_numOpSets; 597 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; 598 599 TComPTL m_pcPTL; 600 #endif 601 TimingInfo m_timingInfo; 587 602 588 603 #if SVC_EXTENSION 589 Bool m_baseLayerInternalFlag;590 Bool m_baseLayerAvailableFlag;591 TComPTL m_pcPTLList[MAX_NUM_LAYER_IDS + 1];604 Bool m_baseLayerInternalFlag; 605 Bool m_baseLayerAvailableFlag; 606 TComPTL m_pcPTLList[MAX_NUM_LAYER_IDS + 1]; 592 607 593 608 std::vector< std::vector<Int> > m_layerSetLayerIdList; 594 609 std::vector<Int> m_numLayerInIdList; 595 610 596 UInt m_maxLayerId;597 UInt m_numLayerSets;598 599 UInt m_vpsNumLayerSetsMinus1;600 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];611 UInt m_maxLayerId; 612 UInt m_numLayerSets; 613 614 UInt m_vpsNumLayerSetsMinus1; 615 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; 601 616 602 617 // ------------------------------------------ 603 618 // Variables related to VPS extensions 604 619 // ------------------------------------------ 605 Bool m_nonHEVCBaseLayerFlag;606 Bool m_splittingFlag;607 Bool m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES];608 UInt m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES];609 Bool m_nuhLayerIdPresentFlag;610 UInt m_layerIdInNuh[MAX_VPS_LAYER_IDX_PLUS1]; // Maps layer ID in the VPS with layer_id_in_nuh611 UInt m_dimensionId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES];620 Bool m_nonHEVCBaseLayerFlag; 621 Bool m_splittingFlag; 622 Bool m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; 623 UInt m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES]; 624 Bool m_nuhLayerIdPresentFlag; 625 UInt m_layerIdInNuh[MAX_VPS_LAYER_IDX_PLUS1]; // Maps layer ID in the VPS with layer_id_in_nuh 626 UInt m_dimensionId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES]; 612 627 613 628 // Below are derived variables 614 UInt m_numScalabilityTypes;615 UInt m_layerIdxInVps[MAX_NUM_LAYER_IDS]; // Maps layer_id_in_nuh with the layer ID in the VPS616 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS];617 Bool m_ilpSshSignalingEnabledFlag;629 UInt m_numScalabilityTypes; 630 UInt m_layerIdxInVps[MAX_NUM_LAYER_IDS]; // Maps layer_id_in_nuh with the layer ID in the VPS 631 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 632 Bool m_ilpSshSignalingEnabledFlag; 618 633 619 634 // Profile-tier-level signalling related 620 Bool m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. 621 #if !SVC_EXTENSION 622 std::vector<TComPTL> m_pcPTLForExtn; 623 #endif 635 Bool m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. 624 636 625 637 // Target output layer signalling related 626 UInt m_numOutputLayerSets;627 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];628 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1];629 Bool m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];630 UInt m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1];631 UInt m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];632 UInt m_directDepTypeLen;633 Bool m_defaultDirectDependencyTypeFlag;634 UInt m_defaultDirectDependencyType;635 UInt m_directDependencyType[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];636 637 UInt m_numProfileTierLevel;638 Int m_numAddOutputLayerSets;639 UInt m_defaultTargetOutputLayerIdc;638 UInt m_numOutputLayerSets; 639 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 640 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1]; 641 Bool m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 642 UInt m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1]; 643 UInt m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 644 UInt m_directDepTypeLen; 645 Bool m_defaultDirectDependencyTypeFlag; 646 UInt m_defaultDirectDependencyType; 647 UInt m_directDependencyType[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 648 649 UInt m_numProfileTierLevel; 650 Int m_numAddOutputLayerSets; 651 UInt m_defaultTargetOutputLayerIdc; 640 652 std::vector< std::vector<Int> > m_profileLevelTierIdx; 641 Bool m_maxOneActiveRefLayerFlag;642 Bool m_pocLsbNotPresentFlag[MAX_VPS_LAYER_IDX_PLUS1];643 Bool m_crossLayerPictureTypeAlignFlag;644 Bool m_crossLayerIrapAlignFlag;645 Bool m_crossLayerAlignedIdrOnlyFlag;646 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_IDX_PLUS1 - 1][MAX_VPS_LAYER_IDX_PLUS1];647 Bool m_maxTidRefPresentFlag;648 Bool m_maxTSLayersPresentFlag;649 UInt m_maxTSLayerMinus1[MAX_LAYERS];650 Bool m_singleLayerForNonIrapFlag;651 Bool m_higherLayerIrapSkipFlag;652 Bool m_tilesNotInUseFlag;653 Bool m_tilesInUseFlag[MAX_VPS_LAYER_IDX_PLUS1];654 Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_IDX_PLUS1];655 Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];656 Bool m_wppNotInUseFlag;657 Bool m_wppInUseFlag[MAX_VPS_LAYER_IDX_PLUS1];658 659 Bool m_ilpRestrictedRefLayersFlag;660 Int m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];661 Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];662 Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];663 664 Bool m_vidSigPresentVpsFlag;665 Int m_vpsVidSigInfo;666 Int m_vpsVidSigIdx[MAX_VPS_LAYER_IDX_PLUS1];667 Int m_vpsVidFormat[16];668 Bool m_vpsFullRangeFlag[16];669 Int m_vpsColorPrimaries[16];670 Int m_vpsTransChar[16];671 Int m_vpsMatCoeff[16];672 673 Bool m_bitRatePresentVpsFlag;674 Bool m_picRatePresentVpsFlag;675 Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];676 Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];677 Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];678 Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];679 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];680 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];681 682 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];683 684 Bool m_repFormatIdxPresentFlag;685 Int m_vpsNumRepFormats; // coded as minus1686 RepFormat m_vpsRepFormat[16];687 Int m_vpsRepFormatIdx[16];688 689 Int m_viewIdLen;690 Int m_viewIdVal[MAX_LAYERS];691 692 Int m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer693 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer694 695 Int m_numAddLayerSets;696 UInt m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];697 UInt m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];698 UInt m_numPredictedLayers[MAX_NUM_LAYER_IDS];699 Int m_numIndependentLayers;700 Int m_numLayersInTreePartition[MAX_LAYERS];701 UInt m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS];702 703 Int m_TolsIdx;704 Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];705 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];706 Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];707 Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];708 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];709 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];710 711 Bool m_vpsVuiPresentFlag;712 Bool m_vpsExtensionFlag;653 Bool m_maxOneActiveRefLayerFlag; 654 Bool m_pocLsbNotPresentFlag[MAX_VPS_LAYER_IDX_PLUS1]; 655 Bool m_crossLayerPictureTypeAlignFlag; 656 Bool m_crossLayerIrapAlignFlag; 657 Bool m_crossLayerAlignedIdrOnlyFlag; 658 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_IDX_PLUS1 - 1][MAX_VPS_LAYER_IDX_PLUS1]; 659 Bool m_maxTidRefPresentFlag; 660 Bool m_maxTSLayersPresentFlag; 661 UInt m_maxTSLayerMinus1[MAX_LAYERS]; 662 Bool m_singleLayerForNonIrapFlag; 663 Bool m_higherLayerIrapSkipFlag; 664 Bool m_tilesNotInUseFlag; 665 Bool m_tilesInUseFlag[MAX_VPS_LAYER_IDX_PLUS1]; 666 Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_IDX_PLUS1]; 667 Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 668 Bool m_wppNotInUseFlag; 669 Bool m_wppInUseFlag[MAX_VPS_LAYER_IDX_PLUS1]; 670 671 Bool m_ilpRestrictedRefLayersFlag; 672 Int m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 673 Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 674 Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 675 676 Bool m_vidSigPresentVpsFlag; 677 Int m_vpsVidSigInfo; 678 Int m_vpsVidSigIdx[MAX_VPS_LAYER_IDX_PLUS1]; 679 Int m_vpsVidFormat[16]; 680 Bool m_vpsFullRangeFlag[16]; 681 Int m_vpsColorPrimaries[16]; 682 Int m_vpsTransChar[16]; 683 Int m_vpsMatCoeff[16]; 684 685 Bool m_bitRatePresentVpsFlag; 686 Bool m_picRatePresentVpsFlag; 687 Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 688 Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 689 Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 690 Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 691 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 692 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 693 694 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 695 696 Bool m_repFormatIdxPresentFlag; 697 Int m_vpsNumRepFormats; // coded as minus1 698 RepFormat m_vpsRepFormat[16]; 699 Int m_vpsRepFormatIdx[16]; 700 701 Int m_viewIdLen; 702 Int m_viewIdVal[MAX_LAYERS]; 703 704 Int m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer 705 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer 706 707 Int m_numAddLayerSets; 708 UInt m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; 709 UInt m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 710 UInt m_numPredictedLayers[MAX_NUM_LAYER_IDS]; 711 Int m_numIndependentLayers; 712 Int m_numLayersInTreePartition[MAX_LAYERS]; 713 UInt m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS]; 714 715 Int m_TolsIdx; 716 Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1]; 717 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 718 Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 719 Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 720 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 721 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 722 723 Bool m_vpsVuiPresentFlag; 724 Bool m_vpsExtensionFlag; 713 725 714 726 #if O0164_MULTI_LAYER_HRD 715 Bool m_vpsVuiBspHrdPresentFlag;716 Int m_vpsNumAddHrdParams;717 std::vector<Bool> m_cprmsAddPresentFlag;718 std::vector<Int> m_numSubLayerHrdMinus1;719 std::vector<TComHRD> m_bspHrd;720 Int m_numSignalledPartitioningSchemes[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];721 Int m_numPartitionsInSchemeMinus1 [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16];722 Int m_layerIncludedInPartitionFlag [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_LAYERS][MAX_LAYERS];723 Int m_numBspSchedulesMinus1 [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER];724 Int m_bspHrdIdx [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];725 Int m_bspSchedIdx [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];726 #endif 727 UInt m_baseLayerPSCompatibilityFlag[MAX_LAYERS];728 Int m_vpsNonVuiExtLength;729 Bool m_vpsPocLsbAlignedFlag;727 Bool m_vpsVuiBspHrdPresentFlag; 728 Int m_vpsNumAddHrdParams; 729 std::vector<Bool> m_cprmsAddPresentFlag; 730 std::vector<Int> m_numSubLayerHrdMinus1; 731 std::vector<TComHRD> m_bspHrd; 732 Int m_numSignalledPartitioningSchemes[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; 733 Int m_numPartitionsInSchemeMinus1 [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16]; 734 Int m_layerIncludedInPartitionFlag [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_LAYERS][MAX_LAYERS]; 735 Int m_numBspSchedulesMinus1 [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER]; 736 Int m_bspHrdIdx [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS]; 737 Int m_bspSchedIdx [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS]; 738 #endif 739 UInt m_baseLayerPSCompatibilityFlag[MAX_LAYERS]; 740 Int m_vpsNonVuiExtLength; 741 Bool m_vpsPocLsbAlignedFlag; 730 742 std::vector< std::vector<Bool> > m_necessaryLayerFlag; 731 743 std::vector<Int> m_numNecessaryLayers; … … 733 745 734 746 public: 735 TComVPS(); 736 virtual ~TComVPS(); 737 738 Void createHrdParamBuffer() 747 TComVPS(); 748 749 virtual ~TComVPS(); 750 751 Void createHrdParamBuffer() 739 752 { 740 m_hrdParameters = new TComHRD[ getNumHrdParameters() ];741 m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ];742 m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ];753 m_hrdParameters.resize(getNumHrdParameters()); 754 m_hrdOpSetIdx.resize(getNumHrdParameters()); 755 m_cprmsPresentFlag.resize(getNumHrdParameters()); 743 756 } 744 757 745 TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } 746 UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } 747 Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } 748 Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } 749 Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } 750 751 Int getVPSId () { return m_VPSId; } 752 Void setVPSId (Int i) { m_VPSId = i; } 753 754 UInt getMaxTLayers () { return m_uiMaxTLayers; } 755 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 756 757 UInt getMaxLayers () { return m_uiMaxLayers; } 758 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 759 760 Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } 761 Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } 762 763 Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } 764 UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } 765 766 Void setMaxDecPicBuffering(UInt v, UInt tLayer) { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; } 767 UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } 768 769 Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } 770 UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } 771 772 UInt getNumHrdParameters() { return m_numHrdParameters; } 773 Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } 758 TComHRD* getHrdParameters( UInt i ) { return &m_hrdParameters[ i ]; } 759 const TComHRD* getHrdParameters( UInt i ) const { return &m_hrdParameters[ i ]; } 760 UInt getHrdOpSetIdx( UInt i ) const { return m_hrdOpSetIdx[ i ]; } 761 Void setHrdOpSetIdx( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } 762 Bool getCprmsPresentFlag( UInt i ) const { return m_cprmsPresentFlag[ i ]; } 763 Void setCprmsPresentFlag( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } 764 765 Int getVPSId() const { return m_VPSId; } 766 Void setVPSId(Int i) { m_VPSId = i; } 767 768 UInt getMaxTLayers() const { return m_uiMaxTLayers; } 769 Void setMaxTLayers(UInt t) { m_uiMaxTLayers = t; } 770 771 UInt getMaxLayers() const { return m_uiMaxLayers; } 772 Void setMaxLayers(UInt l) { m_uiMaxLayers = l; } 773 774 Bool getTemporalNestingFlag() const { return m_bTemporalIdNestingFlag; } 775 Void setTemporalNestingFlag(Bool t) { m_bTemporalIdNestingFlag = t; } 776 777 Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } 778 UInt getNumReorderPics(UInt tLayer) const { return m_numReorderPics[tLayer]; } 779 780 Void setMaxDecPicBuffering(UInt v, UInt tLayer) { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; } 781 UInt getMaxDecPicBuffering(UInt tLayer) const { return m_uiMaxDecPicBuffering[tLayer]; } 782 783 Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } 784 UInt getMaxLatencyIncrease(UInt tLayer) const { return m_uiMaxLatencyIncrease[tLayer]; } 785 786 UInt getNumHrdParameters() const { return m_numHrdParameters; } 787 Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } 774 788 775 789 #if !SVC_EXTENSION 776 UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId;}777 Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v;}778 779 UInt getMaxOpSets() { return m_numOpSets;}780 Void setMaxOpSets(UInt v) { m_numOpSets = v;}781 #endif 782 Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id];}783 Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v;}790 UInt getMaxNuhReservedZeroLayerId() const { return m_maxNuhReservedZeroLayerId; } 791 Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } 792 793 UInt getMaxOpSets() const { return m_numOpSets; } 794 Void setMaxOpSets(UInt v) { m_numOpSets = v; } 795 #endif 796 Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) const { return m_layerIdIncludedFlag[opsIdx][id]; } 797 Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } 784 798 785 799 #if !SVC_EXTENSION 786 TComPTL* getPTL() { return &m_pcPTL; } 787 #endif 788 789 TimingInfo* getTimingInfo() { return &m_timingInfo; } 800 TComPTL* getPTL() { return &m_pcPTL; } 801 const TComPTL* getPTL() const { return &m_pcPTL; } 802 #endif 803 804 TimingInfo* getTimingInfo() { return &m_timingInfo; } 805 const TimingInfo* getTimingInfo() const { return &m_timingInfo; } 790 806 791 807 #if SVC_EXTENSION 792 Void setBaseLayerInternalFlag(Bool x) { m_baseLayerInternalFlag = x;}793 Bool getBaseLayerInternalFlag() { return m_baseLayerInternalFlag;}794 Void setBaseLayerAvailableFlag(Bool x) { m_baseLayerAvailableFlag = x;}795 Bool getBaseLayerAvailableFlag() { return m_baseLayerAvailableFlag;}808 Void setBaseLayerInternalFlag(Bool x) { m_baseLayerInternalFlag = x; } 809 Bool getBaseLayerInternalFlag() const { return m_baseLayerInternalFlag; } 810 Void setBaseLayerAvailableFlag(Bool x) { m_baseLayerAvailableFlag = x; } 811 Bool getBaseLayerAvailableFlag() const { return m_baseLayerAvailableFlag; } 796 812 797 813 #if O0164_MULTI_LAYER_HRD 798 Void createBspHrdParamBuffer(UInt numHrds)814 Void createBspHrdParamBuffer(UInt numHrds) 799 815 { 800 816 m_bspHrd.resize( numHrds ); … … 804 820 #endif 805 821 806 Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl) { return m_bspHrd[i].getCpbCntMinus1(sl); } 807 808 TComPTL* getPTL() { return &m_pcPTLList[0]; } 809 TComPTL* getPTL(UInt idx) { return &m_pcPTLList[idx]; } 810 811 Int getLayerSetLayerIdList(Int set, Int layerId) { return m_layerSetLayerIdList[set][layerId]; } 812 Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x; } 813 814 Int getNumLayersInIdList(Int set) { return m_numLayerInIdList[set]; } 815 Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x; } 816 817 Void deriveLayerIdListVariables(); 818 Void deriveNumberOfSubDpbs(); 819 820 Void setRefLayersFlags(Int currLayerId); 821 Bool getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId) { return m_recursiveRefLayerFlag[currLayerId][refLayerId];} 822 Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } 823 Int getNumRefLayers(Int currLayerId) { return m_numberRefLayers[currLayerId]; } 824 Void setNumRefLayers(); 825 826 void deriveLayerIdListVariablesForAddLayerSets(); 827 UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } 828 Void setVpsNumLayerSetsMinus1(UInt x) { m_vpsNumLayerSetsMinus1 = x; } 829 UInt getNumAddLayerSets() { return m_numAddLayerSets; } 830 Void setNumAddLayerSets(UInt x) { m_numAddLayerSets = x; } 831 UInt getHighestLayerIdxPlus1(UInt set, UInt idx) { return m_highestLayerIdxPlus1[set][idx]; } 832 Void setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx) { m_highestLayerIdxPlus1[set][idx] = layerIdx; } 833 Void setPredictedLayerIds(); 834 UInt getPredictedLayerId(UInt layerId, UInt predIdx) { return m_predictedLayerId[layerId][predIdx]; } 835 Void setPredictedLayerId(UInt layerId, UInt predIdx, UInt x) { m_predictedLayerId[layerId][predIdx] = x; } 836 UInt getNumPredictedLayers(UInt layerId) { return m_numPredictedLayers[layerId]; } 837 Void setNumPredictedLayers(UInt layerId, UInt x) { m_numPredictedLayers[layerId] = x; } 838 Void setTreePartitionLayerIdList(); 839 Int getNumIndependentLayers() { return m_numIndependentLayers; } 840 Void setNumIndependentLayers(Int x) { m_numIndependentLayers = x; } 841 Int getNumLayersInTreePartition(Int idx) { return m_numLayersInTreePartition[idx]; } 842 Void setNumLayersInTreePartition(Int idx, Int x) { m_numLayersInTreePartition[idx] = x; } 843 UInt getTreePartitionLayerId(Int idx, Int layerIdx) { return m_treePartitionLayerIdList[idx][layerIdx]; } 844 Void setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId) { m_treePartitionLayerIdList[idx][layerIdx] = layerId; } 845 846 UInt getMaxLayerId() { return m_maxLayerId; } 847 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 848 UInt getNumLayerSets() { return m_numLayerSets; } 849 Void setNumLayerSets(UInt v) { m_numLayerSets = v; } 850 851 Bool getNonHEVCBaseLayerFlag() { return m_nonHEVCBaseLayerFlag; } 852 Void setNonHEVCBaseLayerFlag(Bool x) { m_nonHEVCBaseLayerFlag = x; } 853 854 Bool getSplittingFlag() { return m_splittingFlag; } 855 Void setSplittingFlag(Bool x) { m_splittingFlag = x; } 856 857 Bool getScalabilityMask(Int id) { return m_scalabilityMask[id]; } 858 Void setScalabilityMask(Int id, Bool x) { m_scalabilityMask[id] = x; } 859 860 UInt getDimensionIdLen(Int id) { return m_dimensionIdLen[id]; } 861 Void setDimensionIdLen(Int id, UInt x) { m_dimensionIdLen[id] = x; } 862 863 Bool getNuhLayerIdPresentFlag() { return m_nuhLayerIdPresentFlag; } 864 Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } 865 866 UInt getLayerIdInNuh(Int layerIdx) { return m_layerIdInNuh[layerIdx]; } 867 Void setLayerIdInNuh(Int layerIdx, UInt layerId) { m_layerIdInNuh[layerIdx] = layerId; } 868 869 UInt getDimensionId(Int layerIdx, Int id) { return m_dimensionId[layerIdx][id]; } 870 Void setDimensionId(Int layerIdx, Int id, UInt x) { m_dimensionId[layerIdx][id] = x; } 871 872 UInt getNumScalabilityTypes() { return m_numScalabilityTypes; } 873 Void setNumScalabilityTypes(UInt x) { m_numScalabilityTypes = x; } 874 875 UInt getLayerIdxInVps(Int layerId) { return m_layerIdxInVps[layerId]; } 876 Void setLayerIdxInVps(Int layerId, UInt layerIdx) { m_layerIdxInVps[layerId] = layerIdx; } 877 878 UInt getMaxSLayersInLayerSetMinus1(Int ls) { return m_maxSLInLayerSetMinus1[ls]; } 879 Void setMaxSLayersInLayerSetMinus1(Int ls, Int x) { m_maxSLInLayerSetMinus1[ls] = x; } 880 Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} 881 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} 882 883 Bool getProfilePresentFlag(Int id) { return m_profilePresentFlag[id]; } 884 Void setProfilePresentFlag(Int id, Bool x) { m_profilePresentFlag[id] = x; } 822 Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl) { return m_bspHrd[i].getCpbCntMinus1(sl); } 823 824 TComPTL* getPTL() { return &m_pcPTLList[0]; } 825 const TComPTL* getPTL() const { return &m_pcPTLList[0]; } 826 TComPTL* getPTL(UInt idx) { return &m_pcPTLList[idx]; } 827 const TComPTL* getPTL(UInt idx) const { return &m_pcPTLList[idx]; } 828 829 Int getLayerSetLayerIdList(Int set, Int layerId) const { return m_layerSetLayerIdList[set][layerId]; } 830 Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x; } 831 832 Int getNumLayersInIdList(Int set) const { return m_numLayerInIdList[set]; } 833 Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x; } 834 835 Void deriveLayerIdListVariables(); 836 Void deriveNumberOfSubDpbs(); 837 838 Void setRefLayersFlags(Int currLayerId); 839 Bool getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId) const { return m_recursiveRefLayerFlag[currLayerId][refLayerId];} 840 Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } 841 Int getNumRefLayers(Int currLayerId) const { return m_numberRefLayers[currLayerId]; } 842 Void setNumRefLayers(); 843 844 Void deriveLayerIdListVariablesForAddLayerSets(); 845 UInt getVpsNumLayerSetsMinus1() const { return m_vpsNumLayerSetsMinus1; } 846 Void setVpsNumLayerSetsMinus1(UInt x) { m_vpsNumLayerSetsMinus1 = x; } 847 UInt getNumAddLayerSets() const { return m_numAddLayerSets; } 848 Void setNumAddLayerSets(UInt x) { m_numAddLayerSets = x; } 849 UInt getHighestLayerIdxPlus1(UInt set, UInt idx) const { return m_highestLayerIdxPlus1[set][idx]; } 850 Void setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx) { m_highestLayerIdxPlus1[set][idx] = layerIdx; } 851 Void setPredictedLayerIds(); 852 UInt getPredictedLayerId(UInt layerId, UInt predIdx) const { return m_predictedLayerId[layerId][predIdx]; } 853 Void setPredictedLayerId(UInt layerId, UInt predIdx, UInt x) { m_predictedLayerId[layerId][predIdx] = x; } 854 UInt getNumPredictedLayers(UInt layerId) const { return m_numPredictedLayers[layerId]; } 855 Void setNumPredictedLayers(UInt layerId, UInt x) { m_numPredictedLayers[layerId] = x; } 856 Void setTreePartitionLayerIdList(); 857 Int getNumIndependentLayers() const { return m_numIndependentLayers; } 858 Void setNumIndependentLayers(Int x) { m_numIndependentLayers = x; } 859 Int getNumLayersInTreePartition(Int idx) const { return m_numLayersInTreePartition[idx]; } 860 Void setNumLayersInTreePartition(Int idx, Int x) { m_numLayersInTreePartition[idx] = x; } 861 UInt getTreePartitionLayerId(Int idx, Int layerIdx) const { return m_treePartitionLayerIdList[idx][layerIdx]; } 862 Void setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId) { m_treePartitionLayerIdList[idx][layerIdx] = layerId; } 863 864 UInt getMaxLayerId() const { return m_maxLayerId; } 865 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 866 UInt getNumLayerSets() const { return m_numLayerSets; } 867 Void setNumLayerSets(UInt v) { m_numLayerSets = v; } 868 869 Bool getNonHEVCBaseLayerFlag() const { return m_nonHEVCBaseLayerFlag; } 870 Void setNonHEVCBaseLayerFlag(Bool x) { m_nonHEVCBaseLayerFlag = x; } 871 872 Bool getSplittingFlag() const { return m_splittingFlag; } 873 Void setSplittingFlag(Bool x) { m_splittingFlag = x; } 874 875 Bool getScalabilityMask(Int id) const { return m_scalabilityMask[id]; } 876 Void setScalabilityMask(Int id, Bool x) { m_scalabilityMask[id] = x; } 877 878 UInt getDimensionIdLen(Int id) const { return m_dimensionIdLen[id]; } 879 Void setDimensionIdLen(Int id, UInt x) { m_dimensionIdLen[id] = x; } 880 881 Bool getNuhLayerIdPresentFlag() const { return m_nuhLayerIdPresentFlag; } 882 Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } 883 884 UInt getLayerIdInNuh(Int layerIdx) const { return m_layerIdInNuh[layerIdx]; } 885 Void setLayerIdInNuh(Int layerIdx, UInt layerId) { m_layerIdInNuh[layerIdx] = layerId; } 886 887 UInt getDimensionId(Int layerIdx, Int id) const { return m_dimensionId[layerIdx][id]; } 888 Void setDimensionId(Int layerIdx, Int id, UInt x) { m_dimensionId[layerIdx][id] = x; } 889 890 UInt getNumScalabilityTypes() const { return m_numScalabilityTypes; } 891 Void setNumScalabilityTypes(UInt x) { m_numScalabilityTypes = x; } 892 893 UInt getLayerIdxInVps(Int layerId) const { return m_layerIdxInVps[layerId]; } 894 Void setLayerIdxInVps(Int layerId, UInt layerIdx) { m_layerIdxInVps[layerId] = layerIdx; } 895 896 UInt getMaxSLayersInLayerSetMinus1(Int ls) const { return m_maxSLInLayerSetMinus1[ls]; } 897 Void setMaxSLayersInLayerSetMinus1(Int ls, Int x) { m_maxSLInLayerSetMinus1[ls] = x; } 898 Bool getIlpSshSignalingEnabledFlag() const { return m_ilpSshSignalingEnabledFlag; } 899 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x; } 900 901 Bool getProfilePresentFlag(Int id) const { return m_profilePresentFlag[id]; } 902 Void setProfilePresentFlag(Int id, Bool x) { m_profilePresentFlag[id] = x; } 885 903 886 904 // Target output layer signalling related 887 UInt getNumOutputLayerSets() { return m_numOutputLayerSets;}888 Void setNumOutputLayerSets(Int x) { m_numOutputLayerSets = x;}905 UInt getNumOutputLayerSets() const { return m_numOutputLayerSets; } 906 Void setNumOutputLayerSets(Int x) { m_numOutputLayerSets = x; } 889 907 890 UInt getOutputLayerSetIdx(Int idx) { return m_outputLayerSetIdx[idx];}891 Void setOutputLayerSetIdx(Int idx, UInt x) { m_outputLayerSetIdx[idx] = x;}892 893 Bool getOutputLayerFlag(Int layerSet, Int layerIdx) { return m_outputLayerFlag[layerSet][layerIdx];}894 Void setOutputLayerFlag(Int layerSet, Int layerIdx, Bool x) { m_outputLayerFlag[layerSet][layerIdx] = x;}908 UInt getOutputLayerSetIdx(Int idx) const { return m_outputLayerSetIdx[idx]; } 909 Void setOutputLayerSetIdx(Int idx, UInt x) { m_outputLayerSetIdx[idx] = x; } 910 911 Bool getOutputLayerFlag(Int layerSet, Int layerIdx) const { return m_outputLayerFlag[layerSet][layerIdx]; } 912 Void setOutputLayerFlag(Int layerSet, Int layerIdx, Bool x) { m_outputLayerFlag[layerSet][layerIdx] = x; } 895 913 896 914 // Direct dependency of layers 897 Bool getDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx){ return m_directDependencyFlag[currLayerIdx][refLayerIdx]; }898 Void setDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx, Bool x){ m_directDependencyFlag[currLayerIdx][refLayerIdx] = x; }915 Bool getDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx) const { return m_directDependencyFlag[currLayerIdx][refLayerIdx]; } 916 Void setDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx, Bool x) { m_directDependencyFlag[currLayerIdx][refLayerIdx] = x; } 899 917 900 UInt getNumDirectRefLayers(Int layerId){ return m_numDirectRefLayers[layerId]; }901 Void setNumDirectRefLayers(Int layerId, UInt refLayerNum){ m_numDirectRefLayers[layerId] = refLayerNum; }902 903 UInt getRefLayerId(Int layerId, Int refLayerIdc){ return m_refLayerId[layerId][refLayerIdc]; }904 Void setRefLayerId(Int layerId, Int refLayerIdc, UInt refLayerId){ m_refLayerId[layerId][refLayerIdc] = refLayerId; }905 906 UInt getDirectDepTypeLen(){ return m_directDepTypeLen; }907 Void setDirectDepTypeLen(UInt x){ m_directDepTypeLen = x; }908 Bool getDefaultDirectDependencyTypeFlag(){ return m_defaultDirectDependencyTypeFlag; }909 Void setDefaultDirectDependecyTypeFlag(Bool x){ m_defaultDirectDependencyTypeFlag = x; }910 UInt getDefaultDirectDependencyType(){ return m_defaultDirectDependencyType; }911 Void setDefaultDirectDependecyType(UInt x){ m_defaultDirectDependencyType = x; }912 UInt getDirectDependencyType(Int currLayerIdx, Int refLayerIdx){ return m_directDependencyType[currLayerIdx][refLayerIdx]; }913 Void setDirectDependencyType(Int currLayerIdx, Int refLayerIdx, UInt x){ m_directDependencyType[currLayerIdx][refLayerIdx] = x; }914 Bool isSamplePredictionType(Int currLayerIdx, Int refLayerIdx){ assert(currLayerIdx != refLayerIdx); return ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 1 ) ? true : false; }915 Bool isMotionPredictionType(Int currLayerIdx, Int refLayerIdx){ assert(currLayerIdx != refLayerIdx); return ( ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 2 ) >> 1 ) ? true : false; }916 917 UInt getNumProfileTierLevel() { return m_numProfileTierLevel;}918 Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x;}919 Int getNumAddOutputLayerSets() { return m_numAddOutputLayerSets;}920 Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x ;}921 922 UInt getDefaultTargetOutputLayerIdc() { return m_defaultTargetOutputLayerIdc;}923 Void setDefaultTargetOutputLayerIdc(UInt x) { m_defaultTargetOutputLayerIdc = x ;}924 925 Bool getNecessaryLayerFlag(Int const i, Int const j) { return m_necessaryLayerFlag[i][j];}926 std::vector< std::vector<Int> >* getProfileLevelTierIdx() { return &m_profileLevelTierIdx;}927 std::vector<Int>* getProfileLevelTierIdx(Int const olsIdx) { return &m_profileLevelTierIdx[olsIdx];}928 Int getProfileLevelTierIdx(Int const olsIdx, Int const layerIdx) { return m_profileLevelTierIdx[olsIdx][layerIdx];}929 Void setProfileLevelTierIdx(Int const olsIdx, Int const layerIdx, Int const ptlIdx) { m_profileLevelTierIdx[olsIdx][layerIdx] = ptlIdx; }930 Void addProfileLevelTierIdx(Int const olsIdx, Int const ptlIdx) { m_profileLevelTierIdx[olsIdx].push_back(ptlIdx);}931 Int calculateLenOfSyntaxElement( Int const numVal );932 933 Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag;}934 Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x;}935 UInt getPocLsbNotPresentFlag(Int i) { return m_pocLsbNotPresentFlag[i];}936 Void setPocLsbNotPresentFlag(Int i, Bool x) { m_pocLsbNotPresentFlag[i] = x;}937 Bool getVpsPocLsbAlignedFlag() { return m_vpsPocLsbAlignedFlag;}938 Void setVpsPocLsbAlignedFlag(Bool x) { m_vpsPocLsbAlignedFlag = x;}939 Bool getCrossLayerPictureTypeAlignFlag() { return m_crossLayerPictureTypeAlignFlag;}940 Void setCrossLayerPictureTypeAlignFlag(Bool x) { m_crossLayerPictureTypeAlignFlag = x;}941 Bool getCrossLayerAlignedIdrOnlyFlag() { return m_crossLayerAlignedIdrOnlyFlag;}942 Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x;}943 Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag;}944 Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x;}945 UInt getMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx) { return m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx];}946 Void setMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx] = maxSublayer;}947 Bool getMaxTidRefPresentFlag() { return m_maxTidRefPresentFlag;}948 Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x;}949 Bool getMaxTSLayersPresentFlag() { return m_maxTSLayersPresentFlag;}950 Void setMaxTSLayersPresentFlag(Bool x) { m_maxTSLayersPresentFlag = x;}951 UInt getMaxTSLayersMinus1(Int layerIdx) { return m_maxTSLayerMinus1[layerIdx];}952 Void setMaxTSLayersMinus1(Int layerIdx, UInt maxTSublayer) { m_maxTSLayerMinus1[layerIdx] = maxTSublayer;}953 Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag;}954 Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x;}955 Bool getHigherLayerIrapSkipFlag() { return m_higherLayerIrapSkipFlag;}956 Void setHigherLayerIrapSkipFlag(Bool x) { m_higherLayerIrapSkipFlag = x;}957 958 Bool getTilesNotInUseFlag() { return m_tilesNotInUseFlag;}959 Void setTilesNotInUseFlag(Bool x);960 Bool getTilesInUseFlag(Int currLayerId) { return m_tilesInUseFlag[currLayerId];}961 Void setTilesInUseFlag(Int currLayerId, Bool x){ m_tilesInUseFlag[currLayerId] = x; }962 Bool getLoopFilterNotAcrossTilesFlag(Int currLayerId) { return m_loopFilterNotAcrossTilesFlag[currLayerId];}963 Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x;}964 Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId){ return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; }965 Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x;}966 Bool getWppNotInUseFlag() { return m_wppNotInUseFlag;}967 Void setWppNotInUseFlag(Bool x);968 Bool getWppInUseFlag(Int currLayerId) { return m_wppInUseFlag[currLayerId];}969 Void setWppInUseFlag(Int currLayerId, Bool x) { m_wppInUseFlag[currLayerId] = x;}970 971 Bool getIlpRestrictedRefLayersFlag ( ){ return m_ilpRestrictedRefLayersFlag;}972 Void setIlpRestrictedRefLayersFlag ( Int val ) { m_ilpRestrictedRefLayersFlag = val; }973 Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ){ return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}974 Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val; }975 Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ){ return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}976 Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;}977 Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ){ return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}978 Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val; }979 980 Bool getVideoSigPresentVpsFlag() { return m_vidSigPresentVpsFlag;}981 Void setVideoSigPresentVpsFlag(Bool x) { m_vidSigPresentVpsFlag = x;}982 Int getNumVideoSignalInfo() { return m_vpsVidSigInfo;}983 Void setNumVideoSignalInfo(Int x) { m_vpsVidSigInfo = x;}984 Int getVideoSignalInfoIdx(Int idx) { return m_vpsVidSigIdx[idx];}985 Void setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x;}986 Int getVideoVPSFormat(Int idx) { return m_vpsVidFormat[idx];}987 Void setVideoVPSFormat(Int idx, Int x) { m_vpsVidFormat[idx] = x;}988 Bool getVideoFullRangeVpsFlag(Int idx) { return m_vpsFullRangeFlag[idx];}989 Void setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x;}990 Int getColorPrimaries(Int idx) { return m_vpsColorPrimaries[idx];}991 Void setColorPrimaries(Int idx, Int x) { m_vpsColorPrimaries[idx] = x;}992 Int getTransCharacter(Int idx) { return m_vpsTransChar[idx];}993 Void setTransCharacter(Int idx, Int x) { m_vpsTransChar[idx] = x;}994 Int getMaxtrixCoeff(Int idx) { return m_vpsMatCoeff[idx];}995 Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x;}996 997 Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag;}998 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x;}999 Bool getPicRatePresentVpsFlag() { return m_picRatePresentVpsFlag;}1000 Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x;}918 UInt getNumDirectRefLayers(Int layerId) const { return m_numDirectRefLayers[layerId]; } 919 Void setNumDirectRefLayers(Int layerId, UInt refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } 920 921 UInt getRefLayerId(Int layerId, Int refLayerIdc) const { return m_refLayerId[layerId][refLayerIdc]; } 922 Void setRefLayerId(Int layerId, Int refLayerIdc, UInt refLayerId) { m_refLayerId[layerId][refLayerIdc] = refLayerId; } 923 924 UInt getDirectDepTypeLen() const { return m_directDepTypeLen; } 925 Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } 926 Bool getDefaultDirectDependencyTypeFlag() const { return m_defaultDirectDependencyTypeFlag; } 927 Void setDefaultDirectDependecyTypeFlag(Bool x) { m_defaultDirectDependencyTypeFlag = x; } 928 UInt getDefaultDirectDependencyType() const { return m_defaultDirectDependencyType; } 929 Void setDefaultDirectDependecyType(UInt x) { m_defaultDirectDependencyType = x; } 930 UInt getDirectDependencyType(Int currLayerIdx, Int refLayerIdx) const { return m_directDependencyType[currLayerIdx][refLayerIdx]; } 931 Void setDirectDependencyType(Int currLayerIdx, Int refLayerIdx, UInt x) { m_directDependencyType[currLayerIdx][refLayerIdx] = x; } 932 Bool isSamplePredictionType(Int currLayerIdx, Int refLayerIdx) const { assert(currLayerIdx != refLayerIdx); return ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 1 ) ? true : false; } 933 Bool isMotionPredictionType(Int currLayerIdx, Int refLayerIdx) const { assert(currLayerIdx != refLayerIdx); return ( ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 2 ) >> 1 ) ? true : false; } 934 935 UInt getNumProfileTierLevel() const { return m_numProfileTierLevel; } 936 Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } 937 Int getNumAddOutputLayerSets() const { return m_numAddOutputLayerSets; } 938 Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x; } 939 940 UInt getDefaultTargetOutputLayerIdc() const { return m_defaultTargetOutputLayerIdc; } 941 Void setDefaultTargetOutputLayerIdc(UInt x) { m_defaultTargetOutputLayerIdc = x; } 942 943 Bool getNecessaryLayerFlag(Int const i, Int const j) const { return m_necessaryLayerFlag[i][j]; } 944 std::vector< std::vector<Int> >* getProfileLevelTierIdx() { return &m_profileLevelTierIdx; } 945 std::vector<Int>* getProfileLevelTierIdx(Int const olsIdx) { return &m_profileLevelTierIdx[olsIdx]; } 946 Int getProfileLevelTierIdx(const Int olsIdx, const Int layerIdx) const { return m_profileLevelTierIdx[olsIdx][layerIdx]; } 947 Void setProfileLevelTierIdx(const Int olsIdx, const Int layerIdx, const Int ptlIdx) { m_profileLevelTierIdx[olsIdx][layerIdx] = ptlIdx; } 948 Void addProfileLevelTierIdx(const Int olsIdx, const Int ptlIdx) { m_profileLevelTierIdx[olsIdx].push_back(ptlIdx); } 949 Int calculateLenOfSyntaxElement( const Int numVal ) const; 950 951 Bool getMaxOneActiveRefLayerFlag() const { return m_maxOneActiveRefLayerFlag; } 952 Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } 953 UInt getPocLsbNotPresentFlag(Int i) const { return m_pocLsbNotPresentFlag[i]; } 954 Void setPocLsbNotPresentFlag(Int i, Bool x) { m_pocLsbNotPresentFlag[i] = x; } 955 Bool getVpsPocLsbAlignedFlag() const { return m_vpsPocLsbAlignedFlag; } 956 Void setVpsPocLsbAlignedFlag(Bool x) { m_vpsPocLsbAlignedFlag = x; } 957 Bool getCrossLayerPictureTypeAlignFlag() const { return m_crossLayerPictureTypeAlignFlag; } 958 Void setCrossLayerPictureTypeAlignFlag(Bool x) { m_crossLayerPictureTypeAlignFlag = x; } 959 Bool getCrossLayerAlignedIdrOnlyFlag() const { return m_crossLayerAlignedIdrOnlyFlag; } 960 Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x; } 961 Bool getCrossLayerIrapAlignFlag() const { return m_crossLayerIrapAlignFlag; } 962 Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x; } 963 UInt getMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx) const { return m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx]; } 964 Void setMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx] = maxSublayer; } 965 Bool getMaxTidRefPresentFlag() const { return m_maxTidRefPresentFlag; } 966 Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x; } 967 Bool getMaxTSLayersPresentFlag() const { return m_maxTSLayersPresentFlag; } 968 Void setMaxTSLayersPresentFlag(Bool x) { m_maxTSLayersPresentFlag = x; } 969 UInt getMaxTSLayersMinus1(Int layerIdx) const { return m_maxTSLayerMinus1[layerIdx]; } 970 Void setMaxTSLayersMinus1(Int layerIdx, UInt maxTSublayer) { m_maxTSLayerMinus1[layerIdx] = maxTSublayer; } 971 Bool getSingleLayerForNonIrapFlag() const { return m_singleLayerForNonIrapFlag; } 972 Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } 973 Bool getHigherLayerIrapSkipFlag() const { return m_higherLayerIrapSkipFlag; } 974 Void setHigherLayerIrapSkipFlag(Bool x) { m_higherLayerIrapSkipFlag = x; } 975 976 Bool getTilesNotInUseFlag() const { return m_tilesNotInUseFlag; } 977 Void setTilesNotInUseFlag(Bool x); 978 Bool getTilesInUseFlag(Int currLayerId) const { return m_tilesInUseFlag[currLayerId]; } 979 Void setTilesInUseFlag(Int currLayerId, Bool x) { m_tilesInUseFlag[currLayerId] = x; } 980 Bool getLoopFilterNotAcrossTilesFlag(Int currLayerId) const { return m_loopFilterNotAcrossTilesFlag[currLayerId];} 981 Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } 982 Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) const { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } 983 Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } 984 Bool getWppNotInUseFlag() const { return m_wppNotInUseFlag; } 985 Void setWppNotInUseFlag(Bool x); 986 Bool getWppInUseFlag(Int currLayerId) const { return m_wppInUseFlag[currLayerId]; } 987 Void setWppInUseFlag(Int currLayerId, Bool x) { m_wppInUseFlag[currLayerId] = x; } 988 989 Bool getIlpRestrictedRefLayersFlag ( ) const { return m_ilpRestrictedRefLayersFlag;} 990 Void setIlpRestrictedRefLayersFlag ( Int val ) { m_ilpRestrictedRefLayersFlag = val; } 991 Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) const { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];} 992 Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val; } 993 Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ) const { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];} 994 Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} 995 Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) const { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];} 996 Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val; } 997 998 Bool getVideoSigPresentVpsFlag() const { return m_vidSigPresentVpsFlag; } 999 Void setVideoSigPresentVpsFlag(Bool x) { m_vidSigPresentVpsFlag = x; } 1000 Int getNumVideoSignalInfo() const { return m_vpsVidSigInfo; } 1001 Void setNumVideoSignalInfo(Int x) { m_vpsVidSigInfo = x; } 1002 Int getVideoSignalInfoIdx(Int idx) const { return m_vpsVidSigIdx[idx]; } 1003 Void setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x; } 1004 Int getVideoVPSFormat(Int idx) const { return m_vpsVidFormat[idx]; } 1005 Void setVideoVPSFormat(Int idx, Int x) { m_vpsVidFormat[idx] = x; } 1006 Bool getVideoFullRangeVpsFlag(Int idx) const { return m_vpsFullRangeFlag[idx]; } 1007 Void setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x; } 1008 Int getColorPrimaries(Int idx) const { return m_vpsColorPrimaries[idx]; } 1009 Void setColorPrimaries(Int idx, Int x) { m_vpsColorPrimaries[idx] = x; } 1010 Int getTransCharacter(Int idx) const { return m_vpsTransChar[idx]; } 1011 Void setTransCharacter(Int idx, Int x) { m_vpsTransChar[idx] = x; } 1012 Int getMaxtrixCoeff(Int idx) const { return m_vpsMatCoeff[idx]; } 1013 Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x; } 1014 1015 Bool getBitRatePresentVpsFlag() const { return m_bitRatePresentVpsFlag; } 1016 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } 1017 Bool getPicRatePresentVpsFlag() const { return m_picRatePresentVpsFlag; } 1018 Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x; } 1001 1019 1002 Bool getBitRatePresentFlag(Int i, Int j) { return m_bitRatePresentFlag[i][j];}1003 Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x;}1004 Bool getPicRatePresentFlag(Int i, Int j) { return m_picRatePresentFlag[i][j];}1005 Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x;}1020 Bool getBitRatePresentFlag(Int i, Int j) const { return m_bitRatePresentFlag[i][j]; } 1021 Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x; } 1022 Bool getPicRatePresentFlag(Int i, Int j) const { return m_picRatePresentFlag[i][j]; } 1023 Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x; } 1006 1024 1007 Int getAvgBitRate(Int i, Int j) { return m_avgBitRate[i][j];}1008 Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x;}1009 Int getMaxBitRate(Int i, Int j) { return m_maxBitRate[i][j];}1010 Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x;}1025 Int getAvgBitRate(Int i, Int j) const { return m_avgBitRate[i][j]; } 1026 Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x; } 1027 Int getMaxBitRate(Int i, Int j) const { return m_maxBitRate[i][j]; } 1028 Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x; } 1011 1029 1012 Int getConstPicRateIdc(Int i, Int j) { return m_constPicRateIdc[i][j];}1013 Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x;}1014 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j];}1015 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x;}1030 Int getConstPicRateIdc(Int i, Int j) const { return m_constPicRateIdc[i][j]; } 1031 Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x; } 1032 Int getAvgPicRate(Int i, Int j) const { return m_avgPicRate[i][j]; } 1033 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 1016 1034 #if O0164_MULTI_LAYER_HRD 1017 Bool getVpsVuiBspHrdPresentFlag() { return m_vpsVuiBspHrdPresentFlag; } 1018 Void setVpsVuiBspHrdPresentFlag(Bool x) { m_vpsVuiBspHrdPresentFlag = x; } 1019 Int getVpsNumAddHrdParams() { return m_vpsNumAddHrdParams; } 1020 Void setVpsNumAddHrdParams(Int i) { m_vpsNumAddHrdParams = i; } 1021 1022 Bool getCprmsAddPresentFlag(Int i) { return m_cprmsAddPresentFlag[i]; } 1023 Void setCprmsAddPresentFlag(Int i, Bool val) { m_cprmsAddPresentFlag[i] = val; } 1024 1025 Int getNumSubLayerHrdMinus1(Int i) { return m_numSubLayerHrdMinus1[i]; } 1026 Void setNumSubLayerHrdMinus1(Int i, Int val) { m_numSubLayerHrdMinus1[i] = val; } 1027 1028 TComHRD* getBspHrd(Int i) {return &m_bspHrd[i];} 1029 1030 Int getNumSignalledPartitioningSchemes(Int i) { return m_numSignalledPartitioningSchemes[i]; } 1031 Void setNumSignalledPartitioningSchemes(Int i, Int val) { m_numSignalledPartitioningSchemes[i] = val; } 1032 1033 Int getNumPartitionsInSchemeMinus1(Int i, Int j) { return m_numPartitionsInSchemeMinus1[i][j];} 1034 Void setNumPartitionsInSchemeMinus1(Int i, Int j, Int val) { m_numPartitionsInSchemeMinus1[i][j] = val; } 1035 1036 Int getLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l) { return m_layerIncludedInPartitionFlag[i][j][k][l];} 1037 Void setLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l, Int val) { m_layerIncludedInPartitionFlag[i][j][k][l] = val; } 1038 1039 Int getNumBspSchedulesMinus1(Int i, Int j, Int k) { return m_numBspSchedulesMinus1[i][j][k];} 1040 Void setNumBspSchedulesMinus1(Int i, Int j, Int k, Int val) { m_numBspSchedulesMinus1[i][j][k] = val; } 1041 1042 Int getBspSchedIdx(Int i, Int j, Int k, Int l, Int m) { return m_bspSchedIdx[i][j][k][l][m];} 1043 Void setBspSchedIdx(Int i, Int j, Int k, Int l, Int m, Int val) { m_bspSchedIdx[i][j][k][l][m] = val; } 1044 1045 Int getBspHrdIdx(Int i, Int j, Int k, Int l, Int m) { return m_bspHrdIdx[i][j][k][l][m];} 1046 Void setBspHrdIdx(Int i, Int j, Int k, Int l, Int m, Int val) { m_bspHrdIdx[i][j][k][l][m] = val; } 1047 #endif 1048 Void setBaseLayerPSCompatibilityFlag (Int layer, int val) { m_baseLayerPSCompatibilityFlag[layer] = val; } 1049 Int getBaseLayerPSCompatibilityFlag (Int layer) { return m_baseLayerPSCompatibilityFlag[layer];} 1050 Bool getAltOuputLayerFlag(Int idx) { return m_altOutputLayerFlag[idx]; } 1051 Void setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x; } 1052 1053 Bool getRepFormatIdxPresentFlag() { return m_repFormatIdxPresentFlag; } 1054 Void setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x; } 1055 1056 Int getVpsNumRepFormats() { return m_vpsNumRepFormats; } 1057 Void setVpsNumRepFormats(Int x) { m_vpsNumRepFormats = x; } 1058 1059 RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } 1060 1061 Int getVpsRepFormatIdx(Int idx) { return m_vpsRepFormatIdx[idx]; } 1062 Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; } 1063 1064 Void setViewIdLen( Int val ) { m_viewIdLen = val; } 1065 Int getViewIdLen( ) { return m_viewIdLen; } 1066 1067 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 1068 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 1069 Int getScalabilityId(Int, ScalabilityType scalType ); 1070 1071 Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdxInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 1072 1073 Int getNumViews(); 1074 Int scalTypeToScalIdx( ScalabilityType scalType ); 1075 1076 Bool getSubLayerFlagInfoPresentFlag(Int olsIdx) { return m_subLayerFlagInfoPresentFlag[olsIdx]; } 1077 Void setSubLayerFlagInfoPresentFlag(Int olsIdx, Bool x) { m_subLayerFlagInfoPresentFlag[olsIdx] = x; } 1078 1079 Bool getSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx) { return m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx]; } 1080 Void setSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx, Bool x) { m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx] = x; } 1035 Bool getVpsVuiBspHrdPresentFlag() const { return m_vpsVuiBspHrdPresentFlag; } 1036 Void setVpsVuiBspHrdPresentFlag(Bool x) { m_vpsVuiBspHrdPresentFlag = x; } 1037 Int getVpsNumAddHrdParams() const { return m_vpsNumAddHrdParams; } 1038 Void setVpsNumAddHrdParams(Int i) { m_vpsNumAddHrdParams = i; } 1039 1040 Bool getCprmsAddPresentFlag(Int i) const { return m_cprmsAddPresentFlag[i]; } 1041 Void setCprmsAddPresentFlag(Int i, Bool val) { m_cprmsAddPresentFlag[i] = val; } 1042 1043 Int getNumSubLayerHrdMinus1(Int i) const { return m_numSubLayerHrdMinus1[i]; } 1044 Void setNumSubLayerHrdMinus1(Int i, Int val) { m_numSubLayerHrdMinus1[i] = val; } 1045 1046 TComHRD* getBspHrd(Int i) { return &m_bspHrd[i]; } 1047 const TComHRD* getBspHrd(Int i) const { return &m_bspHrd[i]; } 1048 1049 Int getNumSignalledPartitioningSchemes(Int i) const { return m_numSignalledPartitioningSchemes[i]; } 1050 Void setNumSignalledPartitioningSchemes(Int i, Int val) { m_numSignalledPartitioningSchemes[i] = val; } 1051 1052 Int getNumPartitionsInSchemeMinus1(Int i, Int j) const { return m_numPartitionsInSchemeMinus1[i][j]; } 1053 Void setNumPartitionsInSchemeMinus1(Int i, Int j, Int val) { m_numPartitionsInSchemeMinus1[i][j] = val; } 1054 1055 Int getLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l) const { return m_layerIncludedInPartitionFlag[i][j][k][l];} 1056 Void setLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l, Int val) { m_layerIncludedInPartitionFlag[i][j][k][l] = val; } 1057 1058 Int getNumBspSchedulesMinus1(Int i, Int j, Int k) const { return m_numBspSchedulesMinus1[i][j][k]; } 1059 Void setNumBspSchedulesMinus1(Int i, Int j, Int k, Int val) { m_numBspSchedulesMinus1[i][j][k] = val; } 1060 1061 Int getBspSchedIdx(Int i, Int j, Int k, Int l, Int m) const { return m_bspSchedIdx[i][j][k][l][m]; } 1062 Void setBspSchedIdx(Int i, Int j, Int k, Int l, Int m, Int val) { m_bspSchedIdx[i][j][k][l][m] = val; } 1063 1064 Int getBspHrdIdx(Int i, Int j, Int k, Int l, Int m) const { return m_bspHrdIdx[i][j][k][l][m]; } 1065 Void setBspHrdIdx(Int i, Int j, Int k, Int l, Int m, Int val) { m_bspHrdIdx[i][j][k][l][m] = val; } 1066 #endif 1067 Void setBaseLayerPSCompatibilityFlag (Int layer, Int val) { m_baseLayerPSCompatibilityFlag[layer] = val; } 1068 Int getBaseLayerPSCompatibilityFlag (Int layer) const { return m_baseLayerPSCompatibilityFlag[layer]; } 1069 Bool getAltOuputLayerFlag(Int idx) const { return m_altOutputLayerFlag[idx]; } 1070 Void setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x; } 1071 1072 Bool getRepFormatIdxPresentFlag() const { return m_repFormatIdxPresentFlag; } 1073 Void setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x; } 1074 1075 Int getVpsNumRepFormats() const { return m_vpsNumRepFormats; } 1076 Void setVpsNumRepFormats(Int x) { m_vpsNumRepFormats = x; } 1077 1078 RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } 1079 const RepFormat* getVpsRepFormat(Int idx) const { return &m_vpsRepFormat[idx]; } 1080 1081 Int getVpsRepFormatIdx(Int idx) const { return m_vpsRepFormatIdx[idx]; } 1082 Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; } 1083 1084 Void setViewIdLen( Int val ) { m_viewIdLen = val; } 1085 Int getViewIdLen() const { return m_viewIdLen; } 1086 1087 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 1088 Int getViewIdVal( Int viewOrderIndex ) const { return m_viewIdVal[viewOrderIndex]; } 1089 Int getScalabilityId(Int, ScalabilityType scalType ) const; 1090 1091 Int getViewIndex( Int layerIdInNuh ) const { return getScalabilityId( getLayerIdxInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 1092 1093 Int getNumViews() const; 1094 Int scalTypeToScalIdx( ScalabilityType scalType ) const; 1095 1096 Bool getSubLayerFlagInfoPresentFlag(Int olsIdx) const { return m_subLayerFlagInfoPresentFlag[olsIdx]; } 1097 Void setSubLayerFlagInfoPresentFlag(Int olsIdx, Bool x) { m_subLayerFlagInfoPresentFlag[olsIdx] = x; } 1098 1099 Bool getSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx) const { return m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx]; } 1100 Void setSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx, Bool x) { m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx] = x; } 1081 1101 1082 1102 // For the 0-th output layer set, use the date from the active SPS for base layer. 1083 Int getMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx){ assert(olsIdx != 0); return m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx]; }1084 Void setMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx, Int x) { m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx] = x; }1085 Int getLayerIdcForOls( Int olsIdx, Int layerId );1086 1087 Int getMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx){ assert(olsIdx != 0); return m_maxVpsNumReorderPics[olsIdx][subLayerIdx]; }1088 Void setMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx, Int x){ m_maxVpsNumReorderPics[olsIdx][subLayerIdx] = x; }1089 1090 Int getMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx){ assert(olsIdx != 0); return m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx]; }1091 Void setMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx, Int x){ m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx] = x; }1092 1093 Int getNumSubDpbs(Int olsIdx) { return m_numSubDpbs[olsIdx];}1094 Void setNumSubDpbs(Int olsIdx, Int x) { m_numSubDpbs[olsIdx] = x;}1095 Void determineSubDpbInfoFlags();1096 1097 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag;}1098 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x;}1099 Bool getVpsExtensionFlag() { return m_vpsExtensionFlag;}1100 Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x;}1101 Int getVpsNonVuiExtLength() { return m_vpsNonVuiExtLength;}1102 Void setVpsNonVuiExtLength(Int x) { m_vpsNonVuiExtLength = x;}1103 Int getMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx) const { assert(olsIdx != 0); return m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx]; } 1104 Void setMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx, Int x) { m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx] = x; } 1105 Int getLayerIdcForOls( Int olsIdx, Int layerId ) const; 1106 1107 Int getMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx) const { assert(olsIdx != 0); return m_maxVpsNumReorderPics[olsIdx][subLayerIdx]; } 1108 Void setMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsNumReorderPics[olsIdx][subLayerIdx] = x; } 1109 1110 Int getMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx) const { assert(olsIdx != 0); return m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx]; } 1111 Void setMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx] = x; } 1112 1113 Int getNumSubDpbs(Int olsIdx) const { return m_numSubDpbs[olsIdx]; } 1114 Void setNumSubDpbs(Int olsIdx, Int x) { m_numSubDpbs[olsIdx] = x; } 1115 Void determineSubDpbInfoFlags(); 1116 1117 Bool getVpsVuiPresentFlag() const { return m_vpsVuiPresentFlag; } 1118 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1119 Bool getVpsExtensionFlag() const { return m_vpsExtensionFlag; } 1120 Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x; } 1121 Int getVpsNonVuiExtLength() const { return m_vpsNonVuiExtLength; } 1122 Void setVpsNonVuiExtLength(Int x) { m_vpsNonVuiExtLength = x; } 1103 1123 #if O0164_MULTI_LAYER_HRD 1104 Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); 1105 #endif 1106 Void deriveNecessaryLayerFlag(); 1107 Void deriveNecessaryLayerFlag(Int const olsIdx); 1108 Void checkNecessaryLayerFlagCondition(); 1109 Void calculateMaxSLInLayerSets(); 1124 Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); 1125 #endif 1126 Void deriveNecessaryLayerFlag(); 1127 Void deriveNecessaryLayerFlag(Int const olsIdx); 1128 Void checkNecessaryLayerFlagCondition(); 1129 Void calculateMaxSLInLayerSets(); 1130 1131 ChromaFormat getChromaFormatIdc( const TComSPS* sps, const UInt layerId ) const; 1132 UInt getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const; 1133 UInt getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const; 1134 UInt getBitDepthY( const TComSPS* sps, const UInt layerId ) const; 1135 UInt getBitDepthC( const TComSPS* sps, const UInt layerId ) const; 1136 const Window& getConformanceWindow( const TComSPS* sps, const UInt layerId ) const; 1110 1137 #endif //SVC_EXTENSION 1111 1138 }; … … 1114 1141 { 1115 1142 private: 1116 Bool m_aspectRatioInfoPresentFlag;1117 Int m_aspectRatioIdc;1118 Int m_sarWidth;1119 Int m_sarHeight;1120 Bool m_overscanInfoPresentFlag;1121 Bool m_overscanAppropriateFlag;1122 Bool m_videoSignalTypePresentFlag;1123 Int m_videoFormat;1124 Bool m_videoFullRangeFlag;1125 Bool m_colourDescriptionPresentFlag;1126 Int m_colourPrimaries;1127 Int m_transferCharacteristics;1128 Int m_matrixCoefficients;1129 Bool m_chromaLocInfoPresentFlag;1130 Int m_chromaSampleLocTypeTopField;1131 Int m_chromaSampleLocTypeBottomField;1132 Bool m_neutralChromaIndicationFlag;1133 Bool m_fieldSeqFlag;1134 Window m_defaultDisplayWindow;1135 Bool m_frameFieldInfoPresentFlag;1136 Bool m_hrdParametersPresentFlag;1137 Bool m_bitstreamRestrictionFlag;1138 Bool m_tilesFixedStructureFlag;1139 Bool m_motionVectorsOverPicBoundariesFlag;1140 Bool m_restrictedRefPicListsFlag;1141 Int m_minSpatialSegmentationIdc;1142 Int m_maxBytesPerPicDenom;1143 Int m_maxBitsPerMinCuDenom;1144 Int m_log2MaxMvLengthHorizontal;1145 Int m_log2MaxMvLengthVertical;1146 TComHRD m_hrdParameters;1143 Bool m_aspectRatioInfoPresentFlag; 1144 Int m_aspectRatioIdc; 1145 Int m_sarWidth; 1146 Int m_sarHeight; 1147 Bool m_overscanInfoPresentFlag; 1148 Bool m_overscanAppropriateFlag; 1149 Bool m_videoSignalTypePresentFlag; 1150 Int m_videoFormat; 1151 Bool m_videoFullRangeFlag; 1152 Bool m_colourDescriptionPresentFlag; 1153 Int m_colourPrimaries; 1154 Int m_transferCharacteristics; 1155 Int m_matrixCoefficients; 1156 Bool m_chromaLocInfoPresentFlag; 1157 Int m_chromaSampleLocTypeTopField; 1158 Int m_chromaSampleLocTypeBottomField; 1159 Bool m_neutralChromaIndicationFlag; 1160 Bool m_fieldSeqFlag; 1161 Window m_defaultDisplayWindow; 1162 Bool m_frameFieldInfoPresentFlag; 1163 Bool m_hrdParametersPresentFlag; 1164 Bool m_bitstreamRestrictionFlag; 1165 Bool m_tilesFixedStructureFlag; 1166 Bool m_motionVectorsOverPicBoundariesFlag; 1167 Bool m_restrictedRefPicListsFlag; 1168 Int m_minSpatialSegmentationIdc; 1169 Int m_maxBytesPerPicDenom; 1170 Int m_maxBitsPerMinCuDenom; 1171 Int m_log2MaxMvLengthHorizontal; 1172 Int m_log2MaxMvLengthVertical; 1173 TComHRD m_hrdParameters; 1147 1174 TimingInfo m_timingInfo; 1148 1175 1149 1176 public: 1150 1177 TComVUI() 1151 :m_aspectRatioInfoPresentFlag(false) //TODO: This initialiser list contains magic numbers 1152 ,m_aspectRatioIdc(0) 1153 ,m_sarWidth(0) 1154 ,m_sarHeight(0) 1155 ,m_overscanInfoPresentFlag(false) 1156 ,m_overscanAppropriateFlag(false) 1157 ,m_videoSignalTypePresentFlag(false) 1158 ,m_videoFormat(5) 1159 ,m_videoFullRangeFlag(false) 1160 ,m_colourDescriptionPresentFlag(false) 1161 ,m_colourPrimaries(2) 1162 ,m_transferCharacteristics(2) 1163 ,m_matrixCoefficients(2) 1164 ,m_chromaLocInfoPresentFlag(false) 1165 ,m_chromaSampleLocTypeTopField(0) 1166 ,m_chromaSampleLocTypeBottomField(0) 1167 ,m_neutralChromaIndicationFlag(false) 1168 ,m_fieldSeqFlag(false) 1169 ,m_frameFieldInfoPresentFlag(false) 1170 ,m_hrdParametersPresentFlag(false) 1171 ,m_bitstreamRestrictionFlag(false) 1172 ,m_tilesFixedStructureFlag(false) 1173 ,m_motionVectorsOverPicBoundariesFlag(true) 1174 ,m_restrictedRefPicListsFlag(1) 1175 ,m_minSpatialSegmentationIdc(0) 1176 ,m_maxBytesPerPicDenom(2) 1177 ,m_maxBitsPerMinCuDenom(1) 1178 ,m_log2MaxMvLengthHorizontal(15) 1179 ,m_log2MaxMvLengthVertical(15) 1180 {} 1181 1182 virtual ~TComVUI() {} 1183 1184 Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } 1185 Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } 1186 1187 Int getAspectRatioIdc() { return m_aspectRatioIdc; } 1188 Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } 1189 1190 Int getSarWidth() { return m_sarWidth; } 1191 Void setSarWidth(Int i) { m_sarWidth = i; } 1192 1193 Int getSarHeight() { return m_sarHeight; } 1194 Void setSarHeight(Int i) { m_sarHeight = i; } 1195 1196 Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } 1197 Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } 1198 1199 Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } 1200 Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } 1201 1202 Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } 1203 Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } 1204 1205 Int getVideoFormat() { return m_videoFormat; } 1206 Void setVideoFormat(Int i) { m_videoFormat = i; } 1207 1208 Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } 1209 Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } 1210 1211 Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } 1212 Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } 1213 1214 Int getColourPrimaries() { return m_colourPrimaries; } 1215 Void setColourPrimaries(Int i) { m_colourPrimaries = i; } 1216 1217 Int getTransferCharacteristics() { return m_transferCharacteristics; } 1218 Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } 1219 1220 Int getMatrixCoefficients() { return m_matrixCoefficients; } 1221 Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } 1222 1223 Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } 1224 Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } 1225 1226 Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } 1227 Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } 1228 1229 Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } 1230 Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } 1231 1232 Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } 1233 Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } 1234 1235 Bool getFieldSeqFlag() { return m_fieldSeqFlag; } 1236 Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } 1237 1238 Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } 1239 Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } 1240 1241 Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } 1242 Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } 1243 1244 Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } 1245 Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } 1246 1247 Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } 1248 Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } 1249 1250 Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } 1251 Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } 1252 1253 Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } 1254 Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } 1255 1256 Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } 1257 Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } 1258 1259 Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } 1260 Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } 1261 1262 Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } 1263 Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } 1264 1265 Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } 1266 Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } 1267 1268 Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } 1269 Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } 1270 1271 Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } 1272 Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } 1273 1274 TComHRD* getHrdParameters () { return &m_hrdParameters; } 1275 1276 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1178 : m_aspectRatioInfoPresentFlag (false) //TODO: This initialiser list contains magic numbers 1179 , m_aspectRatioIdc (0) 1180 , m_sarWidth (0) 1181 , m_sarHeight (0) 1182 , m_overscanInfoPresentFlag (false) 1183 , m_overscanAppropriateFlag (false) 1184 , m_videoSignalTypePresentFlag (false) 1185 , m_videoFormat (5) 1186 , m_videoFullRangeFlag (false) 1187 , m_colourDescriptionPresentFlag (false) 1188 , m_colourPrimaries (2) 1189 , m_transferCharacteristics (2) 1190 , m_matrixCoefficients (2) 1191 , m_chromaLocInfoPresentFlag (false) 1192 , m_chromaSampleLocTypeTopField (0) 1193 , m_chromaSampleLocTypeBottomField (0) 1194 , m_neutralChromaIndicationFlag (false) 1195 , m_fieldSeqFlag (false) 1196 , m_frameFieldInfoPresentFlag (false) 1197 , m_hrdParametersPresentFlag (false) 1198 , m_bitstreamRestrictionFlag (false) 1199 , m_tilesFixedStructureFlag (false) 1200 , m_motionVectorsOverPicBoundariesFlag(true) 1201 , m_restrictedRefPicListsFlag (1) 1202 , m_minSpatialSegmentationIdc (0) 1203 , m_maxBytesPerPicDenom (2) 1204 , m_maxBitsPerMinCuDenom (1) 1205 , m_log2MaxMvLengthHorizontal (15) 1206 , m_log2MaxMvLengthVertical (15) 1207 {} 1208 1209 virtual ~TComVUI() {} 1210 1211 Bool getAspectRatioInfoPresentFlag() const { return m_aspectRatioInfoPresentFlag; } 1212 Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } 1213 1214 Int getAspectRatioIdc() const { return m_aspectRatioIdc; } 1215 Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } 1216 1217 Int getSarWidth() const { return m_sarWidth; } 1218 Void setSarWidth(Int i) { m_sarWidth = i; } 1219 1220 Int getSarHeight() const { return m_sarHeight; } 1221 Void setSarHeight(Int i) { m_sarHeight = i; } 1222 1223 Bool getOverscanInfoPresentFlag() const { return m_overscanInfoPresentFlag; } 1224 Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } 1225 1226 Bool getOverscanAppropriateFlag() const { return m_overscanAppropriateFlag; } 1227 Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } 1228 1229 Bool getVideoSignalTypePresentFlag() const { return m_videoSignalTypePresentFlag; } 1230 Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } 1231 1232 Int getVideoFormat() const { return m_videoFormat; } 1233 Void setVideoFormat(Int i) { m_videoFormat = i; } 1234 1235 Bool getVideoFullRangeFlag() const { return m_videoFullRangeFlag; } 1236 Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } 1237 1238 Bool getColourDescriptionPresentFlag() const { return m_colourDescriptionPresentFlag; } 1239 Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } 1240 1241 Int getColourPrimaries() const { return m_colourPrimaries; } 1242 Void setColourPrimaries(Int i) { m_colourPrimaries = i; } 1243 1244 Int getTransferCharacteristics() const { return m_transferCharacteristics; } 1245 Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } 1246 1247 Int getMatrixCoefficients() const { return m_matrixCoefficients; } 1248 Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } 1249 1250 Bool getChromaLocInfoPresentFlag() const { return m_chromaLocInfoPresentFlag; } 1251 Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } 1252 1253 Int getChromaSampleLocTypeTopField() const { return m_chromaSampleLocTypeTopField; } 1254 Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } 1255 1256 Int getChromaSampleLocTypeBottomField() const { return m_chromaSampleLocTypeBottomField; } 1257 Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } 1258 1259 Bool getNeutralChromaIndicationFlag() const { return m_neutralChromaIndicationFlag; } 1260 Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } 1261 1262 Bool getFieldSeqFlag() const { return m_fieldSeqFlag; } 1263 Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } 1264 1265 Bool getFrameFieldInfoPresentFlag() const { return m_frameFieldInfoPresentFlag; } 1266 Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } 1267 1268 Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } 1269 const Window& getDefaultDisplayWindow() const { return m_defaultDisplayWindow; } 1270 Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } 1271 1272 Bool getHrdParametersPresentFlag() const { return m_hrdParametersPresentFlag; } 1273 Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } 1274 1275 Bool getBitstreamRestrictionFlag() const { return m_bitstreamRestrictionFlag; } 1276 Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } 1277 1278 Bool getTilesFixedStructureFlag() const { return m_tilesFixedStructureFlag; } 1279 Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } 1280 1281 Bool getMotionVectorsOverPicBoundariesFlag() const { return m_motionVectorsOverPicBoundariesFlag; } 1282 Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } 1283 1284 Bool getRestrictedRefPicListsFlag() const { return m_restrictedRefPicListsFlag; } 1285 Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } 1286 1287 Int getMinSpatialSegmentationIdc() const { return m_minSpatialSegmentationIdc; } 1288 Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } 1289 1290 Int getMaxBytesPerPicDenom() const { return m_maxBytesPerPicDenom; } 1291 Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } 1292 1293 Int getMaxBitsPerMinCuDenom() const { return m_maxBitsPerMinCuDenom; } 1294 Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } 1295 1296 Int getLog2MaxMvLengthHorizontal() const { return m_log2MaxMvLengthHorizontal; } 1297 Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } 1298 1299 Int getLog2MaxMvLengthVertical() const { return m_log2MaxMvLengthVertical; } 1300 Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } 1301 1302 TComHRD* getHrdParameters() { return &m_hrdParameters; } 1303 const TComHRD* getHrdParameters() const { return &m_hrdParameters; } 1304 1305 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1306 const TimingInfo* getTimingInfo() const { return &m_timingInfo; } 1277 1307 }; 1278 1308 … … 1281 1311 { 1282 1312 private: 1283 Int m_SPSId;1284 Int m_VPSId;1285 ChromaFormat m_chromaFormatIdc;1286 1287 UInt m_uiMaxTLayers; // maximum number of temporal layers1313 Int m_SPSId; 1314 Int m_VPSId; 1315 ChromaFormat m_chromaFormatIdc; 1316 1317 UInt m_uiMaxTLayers; // maximum number of temporal layers 1288 1318 1289 1319 // Structure 1290 UInt m_picWidthInLumaSamples;1291 UInt m_picHeightInLumaSamples;1292 1293 Int m_log2MinCodingBlockSize;1294 Int m_log2DiffMaxMinCodingBlockSize;1295 UInt m_uiMaxCUWidth;1296 UInt m_uiMaxCUHeight;1297 UInt m_uiMaxCUDepth;1298 1299 Window m_conformanceWindow;1300 1301 TComRPSList m_RPSList;1302 Bool m_bLongTermRefsPresent;1303 Bool m_TMVPFlagsPresent;1304 Int m_numReorderPics[MAX_TLAYER];1320 UInt m_picWidthInLumaSamples; 1321 UInt m_picHeightInLumaSamples; 1322 1323 Int m_log2MinCodingBlockSize; 1324 Int m_log2DiffMaxMinCodingBlockSize; 1325 UInt m_uiMaxCUWidth; 1326 UInt m_uiMaxCUHeight; 1327 UInt m_uiMaxCUDepth; 1328 1329 Window m_conformanceWindow; 1330 1331 TComRPSList m_RPSList; 1332 Bool m_bLongTermRefsPresent; 1333 Bool m_TMVPFlagsPresent; 1334 Int m_numReorderPics[MAX_TLAYER]; 1305 1335 1306 1336 // Tool list 1307 UInt m_uiQuadtreeTULog2MaxSize;1308 UInt m_uiQuadtreeTULog2MinSize;1309 UInt m_uiQuadtreeTUMaxDepthInter;1310 UInt m_uiQuadtreeTUMaxDepthIntra;1311 Bool m_usePCM;1312 UInt m_pcmLog2MaxSize;1313 UInt m_uiPCMLog2MinSize;1314 Bool m_useAMP;1337 UInt m_uiQuadtreeTULog2MaxSize; 1338 UInt m_uiQuadtreeTULog2MinSize; 1339 UInt m_uiQuadtreeTUMaxDepthInter; 1340 UInt m_uiQuadtreeTUMaxDepthIntra; 1341 Bool m_usePCM; 1342 UInt m_pcmLog2MaxSize; 1343 UInt m_uiPCMLog2MinSize; 1344 Bool m_useAMP; 1315 1345 1316 1346 // Parameter 1317 Int m_uiBitDepth[MAX_NUM_CHANNEL_TYPE];1318 Int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE];1319 Bool m_useExtendedPrecision;1320 Bool m_useHighPrecisionPredictionWeighting;1321 Bool m_useResidualRotation;1322 Bool m_useSingleSignificanceMapContext;1323 Bool m_useGolombRiceParameterAdaptation;1324 Bool m_alignCABACBeforeBypass;1325 Bool m_useResidualDPCM[NUMBER_OF_RDPCM_SIGNALLING_MODES];1326 UInt m_uiPCMBitDepth[MAX_NUM_CHANNEL_TYPE];1327 Bool m_bPCMFilterDisableFlag;1328 Bool m_disableIntraReferenceSmoothing;1329 1330 UInt m_uiBitsForPOC;1331 UInt m_numLongTermRefPicSPS;1332 UInt m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];1333 Bool m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS];1347 Int m_uiBitDepth[MAX_NUM_CHANNEL_TYPE]; 1348 Int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE]; 1349 Bool m_useExtendedPrecision; 1350 Bool m_useHighPrecisionPredictionWeighting; 1351 Bool m_useResidualRotation; 1352 Bool m_useSingleSignificanceMapContext; 1353 Bool m_useGolombRiceParameterAdaptation; 1354 Bool m_alignCABACBeforeBypass; 1355 Bool m_useResidualDPCM[NUMBER_OF_RDPCM_SIGNALLING_MODES]; 1356 UInt m_uiPCMBitDepth[MAX_NUM_CHANNEL_TYPE]; 1357 Bool m_bPCMFilterDisableFlag; 1358 Bool m_disableIntraReferenceSmoothing; 1359 1360 UInt m_uiBitsForPOC; 1361 UInt m_numLongTermRefPicSPS; 1362 UInt m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS]; 1363 Bool m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS]; 1334 1364 // Max physical transform size 1335 UInt m_uiMaxTrSize; 1336 1337 Int m_iAMPAcc[MAX_CU_DEPTH]; 1338 Bool m_bUseSAO; 1339 1340 Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag 1341 1342 Bool m_scalingListEnabledFlag; 1343 Bool m_scalingListPresentFlag; 1344 TComScalingList* m_scalingList; //!< ScalingList class pointer 1345 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 1346 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) 1347 1348 Bool m_useDF; 1349 Bool m_useStrongIntraSmoothing; 1350 1351 Bool m_vuiParametersPresentFlag; 1352 TComVUI m_vuiParameters; 1353 1354 static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; 1355 static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; 1356 TComPTL m_pcPTL; 1365 UInt m_uiMaxTrSize; 1366 1367 Bool m_bUseSAO; 1368 1369 Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag 1370 1371 Bool m_scalingListEnabledFlag; 1372 Bool m_scalingListPresentFlag; 1373 TComScalingList m_scalingList; 1374 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 1375 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) 1376 1377 Bool m_useStrongIntraSmoothing; 1378 1379 Bool m_vuiParametersPresentFlag; 1380 TComVUI m_vuiParameters; 1381 1382 static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; 1383 static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; 1384 TComPTL m_pcPTL; 1357 1385 1358 1386 #if O0043_BEST_EFFORT_DECODING 1359 UInt m_forceDecodeBitDepth; // 0 = do not force the decoder's bit depth, other = force the decoder's bit depth to this value (best effort decoding)1387 UInt m_forceDecodeBitDepth; // 0 = do not force the decoder's bit depth, other = force the decoder's bit depth to this value (best effort decoding) 1360 1388 #endif 1361 1389 1362 1390 #if SVC_EXTENSION 1363 UInt m_layerId;1364 Bool m_extensionFlag;1365 Bool m_bV1CompatibleSPSFlag;1366 UInt m_numScaledRefLayerOffsets;1367 Bool m_multiLayerExtSpsFlag;1368 Int m_NumDirectRefLayers;1369 Bool m_updateRepFormatFlag;1370 UInt m_updateRepFormatIndex;1371 Bool m_inferScalingListFlag;1372 UInt m_scalingListRefLayerId;1391 UInt m_layerId; 1392 Bool m_extensionFlag; 1393 Bool m_bV1CompatibleSPSFlag; 1394 UInt m_numScaledRefLayerOffsets; 1395 Bool m_multiLayerExtSpsFlag; 1396 Int m_NumDirectRefLayers; 1397 Bool m_updateRepFormatFlag; 1398 UInt m_updateRepFormatIndex; 1399 Bool m_inferScalingListFlag; 1400 UInt m_scalingListRefLayerId; 1373 1401 #endif //SVC_EXTENSION 1374 1402 1375 1403 public: 1376 TComSPS();1377 virtual ~TComSPS();1404 TComSPS(); 1405 virtual ~TComSPS(); 1378 1406 #if O0043_BEST_EFFORT_DECODING 1379 Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth;}1380 UInt getForceDecodeBitDepth() const { return m_forceDecodeBitDepth;}1381 #endif 1382 1383 Int getVPSId () { return m_VPSId;}1384 Void setVPSId (Int i) { m_VPSId = i;}1385 Int getSPSId () { return m_SPSId;}1386 Void setSPSId (Int i) { m_SPSId = i;}1387 ChromaFormat getChromaFormatIdc () { return m_chromaFormatIdc;}1388 Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i;}1389 1390 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc];}1391 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc];}1407 Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; } 1408 UInt getForceDecodeBitDepth() const { return m_forceDecodeBitDepth; } 1409 #endif 1410 1411 Int getVPSId() const { return m_VPSId; } 1412 Void setVPSId(Int i) { m_VPSId = i; } 1413 Int getSPSId() const { return m_SPSId; } 1414 Void setSPSId(Int i) { m_SPSId = i; } 1415 ChromaFormat getChromaFormatIdc () const { return m_chromaFormatIdc; } 1416 Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; } 1417 1418 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1419 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1392 1420 1393 1421 // structure 1394 Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } 1395 UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } 1396 Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } 1397 UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } 1398 1399 Window& getConformanceWindow() { return m_conformanceWindow; } 1400 Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } 1401 1402 UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } 1403 Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } 1404 1405 UInt getLtRefPicPocLsbSps(UInt index) { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); return m_ltRefPicPocLsbSps[index]; } 1406 Void setLtRefPicPocLsbSps(UInt index, UInt val) { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); m_ltRefPicPocLsbSps[index] = val; } 1407 1408 Bool getUsedByCurrPicLtSPSFlag(Int i) { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); return m_usedByCurrPicLtSPSFlag[i];} 1409 Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); m_usedByCurrPicLtSPSFlag[i] = x;} 1410 1411 Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } 1412 Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } 1413 Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } 1414 Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } 1415 1416 Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } 1417 UInt getMaxCUWidth () { return m_uiMaxCUWidth; } 1418 Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } 1419 UInt getMaxCUHeight () { return m_uiMaxCUHeight; } 1420 Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } 1421 UInt getMaxCUDepth () { return m_uiMaxCUDepth; } 1422 Void setUsePCM ( Bool b ) { m_usePCM = b; } 1423 Bool getUsePCM () { return m_usePCM; } 1424 Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } 1425 UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } 1426 Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } 1427 UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } 1428 Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } 1429 UInt getBitsForPOC () { return m_uiBitsForPOC; } 1430 Bool getUseAMP() { return m_useAMP; } 1431 Void setUseAMP( Bool b ) { m_useAMP = b; } 1432 Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } 1433 UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } 1434 Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } 1435 UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } 1436 Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } 1437 Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } 1438 UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } 1439 UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } 1440 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 1441 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } 1442 Void createRPSList( Int numRPS ); 1443 TComRPSList* getRPSList() { return &m_RPSList; } 1444 Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } 1445 Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } 1446 Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } 1447 Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } 1422 Void setPicWidthInLumaSamples( UInt u ) { m_picWidthInLumaSamples = u; } 1423 UInt getPicWidthInLumaSamples() const { return m_picWidthInLumaSamples; } 1424 Void setPicHeightInLumaSamples( UInt u ) { m_picHeightInLumaSamples = u; } 1425 UInt getPicHeightInLumaSamples() const { return m_picHeightInLumaSamples; } 1426 1427 Window& getConformanceWindow() { return m_conformanceWindow; } 1428 const Window& getConformanceWindow() const { return m_conformanceWindow; } 1429 Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } 1430 1431 UInt getNumLongTermRefPicSPS() const { return m_numLongTermRefPicSPS; } 1432 Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } 1433 1434 UInt getLtRefPicPocLsbSps(UInt index) const { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); return m_ltRefPicPocLsbSps[index]; } 1435 Void setLtRefPicPocLsbSps(UInt index, UInt val) { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); m_ltRefPicPocLsbSps[index] = val; } 1436 1437 Bool getUsedByCurrPicLtSPSFlag(Int i) const { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); return m_usedByCurrPicLtSPSFlag[i]; } 1438 Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); m_usedByCurrPicLtSPSFlag[i] = x; } 1439 1440 Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } 1441 Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } 1442 Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } 1443 Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } 1444 1445 Void setMaxCUWidth( UInt u ) { m_uiMaxCUWidth = u; } 1446 UInt getMaxCUWidth() const { return m_uiMaxCUWidth; } 1447 Void setMaxCUHeight( UInt u ) { m_uiMaxCUHeight = u; } 1448 UInt getMaxCUHeight() const { return m_uiMaxCUHeight; } 1449 Void setMaxCUDepth( UInt u ) { m_uiMaxCUDepth = u; } 1450 UInt getMaxCUDepth() const { return m_uiMaxCUDepth; } 1451 Void setUsePCM( Bool b ) { m_usePCM = b; } 1452 Bool getUsePCM() const { return m_usePCM; } 1453 Void setPCMLog2MaxSize( UInt u ) { m_pcmLog2MaxSize = u; } 1454 UInt getPCMLog2MaxSize() const { return m_pcmLog2MaxSize; } 1455 Void setPCMLog2MinSize( UInt u ) { m_uiPCMLog2MinSize = u; } 1456 UInt getPCMLog2MinSize() const { return m_uiPCMLog2MinSize; } 1457 Void setBitsForPOC( UInt u ) { m_uiBitsForPOC = u; } 1458 UInt getBitsForPOC() const { return m_uiBitsForPOC; } 1459 Bool getUseAMP() const { return m_useAMP; } 1460 Void setUseAMP( Bool b ) { m_useAMP = b; } 1461 Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } 1462 UInt getQuadtreeTULog2MaxSize() const { return m_uiQuadtreeTULog2MaxSize; } 1463 Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } 1464 UInt getQuadtreeTULog2MinSize() const { return m_uiQuadtreeTULog2MinSize; } 1465 Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } 1466 Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } 1467 UInt getQuadtreeTUMaxDepthInter() const { return m_uiQuadtreeTUMaxDepthInter; } 1468 UInt getQuadtreeTUMaxDepthIntra() const { return m_uiQuadtreeTUMaxDepthIntra; } 1469 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 1470 Int getNumReorderPics(UInt tlayer) const { return m_numReorderPics[tlayer]; } 1471 Void createRPSList( Int numRPS ); 1472 const TComRPSList* getRPSList() const { return &m_RPSList; } 1473 TComRPSList* getRPSList() { return &m_RPSList; } 1474 Bool getLongTermRefsPresent() const { return m_bLongTermRefsPresent; } 1475 Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } 1476 Bool getTMVPFlagsPresent() const { return m_TMVPFlagsPresent; } 1477 Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } 1448 1478 // physical transform 1449 Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } 1450 UInt getMaxTrSize () { return m_uiMaxTrSize; } 1451 1452 // AMP accuracy 1453 Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } 1454 Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } 1479 Void setMaxTrSize( UInt u ) { m_uiMaxTrSize = u; } 1480 UInt getMaxTrSize() const { return m_uiMaxTrSize; } 1455 1481 1456 1482 // Bit-depth 1457 Int getBitDepth (ChannelType type) { return m_uiBitDepth[type]; } 1458 Void setBitDepth (ChannelType type, Int u ) { m_uiBitDepth[type] = u; } 1459 Int getDifferentialLumaChromaBitDepth() const { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); } 1460 Int getQpBDOffset (ChannelType type) const { return m_qpBDOffset[type]; } 1461 Void setQpBDOffset (ChannelType type, Int i) { m_qpBDOffset[type] = i; } 1462 Bool getUseExtendedPrecision() const { return m_useExtendedPrecision; } 1463 Void setUseExtendedPrecision(Bool value) { m_useExtendedPrecision = value; } 1464 Bool getUseHighPrecisionPredictionWeighting() const { return m_useHighPrecisionPredictionWeighting; } 1465 Void setUseHighPrecisionPredictionWeighting(Bool value) { m_useHighPrecisionPredictionWeighting = value; } 1466 1467 Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} 1468 Bool getUseSAO () {return m_bUseSAO;} 1469 1470 Bool getUseResidualRotation () const { return m_useResidualRotation; } 1471 Void setUseResidualRotation (const Bool value) { m_useResidualRotation = value; } 1472 1473 Bool getUseSingleSignificanceMapContext() const { return m_useSingleSignificanceMapContext; } 1474 Void setUseSingleSignificanceMapContext(const Bool value) { m_useSingleSignificanceMapContext = value; } 1475 1476 Bool getUseGolombRiceParameterAdaptation() const { return m_useGolombRiceParameterAdaptation; } 1477 Void setUseGolombRiceParameterAdaptation(const Bool value) { m_useGolombRiceParameterAdaptation = value; } 1478 1479 Bool getAlignCABACBeforeBypass () const { return m_alignCABACBeforeBypass; } 1480 Void setAlignCABACBeforeBypass (const Bool value) { m_alignCABACBeforeBypass = value; } 1481 1482 Bool getUseResidualDPCM (const RDPCMSignallingMode signallingMode) const { return m_useResidualDPCM[signallingMode]; } 1483 Void setUseResidualDPCM (const RDPCMSignallingMode signallingMode, const Bool value) { m_useResidualDPCM[signallingMode] = value; } 1484 1485 UInt getMaxTLayers() { return m_uiMaxTLayers; } 1486 Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } 1487 1488 Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } 1489 Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } 1490 UInt getPCMBitDepth (ChannelType type) const { return m_uiPCMBitDepth[type]; } 1491 Void setPCMBitDepth (ChannelType type, UInt u) { m_uiPCMBitDepth[type] = u; } 1492 Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } 1493 Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } 1494 Void setDisableIntraReferenceSmoothing (Bool bValue) { m_disableIntraReferenceSmoothing=bValue; } 1495 Bool getDisableIntraReferenceSmoothing () const { return m_disableIntraReferenceSmoothing; } 1496 1497 Bool getScalingListFlag () { return m_scalingListEnabledFlag; } 1498 Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } 1499 Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } 1500 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1483 Int getBitDepth(ChannelType type) const { return m_uiBitDepth[type]; } 1484 Void setBitDepth(ChannelType type, Int u ) { m_uiBitDepth[type] = u; } 1485 Int getDifferentialLumaChromaBitDepth() const { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); } 1486 Int getQpBDOffset(ChannelType type) const { return m_qpBDOffset[type]; } 1487 Void setQpBDOffset(ChannelType type, Int i) { m_qpBDOffset[type] = i; } 1488 Bool getUseExtendedPrecision() const { return m_useExtendedPrecision; } 1489 Void setUseExtendedPrecision(Bool value) { m_useExtendedPrecision = value; } 1490 Bool getUseHighPrecisionPredictionWeighting() const { return m_useHighPrecisionPredictionWeighting; } 1491 Void setUseHighPrecisionPredictionWeighting(Bool value) { m_useHighPrecisionPredictionWeighting = value; } 1492 1493 Void setUseSAO(Bool bVal) { m_bUseSAO = bVal; } 1494 Bool getUseSAO() const { return m_bUseSAO; } 1495 1496 Bool getUseResidualRotation() const { return m_useResidualRotation; } 1497 Void setUseResidualRotation(const Bool value) { m_useResidualRotation = value; } 1498 1499 Bool getUseSingleSignificanceMapContext() const { return m_useSingleSignificanceMapContext; } 1500 Void setUseSingleSignificanceMapContext(const Bool value) { m_useSingleSignificanceMapContext = value; } 1501 1502 Bool getUseGolombRiceParameterAdaptation() const { return m_useGolombRiceParameterAdaptation; } 1503 Void setUseGolombRiceParameterAdaptation(const Bool value) { m_useGolombRiceParameterAdaptation = value; } 1504 1505 Bool getAlignCABACBeforeBypass() const { return m_alignCABACBeforeBypass; } 1506 Void setAlignCABACBeforeBypass(const Bool value) { m_alignCABACBeforeBypass = value; } 1507 1508 Bool getUseResidualDPCM(const RDPCMSignallingMode signallingMode) const { return m_useResidualDPCM[signallingMode]; } 1509 Void setUseResidualDPCM(const RDPCMSignallingMode signallingMode, const Bool value) { m_useResidualDPCM[signallingMode] = value; } 1510 1511 UInt getMaxTLayers() const { return m_uiMaxTLayers; } 1512 Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } 1513 1514 Bool getTemporalIdNestingFlag() const { return m_bTemporalIdNestingFlag; } 1515 Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } 1516 UInt getPCMBitDepth(ChannelType type) const { return m_uiPCMBitDepth[type]; } 1517 Void setPCMBitDepth(ChannelType type, UInt u) { m_uiPCMBitDepth[type] = u; } 1518 Void setPCMFilterDisableFlag( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } 1519 Bool getPCMFilterDisableFlag() const { return m_bPCMFilterDisableFlag; } 1520 Void setDisableIntraReferenceSmoothing(Bool bValue) { m_disableIntraReferenceSmoothing=bValue; } 1521 Bool getDisableIntraReferenceSmoothing() const { return m_disableIntraReferenceSmoothing; } 1522 1523 Bool getScalingListFlag() const { return m_scalingListEnabledFlag; } 1524 Void setScalingListFlag( Bool b ) { m_scalingListEnabledFlag = b; } 1525 Bool getScalingListPresentFlag() const { return m_scalingListPresentFlag; } 1526 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1527 1528 Void setScalingList( TComScalingList *scalingList); 1529 TComScalingList& getScalingList() { return m_scalingList; } 1530 const TComScalingList& getScalingList() const { return m_scalingList; } 1531 UInt getMaxDecPicBuffering(UInt tlayer) const { return m_uiMaxDecPicBuffering[tlayer]; } 1532 Void setMaxDecPicBuffering( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } 1533 UInt getMaxLatencyIncrease(UInt tlayer) const { return m_uiMaxLatencyIncrease[tlayer]; } 1534 Void setMaxLatencyIncrease( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } 1535 1536 Void setUseStrongIntraSmoothing(Bool bVal) { m_useStrongIntraSmoothing = bVal; } 1537 Bool getUseStrongIntraSmoothing() const { return m_useStrongIntraSmoothing; } 1538 1539 Bool getVuiParametersPresentFlag() const { return m_vuiParametersPresentFlag; } 1540 Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } 1541 TComVUI* getVuiParameters() { return &m_vuiParameters; } 1542 const TComVUI* getVuiParameters() const { return &m_vuiParameters; } 1543 Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); 1544 1545 const TComPTL* getPTL() const { return &m_pcPTL; } 1546 TComPTL* getPTL() { return &m_pcPTL; } 1501 1547 1502 1548 #if SVC_EXTENSION 1503 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } 1504 #else 1505 Void setScalingList ( TComScalingList *scalingList); 1506 #endif 1507 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS 1508 UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } 1509 Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } 1510 UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } 1511 Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } 1512 1513 Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} 1514 Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} 1515 1516 Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } 1517 Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } 1518 TComVUI* getVuiParameters() { return &m_vuiParameters; } 1519 Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); 1520 1521 TComPTL* getPTL() { return &m_pcPTL; } 1522 1523 #if SVC_EXTENSION 1524 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1525 UInt getLayerId() { return m_layerId; } 1526 Int getExtensionFlag() { return m_extensionFlag; } 1527 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1528 Bool getMultiLayerExtSpsFlag() { return m_multiLayerExtSpsFlag; } 1529 Void setMultiLayerExtSpsFlag(Bool flag) { m_multiLayerExtSpsFlag = flag; } 1549 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1550 UInt getLayerId() const { return m_layerId; } 1551 Int getExtensionFlag() const { return m_extensionFlag; } 1552 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1553 Bool getMultiLayerExtSpsFlag() const { return m_multiLayerExtSpsFlag; } 1554 Void setMultiLayerExtSpsFlag(Bool flag) { m_multiLayerExtSpsFlag = flag; } 1530 1555 1531 1556 //These two functions shall be used / called when the syntax element sps_ext_or_max_sub_layers_minus1 and V1CompatibleSPSFlag are implemented 1532 Bool getV1CompatibleSPSFlag() { return m_bV1CompatibleSPSFlag;}1533 Void setV1CompatibleSPSFlag(Bool x) { m_bV1CompatibleSPSFlag = x;}1534 1535 Int getNumDirectRefLayers() { return m_NumDirectRefLayers;}1536 Void setNumDirectRefLayers(Int n) { m_NumDirectRefLayers = n;}1537 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag;}1538 Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x;}1539 Int getUpdateRepFormatIndex() { return m_updateRepFormatIndex;}1540 Void setUpdateRepFormatIndex(UInt index) { m_updateRepFormatIndex = index;}1541 Bool getInferScalingListFlag() { return m_inferScalingListFlag;}1542 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId;}1543 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag;}1544 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId;}1557 Bool getV1CompatibleSPSFlag() const { return m_bV1CompatibleSPSFlag; } 1558 Void setV1CompatibleSPSFlag(Bool x) { m_bV1CompatibleSPSFlag = x; } 1559 1560 Int getNumDirectRefLayers() const { return m_NumDirectRefLayers; } 1561 Void setNumDirectRefLayers(Int n) { m_NumDirectRefLayers = n; } 1562 Bool getUpdateRepFormatFlag() const { return m_updateRepFormatFlag; } 1563 Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } 1564 Int getUpdateRepFormatIndex() const { return m_updateRepFormatIndex; } 1565 Void setUpdateRepFormatIndex(UInt index) { m_updateRepFormatIndex = index; } 1566 Bool getInferScalingListFlag() const { return m_inferScalingListFlag; } 1567 UInt getScalingListRefLayerId() const { return m_scalingListRefLayerId; } 1568 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1569 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1545 1570 #endif //SVC_EXTENSION 1546 1571 }; … … 1551 1576 { 1552 1577 private: 1553 Bool 1554 Bool 1555 UInt 1556 UInt 1578 Bool m_refPicListModificationFlagL0; 1579 Bool m_refPicListModificationFlagL1; 1580 UInt m_RefPicSetIdxL0[REF_PIC_LIST_NUM_IDX]; 1581 UInt m_RefPicSetIdxL1[REF_PIC_LIST_NUM_IDX]; 1557 1582 1558 1583 public: 1559 TComRefPicListModification();1584 TComRefPicListModification(); 1560 1585 virtual ~TComRefPicListModification(); 1561 1586 1562 Void create();1563 Void destroy();1564 1565 Bool getRefPicListModificationFlagL0() { return m_refPicListModificationFlagL0;}1566 Void setRefPicListModificationFlagL0(Bool flag) { m_refPicListModificationFlagL0 = flag;}1567 Bool getRefPicListModificationFlagL1() { return m_refPicListModificationFlagL1;}1568 Void setRefPicListModificationFlagL1(Bool flag) { m_refPicListModificationFlagL1 = flag;}1569 Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL0[idx] = refPicSetIdx;}1570 UInt getRefPicSetIdxL0(UInt idx) { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[idx]; }1571 Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx;}1572 UInt getRefPicSetIdxL1(UInt idx) { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[idx]; }1587 Void create(); 1588 Void destroy(); 1589 1590 Bool getRefPicListModificationFlagL0() const { return m_refPicListModificationFlagL0; } 1591 Void setRefPicListModificationFlagL0(Bool flag) { m_refPicListModificationFlagL0 = flag; } 1592 Bool getRefPicListModificationFlagL1() const { return m_refPicListModificationFlagL1; } 1593 Void setRefPicListModificationFlagL1(Bool flag) { m_refPicListModificationFlagL1 = flag; } 1594 UInt getRefPicSetIdxL0(UInt idx) const { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[idx]; } 1595 Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL0[idx] = refPicSetIdx; } 1596 UInt getRefPicSetIdxL1(UInt idx) const { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[idx]; } 1597 Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; } 1573 1598 }; 1599 1574 1600 1575 1601 /// PPS class … … 1577 1603 { 1578 1604 private: 1579 Int m_PPSId; // pic_parameter_set_id1580 Int m_SPSId; // seq_parameter_set_id1581 Int m_picInitQPMinus26;1582 Bool m_useDQP;1583 Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag1584 Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag1605 Int m_PPSId; // pic_parameter_set_id 1606 Int m_SPSId; // seq_parameter_set_id 1607 Int m_picInitQPMinus26; 1608 Bool m_useDQP; 1609 Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag 1610 Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag 1585 1611 1586 1612 // access channel 1587 TComSPS* m_pcSPS; 1588 UInt m_uiMaxCuDQPDepth; 1589 UInt m_uiMinCuDQPSize; 1590 1591 /* Chroma QP Adjustments*/ 1592 Int m_MaxCuChromaQpAdjDepth; 1593 Int m_MinCuChromaQpAdjSize; 1594 Int m_ChromaQpAdjTableSize; 1595 ChromaQpAdj m_ChromaQpAdjTable[7]; 1596 1597 Int m_chromaCbQpOffset; 1598 Int m_chromaCrQpOffset; 1599 1600 UInt m_numRefIdxL0DefaultActive; 1601 UInt m_numRefIdxL1DefaultActive; 1602 1603 Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) 1604 Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) 1605 Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header 1606 Bool m_useCrossComponentPrediction; 1607 UInt m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE]; 1608 Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. 1609 Bool m_useTransformSkip; 1610 Int m_transformSkipLog2MaxSize; 1611 Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices 1612 Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles 1613 Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts 1613 UInt m_uiMaxCuDQPDepth; 1614 1615 // Chroma QP Adjustments 1616 Int m_MaxCuChromaQpAdjDepth; 1617 Int m_ChromaQpAdjTableSize; 1618 ChromaQpAdj m_ChromaQpAdjTable[7]; 1619 1620 Int m_chromaCbQpOffset; 1621 Int m_chromaCrQpOffset; 1622 1623 UInt m_numRefIdxL0DefaultActive; 1624 UInt m_numRefIdxL1DefaultActive; 1625 1626 Bool m_bUseWeightPred; //!< Use of Weighting Prediction (P_SLICE) 1627 Bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE) 1628 Bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header 1629 Bool m_useCrossComponentPrediction; 1630 UInt m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE]; 1631 Bool m_TransquantBypassEnableFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs. 1632 Bool m_useTransformSkip; 1633 Int m_transformSkipLog2MaxSize; 1634 Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices 1635 Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles 1636 Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts 1614 1637 1615 1638 Bool m_loopFilterAcrossTilesEnabledFlag; … … 1620 1643 std::vector<Int> m_tileRowHeight; 1621 1644 1622 Int m_numSubstreams; 1623 1624 Bool m_signHideFlag; 1625 1626 Bool m_cabacInitPresentFlag; 1627 UInt m_encCABACTableIdx; // Used to transmit table selection across slices 1628 1629 Bool m_sliceHeaderExtensionPresentFlag; 1630 Bool m_loopFilterAcrossSlicesEnabledFlag; 1631 Bool m_deblockingFilterControlPresentFlag; 1632 Bool m_deblockingFilterOverrideEnabledFlag; 1633 Bool m_picDisableDeblockingFilterFlag; 1634 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1635 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1636 Bool m_scalingListPresentFlag; 1637 TComScalingList* m_scalingList; //!< ScalingList class pointer 1638 Bool m_listsModificationPresentFlag; 1639 UInt m_log2ParallelMergeLevelMinus2; 1640 Int m_numExtraSliceHeaderBits; 1645 Bool m_signHideFlag; 1646 1647 Bool m_cabacInitPresentFlag; 1648 1649 Bool m_sliceHeaderExtensionPresentFlag; 1650 Bool m_loopFilterAcrossSlicesEnabledFlag; 1651 Bool m_deblockingFilterControlPresentFlag; 1652 Bool m_deblockingFilterOverrideEnabledFlag; 1653 Bool m_picDisableDeblockingFilterFlag; 1654 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1655 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1656 Bool m_scalingListPresentFlag; 1657 TComScalingList m_scalingList; //!< ScalingList class 1658 Bool m_listsModificationPresentFlag; 1659 UInt m_log2ParallelMergeLevelMinus2; 1660 Int m_numExtraSliceHeaderBits; 1641 1661 1642 1662 #if SVC_EXTENSION 1643 Bool m_extensionFlag; 1644 UInt m_layerId; 1645 Bool m_inferScalingListFlag; 1646 UInt m_scalingListRefLayerId; 1647 Bool m_pocResetInfoPresentFlag; 1648 UInt m_numRefLayerLocationOffsets; 1649 UInt m_refLocationOffsetLayerId[MAX_LAYERS]; 1650 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1651 Window m_refLayerWindow[MAX_LAYERS]; 1652 Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; 1653 Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; 1654 Int m_phaseHorLuma[MAX_LAYERS]; 1655 Int m_phaseVerLuma[MAX_LAYERS]; 1656 Int m_phaseHorChroma[MAX_LAYERS]; 1657 Int m_phaseVerChroma[MAX_LAYERS]; 1658 Bool m_resamplePhaseSetPresentFlag[MAX_LAYERS]; 1663 Bool m_extensionFlag; 1664 UInt m_layerId; 1665 Bool m_inferScalingListFlag; 1666 UInt m_scalingListRefLayerId; 1667 Bool m_pocResetInfoPresentFlag; 1668 UInt m_numRefLayerLocationOffsets; 1669 UInt m_refLocationOffsetLayerId[MAX_LAYERS]; 1670 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1671 Window m_refLayerWindow[MAX_LAYERS]; 1672 Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; 1673 Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; 1674 ResamplingPhase m_resamplingPhase[MAX_LAYERS]; 1659 1675 #if CGS_3D_ASYMLUT 1660 Int m_nCGSFlag;1661 Int m_nCGSOutputBitDepthY; // not for syntax1662 Int m_nCGSOutputBitDepthC; // not for syntax1676 Int m_nCGSFlag; 1677 Int m_nCGSOutputBitDepthY; // not for syntax 1678 Int m_nCGSOutputBitDepthC; // not for syntax 1663 1679 #endif 1664 1680 #endif 1665 1681 1666 1682 public: 1667 TComPPS(); 1668 virtual ~TComPPS(); 1669 1670 Int getPPSId () { return m_PPSId; } 1671 Void setPPSId (Int i) { m_PPSId = i; } 1672 Int getSPSId () { return m_SPSId; } 1673 Void setSPSId (Int i) { m_SPSId = i; } 1674 1675 Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } 1676 Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } 1677 Bool getUseDQP () { return m_useDQP; } 1678 Void setUseDQP ( Bool b ) { m_useDQP = b; } 1679 Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } 1680 Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } 1681 Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } 1682 Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } 1683 1684 Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } 1685 TComSPS* getSPS () { return m_pcSPS; } 1686 Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } 1687 UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} 1688 Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } 1689 UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } 1690 1691 Void setQpOffset(ComponentID compID, Int i ) { if (compID==COMPONENT_Cb) m_chromaCbQpOffset = i; else if (compID==COMPONENT_Cr) m_chromaCrQpOffset = i; else assert(0); } 1692 Int getQpOffset(ComponentID compID) const { return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset ); } 1693 1694 Void setMaxCuChromaQpAdjDepth ( UInt u ) { m_MaxCuChromaQpAdjDepth = u; } 1695 UInt getMaxCuChromaQpAdjDepth () { return m_MaxCuChromaQpAdjDepth; } 1696 Void setMinCuChromaQpAdjSize ( UInt u ) { m_MinCuChromaQpAdjSize = u; } 1697 UInt getMinCuChromaQpAdjSize () { return m_MinCuChromaQpAdjSize; } 1698 Void clearChromaQpAdjTable() { m_ChromaQpAdjTableSize = 0; } 1699 Int getChromaQpAdjTableSize() { return m_ChromaQpAdjTableSize; } 1700 const ChromaQpAdj& getChromaQpAdjTableAt( Int idx ) const { return m_ChromaQpAdjTable[idx]; } 1701 Void setChromaQpAdjTableAt( Int idx, Int cbOffset, Int crOffset ) 1683 TComPPS(); 1684 virtual ~TComPPS(); 1685 1686 Int getPPSId() const { return m_PPSId; } 1687 Void setPPSId(Int i) { m_PPSId = i; } 1688 Int getSPSId() const { return m_SPSId; } 1689 Void setSPSId(Int i) { m_SPSId = i; } 1690 1691 Int getPicInitQPMinus26() const { return m_picInitQPMinus26; } 1692 Void setPicInitQPMinus26( Int i ) { m_picInitQPMinus26 = i; } 1693 Bool getUseDQP() const { return m_useDQP; } 1694 Void setUseDQP( Bool b ) { m_useDQP = b; } 1695 Bool getConstrainedIntraPred() const { return m_bConstrainedIntraPred; } 1696 Void setConstrainedIntraPred( Bool b ) { m_bConstrainedIntraPred = b; } 1697 Bool getSliceChromaQpFlag() const { return m_bSliceChromaQpFlag; } 1698 Void setSliceChromaQpFlag( Bool b ) { m_bSliceChromaQpFlag = b; } 1699 1700 Void setMaxCuDQPDepth( UInt u ) { m_uiMaxCuDQPDepth = u; } 1701 UInt getMaxCuDQPDepth() const { return m_uiMaxCuDQPDepth; } 1702 1703 Void setQpOffset(ComponentID compID, Int i ) 1704 { 1705 if (compID==COMPONENT_Cb) 1706 { 1707 m_chromaCbQpOffset = i; 1708 } 1709 else if (compID==COMPONENT_Cr) 1710 { 1711 m_chromaCrQpOffset = i; 1712 } 1713 else 1714 { 1715 assert(0); 1716 } 1717 } 1718 Int getQpOffset(ComponentID compID) const 1719 { 1720 return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset ); 1721 } 1722 1723 Void setMaxCuChromaQpAdjDepth ( UInt u ) { m_MaxCuChromaQpAdjDepth = u; } 1724 UInt getMaxCuChromaQpAdjDepth () const { return m_MaxCuChromaQpAdjDepth; } 1725 Void clearChromaQpAdjTable() { m_ChromaQpAdjTableSize = 0; } 1726 Int getChromaQpAdjTableSize() const { return m_ChromaQpAdjTableSize; } 1727 const ChromaQpAdj& getChromaQpAdjTableAt( Int idx ) const { return m_ChromaQpAdjTable[idx]; } 1728 Void setChromaQpAdjTableAt( Int idx, Int cbOffset, Int crOffset ) 1702 1729 { 1703 1730 m_ChromaQpAdjTable[idx].u.comp.CbOffset = cbOffset; … … 1706 1733 } 1707 1734 1708 Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } 1709 UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } 1710 Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } 1711 UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } 1712 1713 Bool getUseWP () { return m_bUseWeightPred; } 1714 Bool getWPBiPred () { return m_useWeightedBiPred; } 1715 Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } 1716 Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } 1717 1718 Bool getUseCrossComponentPrediction() const { return m_useCrossComponentPrediction; } 1719 Void setUseCrossComponentPrediction(Bool value) { m_useCrossComponentPrediction = value; } 1720 1721 UInt getSaoOffsetBitShift(ChannelType type) const { return m_saoOffsetBitShift[type]; } 1722 Void setSaoOffsetBitShift(ChannelType type, UInt uiBitShift) { m_saoOffsetBitShift[type] = uiBitShift; } 1723 1724 Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } 1725 Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } 1726 Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } 1727 Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } 1728 1729 Bool getUseTransformSkip () { return m_useTransformSkip; } 1730 Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } 1731 UInt getTransformSkipLog2MaxSize () { return m_transformSkipLog2MaxSize; } 1732 Void setTransformSkipLog2MaxSize ( UInt u ) { m_transformSkipLog2MaxSize = u; } 1733 1734 Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } 1735 Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } 1736 Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } 1737 Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } 1738 Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } 1739 Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } 1740 1741 Void setTilesEnabledFlag (Bool val) { m_tilesEnabledFlag = val; } 1742 Bool getTilesEnabledFlag () const { return m_tilesEnabledFlag; } 1743 Void setTileUniformSpacingFlag (Bool b) { m_uniformSpacingFlag = b; } 1744 Bool getTileUniformSpacingFlag () const { return m_uniformSpacingFlag; } 1745 Void setNumTileColumnsMinus1 (Int i) { m_numTileColumnsMinus1 = i; } 1746 Int getNumTileColumnsMinus1 () const { return m_numTileColumnsMinus1; } 1747 Void setTileColumnWidth (const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; } 1748 UInt getTileColumnWidth (UInt columnIdx) const { return m_tileColumnWidth[columnIdx]; } 1749 Void setNumTileRowsMinus1 (Int i) { m_numTileRowsMinus1 = i; } 1750 Int getNumTileRowsMinus1 () const { return m_numTileRowsMinus1; } 1751 Void setTileRowHeight (const std::vector<Int>& rowHeight) { m_tileRowHeight = rowHeight; } 1752 UInt getTileRowHeight (UInt rowIdx) const { return m_tileRowHeight[rowIdx]; } 1753 1754 Void setNumSubstreams (Int numSubstreams) { m_numSubstreams = numSubstreams; } 1755 Int getNumSubstreams () { return m_numSubstreams; } 1756 1757 Void setSignHideFlag( Bool signHideFlag ) { m_signHideFlag = signHideFlag; } 1758 Bool getSignHideFlag() { return m_signHideFlag; } 1759 1760 Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } 1761 Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } 1762 Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } 1763 UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } 1764 Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } 1765 Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } 1766 Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } 1767 Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } 1768 Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled 1769 Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled 1770 Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter 1771 Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter 1772 Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter 1773 Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter 1774 Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } 1775 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1776 1735 Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } 1736 UInt getNumRefIdxL0DefaultActive() const { return m_numRefIdxL0DefaultActive; } 1737 Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } 1738 UInt getNumRefIdxL1DefaultActive() const { return m_numRefIdxL1DefaultActive; } 1739 1740 Bool getUseWP() const { return m_bUseWeightPred; } 1741 Bool getWPBiPred() const { return m_useWeightedBiPred; } 1742 Void setUseWP( Bool b ) { m_bUseWeightPred = b; } 1743 Void setWPBiPred( Bool b ) { m_useWeightedBiPred = b; } 1744 1745 Bool getUseCrossComponentPrediction() const { return m_useCrossComponentPrediction; } 1746 Void setUseCrossComponentPrediction(Bool value) { m_useCrossComponentPrediction = value; } 1747 1748 UInt getSaoOffsetBitShift(ChannelType type) const { return m_saoOffsetBitShift[type]; } 1749 Void setSaoOffsetBitShift(ChannelType type, UInt uiBitShift) { m_saoOffsetBitShift[type] = uiBitShift; } 1750 1751 Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } 1752 Bool getOutputFlagPresentFlag() const { return m_OutputFlagPresentFlag; } 1753 Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } 1754 Bool getTransquantBypassEnableFlag() const { return m_TransquantBypassEnableFlag; } 1755 1756 Bool getUseTransformSkip() const { return m_useTransformSkip; } 1757 Void setUseTransformSkip( Bool b ) { m_useTransformSkip = b; } 1758 UInt getTransformSkipLog2MaxSize() const { return m_transformSkipLog2MaxSize; } 1759 Void setTransformSkipLog2MaxSize( UInt u ) { m_transformSkipLog2MaxSize = u; } 1760 1761 Void setLoopFilterAcrossTilesEnabledFlag(Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } 1762 Bool getLoopFilterAcrossTilesEnabledFlag() const { return m_loopFilterAcrossTilesEnabledFlag; } 1763 Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } 1764 Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } 1765 Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } 1766 Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } 1767 1768 Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } 1769 Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } 1770 Void setTileUniformSpacingFlag(Bool b) { m_uniformSpacingFlag = b; } 1771 Bool getTileUniformSpacingFlag() const { return m_uniformSpacingFlag; } 1772 Void setNumTileColumnsMinus1(Int i) { m_numTileColumnsMinus1 = i; } 1773 Int getNumTileColumnsMinus1() const { return m_numTileColumnsMinus1; } 1774 Void setTileColumnWidth(const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; } 1775 UInt getTileColumnWidth(UInt columnIdx) const { return m_tileColumnWidth[columnIdx]; } 1776 Void setNumTileRowsMinus1(Int i) { m_numTileRowsMinus1 = i; } 1777 Int getNumTileRowsMinus1() const { return m_numTileRowsMinus1; } 1778 Void setTileRowHeight(const std::vector<Int>& rowHeight) { m_tileRowHeight = rowHeight; } 1779 UInt getTileRowHeight(UInt rowIdx) const { return m_tileRowHeight[rowIdx]; } 1780 1781 Void setSignHideFlag( Bool signHideFlag ) { m_signHideFlag = signHideFlag; } 1782 Bool getSignHideFlag() const { return m_signHideFlag; } 1783 1784 Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } 1785 Bool getCabacInitPresentFlag() const { return m_cabacInitPresentFlag; } 1786 Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } 1787 Bool getDeblockingFilterControlPresentFlag() const { return m_deblockingFilterControlPresentFlag; } 1788 Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } 1789 Bool getDeblockingFilterOverrideEnabledFlag() const { return m_deblockingFilterOverrideEnabledFlag; } 1790 Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled 1791 Bool getPicDisableDeblockingFilterFlag() const { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled 1792 Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter 1793 Int getDeblockingFilterBetaOffsetDiv2() const { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter 1794 Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter 1795 Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter 1796 Bool getScalingListPresentFlag() const { return m_scalingListPresentFlag; } 1797 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1798 1799 TComScalingList& getScalingList() { return m_scalingList; } 1800 const TComScalingList& getScalingList() const { return m_scalingList; } 1801 Bool getListsModificationPresentFlag() const { return m_listsModificationPresentFlag; } 1802 Void setListsModificationPresentFlag( Bool b ) { m_listsModificationPresentFlag = b; } 1803 UInt getLog2ParallelMergeLevelMinus2() const { return m_log2ParallelMergeLevelMinus2; } 1804 Void setLog2ParallelMergeLevelMinus2(UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } 1805 Int getNumExtraSliceHeaderBits() const { return m_numExtraSliceHeaderBits; } 1806 Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } 1807 Void setLoopFilterAcrossSlicesEnabledFlag( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } 1808 Bool getLoopFilterAcrossSlicesEnabledFlag() const { return m_loopFilterAcrossSlicesEnabledFlag; } 1809 Bool getSliceHeaderExtensionPresentFlag() const { return m_sliceHeaderExtensionPresentFlag; } 1810 Void setSliceHeaderExtensionPresentFlag(Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1777 1811 #if SVC_EXTENSION 1778 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } 1779 #else 1780 Void setScalingList ( TComScalingList *scalingList); 1781 #endif 1782 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS 1783 Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } 1784 Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } 1785 UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } 1786 Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } 1787 Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } 1788 Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } 1789 Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } 1790 Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } 1791 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1792 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1793 #if SVC_EXTENSION 1794 Int getExtensionFlag() { return m_extensionFlag; } 1795 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1796 UInt getLayerId() { return m_layerId; } 1797 Void setLayerId( UInt layerId ) { m_layerId = layerId; } 1798 Bool getInferScalingListFlag() { return m_inferScalingListFlag; } 1799 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1800 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1801 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1802 Bool getPocResetInfoPresentFlag() { return m_pocResetInfoPresentFlag; } 1803 Void setPocResetInfoPresentFlag(const Bool val) { m_pocResetInfoPresentFlag = val; } 1804 UInt getNumRefLayerLocationOffsets() { return m_numRefLayerLocationOffsets; } 1805 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } 1806 1807 UInt getRefLocationOffsetLayerId(Int x) { return m_refLocationOffsetLayerId[x]; } 1808 Void setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id; } 1809 Window& getScaledRefLayerWindowForLayer( Int layerId ); 1810 1811 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1812 Window& getRefLayerWindowForLayer( Int layerId ); 1813 Window& getRefLayerWindow( Int x ) { return m_refLayerWindow[x]; } 1814 Bool getScaledRefLayerOffsetPresentFlag(Int x) { return m_scaledRefLayerOffsetPresentFlag[x]; } 1815 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } 1816 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; } 1817 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 1818 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; } 1819 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; } 1820 Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; } 1821 Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; } 1822 Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; } 1823 Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; } 1824 Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; } 1825 Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; } 1826 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 1827 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 1828 Bool hasZeroResamplingPhase(Int refLayerId); 1829 Void getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma); 1812 Int getExtensionFlag() const { return m_extensionFlag; } 1813 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1814 UInt getLayerId() const { return m_layerId; } 1815 Void setLayerId( UInt layerId ) { m_layerId = layerId; } 1816 Bool getInferScalingListFlag() const { return m_inferScalingListFlag; } 1817 UInt getScalingListRefLayerId() const { return m_scalingListRefLayerId; } 1818 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1819 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1820 Bool getPocResetInfoPresentFlag() const { return m_pocResetInfoPresentFlag; } 1821 Void setPocResetInfoPresentFlag(const Bool val) { m_pocResetInfoPresentFlag = val; } 1822 UInt getNumRefLayerLocationOffsets() const { return m_numRefLayerLocationOffsets; } 1823 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } 1824 1825 UInt getRefLocationOffsetLayerId(Int x) const { return m_refLocationOffsetLayerId[x]; } 1826 Void setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id; } 1827 const Window& getScaledRefLayerWindowForLayer( Int layerId ) const; 1828 1829 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1830 const Window& getScaledRefLayerWindow( Int x ) const { return m_scaledRefLayerWindow[x]; } 1831 const Window& getRefLayerWindowForLayer( Int layerId ) const; 1832 Window& getRefLayerWindow( Int x ) { return m_refLayerWindow[x]; } 1833 const Window& getRefLayerWindow( Int x ) const { return m_refLayerWindow[x]; } 1834 Bool getScaledRefLayerOffsetPresentFlag(Int x) const { return m_scaledRefLayerOffsetPresentFlag[x]; } 1835 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } 1836 Bool getRefRegionOffsetPresentFlag(Int x) const { return m_refRegionOffsetPresentFlag[x]; } 1837 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 1838 1839 Int getPhaseHorLuma(Int x) const { return m_resamplingPhase[x].phaseHorLuma; } 1840 Int getPhaseVerLuma(Int x) const { return m_resamplingPhase[x].phaseVerLuma; } 1841 Int getPhaseHorChroma(Int x) const { return m_resamplingPhase[x].phaseHorChroma; } 1842 Int getPhaseVerChroma(Int x) const { return m_resamplingPhase[x].phaseVerChroma; } 1843 Void setPhaseHorLuma(Int x, Int val) { m_resamplingPhase[x].phaseHorLuma = val; } 1844 Void setPhaseVerLuma(Int x, Int val) { m_resamplingPhase[x].phaseVerLuma = val; } 1845 Void setPhaseHorChroma(Int x, Int val) { m_resamplingPhase[x].phaseHorChroma = val; } 1846 Void setPhaseVerChroma(Int x, Int val) { m_resamplingPhase[x].phaseVerChroma = val; } 1847 Bool getResamplePhaseSetPresentFlag(Int x) const { return m_resamplingPhase[x].phasePresentFlag; } 1848 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplingPhase[x].phasePresentFlag = b; } 1849 1850 Bool hasZeroResamplingPhase(Int refLayerId) const; 1851 const ResamplingPhase& getResamplingPhase(Int refLayerId) const; 1830 1852 #if CGS_3D_ASYMLUT 1831 Int getCGSFlag() { return m_nCGSFlag;}1832 Void setCGSFlag(Int n) { m_nCGSFlag = n;}1833 Int getCGSOutputBitDepthY() { return m_nCGSOutputBitDepthY;}1834 Void setCGSOutputBitDepthY(Int n){ m_nCGSOutputBitDepthY = n;}1835 Int getCGSOutputBitDepthC() { return m_nCGSOutputBitDepthC;}1836 Void setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n;}1853 Int getCGSFlag() const { return m_nCGSFlag; } 1854 Void setCGSFlag(Int n) { m_nCGSFlag = n; } 1855 Int getCGSOutputBitDepthY() const { return m_nCGSOutputBitDepthY; } 1856 Void setCGSOutputBitDepthY(Int n) { m_nCGSOutputBitDepthY = n; } 1857 Int getCGSOutputBitDepthC() const { return m_nCGSOutputBitDepthC; } 1858 Void setCGSOutputBitDepthC(Int n) { m_nCGSOutputBitDepthC = n; } 1837 1859 #endif 1838 1860 #endif //SVC_EXTENSION … … 1868 1890 class TComSlice 1869 1891 { 1870 1892 1871 1893 private: 1872 1894 // Bitstream writing 1873 Bool m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE];1874 Int m_iPPSId; ///< picture parameter set ID1875 Bool m_PicOutputFlag; ///< pic_output_flag1876 Int m_iPOC;1877 Int m_iLastIDR;1878 Int m_iAssociatedIRAP;1879 NalUnitType m_iAssociatedIRAPType;1880 static Int m_prevTid0POC;1881 TComReferencePictureSet *m_pcRPS;1882 TComReferencePictureSet m_LocalRPS;1883 Int m_iBDidx;1895 Bool m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE]; 1896 Int m_iPPSId; ///< picture parameter set ID 1897 Bool m_PicOutputFlag; ///< pic_output_flag 1898 Int m_iPOC; 1899 Int m_iLastIDR; 1900 Int m_iAssociatedIRAP; 1901 NalUnitType m_iAssociatedIRAPType; 1902 static Int m_prevTid0POC; 1903 TComReferencePictureSet* m_pcRPS; 1904 TComReferencePictureSet m_LocalRPS; 1905 Int m_iBDidx; 1884 1906 TComRefPicListModification m_RefPicListModification; 1885 NalUnitType m_eNalUnitType; ///< Nal unit type for the slice1886 SliceType m_eSliceType;1887 Int m_iSliceQp;1888 Bool m_dependentSliceSegmentFlag;1907 NalUnitType m_eNalUnitType; ///< Nal unit type for the slice 1908 SliceType m_eSliceType; 1909 Int m_iSliceQp; 1910 Bool m_dependentSliceSegmentFlag; 1889 1911 #if ADAPTIVE_QP_SELECTION 1890 Int m_iSliceQpBase;1891 #endif 1892 Bool m_ChromaQpAdjEnabled;1893 Bool m_deblockingFilterDisable;1894 Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS1895 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter1896 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter1897 Int m_list1IdxToList0Idx[MAX_NUM_REF];1898 Int m_aiNumRefIdx [NUM_REF_PIC_LIST_01]; // for multiple reference of current slice1899 1900 Bool m_bCheckLDC;1912 Int m_iSliceQpBase; 1913 #endif 1914 Bool m_ChromaQpAdjEnabled; 1915 Bool m_deblockingFilterDisable; 1916 Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS 1917 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1918 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1919 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1920 Int m_aiNumRefIdx [NUM_REF_PIC_LIST_01]; // for multiple reference of current slice 1921 1922 Bool m_bCheckLDC; 1901 1923 1902 1924 // Data 1903 Int m_iSliceQpDelta;1904 Int m_iSliceChromaQpDelta[MAX_NUM_COMPONENT];1905 TComPic* m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];1906 Int m_aiRefPOCList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];1907 Bool m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];1908 Int m_iDepth;1925 Int m_iSliceQpDelta; 1926 Int m_iSliceChromaQpDelta[MAX_NUM_COMPONENT]; 1927 TComPic* m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; 1928 Int m_aiRefPOCList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; 1929 Bool m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; 1930 Int m_iDepth; 1909 1931 1910 1932 // referenced slice? 1911 Bool m_bRefenced;1933 Bool m_bRefenced; 1912 1934 1913 1935 // access channel 1914 TComVPS*m_pcVPS;1915 TComSPS*m_pcSPS;1916 TComPPS*m_pcPPS;1917 TComPic* m_pcPic;1936 const TComVPS* m_pcVPS; 1937 const TComSPS* m_pcSPS; 1938 const TComPPS* m_pcPPS; 1939 TComPic* m_pcPic; 1918 1940 #if ADAPTIVE_QP_SELECTION 1919 TComTrQuant* m_pcTrQuant; 1920 #endif 1921 Bool m_colFromL0Flag; // collocated picture from List0 flag 1922 1923 Bool m_noOutputPriorPicsFlag; 1924 Bool m_noRaslOutputFlag; 1925 Bool m_handleCraAsBlaFlag; 1926 1927 UInt m_colRefIdx; 1928 UInt m_maxNumMergeCand; 1929 1930 Double m_lambdas[MAX_NUM_COMPONENT]; 1931 1932 Bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF]; 1933 UInt m_uiTLayer; 1934 Bool m_bTLayerSwitchingFlag; 1935 1936 SliceConstraint m_sliceMode; 1937 UInt m_sliceArgument; 1938 UInt m_sliceCurStartCtuTsAddr; 1939 UInt m_sliceCurEndCtuTsAddr; 1940 UInt m_sliceIdx; 1941 SliceConstraint m_sliceSegmentMode; 1942 UInt m_sliceSegmentArgument; 1943 UInt m_sliceSegmentCurStartCtuTsAddr; 1944 UInt m_sliceSegmentCurEndCtuTsAddr; 1945 Bool m_nextSlice; 1946 Bool m_nextSliceSegment; 1947 UInt m_sliceBits; 1948 UInt m_sliceSegmentBits; 1949 Bool m_bFinalized; 1950 1951 WPScalingParam m_weightPredTable[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] 1952 WPACDCParam m_weightACDCParam[MAX_NUM_COMPONENT]; 1953 1954 std::vector<UInt> m_substreamSizes; 1955 1956 TComScalingList* m_scalingList; //!< pointer of quantization matrix 1957 Bool m_cabacInitFlag; 1958 1959 Bool m_bLMvdL1Zero; 1960 Bool m_temporalLayerNonReferenceFlag; 1961 Bool m_LFCrossSliceBoundaryFlag; 1962 1963 Bool m_enableTMVPFlag; 1941 TComTrQuant* m_pcTrQuant; 1942 #endif 1943 Bool m_colFromL0Flag; // collocated picture from List0 flag 1944 1945 Bool m_noOutputPriorPicsFlag; 1946 Bool m_noRaslOutputFlag; 1947 Bool m_handleCraAsBlaFlag; 1948 1949 UInt m_colRefIdx; 1950 UInt m_maxNumMergeCand; 1951 1952 Double m_lambdas[MAX_NUM_COMPONENT]; 1953 1954 Bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF]; 1955 UInt m_uiTLayer; 1956 Bool m_bTLayerSwitchingFlag; 1957 1958 SliceConstraint m_sliceMode; 1959 UInt m_sliceArgument; 1960 UInt m_sliceCurStartCtuTsAddr; 1961 UInt m_sliceCurEndCtuTsAddr; 1962 UInt m_sliceIdx; 1963 SliceConstraint m_sliceSegmentMode; 1964 UInt m_sliceSegmentArgument; 1965 UInt m_sliceSegmentCurStartCtuTsAddr; 1966 UInt m_sliceSegmentCurEndCtuTsAddr; 1967 Bool m_nextSlice; 1968 Bool m_nextSliceSegment; 1969 UInt m_sliceBits; 1970 UInt m_sliceSegmentBits; 1971 Bool m_bFinalized; 1972 1973 Bool m_bTestWeightPred; 1974 Bool m_bTestWeightBiPred; 1975 WPScalingParam m_weightPredTable[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] 1976 WPACDCParam m_weightACDCParam[MAX_NUM_COMPONENT]; 1977 1978 std::vector<UInt> m_substreamSizes; 1979 1980 Bool m_cabacInitFlag; 1981 1982 Bool m_bLMvdL1Zero; 1983 Bool m_temporalLayerNonReferenceFlag; 1984 Bool m_LFCrossSliceBoundaryFlag; 1985 1986 Bool m_enableTMVPFlag; 1987 1988 SliceType m_encCABACTableIdx; // Used to transmit table selection across slices. 1964 1989 1965 1990 #if SVC_EXTENSION 1966 Int m_associatedIrapPocBeforeReset;1967 Bool m_firstSliceInPic;1968 Bool m_availableForTMVPRefFlag;1969 UInt m_layerId;1970 TComPic* m_pcBaseColPic[MAX_LAYERS];1971 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];1972 Int m_numMotionPredRefLayers;1973 Bool m_bMFMEnabledFlag;1974 Int m_colRefLayerIdx;1975 Bool m_altColIndicationFlag;1976 TComPic* m_pcIlpPic;1977 1978 Bool m_interLayerPredEnabledFlag;1979 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures1980 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_IDX_PLUS1];1981 Bool m_bDiscardableFlag;1982 Bool m_bCrossLayerBLAFlag;1983 Int m_pocResetIdc;1984 Int m_pocResetPeriodId;1985 Bool m_fullPocResetFlag;1986 Int m_pocLsbVal;1987 Int m_pocMsbVal;1988 Bool m_pocMsbValRequiredFlag;1989 Bool m_pocMsbValPresentFlag;1990 Bool m_pocMsbValNeeded;1991 Int m_pocResetDeltaPoc;1992 Int m_pocValueBeforeReset;1993 Int m_picOrderCntLsb;1991 Int m_associatedIrapPocBeforeReset; 1992 Bool m_firstSliceInPic; 1993 Bool m_availableForTMVPRefFlag; 1994 UInt m_layerId; 1995 TComPic* m_pcBaseColPic[MAX_LAYERS]; 1996 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; 1997 Int m_numMotionPredRefLayers; 1998 Bool m_bMFMEnabledFlag; 1999 Int m_colRefLayerIdx; 2000 Bool m_altColIndicationFlag; 2001 TComPic* m_pcIlpPic; 2002 2003 Bool m_interLayerPredEnabledFlag; 2004 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 2005 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_IDX_PLUS1]; 2006 Bool m_bDiscardableFlag; 2007 Bool m_bCrossLayerBLAFlag; 2008 Int m_pocResetIdc; 2009 Int m_pocResetPeriodId; 2010 Bool m_fullPocResetFlag; 2011 Int m_pocLsbVal; 2012 Int m_pocMsbVal; 2013 Bool m_pocMsbValRequiredFlag; 2014 Bool m_pocMsbValPresentFlag; 2015 Bool m_pocMsbValNeeded; 2016 Int m_pocResetDeltaPoc; 2017 Int m_pocValueBeforeReset; 2018 Int m_picOrderCntLsb; 1994 2019 #if CGS_3D_ASYMLUT 1995 Int m_nCGSOverWritePPS; // for optimization, not output to bitstream2020 Int m_nCGSOverWritePPS; // for optimization, not output to bitstream 1996 2021 #endif 1997 2022 #endif //SVC_EXTENSION 1998 2023 1999 2024 public: 2000 TComSlice();2001 virtual ~TComSlice();2025 TComSlice(); 2026 virtual ~TComSlice(); 2002 2027 #if SVC_EXTENSION 2003 Void initSlice ( UInt layerId ); 2028 Void initSlice( UInt layerId ); 2029 Void setVPS( const TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 2004 2030 #else 2005 Void initSlice (); 2006 #endif 2007 Void initTiles(); 2008 2009 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 2010 TComVPS* getVPS () { return m_pcVPS; } 2011 Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } 2012 TComSPS* getSPS () { return m_pcSPS; } 2013 const TComSPS* getSPS() const { return m_pcSPS; } 2014 2015 Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } 2016 TComPPS* getPPS () { return m_pcPPS; } 2017 const TComPPS* getPPS() const { return m_pcPPS; } 2031 Void initSlice(); 2032 #endif 2033 2034 Void setVPS( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 2035 const TComVPS* getVPS() const { return m_pcVPS; } 2036 Void setSPS( const TComSPS* pcSPS ) { m_pcSPS = pcSPS; } 2037 const TComSPS* getSPS() const { return m_pcSPS; } 2038 2039 Void setPPS( const TComPPS* pcPPS ) { m_pcPPS = pcPPS; m_iPPSId = (pcPPS) ? pcPPS->getPPSId() : -1; } 2040 const TComPPS* getPPS() const { return m_pcPPS; } 2018 2041 2019 2042 #if ADAPTIVE_QP_SELECTION 2020 Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } 2021 TComTrQuant* getTrQuant () { return m_pcTrQuant; } 2022 #endif 2023 2024 Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } 2025 Int getPPSId () { return m_iPPSId; } 2026 Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } 2027 Bool getPicOutputFlag() { return m_PicOutputFlag; } 2028 Void setSaoEnabledFlag(ChannelType chType, Bool s) {m_saoEnabledFlag[chType] =s; } 2029 Bool getSaoEnabledFlag(ChannelType chType) { return m_saoEnabledFlag[chType]; } 2030 Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } 2031 TComReferencePictureSet* getRPS () { return m_pcRPS; } 2032 TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } 2033 2034 Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } 2035 Int getRPSidx () { return m_iBDidx; } 2036 Int getPrevTid0POC () { return m_prevTid0POC; } 2037 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 2038 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } 2039 Int getLastIDR() { return m_iLastIDR; } 2040 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 2041 Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } 2042 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 2043 NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } 2044 SliceType getSliceType () { return m_eSliceType; } 2045 Int getPOC () { return m_iPOC; } 2046 Int getSliceQp () { return m_iSliceQp; } 2047 Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } 2048 Void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } 2043 Void setTrQuant( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } 2044 TComTrQuant* getTrQuant() { return m_pcTrQuant; } 2045 const TComTrQuant* getTrQuant() const { return m_pcTrQuant; } 2046 #endif 2047 2048 Void setPPSId( Int PPSId ) { m_iPPSId = PPSId; } 2049 Int getPPSId() const { return m_iPPSId; } 2050 Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } 2051 Bool getPicOutputFlag() const { return m_PicOutputFlag; } 2052 Void setSaoEnabledFlag(ChannelType chType, Bool s) {m_saoEnabledFlag[chType] =s; } 2053 Bool getSaoEnabledFlag(ChannelType chType) const { return m_saoEnabledFlag[chType]; } 2054 Void setRPS( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } 2055 TComReferencePictureSet* getRPS() { return m_pcRPS; } 2056 TComReferencePictureSet* getLocalRPS() { return &m_LocalRPS; } 2057 2058 Void setRPSidx( Int iBDidx ) { m_iBDidx = iBDidx; } 2059 Int getRPSidx() const { return m_iBDidx; } 2060 Int getPrevTid0POC() const { return m_prevTid0POC; } 2061 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 2062 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } 2063 Int getLastIDR() const { return m_iLastIDR; } 2064 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 2065 Int getAssociatedIRAPPOC() const { return m_iAssociatedIRAP; } 2066 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 2067 NalUnitType getAssociatedIRAPType() const { return m_iAssociatedIRAPType; } 2068 SliceType getSliceType() const { return m_eSliceType; } 2069 Int getPOC() const { return m_iPOC; } 2070 Int getSliceQp() const { return m_iSliceQp; } 2071 Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } 2072 Void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } 2049 2073 #if ADAPTIVE_QP_SELECTION 2050 Int getSliceQpBase () const { return m_iSliceQpBase;}2051 #endif 2052 Int getSliceQpDelta () const { return m_iSliceQpDelta;}2053 Int getSliceChromaQpDelta (ComponentID compID) const { return isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID];}2054 Bool getUseChromaQpAdj() const { return m_ChromaQpAdjEnabled;}2055 Bool getDeblockingFilterDisable() const { return m_deblockingFilterDisable;}2056 Bool getDeblockingFilterOverrideFlag() const { return m_deblockingFilterOverrideFlag;}2057 Int getDeblockingFilterBetaOffsetDiv2() const { return m_deblockingFilterBetaOffsetDiv2;}2058 Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2;}2059 2060 Int getNumRefIdx ( RefPicList e ) const { return m_aiNumRefIdx[e];}2061 TComPic* getPic () { return m_pcPic;}2062 TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx];}2063 Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx];}2064 Int getDepth () { return m_iDepth;}2065 Bool getColFromL0Flag () { return m_colFromL0Flag;}2066 UInt getColRefIdx () { return m_colRefIdx;}2067 Void checkColRefIdx(UInt curSliceIdx, TComPic* pic);2068 Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j];}2069 Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value;}2070 Bool getCheckLDC () { return m_bCheckLDC;}2071 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero;}2072 Int getNumRpsCurrTempList();2073 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx];}2074 Void setReferenced(Bool b) { m_bRefenced = b;}2075 Bool isReferenced() { return m_bRefenced;}2076 Bool isReferenceNalu(){ return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); }2077 Void setPOC ( Int i ){ m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} }2078 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e;}2079 NalUnitType getNalUnitType () const { return m_eNalUnitType;}2080 Bool getRapPicFlag ();2081 Bool getIdrPicFlag (){ return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }2082 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23);}2083 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);2074 Int getSliceQpBase() const { return m_iSliceQpBase; } 2075 #endif 2076 Int getSliceQpDelta() const { return m_iSliceQpDelta; } 2077 Int getSliceChromaQpDelta(ComponentID compID) const { return isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID]; } 2078 Bool getUseChromaQpAdj() const { return m_ChromaQpAdjEnabled; } 2079 Bool getDeblockingFilterDisable() const { return m_deblockingFilterDisable; } 2080 Bool getDeblockingFilterOverrideFlag() const { return m_deblockingFilterOverrideFlag; } 2081 Int getDeblockingFilterBetaOffsetDiv2()const { return m_deblockingFilterBetaOffsetDiv2; } 2082 Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2; } 2083 2084 Int getNumRefIdx( RefPicList e ) const { return m_aiNumRefIdx[e]; } 2085 TComPic* getPic() { return m_pcPic; } 2086 TComPic* getRefPic( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } 2087 Int getRefPOC( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } 2088 Int getDepth() const { return m_iDepth; } 2089 Bool getColFromL0Flag() const { return m_colFromL0Flag; } 2090 UInt getColRefIdx() const { return m_colRefIdx; } 2091 Void checkColRefIdx(UInt curSliceIdx, TComPic* pic); 2092 Bool getIsUsedAsLongTerm(Int i, Int j) const { return m_bIsUsedAsLongTerm[i][j]; } 2093 Void setIsUsedAsLongTerm(Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } 2094 Bool getCheckLDC() const { return m_bCheckLDC; } 2095 Bool getMvdL1ZeroFlag() const { return m_bLMvdL1Zero; } 2096 Int getNumRpsCurrTempList() const; 2097 Int getList1IdxToList0Idx( Int list1Idx ) const { return m_list1IdxToList0Idx[list1Idx]; } 2098 Void setReferenced(Bool b) { m_bRefenced = b; } 2099 Bool isReferenced() const { return m_bRefenced; } 2100 Bool isReferenceNalu() const { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } 2101 Void setPOC( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } 2102 Void setNalUnitType( NalUnitType e ) { m_eNalUnitType = e; } 2103 NalUnitType getNalUnitType() const { return m_eNalUnitType; } 2104 Bool getRapPicFlag() const; 2105 Bool getIdrPicFlag() const { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2106 Bool isIRAP() const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 2107 Void checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2084 2108 #if NO_CLRAS_OUTPUT_FLAG 2085 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 );2086 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag);2109 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 ); 2110 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); 2087 2111 #else 2088 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);2089 #endif 2090 Void setSliceType ( SliceType e ) { m_eSliceType = e;}2091 Void setSliceQp ( Int i ) { m_iSliceQp = i;}2112 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 2113 #endif 2114 Void setSliceType( SliceType e ) { m_eSliceType = e; } 2115 Void setSliceQp( Int i ) { m_iSliceQp = i; } 2092 2116 #if ADAPTIVE_QP_SELECTION 2093 Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i;}2094 #endif 2095 Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i;}2096 Void setSliceChromaQpDelta( ComponentID compID, Int i ) { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i;}2097 Void setUseChromaQpAdj ( Bool b ) { m_ChromaQpAdjEnabled = b;}2098 Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b;}2099 Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b;}2100 Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i;}2101 Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i;}2102 2103 Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p;}2104 Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i;}2105 Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i;}2106 Void setPic ( TComPic* p ) { m_pcPic = p;}2107 Void setDepth ( Int iDepth ) { m_iDepth = iDepth;}2117 Void setSliceQpBase( Int i ) { m_iSliceQpBase = i; } 2118 #endif 2119 Void setSliceQpDelta( Int i ) { m_iSliceQpDelta = i; } 2120 Void setSliceChromaQpDelta( ComponentID compID, Int i ) { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i; } 2121 Void setUseChromaQpAdj( Bool b ) { m_ChromaQpAdjEnabled = b; } 2122 Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } 2123 Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } 2124 Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } 2125 Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } 2126 2127 Void setRefPic( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } 2128 Void setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } 2129 Void setNumRefIdx( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } 2130 Void setPic( TComPic* p ) { m_pcPic = p; } 2131 Void setDepth( Int iDepth ) { m_iDepth = iDepth; } 2108 2132 2109 2133 #if SVC_EXTENSION 2110 Void setPrevTid0POC( Int x ) { m_prevTid0POC = x;}2111 Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x;}2112 Int getAssociatedIrapPocBeforeReset( ) { return m_associatedIrapPocBeforeReset;}2113 2114 Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL );2134 Void setPrevTid0POC( Int x ) { m_prevTid0POC = x; } 2135 Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; } 2136 Int getAssociatedIrapPocBeforeReset( ) { return m_associatedIrapPocBeforeReset; } 2137 2138 Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 2115 2139 #if CGS_3D_ASYMLUT 2116 Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; }2117 Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; }2140 Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; } 2141 Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; } 2118 2142 #endif 2119 2143 #else 2120 Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );2121 #endif 2122 Void setRefPOCList();2123 Void setColFromL0Flag ( Bool colFromL0 ) { m_colFromL0Flag = colFromL0;}2124 Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx;}2125 Void setCheckLDC ( Bool b ) { m_bCheckLDC = b;}2126 Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b;}2127 2128 Bool isIntra () { return m_eSliceType == I_SLICE;}2129 Bool isInterB () { return m_eSliceType == B_SLICE;}2130 Bool isInterP () { return m_eSliceType == P_SLICE;}2131 2132 Void setLambdas ( const Double lambdas[MAX_NUM_COMPONENT] ){ for (Int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; }2133 const Double* getLambdas() const { return m_lambdas;}2134 2135 Void initEqualRef();2136 Bool isEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2 )2144 Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 2145 #endif 2146 Void setRefPOCList(); 2147 Void setColFromL0Flag( Bool colFromL0 ) { m_colFromL0Flag = colFromL0; } 2148 Void setColRefIdx( UInt refIdx) { m_colRefIdx = refIdx; } 2149 Void setCheckLDC( Bool b ) { m_bCheckLDC = b; } 2150 Void setMvdL1ZeroFlag( Bool b) { m_bLMvdL1Zero = b; } 2151 2152 Bool isIntra() const { return m_eSliceType == I_SLICE; } 2153 Bool isInterB() const { return m_eSliceType == B_SLICE; } 2154 Bool isInterP() const { return m_eSliceType == P_SLICE; } 2155 2156 Void setLambdas( const Double lambdas[MAX_NUM_COMPONENT] ) { for (Int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; } 2157 const Double* getLambdas() const { return m_lambdas; } 2158 2159 Void initEqualRef(); 2160 Bool isEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) 2137 2161 { 2138 2162 assert(e<NUM_REF_PIC_LIST_01); 2139 if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; 2140 return m_abEqualRef[e][iRefIdx1][iRefIdx2]; 2163 if (iRefIdx1 < 0 || iRefIdx2 < 0) 2164 { 2165 return false; 2166 } 2167 else 2168 { 2169 return m_abEqualRef[e][iRefIdx1][iRefIdx2]; 2170 } 2141 2171 } 2142 2172 2143 Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b)2173 Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) 2144 2174 { 2145 2175 assert(e<NUM_REF_PIC_LIST_01); … … 2147 2177 } 2148 2178 2149 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 2150 Void setList1IdxToList0Idx(); 2151 2152 UInt getTLayer () { return m_uiTLayer; } 2153 Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 2154 2155 Void setTLayerInfo( UInt uiTLayer ); 2156 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 2179 static Void sortPicList( TComList<TComPic*>& rcListPic ); 2180 Void setList1IdxToList0Idx(); 2181 2182 UInt getTLayer() const { return m_uiTLayer; } 2183 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 2184 2185 Void setTLayerInfo( UInt uiTLayer ); 2186 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 2187 2157 2188 #if SVC_POC 2158 Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false);2189 Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false); 2159 2190 #else 2160 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic );2161 #endif 2162 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic,TComReferencePictureSet *RPSList);2163 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );2164 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );2191 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); 2192 #endif 2193 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *RPSList); 2194 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); 2195 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); 2165 2196 #if ALLOW_RECOVERY_POINT_AS_RAP 2166 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic,TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);2167 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic,TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);2197 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2198 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2168 2199 #else 2169 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2170 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2171 #endif 2172 Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } 2173 UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } 2174 2175 Void setNoOutputPriorPicsFlag ( Bool val ) { m_noOutputPriorPicsFlag = val; } 2176 Bool getNoOutputPriorPicsFlag () { return m_noOutputPriorPicsFlag; } 2177 2178 Void setNoRaslOutputFlag ( Bool val ) { m_noRaslOutputFlag = val; } 2179 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } 2180 2181 Void setHandleCraAsBlaFlag ( Bool val ) { m_handleCraAsBlaFlag = val; } 2182 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } 2183 2184 Void setSliceMode ( SliceConstraint mode ) { m_sliceMode = mode; } 2185 SliceConstraint getSliceMode () const { return m_sliceMode; } 2186 Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } 2187 UInt getSliceArgument () { return m_sliceArgument; } 2188 Void setSliceCurStartCtuTsAddr ( UInt ctuTsAddr ) { m_sliceCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2189 UInt getSliceCurStartCtuTsAddr () const { return m_sliceCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2190 Void setSliceCurEndCtuTsAddr ( UInt ctuTsAddr ) { m_sliceCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2191 UInt getSliceCurEndCtuTsAddr () const { return m_sliceCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2192 Void setSliceIdx ( UInt i) { m_sliceIdx = i; } 2193 UInt getSliceIdx () { return m_sliceIdx; } 2194 Void copySliceInfo (TComSlice *pcSliceSrc); 2195 Void setSliceSegmentMode ( SliceConstraint mode ) { m_sliceSegmentMode = mode; } 2196 SliceConstraint getSliceSegmentMode () const { return m_sliceSegmentMode; } 2197 Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } 2198 UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } 2199 Void setSliceSegmentCurStartCtuTsAddr ( UInt ctuTsAddr ) { m_sliceSegmentCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2200 UInt getSliceSegmentCurStartCtuTsAddr () const { return m_sliceSegmentCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2201 Void setSliceSegmentCurEndCtuTsAddr ( UInt ctuTsAddr ) { m_sliceSegmentCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2202 UInt getSliceSegmentCurEndCtuTsAddr () const { return m_sliceSegmentCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2203 Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } 2204 UInt getSliceBits () { return m_sliceBits; } 2205 Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } 2206 UInt getSliceSegmentBits () { return m_sliceSegmentBits; } 2207 Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } 2208 Bool getFinalized () { return m_bFinalized; } 2209 Void setWpScaling ( WPScalingParam wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT] ) { memcpy(m_weightPredTable, wp, sizeof(WPScalingParam)*NUM_REF_PIC_LIST_01*MAX_NUM_REF*MAX_NUM_COMPONENT); } 2210 Void getWpScaling ( RefPicList e, Int iRefIdx, WPScalingParam *&wp); 2211 2212 Void resetWpScaling (); 2213 Void initWpScaling (); 2214 inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } 2215 2216 Void setWpAcDcParam ( WPACDCParam wp[MAX_NUM_COMPONENT] ) { memcpy(m_weightACDCParam, wp, sizeof(WPACDCParam)*MAX_NUM_COMPONENT); } 2217 Void getWpAcDcParam ( WPACDCParam *&wp ); 2218 Void initWpAcDcParam (); 2219 2220 Void clearSubstreamSizes ( ) { return m_substreamSizes.clear(); } 2221 UInt getNumberOfSubstreamSizes ( ) { return (UInt) m_substreamSizes.size(); } 2222 Void addSubstreamSize ( UInt size ) { m_substreamSizes.push_back(size); } 2223 UInt getSubstreamSize ( Int idx ) { assert(idx<getNumberOfSubstreamSizes()); return m_substreamSizes[idx]; } 2224 2225 Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } 2226 TComScalingList* getScalingList () { return m_scalingList; } 2227 Void setDefaultScalingList (); 2228 Bool checkDefaultScalingList (); 2229 Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag 2230 Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag 2231 Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} 2232 Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} 2233 Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } 2234 Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} 2235 2236 Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } 2237 Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} 2200 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2201 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2202 #endif 2203 Void setMaxNumMergeCand(UInt val ) { m_maxNumMergeCand = val; } 2204 UInt getMaxNumMergeCand() const { return m_maxNumMergeCand; } 2205 2206 Void setNoOutputPriorPicsFlag( Bool val ) { m_noOutputPriorPicsFlag = val; } 2207 Bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; } 2208 2209 Void setNoRaslOutputFlag( Bool val ) { m_noRaslOutputFlag = val; } 2210 Bool getNoRaslOutputFlag() const { return m_noRaslOutputFlag; } 2211 2212 Void setHandleCraAsBlaFlag( Bool val ) { m_handleCraAsBlaFlag = val; } 2213 Bool getHandleCraAsBlaFlag() const { return m_handleCraAsBlaFlag; } 2214 2215 Void setSliceMode( SliceConstraint mode ) { m_sliceMode = mode; } 2216 SliceConstraint getSliceMode() const { return m_sliceMode; } 2217 Void setSliceArgument( UInt uiArgument ) { m_sliceArgument = uiArgument; } 2218 UInt getSliceArgument() const { return m_sliceArgument; } 2219 Void setSliceCurStartCtuTsAddr( UInt ctuTsAddr ) { m_sliceCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2220 UInt getSliceCurStartCtuTsAddr() const { return m_sliceCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2221 Void setSliceCurEndCtuTsAddr( UInt ctuTsAddr ) { m_sliceCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2222 UInt getSliceCurEndCtuTsAddr() const { return m_sliceCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2223 Void setSliceIdx( UInt i) { m_sliceIdx = i; } 2224 UInt getSliceIdx() const { return m_sliceIdx; } 2225 Void copySliceInfo(TComSlice *pcSliceSrc); 2226 Void setSliceSegmentMode( SliceConstraint mode ) { m_sliceSegmentMode = mode; } 2227 SliceConstraint getSliceSegmentMode() const { return m_sliceSegmentMode; } 2228 Void setSliceSegmentArgument( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } 2229 UInt getSliceSegmentArgument() const { return m_sliceSegmentArgument; } 2230 Void setSliceSegmentCurStartCtuTsAddr( UInt ctuTsAddr ) { m_sliceSegmentCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2231 UInt getSliceSegmentCurStartCtuTsAddr() const { return m_sliceSegmentCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2232 Void setSliceSegmentCurEndCtuTsAddr( UInt ctuTsAddr ) { m_sliceSegmentCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2233 UInt getSliceSegmentCurEndCtuTsAddr() const { return m_sliceSegmentCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) 2234 Void setSliceBits( UInt uiVal ) { m_sliceBits = uiVal; } 2235 UInt getSliceBits() const { return m_sliceBits; } 2236 Void setSliceSegmentBits( UInt uiVal ) { m_sliceSegmentBits = uiVal; } 2237 UInt getSliceSegmentBits() const { return m_sliceSegmentBits; } 2238 Void setFinalized( Bool uiVal ) { m_bFinalized = uiVal; } 2239 Bool getFinalized() const { return m_bFinalized; } 2240 Bool testWeightPred( ) const { return m_bTestWeightPred; } 2241 Void setTestWeightPred( Bool bValue ) { m_bTestWeightPred = bValue; } 2242 Bool testWeightBiPred( ) const { return m_bTestWeightBiPred; } 2243 Void setTestWeightBiPred( Bool bValue ) { m_bTestWeightBiPred = bValue; } 2244 Void setWpScaling( WPScalingParam wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT] ) 2245 { 2246 memcpy(m_weightPredTable, wp, sizeof(WPScalingParam)*NUM_REF_PIC_LIST_01*MAX_NUM_REF*MAX_NUM_COMPONENT); 2247 } 2248 2249 Void getWpScaling( RefPicList e, Int iRefIdx, WPScalingParam *&wp); 2250 2251 Void resetWpScaling(); 2252 Void initWpScaling(const TComSPS *sps); 2253 2254 Void setWpAcDcParam( WPACDCParam wp[MAX_NUM_COMPONENT] ) 2255 { 2256 memcpy(m_weightACDCParam, wp, sizeof(WPACDCParam)*MAX_NUM_COMPONENT); 2257 } 2258 2259 Void getWpAcDcParam( WPACDCParam *&wp ); 2260 Void initWpAcDcParam(); 2261 2262 Void clearSubstreamSizes( ) { return m_substreamSizes.clear(); } 2263 UInt getNumberOfSubstreamSizes( ) { return (UInt) m_substreamSizes.size(); } 2264 Void addSubstreamSize( UInt size ) { m_substreamSizes.push_back(size); } 2265 UInt getSubstreamSize( Int idx ) { assert(idx<getNumberOfSubstreamSizes()); return m_substreamSizes[idx]; } 2266 2267 Void setCabacInitFlag( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag 2268 Bool getCabacInitFlag() { return m_cabacInitFlag; } //!< get CABAC initial flag 2269 Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag; } 2270 Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x; } 2271 Void setLFCrossSliceBoundaryFlag( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } 2272 Bool getLFCrossSliceBoundaryFlag() { return m_LFCrossSliceBoundaryFlag; } 2273 2274 Void setEnableTMVPFlag( Bool b ) { m_enableTMVPFlag = b; } 2275 Bool getEnableTMVPFlag() { return m_enableTMVPFlag; } 2276 2277 Void setEncCABACTableIdx( SliceType idx ) { m_encCABACTableIdx = idx; } 2278 SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; } 2238 2279 2239 2280 #if SVC_EXTENSION 2240 Void setFirstSliceInPic ( Bool val ) { m_firstSliceInPic = val; } 2241 Bool getFirstSliceInPic () { return m_firstSliceInPic; } 2242 Void setAvailableForTMVPRefFlag ( Bool b ) { m_availableForTMVPRefFlag = b; } 2243 Bool getAvailableForTMVPRefFlag () { return m_availableForTMVPRefFlag;} 2244 Bool setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); 2245 Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } 2246 TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } 2247 TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } 2248 TComPic* getBaseColPic( TComList<TComPic*>& rcListPic ); 2249 2250 Void setLayerId (UInt layerId) { m_layerId = layerId; } 2251 UInt getLayerId () { return m_layerId; } 2252 UInt getLayerIdx() { return m_pcVPS->getLayerIdxInVps(m_layerId); } 2253 2254 Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 2255 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 2256 2257 Void setRefPicListModificationSvc(); 2258 Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } 2259 2260 Int getActiveNumILRRefIdx ( ) { return m_activeNumILRRefIdx; } 2261 Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } 2262 2263 Int getInterLayerPredLayerIdc (UInt layerIdc) { return m_interLayerPredLayerIdc[layerIdc];} 2264 Void setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdc) { m_interLayerPredLayerIdc[layerIdc] = refLayerIdc; } 2265 2266 Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } 2267 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 2268 2269 Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } 2270 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } 2271 2272 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } 2273 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 2274 2275 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 2276 2277 Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } 2278 Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } 2279 2280 Bool isIDR() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 2281 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP); } 2282 Bool isCRA() { return m_eNalUnitType == NAL_UNIT_CODED_SLICE_CRA; } 2283 Bool isBLA() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP 2284 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 2285 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP ); } 2286 Bool isSLNR() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N 2287 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_TSA_N 2288 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_STSA_N 2289 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N 2290 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N 2291 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N10 2292 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N12 2293 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); } 2294 2295 Bool getDiscardableFlag () { return m_bDiscardableFlag; } 2296 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } 2297 Bool getCrossLayerBLAFlag () { return m_bCrossLayerBLAFlag; } 2298 Void setCrossLayerBLAFlag (Bool b) { m_bCrossLayerBLAFlag = b; } 2299 2300 Int getNumNegativeRpsCurrTempList(); 2301 2302 UInt getPicWidthInLumaSamples(); 2303 UInt getPicHeightInLumaSamples(); 2304 #if AUXILIARY_PICTURES 2305 ChromaFormat getChromaFormatIdc(); 2306 #else 2307 UInt getChromaFormatIdc(); 2308 #endif 2309 UInt getBitDepthY(); 2310 UInt getBitDepthC(); 2311 Int getQpBDOffsetY(); 2312 Int getQpBDOffsetC(); 2313 2314 Window& getConformanceWindow(); 2315 2316 Void setILRPic(TComPic **pcIlpPic); 2317 2318 Int getPocResetIdc () { return m_pocResetIdc; } 2319 Void setPocResetIdc (Int b) { m_pocResetIdc = b; } 2320 Int getPocResetPeriodId () { return m_pocResetPeriodId; } 2321 Void setPocResetPeriodId (Int b) { m_pocResetPeriodId = b; } 2322 Bool getFullPocResetFlag () { return m_fullPocResetFlag; } 2323 Void setFullPocResetFlag (Bool b) { m_fullPocResetFlag = b; } 2324 Int getPocLsbVal () { return m_pocLsbVal; } 2325 Void setPocLsbVal (Int b) { m_pocLsbVal = b; } 2326 Void setPocMsbNeeded (Bool x) { m_pocMsbValNeeded = x; } 2327 Bool getPocMsbNeeded () { return m_pocMsbValNeeded; } 2328 Int getPocResetDeltaPoc () { return m_pocResetDeltaPoc; } 2329 Void setPocResetDeltaPoc (Int x) { m_pocResetDeltaPoc = x; } 2330 Int getPocMsbVal () { return m_pocMsbVal; } 2331 Void setPocMsbVal (Int b) { m_pocMsbVal = b; } 2332 Bool getPocMsbValPresentFlag () { return m_pocMsbValPresentFlag; } 2333 Void setPocMsbValPresentFlag (Bool x) { m_pocMsbValPresentFlag = x; } 2334 Bool getPocMsbValRequiredFlag () { return m_pocMsbValRequiredFlag; } 2335 Void setPocMsbValRequiredFlag (Bool x) { m_pocMsbValRequiredFlag = x; } 2336 2337 Bool getBlaPicFlag (); 2338 Bool getCraPicFlag (); 2339 Bool getRaslPicFlag (); 2340 Bool getRadlPicFlag (); 2341 Int getPicOrderCntLsb() { return m_picOrderCntLsb; } 2342 Void setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; } 2343 2344 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } 2345 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } 2346 Void decrementRefPocValues(Int const decrementValue); 2347 Int getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ); 2348 2349 Int getReferenceLayerIdc( UInt refLayerId ); 2350 2281 Void setFirstSliceInPic( Bool val ) { m_firstSliceInPic = val; } 2282 Bool getFirstSliceInPic() { return m_firstSliceInPic; } 2283 Void setAvailableForTMVPRefFlag( Bool b ) { m_availableForTMVPRefFlag = b; } 2284 Bool getAvailableForTMVPRefFlag() { return m_availableForTMVPRefFlag; } 2285 Bool setBaseColPic( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); 2286 Void setBaseColPic(UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } 2287 TComPic* getBaseColPic(UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } 2288 TComPic** getBaseColPic() { return &m_pcBaseColPic[0]; } 2289 TComPic* getBaseColPic( TComList<TComPic*>& rcListPic ); 2290 2291 Void setLayerId(UInt layerId) { m_layerId = layerId; } 2292 UInt getLayerId() { return m_layerId; } 2293 UInt getLayerIdx() { return m_pcVPS->getLayerIdxInVps(m_layerId); } 2294 2295 Void setFullPelBaseRec( UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 2296 TComPicYuv* getFullPelBaseRec( UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 2297 2298 Void setRefPicListModificationSvc(); 2299 Int getNumILRRefIdx() { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } 2300 2301 Int getActiveNumILRRefIdx() { return m_activeNumILRRefIdx; } 2302 Void setActiveNumILRRefIdx( Int i ) { m_activeNumILRRefIdx = i; } 2303 2304 Int getInterLayerPredLayerIdc(UInt layerIdc) { return m_interLayerPredLayerIdc[layerIdc]; } 2305 Void setInterLayerPredLayerIdc(UInt refLayerIdc, UInt layerIdc) { m_interLayerPredLayerIdc[layerIdc] = refLayerIdc; } 2306 2307 Void setInterLayerPredEnabledFlag( Bool val ) { m_interLayerPredEnabledFlag = val; } 2308 Bool getInterLayerPredEnabledFlag() { return m_interLayerPredEnabledFlag; } 2309 2310 Void setNumMotionPredRefLayers(Int i) { m_numMotionPredRefLayers = i; } 2311 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } 2312 2313 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } 2314 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 2315 2316 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 2317 2318 Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } 2319 Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } 2320 2321 Bool isIDR() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP); } 2322 Bool isCRA() { return m_eNalUnitType == NAL_UNIT_CODED_SLICE_CRA; } 2323 Bool isBLA() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP ); } 2324 Bool isSLNR() 2325 { 2326 return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N 2327 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_TSA_N 2328 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_STSA_N 2329 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N 2330 || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N 2331 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N10 2332 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N12 2333 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); 2334 } 2335 2336 Bool getDiscardableFlag () { return m_bDiscardableFlag; } 2337 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } 2338 Bool getCrossLayerBLAFlag () { return m_bCrossLayerBLAFlag; } 2339 Void setCrossLayerBLAFlag (Bool b) { m_bCrossLayerBLAFlag = b; } 2340 2341 Int getNumNegativeRpsCurrTempList(); 2342 2343 UInt getPicWidthInLumaSamples(); 2344 UInt getPicHeightInLumaSamples(); 2345 ChromaFormat getChromaFormatIdc(); 2346 UInt getBitDepthY(); 2347 UInt getBitDepthC(); 2348 Int getQpBDOffsetY(); 2349 Int getQpBDOffsetC(); 2350 2351 const Window& getConformanceWindow() const; 2352 2353 Void setILRPic(TComPic **pcIlpPic); 2354 2355 Int getPocResetIdc() { return m_pocResetIdc; } 2356 Void setPocResetIdc(Int b) { m_pocResetIdc = b; } 2357 Int getPocResetPeriodId() { return m_pocResetPeriodId; } 2358 Void setPocResetPeriodId(Int b) { m_pocResetPeriodId = b; } 2359 Bool getFullPocResetFlag() { return m_fullPocResetFlag; } 2360 Void setFullPocResetFlag(Bool b) { m_fullPocResetFlag = b; } 2361 Int getPocLsbVal() { return m_pocLsbVal; } 2362 Void setPocLsbVal(Int b) { m_pocLsbVal = b; } 2363 Void setPocMsbNeeded(Bool x) { m_pocMsbValNeeded = x; } 2364 Bool getPocMsbNeeded() { return m_pocMsbValNeeded; } 2365 Int getPocResetDeltaPoc() { return m_pocResetDeltaPoc; } 2366 Void setPocResetDeltaPoc(Int x) { m_pocResetDeltaPoc = x; } 2367 Int getPocMsbVal() { return m_pocMsbVal; } 2368 Void setPocMsbVal(Int b) { m_pocMsbVal = b; } 2369 Bool getPocMsbValPresentFlag() { return m_pocMsbValPresentFlag; } 2370 Void setPocMsbValPresentFlag(Bool x) { m_pocMsbValPresentFlag = x; } 2371 Bool getPocMsbValRequiredFlag() { return m_pocMsbValRequiredFlag; } 2372 Void setPocMsbValRequiredFlag(Bool x) { m_pocMsbValRequiredFlag = x; } 2373 2374 Bool getBlaPicFlag(); 2375 Bool getCraPicFlag(); 2376 Bool getRaslPicFlag(); 2377 Bool getRadlPicFlag(); 2378 Int getPicOrderCntLsb() { return m_picOrderCntLsb; } 2379 Void setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; } 2380 2381 Int getPocValueBeforeReset() { return m_pocValueBeforeReset; } 2382 Void setPocValueBeforeReset(Int x) { m_pocValueBeforeReset = x ; } 2383 Void decrementRefPocValues(Int const decrementValue); 2384 Int getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ); 2385 2386 Int getReferenceLayerIdc( UInt refLayerId ); 2351 2387 #endif //SVC_EXTENSION 2352 2388 2353 2389 protected: 2354 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, Int poc);2355 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);2390 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, Int poc); 2391 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 2356 2392 };// END CLASS DEFINITION TComSlice 2357 2393 2394 Void calculateParameterSetChangedFlag(Bool &bChanged, const std::vector<UChar> *pOldData, const std::vector<UChar> *pNewData); 2358 2395 2359 2396 template <class T> class ParameterSetMap 2360 2397 { 2361 2398 public: 2399 template <class Tm> 2400 struct MapData 2401 { 2402 Bool bChanged; 2403 std::vector<UChar> *pNaluData; // Can be null 2404 Tm* parameterSet; 2405 }; 2406 2362 2407 ParameterSetMap(Int maxId) 2363 2408 :m_maxId (maxId) … … 2366 2411 ~ParameterSetMap() 2367 2412 { 2368 for (typename std::map<Int, T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++)2413 for (typename std::map<Int,MapData<T> >::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) 2369 2414 { 2370 delete (*i).second; 2415 delete (*i).second.pNaluData; 2416 delete (*i).second.parameterSet; 2371 2417 } 2372 2418 } 2373 2419 2374 Void storePS(Int psId, T *ps )2420 Void storePS(Int psId, T *ps, const std::vector<UChar> *pNaluData) 2375 2421 { 2376 2422 assert ( psId < m_maxId ); 2377 2423 if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) 2378 2424 { 2379 delete m_paramsetMap[psId]; 2425 MapData<T> &mapData=m_paramsetMap[psId]; 2426 2427 // work out changed flag 2428 calculateParameterSetChangedFlag(mapData.bChanged, mapData.pNaluData, pNaluData); 2429 delete m_paramsetMap[psId].pNaluData; 2430 delete m_paramsetMap[psId].parameterSet; 2431 2432 m_paramsetMap[psId].parameterSet = ps; 2380 2433 } 2381 m_paramsetMap[psId] = ps; 2434 else 2435 { 2436 m_paramsetMap[psId].parameterSet = ps; 2437 m_paramsetMap[psId].bChanged = false; 2438 } 2439 if (pNaluData) 2440 { 2441 m_paramsetMap[psId].pNaluData=new std::vector<UChar>; 2442 *(m_paramsetMap[psId].pNaluData) = *pNaluData; 2443 } 2444 else 2445 { 2446 m_paramsetMap[psId].pNaluData=0; 2447 } 2382 2448 } 2383 2449 2384 Void mergePSList(ParameterSetMap<T> &rPsList)2450 Void clearChangedFlag(Int psId) 2385 2451 { 2386 for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++)2452 if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) 2387 2453 { 2388 storePS(i->first, i->second);2454 m_paramsetMap[psId].bChanged=false; 2389 2455 } 2390 rPsList.m_paramsetMap.clear();2391 2456 } 2392 2457 2458 Bool getChangedFlag(Int psId) const 2459 { 2460 const typename std::map<Int,MapData<T> >::const_iterator constit=m_paramsetMap.find(psId); 2461 if ( constit != m_paramsetMap.end() ) 2462 { 2463 return constit->second.bChanged; 2464 } 2465 return false; 2466 } 2393 2467 2394 2468 T* getPS(Int psId) 2395 2469 { 2396 return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId] ;2470 return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId].parameterSet; 2397 2471 } 2398 2472 2399 2473 T* getFirstPS() 2400 2474 { 2401 return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second ;2475 return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second.parameterSet; 2402 2476 } 2403 2477 2404 2478 private: 2405 std::map<Int, T *> m_paramsetMap;2406 Int m_maxId;2479 std::map<Int,MapData<T> > m_paramsetMap; 2480 Int m_maxId; 2407 2481 }; 2408 2482 … … 2410 2484 { 2411 2485 public: 2412 ParameterSetManager();2413 virtual ~ParameterSetManager();2486 ParameterSetManager(); 2487 virtual ~ParameterSetManager(); 2414 2488 2415 2489 //! store sequence parameter set and take ownership of it 2416 Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); };2490 Void storeVPS(TComVPS *vps, const std::vector<UChar> *pNaluData) { m_vpsMap.storePS( vps->getVPSId(), vps, pNaluData); }; 2417 2491 //! get pointer to existing video parameter set 2418 TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; 2419 TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; 2492 TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; 2493 Bool getVPSChangedFlag(Int vpsId) const { return m_vpsMap.getChangedFlag(vpsId); } 2494 Void clearVPSChangedFlag(Int vpsId) { m_vpsMap.clearChangedFlag(vpsId); } 2495 TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; 2420 2496 2421 2497 //! store sequence parameter set and take ownership of it 2422 Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); };2498 Void storeSPS(TComSPS *sps, const std::vector<UChar> *pNaluData) { m_spsMap.storePS( sps->getSPSId(), sps, pNaluData); }; 2423 2499 //! get pointer to existing sequence parameter set 2424 TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; 2425 TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; 2500 TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; 2501 Bool getSPSChangedFlag(Int spsId) const { return m_spsMap.getChangedFlag(spsId); } 2502 Void clearSPSChangedFlag(Int spsId) { m_spsMap.clearChangedFlag(spsId); } 2503 TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; 2426 2504 2427 2505 //! store picture parameter set and take ownership of it 2428 Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); };2506 Void storePPS(TComPPS *pps, const std::vector<UChar> *pNaluData) { m_ppsMap.storePS( pps->getPPSId(), pps, pNaluData); }; 2429 2507 //! get pointer to existing picture parameter set 2430 TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; 2431 TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; 2508 TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; 2509 Bool getPPSChangedFlag(Int ppsId) const { return m_ppsMap.getChangedFlag(ppsId); } 2510 Void clearPPSChangedFlag(Int ppsId) { m_ppsMap.clearChangedFlag(ppsId); } 2511 TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; 2432 2512 2433 2513 //! activate a SPS from a active parameter sets SEI message 2434 2514 //! \returns true, if activation is successful 2435 Bool activateSPSWithSEI(Int SPSId);2515 Bool activateSPSWithSEI(Int SPSId); 2436 2516 2437 2517 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2438 2518 //! \returns true, if activation is successful 2439 Bool activatePPS(Int ppsId, Bool isIRAP); 2440 2441 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; 2442 TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; 2443 TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; 2519 Bool activatePPS(Int ppsId, Bool isIRAP); 2520 2521 const TComVPS* getActiveVPS()const { return &m_activeVPS; }; 2522 const TComSPS* getActiveSPS()const { return &m_activeSPS; }; 2523 2524 #if SVC_EXTENSION 2525 const TComPPS* getActivePPS()const { return &m_activePPS; }; 2526 #endif 2444 2527 2445 2528 protected: … … 2449 2532 static ParameterSetMap<TComSPS> m_spsMap; 2450 2533 static ParameterSetMap<TComPPS> m_ppsMap; 2534 2535 TComPPS m_activePPS; 2536 static TComVPS m_activeVPS; 2451 2537 #else 2452 2538 ParameterSetMap<TComVPS> m_vpsMap; 2453 2539 ParameterSetMap<TComSPS> m_spsMap; 2454 2540 ParameterSetMap<TComPPS> m_ppsMap; 2455 #endif 2456 2457 #if SVC_EXTENSION 2458 static Int m_activeVPSId; 2459 #else 2460 Int m_activeVPSId; 2461 #endif 2462 Int m_activeSPSId; 2463 Int m_activePPSId; 2541 2542 TComVPS m_activeVPS; // used for SEI message 2543 #endif 2544 2545 TComSPS m_activeSPS; // used for SEI message 2464 2546 }; 2465 2547 -
branches/SHM-dev/source/Lib/TLibCommon/TComTU.cpp
r1029 r1235 59 59 mpParent(NULL) 60 60 { 61 TComSPS *pSPS=pcCU->getSlice()->getSPS();61 const TComSPS *pSPS=pcCU->getSlice()->getSPS(); 62 62 mLog2TrLumaSize = g_aucConvertToBit[pSPS->getMaxCUWidth() >> (mCuDepth+initTrDepthRelCU)]+2; 63 63 -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1203 r1235 2909 2909 { 2910 2910 xSetScalingListEnc(scalingList,list,size,qp,format); 2911 xSetScalingListDec( scalingList,list,size,qp,format);2911 xSetScalingListDec(*scalingList,list,size,qp,format); 2912 2912 setErrScaleCoeff(list,size,qp); 2913 2913 } … … 2918 2918 * \param scalingList quantaized matrix address 2919 2919 */ 2920 Void TComTrQuant::setScalingListDec( TComScalingList *scalingList, const ChromaFormat format)2920 Void TComTrQuant::setScalingListDec(const TComScalingList &scalingList, const ChromaFormat format) 2921 2921 { 2922 2922 const Int minimumQp = 0; … … 2994 2994 * \param uiQP Quantization parameter 2995 2995 */ 2996 Void TComTrQuant::xSetScalingListDec( TComScalingList *scalingList, UInt listId, UInt sizeId, Int qp, const ChromaFormat format)2996 Void TComTrQuant::xSetScalingListDec(const TComScalingList &scalingList, UInt listId, UInt sizeId, Int qp, const ChromaFormat format) 2997 2997 { 2998 2998 UInt width = g_scalingListSizeX[sizeId]; … … 3000 3000 UInt ratio = g_scalingListSizeX[sizeId]/min(MAX_MATRIX_SIZE_NUM,(Int)g_scalingListSizeX[sizeId]); 3001 3001 Int *dequantcoeff; 3002 Int *coeff = scalingList->getScalingListAddress(sizeId,listId);3002 const Int *coeff = scalingList.getScalingListAddress(sizeId,listId); 3003 3003 3004 3004 dequantcoeff = getDequantCoeff(listId, qp, sizeId); … … 3011 3011 height, width, ratio, 3012 3012 min(MAX_MATRIX_SIZE_NUM, (Int)g_scalingListSizeX[sizeId]), 3013 scalingList ->getScalingListDC(sizeId,listId));3013 scalingList.getScalingListDC(sizeId,listId)); 3014 3014 } 3015 3015 … … 3094 3094 * \param dc dc parameter 3095 3095 */ 3096 Void TComTrQuant::processScalingListDec( Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc)3096 Void TComTrQuant::processScalingListDec( const Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc) 3097 3097 { 3098 3098 for(UInt j=0;j<height;j++) -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.h
r1029 r1235 182 182 Void xsetFlatScalingList ( UInt list, UInt size, Int qp, const ChromaFormat format); 183 183 Void xSetScalingListEnc ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format); 184 Void xSetScalingListDec ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format);184 Void xSetScalingListDec ( const TComScalingList &scalingList, UInt list, UInt size, Int qp, const ChromaFormat format); 185 185 Void setScalingList ( TComScalingList *scalingList, const ChromaFormat format); 186 Void setScalingListDec ( TComScalingList *scalingList, const ChromaFormat format);186 Void setScalingListDec ( const TComScalingList &scalingList, const ChromaFormat format); 187 187 Void processScalingListEnc( Int *coeff, Int *quantcoeff, Int quantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc); 188 Void processScalingListDec( Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc);188 Void processScalingListDec( const Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc); 189 189 #if ADAPTIVE_QP_SELECTION 190 190 Void initSliceQpDelta() ; -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r1212 r1235 73 73 Int strideEL = pcUsPic->getStride(COMPONENT_Y); 74 74 75 Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();75 ChromaFormat chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 76 76 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 77 77 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 78 Bool phaseSetPresentFlag; 79 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma;80 currSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma );81 82 if( ! phaseSetPresentFlag )78 79 const ResamplingPhase &resamplingPhase = currSlice->getPPS()->getResamplingPhase( refLayerId ); 80 Int phaseVerChroma = resamplingPhase.phaseVerChroma; 81 82 if( !resamplingPhase.phasePresentFlag ) 83 83 { 84 84 Int refRegionHeight = heightBL - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset(); … … 192 192 pcBasePic->extendPicBorder(); // extend the border. 193 193 194 Int 195 Int 196 197 Int phaseX = phaseHorLuma;198 Int phaseY = phaseVerLuma;194 Int shiftX = 16; 195 Int shiftY = 16; 196 197 Int phaseX = resamplingPhase.phaseHorLuma; 198 Int phaseY = resamplingPhase.phaseVerLuma; 199 199 Int addX = ( ( phaseX * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 200 200 Int addY = ( ( phaseY * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); … … 207 207 widthEL = pcUsPic->getWidth ( COMPONENT_Y ); 208 208 heightEL = pcUsPic->getHeight( COMPONENT_Y ); 209 210 209 widthBL = pcBasePic->getWidth ( COMPONENT_Y ); 211 210 heightBL = min<Int>( pcBasePic->getHeight( COMPONENT_Y ), heightEL ); … … 256 255 257 256 Int nShift = 20 - g_bitDepthLayer[CHANNEL_TYPE_LUMA][currLayerId]; 258 259 257 Int iOffset = 1 << (nShift - 1); 260 258 … … 290 288 widthEL >>= 1; 291 289 heightEL >>= 1; 292 293 290 widthBL >>= 1; 294 291 heightBL >>= 1; … … 306 303 shiftY = 16; 307 304 308 addX = ( ( phaseHorChroma * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 ));305 addX = ( ( resamplingPhase.phaseHorChroma * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 309 306 addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 310 307 Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4; -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1227 r1235 307 307 308 308 #define MAX_NUM_LONG_TERM_REF_PICS 33 309 #define NUM_LONG_TERM_REF_PIC_SPS 0 309 310 310 311 #define DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES 1 … … 342 343 343 344 #define MAX_TIMECODE_SEI_SETS 3 ///< Maximum number of time sets 344 345 345 346 346 //------------------------------------------------ -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1218 r1235 106 106 */ 107 107 #if LAYERS_NOT_PRESENT_SEI 108 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream)109 #else 110 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)108 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 109 #else 110 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 111 111 #endif 112 112 { … … 133 133 #if O0164_MULTI_LAYER_HRD 134 134 #if LAYERS_NOT_PRESENT_SEI 135 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei)136 #else 137 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei)135 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei) 136 #else 137 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei) 138 138 #endif 139 139 #else 140 140 #if LAYERS_NOT_PRESENT_SEI 141 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream)142 #else 143 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)141 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 142 #else 143 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 144 144 #endif 145 145 #endif … … 557 557 558 558 #if SVC_EXTENSION 559 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps,std::ostream *pDecodedMessageOutputStream)560 #else 561 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)559 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 560 #else 561 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 562 562 #endif 563 563 { … … 568 568 569 569 #if SVC_EXTENSION 570 TComHRD *hrd;570 const TComHRD *hrd; 571 571 if( bspNestingSei ) // If DU info SEI contained inside a BSP nesting SEI message 572 572 { … … 577 577 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 578 578 std::vector<Int> hrdIdx(maxValues, 0); 579 std::vector< TComHRD*> hrdVec;579 std::vector<const TComHRD*> hrdVec; 580 580 std::vector<Int> syntaxElemLen(maxValues, 0); 581 581 for(Int i = 0; i < maxValues; i++) … … 601 601 else 602 602 { 603 TComVUI *vui = sps->getVuiParameters();603 const TComVUI *vui = sps->getVuiParameters(); 604 604 hrd = vui->getHrdParameters(); 605 605 } … … 621 621 } 622 622 #else 623 TComVUI *vui = sps->getVuiParameters();623 const TComVUI *vui = sps->getVuiParameters(); 624 624 625 625 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) … … 642 642 643 643 #if SVC_EXTENSION 644 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream)645 #else 646 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)644 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 645 #else 646 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 647 647 #endif 648 648 { … … 651 651 652 652 #if SVC_EXTENSION 653 TComHRD *pHRD;653 const TComHRD *pHRD; 654 654 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 655 655 { … … 660 660 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 661 661 std::vector<Int> hrdIdx(maxValues, 0); 662 std::vector< TComHRD*> hrdVec;662 std::vector<const TComHRD*> hrdVec; 663 663 std::vector<Int> syntaxElemLen(maxValues, 0); 664 664 for(i = 0; i < maxValues; i++) … … 683 683 else 684 684 { 685 TComVUI *vui = sps->getVuiParameters();685 const TComVUI *vui = sps->getVuiParameters(); 686 686 pHRD = vui->getHrdParameters(); 687 687 } 688 688 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 689 689 #else 690 TComVUI *pVUI = sps->getVuiParameters();691 TComHRD *pHRD = pVUI->getHrdParameters();690 const TComVUI *pVUI = sps->getVuiParameters(); 691 const TComHRD *pHRD = pVUI->getHrdParameters(); 692 692 #endif 693 693 … … 746 746 747 747 #if SVC_EXTENSION 748 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream)749 #else 750 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)748 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 749 #else 750 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 751 751 #endif 752 752 { … … 755 755 756 756 #if SVC_EXTENSION 757 TComHRD *hrd;758 TComVUI *vui = sps->getVuiParameters();757 const TComHRD *hrd; 758 const TComVUI *vui = sps->getVuiParameters(); 759 759 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 760 760 { … … 765 765 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 766 766 std::vector<Int> hrdIdx(maxValues, 0); 767 std::vector< TComHRD*> hrdVec;767 std::vector<const TComHRD*> hrdVec; 768 768 std::vector<Int> syntaxElemLen(maxValues, 0); 769 769 for(i = 0; i < maxValues; i++) … … 796 796 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 797 797 #else 798 TComVUI *vui = sps->getVuiParameters();799 TComHRD *hrd = vui->getHrdParameters();798 const TComVUI *vui = sps->getVuiParameters(); 799 const TComHRD *hrd = vui->getHrdParameters(); 800 800 #endif 801 801 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); … … 1061 1061 1062 1062 #if LAYERS_NOT_PRESENT_SEI 1063 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream)1064 #else 1065 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)1063 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 1064 #else 1065 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 1066 1066 #endif 1067 1067 { … … 1423 1423 #if SVC_EXTENSION 1424 1424 #if LAYERS_NOT_PRESENT_SEI 1425 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)1425 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 1426 1426 { 1427 1427 UInt uiCode; … … 1485 1485 1486 1486 #if SUB_BITSTREAM_PROPERTY_SEI 1487 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)1487 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 1488 1488 { 1489 1489 UInt uiCode; … … 1510 1510 #if O0164_MULTI_LAYER_HRD 1511 1511 #if LAYERS_NOT_PRESENT_SEI 1512 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)1513 #else 1514 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)1512 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream) 1513 #else 1514 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream) 1515 1515 #endif 1516 1516 { … … 1537 1537 } 1538 1538 1539 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream)1539 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream) 1540 1540 { 1541 1541 assert(vps->getVpsVuiPresentFlag()); 1542 1542 1543 #if SVC_EXTENSION1544 1543 UInt uiCode; 1545 1544 Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx; … … 1548 1547 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 1549 1548 std::vector<Int> hrdIdx(0, maxValues); 1550 std::vector< TComHRD*> hrdVec;1549 std::vector<const TComHRD*> hrdVec; 1551 1550 std::vector<Int> syntaxElemLen; 1552 1551 for(Int i = 0; i < maxValues; i++) … … 1580 1579 } 1581 1580 } 1582 #else1583 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);1584 UInt len;1585 UInt hrdIdx;1586 UInt uiCode;1587 1588 if (schedCombCnt > 0)1589 {1590 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);1591 }1592 else1593 {1594 hrdIdx = 0;1595 }1596 1597 TComHRD *hrd = vps->getBspHrd(hrdIdx);1598 1599 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())1600 {1601 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;1602 }1603 else1604 {1605 len = 23 + 1;1606 }1607 1608 if (hrd->getNalHrdParametersPresentFlag())1609 {1610 for(UInt i = 0; i < schedCombCnt; i++)1611 {1612 sei_read_code( pDecodedMessageOutputStream, len, uiCode, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = uiCode;1613 }1614 }1615 #if BSP_INIT_ARRIVAL_SEI1616 if( hrd->getVclHrdParametersPresentFlag() )1617 #else1618 else1619 #endif1620 {1621 for(UInt i = 0; i < schedCombCnt; i++)1622 {1623 sei_read_code( pDecodedMessageOutputStream, len, uiCode, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = uiCode;1624 }1625 }1626 #endif1627 1581 } 1628 1582 -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
r1218 r1235 57 57 virtual ~SEIReader() {}; 58 58 #if LAYERS_NOT_PRESENT_SEI 59 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream);59 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 60 60 #else 61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 62 62 #endif 63 63 protected: 64 64 #if O0164_MULTI_LAYER_HRD 65 65 #if LAYERS_NOT_PRESENT_SEI 66 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL);66 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL); 67 67 #else 68 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps,, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL);68 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL); 69 69 #endif 70 70 #else 71 71 #if LAYERS_NOT_PRESENT_SEI 72 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream);72 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 73 73 #else 74 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);74 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 75 75 #endif 76 76 #endif 77 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);78 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);79 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);77 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 78 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 79 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 80 80 #if SVC_EXTENSION 81 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream);82 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream);83 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream);81 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 82 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 83 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 84 84 #else 85 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);86 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);87 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);85 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 86 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 87 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 88 88 #endif 89 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);90 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);91 Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);92 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);93 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);94 Void xParseSEIRegionRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);95 Void xParseSEINoDisplay (SEINoDisplay &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);96 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);97 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);89 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 90 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 91 Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 92 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 93 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 94 Void xParseSEIRegionRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 95 Void xParseSEINoDisplay (SEINoDisplay &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 96 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 97 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 98 98 #if !LAYERS_NOT_PRESENT_SEI 99 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);99 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 100 100 #endif 101 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);102 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);103 Void xParseSEIChromaSamplingFilterHint (SEIChromaSamplingFilterHint& sei, UInt payloadSize/*,TComSPS* */, std::ostream *pDecodedMessageOutputStream);104 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);105 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);101 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 102 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 103 Void xParseSEIChromaSamplingFilterHint (SEIChromaSamplingFilterHint& sei, UInt payloadSize/*,TComSPS* */, std::ostream *pDecodedMessageOutputStream); 104 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 105 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 106 106 107 107 Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const Char *pSymbolName); … … 111 111 112 112 #if Q0074_COLOUR_REMAPPING_SEI 113 Void xParseSEIColourRemappingInfo (SEIColourRemappingInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);113 Void xParseSEIColourRemappingInfo (SEIColourRemappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 114 114 #endif 115 115 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 116 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);116 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 117 117 #endif 118 118 #if SUB_BITSTREAM_PROPERTY_SEI 119 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty &sei, TComVPS *vps,std::ostream *pDecodedMessageOutputStream);119 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty &sei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 120 120 #endif 121 121 #if LAYERS_NOT_PRESENT_SEI 122 Void xParseSEILayersNotPresent (SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps ,std::ostream *pDecodedMessageOutputStream);123 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream);122 Void xParseSEILayersNotPresent (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 123 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 124 124 #endif 125 125 #if O0164_MULTI_LAYER_HRD 126 126 #if LAYERS_NOT_PRESENT_SEI 127 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream);127 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream); 128 128 #else 129 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei ,std::ostream *pDecodedMessageOutputStream);129 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, const TComSPS *sps, const SEIScalableNesting &nestingSei ,std::ostream *pDecodedMessageOutputStream); 130 130 #endif 131 Void xParseSEIBspInitialArrivalTime (SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream);132 Void xParseHrdParameters (TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1,std::ostream *pDecodedMessageOutputStream);131 Void xParseSEIBspInitialArrivalTime (SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream); 132 Void xParseHrdParameters (TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1, std::ostream *pDecodedMessageOutputStream); 133 133 #endif 134 134 #if Q0189_TMVP_CONSTRAINTS 135 Void xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);135 Void xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 136 136 #endif 137 137 #if Q0247_FRAME_FIELD_INFO 138 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);138 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 139 139 #endif 140 140 #if P0123_ALPHA_CHANNEL_SEI 141 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);141 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 142 142 #endif 143 143 #if Q0096_OVERLAY_SEI 144 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);144 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 145 145 #endif 146 146 #if P0138_USE_ALT_CPB_PARAMS_FLAG 147 Bool xPayloadExtensionPresent 147 Bool xPayloadExtensionPresent(); 148 148 #endif 149 149 }; -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1230 r1235 316 316 if(pcPPS->getScalingListPresentFlag ()) 317 317 { 318 parseScalingList( pcPPS->getScalingList() );318 parseScalingList( &(pcPPS->getScalingList()) ); 319 319 } 320 320 … … 379 379 Int cbOffset; 380 380 Int crOffset; 381 READ_SVLC(cbOffset, "cb_qp_adjust nemt[i]");382 READ_SVLC(crOffset, "cr_qp_adjust nemt[i]");381 READ_SVLC(cbOffset, "cb_qp_adjustment[i]"); 382 READ_SVLC(crOffset, "cr_qp_adjustment[i]"); 383 383 pcPPS->setChromaQpAdjTableAt(chromaQpAdjustmentIndex, cbOffset, crOffset); 384 384 } … … 879 879 if(pcSPS->getScalingListPresentFlag ()) 880 880 { 881 parseScalingList( pcSPS->getScalingList() );881 parseScalingList( &(pcSPS->getScalingList()) ); 882 882 } 883 883 #if SVC_EXTENSION … … 1141 1141 } 1142 1142 1143 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager)1143 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager) 1144 1144 { 1145 1145 UInt uiCode; … … 1165 1165 } 1166 1166 READ_UVLC ( uiCode, "slice_pic_parameter_set_id" ); pcSlice->setPPSId(uiCode); 1167 pps = parameterSetManager->getP refetchedPPS(uiCode);1167 pps = parameterSetManager->getPPS(uiCode); 1168 1168 //!KS: need to add error handling code here, if PPS is not available 1169 1169 assert(pps!=0); 1170 sps = parameterSetManager->get PrefetchedSPS(pps->getSPSId());1170 sps = parameterSetManager->getSPS(pps->getSPSId()); 1171 1171 //!KS: need to add error handling code here, if SPS is not available 1172 1172 assert(sps!=0); 1173 1173 pcSlice->setSPS(sps); 1174 1174 pcSlice->setPPS(pps); 1175 1176 #if SVC_EXTENSION 1177 TComVPS* vps = parameterSetManager->getVPS(sps->getVPSId()); 1178 pcSlice->setVPS(vps); 1179 1180 Int iPOClsb = 0; 1181 #endif 1175 1182 1176 1183 const ChromaFormat chFmt = sps->getChromaFormatIdc(); … … 1212 1219 } 1213 1220 1214 #if SVC_EXTENSION1215 Int iPOClsb = 0;1216 #endif1217 1218 1221 if(!pcSlice->getDependentSliceSegmentFlag()) 1219 1222 { 1220 1223 #if SVC_EXTENSION 1221 1224 Int iBits = 0; 1222 if(p cSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1225 if(pps->getNumExtraSliceHeaderBits() > iBits) 1223 1226 { 1224 1227 READ_FLAG(uiCode, "discardable_flag"); … … 1237 1240 } 1238 1241 1239 if(p cSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1242 if(pps->getNumExtraSliceHeaderBits() > iBits) 1240 1243 { 1241 1244 READ_FLAG(uiCode, "cross_layer_bla_flag"); pcSlice->setCrossLayerBLAFlag( uiCode ? true : false ); … … 1243 1246 } 1244 1247 1245 for ( ; iBits < p cSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)1248 for ( ; iBits < pps->getNumExtraSliceHeaderBits(); iBits++) 1246 1249 { 1247 1250 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1248 1251 } 1249 1252 #else //SVC_EXTENSION 1250 for (Int i = 0; i < p cSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)1253 for (Int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++) 1251 1254 { 1252 1255 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored … … 1276 1279 1277 1280 #if SVC_EXTENSION 1278 if( ( pcSlice->getLayerId() > 0 && ! pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() )1281 if( ( pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( vps->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() ) 1279 1282 #else 1280 1283 else … … 1336 1339 { 1337 1340 Int numBits = 0; 1338 while ((1 << numBits) < pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets())1341 while ((1 << numBits) < sps->getRPSList()->getNumberOfReferencePictureSets()) 1339 1342 { 1340 1343 numBits++; … … 1356 1359 UInt numOfLtrp = 0; 1357 1360 UInt numLtrpInSPS = 0; 1358 if ( pcSlice->getSPS()->getNumLongTermRefPicSPS() > 0)1361 if (sps->getNumLongTermRefPicSPS() > 0) 1359 1362 { 1360 1363 READ_UVLC( uiCode, "num_long_term_sps"); … … 1364 1367 } 1365 1368 Int bitsForLtrpInSPS = 0; 1366 while ( pcSlice->getSPS()->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS))1369 while (sps->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS)) 1367 1370 { 1368 1371 bitsForLtrpInSPS++; … … 1371 1374 numOfLtrp += uiCode; 1372 1375 rps->setNumberOfLongtermPictures(numOfLtrp); 1373 Int maxPicOrderCntLSB = 1 << pcSlice->getSPS()->getBitsForPOC();1376 Int maxPicOrderCntLSB = 1 << sps->getBitsForPOC(); 1374 1377 Int prevDeltaMSB = 0, deltaPocMSBCycleLT = 0; 1375 1378 for(Int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++) … … 1383 1386 READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]"); 1384 1387 } 1385 Bool usedByCurrFromSPS= pcSlice->getSPS()->getUsedByCurrPicLtSPSFlag(uiCode);1386 1387 pocLsbLt = pcSlice->getSPS()->getLtRefPicPocLsbSps(uiCode);1388 Bool usedByCurrFromSPS=sps->getUsedByCurrPicLtSPSFlag(uiCode); 1389 1390 pocLsbLt = sps->getLtRefPicPocLsbSps(uiCode); 1388 1391 rps->setUsed(j,usedByCurrFromSPS); 1389 1392 } 1390 1393 else 1391 1394 { 1392 READ_CODE( pcSlice->getSPS()->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode;1395 READ_CODE(sps->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode; 1393 1396 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag"); rps->setUsed(j,uiCode); 1394 1397 } … … 1483 1486 pcSlice->setRPS(rps); 1484 1487 } 1485 if ( pcSlice->getSPS()->getTMVPFlagsPresent())1488 if (sps->getTMVPFlagsPresent()) 1486 1489 { 1487 1490 READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" ); … … 1496 1499 #if SVC_EXTENSION 1497 1500 pcSlice->setActiveNumILRRefIdx(0); 1498 if((pcSlice->getLayerId() > 0) && !( pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )1501 if((pcSlice->getLayerId() > 0) && !(vps->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1499 1502 { 1500 1503 READ_FLAG(uiCode,"inter_layer_pred_enabled_flag"); … … 1509 1512 numBits++; 1510 1513 } 1511 if( ! pcSlice->getVPS()->getMaxOneActiveRefLayerFlag())1514 if( !vps->getMaxOneActiveRefLayerFlag()) 1512 1515 { 1513 1516 READ_CODE( numBits, uiCode,"num_inter_layer_ref_pics_minus1" ); … … 1518 1521 for( Int i = 0; i < pcSlice->getNumILRRefIdx(); i++ ) 1519 1522 { 1520 if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&1521 pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >= pcSlice->getTLayer() )1523 if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) && 1524 vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >= pcSlice->getTLayer() ) 1522 1525 { 1523 1526 pcSlice->setActiveNumILRRefIdx(1); … … 1545 1548 else 1546 1549 { 1547 Int refLayerId = pcSlice->getVPS()->getRefLayerId(pcSlice->getLayerId(), 0);1548 Int refLayerIdx = pcSlice->getVPS()->getLayerIdxInVps(refLayerId);1549 1550 if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(refLayerIdx, pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&1551 pcSlice->getVPS()->getMaxTSLayersMinus1(refLayerIdx) >= pcSlice->getTLayer() )1550 Int refLayerId = vps->getRefLayerId(pcSlice->getLayerId(), 0); 1551 Int refLayerIdx = vps->getLayerIdxInVps(refLayerId); 1552 1553 if( ( vps->getMaxTidIlRefPicsPlus1(refLayerIdx, pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) && 1554 vps->getMaxTSLayersMinus1(refLayerIdx) >= pcSlice->getTLayer() ) 1552 1555 { 1553 1556 pcSlice->setActiveNumILRRefIdx(1); … … 1557 1560 } 1558 1561 } 1559 else if( pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true && (pcSlice->getLayerId() > 0 ))1562 else if( vps->getIlpSshSignalingEnabledFlag() == true && (pcSlice->getLayerId() > 0 )) 1560 1563 { 1561 1564 pcSlice->setInterLayerPredEnabledFlag(true); … … 1566 1569 for(i = 0, numRefLayerPics = 0; i < pcSlice->getNumILRRefIdx(); i++ ) 1567 1570 { 1568 if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&1569 pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >= pcSlice->getTLayer() )1571 if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) && 1572 vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >= pcSlice->getTLayer() ) 1570 1573 { 1571 1574 refLayerPicIdc[ numRefLayerPics++ ] = i; … … 1591 1594 else 1592 1595 { 1593 format = pcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : pcSlice->getVPS()->getVpsRepFormatIdx( pcSlice->getVPS()->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc();1596 format = vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx( vps->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc(); 1594 1597 1595 1598 // conformance check 1596 assert( (sps->getUpdateRepFormatFlag()==false && pcSlice->getVPS()->getVpsNumRepFormats()==1) || pcSlice->getVPS()->getVpsNumRepFormats() > 1 );1599 assert( (sps->getUpdateRepFormatFlag()==false && vps->getVpsNumRepFormats()==1) || vps->getVpsNumRepFormats() > 1 ); 1597 1600 } 1598 1601 if (format != CHROMA_400) … … 1633 1636 else 1634 1637 { 1635 pcSlice->setNumRefIdx(REF_PIC_LIST_0, p cSlice->getPPS()->getNumRefIdxL0DefaultActive());1638 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pps->getNumRefIdxL0DefaultActive()); 1636 1639 if (pcSlice->isInterB()) 1637 1640 { 1638 pcSlice->setNumRefIdx(REF_PIC_LIST_1, p cSlice->getPPS()->getNumRefIdxL1DefaultActive());1641 pcSlice->setNumRefIdx(REF_PIC_LIST_1, pps->getNumRefIdxL1DefaultActive()); 1639 1642 } 1640 1643 else … … 1648 1651 if(!pcSlice->isIntra()) 1649 1652 { 1650 if( !p cSlice->getPPS()->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )1653 if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 ) 1651 1654 { 1652 1655 refPicListModification->setRefPicListModificationFlagL0( 0 ); … … 1691 1694 if(pcSlice->isInterB()) 1692 1695 { 1693 if( !p cSlice->getPPS()->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )1696 if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 ) 1694 1697 { 1695 1698 refPicListModification->setRefPicListModificationFlagL1( 0 ); … … 1773 1776 if ( (pps->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) ) 1774 1777 { 1775 xParsePredWeightTable(pcSlice );1776 pcSlice->initWpScaling( );1778 xParsePredWeightTable(pcSlice, sps); 1779 pcSlice->initWpScaling(sps); 1777 1780 } 1778 1781 if (!pcSlice->isIntra()) … … 1795 1798 assert( pcSlice->getSliceQp() <= 51 ); 1796 1799 1797 if (p cSlice->getPPS()->getSliceChromaQpFlag())1800 if (pps->getSliceChromaQpFlag()) 1798 1801 { 1799 1802 if (numValidComp>COMPONENT_Cb) … … 1803 1806 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) >= -12 ); 1804 1807 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) <= 12 ); 1805 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) >= -12 );1806 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) <= 12 );1808 assert( (pps->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) >= -12 ); 1809 assert( (pps->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) <= 12 ); 1807 1810 } 1808 1811 … … 1813 1816 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) >= -12 ); 1814 1817 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) <= 12 ); 1815 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >= -12 );1816 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) <= 12 );1817 } 1818 } 1819 1820 if (p cSlice->getPPS()->getChromaQpAdjTableSize() > 0)1818 assert( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >= -12 ); 1819 assert( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) <= 12 ); 1820 } 1821 } 1822 1823 if (pps->getChromaQpAdjTableSize() > 0) 1821 1824 { 1822 1825 READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0); … … 1824 1827 else pcSlice->setUseChromaQpAdj(false); 1825 1828 1826 if (p cSlice->getPPS()->getDeblockingFilterControlPresentFlag())1827 { 1828 if(p cSlice->getPPS()->getDeblockingFilterOverrideEnabledFlag())1829 if (pps->getDeblockingFilterControlPresentFlag()) 1830 { 1831 if(pps->getDeblockingFilterOverrideEnabledFlag()) 1829 1832 { 1830 1833 READ_FLAG ( uiCode, "deblocking_filter_override_flag" ); pcSlice->setDeblockingFilterOverrideFlag(uiCode ? true : false); … … 1849 1852 else 1850 1853 { 1851 pcSlice->setDeblockingFilterDisable ( p cSlice->getPPS()->getPicDisableDeblockingFilterFlag() );1852 pcSlice->setDeblockingFilterBetaOffsetDiv2( p cSlice->getPPS()->getDeblockingFilterBetaOffsetDiv2() );1853 pcSlice->setDeblockingFilterTcOffsetDiv2 ( p cSlice->getPPS()->getDeblockingFilterTcOffsetDiv2() );1854 pcSlice->setDeblockingFilterDisable ( pps->getPicDisableDeblockingFilterFlag() ); 1855 pcSlice->setDeblockingFilterBetaOffsetDiv2( pps->getDeblockingFilterBetaOffsetDiv2() ); 1856 pcSlice->setDeblockingFilterTcOffsetDiv2 ( pps->getDeblockingFilterTcOffsetDiv2() ); 1854 1857 } 1855 1858 } … … 1861 1864 } 1862 1865 1863 Bool isSAOEnabled = pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA)));1866 Bool isSAOEnabled = sps->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA))); 1864 1867 Bool isDBFEnabled = (!pcSlice->getDeblockingFilterDisable()); 1865 1868 1866 if(p cSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled ))1869 if(pps->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled )) 1867 1870 { 1868 1871 READ_FLAG( uiCode, "slice_loop_filter_across_slices_enabled_flag"); … … 1870 1873 else 1871 1874 { 1872 uiCode = p cSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()?1:0;1875 uiCode = pps->getLoopFilterAcrossSlicesEnabledFlag()?1:0; 1873 1876 } 1874 1877 pcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false); … … 2379 2382 * \returns Void 2380 2383 */ 2381 Void TDecCavlc::xParsePredWeightTable( TComSlice* pcSlice )2384 Void TDecCavlc::xParsePredWeightTable( TComSlice* pcSlice, const TComSPS *sps ) 2382 2385 { 2383 2386 WPScalingParam *wp; 2384 TComSPS *sps = pcSlice->getSPS();2385 2387 const ChromaFormat chFmt = sps->getChromaFormatIdc(); 2386 2388 const Int numValidComp = Int(getNumberValidComponents(chFmt)); … … 2526 2528 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2527 2529 scalingListPredModeFlag = (code) ? true : false; 2530 scalingList->setScalingListPredModeFlag(sizeId, listId, scalingListPredModeFlag); 2528 2531 if(!scalingListPredModeFlag) //Copy Mode 2529 2532 { … … 3733 3736 } 3734 3737 3735 READ_CODE(numBits, uiCode, "bsp_ comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode);3738 READ_CODE(numBits, uiCode, "bsp_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 3736 3739 } 3737 3740 3738 READ_UVLC(uiCode, "bsp_ comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode);3741 READ_UVLC(uiCode, "bsp_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 3739 3742 } 3740 3743 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r1224 r1235 85 85 Void parseProfileTier (ProfileTierLevel *ptl); 86 86 Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); 87 Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager);87 Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager); 88 88 Void parseTerminatingBit ( UInt& ruiBit ); 89 89 Void parseRemainingBytes ( Bool noTrailingBytesExpected ); … … 117 117 Void parseIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); 118 118 119 Void xParsePredWeightTable ( TComSlice* pcSlice );119 Void xParsePredWeightTable ( TComSlice* pcSlice, const TComSPS *sps ); 120 120 Void parseScalingList ( TComScalingList* scalingList ); 121 121 Void xDecodeScalingList ( TComScalingList *scalingList, UInt sizeId, UInt listId); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1203 r1235 239 239 { 240 240 UInt uiIdx = uiAbsPartIdx; 241 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())241 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 242 242 { 243 243 setdQPFlag(true); … … 245 245 } 246 246 247 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj() )247 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) 248 248 { 249 249 setIsChromaQpAdjCoded(true); … … 270 270 uiIdx += uiQNumParts; 271 271 } 272 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())272 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 273 273 { 274 274 if ( getdQPFlag() ) … … 281 281 } 282 282 283 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())283 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 284 284 { 285 285 setdQPFlag(true); … … 287 287 } 288 288 289 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj() )289 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) 290 290 { 291 291 setIsChromaQpAdjCoded(true); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h
r1212 r1235 77 77 #endif 78 78 79 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager) = 0;79 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager) = 0; 80 80 81 81 virtual Void parseTerminatingBit ( UInt& ruilsLast ) = 0; … … 150 150 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 151 151 #endif 152 Void decodeSliceHeader ( TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager); }152 Void decodeSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager); } 153 153 154 154 Void decodeTerminatingBit ( UInt& ruiIsLast ) { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast); } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1230 r1235 584 584 } 585 585 eMode = (PartSize) uiMode; 586 if ( pcCU->getSlice()->getSPS()->get AMPAcc( uiDepth ))586 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 587 587 { 588 588 if (eMode == SIZE_2NxN) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h
r1212 r1235 85 85 ) {} 86 86 87 Void parseSliceHeader ( TComSlice* /*pcSlice*/, ParameterSetManager Decoder* /*parameterSetManager*/) {}87 Void parseSliceHeader ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/) {} 88 88 Void parseTerminatingBit ( UInt& ruiBit ); 89 89 Void parseRemainingBytes ( Bool noTrailingBytesExpected); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r1029 r1235 40 40 //! \ingroup TLibDecoder 41 41 //! \{ 42 43 #if SVC_EXTENSION44 ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS);45 ParameterSetMap<TComSPS> ParameterSetManagerDecoder::m_spsBuffer(MAX_NUM_SPS);46 ParameterSetMap<TComPPS> ParameterSetManagerDecoder::m_ppsBuffer(MAX_NUM_PPS);47 #endif48 42 49 43 ////////////////////////////////////////////////////////////////////// … … 271 265 } 272 266 273 ParameterSetManagerDecoder::ParameterSetManagerDecoder()274 #if !SVC_EXTENSION275 : m_vpsBuffer(MAX_NUM_VPS)276 , m_spsBuffer(MAX_NUM_SPS)277 , m_ppsBuffer(MAX_NUM_PPS)278 #endif279 {280 }281 282 ParameterSetManagerDecoder::~ParameterSetManagerDecoder()283 {284 285 }286 287 TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS (Int vpsId)288 {289 if (m_vpsBuffer.getPS(vpsId) != NULL )290 {291 return m_vpsBuffer.getPS(vpsId);292 }293 else294 {295 return getVPS(vpsId);296 }297 }298 299 300 TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS (Int spsId)301 {302 if (m_spsBuffer.getPS(spsId) != NULL )303 {304 return m_spsBuffer.getPS(spsId);305 }306 else307 {308 return getSPS(spsId);309 }310 }311 312 TComPPS* ParameterSetManagerDecoder::getPrefetchedPPS (Int ppsId)313 {314 if (m_ppsBuffer.getPS(ppsId) != NULL )315 {316 return m_ppsBuffer.getPS(ppsId);317 }318 else319 {320 return getPPS(ppsId);321 }322 }323 324 Void ParameterSetManagerDecoder::applyPrefetchedPS()325 {326 m_vpsMap.mergePSList(m_vpsBuffer);327 m_ppsMap.mergePSList(m_ppsBuffer);328 m_spsMap.mergePSList(m_spsBuffer);329 }330 331 267 //! \} -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.h
r1029 r1235 88 88 }; 89 89 90 91 class ParameterSetManagerDecoder:public ParameterSetManager92 {93 public:94 ParameterSetManagerDecoder();95 virtual ~ParameterSetManagerDecoder();96 Void storePrefetchedVPS(TComVPS *vps) { m_vpsBuffer.storePS( vps->getVPSId(), vps); };97 TComVPS* getPrefetchedVPS (Int vpsId);98 Void storePrefetchedSPS(TComSPS *sps) { m_spsBuffer.storePS( sps->getSPSId(), sps); };99 TComSPS* getPrefetchedSPS (Int spsId);100 Void storePrefetchedPPS(TComPPS *pps) { m_ppsBuffer.storePS( pps->getPPSId(), pps); };101 TComPPS* getPrefetchedPPS (Int ppsId);102 Void applyPrefetchedPS();103 104 private:105 #if SVC_EXTENSION106 static ParameterSetMap<TComVPS> m_vpsBuffer;107 static ParameterSetMap<TComSPS> m_spsBuffer;108 static ParameterSetMap<TComPPS> m_ppsBuffer;109 #else110 ParameterSetMap<TComVPS> m_vpsBuffer;111 ParameterSetMap<TComSPS> m_spsBuffer;112 ParameterSetMap<TComPPS> m_ppsBuffer;113 #endif114 };115 116 117 90 //! \} 118 91 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1229 r1235 223 223 } 224 224 225 Void TDecTop::xGetNewPicBuffer ( TComSlice* pcSlice, TComPic*& rpcPic ) 226 { 227 Int numReorderPics[MAX_TLAYER]; 228 #if SVC_EXTENSION 229 Window &conformanceWindow = pcSlice->getConformanceWindow(); 225 #if SVC_EXTENSION 226 Void TDecTop::xGetNewPicBuffer( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer ) 230 227 #else 231 Window &conformanceWindow = pcSlice->getSPS()->getConformanceWindow(); 232 #endif 233 Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window(); 234 235 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 236 { 237 #if SVC_EXTENSION 238 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 ) 239 { 240 assert( this->getLayerId() == 0 ); 241 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 242 } 243 else 244 { 245 TComVPS *vps = pcSlice->getVPS(); 246 // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures. 247 numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer); 248 } 249 #else 250 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 251 #endif 252 } 253 228 Void TDecTop::xGetNewPicBuffer ( const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer ) 229 #endif 230 { 254 231 #if SVC_EXTENSION 255 232 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 ) 256 233 { 257 assert( this->getLayerId()== 0 );258 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded234 assert( m_layerId == 0 ); 235 m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 259 236 } 260 237 else 261 238 { 262 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), pcSlice->getVPS()->getLayerIdcForOls( pcSlice->getVPS()->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), pcSlice->getLayerId() ), pcSlice->getTLayer()) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded239 m_iMaxRefPicNum = vps.getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), vps.getLayerIdcForOls( vps.getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), m_layerId ), temporalLayer ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 263 240 } 264 241 265 242 m_iMaxRefPicNum += 1; // it should be updated if more than 1 resampling picture is used 266 243 #else 267 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded244 m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 268 245 #endif 269 246 … … 275 252 if(m_layerId > 0) 276 253 { 277 xSetSpatialEnhLayerFlag( pcSlice, rpcPic ); 278 } 279 280 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 281 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 254 xSetSpatialEnhLayerFlag( vps, sps, pps, rpcPic ); 255 } 256 257 rpcPic->create( vps, sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 282 258 #else //SVC_EXTENSION 283 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 284 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 259 rpcPic->create ( sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 285 260 #endif //SVC_EXTENSION 286 261 … … 326 301 if( m_layerId > 0 ) 327 302 { 328 xSetSpatialEnhLayerFlag( pcSlice, rpcPic ); 329 } 330 331 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 332 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 303 xSetSpatialEnhLayerFlag( vps, sps, pps, rpcPic ); 304 } 305 306 rpcPic->create( vps, sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 333 307 #else //SVC_EXTENSION 334 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 335 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 308 rpcPic->create ( sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 336 309 #endif //SVC_EXTENSION 337 310 } … … 386 359 { 387 360 printf("\ninserting lost poc : %d\n",iLostPoc); 388 TComSlice cFillSlice;389 cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() );390 cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() );391 #if SVC_EXTENSION392 cFillSlice.setVPS( m_parameterSetManagerDecoder.getFirstVPS() );393 cFillSlice.initSlice( m_layerId );394 #else395 cFillSlice.initSlice();396 #endif397 361 TComPic *cFillPic; 398 xGetNewPicBuffer(&cFillSlice,cFillPic); 399 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 400 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 401 #if SVC_EXTENSION 402 cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder.getFirstVPS() ); 362 #if SVC_EXTENSION 363 xGetNewPicBuffer(*(m_parameterSetManager.getFirstVPS()), *(m_parameterSetManager.getFirstSPS()), *(m_parameterSetManager.getFirstPPS()), cFillPic, 0); 403 364 cFillPic->getSlice(0)->initSlice( m_layerId ); 404 365 #else 366 xGetNewPicBuffer(*(m_parameterSetManager.getFirstSPS()), *(m_parameterSetManager.getFirstPPS()), cFillPic, 0); 405 367 cFillPic->getSlice(0)->initSlice(); 406 368 #endif … … 445 407 Void TDecTop::xActivateParameterSets() 446 408 { 447 m_parameterSetManagerDecoder.applyPrefetchedPS(); 448 449 TComPPS *pps = m_parameterSetManagerDecoder.getPPS(m_apcSlicePilot->getPPSId()); 450 assert (pps != 0); 451 452 TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); 453 assert (sps != 0); 454 455 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 456 { 457 printf ("Parameter set activation failed!"); 458 assert (0); 459 } 460 461 #if SVC_EXTENSION 462 // scaling list settings and checks 463 TComVPS *activeVPS = m_parameterSetManagerDecoder.getActiveVPS(); 464 TComSPS *activeSPS = m_parameterSetManagerDecoder.getActiveSPS(); 465 TComPPS *activePPS = m_parameterSetManagerDecoder.getActivePPS(); 466 467 if( activeSPS->getInferScalingListFlag() ) 468 { 469 UInt refLayerId = activeSPS->getScalingListRefLayerId(); 470 TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 471 472 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 473 if( activeVPS->getNonHEVCBaseLayerFlag() ) 474 { 475 assert( refLayerId > 0 ); 476 } 477 478 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 479 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 480 assert( refSps->getInferScalingListFlag() == false ); 481 482 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 483 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 484 assert( activeVPS->getRecursiveRefLayerFlag( activeSPS->getLayerId(), refLayerId ) == true ); 485 486 if( activeSPS->getScalingList() != refSps->getScalingList() ) 487 { 488 // delete created instance of scaling list since it will be inferred 489 delete activeSPS->getScalingList(); 490 491 // infer scaling list 492 activeSPS->setScalingList( refSps->getScalingList() ); 493 } 494 } 495 496 if( activePPS->getInferScalingListFlag() ) 497 { 498 UInt refLayerId = activePPS->getScalingListRefLayerId(); 499 TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 500 501 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 502 if( activeVPS->getNonHEVCBaseLayerFlag() ) 503 { 504 assert( refLayerId > 0 ); 505 } 506 507 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 508 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 509 assert( refPps->getInferScalingListFlag() == false ); 510 511 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 512 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 513 assert( activeVPS->getRecursiveRefLayerFlag( activePPS->getLayerId(), refLayerId ) == true ); 514 515 if( activePPS->getScalingList() != refPps->getScalingList() ) 516 { 517 // delete created instance of scaling list since it will be inferred 518 delete activePPS->getScalingList(); 519 520 // infer scaling list 521 activePPS->setScalingList( refPps->getScalingList() ); 522 } 523 524 } 409 if (m_bFirstSliceInPicture) 410 { 411 const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value 412 assert (pps != 0); 413 414 #if SVC_EXTENSION 415 TComSPS *updateSPS = m_parameterSetManager.getSPS(pps->getSPSId()); // this is a temporary SPS object. Do not store this value 416 #endif 417 const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); // this is a temporary SPS object. Do not store this value 418 assert (sps != 0); 419 420 m_parameterSetManager.clearSPSChangedFlag(sps->getSPSId()); 421 m_parameterSetManager.clearPPSChangedFlag(pps->getPPSId()); 422 423 if (false == m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 424 { 425 printf ("Parameter set activation failed!"); 426 assert (0); 427 } 428 429 #if SVC_EXTENSION 430 // scaling list settings and checks 431 TComVPS *vps = m_parameterSetManager.getVPS(sps->getVPSId()); 432 assert (vps != 0); 433 434 m_parameterSetManager.clearVPSChangedFlag(sps->getVPSId()); 435 436 if( sps->getInferScalingListFlag() ) 437 { 438 UInt refLayerId = sps->getScalingListRefLayerId(); 439 const TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 440 441 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 442 if( vps->getNonHEVCBaseLayerFlag() ) 443 { 444 assert( refLayerId > 0 ); 445 } 446 447 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 448 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 449 assert( refSps->getInferScalingListFlag() == false ); 450 451 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 452 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 453 assert( vps->getRecursiveRefLayerFlag( sps->getLayerId(), refLayerId ) == true ); 454 } 455 456 if( pps->getInferScalingListFlag() ) 457 { 458 UInt refLayerId = pps->getScalingListRefLayerId(); 459 const TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 460 461 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 462 if( vps->getNonHEVCBaseLayerFlag() ) 463 { 464 assert( refLayerId > 0 ); 465 } 466 467 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 468 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 469 assert( refPps->getInferScalingListFlag() == false ); 470 471 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 472 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 473 assert( vps->getRecursiveRefLayerFlag( pps->getLayerId(), refLayerId ) == true ); 474 } 525 475 526 476 #if AVC_BASE 527 if( activeVPS->getNonHEVCBaseLayerFlag() ) 528 { 529 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 530 if( m_layerId > 0 && pBLPic->getPicYuvRec() == NULL ) 531 { 532 UInt refLayerId = 0; 533 RepFormat* repFormat = activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(refLayerId) ); 534 535 Int numReorderPics[MAX_TLAYER]; 536 Window defaultDisplayWindow; 537 538 #if AUXILIARY_PICTURES 539 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true); 477 if( vps->getNonHEVCBaseLayerFlag() ) 478 { 479 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 480 if( m_layerId > 0 && pBLPic->getPicYuvRec() == NULL ) 481 { 482 UInt refLayerId = 0; 483 const RepFormat* repFormat = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(refLayerId) ); 484 485 pBLPic->create( *vps, *sps, *pps, sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), true, refLayerId); 486 487 // it is needed where the VPS is accessed through the slice 488 pBLPic->getSlice(0)->setVPS( vps ); 489 490 g_bitDepthLayer[CHANNEL_TYPE_LUMA][0] = repFormat->getBitDepthVpsLuma(); 491 g_bitDepthLayer[CHANNEL_TYPE_CHROMA][0] = repFormat->getBitDepthVpsChroma(); 492 } 493 } 494 #endif 495 496 if( m_layerId > 0 ) 497 { 498 // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1. 499 updateSPS->setMaxTLayers( vps->getMaxTLayers() ); 500 501 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 502 updateSPS->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true ); 503 504 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, 505 // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS. 506 for(UInt i=0; i < sps->getMaxTLayers(); i++) 507 { 508 // to avoid compiler warning "array subscript is above array bounds" 509 assert( i < MAX_TLAYER ); 510 511 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, 512 // due to MultiLayerExtSpsFlag being equal to 1, for a layer that refers to the SPS and has nuh_layer_id equal to currLayerId, 513 // the value of sps_max_dec_pic_buffering_minus1[ i ] is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOlsIdx ][ layerIdx ][ i ] of the active VPS, 514 // where layerIdx is equal to the value such that LayerSetLayerIdList[ TargetDecLayerSetIdx ][ layerIdx ] is equal to currLayerId. 515 if( sps->getMultiLayerExtSpsFlag() ) 516 { 517 updateSPS->setMaxDecPicBuffering( vps->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), vps->getLayerIdcForOls( vps->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), m_layerId ), i) + 1, i); 518 } 519 520 // The value of sps_max_dec_pic_buffering_minus1[ i ] shall be less than or equal to vps_max_dec_pic_buffering_minus1[ i ] for each value of i. 521 assert( sps->getMaxDecPicBuffering(i) <= vps->getMaxDecPicBuffering(i) ); 522 } 523 524 UInt layerIdx = vps->getLayerIdxInVps( m_layerId ); 525 526 if( vps->getBaseLayerPSCompatibilityFlag(layerIdx) ) 527 { 528 const RepFormat* repFormat = vps->getVpsRepFormat(vps->getVpsRepFormatIdx(layerIdx)); 529 530 assert( pps->getLayerId() == 0 ); 531 assert( sps->getLayerId() == 0 ); 532 assert( repFormat->getChromaFormatVpsIdc() == sps->getChromaFormatIdc() ); 533 assert( repFormat->getSeparateColourPlaneVpsFlag() == 0 ); 534 assert( repFormat->getPicHeightVpsInLumaSamples() == sps->getPicHeightInLumaSamples() ); 535 assert( repFormat->getPicWidthVpsInLumaSamples() == sps->getPicWidthInLumaSamples() ); 536 assert( repFormat->getBitDepthVpsLuma() == sps->getBitDepth(CHANNEL_TYPE_LUMA) ); 537 assert( repFormat->getBitDepthVpsChroma() == sps->getBitDepth(CHANNEL_TYPE_CHROMA) ); 538 assert( repFormat->getConformanceWindowVps().getWindowLeftOffset() == sps->getConformanceWindow().getWindowLeftOffset() ); 539 assert( repFormat->getConformanceWindowVps().getWindowRightOffset() == sps->getConformanceWindow().getWindowRightOffset() ); 540 assert( repFormat->getConformanceWindowVps().getWindowTopOffset() == sps->getConformanceWindow().getWindowTopOffset() ); 541 assert( repFormat->getConformanceWindowVps().getWindowBottomOffset() == sps->getConformanceWindow().getWindowBottomOffset() ); 542 } 543 } 544 545 //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer 546 UInt layerIdx = vps->getLayerIdxInVps(m_apcSlicePilot->getLayerId()); 547 548 if ( vps->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) ) 549 { 550 assert( sps->getPicWidthInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getPicWidthVpsInLumaSamples() ); 551 assert( sps->getPicHeightInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getPicHeightVpsInLumaSamples() ); 552 assert( sps->getChromaFormatIdc() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getChromaFormatVpsIdc() ); 553 assert( sps->getBitDepth(CHANNEL_TYPE_LUMA) <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsLuma() ); 554 assert( sps->getBitDepth(CHANNEL_TYPE_CHROMA) <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsChroma() ); 555 } 556 else if ( vps->getVpsExtensionFlag() == 1 ) 557 { 558 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples()); 559 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples()); 560 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc()); 561 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma()); 562 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()); 563 } 564 #endif //SVC_EXTENSION 565 566 // TODO: remove the use of the following globals: 567 for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++) 568 { 569 #if SVC_EXTENSION 570 g_bitDepth[channel] = isLuma(ChannelType(channel)) ? vps->getBitDepthY(sps, m_apcSlicePilot->getLayerId()) : vps->getBitDepthC(sps, m_apcSlicePilot->getLayerId()); 540 571 #else 541 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true); 542 #endif 543 // it is needed where the VPS is accessed through the slice 544 pBLPic->getSlice(0)->setVPS( activeVPS ); 545 546 g_bitDepthLayer[CHANNEL_TYPE_LUMA][0] = repFormat->getBitDepthVpsLuma(); 547 g_bitDepthLayer[CHANNEL_TYPE_CHROMA][0] = repFormat->getBitDepthVpsChroma(); 548 } 549 } 550 #endif 551 552 if( m_layerId > 0 ) 553 { 554 // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1. 555 sps->setMaxTLayers( activeVPS->getMaxTLayers() ); 556 557 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 558 sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? activeVPS->getTemporalNestingFlag() : true ); 559 560 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, 561 // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS. 562 for(UInt i=0; i < sps->getMaxTLayers(); i++) 563 { 564 // to avoid compiler warning "array subscript is above array bounds" 565 assert( i < MAX_TLAYER ); 566 567 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, 568 // due to MultiLayerExtSpsFlag being equal to 1, for a layer that refers to the SPS and has nuh_layer_id equal to currLayerId, 569 // the value of sps_max_dec_pic_buffering_minus1[ i ] is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOlsIdx ][ layerIdx ][ i ] of the active VPS, 570 // where layerIdx is equal to the value such that LayerSetLayerIdList[ TargetDecLayerSetIdx ][ layerIdx ] is equal to currLayerId. 571 if( sps->getMultiLayerExtSpsFlag() ) 572 { 573 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), activeVPS->getLayerIdcForOls( activeVPS->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), m_layerId ), i) + 1, i); 574 } 575 576 // The value of sps_max_dec_pic_buffering_minus1[ i ] shall be less than or equal to vps_max_dec_pic_buffering_minus1[ i ] for each value of i. 577 assert( sps->getMaxDecPicBuffering(i) <= activeVPS->getMaxDecPicBuffering(i) ); 578 } 579 580 UInt layerIdx = activeVPS->getLayerIdxInVps( m_layerId ); 581 582 if( activeVPS->getBaseLayerPSCompatibilityFlag(layerIdx) ) 583 { 584 RepFormat* repFormat = activeVPS->getVpsRepFormat(activeVPS->getVpsRepFormatIdx(layerIdx)); 585 586 assert( pps->getLayerId() == 0 ); 587 assert( sps->getLayerId() == 0 ); 588 assert( repFormat->getChromaFormatVpsIdc() == sps->getChromaFormatIdc() ); 589 assert( repFormat->getSeparateColourPlaneVpsFlag() == 0 ); 590 assert( repFormat->getPicHeightVpsInLumaSamples() == sps->getPicHeightInLumaSamples() ); 591 assert( repFormat->getPicWidthVpsInLumaSamples() == sps->getPicWidthInLumaSamples() ); 592 assert( repFormat->getBitDepthVpsLuma() == sps->getBitDepth(CHANNEL_TYPE_LUMA) ); 593 assert( repFormat->getBitDepthVpsChroma() == sps->getBitDepth(CHANNEL_TYPE_CHROMA) ); 594 assert( repFormat->getConformanceWindowVps().getWindowLeftOffset() == sps->getConformanceWindow().getWindowLeftOffset() ); 595 assert( repFormat->getConformanceWindowVps().getWindowRightOffset() == sps->getConformanceWindow().getWindowRightOffset() ); 596 assert( repFormat->getConformanceWindowVps().getWindowTopOffset() == sps->getConformanceWindow().getWindowTopOffset() ); 597 assert( repFormat->getConformanceWindowVps().getWindowBottomOffset() == sps->getConformanceWindow().getWindowBottomOffset() ); 598 } 599 } 600 601 //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer 602 UInt layerIdx = activeVPS->getLayerIdxInVps(m_apcSlicePilot->getLayerId()); 603 604 if ( activeVPS->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) ) 605 { 606 assert( sps->getPicWidthInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getPicWidthVpsInLumaSamples() ); 607 assert( sps->getPicHeightInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getPicHeightVpsInLumaSamples() ); 608 assert( sps->getChromaFormatIdc() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getChromaFormatVpsIdc() ); 609 assert( sps->getBitDepth(CHANNEL_TYPE_LUMA) <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsLuma() ); 610 assert( sps->getBitDepth(CHANNEL_TYPE_CHROMA) <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsChroma() ); 611 } 612 else if ( activeVPS->getVpsExtensionFlag() == 1 ) 613 { 614 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples()); 615 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples()); 616 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc()); 617 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma()); 618 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()); 619 } 620 #endif //SVC_EXTENSION 621 622 m_apcSlicePilot->setPPS(pps); 623 m_apcSlicePilot->setSPS(sps); 624 pps->setSPS(sps); 625 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumTileColumnsMinus1() + 1) : ((pps->getNumTileRowsMinus1() + 1)*(pps->getNumTileColumnsMinus1() + 1))); 626 pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) ); 627 pps->setMinCuChromaQpAdjSize( sps->getMaxCUWidth() >> ( pps->getMaxCuChromaQpAdjDepth()) ); 628 629 for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++) 630 { 631 #if SVC_EXTENSION 632 g_bitDepth[channel] = isLuma(ChannelType(channel)) ? m_apcSlicePilot->getBitDepthY() : m_apcSlicePilot->getBitDepthC(); 572 g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel)); 573 #endif 574 g_maxTrDynamicRange[channel] = (sps->getUseExtendedPrecision()) ? std::max<Int>(15, (g_bitDepth[channel] + 6)) : 15; 575 } 576 g_uiMaxCUWidth = sps->getMaxCUWidth(); 577 g_uiMaxCUHeight = sps->getMaxCUHeight(); 578 g_uiMaxCUDepth = sps->getMaxCUDepth(); 579 #if SVC_EXTENSION 580 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(vps->getChromaFormatIdc(sps, m_apcSlicePilot->getLayerId()), sps->getQuadtreeTULog2MinSize())); 633 581 #else 634 g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel)); 635 #endif 636 637 if (sps->getUseExtendedPrecision()) g_maxTrDynamicRange[channel] = std::max<Int>(15, (g_bitDepth[channel] + 6)); 638 else g_maxTrDynamicRange[channel] = 15; 639 } 640 g_uiMaxCUWidth = sps->getMaxCUWidth(); 641 g_uiMaxCUHeight = sps->getMaxCUHeight(); 642 g_uiMaxCUDepth = sps->getMaxCUDepth(); 643 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize())); 644 645 for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) 646 { 647 sps->setAMPAcc( i, sps->getUseAMP() ); 648 } 649 650 for (Int i = sps->getLog2DiffMaxMinCodingBlockSize(); i < sps->getMaxCUDepth(); i++) 651 { 652 sps->setAMPAcc( i, 0 ); 653 } 654 655 m_cSAO.destroy(); 656 #if SVC_EXTENSION 657 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 582 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize())); 583 #endif 584 585 // Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use. 586 #if SVC_EXTENSION 587 xGetNewPicBuffer( *(vps), *(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer() ); 658 588 #else 659 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 660 #endif 661 m_cLoopFilter.create( sps->getMaxCUDepth() ); 589 xGetNewPicBuffer (*(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer()); 590 #endif 591 592 #if ALIGNED_BUMPING 593 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 594 #else 595 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 596 #endif 597 598 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice 599 assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1)); 600 m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx); 601 602 // we now have a real slice: 603 TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); 604 605 // Update the PPS and SPS pointers with the ones of the picture. 606 pps=pSlice->getPPS(); 607 sps=pSlice->getSPS(); 608 609 // Initialise the various objects for the new set of settings 610 #if SVC_EXTENSION 611 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 612 #else 613 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 614 #endif 615 m_cLoopFilter.create( sps->getMaxCUDepth() ); 616 m_cPrediction.initTempBuff(sps->getChromaFormatIdc()); 617 618 Bool isField = false; 619 Bool isTopField = false; 620 621 if(!m_SEIs.empty()) 622 { 623 // Check if any new Picture Timing SEI has arrived 624 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 625 if (pictureTimingSEIs.size()>0) 626 { 627 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 628 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12); 629 isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11); 630 } 631 632 #if Q0189_TMVP_CONSTRAINTS 633 // Check if any new temporal motion vector prediction constraints SEI has arrived 634 SEIMessages seiTMVPConstrainsList = extractSeisByType (m_SEIs, SEI::TMVP_CONSTRAINTS); 635 if (seiTMVPConstrainsList.size() > 0) 636 { 637 assert ( m_pcPic->getTLayer() == 0 ); //this SEI can present only for AU with Tid equal to 0 638 SEITMVPConstrains* tmvpConstraintSEI = (SEITMVPConstrains*) *(seiTMVPConstrainsList.begin()); 639 if ( tmvpConstraintSEI->prev_pics_not_used_flag == 1 ) 640 { 641 //update all pics in the DPB such that they cannot be used for TMPV ref 642 TComList<TComPic*>::iterator iterRefPic = m_cListPic.begin(); 643 while( iterRefPic != m_cListPic.end() ) 644 { 645 TComPic *refPic = *iterRefPic; 646 if( ( refPic->getLayerId() == m_pcPic->getLayerId() ) && refPic->getReconMark() ) 647 { 648 for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--) 649 { 650 TComSlice *refSlice = refPic->getSlice(i); 651 refSlice->setAvailableForTMVPRefFlag( false ); 652 } 653 } 654 iterRefPic++; 655 } 656 } 657 } 658 #endif 659 } 660 661 //Set Field/Frame coding mode 662 m_pcPic->setField(isField); 663 m_pcPic->setTopField(isTopField); 664 665 // transfer any SEI messages that have been received to the picture 666 m_pcPic->setSEIs(m_SEIs); 667 m_SEIs.clear(); 668 669 // Recursive structure 670 #if SVC_EXTENSION 671 m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() ); 672 m_cCuDecoder.init ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId ); 673 #else 674 m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() ); 675 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 676 #endif 677 m_cTrQuant.init ( sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTrSize()); 678 679 m_cSliceDecoder.create(); 680 } 681 else 682 { 683 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice 684 m_pcPic->allocateNewSlice(); 685 assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1)); 686 m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx); 687 688 TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); // we now have a real slice. 689 690 const TComSPS *sps = pSlice->getSPS(); 691 const TComPPS *pps = pSlice->getPPS(); 692 693 // check that the current active PPS has not changed... 694 if (m_parameterSetManager.getSPSChangedFlag(sps->getSPSId()) ) 695 { 696 printf("Error - a new SPS has been decoded while processing a picture\n"); 697 exit(1); 698 } 699 if (m_parameterSetManager.getPPSChangedFlag(pps->getPPSId()) ) 700 { 701 printf("Error - a new PPS has been decoded while processing a picture\n"); 702 exit(1); 703 } 704 705 // Check if any new SEI has arrived 706 if(!m_SEIs.empty()) 707 { 708 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 709 SEIMessages &picSEI = m_pcPic->getSEIs(); 710 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 711 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 712 deleteSEIs(m_SEIs); 713 } 714 } 715 662 716 } 663 717 … … 669 723 { 670 724 #if SVC_EXTENSION 671 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) );672 673 // Following check should go wherever the VPS is activated674 if( !m_apcSlicePilot->getVPS()->getBaseLayerAvailableFlag() )675 {676 assert(nalu.m_layerId != 0);677 assert(m_apcSlicePilot->getVPS()->getNumAddLayerSets() > 0);678 679 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() >= 0 )680 {681 UInt layerIdx = m_apcSlicePilot->getVPS()->getOutputLayerSetIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx());682 assert(layerIdx > m_apcSlicePilot->getVPS()->getVpsNumLayerSetsMinus1());683 }684 }685 686 725 m_apcSlicePilot->initSlice( nalu.m_layerId ); 726 m_apcSlicePilot->setTLayer( nalu.m_temporalId ); 687 727 #else //SVC_EXTENSION 688 m_apcSlicePilot->initSlice(); 728 m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice 729 // it is not associated with picture, sps or pps structures. 689 730 #endif 690 731 … … 700 741 701 742 m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType); 702 #if SVC_EXTENSION 703 m_apcSlicePilot->setTLayer( nalu.m_temporalId ); 704 #endif 743 705 744 Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 706 745 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || … … 716 755 #endif 717 756 718 #if SVC_EXTENSION 719 setRefLayerParams(m_apcSlicePilot->getVPS()); 757 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager); 758 759 #if SVC_EXTENSION 760 const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); 761 assert (pps != 0); 762 const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); 763 assert (sps != 0); 764 const TComVPS *vps = m_parameterSetManager.getVPS(sps->getVPSId()); 765 assert (vps != 0); 766 767 // Following check should go wherever the VPS is activated 768 if( !vps->getBaseLayerAvailableFlag() ) 769 { 770 assert( nalu.m_layerId != 0 ); 771 assert( vps->getNumAddLayerSets() > 0 ); 772 773 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() >= 0 ) 774 { 775 UInt layerIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 776 assert( layerIdx > vps->getVpsNumLayerSetsMinus1() ); 777 } 778 } 779 780 setRefLayerParams(vps); 720 781 m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers); 721 782 #endif 722 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);723 783 724 784 // set POC for dependent slices in skipped pictures … … 779 839 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 780 840 { 781 Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 841 #if !SVC_EXTENSION 842 TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); 843 assert (pps != 0); 844 TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); 845 assert (sps != 0); 846 #endif 847 Int iMaxPOClsb = 1 << sps->getBitsForPOC(); 782 848 m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) ); 783 849 } … … 892 958 if( m_apcSlicePilot->getPocResetIdc() != 0 ) 893 959 { 894 if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )960 if( vps->getVpsPocLsbAlignedFlag() ) 895 961 { 896 962 m_pocResettingFlag = true; … … 956 1022 numAffectedLayers = 1; 957 1023 958 if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )959 { 960 for( UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ )961 { 962 affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);963 } 964 numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;1024 if( vps->getVpsPocLsbAlignedFlag() ) 1025 { 1026 for( UInt j = 0; j < vps->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ ) 1027 { 1028 affectedLayerList[j + 1] = vps->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j); 1029 } 1030 numAffectedLayers = vps->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1; 965 1031 } 966 1032 … … 1167 1233 m_apcSlicePilot->setAvailableForTMVPRefFlag( true ); 1168 1234 1169 // actual decoding starts here1170 xActivateParameterSets();1171 1172 1235 // Initialize ILRP if needed, only for the current layer 1173 1236 // ILRP intialization should go along with activation of parameters sets, … … 1175 1238 xInitILRP(m_apcSlicePilot); 1176 1239 1177 if (!m_apcSlicePilot->getDependentSliceSegmentFlag())1178 {1179 m_prevPOC = m_apcSlicePilot->getPOC();1180 curLayerId = m_layerId;1181 m_uiPrevLayerId = m_layerId;1182 }1183 m_bFirstSliceInSequence = false;1184 m_bFirstSliceInBitstream = false;1185 1186 1240 #else //SVC_EXTENSION 1187 1241 //we should only get a different poc for a new picture (with CTU address==0) … … 1205 1259 m_prevPOC = m_apcSlicePilot->getPOC(); 1206 1260 } 1261 #endif //SVC_EXTENSION 1262 1263 //detect lost reference picture and insert copy of earlier frame. 1264 { 1265 Int lostPoc; 1266 while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0) 1267 { 1268 xCreateLostPicture(lostPoc-1); 1269 } 1270 } 1271 1272 if (!m_apcSlicePilot->getDependentSliceSegmentFlag()) 1273 { 1274 m_prevPOC = m_apcSlicePilot->getPOC(); 1275 #if SVC_EXTENSION 1276 curLayerId = m_layerId; 1277 m_uiPrevLayerId = m_layerId; 1278 #endif 1279 } 1207 1280 1208 1281 // actual decoding starts here 1209 1282 xActivateParameterSets(); 1210 1283 1211 if (!m_apcSlicePilot->getDependentSliceSegmentFlag())1212 {1213 m_prevPOC = m_apcSlicePilot->getPOC();1214 }1215 1284 m_bFirstSliceInSequence = false; 1216 1285 m_bFirstSliceInBitstream = false; 1217 #endif //SVC_EXTENSION 1218 1219 //detect lost reference picture and insert copy of earlier frame. 1220 Int lostPoc; 1221 while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0) 1222 { 1223 xCreateLostPicture(lostPoc-1); 1224 } 1286 1287 TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1288 1289 #if SVC_EXTENSION 1225 1290 if (m_bFirstSliceInPicture) 1226 1291 { 1227 #if SVC_EXTENSION1228 1292 #if AVC_BASE 1229 if( m_layerId > 0 && m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getNonHEVCBaseLayerFlag() )1293 if( m_layerId > 0 && vps->getNonHEVCBaseLayerFlag() ) 1230 1294 { 1231 1295 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); … … 1336 1400 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1337 1401 { 1338 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++)1402 for (UInt i = 0; i < vps->getMaxLayers(); i++) 1339 1403 { 1340 1404 m_ppcTDecTop[i]->setLayerInitializedFlag(false); … … 1345 1409 xCheckLayerReset(); 1346 1410 xSetLayerInitializedFlag(); 1347 #endif 1348 1349 // Buffer initialize for prediction. 1350 m_cPrediction.initTempBuff(m_apcSlicePilot->getSPS()->getChromaFormatIdc()); 1351 #if ALIGNED_BUMPING 1352 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1353 #else 1354 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1355 #endif 1356 // Get a new picture buffer 1357 xGetNewPicBuffer (m_apcSlicePilot, m_pcPic); 1358 1411 1359 1412 #if SVC_POC 1360 1413 m_pcPic->setCurrAuFlag( true ); … … 1399 1452 else 1400 1453 { 1401 if( m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag())1454 if( vps->getBaseLayerInternalFlag()) 1402 1455 { 1403 1456 /* When the picture with nuh_layer_id equal to 0 in an access unit is not an IDR picture … … 1417 1470 and there is at least one other picture in the same access unit that is not an IRAP picture, 1418 1471 the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */ 1419 if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )1472 if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && vps->getBaseLayerInternalFlag() ) 1420 1473 { 1421 1474 assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 ); … … 1425 1478 vps_base_layer_internal_flag is equal to 1 and there is at least one non-IDR picture in the same access unit, 1426 1479 the value of poc_reset_idc shall be equal to 2 for all pictures in the access unit. */ 1427 if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )1480 if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && vps->getBaseLayerInternalFlag() ) 1428 1481 { 1429 1482 assert( m_apcSlicePilot->getPocResetIdc() == 2 ); … … 1443 1496 } 1444 1497 #endif 1445 1446 Bool isField = false; 1447 Bool isTopField = false; 1448 1449 if(!m_SEIs.empty()) 1450 { 1451 // Check if any new Picture Timing SEI has arrived 1452 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 1453 if (pictureTimingSEIs.size()>0) 1454 { 1455 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 1456 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12); 1457 isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11); 1458 } 1459 1460 #if Q0189_TMVP_CONSTRAINTS 1461 // Check if any new temporal motion vector prediction constraints SEI has arrived 1462 SEIMessages seiTMVPConstrainsList = extractSeisByType (m_SEIs, SEI::TMVP_CONSTRAINTS); 1463 if (seiTMVPConstrainsList.size() > 0) 1464 { 1465 assert ( m_pcPic->getTLayer() == 0 ); //this SEI can present only for AU with Tid equal to 0 1466 SEITMVPConstrains* tmvpConstraintSEI = (SEITMVPConstrains*) *(seiTMVPConstrainsList.begin()); 1467 if ( tmvpConstraintSEI->prev_pics_not_used_flag == 1 ) 1468 { 1469 //update all pics in the DPB such that they cannot be used for TMPV ref 1470 TComList<TComPic*>::iterator iterRefPic = m_cListPic.begin(); 1471 while( iterRefPic != m_cListPic.end() ) 1472 { 1473 TComPic *refPic = *iterRefPic; 1474 if( ( refPic->getLayerId() == m_pcPic->getLayerId() ) && refPic->getReconMark() ) 1475 { 1476 for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--) 1477 { 1478 TComSlice *refSlice = refPic->getSlice(i); 1479 refSlice->setAvailableForTMVPRefFlag( false ); 1480 } 1481 } 1482 iterRefPic++; 1483 } 1484 } 1485 } 1486 #endif 1487 } 1488 1489 //Set Field/Frame coding mode 1490 m_pcPic->setField(isField); 1491 m_pcPic->setTopField(isTopField); 1492 1493 // transfer any SEI messages that have been received to the picture 1494 m_pcPic->setSEIs(m_SEIs); 1495 m_SEIs.clear(); 1496 1497 // Recursive structure 1498 m_cCuDecoder.create ( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getChromaFormatIdc() ); 1499 #if SVC_EXTENSION 1500 m_cCuDecoder.init ( m_ppcTDecTop,&m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, curLayerId ); 1501 #else 1502 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 1503 #endif 1504 m_cTrQuant.init ( g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getMaxTrSize()); 1505 1506 m_cSliceDecoder.create(); 1507 } 1508 else 1509 { 1510 // Check if any new SEI has arrived 1511 if(!m_SEIs.empty()) 1512 { 1513 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 1514 SEIMessages &picSEI = m_pcPic->getSEIs(); 1515 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 1516 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 1517 deleteSEIs(m_SEIs); 1518 } 1519 } 1520 1521 // Set picture slice pointer 1522 TComSlice* pcSlice = m_apcSlicePilot; 1523 1524 m_pcPic->getPicSym()->initTiles(pcSlice->getPPS()); 1525 m_pcPic->getPicSym()->initCtuTsRsAddrMaps(); 1526 1498 } 1499 #endif //SVC_EXTENSION 1500 1527 1501 // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses. 1528 1502 // Now, having set up the maps, convert them to the correct form. … … 1534 1508 pcSlice->setSliceCurEndCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr())); 1535 1509 } 1536 1537 if (m_bFirstSliceInPicture) 1538 { 1539 if(m_pcPic->getNumAllocatedSlice() != 1) 1540 { 1541 m_pcPic->clearSliceBuffer(); 1542 } 1543 } 1544 else 1545 { 1546 m_pcPic->allocateNewSlice(); 1547 } 1548 assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1)); 1549 m_apcSlicePilot = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1550 m_pcPic->getPicSym()->setSlice(pcSlice, m_uiSliceIdx); 1551 1510 1552 1511 m_pcPic->setTLayer(nalu.m_temporalId); 1553 1512 … … 1577 1536 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1578 1537 #if AVC_BASE 1579 if( refLayerId == 0 && m_parameterSetManager Decoder.getActiveVPS()->getNonHEVCBaseLayerFlag() )1538 if( refLayerId == 0 && m_parameterSetManager.getActiveVPS()->getNonHEVCBaseLayerFlag() ) 1580 1539 { 1581 1540 TComPic* pic = *m_ppcTDecTop[0]->getListPic()->begin(); … … 1619 1578 1620 1579 // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0. 1621 Bool phaseSetPresentFlag; 1622 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 1623 pcSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma ); 1624 1625 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1626 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1580 const ResamplingPhase &resamplingPhase = pcSlice->getPPS()->getResamplingPhase( refLayerId ); 1581 1582 assert( ( (widthEL != widthBL) || (resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0) ) 1583 && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) ); 1627 1584 1628 1585 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); … … 1673 1630 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1674 1631 #if AVC_BASE 1675 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getNonHEVCBaseLayerFlag() )1632 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && pcSlice->getVPS()->getNonHEVCBaseLayerFlag() ) 1676 1633 { 1677 1634 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); … … 1792 1749 if(pcSlice->getSPS()->getScalingListFlag()) 1793 1750 { 1794 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1795 1796 #if SVC_EXTENSION 1797 if( pcSlice->getPPS()->getScalingListPresentFlag() || pcSlice->getPPS()->getInferScalingListFlag() ) 1751 TComScalingList scalingList; 1752 1753 #if SVC_EXTENSION 1754 if( pcSlice->getPPS()->getInferScalingListFlag() ) 1755 { 1756 const TComPPS *refPps = m_ppcTDecTop[pcSlice->getPPS()->getScalingListRefLayerId()]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 1757 scalingList = refPps->getScalingList(); 1758 } 1759 else 1760 #endif 1761 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1762 { 1763 scalingList = pcSlice->getPPS()->getScalingList(); 1764 } 1765 #if SVC_EXTENSION 1766 else if( pcSlice->getSPS()->getInferScalingListFlag() ) 1767 { 1768 const TComSPS *refSps = m_ppcTDecTop[pcSlice->getSPS()->getScalingListRefLayerId()]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 1769 scalingList = refSps->getScalingList(); 1770 } 1771 #endif 1772 else if (pcSlice->getSPS()->getScalingListPresentFlag()) 1773 { 1774 scalingList = pcSlice->getSPS()->getScalingList(); 1775 } 1776 else 1777 { 1778 scalingList.setDefaultScalingList(); 1779 } 1780 #if SVC_EXTENSION 1781 m_cTrQuant.setScalingListDec(scalingList, pcSlice->getChromaFormatIdc()); 1798 1782 #else 1799 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1800 #endif 1801 { 1802 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1803 } 1804 1805 #if SVC_EXTENSION 1806 if( m_layerId == 0 || ( m_layerId > 0 && !pcSlice->getPPS()->getInferScalingListFlag() && !pcSlice->getSPS()->getInferScalingListFlag() ) ) 1807 #endif 1808 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1809 { 1810 pcSlice->setDefaultScalingList(); 1811 } 1812 m_cTrQuant.setScalingListDec(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc()); 1783 m_cTrQuant.setScalingListDec(scalingList, pcSlice->getSPS()->getChromaFormatIdc()); 1784 #endif 1813 1785 m_cTrQuant.setUseScalingList(true); 1814 1786 } 1815 1787 else 1816 1788 { 1789 #if SVC_EXTENSION 1790 m_cTrQuant.setFlatScalingList(pcSlice->getChromaFormatIdc()); 1791 #else 1817 1792 m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc()); 1793 #endif 1818 1794 m_cTrQuant.setUseScalingList(false); 1819 1795 } … … 1833 1809 } 1834 1810 1835 Void TDecTop::xDecodeVPS( )1811 Void TDecTop::xDecodeVPS(const std::vector<UChar> *pNaluData) 1836 1812 { 1837 1813 TComVPS* vps = new TComVPS(); 1838 1814 1839 1815 m_cEntropyDecoder.decodeVPS( vps ); 1840 m_parameterSetManager Decoder.storePrefetchedVPS(vps);1816 m_parameterSetManager.storeVPS(vps, pNaluData); 1841 1817 #if SVC_EXTENSION 1842 1818 checkValueOfTargetOutputLayerSetIdx(vps); 1843 #endif 1844 } 1845 1846 Void TDecTop::xDecodeSPS() 1819 1820 #if AVC_BASE 1821 if( vps->getNonHEVCBaseLayerFlag() ) 1822 { 1823 if( !m_ppcTDecTop[0]->getBLReconFile()->good() ) 1824 { 1825 printf( "Base layer YUV input reading error\n" ); 1826 exit(EXIT_FAILURE); 1827 } 1828 } 1829 else 1830 { 1831 TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic(); 1832 cListPic->clear(); 1833 } 1834 #endif 1835 1836 xDeriveSmallestLayerId(vps); 1837 #endif 1838 } 1839 1840 Void TDecTop::xDecodeSPS(const std::vector<UChar> *pNaluData) 1847 1841 { 1848 1842 TComSPS* sps = new TComSPS(); … … 1854 1848 #endif 1855 1849 m_cEntropyDecoder.decodeSPS( sps ); 1856 m_parameterSetManager Decoder.storePrefetchedSPS(sps);1850 m_parameterSetManager.storeSPS(sps, pNaluData); 1857 1851 } 1858 1852 1859 1853 #if CGS_3D_ASYMLUT 1860 Void TDecTop::xDecodePPS( TCom3DAsymLUT * pc3DAsymLUT )1854 Void TDecTop::xDecodePPS( const std::vector<UChar> *pNaluData, TCom3DAsymLUT * pc3DAsymLUT ) 1861 1855 #else 1862 Void TDecTop::xDecodePPS( )1856 Void TDecTop::xDecodePPS(const std::vector<UChar> *pNaluData) 1863 1857 #endif 1864 1858 { … … 1873 1867 m_cEntropyDecoder.decodePPS( pps ); 1874 1868 #endif 1875 m_parameterSetManager Decoder.storePrefetchedPPS( pps);1869 m_parameterSetManager.storePPS( pps, pNaluData); 1876 1870 } 1877 1871 … … 1887 1881 #endif 1888 1882 #if LAYERS_NOT_PRESENT_SEI 1889 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager Decoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream );1883 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1890 1884 #else 1891 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager Decoder.getActiveSPS(), m_pDecodedSEIOutputStream );1885 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1892 1886 #endif 1893 1887 } … … 1895 1889 { 1896 1890 #if LAYERS_NOT_PRESENT_SEI 1897 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager Decoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream );1891 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1898 1892 #else 1899 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager Decoder.getActiveSPS(), m_pDecodedSEIOutputStream );1893 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1900 1894 #endif 1901 1895 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); … … 1904 1898 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1905 1899 #if R0247_SEI_ACTIVE 1906 getLayerDec(0)->m_parameterSetManagerDecoder.applyPrefetchedPS();1907 1900 assert(seiAps->activeSeqParameterSetId.size()>0); 1908 if( !getLayerDec(0)->m_parameterSetManager Decoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) )1901 if( !getLayerDec(0)->m_parameterSetManager.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) ) 1909 1902 { 1910 1903 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1913 1906 { 1914 1907 Int layerIdx = seiAps->layerSpsIdx[c]; 1915 getLayerDec(layerIdx)->m_parameterSetManagerDecoder.applyPrefetchedPS(); 1916 if( !getLayerDec(layerIdx)->m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[layerIdx] ) ) 1908 if( !getLayerDec(layerIdx)->m_parameterSetManager.activateSPSWithSEI( seiAps->activeSeqParameterSetId[layerIdx] ) ) 1917 1909 { 1918 1910 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1920 1912 } 1921 1913 #else 1922 m_parameterSetManagerDecoder.applyPrefetchedPS();1923 1914 assert(seiAps->activeSeqParameterSetId.size()>0); 1924 if (! m_parameterSetManager Decoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))1915 if (! m_parameterSetManager.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] )) 1925 1916 { 1926 1917 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1954 1945 assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1955 1946 #endif 1956 xDecodeVPS( );1947 xDecodeVPS(nalu.m_Bitstream->getFifo()); 1957 1948 #if RExt__DECODER_DEBUG_BIT_STATISTICS 1958 1949 TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0); 1959 1950 #endif 1960 1951 #if SVC_EXTENSION 1961 m_isLastNALWasEos = false; 1962 #if AVC_BASE 1963 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getNonHEVCBaseLayerFlag() ) 1964 { 1965 if( !m_ppcTDecTop[0]->getBLReconFile()->good() ) 1966 { 1967 printf( "Base layer YUV input reading error\n" ); 1968 exit(EXIT_FAILURE); 1969 } 1970 } 1971 else 1972 { 1973 TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic(); 1974 cListPic->clear(); 1975 } 1976 #endif 1977 xDeriveSmallestLayerId(m_parameterSetManagerDecoder.getPrefetchedVPS(0)); 1952 m_isLastNALWasEos = false; 1978 1953 #endif 1979 1954 return false; 1980 1955 1981 1956 case NAL_UNIT_SPS: 1982 xDecodeSPS( );1957 xDecodeSPS(nalu.m_Bitstream->getFifo()); 1983 1958 #if RExt__DECODER_DEBUG_BIT_STATISTICS 1984 1959 TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0); … … 1987 1962 1988 1963 case NAL_UNIT_PPS: 1989 xDecodePPS(1990 1964 #if CGS_3D_ASYMLUT 1991 &m_c3DAsymLUTPPS 1992 #endif 1993 ); 1965 xDecodePPS( nalu.m_Bitstream->getFifo(), &m_c3DAsymLUTPPS ); 1966 #else 1967 xDecodePPS(nalu.m_Bitstream->getFifo()); 1968 #endif 1994 1969 #if RExt__DECODER_DEBUG_BIT_STATISTICS 1995 1970 TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0); … … 2205 2180 Void TDecTop::xInitILRP(TComSlice *slice) 2206 2181 { 2207 TComSPS* pcSPS = slice->getSPS(); 2182 const TComVPS* vps = slice->getVPS(); 2183 const TComSPS* sps = slice->getSPS(); 2184 2208 2185 Int bitDepthY = slice->getBitDepthY(); 2209 2186 Int bitDepthC = slice->getBitDepthC(); 2210 Int picWidth = slice->getPicWidthInLumaSamples();2211 Int picHeight = slice->getPicHeightInLumaSamples();2212 2187 2213 2188 if( m_layerId > 0 ) … … 2216 2191 g_bitDepth[CHANNEL_TYPE_LUMA] = bitDepthY; 2217 2192 g_bitDepth[CHANNEL_TYPE_CHROMA] = bitDepthC; 2218 g_uiMaxCUWidth = pcSPS->getMaxCUWidth();2219 g_uiMaxCUHeight = pcSPS->getMaxCUHeight();2220 g_uiMaxCUDepth = pcSPS->getMaxCUDepth();2221 g_uiAddCUDepth = max (0, pcSPS->getLog2MinCodingBlockSize() - (Int)pcSPS->getQuadtreeTULog2MinSize() );2193 g_uiMaxCUWidth = sps->getMaxCUWidth(); 2194 g_uiMaxCUHeight = sps->getMaxCUHeight(); 2195 g_uiMaxCUDepth = sps->getMaxCUDepth(); 2196 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); 2222 2197 2223 2198 Int numReorderPics[MAX_TLAYER]; 2224 Window &conformanceWindow = slice->getConformanceWindow();2225 Window defaultDisplayWindow = pcSPS->getVuiParametersPresentFlag() ? pcSPS->getVuiParameters()->getDefaultDisplayWindow() : Window();2226 2199 2227 2200 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++ ) … … 2230 2203 { 2231 2204 assert( this->getLayerId() == 0 ); 2232 numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer);2205 numReorderPics[temporalLayer] = sps->getNumReorderPics(temporalLayer); 2233 2206 } 2234 2207 else 2235 { 2236 TComVPS *vps = slice->getVPS(); 2208 { 2237 2209 // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures. 2238 2210 numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer); … … 2244 2216 for (Int j=0; j < m_numDirectRefLayers; j++) 2245 2217 { 2246 2247 2218 m_cIlpPic[j] = new TComPic; 2248 2219 2249 #if AUXILIARY_PICTURES 2250 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 2251 #else 2252 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 2253 #endif 2220 m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 2221 2254 2222 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 2255 2223 { … … 2263 2231 TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdx ) 2264 2232 { 2265 TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS();2233 const TComVPS* vps = m_parameterSetManager.getActiveVPS(); 2266 2234 if( vps->getNumDirectRefLayers( m_layerId ) <= 0 ) 2267 2235 { … … 2272 2240 } 2273 2241 2274 Void TDecTop::setRefLayerParams( TComVPS* vps )2242 Void TDecTop::setRefLayerParams( const TComVPS* vps ) 2275 2243 { 2276 2244 for(UInt layerIdx = 0; layerIdx < m_numLayer; layerIdx++) … … 2404 2372 } 2405 2373 2406 Void TDecTop::markAllPicsAsNoCurrAu( TComVPS *vps)2374 Void TDecTop::markAllPicsAsNoCurrAu( const TComVPS *vps ) 2407 2375 { 2408 2376 for(Int i = 0; i < MAX_LAYERS; i++) 2409 2377 { 2410 TComList<TComPic*>* listPic = this->getLayerDec(vps->getLayerIdInNuh(i))->getListPic();2378 TComList<TComPic*>* listPic = m_ppcTDecTop[vps->getLayerIdInNuh(i)]->getListPic(); 2411 2379 TComList<TComPic*>::iterator iterPic = listPic->begin(); 2412 2380 while ( iterPic != listPic->end() ) … … 2570 2538 } 2571 2539 2572 Void TDecTop::xSetSpatialEnhLayerFlag( TComSlice* slice, TComPic* pic)2573 { 2574 for(UInt i = 0; i < slice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ )2575 { 2576 const Window scalEL = slice->getPPS()->getScaledRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i));2577 const Window refEL = slice->getPPS()->getRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i));2540 Void TDecTop::xSetSpatialEnhLayerFlag( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic* pic ) 2541 { 2542 for(UInt i = 0; i < vps.getNumDirectRefLayers( m_layerId ); i++ ) 2543 { 2544 const Window scalEL = pps.getScaledRefLayerWindowForLayer(vps.getRefLayerId(m_layerId, i)); 2545 const Window refEL = pps.getRefLayerWindowForLayer(vps.getRefLayerId(m_layerId, i)); 2578 2546 Bool equalOffsets = scalEL.hasEqualOffset(refEL); 2579 Bool zeroPhase = slice->getPPS()->hasZeroResamplingPhase(slice->getVPS()->getRefLayerId(m_layerId, i));2547 Bool zeroPhase = pps.hasZeroResamplingPhase(vps.getRefLayerId(m_layerId, i)); 2580 2548 2581 2549 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( i ); 2582 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin());2583 2550 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 2584 2551 2585 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, i);2552 UInt refLayerId = vps.getRefLayerId(m_layerId, i); 2586 2553 Bool sameBitDepths = ( g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId] ); 2587 2554 2588 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == slice->getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == slice->getPicHeightInLumaSamples() && equalOffsets && zeroPhase )2555 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == vps.getPicWidthInLumaSamples(&sps, m_layerId) && pcPicYuvRecBase->getHeight(COMPONENT_Y) == vps.getPicHeightInLumaSamples(&sps, m_layerId) && equalOffsets && zeroPhase ) 2589 2556 { 2590 2557 pic->setEqualPictureSizeAndOffsetFlag( i, true ); … … 2593 2560 if( !pic->equalPictureSizeAndOffsetFlag(i) || !sameBitDepths 2594 2561 #if CGS_3D_ASYMLUT 2595 || slice->getPPS()->getCGSFlag() > 02562 || pps.getCGSFlag() > 0 2596 2563 #endif 2597 2564 #if LAYER_CTB … … 2603 2570 2604 2571 //only for scalable extension 2605 assert( slice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true );2572 assert( vps.getScalabilityMask( SCALABILITY_ID ) == true ); 2606 2573 } 2607 2574 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r1223 r1235 75 75 76 76 TComList<TComPic*> m_cListPic; // Dynamic buffer 77 ParameterSetManager Decoder m_parameterSetManagerDecoder; // storage for parameter sets77 ParameterSetManager m_parameterSetManager; // storage for parameter sets 78 78 TComSlice* m_apcSlicePilot; 79 79 … … 152 152 Int m_prevPicOrderCnt; 153 153 #if CONFORMANCE_BITSTREAM_MODE 154 Bool m_confModeFlag;155 std::vector<TComPic> m_confListPic; // Dynamic buffer for storing pictures for conformance purposes156 #endif 157 Bool m_isOutputLayerFlag;154 Bool m_confModeFlag; 155 std::vector<TComPic> m_confListPic; // Dynamic buffer for storing pictures for conformance purposes 156 #endif 157 Bool m_isOutputLayerFlag; 158 158 #endif //SVC_EXTENSION 159 159 160 160 public: 161 161 #if SVC_EXTENSION 162 static Bool 163 static Int 164 static Bool 165 static Bool 166 static Bool 167 static Bool 168 static Int 169 static Bool 170 static Bool 171 static Int 172 static Int 162 static Bool m_checkPocRestrictionsForCurrAu; 163 static Int m_pocResetIdcOrCurrAu; 164 static Bool m_baseLayerIdrFlag; 165 static Bool m_baseLayerPicPresentFlag; 166 static Bool m_baseLayerIrapFlag; 167 static Bool m_nonBaseIdrPresentFlag; 168 static Int m_nonBaseIdrType; 169 static Bool m_picNonIdrWithRadlPresentFlag; 170 static Bool m_picNonIdrNoLpPresentFlag; 171 static Int m_crossLayerPocResetPeriodId; 172 static Int m_crossLayerPocResetIdc; 173 173 #endif //SVC_EXTENSION 174 174 … … 189 189 190 190 Void deletePicBuffer(); 191 192 193 TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }194 195 191 196 192 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); … … 210 206 Int getParseIdc () { return m_parseIdc; } 211 207 Void setParseIdc (Int x) { m_parseIdc = x; } 212 Void markAllPicsAsNoCurrAu ( TComVPS *vps);208 Void markAllPicsAsNoCurrAu ( const TComVPS *vps ); 213 209 214 210 Int getLastPocPeriodId () { return m_lastPocPeriodId; } … … 240 236 Void setNumMotionPredRefLayers (Int num) { m_numMotionPredRefLayers = num; } 241 237 242 Void setRefLayerParams( TComVPS* vps );238 Void setRefLayerParams( const TComVPS* vps ); 243 239 244 240 #if AVC_BASE … … 251 247 Void checkValueOfTargetOutputLayerSetIdx(TComVPS *vps); 252 248 253 ParameterSetManager Decoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; }249 ParameterSetManager* getParameterSetManager() { return &m_parameterSetManager; } 254 250 255 251 #if CONFORMANCE_BITSTREAM_MODE 256 252 std::vector<TComPic>* getConfListPic() {return &m_confListPic; } 257 Bool const getConfModeFlag() { return m_confModeFlag; }258 Void setConfModeFlag(Bool x) { m_confModeFlag = x; }253 Bool const getConfModeFlag() { return m_confModeFlag; } 254 Void setConfModeFlag(Bool x) { m_confModeFlag = x; } 259 255 #endif 260 256 #endif //SVC_EXTENSION 261 257 262 258 protected: 263 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); 264 Void xCreateLostPicture (Int iLostPOC); 259 #if SVC_EXTENSION 260 Void xGetNewPicBuffer ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer); 261 #else 262 Void xGetNewPicBuffer (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer); 263 #endif 264 Void xCreateLostPicture (Int iLostPOC); 265 265 266 266 Void xActivateParameterSets(); 267 267 #if SVC_EXTENSION 268 268 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 269 Void xSetSpatialEnhLayerFlag( TComSlice* slice, TComPic* pic);269 Void xSetSpatialEnhLayerFlag( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic* pic ); 270 270 #else 271 271 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 272 272 #endif 273 Void xDecodeVPS( );274 Void xDecodeSPS( );273 Void xDecodeVPS(const std::vector<UChar> *pNaluData); 274 Void xDecodeSPS(const std::vector<UChar> *pNaluData); 275 275 #if CGS_3D_ASYMLUT 276 Void xDecodePPS( TCom3DAsymLUT * pc3DAsymLUT);276 Void xDecodePPS(const std::vector<UChar> *pNaluData, TCom3DAsymLUT *pc3DAsymLUT); 277 277 #else 278 Void xDecodePPS( );278 Void xDecodePPS(const std::vector<UChar> *pNaluData); 279 279 #endif 280 280 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); … … 282 282 #if SVC_EXTENSION 283 283 #if NO_CLRAS_OUTPUT_FLAG 284 Int getNoClrasOutputFlag() { return m_noClrasOutputFlag;}285 Void setNoClrasOutputFlag(Bool x) { m_noClrasOutputFlag = x; }286 Int getLayerInitializedFlag() { return m_layerInitializedFlag;}287 Void setLayerInitializedFlag(Bool x) { m_layerInitializedFlag = x; }288 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;}289 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; }284 Int getNoClrasOutputFlag() { return m_noClrasOutputFlag;} 285 Void setNoClrasOutputFlag(Bool x) { m_noClrasOutputFlag = x; } 286 Int getLayerInitializedFlag() { return m_layerInitializedFlag;} 287 Void setLayerInitializedFlag(Bool x) { m_layerInitializedFlag = x; } 288 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 289 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 290 290 #endif 291 291 #if CGS_3D_ASYMLUT 292 Void initAsymLut(TComSlice *pcSlice);293 #endif 294 Void resetPocRestrictionCheckParameters();295 Void xCheckLayerReset();296 Void xSetNoRaslOutputFlag();297 Void xSetLayerInitializedFlag();292 Void initAsymLut(TComSlice *pcSlice); 293 #endif 294 Void resetPocRestrictionCheckParameters(); 295 Void xCheckLayerReset(); 296 Void xSetNoRaslOutputFlag(); 297 Void xSetLayerInitializedFlag(); 298 298 #endif 299 299 };// END CLASS DEFINITION TDecTop -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1185 r1235 55 55 56 56 #if O0164_MULTI_LAYER_HRD 57 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr)57 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr) 58 58 #else 59 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)59 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps) 60 60 #endif 61 61 { … … 215 215 */ 216 216 #if O0164_MULTI_LAYER_HRD 217 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)217 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei) 218 218 #else 219 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps)219 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const TComSPS *sps) 220 220 #endif 221 221 { … … 341 341 342 342 #if SVC_EXTENSION 343 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps)344 { 345 TComHRD *hrd;343 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps) 344 { 345 const TComHRD *hrd; 346 346 if( bspNestingSei ) // If DU info SEI contained inside a BSP nesting SEI message 347 347 { … … 352 352 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 353 353 std::vector<Int> hrdIdx(maxValues, 0); 354 std::vector< TComHRD*> hrdVec;354 std::vector<const TComHRD*> hrdVec; 355 355 std::vector<Int> syntaxElemLen(maxValues, 0); 356 356 for(Int i = 0; i < maxValues; i++) … … 376 376 else 377 377 { 378 TComVUI *vui = sps->getVuiParameters();378 const TComVUI *vui = sps->getVuiParameters(); 379 379 hrd = vui->getHrdParameters(); 380 380 } … … 392 392 } 393 393 #else 394 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)395 { 396 TComVUI *vui = sps->getVuiParameters();394 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps) 395 { 396 const TComVUI *vui = sps->getVuiParameters(); 397 397 WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx"); 398 398 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) … … 409 409 410 410 #if SVC_EXTENSION 411 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps)411 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps) 412 412 #else 413 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps)413 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps) 414 414 #endif 415 415 { 416 416 Int i, nalOrVcl; 417 417 #if SVC_EXTENSION 418 TComHRD *hrd;418 const TComHRD *hrd; 419 419 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 420 420 { … … 425 425 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 426 426 std::vector<Int> hrdIdx(maxValues, 0); 427 std::vector< TComHRD*> hrdVec;427 std::vector<const TComHRD*> hrdVec; 428 428 std::vector<Int> syntaxElemLen(maxValues, 0); 429 429 for(i = 0; i < maxValues; i++) … … 448 448 else 449 449 { 450 TComVUI *vui = sps->getVuiParameters();450 const TComVUI *vui = sps->getVuiParameters(); 451 451 hrd = vui->getHrdParameters(); 452 452 } 453 453 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 454 454 #else 455 TComVUI *vui = sps->getVuiParameters();456 TComHRD *hrd = vui->getHrdParameters();455 const TComVUI *vui = sps->getVuiParameters(); 456 const TComHRD *hrd = vui->getHrdParameters(); 457 457 #endif 458 458 … … 495 495 496 496 #if SVC_EXTENSION 497 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps)497 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps) 498 498 #else 499 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps)499 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps) 500 500 #endif 501 501 { 502 502 Int i; 503 503 #if SVC_EXTENSION 504 TComHRD *hrd;505 TComVUI *vui = sps->getVuiParameters();504 const TComHRD *hrd; 505 const TComVUI *vui = sps->getVuiParameters(); 506 506 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 507 507 { … … 512 512 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 513 513 std::vector<Int> hrdIdx(maxValues, 0); 514 std::vector< TComHRD*> hrdVec;514 std::vector<const TComHRD*> hrdVec; 515 515 std::vector<Int> syntaxElemLen(maxValues, 0); 516 516 for(i = 0; i < maxValues; i++) … … 543 543 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 544 544 #else 545 TComVUI *vui = sps->getVuiParameters();546 TComHRD *hrd = vui->getHrdParameters();545 const TComVUI *vui = sps->getVuiParameters(); 546 const TComHRD *hrd = vui->getHrdParameters(); 547 547 #endif 548 548 … … 752 752 753 753 #if O0164_MULTI_LAYER_HRD 754 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps,TComSPS *sps)754 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComVPS *vps, const TComSPS *sps) 755 755 #else 756 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)756 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps) 757 757 #endif 758 758 { … … 1130 1130 1131 1131 #if O0164_MULTI_LAYER_HRD 1132 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei)1132 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei) 1133 1133 { 1134 1134 WRITE_UVLC( sei.m_bspIdx, "bsp_idx" ); … … 1149 1149 } 1150 1150 1151 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei)1151 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei) 1152 1152 { 1153 1153 assert(vps->getVpsVuiPresentFlag()); 1154 1154 1155 #if SVC_EXTENSION1156 1155 Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx; 1157 1156 Int seiOlsIdx = bspNestingSei.m_seiOlsIdx; … … 1159 1158 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 1160 1159 std::vector<Int> hrdIdx(maxValues, 0); 1161 std::vector< TComHRD*> hrdVec;1160 std::vector<const TComHRD*> hrdVec; 1162 1161 std::vector<Int> syntaxElemLen(maxValues, 0); 1163 1162 for(Int i = 0; i < maxValues; i++) … … 1191 1190 } 1192 1191 } 1193 #else1194 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);1195 UInt len;1196 UInt hrdIdx;1197 1198 if (schedCombCnt > 0)1199 {1200 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);1201 }1202 else1203 {1204 hrdIdx = 0;1205 }1206 1207 TComHRD *hrd = vps->getBspHrd(hrdIdx);1208 1209 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())1210 {1211 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;1212 }1213 else1214 {1215 len = 23 + 1;1216 }1217 1218 if (hrd->getNalHrdParametersPresentFlag())1219 {1220 for(UInt i = 0; i < schedCombCnt; i++)1221 {1222 WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" );1223 }1224 }1225 #if BSP_INIT_ARRIVAL_SEI1226 if( hrd->getVclHrdParametersPresentFlag() )1227 #else1228 else1229 #endif1230 {1231 for(UInt i = 0; i < schedCombCnt; i++)1232 {1233 WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" );1234 }1235 }1236 #endif1237 1192 } 1238 1193 -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
r1185 r1235 51 51 52 52 #if O0164_MULTI_LAYER_HRD 53 Void writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);53 Void writeSEImessage(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL); 54 54 #else 55 Void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps);55 Void writeSEImessage(TComBitIf& bs, const SEI& sei, const TComSPS *sps); 56 56 #endif 57 57 58 58 protected: 59 59 #if O0164_MULTI_LAYER_HRD 60 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);60 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei); 61 61 #else 62 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);62 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps); 63 63 #endif 64 64 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); … … 66 66 Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei); 67 67 #if SVC_EXTENSION 68 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps);69 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps);70 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps);68 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); 69 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); 70 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); 71 71 #else 72 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps);73 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps);74 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps);72 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps); 73 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps); 74 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps); 75 75 #endif 76 76 TComSPS *m_pSPS; … … 85 85 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 86 86 #if O0164_MULTI_LAYER_HRD 87 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps,TComSPS *sps);87 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComVPS *vps, const TComSPS *sps); 88 88 #else 89 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);89 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps); 90 90 #endif 91 91 Void xWriteSEITempMotionConstrainedTileSets(TComBitIf& bs, const SEITempMotionConstrainedTileSets& sei); … … 110 110 #endif 111 111 #if Q0189_TMVP_CONSTRAINTS 112 Void xWriteSEITMVPConstraints 112 Void xWriteSEITMVPConstraints(const SEITMVPConstrains &sei); 113 113 #endif 114 114 #if Q0247_FRAME_FIELD_INFO 115 Void xWriteSEIFrameFieldInfo 115 Void xWriteSEIFrameFieldInfo(const SEIFrameFieldInfo &sei); 116 116 #endif 117 117 #if O0164_MULTI_LAYER_HRD 118 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei);119 Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei);118 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei); 119 Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei); 120 120 Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 121 121 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r1214 r1235 509 509 TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx()); 510 510 UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc); 511 const Window &scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);511 Window scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 512 512 TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 513 513 // borders of down-sampled picture -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1231 r1235 96 96 } 97 97 98 Void TEncCavlc::codeShortTermRefPicSet( TComSPS* pcSPS,TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx)98 Void TEncCavlc::codeShortTermRefPicSet( const TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx) 99 99 { 100 100 #if PRINT_RPS_INFO … … 153 153 154 154 155 Void TEncCavlc::codePPS( TComPPS* pcPPS156 155 #if CGS_3D_ASYMLUT 157 , TEnc3DAsymLUT * pc3DAsymLUT 158 #endif 159 ) 156 Void TEncCavlc::codePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 157 #else 158 Void TEncCavlc::codePPS( const TComPPS* pcPPS ) 159 #endif 160 160 { 161 161 #if ENC_DEC_TRACE 162 162 xTracePPSHeader (pcPPS); 163 163 #endif 164 165 const UInt numberValidComponents = getNumberValidComponents(pcPPS->getSPS()->getChromaFormatIdc());166 164 167 165 WRITE_UVLC( pcPPS->getPPSId(), "pps_pic_parameter_set_id" ); … … 184 182 } 185 183 186 WRITE_SVLC( COMPONENT_Cb<numberValidComponents ? (pcPPS->getQpOffset(COMPONENT_Cb)) : 0, "pps_cb_qp_offset" ); 187 WRITE_SVLC( COMPONENT_Cr<numberValidComponents ? (pcPPS->getQpOffset(COMPONENT_Cr)) : 0, "pps_cr_qp_offset" ); 188 189 assert(numberValidComponents <= 3); // if more than 3 components (eg 4:4:4:4), then additional offsets will have to go in extension area... 184 WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" ); 185 WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" ); 190 186 191 187 WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0, "pps_slice_chroma_qp_offsets_present_flag" ); … … 232 228 if( pcPPS->getScalingListPresentFlag() ) 233 229 { 234 codeScalingList( m_pcSlice->getScalingList() );230 codeScalingList( pcPPS->getScalingList() ); 235 231 } 236 232 WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag"); … … 320 316 WRITE_CODE( pcPPS->getRefLocationOffsetLayerId(k), 6, "ref_loc_offset_layer_id" ); 321 317 WRITE_FLAG( pcPPS->getScaledRefLayerOffsetPresentFlag(k) ? 1 : 0, "scaled_ref_layer_offset_prsent_flag" ); 322 if (pcPPS->getScaledRefLayerOffsetPresentFlag(k))318 if( pcPPS->getScaledRefLayerOffsetPresentFlag(k) ) 323 319 { 324 320 Window scaledWindow = pcPPS->getScaledRefLayerWindow(k); … … 328 324 WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" ); 329 325 } 326 330 327 WRITE_FLAG( pcPPS->getRefRegionOffsetPresentFlag(k) ? 1 : 0, "ref_region_offset_prsent_flag" ); 331 if (pcPPS->getRefRegionOffsetPresentFlag(k)) 328 329 if( pcPPS->getRefRegionOffsetPresentFlag(k) ) 332 330 { 333 Window refWindow = pcPPS->getRefLayerWindow(k);331 const Window refWindow = pcPPS->getRefLayerWindow(k); 334 332 WRITE_SVLC( refWindow.getWindowLeftOffset() >> 1, "ref_region_left_offset" ); 335 333 WRITE_SVLC( refWindow.getWindowTopOffset() >> 1, "ref_region_top_offset" ); … … 337 335 WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" ); 338 336 } 337 339 338 WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(k) ? 1 : 0, "resample_phase_set_present_flag" ); 340 if (pcPPS->getResamplePhaseSetPresentFlag(k)) 339 340 if( pcPPS->getResamplePhaseSetPresentFlag(k) ) 341 341 { 342 342 WRITE_UVLC( pcPPS->getPhaseHorLuma(k), "phase_hor_luma" ); … … 367 367 } 368 368 369 Void TEncCavlc::codeVUI( TComVUI *pcVUI,TComSPS* pcSPS )369 Void TEncCavlc::codeVUI( const TComVUI *pcVUI, const TComSPS* pcSPS ) 370 370 { 371 371 #if ENC_DEC_TRACE … … 421 421 WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset()/ TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_bottom_offset"); 422 422 } 423 TimingInfo *timingInfo = pcVUI->getTimingInfo();423 const TimingInfo *timingInfo = pcVUI->getTimingInfo(); 424 424 WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vui_timing_info_present_flag"); 425 425 if(timingInfo->getTimingInfoPresentFlag()) … … 453 453 } 454 454 455 Void TEncCavlc::codeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 )455 Void TEncCavlc::codeHrdParameters( const TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ) 456 456 { 457 457 if( commonInfPresentFlag ) … … 484 484 { 485 485 WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0, "fixed_pic_rate_general_flag"); 486 Bool fixedPixRateWithinCvsFlag = true; 486 487 if( !hrd->getFixedPicRateFlag( i ) ) 487 488 { 489 fixedPixRateWithinCvsFlag = hrd->getFixedPicRateWithinCvsFlag( i ); 488 490 WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag"); 489 491 } 490 else 491 { 492 hrd->setFixedPicRateWithinCvsFlag( i, true ); 493 } 494 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 492 if( fixedPixRateWithinCvsFlag ) 495 493 { 496 494 WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ), "elemental_duration_in_tc_minus1"); … … 526 524 } 527 525 528 Void TEncCavlc::codeSPS( TComSPS* pcSPS )526 Void TEncCavlc::codeSPS( const TComSPS* pcSPS ) 529 527 { 530 528 #if SVC_EXTENSION … … 662 660 if(pcSPS->getScalingListPresentFlag()) 663 661 { 664 codeScalingList( m_pcSlice->getScalingList() );662 codeScalingList( pcSPS->getScalingList() ); 665 663 } 666 664 #if SVC_EXTENSION … … 683 681 assert( pcSPS->getMaxTLayers() > 0 ); 684 682 685 TComRPSList* rpsList = pcSPS->getRPSList(); 686 TComReferencePictureSet* rps; 683 const TComRPSList* rpsList = pcSPS->getRPSList(); 687 684 688 685 WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" ); 689 686 for(Int i=0; i < rpsList->getNumberOfReferencePictureSets(); i++) 690 687 { 691 rps = rpsList->getReferencePictureSet(i);692 codeShortTermRefPicSet( pcSPS,rps,false, i);688 const TComReferencePictureSet*rps = rpsList->getReferencePictureSet(i); 689 codeShortTermRefPicSet( rps,false, i); 693 690 } 694 691 WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0, "long_term_ref_pics_present_flag" ); … … 778 775 } 779 776 780 Void TEncCavlc::codeVPS( TComVPS* pcVPS )777 Void TEncCavlc::codeVPS( const TComVPS* pcVPS ) 781 778 { 782 779 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); … … 824 821 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 825 822 WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6, "vps_max_nuh_reserved_zero_layer_id" ); 826 pcVPS->setMaxOpSets(1);827 823 WRITE_UVLC( pcVPS->getMaxOpSets() - 1, "vps_max_op_sets_minus1" ); 828 824 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ ) … … 832 828 { 833 829 // Only applicable for version 1 834 pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );830 // pcVPS->setLayerIdIncludedFlag( true, opsIdx, i ); 835 831 #endif 836 832 WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" ); … … 838 834 } 839 835 840 TimingInfo *timingInfo = pcVPS->getTimingInfo();836 const TimingInfo *timingInfo = pcVPS->getTimingInfo(); 841 837 WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vps_timing_info_present_flag"); 842 838 if(timingInfo->getTimingInfoPresentFlag()) … … 849 845 WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(), "vps_num_ticks_poc_diff_one_minus1"); 850 846 } 851 pcVPS->setNumHrdParameters( 0 );852 847 WRITE_UVLC( pcVPS->getNumHrdParameters(), "vps_num_hrd_parameters" ); 853 848 854 849 if( pcVPS->getNumHrdParameters() > 0 ) 855 850 { 856 pcVPS->createHrdParamBuffer(); 857 } 858 for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ ) 859 { 860 // Only applicable for version 1 861 pcVPS->setHrdOpSetIdx( 0, i ); 862 WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ), "hrd_op_set_idx" ); 863 if( i > 0 ) 864 { 865 WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" ); 866 } 867 codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 851 for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ ) 852 { 853 // Only applicable for version 1 854 WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ), "hrd_op_set_idx" ); 855 if( i > 0 ) 856 { 857 WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" ); 858 } 859 codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 860 } 868 861 } 869 862 } … … 1004 997 { 1005 998 #endif 1006 TComReferencePictureSet* rps = pcSlice->getRPS();999 const TComReferencePictureSet* rps = pcSlice->getRPS(); 1007 1000 1008 1001 // check for bitstream restriction stating that: … … 1023 1016 { 1024 1017 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); 1025 codeShortTermRefPicSet( pcSlice->getSPS(),rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets());1018 codeShortTermRefPicSet( rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets()); 1026 1019 } 1027 1020 else … … 1247 1240 { 1248 1241 SliceType sliceType = pcSlice->getSliceType(); 1249 Int encCABACTableIdx = pcSlice->getPPS()->getEncCABACTableIdx();1242 SliceType encCABACTableIdx = pcSlice->getEncCABACTableIdx(); 1250 1243 Bool encCabacInitFlag = (sliceType!=encCABACTableIdx && encCABACTableIdx!=I_SLICE) ? true : false; 1251 1244 pcSlice->setCabacInitFlag( encCabacInitFlag ); … … 1318 1311 } 1319 1312 1320 Void TEncCavlc::codePTL( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1)1313 Void TEncCavlc::codePTL( const TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1) 1321 1314 { 1322 1315 if(profilePresentFlag) … … 1364 1357 } 1365 1358 } 1366 Void TEncCavlc::codeProfileTier( ProfileTierLevel* ptl )1359 Void TEncCavlc::codeProfileTier( const ProfileTierLevel* ptl ) 1367 1360 { 1368 1361 WRITE_CODE( ptl->getProfileSpace(), 2 , "XXX_profile_space[]"); … … 1734 1727 * \param scalingList quantization matrix information 1735 1728 */ 1736 Void TEncCavlc::codeScalingList( TComScalingList* scalingList ) 1737 { 1738 UInt listId,sizeId; 1739 Bool scalingListPredModeFlag; 1740 1729 Void TEncCavlc::codeScalingList( const TComScalingList &scalingList ) 1730 { 1741 1731 //for each size 1742 for( sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)1743 { 1744 Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.1745 1746 for( listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)1747 { 1748 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId);1732 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) 1733 { 1734 const Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries. 1735 1736 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep) 1737 { 1738 Bool scalingListPredModeFlag = scalingList.getScalingListPredModeFlag(sizeId, listId); 1749 1739 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" ); 1750 1740 if(!scalingListPredModeFlag)// Copy Mode … … 1753 1743 { 1754 1744 // adjust the code, to cope with the missing chroma entries 1755 WRITE_UVLC( ((Int)listId - (Int)scalingList ->getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta");1745 WRITE_UVLC( ((Int)listId - (Int)scalingList.getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta"); 1756 1746 } 1757 1747 else 1758 1748 { 1759 WRITE_UVLC( (Int)listId - (Int)scalingList ->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");1749 WRITE_UVLC( (Int)listId - (Int)scalingList.getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta"); 1760 1750 } 1761 1751 } 1762 1752 else// DPCM Mode 1763 1753 { 1764 xCodeScalingList( scalingList, sizeId, listId);1754 xCodeScalingList(&scalingList, sizeId, listId); 1765 1755 } 1766 1756 } … … 1773 1763 * \param listIdc list index 1774 1764 */ 1775 Void TEncCavlc::xCodeScalingList( TComScalingList* scalingList, UInt sizeId, UInt listId)1765 Void TEncCavlc::xCodeScalingList(const TComScalingList* scalingList, UInt sizeId, UInt listId) 1776 1766 { 1777 1767 Int coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); … … 1779 1769 Int nextCoef = SCALING_LIST_START_VALUE; 1780 1770 Int data; 1781 Int *src = scalingList->getScalingListAddress(sizeId, listId);1771 const Int *src = scalingList->getScalingListAddress(sizeId, listId); 1782 1772 if( sizeId > SCALING_LIST_8x8 ) 1783 1773 { … … 1814 1804 } 1815 1805 return false; 1816 }1817 Bool TComScalingList::checkPredMode(UInt sizeId, UInt listId)1818 {1819 Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.1820 1821 for(Int predListIdx = (Int)listId ; predListIdx >= 0; predListIdx-=predListStep)1822 {1823 if( !memcmp(getScalingListAddress(sizeId,listId),((listId == predListIdx) ?1824 getScalingListDefaultAddress(sizeId, predListIdx): getScalingListAddress(sizeId, predListIdx)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix1825 && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value1826 {1827 setRefMatrixId(sizeId, listId, predListIdx);1828 return false;1829 }1830 }1831 return true;1832 1806 } 1833 1807 … … 1947 1921 } 1948 1922 1949 Void TEncCavlc::codeVPSExtension (TComVPS *vps)1923 Void TEncCavlc::codeVPSExtension( const TComVPS *vps ) 1950 1924 { 1951 1925 Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1]; … … 2071 2045 for( Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < vps->getNumProfileTierLevel(); idx++ ) 2072 2046 { 2073 vps->setProfilePresentFlag(idx, true);2074 2075 2047 WRITE_FLAG( vps->getProfilePresentFlag(idx), "vps_profile_present_flag[i]" ); 2076 2048 … … 2216 2188 WRITE_CODE(1, 8, "vps_non_vui_extension_data_byte"); 2217 2189 } 2218 2219 vps->setVpsVuiPresentFlag(true); 2190 2220 2191 WRITE_FLAG( vps->getVpsVuiPresentFlag() ? 1 : 0, "vps_vui_present_flag" ); 2221 2192 … … 2231 2202 } 2232 2203 2233 Void TEncCavlc::codeRepFormat( RepFormat *repFormat )2204 Void TEncCavlc::codeRepFormat( const RepFormat *repFormat ) 2234 2205 { 2235 2206 WRITE_CODE( repFormat->getPicWidthVpsInLumaSamples (), 16, "pic_width_vps_in_luma_samples" ); … … 2264 2235 } 2265 2236 2266 Void TEncCavlc::codeVpsDpbSizeTable( TComVPS *vps)2237 Void TEncCavlc::codeVpsDpbSizeTable( const TComVPS *vps ) 2267 2238 { 2268 2239 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) … … 2297 2268 } 2298 2269 2299 Void TEncCavlc::codeVPSVUI (TComVPS *vps)2270 Void TEncCavlc::codeVPSVUI( const TComVPS *vps ) 2300 2271 { 2301 2272 Int i,j; 2302 2273 WRITE_FLAG(vps->getCrossLayerPictureTypeAlignFlag(), "cross_layer_pic_type_aligned_flag"); 2303 if (!vps->getCrossLayerPictureTypeAlignFlag()) 2274 2275 if( !vps->getCrossLayerPictureTypeAlignFlag() ) 2304 2276 { 2305 2277 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); … … 2308 2280 { 2309 2281 // When not present, the value of cross_layer_irap_aligned_flag is inferred to be equal to vps_vui_present_flag, 2310 // i.e. it is true in this function 2311 vps->setCrossLayerIrapAlignFlag( true ); 2282 assert( vps->getCrossLayerIrapAlignFlag() == true ); 2312 2283 } 2313 2284 … … 2465 2436 } 2466 2437 2467 Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS )2438 Void TEncCavlc::codeSPSExtension( const TComSPS* pcSPS ) 2468 2439 { 2469 2440 // more syntax elements to be written here … … 2473 2444 } 2474 2445 2475 Void TEncCavlc::codeVpsVuiBspHrdParams( TComVPS * const vps)2446 Void TEncCavlc::codeVpsVuiBspHrdParams( const TComVPS* vps ) 2476 2447 { 2477 2448 WRITE_UVLC( vps->getVpsNumAddHrdParams(), "vps_num_add_hrd_params" ); … … 2528 2499 } 2529 2500 2530 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_ comb_hrd_idx[h][i][t][j][k]");2501 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_hrd_idx[h][i][t][j][k]"); 2531 2502 } 2532 2503 2533 WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_ comb_sched_idx[h][i][t][j][k]");2504 WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_sched_idx[h][i][t][j][k]"); 2534 2505 } 2535 2506 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h
r1224 r1235 75 75 TComSlice* m_pcSlice; 76 76 77 Void codeShortTermRefPicSet ( TComSPS* pcSPS,TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );77 Void codeShortTermRefPicSet ( const TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx ); 78 78 Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag ); 79 79 … … 81 81 82 82 Void resetEntropy (); 83 Void determineCabacInitIdx () {};83 SliceType determineCabacInitIdx () { assert(0); return I_SLICE; }; 84 84 85 85 Void setBitstream ( TComBitIf* p ) { m_pcBitIf = p; } … … 87 87 Void resetBits () { m_pcBitIf->resetBits(); } 88 88 UInt getNumberOfWrittenBits() { return m_pcBitIf->getNumberOfWrittenBits(); } 89 Void codeVPS ( TComVPS* pcVPS ); 90 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); 91 Void codeSPS ( TComSPS* pcSPS ); 92 Void codePPS ( TComPPS* pcPPS 89 Void codeVPS ( const TComVPS* pcVPS ); 90 Void codeVUI ( const TComVUI *pcVUI, const TComSPS* pcSPS ); 91 Void codeSPS ( const TComSPS* pcSPS ); 93 92 #if CGS_3D_ASYMLUT 94 , TEnc3DAsymLUT * pc3DAsymLUT 93 Void codePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ); 94 #else 95 Void codePPS ( const TComPPS* pcPPS ); 95 96 #endif 96 );97 97 Void codeSliceHeader ( TComSlice* pcSlice ); 98 Void codePTL ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);99 Void codeProfileTier ( ProfileTierLevel* ptl );100 Void codeHrdParameters ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );98 Void codePTL ( const TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1); 99 Void codeProfileTier ( const ProfileTierLevel* ptl ); 100 Void codeHrdParameters ( const TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 101 101 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 102 102 Void codeTerminatingBit ( UInt uilsLast ); … … 146 146 Void xCodePredWeightTable ( TComSlice* pcSlice ); 147 147 148 Void codeScalingList ( TComScalingList*scalingList );149 Void xCodeScalingList ( TComScalingList* scalingList, UInt sizeId, UInt listId);148 Void codeScalingList ( const TComScalingList &scalingList ); 149 Void xCodeScalingList ( const TComScalingList* scalingList, UInt sizeId, UInt listId); 150 150 Void codeDFFlag ( UInt uiCode, const Char *pSymbolName ); 151 151 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); … … 154 154 155 155 #if SVC_EXTENSION 156 Void codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow );157 Void codeSPSExtension ( TComSPS* pcSPS);158 Void codeVPSExtension ( TComVPS* pcVPS);159 Void codeVPSVUI ( TComVPS *vps);160 Void codeRepFormat ( RepFormat *repFormat );161 Void codeVpsDpbSizeTable ( TComVPS *vps );162 Void codeVpsVuiBspHrdParams( TComVPS * const );156 Void codeSliceHeaderExtn ( TComSlice* slice, Int shBitsWrittenTillNow ); 157 Void codeSPSExtension ( const TComSPS* sps ); 158 Void codeVPSExtension ( const TComVPS* vps ); 159 Void codeVPSVUI ( const TComVPS* vps ); 160 Void codeRepFormat ( const RepFormat *repFormat ); 161 Void codeVpsDpbSizeTable ( const TComVPS *vps ); 162 Void codeVpsVuiBspHrdParams( const TComVPS * const ); 163 163 164 164 #if CGS_3D_ASYMLUT -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1230 r1235 702 702 Void setWaveFrontSynchro(Int iWaveFrontSynchro) { m_iWaveFrontSynchro = iWaveFrontSynchro; } 703 703 Int getWaveFrontsynchro() { return m_iWaveFrontSynchro; } 704 Void setWaveFrontSubstreams(Int iWaveFrontSubstreams) { m_iWaveFrontSubstreams = iWaveFrontSubstreams; }705 Int getWaveFrontSubstreams() { return m_iWaveFrontSubstreams; }706 704 Void setDecodedPictureHashSEIEnabled(Int b) { m_decodedPictureHashSEIEnabled = b; } 707 705 Int getDecodedPictureHashSEIEnabled() { return m_decodedPictureHashSEIEnabled; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp
r1203 r1235 407 407 const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents(); 408 408 409 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )409 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 410 410 { 411 411 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 601 601 602 602 //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N) 603 if( pcPic->getSlice(0)->getSPS()->getAMPAcc(uiDepth))603 if(pcSlice->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 604 604 { 605 605 #if AMP_ENC_SPEEDUP … … 805 805 } 806 806 807 if( (g_uiMaxCUWidth>>uiDepth) == rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )807 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 808 808 { 809 809 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 816 816 #endif 817 817 } 818 else if( (g_uiMaxCUWidth>>uiDepth) > rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )818 else if( (g_uiMaxCUWidth>>uiDepth) > (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 819 819 { 820 820 iMinQP = iBaseQP; … … 909 909 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 910 910 911 if( (g_uiMaxCUWidth>>uiDepth) == rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() && rpcTempCU->getSlice()->getPPS()->getUseDQP())911 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && rpcTempCU->getSlice()->getPPS()->getUseDQP()) 912 912 { 913 913 Bool hasResidual = false; … … 1079 1079 { 1080 1080 UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2; 1081 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())1081 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 1082 1082 { 1083 1083 setdQPFlag(true); 1084 1084 } 1085 1085 1086 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj())1086 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj()) 1087 1087 { 1088 1088 setCodeChromaQpAdjFlag(true); … … 1106 1106 } 1107 1107 1108 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())1108 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 1109 1109 { 1110 1110 setdQPFlag(true); 1111 1111 } 1112 1112 1113 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj())1113 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj()) 1114 1114 { 1115 1115 setCodeChromaQpAdjFlag(true); … … 1659 1659 UInt uiDepth = pcCU->getDepth( 0 ); 1660 1660 1661 if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() )1661 if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 1662 1662 { 1663 1663 if ( pcCU->getQtRootCbf( 0) ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
r1212 r1235 79 79 80 80 #if CGS_3D_ASYMLUT 81 Void TEncEntropy::encodePPS( TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT )81 Void TEncEntropy::encodePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 82 82 { 83 83 m_pcEntropyCoderIf->codePPS( pcPPS, pc3DAsymLUT ); … … 85 85 } 86 86 #else 87 Void TEncEntropy::encodePPS( TComPPS* pcPPS )87 Void TEncEntropy::encodePPS( const TComPPS* pcPPS ) 88 88 { 89 89 m_pcEntropyCoderIf->codePPS( pcPPS ); … … 92 92 #endif 93 93 94 Void TEncEntropy::encodeSPS( TComSPS* pcSPS )94 Void TEncEntropy::encodeSPS( const TComSPS* pcSPS ) 95 95 { 96 96 m_pcEntropyCoderIf->codeSPS( pcSPS ); … … 107 107 } 108 108 109 Void TEncEntropy::encodeVPS( TComVPS* pcVPS )109 Void TEncEntropy::encodeVPS( const TComVPS* pcVPS ) 110 110 { 111 111 m_pcEntropyCoderIf->codeVPS( pcVPS ); … … 739 739 } 740 740 741 /** encode quantization matrix742 * \param scalingList quantization matrix information743 */744 Void TEncEntropy::encodeScalingList( TComScalingList* scalingList )745 {746 m_pcEntropyCoderIf->codeScalingList( scalingList );747 }748 749 741 #if SVC_EXTENSION 750 742 Void TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.h
r1212 r1235 64 64 public: 65 65 virtual Void resetEntropy () = 0; 66 virtual VoiddetermineCabacInitIdx () = 0;66 virtual SliceType determineCabacInitIdx () = 0; 67 67 virtual Void setBitstream ( TComBitIf* p ) = 0; 68 68 virtual Void setSlice ( TComSlice* p ) = 0; … … 70 70 virtual UInt getNumberOfWrittenBits() = 0; 71 71 72 virtual Void codeVPS ( TComVPS* pcVPS ) = 0; 73 virtual Void codeSPS ( TComSPS* pcSPS ) = 0; 74 virtual Void codePPS ( TComPPS* pcPPS 72 virtual Void codeVPS ( const TComVPS* pcVPS ) = 0; 73 virtual Void codeSPS ( const TComSPS* pcSPS ) = 0; 75 74 #if CGS_3D_ASYMLUT 76 , TEnc3DAsymLUT * pc3DAsymLUT 77 #endif 78 ) = 0; 75 virtual Void codePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) = 0; 76 #else 77 virtual Void codePPS ( const TComPPS* pcPPS ) = 0; 78 #endif 79 79 virtual Void codeSliceHeader ( TComSlice* pcSlice ) = 0; 80 80 … … 82 82 virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; 83 83 virtual Void codeSliceFinish () = 0; 84 virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; 85 virtual Void codeScalingList ( TComScalingList* scalingList ) = 0; 84 virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; 86 85 87 86 public: … … 140 139 UInt getNumberOfWrittenBits () { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } 141 140 Void resetEntropy () { m_pcEntropyCoderIf->resetEntropy(); } 142 Void determineCabacInitIdx () {m_pcEntropyCoderIf->determineCabacInitIdx(); }141 SliceType determineCabacInitIdx () { return m_pcEntropyCoderIf->determineCabacInitIdx(); } 143 142 144 143 Void encodeSliceHeader ( TComSlice* pcSlice ); … … 149 148 150 149 public: 151 Void encodeVPS ( TComVPS* pcVPS);150 Void encodeVPS ( const TComVPS* pcVPS); 152 151 // SPS 153 Void encodeSPS ( TComSPS* pcSPS ); 154 Void encodePPS ( TComPPS* pcPPS 152 Void encodeSPS ( const TComSPS* pcSPS ); 155 153 #if CGS_3D_ASYMLUT 156 , TEnc3DAsymLUT * pc3DAsymLUT 157 #endif 158 ); 154 Void encodePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ); 155 #else 156 Void encodePPS ( const TComPPS* pcPPS ); 157 #endif 159 158 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 160 159 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); … … 184 183 Void encodeChromaQpAdjustment ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 185 184 186 Void encodeScalingList ( TComScalingList* scalingList );187 188 185 Void encodeCrossComponentPrediction( TComTU &rTu, ComponentID compID ); 189 186 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1232 r1235 216 216 } 217 217 218 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets ( TComSPS *sps)218 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets (const TComSPS *sps) 219 219 { 220 220 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); … … 374 374 } 375 375 376 SEITempMotionConstrainedTileSets* TEncGOP::xCreateSEITempMotionConstrainedTileSets ( )376 SEITempMotionConstrainedTileSets* TEncGOP::xCreateSEITempMotionConstrainedTileSets (const TComPPS *pps) 377 377 { 378 TComPPS *pps = m_pcEncTop->getPPS();379 378 SEITempMotionConstrainedTileSets *sei = new SEITempMotionConstrainedTileSets(); 380 379 if(pps->getTilesEnabledFlag()) … … 490 489 } 491 490 492 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps)491 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const TComSPS *sps, const TComPPS *pps) 493 492 { 494 493 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); … … 579 578 if(m_pcCfg->getTMCTSSEIEnabled()) 580 579 { 581 SEITempMotionConstrainedTileSets *sei_tmcts = xCreateSEITempMotionConstrainedTileSets ( );580 SEITempMotionConstrainedTileSets *sei_tmcts = xCreateSEITempMotionConstrainedTileSets (pps); 582 581 583 582 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); … … 1123 1122 // Slice data initialization 1124 1123 pcPic->clearSliceBuffer(); 1125 assert(pcPic->getNumAllocatedSlice() == 1);1124 pcPic->allocateNewSlice(); 1126 1125 m_pcSliceEncoder->setSliceIdx(0); 1127 1126 pcPic->setCurrSliceIdx(0); 1128 1127 #if SVC_EXTENSION 1129 1128 pcPic->setLayerId( m_layerId ); 1130 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), m_pcEncTop->getVPS(),isField );1131 #else 1132 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), isField );1129 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, isField ); 1130 #else 1131 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, &(pcPic->getPicSym()->getSPS()), &(pcPic->getPicSym()->getPPS()), isField ); 1133 1132 #endif 1134 1133 … … 1252 1251 //set default slice level flag to the same as SPS level flag 1253 1252 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); 1254 pcSlice->setScalingList ( m_pcEncTop->getScalingList() );1255 if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF)1256 {1257 m_pcEncTop->getTrQuant()->setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc());1258 m_pcEncTop->getTrQuant()->setUseScalingList(false);1259 m_pcEncTop->getSPS()->setScalingListPresentFlag(false);1260 m_pcEncTop->getPPS()->setScalingListPresentFlag(false);1261 }1262 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_DEFAULT)1263 {1264 #if SVC_EXTENSION1265 // inferring of the scaling list can be moved to the config file1266 UInt refLayerId = 0;1267 if( m_layerId > 0 && !m_pcEncTop->getVPS()->getNonHEVCBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )1268 {1269 m_pcEncTop->getSPS()->setInferScalingListFlag( true );1270 m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );1271 m_pcEncTop->getSPS()->setScalingListPresentFlag( false );1272 m_pcEncTop->getPPS()->setInferScalingListFlag( false );1273 m_pcEncTop->getPPS()->setScalingListPresentFlag( false );1274 1275 // infer the scaling list from the reference layer1276 pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() );1277 }1278 else1279 {1280 #endif1281 pcSlice->setDefaultScalingList ();1282 m_pcEncTop->getSPS()->setScalingListPresentFlag(false);1283 m_pcEncTop->getPPS()->setScalingListPresentFlag(false);1284 1285 #if SVC_EXTENSION1286 }1287 #endif1288 1289 m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());1290 m_pcEncTop->getTrQuant()->setUseScalingList(true);1291 }1292 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_FILE_READ)1293 {1294 #if SVC_EXTENSION1295 // inferring of the scaling list can be moved to the config file1296 UInt refLayerId = 0;1297 if( m_layerId > 0 && !m_pcEncTop->getVPS()->getNonHEVCBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )1298 {1299 m_pcEncTop->getSPS()->setInferScalingListFlag( true );1300 m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );1301 m_pcEncTop->getSPS()->setScalingListPresentFlag( false );1302 m_pcEncTop->getPPS()->setInferScalingListFlag( false );1303 m_pcEncTop->getPPS()->setScalingListPresentFlag( false );1304 1305 // infer the scaling list from the reference layer1306 pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() );1307 }1308 else1309 {1310 #endif1311 pcSlice->setDefaultScalingList ();1312 if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile()))1313 {1314 Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string1315 assert(bParsedScalingList);1316 exit(1);1317 }1318 pcSlice->getScalingList()->checkDcOfMatrix();1319 m_pcEncTop->getSPS()->setScalingListPresentFlag(pcSlice->checkDefaultScalingList());1320 m_pcEncTop->getPPS()->setScalingListPresentFlag(false);1321 1322 #if SVC_EXTENSION1323 }1324 #endif1325 1326 m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());1327 m_pcEncTop->getTrQuant()->setUseScalingList(true);1328 }1329 else1330 {1331 printf("error : ScalingList == %d no support\n",m_pcEncTop->getUseScalingListId());1332 assert(0);1333 }1334 1253 1335 1254 if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='P') … … 1381 1300 1382 1301 // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0. 1383 Bool phaseSetPresentFlag; 1384 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 1385 pcSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma ); 1386 1387 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1388 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1302 const ResamplingPhase &resamplingPhase = pcSlice->getPPS()->getResamplingPhase( refLayerId ); 1303 1304 assert( ( (widthEL != widthBL) || (resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0) ) 1305 && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) ); 1389 1306 1390 1307 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); … … 1418 1335 Bool bSignalPPS = m_bSeqFirst; 1419 1336 bSignalPPS |= m_pcCfg->getGOPSize() > 1 ? pocCurr % m_pcCfg->getIntraPeriod() == 0 : pocCurr % m_pcCfg->getFrameRate() == 0; 1420 xDetermin3DAsymLUT( pcSlice , pcPic , refLayerIdc , m_pcCfg , bSignalPPS ); 1337 xDetermin3DAsymLUT( pcSlice, pcPic, refLayerIdc, m_pcCfg, bSignalPPS ); 1338 1339 // update PPS in TEncTop and TComPicSym classes 1340 m_pcEncTop->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() ); 1341 m_pcEncTop->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() ); 1342 pcPic->getPicSym()->getPPSToUpdate()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() ); 1343 pcPic->getPicSym()->getPPSToUpdate()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() ); 1344 1421 1345 m_Enc3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pColorMappedPic ); 1422 1346 pBaseColRec = m_pColorMappedPic; … … 1608 1532 if(lTid==pcSlice->getTLayer()) 1609 1533 { 1610 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);1534 const TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1611 1535 for(Int jj=0;jj<nRPS->getNumberOfPictures();jj++) 1612 1536 { … … 1725 1649 if(lTid==pcSlice->getTLayer()) 1726 1650 { 1727 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);1651 const TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1728 1652 for(Int jj=0; jj<nRPS->getNumberOfPictures(); jj++) 1729 1653 { … … 1844 1768 pcSlice->setSliceType ( P_SLICE ); 1845 1769 } 1770 pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx()); 1846 1771 1847 1772 if (pcSlice->getSliceType() == B_SLICE) … … 1894 1819 pcSlice->setEnableTMVPFlag(1); 1895 1820 } 1896 pcSlice->getSPS()->setTMVPFlagsPresent(1);1897 1821 } 1898 1822 else if (m_pcEncTop->getTMVPModeId() == 1) 1899 1823 { 1900 pcSlice->getSPS()->setTMVPFlagsPresent(1);1901 1824 #if SVC_EXTENSION 1902 1825 if( pcSlice->getIdrPicFlag() ) … … 1910 1833 else 1911 1834 { 1912 pcSlice->getSPS()->setTMVPFlagsPresent(0);1913 1835 pcSlice->setEnableTMVPFlag(0); 1914 1836 } … … 2026 1948 pcPic->getSlice(pcSlice->getSliceIdx())->setMvdL1ZeroFlag(pcSlice->getMvdL1ZeroFlag()); 2027 1949 2028 pcPic->getPicSym()->initTiles(pcSlice->getPPS());2029 pcPic->getPicSym()->initCtuTsRsAddrMaps();2030 2031 1950 Double lambda = 0.0; 2032 1951 Int actualHeadBits = 0; … … 2114 2033 2115 2034 // Allocate some coders, now the number of tiles are known. 2116 const Int numSubstreams = pcSlice->getPPS()->getNumSubstreams(); 2035 const Int numSubstreamsColumns = (pcSlice->getPPS()->getNumTileColumnsMinus1() + 1); 2036 const Int numSubstreamRows = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcPic->getFrameHeightInCtus() : (pcSlice->getPPS()->getNumTileRowsMinus1() + 1); 2037 const Int numSubstreams = numSubstreamRows * numSubstreamsColumns; 2117 2038 std::vector<TComOutputBitstream> substreamsOut(numSubstreams); 2118 2039 … … 2138 2059 m_pcSliceEncoder->setSliceIdx ( uiNumSliceSegments ); 2139 2060 pcSlice = pcPic->getSlice ( uiNumSliceSegments ); 2061 assert(pcSlice->getPPS()!=0); 2140 2062 pcSlice->copySliceInfo ( pcPic->getSlice(uiNumSliceSegments-1) ); 2141 2063 pcSlice->setSliceIdx ( uiNumSliceSegments ); … … 2151 2073 pcSlice->setDependentSliceSegmentFlag(bNextSegmentIsDependentSlice); 2152 2074 pcSlice->setSliceSegmentCurStartCtuTsAddr ( curSliceSegmentEnd ); 2075 // TODO: optimise cabac_init during compress slice to improve multi-slice operation 2076 // pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx()); 2153 2077 uiNumSliceSegments ++; 2154 2078 } … … 2177 2101 if ( m_pcCfg->getDeblockingFilterMetric() ) 2178 2102 { 2179 dblMetric(pcPic, uiNumSliceSegments);2103 applyDeblockingFilterMetric(pcPic, uiNumSliceSegments); 2180 2104 } 2181 2105 m_pcLoopFilter->loopFilterPic( pcPic ); … … 2185 2109 m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder, pcSlice ); 2186 2110 2187 / * write various header sets. */2111 // write various header sets. 2188 2112 if ( m_bSeqFirst ) 2189 2113 { … … 2222 2146 2223 2147 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2224 if (m_bSeqFirst) 2225 { 2226 pcSlice->getSPS()->setNumLongTermRefPicSPS(m_numLongTermRefPicSPS); 2227 assert (m_numLongTermRefPicSPS <= MAX_NUM_LONG_TERM_REF_PICS); 2228 for (Int k = 0; k < m_numLongTermRefPicSPS; k++) 2229 { 2230 pcSlice->getSPS()->setLtRefPicPocLsbSps(k, m_ltRefPicPocLsbSps[k]); 2231 pcSlice->getSPS()->setUsedByCurrPicLtSPSFlag(k, m_ltRefPicUsedByCurrPicFlag[k]); 2232 } 2233 } 2234 if( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) 2235 { 2236 UInt maxCU = m_pcCfg->getSliceArgument(); 2237 UInt numDU = ( m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_CTU ) ? ( pcPic->getNumberOfCtusInFrame() / maxCU ) : ( 0 ); 2238 if( pcPic->getNumberOfCtusInFrame() % maxCU != 0 || numDU == 0 ) 2239 { 2240 numDU ++; 2241 } 2242 pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->setNumDU( numDU ); 2243 pcSlice->getSPS()->setHrdParameters( m_pcCfg->getFrameRate(), numDU, m_pcCfg->getTargetBitrate(), ( m_pcCfg->getIntraPeriod() > 0 ) ); 2244 } 2245 if( m_pcCfg->getBufferingPeriodSEIEnabled() || m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) 2246 { 2247 pcSlice->getSPS()->getVuiParameters()->setHrdParametersPresentFlag( true ); 2248 } 2249 2148 2250 2149 #if SVC_EXTENSION 2251 2150 // dependency constraint … … 2285 2184 actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8; 2286 2185 2287 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS() );2186 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS(), pcSlice->getPPS()); 2288 2187 2289 2188 #if O0164_MULTI_LAYER_HRD … … 2776 2675 } 2777 2676 #endif 2677 2678 pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx()); 2778 2679 2779 2680 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); … … 3089 2990 || ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) ) 3090 2991 { 3091 TComVUI *vui = pcSlice->getSPS()->getVuiParameters();3092 TComHRD *hrd = vui->getHrdParameters();2992 const TComVUI *vui = pcSlice->getSPS()->getVuiParameters(); 2993 const TComHRD *hrd = vui->getHrdParameters(); 3093 2994 3094 2995 if( hrd->getSubPicCpbParamsPresentFlag() ) … … 4094 3995 } 4095 3996 4096 Void TEncGOP:: dblMetric( TComPic* pcPic, UInt uiNumSlices )3997 Void TEncGOP::applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices ) 4097 3998 { 4098 3999 TComPicYuv* pcPicYuvRec = pcPic->getPicYuvRec(); … … 4819 4720 4820 4721 #if CGS_3D_ASYMLUT 4821 Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg, Bool bSignalPPS )4722 Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice, TComPic * pCurPic, UInt refLayerIdc, TEncCfg * pCfg, Bool bSignalPPS ) 4822 4723 { 4823 4724 Int nCGSFlag = pSlice->getPPS()->getCGSFlag(); … … 4884 4785 } 4885 4786 } 4886 pSlice->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() );4887 pSlice->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() );4888 4787 } 4889 4788 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1212 r1235 236 236 Double xCalculateRVM(); 237 237 238 SEIActiveParameterSets* xCreateSEIActiveParameterSets ( TComSPS *sps);238 SEIActiveParameterSets* xCreateSEIActiveParameterSets (const TComSPS *sps); 239 239 SEIFramePacking* xCreateSEIFramePacking(); 240 240 SEISegmentedRectFramePacking* xCreateSEISegmentedRectFramePacking(); 241 241 SEIDisplayOrientation* xCreateSEIDisplayOrientation(); 242 242 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 243 SEITempMotionConstrainedTileSets* xCreateSEITempMotionConstrainedTileSets ( );243 SEITempMotionConstrainedTileSets* xCreateSEITempMotionConstrainedTileSets (const TComPPS *pps); 244 244 SEIKneeFunctionInfo* xCreateSEIKneeFunctionInfo(); 245 245 SEIChromaSamplingFilterHint* xCreateSEIChromaSamplingFilterHint(Bool bChromaLocInfoPresent, Int iHorFilterIndex, Int iVerFilterIdc); 246 246 247 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps);247 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const TComSPS *sps, const TComPPS *pps); 248 248 Int xGetFirstSeiLocation (AccessUnit &accessUnit); 249 249 Void xResetNonNestedSEIPresentFlags() … … 258 258 m_nestedPictureTimingSEIPresentInAU = false; 259 259 } 260 Void dblMetric( TComPic* pcPic, UInt uiNumSlices );260 Void applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices ); 261 261 262 262 #if Q0074_COLOUR_REMAPPING_SEI … … 290 290 Void downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest); 291 291 Void downScaleComponent2x2( const Pel* pSrc, Pel* pDest, const Int iSrcStride, const Int iDestStride, const Int iSrcWidth, const Int iSrcHeight, const Int inputBitDepth, const Int outputBitDepth ); 292 inline Short 292 inline Short xClip( Short x , Int bitdepth ); 293 293 Void initDs(Int iWidth, Int iHeight, Int iType); 294 Void filterImg( 295 Pel *src, 296 Int iSrcStride, 297 Pel *dst, 298 Int iDstStride, 299 Int height1, 300 Int width1, 301 Int shift, 302 Int plane); 294 Void filterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height1, Int width1, Int shift, Int plane); 303 295 304 296 Int get_mem2DintWithPad(Int ***array2D, Int dim0, Int dim1, Int iPadY, Int iPadX); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp
r1029 r1235 128 128 129 129 #if SVC_EXTENSION 130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 131 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId ) 132 131 { 133 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 134 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 132 TComPic::create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual, layerId ); 133 134 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 135 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 135 136 #else 136 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 137 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual ) 138 138 { 139 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 139 TComPic::create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual ); 140 141 const Int iWidth = sps.getPicWidthInLumaSamples(); 142 const Int iHeight = sps.getPicHeightInLumaSamples(); 140 143 #endif 141 144 m_uiMaxAQDepth = uiMaxAQDepth; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h
r1029 r1235 106 106 107 107 #if SVC_EXTENSION 108 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 109 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false ); 108 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId ); 110 109 #else //SVC_EXTENSION 111 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 112 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 110 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ ); 113 111 #endif //SVC_EXTENSION 114 112 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r1230 r1235 109 109 SliceType eSliceType = m_pcSlice->getSliceType(); 110 110 111 Int encCABACTableIdx = m_pcSlice->getPPS()->getEncCABACTableIdx();111 SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx();; 112 112 if (!m_pcSlice->isIntra() && (encCABACTableIdx==B_SLICE || encCABACTableIdx==P_SLICE) && m_pcSlice->getPPS()->getCabacInitPresentFlag()) 113 113 { 114 eSliceType = (SliceType)encCABACTableIdx;114 eSliceType = encCABACTableIdx; 115 115 } 116 116 … … 161 161 * stores the index of the closest table. This index is used for the next P/B slice when cabac_init_present_flag is true. 162 162 */ 163 VoidTEncSbac::determineCabacInitIdx()163 SliceType TEncSbac::determineCabacInitIdx() 164 164 { 165 165 Int qp = m_pcSlice->getSliceQp(); … … 214 214 } 215 215 } 216 m_pcSlice->getPPS()->setEncCABACTableIdx( bestSliceType );216 return bestSliceType; 217 217 } 218 218 else 219 219 { 220 m_pcSlice->getPPS()->setEncCABACTableIdx( I_SLICE );221 } 222 } 223 224 Void TEncSbac::codeVPS( TComVPS* pcVPS )220 return I_SLICE; 221 } 222 } 223 224 Void TEncSbac::codeVPS( const TComVPS* pcVPS ) 225 225 { 226 226 assert (0); … … 228 228 } 229 229 230 Void TEncSbac::codeSPS( TComSPS* pcSPS )230 Void TEncSbac::codeSPS( const TComSPS* pcSPS ) 231 231 { 232 232 assert (0); … … 234 234 } 235 235 236 Void TEncSbac::codePPS( TComPPS* pcPPS237 236 #if CGS_3D_ASYMLUT 238 , TEnc3DAsymLUT * pc3DAsymLUT 237 Void TEncSbac::codePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 238 #else 239 Void TEncSbac::codePPS( const TComPPS* pcPPS ) 239 240 #endif 240 )241 241 { 242 242 assert (0); … … 459 459 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 460 460 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 461 if ( pcCU->getSlice()->getSPS()->get AMPAcc( uiDepth ))461 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 462 462 { 463 463 if (eSize == SIZE_2NxN) … … 485 485 } 486 486 487 if ( pcCU->getSlice()->getSPS()->get AMPAcc( uiDepth ))487 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 488 488 { 489 489 if (eSize == SIZE_Nx2N) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.h
r1212 r1235 75 75 // Virtual list 76 76 Void resetEntropy (); 77 VoiddetermineCabacInitIdx ();77 SliceType determineCabacInitIdx (); 78 78 Void setBitstream ( TComBitIf* p ) { m_pcBitIf = p; m_pcBinIf->init( p ); } 79 79 Void setSlice ( TComSlice* p ) { m_pcSlice = p; } … … 87 87 //--SBAC RD 88 88 89 Void codeVPS ( TComVPS* pcVPS ); 90 Void codeSPS ( TComSPS* pcSPS ); 91 Void codePPS ( TComPPS* pcPPS 89 Void codeVPS ( const TComVPS* pcVPS ); 90 Void codeSPS ( const TComSPS* pcSPS ); 92 91 #if CGS_3D_ASYMLUT 93 , TEnc3DAsymLUT * pc3DAsymLUT 92 Void codePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ); 93 #else 94 Void codePPS ( const TComPPS* pcPPS ); 94 95 #endif 95 );96 96 Void codeSliceHeader ( TComSlice* pcSlice ); 97 97 Void codeTilesWPPEntryPoint ( TComSlice* pSlice ); … … 103 103 Void codeSaoUflc ( UInt uiLength, UInt uiCode ); 104 104 Void codeSAOSign ( UInt uiCode); //<! code SAO offset sign 105 Void codeScalingList ( TComScalingList* /*scalingList*/ ){ assert (0); return;};106 105 107 106 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1234 r1235 3945 3945 #if SVC_EXTENSION 3946 3946 // Check WP for B-slices 3947 if ( pcCU->getSlice()->getPPS()->getUseWP())3947 if( pcCU->getSlice()->testWeightPred() ) 3948 3948 #else 3949 if ( pcCU->getSlice()-> getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )3949 if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE ) 3950 3950 #endif 3951 3951 { … … 3959 3959 #if SVC_EXTENSION 3960 3960 // Check WP for B-slices 3961 if ( pcCU->getSlice()->getPPS()->getUseWP())3961 if ( pcCU->getSlice()->testWeightPred() ) 3962 3962 #else 3963 if ( pcCU->getSlice()-> getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )3963 if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE ) 3964 3964 #endif 3965 3965 { … … 5584 5584 assert( pcCU->getDepth( 0 ) == pcCU->getDepth( uiAbsPartIdx ) ); 5585 5585 const UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); 5586 TComSPS *sps=pcCU->getSlice()->getSPS();5586 const TComSPS *sps=pcCU->getSlice()->getSPS(); 5587 5587 5588 5588 if( uiCurrTrMode == uiTrMode ) … … 5973 5973 5974 5974 TComSlice *pcSlice = pcCU->getSlice(); 5975 TComPPS *pps = pcCU->getSlice()->getPPS();5976 5975 WPScalingParam *wp0 , *wp1; 5977 5976 5978 m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && p ps->getUseWP() ) || ( pcSlice->getSliceType()==B_SLICE && pps->getWPBiPred() ) ;5977 m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pcSlice->testWeightPred() ) || ( pcSlice->getSliceType()==B_SLICE && pcSlice->testWeightBiPred() ) ; 5979 5978 5980 5979 if ( !m_cDistParam.bApplyWeight ) return; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1203 r1235 48 48 49 49 TEncSlice::TEncSlice() 50 : m_encCABACTableIdx(I_SLICE) 50 51 { 51 52 m_apcPicYuvPred = NULL; … … 220 221 #if SVC_EXTENSION 221 222 //\param vps VPS associated with the slice 222 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps,Bool isField )223 #else 224 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS,TComPPS *pPPS, Bool isField )223 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, Bool isField ) 224 #else 225 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, const TComSPS* pSPS, const TComPPS *pPPS, Bool isField ) 225 226 #endif 226 227 { … … 229 230 230 231 rpcSlice = pcPic->getSlice(0); 231 rpcSlice->setSPS( pSPS );232 rpcSlice->setPPS( pPPS );233 232 rpcSlice->setSliceBits(0); 234 233 rpcSlice->setPic( pcPic ); 235 234 #if SVC_EXTENSION 235 const TComPPS* pPPS = &pcPic->getPicSym()->getPPS(); 236 236 237 UInt layerId = pcPic->getLayerId(); 237 rpcSlice->setVPS( vps );238 238 rpcSlice->initSlice( layerId ); 239 239 #else … … 501 501 else if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag()) 502 502 { 503 rpcSlice->getPPS()->setDeblockingFilterOverrideEnabledFlag( !m_pcCfg->getLoopFilterOffsetInPPS() ); 504 rpcSlice->setDeblockingFilterOverrideFlag( !m_pcCfg->getLoopFilterOffsetInPPS() ); 505 rpcSlice->getPPS()->setPicDisableDeblockingFilterFlag( m_pcCfg->getLoopFilterDisable() ); 506 rpcSlice->setDeblockingFilterDisable( m_pcCfg->getLoopFilterDisable() ); 503 rpcSlice->setDeblockingFilterOverrideFlag( rpcSlice->getPPS()->getDeblockingFilterOverrideEnabledFlag() ); 504 rpcSlice->setDeblockingFilterDisable( rpcSlice->getPPS()->getPicDisableDeblockingFilterFlag() ); 507 505 if ( !rpcSlice->getDeblockingFilterDisable()) 508 506 { 509 if ( !m_pcCfg->getLoopFilterOffsetInPPS() && eSliceType!=I_SLICE) 510 { 511 rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() ); 512 rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() ); 507 if ( rpcSlice->getDeblockingFilterOverrideFlag() && eSliceType!=I_SLICE) 508 { 513 509 rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() ); 514 510 rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() ); … … 516 512 else 517 513 { 518 rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getLoopFilterBetaOffset() );519 rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getLoopFilterTcOffset() );520 514 rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getLoopFilterBetaOffset() ); 521 515 rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getLoopFilterTcOffset() ); … … 558 552 #endif 559 553 560 xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );561 562 554 #if SVC_EXTENSION 563 555 if( layerId > 0 ) … … 792 784 793 785 xEstimateWPParamSlice( pcSlice ); 794 pcSlice->initWpScaling( );786 pcSlice->initWpScaling(pcSlice->getSPS()); 795 787 796 788 // check WP on/off … … 1010 1002 m_lastSliceSegmentEndContextState.loadContexts( m_pppcRDSbacCoder[0][CI_CURR_BEST] );//ctx end of dep.slice 1011 1003 } 1012 xRestoreWPparam( pcSlice );1013 1004 1014 1005 // stop use of temporary bit counter object. 1015 1006 m_pppcRDSbacCoder[0][CI_CURR_BEST]->setBitstream(NULL); 1016 1007 m_pcRDGoOnSbacCoder->setBitstream(NULL); // stop use of tempBitCounter. 1008 1009 // TODO: optimise cabac_init during compress slice to improve multi-slice operation 1010 //if (pcSlice->getPPS()->getCabacInitPresentFlag() && !pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag()) 1011 //{ 1012 // m_encCABACTableIdx = m_pcEntropyCoder->determineCabacInitIdx(); 1013 //} 1014 //else 1015 //{ 1016 // m_encCABACTableIdx = pcSlice->getSliceType(); 1017 //} 1017 1018 } 1018 1019 … … 1198 1199 #endif 1199 1200 1200 if (pcSlice->getPPS()->getCabacInitPresentFlag()) 1201 { 1202 if (pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag()) 1203 { 1204 pcSlice->getPPS()->setEncCABACTableIdx( pcSlice->getSliceType() ); 1205 } 1206 else 1207 { 1208 m_pcEntropyCoder->determineCabacInitIdx(); 1209 } 1210 } 1201 if (pcSlice->getPPS()->getCabacInitPresentFlag() && !pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag()) 1202 { 1203 m_encCABACTableIdx = m_pcEntropyCoder->determineCabacInitIdx(); 1204 } 1205 else 1206 { 1207 m_encCABACTableIdx = pcSlice->getSliceType(); 1208 } 1209 1211 1210 numBinsCoded = m_pcBinCABAC->getBinsCoded(); 1212 1211 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.h
r1201 r1235 98 98 TEncSbac m_lastSliceSegmentEndContextState; ///< context storage for state at the end of the previous slice-segment (used for dependent slices only). 99 99 TEncSbac m_entropyCodingSyncContextState; ///< context storate for state of contexts at the wavefront/WPP/entropy-coding-sync second CTU of tile-row 100 SliceType m_encCABACTableIdx; 100 101 101 102 #if SVC_EXTENSION && JCTVC_M0259_LAMBDAREFINEMENT … … 120 121 /// preparation of slice encoding (reference marking, QP and lambda) 121 122 #if SVC_EXTENSION 122 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 123 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField ); 123 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, Bool isField ); 124 124 Void estimateILWpParam ( TComSlice* pcSlice ); 125 125 #else 126 126 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 127 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS,TComPPS *pPPS, Bool isField );127 Int iGOPid, TComSlice*& rpcSlice, const TComSPS* pSPS, const TComPPS *pPPS, Bool isField ); 128 128 #endif 129 129 … … 143 143 Void setSliceIdx(UInt i) { m_uiSliceIdx = i; } 144 144 145 SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; } 146 145 147 private: 146 148 Double xGetQPValueAccordingToLambda ( Double lambda ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1226 r1235 185 185 m_cSliceEncoder. destroy(); 186 186 m_cCuEncoder. destroy(); 187 if (m_cSPS.getUseSAO()) 188 { 189 m_cEncSAO.destroyEncData(); 190 m_cEncSAO.destroy(); 191 } 187 m_cEncSAO. destroyEncData(); 188 m_cEncSAO. destroy(); 192 189 m_cLoopFilter. destroy(); 193 190 m_cRateCtrl. destroy(); … … 232 229 // initialize SPS 233 230 xInitSPS(); 234 235 // set the VPS profile information 236 #if SVC_EXTENSION 237 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( true ); 238 #else 239 *m_cVPS.getPTL() = *m_cSPS.getPTL(); 240 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( false ); 241 #endif 231 xInitVPS(); 232 242 233 m_cRdCost.setCostMode(m_costMode); 243 234 244 235 // initialize PPS 245 m_cPPS.setSPS(&m_cSPS);246 236 xInitPPS(); 247 237 xInitRPS(isFieldCoding); … … 271 261 272 262 m_iMaxRefPicNum = 0; 263 264 xInitScalingLists(); 265 273 266 #if SVC_EXTENSION 274 267 m_iSPSIdCnt ++; … … 276 269 xInitILRP(); 277 270 #endif 271 } 272 273 Void TEncTop::xInitScalingLists() 274 { 275 // Initialise scaling lists 276 // The encoder will only use the SPS scaling lists. The PPS will never be marked present. 277 278 if(getUseScalingListId() == SCALING_LIST_OFF) 279 { 280 #if SVC_EXTENSION 281 getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId)); 282 #else 283 getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc()); 284 #endif 285 getTrQuant()->setUseScalingList(false); 286 m_cSPS.setScalingListPresentFlag(false); 287 m_cPPS.setScalingListPresentFlag(false); 288 } 289 else if(getUseScalingListId() == SCALING_LIST_DEFAULT) 290 { 291 #if SVC_EXTENSION 292 // inferring of the scaling list can be moved to the config file 293 UInt refLayerId = 0; 294 if( m_layerId > 0 && !m_cVPS.getNonHEVCBaseLayerFlag() && m_cVPS.getRecursiveRefLayerFlag( m_layerId, refLayerId ) ) 295 { 296 m_cSPS.setInferScalingListFlag( true ); 297 m_cSPS.setScalingListRefLayerId( refLayerId ); 298 m_cSPS.setScalingListPresentFlag( false ); 299 m_cPPS.setInferScalingListFlag( false ); 300 m_cPPS.setScalingListPresentFlag( false ); 301 302 // infer the scaling list from the reference layer 303 getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() ); 304 } 305 else 306 { 307 #endif 308 m_cSPS.getScalingList().setDefaultScalingList (); 309 m_cSPS.setScalingListPresentFlag(false); 310 m_cPPS.setScalingListPresentFlag(false); 311 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc()); 312 #if SVC_EXTENSION 313 } 314 #endif 315 getTrQuant()->setUseScalingList(true); 316 } 317 else if(getUseScalingListId() == SCALING_LIST_FILE_READ) 318 { 319 #if SVC_EXTENSION 320 // inferring of the scaling list can be moved to the config file 321 UInt refLayerId = 0; 322 if( m_layerId > 0 && !m_cVPS.getNonHEVCBaseLayerFlag() && m_cVPS.getRecursiveRefLayerFlag( m_layerId, refLayerId ) ) 323 { 324 m_cSPS.setInferScalingListFlag( true ); 325 m_cSPS.setScalingListRefLayerId( refLayerId ); 326 m_cSPS.setScalingListPresentFlag( false ); 327 m_cPPS.setInferScalingListFlag( false ); 328 m_cPPS.setScalingListPresentFlag( false ); 329 330 // infer the scaling list from the reference layer 331 getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() ); 332 } 333 else 334 { 335 #endif 336 m_cSPS.getScalingList().setDefaultScalingList (); 337 if(m_cSPS.getScalingList().xParseScalingList(getScalingListFile())) 338 { 339 Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string 340 assert(bParsedScalingList); 341 exit(1); 342 } 343 m_cSPS.getScalingList().checkDcOfMatrix(); 344 m_cSPS.setScalingListPresentFlag(m_cSPS.getScalingList().checkDefaultScalingList()); 345 m_cPPS.setScalingListPresentFlag(false); 346 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc()); 347 #if SVC_EXTENSION 348 } 349 #endif 350 getTrQuant()->setUseScalingList(true); 351 } 352 else 353 { 354 printf("error : ScalingList == %d not supported\n",getUseScalingListId()); 355 assert(0); 356 } 357 358 // Prepare delta's: 359 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) 360 { 361 const Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries. 362 363 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep) 364 { 365 m_cSPS.getScalingList().checkPredMode( sizeId, listId ); 366 } 367 } 368 278 369 } 279 370 … … 585 676 Void TEncTop::xGetNewPicBuffer ( TComPic*& rpcPic ) 586 677 { 678 // At this point, the SPS and PPS can be considered activated - they are copied to the new TComPic. 679 587 680 TComSlice::sortPicList(m_cListPic); 588 681 … … 611 704 for( UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 612 705 { 613 const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));614 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));706 const Window scalEL = m_cPPS.getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 707 const Window altRL = m_cPPS.getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 615 708 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 616 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));709 Bool zeroPhase = m_cPPS.hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 617 710 618 711 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i ); … … 643 736 } 644 737 645 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 646 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 738 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId); 647 739 #else //SVC_EXTENSION 648 pcEPic->create( m_ iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);740 pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false); 649 741 #endif //SVC_EXTENSION 650 742 rpcPic = pcEPic; … … 659 751 for( UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 660 752 { 661 const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));662 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));753 const Window scalEL = m_cPPS.getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 754 const Window altRL = m_cPPS.getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 663 755 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 664 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));756 Bool zeroPhase = m_cPPS.hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 665 757 666 758 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i ); … … 688 780 } 689 781 690 rpcPic->create( m_ iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS);782 rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false, m_layerId ); 691 783 #else //SVC_EXTENSION 692 rpcPic->create( m_ iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, false );784 rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false ); 693 785 #endif //SVC_EXTENSION 694 786 } … … 705 797 rpcPic->getPicYuvRec()->setBorderExtension(false); 706 798 } 799 800 Void TEncTop::xInitVPS() 801 { 802 // The SPS must have already been set up. 803 // set the VPS profile information. 804 #if SVC_EXTENSION 805 m_cVPS.setVpsVuiPresentFlag( true ); 806 #else 807 *m_cVPS.getPTL() = *m_cSPS.getPTL(); 808 m_cVPS.setMaxOpSets(1); 809 #endif 810 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( false ); 811 m_cVPS.setNumHrdParameters( 0 ); 812 813 m_cVPS.createHrdParamBuffer(); 814 for( UInt i = 0; i < m_cVPS.getNumHrdParameters(); i ++ ) 815 { 816 m_cVPS.setHrdOpSetIdx( 0, i ); 817 m_cVPS.setCprmsPresentFlag( false, i ); 818 // Set up HrdParameters here. 819 } 820 } 821 707 822 708 823 Void TEncTop::xInitSPS() … … 781 896 m_cSPS.setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra ); 782 897 898 m_cSPS.setTMVPFlagsPresent((getTMVPModeId() == 2 || getTMVPModeId() == 1)); 899 783 900 m_cSPS.setTMVPFlagsPresent(false); 784 901 785 902 m_cSPS.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); 786 787 Int i; 788 789 for (i = 0; i < g_uiMaxCUDepth-g_uiAddCUDepth; i++ ) 790 { 791 m_cSPS.setAMPAcc( i, m_useAMP ); 792 //m_cSPS.setAMPAcc( i, 1 ); 793 } 794 903 795 904 m_cSPS.setUseAMP ( m_useAMP ); 796 797 for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ )798 {799 m_cSPS.setAMPAcc(i, 0);800 }801 802 905 803 906 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) … … 830 933 m_cSPS.setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false ); 831 934 832 for ( i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ )935 for ( Int i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ ) 833 936 { 834 937 #if SVC_EXTENSION … … 841 944 m_cSPS.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag ); 842 945 m_cSPS.setDisableIntraReferenceSmoothing( m_disableIntraReferenceSmoothing ); 843 m_cSPS.setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 );946 m_cSPS.setScalingListFlag ( (m_useScalingListId == SCALING_LIST_OFF) ? 0 : 1 ); 844 947 m_cSPS.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 845 948 m_cSPS.setVuiParametersPresentFlag(getVuiParametersPresentFlag()); … … 880 983 pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical()); 881 984 } 985 m_cSPS.setNumLongTermRefPicSPS(NUM_LONG_TERM_REF_PIC_SPS); 986 assert (NUM_LONG_TERM_REF_PIC_SPS <= MAX_NUM_LONG_TERM_REF_PICS); 987 for (Int k = 0; k < NUM_LONG_TERM_REF_PIC_SPS; k++) 988 { 989 m_cSPS.setLtRefPicPocLsbSps(k, 0); 990 m_cSPS.setUsedByCurrPicLtSPSFlag(k, 0); 991 } 992 if( getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() ) 993 { 994 #if SVC_EXTENSION 995 const UInt picWidth = m_cVPS.getPicWidthInLumaSamples(&m_cSPS, m_layerId); 996 const UInt picHeight= m_cVPS.getPicWidthInLumaSamples(&m_cSPS, m_layerId); 997 #else 998 const UInt picWidth = m_cSPS.getPicWidthInLumaSamples(); 999 const UInt picHeight= m_cSPS.getPicWidthInLumaSamples(); 1000 #endif 1001 1002 const UInt frameWidthInCtus = ( picWidth + g_uiMaxCUWidth -1 ) / g_uiMaxCUWidth; 1003 const UInt frameHeightInCtus = ( picHeight + g_uiMaxCUHeight - 1 ) / g_uiMaxCUHeight; 1004 const UInt numCtusInFrame = frameWidthInCtus * frameHeightInCtus; 1005 1006 UInt maxCU = getSliceArgument(); 1007 UInt numDU = ( getSliceMode() == FIXED_NUMBER_OF_CTU ) ? ( numCtusInFrame / maxCU ) : ( 0 ); 1008 if( numCtusInFrame % maxCU != 0 || numDU == 0 ) 1009 { 1010 numDU ++; 1011 } 1012 m_cSPS.getVuiParameters()->getHrdParameters()->setNumDU( numDU ); 1013 m_cSPS.setHrdParameters( getFrameRate(), numDU, getTargetBitrate(), ( getIntraPeriod() > 0 ) ); 1014 } 1015 if( getBufferingPeriodSEIEnabled() || getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() ) 1016 { 1017 m_cSPS.getVuiParameters()->setHrdParametersPresentFlag( true ); 1018 } 1019 882 1020 } 883 1021 … … 892 1030 } 893 1031 894 if (m_costMode==COST_SEQUENCE_LEVEL_LOSSLESS || m_costMode==COST_LOSSLESS_CODING) bUseDQP=false; 895 896 if(bUseDQP) 1032 if (m_costMode==COST_SEQUENCE_LEVEL_LOSSLESS || m_costMode==COST_LOSSLESS_CODING) 1033 { 1034 bUseDQP=false; 1035 } 1036 1037 1038 if ( m_RCEnableRateControl ) 1039 { 1040 m_cPPS.setUseDQP(true); 1041 m_cPPS.setMaxCuDQPDepth( 0 ); 1042 } 1043 else if(bUseDQP) 897 1044 { 898 1045 m_cPPS.setUseDQP(true); 899 1046 m_cPPS.setMaxCuDQPDepth( m_iMaxCuDQPDepth ); 900 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );901 1047 } 902 1048 else … … 904 1050 m_cPPS.setUseDQP(false); 905 1051 m_cPPS.setMaxCuDQPDepth( 0 ); 906 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );907 1052 } 908 1053 … … 919 1064 } 920 1065 921 if ( m_RCEnableRateControl )922 {923 m_cPPS.setUseDQP(true);924 m_cPPS.setMaxCuDQPDepth( 0 );925 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );926 }927 928 m_cPPS.setMinCuChromaQpAdjSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuChromaQpAdjDepth()) );929 930 1066 m_cPPS.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset ); 931 1067 m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset ); 932 1068 933 m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams);934 1069 m_cPPS.setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 ); 935 1070 m_cPPS.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) ); … … 952 1087 { 953 1088 m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent ); 1089 1090 if (m_cPPS.getDeblockingFilterControlPresentFlag()) 1091 { 1092 m_cPPS.setDeblockingFilterOverrideEnabledFlag( !getLoopFilterOffsetInPPS() ); 1093 m_cPPS.setPicDisableDeblockingFilterFlag( getLoopFilterDisable() ); 1094 } 1095 } 1096 1097 if (m_cPPS.getDeblockingFilterControlPresentFlag() && ! m_cPPS.getPicDisableDeblockingFilterFlag()) 1098 { 1099 m_cPPS.setDeblockingFilterBetaOffsetDiv2( getLoopFilterBetaOffset() ); 1100 m_cPPS.setDeblockingFilterTcOffsetDiv2( getLoopFilterTcOffset() ); 954 1101 } 955 1102 m_cPPS.setLog2ParallelMergeLevelMinus2 (m_log2ParallelMergeLevelMinus2 ); … … 1076 1223 rps->setInterRPSPrediction(ge.m_interRPSPrediction > 0); // not very clean, converting anything > 0 to true. 1077 1224 rps->setDeltaRIdxMinus1(0); // index to the Reference RPS is always the previous one. 1078 TComReferencePictureSet* RPSRef = rpsList->getReferencePictureSet(i-1); // get the reference RPS1225 TComReferencePictureSet* RPSRef = i>0 ? rpsList->getReferencePictureSet(i-1): NULL; // get the reference RPS 1079 1226 1080 1227 if (ge.m_interRPSPrediction == 2) // Automatic generation of the inter RPS idc based on the RIdx provided. 1081 1228 { 1229 assert (RPSRef!=NULL); 1082 1230 Int deltaRPS = getGOPEntry(i-1).m_POC - ge.m_POC; // the ref POC - current POC 1083 1231 Int numRefDeltaPOC = RPSRef->getNumberOfPictures(); … … 1108 1256 else if (ge.m_interRPSPrediction == 1) // inter RPS idc based on the RefIdc values provided in config file. 1109 1257 { 1258 assert (RPSRef!=NULL); 1110 1259 rps->setDeltaRPS(ge.m_deltaRPS); 1111 1260 rps->setNumRefIdc(ge.m_numRefIdc); … … 1266 1415 } 1267 1416 1268 slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1417 TComReferencePictureSet *rps=slice->getLocalRPS(); 1418 (*rps) = *(slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1419 slice->setRPS(rps); 1269 1420 slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures()); 1270 1421 } … … 1313 1464 1314 1465 // # substreams is "per tile" when tiles are independent. 1315 if (m_iWaveFrontSynchro )1316 {1317 m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));1318 }1319 else1320 {1321 m_cPPS.setNumSubstreams((m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1));1322 }1323 1466 } 1324 1467 … … 1404 1547 picHeight = repFormat->getPicHeightVpsInLumaSamples(); 1405 1548 1406 if( m_layerId > 0)1549 if( m_layerId > 0 ) 1407 1550 { 1408 1551 g_bitDepth[CHANNEL_TYPE_LUMA] = bitDepthY; … … 1413 1556 g_uiAddCUDepth = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() ); 1414 1557 1415 Int numReorderPics[MAX_TLAYER];1416 Window &conformanceWindow = repFormat->getConformanceWindowVps();1417 Window defaultDisplayWindow = m_cSPS.getVuiParametersPresentFlag() ? m_cSPS.getVuiParameters()->getDefaultDisplayWindow() : Window();1418 1419 1558 if (m_cIlpPic[0] == NULL) 1420 1559 { … … 1422 1561 { 1423 1562 m_cIlpPic[j] = new TComPic; 1424 #if AUXILIARY_PICTURES 1425 m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1426 #else 1427 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1428 #endif 1563 m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 1429 1564 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 1430 1565 { … … 1462 1597 } 1463 1598 1464 Window& TEncTop::getScaledRefLayerWindowForLayer(Int layerId) 1465 { 1466 static Window win; 1467 1599 Window TEncTop::getScaledRefLayerWindowForLayer(Int layerId) 1600 { 1468 1601 for (Int i = 0; i < m_numRefLayerLocationOffsets; i++) 1469 1602 { … … 1474 1607 } 1475 1608 1476 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 1477 return win; 1478 } 1479 1480 Window& TEncTop::getRefLayerWindowForLayer(Int layerId) 1481 { 1482 static Window win; 1483 1609 return Window(); 1610 } 1611 1612 Window TEncTop::getRefLayerWindowForLayer(Int layerId) 1613 { 1484 1614 for (Int i = 0; i < m_numRefLayerLocationOffsets; i++) 1485 1615 { … … 1490 1620 } 1491 1621 1492 win.resetWindow(); // reference offsets are inferred to be zero when not present 1493 return win; 1622 return Window(); 1494 1623 } 1495 1624 #endif //SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r1226 r1235 93 93 TEncCu m_cCuEncoder; ///< CU encoder 94 94 // SPS 95 TComSPS m_cSPS; ///< SPS 96 TComPPS m_cPPS; ///< PPS 95 TComSPS m_cSPS; ///< SPS. This is the base value. This is copied to TComPicSym 96 TComPPS m_cPPS; ///< PPS. This is the base value. This is copied to TComPicSym 97 97 // RD cost computation 98 98 TComRdCost m_cRdCost; ///< RD cost computation class … … 110 110 TEncPreanalyzer m_cPreanalyzer; ///< image characteristics analyzer for TM5-step3-like adaptive QP 111 111 112 TComScalingList m_scalingList; ///< quantization matrix information113 112 TEncRateCtrl m_cRateCtrl; ///< Rate control class 114 113 … … 148 147 protected: 149 148 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed 149 Void xInitVPS (); ///< initialize VPS from encoder options 150 150 Void xInitSPS (); ///< initialize SPS from encoder options 151 151 Void xInitPPS (); ///< initialize PPS from encoder options 152 Void xInitScalingLists(); ///< initialize scaling lists 152 153 153 154 Void xInitPPSforTiles (); … … 187 188 TEncSbac* getRDGoOnSbacCoder () { return &m_cRDGoOnSbacCoder; } 188 189 TEncRateCtrl* getRateCtrl () { return &m_cRateCtrl; } 189 TComSPS* getSPS () { return &m_cSPS; }190 TComPPS* getPPS () { return &m_cPPS; }191 190 Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid ); 192 191 Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid ); 193 TComScalingList* getScalingList () { return &m_scalingList; }194 192 // ------------------------------------------------------------------------------------------------------------------- 195 193 // encoder function … … 198 196 /// encode several number of pictures until end-of-sequence 199 197 #if SVC_EXTENSION 198 TComSPS* getSPS() { return &m_cSPS; } 199 #if CGS_3D_ASYMLUT 200 TComPPS* getPPS() { return &m_cPPS; } 201 #endif 200 202 Void setLayerEnc(TEncTop** p) { m_ppcTEncTop = p; } 201 203 TEncTop** getLayerEnc() { return m_ppcTEncTop; } … … 203 205 Int getNumPicRcvd() { return m_iNumPicRcvd; } 204 206 Void setNumPicRcvd( Int num ) { m_iNumPicRcvd = num; } 205 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; }206 UInt getNumRefLayerLocationOffsets() { return m_numRefLayerLocationOffsets; }207 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } 208 UInt getNumRefLayerLocationOffsets() { return m_numRefLayerLocationOffsets; } 207 209 Void setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id; } 208 210 UInt getRefLocationOffsetLayerId(Int x) { return m_refLocationOffsetLayerId[x]; } 209 Window &getScaledRefLayerWindowForLayer(Int layerId);211 Window getScaledRefLayerWindowForLayer(Int layerId); 210 212 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 211 213 Void setNumRefLayerOffsets(Int x) { m_numRefLayerOffsets = x; } … … 213 215 Void setRefLayerId(Int layerIdx, UInt layerId) { m_refLayerId[layerIdx] = layerId; } 214 216 UInt getRefLayerId(Int layerIdx) { return m_refLayerId[layerIdx]; } 215 Window &getRefLayerWindowForLayer(Int layerId);216 Window& getRefLayerWindow(Int x) { return m_refLayerWindow[x]; }217 Window getRefLayerWindowForLayer(Int layerId); 218 Window& getRefLayerWindow(Int x) { return m_refLayerWindow[x]; } 217 219 Bool getScaledRefLayerOffsetPresentFlag(Int x) { return m_scaledRefLayerOffsetPresentFlag[x]; } 218 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; }219 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }220 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }221 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }222 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }223 Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; }224 Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; }225 Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; }226 Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; }227 Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; }228 Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; }220 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } 221 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; } 222 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 223 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; } 224 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; } 225 Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; } 226 Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; } 227 Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; } 228 Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; } 229 Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; } 230 Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; } 229 231 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 230 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }231 232 TComPic** getIlpList() { return m_cIlpPic; }233 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; }234 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; }232 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 233 234 TComPic** getIlpList() { return m_cIlpPic; } 235 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } 236 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 235 237 Void setInterLayerWeightedPredFlag(Bool flag) { m_interLayerWeightedPredFlag = flag; } 236 238 Bool getInterLayerWeightedPredFlag() { return m_interLayerWeightedPredFlag; } -
branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
r1202 r1235 47 47 WeightPredAnalysis::WeightPredAnalysis() 48 48 { 49 m_weighted_pred_flag = false;50 m_weighted_bipred_flag = false;51 52 49 for ( UInt lst =0 ; lst<NUM_REF_PIC_LIST_01 ; lst++ ) 53 50 { … … 121 118 } 122 119 123 124 /** store weighted_pred_flag and weighted_bipred_idc values125 * \param weighted_pred_flag126 * \param weighted_bipred_idc127 * \returns Void128 */129 Void WeightPredAnalysis::xStoreWPparam(const Bool weighted_pred_flag, const Bool weighted_bipred_flag)130 {131 m_weighted_pred_flag = weighted_pred_flag;132 m_weighted_bipred_flag = weighted_bipred_flag;133 }134 135 136 /** restore weighted_pred_flag and weighted_bipred_idc values137 * \param TComSlice *slice138 * \returns Void139 */140 Void WeightPredAnalysis::xRestoreWPparam(TComSlice *const slice)141 {142 slice->getPPS()->setUseWP (m_weighted_pred_flag);143 slice->getPPS()->setWPBiPred(m_weighted_bipred_flag);144 }145 146 147 120 /** check weighted pred or non-weighted pred 148 121 * \param TComSlice *slice … … 168 141 if(iPresentCnt==0) 169 142 { 170 slice-> getPPS()->setUseWP(false);171 slice-> getPPS()->setWPBiPred(false);143 slice->setTestWeightPred(false); 144 slice->setTestWeightBiPred(false); 172 145 173 146 for ( UInt lst=0 ; lst<NUM_REF_PIC_LIST_01 ; lst++ ) … … 188 161 slice->setWpScaling( m_wp ); 189 162 } 163 else 164 { 165 slice->setTestWeightPred(slice->getPPS()->getUseWP()); 166 slice->setTestWeightBiPred(slice->getPPS()->getWPBiPred()); 167 } 190 168 } 191 169 … … 213 191 } while (validRangeFlag == false); 214 192 215 // selecting whether WP is used, or not 193 // selecting whether WP is used, or not (fast search) 194 // NOTE: This is not operating on a slice, but the entire picture. 216 195 xSelectWP(slice, iDenom); 217 196 -
branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.h
r1029 r1235 46 46 private: 47 47 48 // member variables 49 Bool m_weighted_pred_flag; 50 Bool m_weighted_bipred_flag; 48 // member variables 51 49 WPScalingParam m_wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; 52 50 … … 75 73 Void xCalcACDCParamSlice (TComSlice *const slice); 76 74 Void xEstimateWPParamSlice(TComSlice *const slice); 77 Void xStoreWPparam (const Bool weighted_pred_flag, const Bool weighted_bipred_flag);78 Void xRestoreWPparam (TComSlice *const slice);79 75 Void xCheckWPEnable (TComSlice *const slice); 80 76 };
Note: See TracChangeset for help on using the changeset viewer.