Ticket #1099: SVN_HEVCSoftware_trunk_ps_shared_ptr.patch
File SVN_HEVCSoftware_trunk_ps_shared_ptr.patch, 63.0 KB (added by jackh, 10 years ago) |
---|
-
source/App/TAppEncoder/TAppEncTop.cpp
67 67 68 68 Void TAppEncTop::xInitLibCfg() 69 69 { 70 TComVPS vps;70 std::tr1::shared_ptr<TComVPS> vps=std::tr1::shared_ptr<TComVPS>(new TComVPS()); 71 71 72 vps .setMaxTLayers ( m_maxTempLayer );72 vps->setMaxTLayers ( m_maxTempLayer ); 73 73 if (m_maxTempLayer == 1) 74 74 { 75 vps .setTemporalNestingFlag(true);75 vps->setTemporalNestingFlag(true); 76 76 } 77 vps .setMaxLayers ( 1 );77 vps->setMaxLayers ( 1 ); 78 78 for(Int i = 0; i < MAX_TLAYER; i++) 79 79 { 80 vps .setNumReorderPics ( m_numReorderPics[i], i );81 vps .setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i );80 vps->setNumReorderPics ( m_numReorderPics[i], i ); 81 vps->setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 82 82 } 83 m_cTEncTop.setVPS( &vps);83 m_cTEncTop.setVPS(vps); 84 84 85 85 m_cTEncTop.setProfile(m_profile); 86 86 m_cTEncTop.setLevel(m_levelTier, m_level); -
source/Lib/TLibDecoder/TDecSlice.cpp
406 406 407 407 } 408 408 409 TComVPS*ParameterSetManagerDecoder::getPrefetchedVPS (Int vpsId)409 std::tr1::shared_ptr<TComVPS> ParameterSetManagerDecoder::getPrefetchedVPS (Int vpsId) 410 410 { 411 411 if (m_vpsBuffer.getPS(vpsId) != NULL ) 412 412 { … … 419 419 } 420 420 421 421 422 TComSPS*ParameterSetManagerDecoder::getPrefetchedSPS (Int spsId)422 std::tr1::shared_ptr<TComSPS> ParameterSetManagerDecoder::getPrefetchedSPS (Int spsId) 423 423 { 424 424 if (m_spsBuffer.getPS(spsId) != NULL ) 425 425 { … … 431 431 } 432 432 } 433 433 434 TComPPS*ParameterSetManagerDecoder::getPrefetchedPPS (Int ppsId)434 std::tr1::shared_ptr<TComPPS> ParameterSetManagerDecoder::getPrefetchedPPS (Int ppsId) 435 435 { 436 436 if (m_ppsBuffer.getPS(ppsId) != NULL ) 437 437 { -
source/Lib/TLibDecoder/TDecTop.cpp
251 251 { 252 252 m_parameterSetManagerDecoder.applyPrefetchedPS(); 253 253 254 TComPPS *pps = m_parameterSetManagerDecoder.getPPS(m_apcSlicePilot->getPPSId());255 assert (pps != 0);254 std::tr1::shared_ptr<TComPPS> pps = m_parameterSetManagerDecoder.getPPS(m_apcSlicePilot->getPPSId()); 255 assert (pps); 256 256 257 TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId());258 assert (sps != 0);257 std::tr1::shared_ptr<TComSPS> sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); 258 assert (sps); 259 259 260 260 Bool spsChanged=sps!=m_parameterSetManagerDecoder.getActiveSPS(); 261 261 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) … … 620 620 621 621 Void TDecTop::xDecodeVPS() 622 622 { 623 TComVPS* vps = new TComVPS();623 std::tr1::shared_ptr<TComVPS> vps = std::tr1::shared_ptr<TComVPS>(new TComVPS()); 624 624 625 625 m_cEntropyDecoder.decodeVPS( vps ); 626 626 m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 627 627 628 } 628 629 629 630 Void TDecTop::xDecodeSPS() 630 631 { 631 TComSPS* sps = new TComSPS();632 std::tr1::shared_ptr<TComSPS> sps = std::tr1::shared_ptr<TComSPS>(new TComSPS()); 632 633 m_cEntropyDecoder.decodeSPS( sps ); 633 634 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 634 635 } 635 636 636 637 Void TDecTop::xDecodePPS() 637 638 { 638 TComPPS* pps = new TComPPS();639 std::tr1::shared_ptr<TComPPS> pps = std::tr1::shared_ptr<TComPPS>(new TComPPS()); 639 640 m_cEntropyDecoder.decodePPS( pps ); 640 641 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 641 642 } -
source/Lib/TLibDecoder/TDecSlice.h
92 92 public: 93 93 ParameterSetManagerDecoder(); 94 94 virtual ~ParameterSetManagerDecoder(); 95 Void storePrefetchedVPS( TComVPS *vps) { m_vpsBuffer.storePS( vps->getVPSId(), vps); };96 TComVPS*getPrefetchedVPS (Int vpsId);97 Void storePrefetchedSPS( TComSPS *sps) { m_spsBuffer.storePS( sps->getSPSId(), sps); };98 TComSPS*getPrefetchedSPS (Int spsId);99 Void storePrefetchedPPS( TComPPS *pps) { m_ppsBuffer.storePS( pps->getPPSId(), pps); };100 TComPPS*getPrefetchedPPS (Int ppsId);95 Void storePrefetchedVPS(const std::tr1::shared_ptr<TComVPS> &vps) { m_vpsBuffer.storePS( vps->getVPSId(), vps); }; 96 std::tr1::shared_ptr<TComVPS> getPrefetchedVPS (Int vpsId); 97 Void storePrefetchedSPS(const std::tr1::shared_ptr<TComSPS> &sps) { m_spsBuffer.storePS( sps->getSPSId(), sps); }; 98 std::tr1::shared_ptr<TComSPS> getPrefetchedSPS (Int spsId); 99 Void storePrefetchedPPS(const std::tr1::shared_ptr<TComPPS> &pps) { m_ppsBuffer.storePS( pps->getPPSId(), pps); }; 100 std::tr1::shared_ptr<TComPPS> getPrefetchedPPS (Int ppsId); 101 101 Void applyPrefetchedPS(); 102 102 103 103 private: -
source/Lib/TLibDecoder/TDecEntropy.h
64 64 virtual Void resetEntropy ( TComSlice* pcSlice ) = 0; 65 65 virtual Void setBitstream ( TComInputBitstream* p ) = 0; 66 66 67 virtual Void parseVPS ( TComVPS*pcVPS ) = 0;68 virtual Void parseSPS ( TComSPS*pcSPS ) = 0;69 virtual Void parsePPS ( TComPPS*pcPPS ) = 0;67 virtual Void parseVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ) = 0; 68 virtual Void parseSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ) = 0; 69 virtual Void parsePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ) = 0; 70 70 71 71 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) = 0; 72 72 … … 127 127 Void setEntropyDecoder ( TDecEntropyIf* p ); 128 128 Void setBitstream ( TComInputBitstream* p ) { m_pcEntropyDecoderIf->setBitstream(p); } 129 129 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 130 Void decodeVPS ( TComVPS*pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); }131 Void decodeSPS ( TComSPS*pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); }132 Void decodePPS ( TComPPS*pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); }130 Void decodeVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 131 Void decodeSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 132 Void decodePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 133 133 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager); } 134 134 135 135 Void decodeTerminatingBit ( UInt& ruiIsLast ) { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast); } -
source/Lib/TLibDecoder/SEIread.cpp
108 108 /** 109 109 * unmarshal a single SEI message from bitstream bs 110 110 */ 111 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps)111 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const std::tr1::shared_ptr<TComSPS> &sps) 112 112 { 113 113 setBitstream(bs); 114 114 … … 126 126 assert(rbspTrailingBits == 0x80); 127 127 } 128 128 129 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps)129 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const std::tr1::shared_ptr<TComSPS> &sps) 130 130 { 131 131 #if ENC_DEC_TRACE 132 132 xTraceSEIHeader(); … … 405 405 } 406 406 } 407 407 408 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, TComSPS *sps)408 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, const std::tr1::shared_ptr<TComSPS> &sps) 409 409 { 410 410 UInt val; 411 411 READ_UVLC(val, "decoding_unit_idx"); … … 430 430 xParseByteAlign(); 431 431 } 432 432 433 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, TComSPS *sps)433 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, const std::tr1::shared_ptr<TComSPS> &sps) 434 434 { 435 435 Int i, nalOrVcl; 436 436 UInt code; … … 476 476 } 477 477 xParseByteAlign(); 478 478 } 479 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, TComSPS *sps)479 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, const std::tr1::shared_ptr<TComSPS> &sps) 480 480 { 481 481 Int i; 482 482 UInt code; … … 718 718 xParseByteAlign(); 719 719 } 720 720 721 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps)721 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const std::tr1::shared_ptr<TComSPS> &sps) 722 722 { 723 723 UInt uiCode; 724 724 SEIMessages seis; -
source/Lib/TLibDecoder/TDecSbac.h
74 74 75 75 Void resetEntropy (TComSlice* pSlice ); 76 76 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 77 Void parseVPS ( TComVPS*/*pcVPS*/ ) {}78 Void parseSPS ( TComSPS*/*pcSPS*/ ) {}79 Void parsePPS ( TComPPS*/*pcPPS*/ ) {}77 Void parseVPS ( const std::tr1::shared_ptr<TComVPS> & /*pcVPS*/ ) {} 78 Void parseSPS ( const std::tr1::shared_ptr<TComSPS> & /*pcSPS*/ ) {} 79 Void parsePPS ( const std::tr1::shared_ptr<TComPPS> & /*pcPPS*/ ) {} 80 80 81 81 Void parseSliceHeader ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {} 82 82 Void parseTerminatingBit ( UInt& ruiBit ); -
source/Lib/TLibDecoder/SEIread.h
55 55 public: 56 56 SEIReader() {}; 57 57 virtual ~SEIReader() {}; 58 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps);58 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const std::tr1::shared_ptr<TComSPS> &sps); 59 59 protected: 60 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps);60 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const std::tr1::shared_ptr<TComSPS> &sps); 61 61 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize); 62 62 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize); 63 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps);63 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const std::tr1::shared_ptr<TComSPS> &sps); 64 64 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize); 65 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps);66 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps);65 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const std::tr1::shared_ptr<TComSPS> &sps); 66 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const std::tr1::shared_ptr<TComSPS> &sps); 67 67 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize); 68 68 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize); 69 69 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize); … … 71 71 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 72 72 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 73 73 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 74 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);74 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const std::tr1::shared_ptr<TComSPS> &sps); 75 75 Void xParseByteAlign(); 76 76 }; 77 77 -
source/Lib/TLibDecoder/TDecCAVLC.cpp
44 44 45 45 #if ENC_DEC_TRACE 46 46 47 Void xTraceSPSHeader ( TComSPS *pSPS)47 Void xTraceSPSHeader (const std::tr1::shared_ptr<TComSPS> &pSPS) 48 48 { 49 49 fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() ); 50 50 } 51 51 52 Void xTracePPSHeader ( TComPPS *pPPS)52 Void xTracePPSHeader (const std::tr1::shared_ptr<TComPPS> &pPPS) 53 53 { 54 54 fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() ); 55 55 } … … 78 78 // Public member functions 79 79 // ==================================================================================================================== 80 80 81 void TDecCavlc::parseShortTermRefPicSet( TComSPS*sps, TComReferencePictureSet* rps, Int idx )81 void TDecCavlc::parseShortTermRefPicSet( const std::tr1::shared_ptr<TComSPS> &sps, TComReferencePictureSet* rps, Int idx ) 82 82 { 83 83 UInt code; 84 84 UInt interRPSPred; … … 174 174 #endif 175 175 } 176 176 177 Void TDecCavlc::parsePPS( TComPPS*pcPPS)177 Void TDecCavlc::parsePPS(const std::tr1::shared_ptr<TComPPS> &pcPPS) 178 178 { 179 179 #if ENC_DEC_TRACE 180 180 xTracePPSHeader (pcPPS); … … 314 314 } 315 315 } 316 316 317 Void TDecCavlc::parseVUI(TComVUI* pcVUI, TComSPS *pcSPS)317 Void TDecCavlc::parseVUI(TComVUI* pcVUI, const std::tr1::shared_ptr<TComSPS> &pcSPS) 318 318 { 319 319 #if ENC_DEC_TRACE 320 320 fprintf( g_hTrace, "----------- vui_parameters -----------\n"); … … 481 481 } 482 482 } 483 483 484 Void TDecCavlc::parseSPS( TComSPS*pcSPS)484 Void TDecCavlc::parseSPS(const std::tr1::shared_ptr<TComSPS> &pcSPS) 485 485 { 486 486 #if ENC_DEC_TRACE 487 487 xTraceSPSHeader (pcSPS); … … 648 648 } 649 649 } 650 650 651 Void TDecCavlc::parseVPS( TComVPS*pcVPS)651 Void TDecCavlc::parseVPS(const std::tr1::shared_ptr<TComVPS> &pcVPS) 652 652 { 653 653 UInt uiCode; 654 654 … … 739 739 #if ENC_DEC_TRACE 740 740 xTraceSliceHeader(rpcSlice); 741 741 #endif 742 TComPPS* pps = NULL;743 TComSPS* sps = NULL;742 std::tr1::shared_ptr<TComPPS> pps; 743 std::tr1::shared_ptr<TComSPS> sps; 744 744 745 745 UInt firstSliceSegmentInPic; 746 746 READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" ); -
source/Lib/TLibDecoder/TDecCAVLC.h
60 60 virtual ~TDecCavlc(); 61 61 62 62 protected: 63 void parseShortTermRefPicSet ( TComSPS*pcSPS, TComReferencePictureSet* pcRPS, Int idx);63 void parseShortTermRefPicSet (const std::tr1::shared_ptr<TComSPS> &pcSPS, TComReferencePictureSet* pcRPS, Int idx); 64 64 65 65 public: 66 66 … … 70 70 Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); 71 71 Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ); 72 72 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 73 Void parseVPS ( TComVPS*pcVPS );74 Void parseSPS ( TComSPS*pcSPS );75 Void parsePPS ( TComPPS*pcPPS);76 Void parseVUI ( TComVUI* pcVUI, TComSPS*pcSPS );73 Void parseVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ); 74 Void parseSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ); 75 Void parsePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS); 76 Void parseVUI ( TComVUI* pcVUI, const std::tr1::shared_ptr<TComSPS> &pcSPS ); 77 77 Void parseSEI ( SEIMessages& ); 78 78 Void parsePTL ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ); 79 79 Void parseProfileTier (ProfileTierLevel *ptl); -
source/Lib/TLibCommon/TComSlice.h
41 41 #include <cstring> 42 42 #include <map> 43 43 #include <vector> 44 #ifdef _MSC_VER 45 #include <memory> 46 #else 47 #include <tr1/memory> 48 #endif 44 49 #include "CommonDef.h" 45 50 #include "TComRom.h" 46 51 #include "TComList.h" … … 916 921 Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag 917 922 918 923 // access channel 919 TComSPS*m_pcSPS;924 std::tr1::shared_ptr<TComSPS> m_pcSPS; 920 925 UInt m_uiMaxCuDQPDepth; 921 926 UInt m_uiMinCuDQPSize; 922 927 … … 981 986 Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } 982 987 Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } 983 988 984 Void setSPS ( TComSPS*pcSPS ) { m_pcSPS = pcSPS; }985 TComSPS*getSPS () { return m_pcSPS; }989 Void setSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ) { m_pcSPS = pcSPS; } 990 std::tr1::shared_ptr<TComSPS> getSPS () { return m_pcSPS; } 986 991 Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } 987 992 UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} 988 993 Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } … … 1151 1156 Bool m_bRefenced; 1152 1157 1153 1158 // access channel 1154 TComVPS*m_pcVPS;1155 TComSPS*m_pcSPS;1156 TComPPS*m_pcPPS;1159 std::tr1::shared_ptr<TComVPS> m_pcVPS; 1160 std::tr1::shared_ptr<TComSPS> m_pcSPS; 1161 std::tr1::shared_ptr<TComPPS> m_pcPPS; 1157 1162 TComPic* m_pcPic; 1158 1163 #if ADAPTIVE_QP_SELECTION 1159 1164 TComTrQuant* m_pcTrQuant; … … 1211 1216 virtual ~TComSlice(); 1212 1217 Void initSlice (); 1213 1218 1214 Void setVPS ( TComVPS*pcVPS ) { m_pcVPS = pcVPS; }1215 TComVPS*getVPS () { return m_pcVPS; }1216 Void setSPS ( TComSPS*pcSPS ) { m_pcSPS = pcSPS; }1217 TComSPS*getSPS () { return m_pcSPS; }1219 Void setVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ) { m_pcVPS = pcVPS; } 1220 std::tr1::shared_ptr<TComVPS> getVPS () { return m_pcVPS; } 1221 Void setSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ) { m_pcSPS = pcSPS; } 1222 std::tr1::shared_ptr<TComSPS> getSPS () { return m_pcSPS; } 1218 1223 1219 Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); }1220 TComPPS*getPPS () { return m_pcPPS; }1224 Void setPPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ) { assert(pcPPS); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } 1225 std::tr1::shared_ptr<TComPPS> getPPS () { return m_pcPPS; } 1221 1226 1222 1227 #if ADAPTIVE_QP_SELECTION 1223 1228 Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } … … 1438 1443 :m_maxId (maxId) 1439 1444 {} 1440 1445 1441 ~ParameterSetMap()1446 Void storePS(Int psId, const std::tr1::shared_ptr<T> &ps) 1442 1447 { 1443 for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++)1444 {1445 delete (*i).second;1446 }1447 }1448 1449 Void storePS(Int psId, T *ps)1450 {1451 1448 assert ( psId < m_maxId ); 1452 if ( m_paramsetMap.find(psId) != m_paramsetMap.end() )1453 {1454 delete m_paramsetMap[psId];1455 }1456 1449 m_paramsetMap[psId] = ps; 1457 1450 } 1458 1451 1459 1452 Void mergePSList(ParameterSetMap<T> &rPsList) 1460 1453 { 1461 for (typename std::map<Int, T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++)1454 for (typename std::map<Int,std::tr1::shared_ptr<T> >::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) 1462 1455 { 1463 1456 storePS(i->first, i->second); 1464 1457 } … … 1466 1459 } 1467 1460 1468 1461 1469 T*getPS(Int psId)1462 std::tr1::shared_ptr<T> getPS(Int psId) 1470 1463 { 1471 return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL: m_paramsetMap[psId];1464 return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? std::tr1::shared_ptr<T>() : m_paramsetMap[psId]; 1472 1465 } 1473 1466 1474 T*getFirstPS()1467 std::tr1::shared_ptr<T> getFirstPS() 1475 1468 { 1476 return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL: m_paramsetMap.begin()->second;1469 return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? std::tr1::shared_ptr<T>() : m_paramsetMap.begin()->second; 1477 1470 } 1478 1471 1479 1472 private: 1480 std::map<Int, T *> m_paramsetMap;1473 std::map<Int,std::tr1::shared_ptr<T> > m_paramsetMap; 1481 1474 Int m_maxId; 1482 1475 }; 1483 1476 … … 1488 1481 virtual ~ParameterSetManager(); 1489 1482 1490 1483 //! store sequence parameter set and take ownership of it 1491 Void storeVPS( TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); };1484 Void storeVPS(const std::tr1::shared_ptr<TComVPS> &vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; 1492 1485 //! get pointer to existing video parameter set 1493 TComVPS*getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); };1494 TComVPS*getFirstVPS() { return m_vpsMap.getFirstPS(); };1486 std::tr1::shared_ptr<TComVPS> getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; 1487 std::tr1::shared_ptr<TComVPS> getFirstVPS() { return m_vpsMap.getFirstPS(); }; 1495 1488 1496 1489 //! store sequence parameter set and take ownership of it 1497 Void storeSPS( TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); };1490 Void storeSPS(const std::tr1::shared_ptr<TComSPS> &sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; 1498 1491 //! get pointer to existing sequence parameter set 1499 TComSPS*getSPS(Int spsId) { return m_spsMap.getPS(spsId); };1500 TComSPS*getFirstSPS() { return m_spsMap.getFirstPS(); };1492 std::tr1::shared_ptr<TComSPS> getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; 1493 std::tr1::shared_ptr<TComSPS> getFirstSPS() { return m_spsMap.getFirstPS(); }; 1501 1494 1502 1495 //! store picture parameter set and take ownership of it 1503 Void storePPS( TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); };1496 Void storePPS(const std::tr1::shared_ptr<TComPPS> &pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; 1504 1497 //! get pointer to existing picture parameter set 1505 TComPPS*getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); };1506 TComPPS*getFirstPPS() { return m_ppsMap.getFirstPS(); };1498 std::tr1::shared_ptr<TComPPS> getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; 1499 std::tr1::shared_ptr<TComPPS> getFirstPPS() { return m_ppsMap.getFirstPS(); }; 1507 1500 1508 1501 //! activate a SPS from a active parameter sets SEI message 1509 1502 //! \returns true, if activation is successful … … 1513 1506 //! \returns true, if activation is successful 1514 1507 Bool activatePPS(Int ppsId, Bool isIRAP); 1515 1508 1516 TComVPS*getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };1517 TComSPS*getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); };1518 TComPPS*getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); };1509 std::tr1::shared_ptr<TComVPS> getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; 1510 std::tr1::shared_ptr<TComSPS> getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; 1511 std::tr1::shared_ptr<TComPPS> getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; 1519 1512 1520 1513 protected: 1521 1514 -
source/Lib/TLibCommon/TComWeightPrediction.cpp
273 273 assert(iRefIdx0 >= 0 || iRefIdx1 >= 0); 274 274 275 275 TComSlice* pcSlice = pcCU->getSlice(); 276 TComPPS*pps = pcCU->getSlice()->getPPS();276 std::tr1::shared_ptr<TComPPS> pps = pcCU->getSlice()->getPPS(); 277 277 Bool wpBiPred = pps->getWPBiPred(); 278 278 wpScalingParam* pwp; 279 279 Bool bBiDir = (iRefIdx0>=0 && iRefIdx1>=0); … … 350 350 Void TComWeightPrediction::xWeightedPredictionBi( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* rpcYuvDst ) 351 351 { 352 352 wpScalingParam *pwp0, *pwp1; 353 TComPPS *pps = pcCU->getSlice()->getPPS();353 std::tr1::shared_ptr<TComPPS> pps = pcCU->getSlice()->getPPS(); 354 354 assert( pps->getWPBiPred()); 355 355 356 356 getWpScaling(pcCU, iRefIdx0, iRefIdx1, pwp0, pwp1); -
source/Lib/TLibCommon/TComSlice.cpp
65 65 , m_iSliceQpDeltaCr ( 0 ) 66 66 , m_iDepth ( 0 ) 67 67 , m_bRefenced ( false ) 68 , m_pcSPS ( NULL)69 , m_pcPPS ( NULL)68 , m_pcSPS ( ) 69 , m_pcPPS ( ) 70 70 , m_pcPic ( NULL ) 71 71 , m_colFromL0Flag ( 1 ) 72 72 , m_colRefIdx ( 0 ) … … 1399 1399 , m_useDQP (false) 1400 1400 , m_bConstrainedIntraPred (false) 1401 1401 , m_bSliceChromaQpFlag (false) 1402 , m_pcSPS ( NULL)1402 , m_pcSPS () 1403 1403 , m_uiMaxCuDQPDepth (0) 1404 1404 , m_uiMinCuDQPSize (0) 1405 1405 , m_chromaCbQpOffset (0) … … 1881 1881 //! \returns true, if activation is successful 1882 1882 Bool ParameterSetManager::activateSPSWithSEI(Int spsId) 1883 1883 { 1884 TComSPS *sps = m_spsMap.getPS(spsId);1884 std::tr1::shared_ptr<TComSPS> sps = m_spsMap.getPS(spsId); 1885 1885 if (sps) 1886 1886 { 1887 1887 Int vpsId = sps->getVPSId(); … … 1907 1907 //! \returns true, if activation is successful 1908 1908 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 1909 1909 { 1910 TComPPS *pps = m_ppsMap.getPS(ppsId);1910 std::tr1::shared_ptr<TComPPS> pps = m_ppsMap.getPS(ppsId); 1911 1911 if (pps) 1912 1912 { 1913 1913 Int spsId = pps->getSPSId(); … … 1916 1916 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP."); 1917 1917 return false; 1918 1918 } 1919 TComSPS *sps = m_spsMap.getPS(spsId);1919 std::tr1::shared_ptr<TComSPS> sps = m_spsMap.getPS(spsId); 1920 1920 if (sps) 1921 1921 { 1922 1922 Int vpsId = sps->getVPSId(); -
source/Lib/TLibEncoder/TEncGOP.h
155 155 156 156 Double xCalculateRVM(); 157 157 158 SEIActiveParameterSets* xCreateSEIActiveParameterSets ( TComSPS *sps);158 SEIActiveParameterSets* xCreateSEIActiveParameterSets (const std::tr1::shared_ptr<TComSPS> &sps); 159 159 SEIFramePacking* xCreateSEIFramePacking(); 160 160 SEIDisplayOrientation* xCreateSEIDisplayOrientation(); 161 161 162 162 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 163 163 164 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps);164 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const std::tr1::shared_ptr<TComSPS> &sps); 165 165 Int xGetFirstSeiLocation (AccessUnit &accessUnit); 166 166 Void xResetNonNestedSEIPresentFlags() 167 167 { -
source/Lib/TLibEncoder/TEncCavlc.h
68 68 TComSlice* m_pcSlice; 69 69 UInt m_uiCoeffCost; 70 70 71 Void codeShortTermRefPicSet ( TComSPS*pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );71 Void codeShortTermRefPicSet ( const std::tr1::shared_ptr<TComSPS> &pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx ); 72 72 Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag ); 73 73 74 74 public: … … 82 82 Void resetCoeffCost () { m_uiCoeffCost = 0; } 83 83 UInt getNumberOfWrittenBits() { return m_pcBitIf->getNumberOfWrittenBits(); } 84 84 UInt getCoeffCost () { return m_uiCoeffCost; } 85 Void codeVPS ( TComVPS*pcVPS );86 Void codeVUI ( TComVUI *pcVUI, TComSPS*pcSPS );87 Void codeSPS ( TComSPS*pcSPS );88 Void codePPS ( TComPPS*pcPPS );85 Void codeVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ); 86 Void codeVUI ( TComVUI *pcVUI, const std::tr1::shared_ptr<TComSPS> &pcSPS ); 87 Void codeSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ); 88 Void codePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ); 89 89 Void codeSliceHeader ( TComSlice* pcSlice ); 90 90 Void codePTL ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1); 91 91 Void codeProfileTier ( ProfileTierLevel* ptl ); -
source/Lib/TLibEncoder/TEncEntropy.cpp
80 80 m_pcEntropyCoderIf->codeSliceFinish(); 81 81 } 82 82 83 Void TEncEntropy::encodePPS( TComPPS*pcPPS )83 Void TEncEntropy::encodePPS( const std::tr1::shared_ptr<TComPPS> &pcPPS ) 84 84 { 85 85 m_pcEntropyCoderIf->codePPS( pcPPS ); 86 86 return; 87 87 } 88 88 89 Void TEncEntropy::encodeSPS( TComSPS*pcSPS )89 Void TEncEntropy::encodeSPS( const std::tr1::shared_ptr<TComSPS> &pcSPS ) 90 90 { 91 91 m_pcEntropyCoderIf->codeSPS( pcSPS ); 92 92 return; … … 101 101 m_pcEntropyCoderIf->codeCUTransquantBypassFlag( pcCU, uiAbsPartIdx ); 102 102 } 103 103 104 Void TEncEntropy::encodeVPS( TComVPS*pcVPS )104 Void TEncEntropy::encodeVPS( const std::tr1::shared_ptr<TComVPS> &pcVPS ) 105 105 { 106 106 m_pcEntropyCoderIf->codeVPS( pcVPS ); 107 107 return; -
source/Lib/TLibEncoder/TEncCfg.h
289 289 #endif 290 290 Bool m_TransquantBypassEnableFlag; ///< transquant_bypass_enable_flag setting in PPS. 291 291 Bool m_CUTransquantBypassFlagValue; ///< if transquant_bypass_enable_flag, the fixed value to use for the per-CU cu_transquant_bypass_flag. 292 TComVPSm_cVPS;292 std::tr1::shared_ptr<TComVPS> m_cVPS; 293 293 Bool m_recalculateQPAccordingToLambda; ///< recalculate QP value according to the lambda value 294 294 Int m_activeParameterSetsSEIEnabled; ///< enable active parameter set SEI message 295 295 Bool m_vuiParametersPresentFlag; ///< enable generation of VUI parameters … … 689 689 Void setTransquantBypassEnableFlag(Bool flag) { m_TransquantBypassEnableFlag = flag; } 690 690 Bool getCUTransquantBypassFlagValue() { return m_CUTransquantBypassFlagValue; } 691 691 Void setCUTransquantBypassFlagValue(Bool flag) { m_CUTransquantBypassFlagValue = flag; } 692 Void setVPS( TComVPS *p) { m_cVPS = *p; }693 TComVPS *getVPS() { return &m_cVPS; }692 Void setVPS(const std::tr1::shared_ptr<TComVPS> &p) { m_cVPS = p; } 693 std::tr1::shared_ptr<TComVPS> getVPS() { return m_cVPS; } 694 694 Void setUseRecalculateQPAccordingToLambda ( Bool b ) { m_recalculateQPAccordingToLambda = b; } 695 695 Bool getUseRecalculateQPAccordingToLambda () { return m_recalculateQPAccordingToLambda; } 696 696 -
source/Lib/TLibEncoder/TEncSlice.h
112 112 113 113 /// preparation of slice encoding (reference marking, QP and lambda) 114 114 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 115 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS );115 Int iGOPid, TComSlice*& rpcSlice, const std::tr1::shared_ptr<TComSPS> &pSPS, const std::tr1::shared_ptr<TComPPS> &pPPS ); 116 116 #if RATE_CONTROL_LAMBDA_DOMAIN 117 117 Void resetQP ( TComPic* pic, Int sliceQP, Double lambda ); 118 118 #else 119 Void xLamdaRecalculation ( Int changeQP, Int idGOP, Int depth, SliceType eSliceType, TComSPS*pcSPS, TComSlice* pcSlice);119 Void xLamdaRecalculation ( Int changeQP, Int idGOP, Int depth, SliceType eSliceType, const std::tr1::shared_ptr<TComSPS> &pcSPS, TComSlice* pcSlice); 120 120 #endif 121 121 // compress and encode slice 122 122 Void precompressSlice ( TComPic*& rpcPic ); ///< precompress slice for multi-loop opt. -
source/Lib/TLibEncoder/TEncSearch.cpp
5897 5897 } 5898 5898 5899 5899 TComSlice *pcSlice = pcCU->getSlice(); 5900 TComPPS *pps = pcCU->getSlice()->getPPS();5900 std::tr1::shared_ptr<TComPPS> pps = pcCU->getSlice()->getPPS(); 5901 5901 wpScalingParam *wp0 , *wp1; 5902 5902 m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pps->getUseWP() ) || ( pcSlice->getSliceType()==B_SLICE && pps->getWPBiPred() ) ; 5903 5903 if ( !m_cDistParam.bApplyWeight ) return; -
source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
1000 1000 { 1001 1001 Int x,y; 1002 1002 TComDataCU *pTmpCu = m_pcPic->getCU(iAddr); 1003 TComSPS *pTmpSPS = m_pcPic->getSlice(0)->getSPS();1003 std::tr1::shared_ptr<TComSPS> pTmpSPS = m_pcPic->getSlice(0)->getSPS(); 1004 1004 1005 1005 Pel* pOrg; 1006 1006 Pel* pRec; … … 1265 1265 { 1266 1266 Int addr, yCbCr; 1267 1267 Int x,y; 1268 TComSPS *pTmpSPS = pcPic->getSlice(0)->getSPS();1268 std::tr1::shared_ptr<TComSPS> pTmpSPS = pcPic->getSlice(0)->getSPS(); 1269 1269 1270 1270 Pel* pOrg; 1271 1271 Pel* pRec; -
source/Lib/TLibEncoder/TEncTop.h
93 93 TEncSlice m_cSliceEncoder; ///< slice encoder 94 94 TEncCu m_cCuEncoder; ///< CU encoder 95 95 // SPS 96 TComSPSm_cSPS; ///< SPS97 TComPPSm_cPPS; ///< PPS96 std::tr1::shared_ptr<TComSPS> m_cSPS; ///< SPS 97 std::tr1::shared_ptr<TComPPS> m_cPPS; ///< PPS 98 98 // RD cost computation 99 99 TComBitCounter m_cBitCounter; ///< bit counter for RD optimization 100 100 TComRdCost m_cRdCost; ///< RD cost computation class … … 169 169 TEncSbac**** getRDSbacCoders () { return m_ppppcRDSbacCoders; } 170 170 TEncSbac* getRDGoOnSbacCoders () { return m_pcRDGoOnSbacCoders; } 171 171 TEncRateCtrl* getRateCtrl () { return &m_cRateCtrl; } 172 TComSPS* getSPS () { return &m_cSPS; }173 TComPPS* getPPS () { return &m_cPPS; }172 std::tr1::shared_ptr<TComSPS> getSPS () { return m_cSPS; } 173 std::tr1::shared_ptr<TComPPS> getPPS () { return m_cPPS; } 174 174 Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid ); 175 175 Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid ); 176 176 TComScalingList* getScalingList () { return &m_scalingList; } -
source/Lib/TLibEncoder/TEncSbac.cpp
239 239 m_pcBinIf->start(); 240 240 } 241 241 242 Void TEncSbac::codeVPS( TComVPS*pcVPS )242 Void TEncSbac::codeVPS( const std::tr1::shared_ptr<TComVPS> &pcVPS ) 243 243 { 244 244 assert (0); 245 245 return; 246 246 } 247 247 248 Void TEncSbac::codeSPS( TComSPS*pcSPS )248 Void TEncSbac::codeSPS( const std::tr1::shared_ptr<TComSPS> &pcSPS ) 249 249 { 250 250 assert (0); 251 251 return; 252 252 } 253 253 254 Void TEncSbac::codePPS( TComPPS*pcPPS )254 Void TEncSbac::codePPS( const std::tr1::shared_ptr<TComPPS> &pcPPS ) 255 255 { 256 256 assert (0); 257 257 return; -
source/Lib/TLibEncoder/TEncGOP.cpp
136 136 137 137 } 138 138 139 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets ( TComSPS *sps)139 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets (const std::tr1::shared_ptr<TComSPS> &sps) 140 140 { 141 141 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); 142 142 seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId(); … … 269 269 return seiToneMappingInfo; 270 270 } 271 271 272 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps)272 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const std::tr1::shared_ptr<TComSPS> &sps) 273 273 { 274 274 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 275 275 -
source/Lib/TLibEncoder/SEIwrite.h
46 46 SEIWriter() {}; 47 47 virtual ~SEIWriter() {}; 48 48 49 void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps);49 void writeSEImessage(TComBitIf& bs, const SEI& sei, const std::tr1::shared_ptr<TComSPS> &sps); 50 50 51 51 protected: 52 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);52 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const std::tr1::shared_ptr<TComSPS> &sps); 53 53 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); 54 54 Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei); 55 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps);55 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const std::tr1::shared_ptr<TComSPS> &sps); 56 56 Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei); 57 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps);58 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps);59 TComSPS *m_pSPS;57 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const std::tr1::shared_ptr<TComSPS> &sps); 58 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const std::tr1::shared_ptr<TComSPS> &sps); 59 std::tr1::shared_ptr<TComSPS> m_pSPS; 60 60 Void xWriteSEIRecoveryPoint(const SEIRecoveryPoint& sei); 61 61 Void xWriteSEIFramePacking(const SEIFramePacking& sei); 62 62 Void xWriteSEIDisplayOrientation(const SEIDisplayOrientation &sei); … … 64 64 Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei); 65 65 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 66 66 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 67 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);67 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const std::tr1::shared_ptr<TComSPS> &sps); 68 68 Void xWriteByteAlign(); 69 69 }; 70 70 -
source/Lib/TLibEncoder/TEncCavlc.cpp
44 44 45 45 #if ENC_DEC_TRACE 46 46 47 Void xTraceSPSHeader ( TComSPS *pSPS)47 Void xTraceSPSHeader (const std::tr1::shared_ptr<TComSPS> &pSPS) 48 48 { 49 49 fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() ); 50 50 } 51 51 52 Void xTracePPSHeader ( TComPPS *pPPS)52 Void xTracePPSHeader (const std::tr1::shared_ptr<TComPPS> &pPPS) 53 53 { 54 54 fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() ); 55 55 } … … 96 96 WRITE_SVLC(iCode, pSymbolName); 97 97 } 98 98 99 Void TEncCavlc::codeShortTermRefPicSet( TComSPS*pcSPS, TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx)99 Void TEncCavlc::codeShortTermRefPicSet( const std::tr1::shared_ptr<TComSPS> &pcSPS, TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx) 100 100 { 101 101 #if PRINT_RPS_INFO 102 102 Int lastBits = getNumberOfWrittenBits(); … … 153 153 } 154 154 155 155 156 Void TEncCavlc::codePPS( TComPPS*pcPPS )156 Void TEncCavlc::codePPS( const std::tr1::shared_ptr<TComPPS> &pcPPS ) 157 157 { 158 158 #if ENC_DEC_TRACE 159 159 xTracePPSHeader (pcPPS); … … 233 233 WRITE_FLAG( 0, "pps_extension_flag" ); 234 234 } 235 235 236 Void TEncCavlc::codeVUI( TComVUI *pcVUI, TComSPS*pcSPS )236 Void TEncCavlc::codeVUI( TComVUI *pcVUI, const std::tr1::shared_ptr<TComSPS> &pcSPS ) 237 237 { 238 238 #if ENC_DEC_TRACE 239 239 fprintf( g_hTrace, "----------- vui_parameters -----------\n"); … … 392 392 } 393 393 } 394 394 395 Void TEncCavlc::codeSPS( TComSPS*pcSPS )395 Void TEncCavlc::codeSPS( const std::tr1::shared_ptr<TComSPS> &pcSPS ) 396 396 { 397 397 #if ENC_DEC_TRACE 398 398 xTraceSPSHeader (pcSPS); … … 507 507 WRITE_FLAG( 0, "sps_extension_flag" ); 508 508 } 509 509 510 Void TEncCavlc::codeVPS( TComVPS*pcVPS )510 Void TEncCavlc::codeVPS( const std::tr1::shared_ptr<TComVPS> &pcVPS ) 511 511 { 512 512 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 513 513 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); -
source/Lib/TLibEncoder/TEncSlice.cpp
175 175 \param pSPS SPS associated with the slice 176 176 \param pPPS PPS associated with the slice 177 177 */ 178 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )178 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, const std::tr1::shared_ptr<TComSPS> &pSPS, const std::tr1::shared_ptr<TComPPS> &pPPS ) 179 179 { 180 180 Double dQP; 181 181 Double dLambda; … … 493 493 /** 494 494 - lambda re-computation based on rate control QP 495 495 */ 496 Void TEncSlice::xLamdaRecalculation(Int changeQP, Int idGOP, Int depth, SliceType eSliceType, TComSPS*pcSPS, TComSlice* pcSlice)496 Void TEncSlice::xLamdaRecalculation(Int changeQP, Int idGOP, Int depth, SliceType eSliceType, const std::tr1::shared_ptr<TComSPS> &pcSPS, TComSlice* pcSlice) 497 497 { 498 498 Int qp; 499 499 Double recalQP= (Double)changeQP; -
source/Lib/TLibEncoder/TEncTop.cpp
209 209 m_cGOPEncoder. destroy(); 210 210 m_cSliceEncoder. destroy(); 211 211 m_cCuEncoder. destroy(); 212 if (m_cSPS .getUseSAO())212 if (m_cSPS->getUseSAO()) 213 213 { 214 214 m_cEncSAO.destroy(); 215 215 m_cEncSAO.destroyEncBuffer(); … … 279 279 xInitSPS(); 280 280 281 281 /* set the VPS profile information */ 282 *m_cVPS .getPTL() = *m_cSPS.getPTL();283 m_cVPS .getTimingInfo()->setTimingInfoPresentFlag ( false );282 *m_cVPS->getPTL() = *m_cSPS->getPTL(); 283 m_cVPS->getTimingInfo()->setTimingInfoPresentFlag ( false ); 284 284 // initialize PPS 285 m_cPPS .setSPS(&m_cSPS);285 m_cPPS->setSPS(m_cSPS); 286 286 xInitPPS(); 287 287 xInitRPS(); 288 288 … … 418 418 if ( getUseAdaptiveQP() ) 419 419 { 420 420 TEncPic* pcEPic = new TEncPic; 421 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS .getMaxCuDQPDepth()+1 ,421 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS->getMaxCuDQPDepth()+1 , 422 422 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 423 423 rpcPic = pcEPic; 424 424 } … … 447 447 448 448 Void TEncTop::xInitSPS() 449 449 { 450 ProfileTierLevel& profileTierLevel = *m_cSPS .getPTL()->getGeneralPTL();450 ProfileTierLevel& profileTierLevel = *m_cSPS->getPTL()->getGeneralPTL(); 451 451 profileTierLevel.setLevelIdc(m_level); 452 452 profileTierLevel.setTierFlag(m_levelTier); 453 453 profileTierLevel.setProfileIdc(m_profile); … … 471 471 /* XXX: may be a good idea to refactor the above into a function 472 472 * that chooses the actual compatibility based upon options */ 473 473 474 m_cSPS.setPicWidthInLumaSamples ( m_iSourceWidth ); 475 m_cSPS.setPicHeightInLumaSamples ( m_iSourceHeight ); 476 m_cSPS.setConformanceWindow ( m_conformanceWindow ); 477 m_cSPS.setMaxCUWidth ( g_uiMaxCUWidth ); 478 m_cSPS.setMaxCUHeight ( g_uiMaxCUHeight ); 479 m_cSPS.setMaxCUDepth ( g_uiMaxCUDepth ); 474 m_cSPS=std::tr1::shared_ptr<TComSPS>(new TComSPS()); 475 m_cSPS->setPicWidthInLumaSamples ( m_iSourceWidth ); 476 m_cSPS->setPicHeightInLumaSamples ( m_iSourceHeight ); 477 m_cSPS->setConformanceWindow ( m_conformanceWindow ); 478 m_cSPS->setMaxCUWidth ( g_uiMaxCUWidth ); 479 m_cSPS->setMaxCUHeight ( g_uiMaxCUHeight ); 480 m_cSPS->setMaxCUDepth ( g_uiMaxCUDepth ); 480 481 481 Int minCUSize = m_cSPS .getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );482 Int minCUSize = m_cSPS->getMaxCUWidth() >> ( m_cSPS->getMaxCUDepth()-g_uiAddCUDepth ); 482 483 Int log2MinCUSize = 0; 483 484 while(minCUSize > 1) 484 485 { … … 486 487 log2MinCUSize++; 487 488 } 488 489 489 m_cSPS .setLog2MinCodingBlockSize(log2MinCUSize);490 m_cSPS .setLog2DiffMaxMinCodingBlockSize(m_cSPS.getMaxCUDepth()-g_uiAddCUDepth);490 m_cSPS->setLog2MinCodingBlockSize(log2MinCUSize); 491 m_cSPS->setLog2DiffMaxMinCodingBlockSize(m_cSPS->getMaxCUDepth()-g_uiAddCUDepth); 491 492 492 m_cSPS .setPCMLog2MinSize (m_uiPCMLog2MinSize);493 m_cSPS .setUsePCM ( m_usePCM );494 m_cSPS .setPCMLog2MaxSize( m_pcmLog2MaxSize );493 m_cSPS->setPCMLog2MinSize (m_uiPCMLog2MinSize); 494 m_cSPS->setUsePCM ( m_usePCM ); 495 m_cSPS->setPCMLog2MaxSize( m_pcmLog2MaxSize ); 495 496 496 m_cSPS .setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize );497 m_cSPS .setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize );498 m_cSPS .setQuadtreeTUMaxDepthInter( m_uiQuadtreeTUMaxDepthInter );499 m_cSPS .setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra );497 m_cSPS->setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize ); 498 m_cSPS->setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize ); 499 m_cSPS->setQuadtreeTUMaxDepthInter( m_uiQuadtreeTUMaxDepthInter ); 500 m_cSPS->setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra ); 500 501 501 m_cSPS .setTMVPFlagsPresent(false);502 m_cSPS .setUseLossless ( m_useLossless );502 m_cSPS->setTMVPFlagsPresent(false); 503 m_cSPS->setUseLossless ( m_useLossless ); 503 504 504 m_cSPS .setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize );505 m_cSPS->setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); 505 506 506 507 Int i; 507 508 508 509 for (i = 0; i < g_uiMaxCUDepth-g_uiAddCUDepth; i++ ) 509 510 { 510 m_cSPS .setAMPAcc( i, m_useAMP );511 //m_cSPS .setAMPAcc( i, 1 );511 m_cSPS->setAMPAcc( i, m_useAMP ); 512 //m_cSPS->setAMPAcc( i, 1 ); 512 513 } 513 514 514 m_cSPS .setUseAMP ( m_useAMP );515 m_cSPS->setUseAMP ( m_useAMP ); 515 516 516 517 for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ ) 517 518 { 518 m_cSPS .setAMPAcc(i, 0);519 m_cSPS->setAMPAcc(i, 0); 519 520 } 520 521 521 m_cSPS .setBitDepthY( g_bitDepthY );522 m_cSPS .setBitDepthC( g_bitDepthC );522 m_cSPS->setBitDepthY( g_bitDepthY ); 523 m_cSPS->setBitDepthC( g_bitDepthC ); 523 524 524 m_cSPS .setQpBDOffsetY ( 6*(g_bitDepthY - 8) );525 m_cSPS .setQpBDOffsetC ( 6*(g_bitDepthC - 8) );525 m_cSPS->setQpBDOffsetY ( 6*(g_bitDepthY - 8) ); 526 m_cSPS->setQpBDOffsetC ( 6*(g_bitDepthC - 8) ); 526 527 527 m_cSPS .setUseSAO( m_bUseSAO );528 m_cSPS->setUseSAO( m_bUseSAO ); 528 529 529 m_cSPS .setMaxTLayers( m_maxTempLayer );530 m_cSPS .setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false );531 for ( i = 0; i < m_cSPS .getMaxTLayers(); i++ )530 m_cSPS->setMaxTLayers( m_maxTempLayer ); 531 m_cSPS->setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false ); 532 for ( i = 0; i < m_cSPS->getMaxTLayers(); i++ ) 532 533 { 533 m_cSPS .setMaxDecPicBuffering(m_maxDecPicBuffering[i], i);534 m_cSPS .setNumReorderPics(m_numReorderPics[i], i);534 m_cSPS->setMaxDecPicBuffering(m_maxDecPicBuffering[i], i); 535 m_cSPS->setNumReorderPics(m_numReorderPics[i], i); 535 536 } 536 m_cSPS .setPCMBitDepthLuma (g_uiPCMBitDepthLuma);537 m_cSPS .setPCMBitDepthChroma (g_uiPCMBitDepthChroma);538 m_cSPS .setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag );537 m_cSPS->setPCMBitDepthLuma (g_uiPCMBitDepthLuma); 538 m_cSPS->setPCMBitDepthChroma (g_uiPCMBitDepthChroma); 539 m_cSPS->setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag ); 539 540 540 m_cSPS .setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 );541 m_cSPS->setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 ); 541 542 542 m_cSPS .setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );543 m_cSPS->setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 543 544 544 m_cSPS .setVuiParametersPresentFlag(getVuiParametersPresentFlag());545 if (m_cSPS .getVuiParametersPresentFlag())545 m_cSPS->setVuiParametersPresentFlag(getVuiParametersPresentFlag()); 546 if (m_cSPS->getVuiParametersPresentFlag()) 546 547 { 547 TComVUI* pcVUI = m_cSPS .getVuiParameters();548 TComVUI* pcVUI = m_cSPS->getVuiParameters(); 548 549 pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioIdc() != -1); 549 550 pcVUI->setAspectRatioIdc(getAspectRatioIdc()); 550 551 pcVUI->setSarWidth(getSarWidth()); … … 581 582 582 583 Void TEncTop::xInitPPS() 583 584 { 584 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 585 m_cPPS=std::tr1::shared_ptr<TComPPS>(new TComPPS()); 586 m_cPPS->setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 585 587 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; 586 588 587 Int lowestQP = - m_cSPS .getQpBDOffsetY();589 Int lowestQP = - m_cSPS->getQpBDOffsetY(); 588 590 589 591 if(getUseLossless()) 590 592 { … … 610 612 611 613 if(bUseDQP) 612 614 { 613 m_cPPS .setUseDQP(true);614 m_cPPS .setMaxCuDQPDepth( m_iMaxCuDQPDepth );615 m_cPPS .setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );615 m_cPPS->setUseDQP(true); 616 m_cPPS->setMaxCuDQPDepth( m_iMaxCuDQPDepth ); 617 m_cPPS->setMinCuDQPSize( m_cPPS->getSPS()->getMaxCUWidth() >> ( m_cPPS->getMaxCuDQPDepth()) ); 616 618 } 617 619 else 618 620 { 619 m_cPPS .setUseDQP(false);620 m_cPPS .setMaxCuDQPDepth( 0 );621 m_cPPS .setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );621 m_cPPS->setUseDQP(false); 622 m_cPPS->setMaxCuDQPDepth( 0 ); 623 m_cPPS->setMinCuDQPSize( m_cPPS->getSPS()->getMaxCUWidth() >> ( m_cPPS->getMaxCuDQPDepth()) ); 622 624 } 623 625 624 626 #if RATE_CONTROL_LAMBDA_DOMAIN 625 627 if ( m_RCEnableRateControl ) 626 628 { 627 m_cPPS .setUseDQP(true);628 m_cPPS .setMaxCuDQPDepth( 0 );629 m_cPPS .setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );629 m_cPPS->setUseDQP(true); 630 m_cPPS->setMaxCuDQPDepth( 0 ); 631 m_cPPS->setMinCuDQPSize( m_cPPS->getSPS()->getMaxCUWidth() >> ( m_cPPS->getMaxCuDQPDepth()) ); 630 632 } 631 633 #endif 632 634 633 m_cPPS .setChromaCbQpOffset( m_chromaCbQpOffset );634 m_cPPS .setChromaCrQpOffset( m_chromaCrQpOffset );635 m_cPPS->setChromaCbQpOffset( m_chromaCbQpOffset ); 636 m_cPPS->setChromaCrQpOffset( m_chromaCrQpOffset ); 635 637 636 m_cPPS .setNumSubstreams(m_iWaveFrontSubstreams);637 m_cPPS .setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 );638 m_cPPS .setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) );639 m_cPPS .setUseWP( m_useWeightedPred );640 m_cPPS .setWPBiPred( m_useWeightedBiPred );641 m_cPPS .setOutputFlagPresentFlag( false );642 m_cPPS .setSignHideFlag(getSignHideFlag());638 m_cPPS->setNumSubstreams(m_iWaveFrontSubstreams); 639 m_cPPS->setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 ); 640 m_cPPS->setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) ); 641 m_cPPS->setUseWP( m_useWeightedPred ); 642 m_cPPS->setWPBiPred( m_useWeightedBiPred ); 643 m_cPPS->setOutputFlagPresentFlag( false ); 644 m_cPPS->setSignHideFlag(getSignHideFlag()); 643 645 if ( getDeblockingFilterMetric() ) 644 646 { 645 m_cPPS .setDeblockingFilterControlPresentFlag (true);646 m_cPPS .setDeblockingFilterOverrideEnabledFlag(true);647 m_cPPS .setPicDisableDeblockingFilterFlag(false);648 m_cPPS .setDeblockingFilterBetaOffsetDiv2(0);649 m_cPPS .setDeblockingFilterTcOffsetDiv2(0);647 m_cPPS->setDeblockingFilterControlPresentFlag (true); 648 m_cPPS->setDeblockingFilterOverrideEnabledFlag(true); 649 m_cPPS->setPicDisableDeblockingFilterFlag(false); 650 m_cPPS->setDeblockingFilterBetaOffsetDiv2(0); 651 m_cPPS->setDeblockingFilterTcOffsetDiv2(0); 650 652 } 651 653 else 652 654 { 653 m_cPPS .setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent );655 m_cPPS->setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent ); 654 656 } 655 m_cPPS .setLog2ParallelMergeLevelMinus2 (m_log2ParallelMergeLevelMinus2 );656 m_cPPS .setCabacInitPresentFlag(CABAC_INIT_PRESENT_FLAG);657 m_cPPS .setLoopFilterAcrossSlicesEnabledFlag( m_bLFCrossSliceBoundaryFlag );657 m_cPPS->setLog2ParallelMergeLevelMinus2 (m_log2ParallelMergeLevelMinus2 ); 658 m_cPPS->setCabacInitPresentFlag(CABAC_INIT_PRESENT_FLAG); 659 m_cPPS->setLoopFilterAcrossSlicesEnabledFlag( m_bLFCrossSliceBoundaryFlag ); 658 660 Int histogram[MAX_NUM_REF + 1]; 659 661 for( Int i = 0; i <= MAX_NUM_REF; i++ ) 660 662 { … … 676 678 } 677 679 } 678 680 assert(bestPos <= 15); 679 m_cPPS .setNumRefIdxL0DefaultActive(bestPos);680 m_cPPS .setNumRefIdxL1DefaultActive(bestPos);681 m_cPPS .setTransquantBypassEnableFlag(getTransquantBypassEnableFlag());682 m_cPPS .setUseTransformSkip( m_useTransformSkip );681 m_cPPS->setNumRefIdxL0DefaultActive(bestPos); 682 m_cPPS->setNumRefIdxL1DefaultActive(bestPos); 683 m_cPPS->setTransquantBypassEnableFlag(getTransquantBypassEnableFlag()); 684 m_cPPS->setUseTransformSkip( m_useTransformSkip ); 683 685 if (m_sliceSegmentMode) 684 686 { 685 m_cPPS .setDependentSliceSegmentsEnabledFlag( true );687 m_cPPS->setDependentSliceSegmentsEnabledFlag( true ); 686 688 } 687 if( m_cPPS .getDependentSliceSegmentsEnabledFlag() )689 if( m_cPPS->getDependentSliceSegmentsEnabledFlag() ) 688 690 { 689 Int NumCtx = m_cPPS .getEntropyCodingSyncEnabledFlag()?2:1;691 Int NumCtx = m_cPPS->getEntropyCodingSyncEnabledFlag()?2:1; 690 692 m_cSliceEncoder.initCtxMem( NumCtx ); 691 693 for ( UInt st = 0; st < NumCtx; st++ ) 692 694 { … … 703 705 { 704 706 TComReferencePictureSet* rps; 705 707 706 m_cSPS .createRPSList(getGOPSize()+m_extraRPSs);707 TComRPSList* rpsList = m_cSPS .getRPSList();708 m_cSPS->createRPSList(getGOPSize()+m_extraRPSs); 709 TComRPSList* rpsList = m_cSPS->getRPSList(); 708 710 709 711 for( Int i = 0; i < getGOPSize()+m_extraRPSs; i++) 710 712 { … … 940 942 941 943 Void TEncTop::xInitPPSforTiles() 942 944 { 943 m_cPPS .setUniformSpacingFlag( m_iUniformSpacingIdr );944 m_cPPS .setNumColumnsMinus1( m_iNumColumnsMinus1 );945 m_cPPS .setNumRowsMinus1( m_iNumRowsMinus1 );945 m_cPPS->setUniformSpacingFlag( m_iUniformSpacingIdr ); 946 m_cPPS->setNumColumnsMinus1( m_iNumColumnsMinus1 ); 947 m_cPPS->setNumRowsMinus1( m_iNumRowsMinus1 ); 946 948 if( m_iUniformSpacingIdr == 0 ) 947 949 { 948 m_cPPS .setColumnWidth( m_puiColumnWidth );949 m_cPPS .setRowHeight( m_puiRowHeight );950 m_cPPS->setColumnWidth( m_puiColumnWidth ); 951 m_cPPS->setRowHeight( m_puiRowHeight ); 950 952 } 951 m_cPPS .setLoopFilterAcrossTilesEnabledFlag( m_loopFilterAcrossTilesEnabledFlag );953 m_cPPS->setLoopFilterAcrossTilesEnabledFlag( m_loopFilterAcrossTilesEnabledFlag ); 952 954 953 955 // # substreams is "per tile" when tiles are independent. 954 956 if (m_iWaveFrontSynchro 955 957 ) 956 958 { 957 m_cPPS .setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));959 m_cPPS->setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1)); 958 960 } 959 961 } 960 962 -
source/Lib/TLibEncoder/TEncEntropy.h
67 67 virtual UInt getNumberOfWrittenBits() = 0; 68 68 virtual UInt getCoeffCost () = 0; 69 69 70 virtual Void codeVPS ( TComVPS*pcVPS ) = 0;71 virtual Void codeSPS ( TComSPS*pcSPS ) = 0;72 virtual Void codePPS ( TComPPS*pcPPS ) = 0;70 virtual Void codeVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ) = 0; 71 virtual Void codeSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ) = 0; 72 virtual Void codePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ) = 0; 73 73 virtual Void codeSliceHeader ( TComSlice* pcSlice ) = 0; 74 74 75 75 virtual Void codeTilesWPPEntryPoint ( TComSlice* pSlice ) = 0; … … 146 146 TEncEntropyIf* m_pcEntropyCoderIf; 147 147 148 148 public: 149 Void encodeVPS ( TComVPS*pcVPS);149 Void encodeVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS); 150 150 // SPS 151 Void encodeSPS ( TComSPS*pcSPS );152 Void encodePPS ( TComPPS*pcPPS );151 Void encodeSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ); 152 Void encodePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ); 153 153 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 154 154 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 155 155 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); -
source/Lib/TLibEncoder/TEncSbac.h
89 89 UInt getNumberOfWrittenBits () { return m_pcBinIf->getNumWrittenBits(); } 90 90 //--SBAC RD 91 91 92 Void codeVPS ( TComVPS*pcVPS );93 Void codeSPS ( TComSPS*pcSPS );94 Void codePPS ( TComPPS*pcPPS );92 Void codeVPS ( const std::tr1::shared_ptr<TComVPS> &pcVPS ); 93 Void codeSPS ( const std::tr1::shared_ptr<TComSPS> &pcSPS ); 94 Void codePPS ( const std::tr1::shared_ptr<TComPPS> &pcPPS ); 95 95 Void codeSliceHeader ( TComSlice* pcSlice ); 96 96 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 97 97 Void codeTerminatingBit ( UInt uilsLast ); -
source/Lib/TLibEncoder/SEIwrite.cpp
99 99 } 100 100 #endif 101 101 102 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)102 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const std::tr1::shared_ptr<TComSPS> &sps) 103 103 { 104 104 switch (sei.payloadType()) 105 105 { … … 154 154 * marshal a single SEI message sei, storing the marshalled representation 155 155 * in bitstream bs. 156 156 */ 157 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps)157 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const std::tr1::shared_ptr<TComSPS> &sps) 158 158 { 159 159 /* calculate how large the payload data is */ 160 160 /* TODO: this would be far nicer if it used vectored buffers */ … … 281 281 } 282 282 } 283 283 284 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)284 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const std::tr1::shared_ptr<TComSPS> &sps) 285 285 { 286 286 TComVUI *vui = sps->getVuiParameters(); 287 287 WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx"); … … 297 297 xWriteByteAlign(); 298 298 } 299 299 300 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps)300 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const std::tr1::shared_ptr<TComSPS> &sps) 301 301 { 302 302 Int i, nalOrVcl; 303 303 TComVUI *vui = sps->getVuiParameters(); … … 334 334 } 335 335 xWriteByteAlign(); 336 336 } 337 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps)337 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const std::tr1::shared_ptr<TComSPS> &sps) 338 338 { 339 339 Int i; 340 340 TComVUI *vui = sps->getVuiParameters(); … … 536 536 xWriteByteAlign(); 537 537 } 538 538 539 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)539 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const std::tr1::shared_ptr<TComSPS> &sps) 540 540 { 541 541 WRITE_FLAG( sei.m_bitStreamSubsetFlag, "bitstream_subset_flag" ); 542 542 WRITE_FLAG( sei.m_nestingOpFlag, "nesting_op_flag " );