Commit d8f74a46 authored by Frank Bossen's avatar Frank Bossen

Merge branch 'hevc_macro' into 'master'

Remove HEVC_VPS and HEVC_TOOLS macros

See merge request jvet/VVCSoftware_VTM!666
parents d293d979 5cbf1721
Pipeline #1869 pending with stage
......@@ -70,22 +70,6 @@ EncApp::~EncApp()
void EncApp::xInitLibCfg()
{
#if HEVC_VPS
VPS vps;
vps.setMaxTLayers ( m_maxTempLayer );
if (m_maxTempLayer == 1)
{
vps.setTemporalNestingFlag(true);
}
vps.setMaxLayers ( 1 );
for(int i = 0; i < MAX_TLAYER; i++)
{
vps.setNumReorderPics ( m_numReorderPics[i], i );
vps.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i );
}
m_cEncLib.setVPS(&vps);
#else
VPS vps;
vps.setMaxLayers ( 1 );
......@@ -95,7 +79,6 @@ void EncApp::xInitLibCfg()
}
vps.setVPSExtensionFlag ( false );
m_cEncLib.setVPS(&vps);
#endif
m_cEncLib.setProfile ( m_profile);
m_cEncLib.setLevel ( m_levelTier, m_level);
m_cEncLib.setSubProfile ( m_subProfile );
......
......@@ -357,11 +357,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
idr_found = true;
}
#if HEVC_VPS
if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP )) || ((idx>1 && !idr_found) && ( nalu_type == NAL_UNIT_DPS || nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS))
#else
if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_DPS || nalu_type == NAL_UNIT_VPS ||nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
#endif
|| (nalu_type == NAL_UNIT_SUFFIX_SEI && skip_next_sei))
{
}
......
......@@ -768,11 +768,7 @@ void CodingStructure::initSubStructure( CodingStructure& subStruct, const Channe
subStruct.picture = picture;
subStruct.sps = sps;
#if HEVC_VPS
subStruct.vps = vps;
#else
subStruct.vps = vps;
#endif
subStruct.pps = pps;
memcpy(subStruct.alfApss, alfApss, sizeof(alfApss));
......
......@@ -97,11 +97,7 @@ public:
const PPS *pps;
APS* alfApss[MAX_NUM_APS];
APS * lmcsAps;
#if HEVC_VPS
const VPS *vps;
#else
const VPS *vps;
#endif
const PreCalcValues* pcv;
CodingStructure(CUCache&, PUCache&, TUCache&);
......
......@@ -167,14 +167,8 @@ static const int MAX_NUM_PICS_IN_SOP = 1024;
static const int MAX_NESTING_NUM_OPS = 1024;
static const int MAX_NESTING_NUM_LAYER = 64;
#if HEVC_VPS
static const int MAX_VPS_NUM_HRD_PARAMETERS = 1;
static const int MAX_VPS_OP_SETS_PLUS1 = 1024;
static const int MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 = 1;
#else
static const int MAX_VPS_NUM_HRD_PARAMETERS = 1;
static const int MAX_VPS_LAYERS = 256;
#endif
static const int MAXIMUM_INTRA_FILTERED_WIDTH = 16;
static const int MAXIMUM_INTRA_FILTERED_HEIGHT = 16;
......
......@@ -920,9 +920,6 @@ void Picture::finalInit(const SPS& sps, const PPS& pps, APS** alfApss, APS& lmcs
memcpy(cs->alfApss, alfApss, sizeof(cs->alfApss));
cs->lmcsAps = &lmcsAps;
#if HEVC_VPS
cs->vps = nullptr;
#endif
cs->pcv = pps.pcv;
brickMap = new BrickMap;
......
......@@ -139,20 +139,12 @@ public:
PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
SEIActiveParameterSets()
#if HEVC_VPS
: activeVPSId (0)
, m_selfContainedCvsFlag (false)
#else
: m_selfContainedCvsFlag(false)
#endif
, m_noParameterSetUpdateFlag (false)
, numSpsIdsMinus1 (0)
{}
virtual ~SEIActiveParameterSets() {}
#if HEVC_VPS
int activeVPSId;
#endif
bool m_selfContainedCvsFlag;
bool m_noParameterSetUpdateFlag;
int numSpsIdsMinus1;
......
......@@ -70,9 +70,6 @@ Slice::Slice()
, m_biDirPred ( false )
, m_iSliceQpDelta ( 0 )
, m_iDepth ( 0 )
#if HEVC_VPS
, m_pcVPS ( NULL )
#endif
, m_dps ( nullptr )
, m_pcSPS ( NULL )
, m_pcPPS ( NULL )
......@@ -1317,34 +1314,6 @@ unsigned Slice::getMinPictureDistance() const
return (unsigned) minPicDist;
}
#if HEVC_VPS
// ------------------------------------------------------------------------------------------------
// Video parameter set (VPS)
// ------------------------------------------------------------------------------------------------
VPS::VPS()
: m_VPSId ( 0)
, m_uiMaxTLayers ( 1)
, m_uiMaxLayers ( 1)
, m_bTemporalIdNestingFlag (false)
, m_numHrdParameters ( 0)
, m_maxNuhReservedZeroLayerId ( 0)
, m_hrdParameters ()
, m_hrdOpSetIdx ()
, m_cprmsPresentFlag ()
{
for( int i = 0; i < MAX_TLAYER; i++)
{
m_numReorderPics[i] = 0;
m_uiMaxDecPicBuffering[i] = 1;
m_uiMaxLatencyIncrease[i] = 0;
}
}
VPS::~VPS()
{
}
#else
// ------------------------------------------------------------------------------------------------
// Video parameter set (VPS)
// ------------------------------------------------------------------------------------------------
......@@ -1362,7 +1331,6 @@ VPS::VPS()
VPS::~VPS()
{
}
#endif
// ------------------------------------------------------------------------------------------------
// Sequence parameter set (SPS)
......@@ -1395,9 +1363,6 @@ SPS::SPS()
#if INCLUDE_ISP_CFG_FLAG
, m_ISP ( false )
#endif
#if HEVC_VPS
, m_VPSId ( 0)
#endif
, m_chromaFormatIdc (CHROMA_420)
, m_uiMaxTLayers ( 1)
// Structure
......@@ -1980,18 +1945,10 @@ void ScalingList::checkDcOfMatrix()
}
ParameterSetManager::ParameterSetManager()
#if HEVC_VPS
: m_vpsMap(MAX_NUM_VPS)
, m_spsMap(MAX_NUM_SPS)
#else
: m_spsMap(MAX_NUM_SPS)
#endif
, m_ppsMap(MAX_NUM_PPS)
, m_apsMap(MAX_NUM_APS * MAX_NUM_APS_TYPE)
, m_dpsMap(MAX_NUM_DPS)
#if HEVC_VPS
, m_activeVPSId(-1)
#endif
, m_activeDPSId(-1)
, m_activeSPSId(-1)
{
......@@ -2029,11 +1986,7 @@ ParameterSetManager::~ParameterSetManager()
// return false;
//}
#if HEVC_VPS
//! activate a PPS and depending on isIDR parameter also SPS and VPS
#else
//! activate a PPS and depending on isIDR parameter also SPS
#endif
//! \returns true, if activation is successful
bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
{
......@@ -2078,37 +2031,12 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
}
}
#if HEVC_VPS
int vpsId = sps->getVPSId();
if (!isIRAP && (vpsId != m_activeVPSId ))
{
msg( WARNING, "Warning: tried to activate PPS referring to a inactive VPS at non-IDR.");
}
else
{
#endif
m_spsMap.clear();
m_spsMap.setActive(spsId);
#if HEVC_VPS
VPS *vps =m_vpsMap.getPS(vpsId);
if (vps)
{
m_activeVPSId = vpsId;
m_activeSPSId = spsId;
m_ppsMap.setActive(ppsId);
return true;
}
else
{
msg( WARNING, "Warning: tried to activate PPS that refers to a non-existing VPS.");
}
}
#else
m_activeSPSId = spsId;
m_ppsMap.clear();
m_ppsMap.setActive(ppsId);
return true;
#endif
}
else
{
......@@ -2123,9 +2051,6 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
// Failed to activate if reach here.
m_activeSPSId=-1;
#if HEVC_VPS
m_activeVPSId=-1;
#endif
m_activeDPSId=-1;
return false;
}
......
......@@ -431,87 +431,6 @@ public:
#if HEVC_VPS
class VPS
{
private:
int m_VPSId;
uint32_t m_uiMaxTLayers;
uint32_t m_uiMaxLayers;
bool m_bTemporalIdNestingFlag;
uint32_t m_numReorderPics[MAX_TLAYER];
uint32_t m_uiMaxDecPicBuffering[MAX_TLAYER];
uint32_t m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit)
uint32_t m_numHrdParameters;
uint32_t m_maxNuhReservedZeroLayerId;
std::vector<HRDParameters> m_hrdParameters;
std::vector<uint32_t> m_hrdOpSetIdx;
std::vector<bool> m_cprmsPresentFlag;
uint32_t m_numOpSets;
bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1];
PTL m_pcPTL;
TimingInfo m_timingInfo;
public:
VPS();
virtual ~VPS();
void createHrdParamBuffer()
{
m_hrdParameters .resize(getNumHrdParameters());
m_hrdOpSetIdx .resize(getNumHrdParameters());
m_cprmsPresentFlag.resize(getNumHrdParameters());
}
HRDParameters* getHrdParameters( uint32_t i ) { return &m_hrdParameters[ i ]; }
const HRDParameters* getHrdParameters( uint32_t i ) const { return &m_hrdParameters[ i ]; }
uint32_t getHrdOpSetIdx( uint32_t i ) const { return m_hrdOpSetIdx[ i ]; }
void setHrdOpSetIdx( uint32_t val, uint32_t i ) { m_hrdOpSetIdx[ i ] = val; }
bool getCprmsPresentFlag( uint32_t i ) const { return m_cprmsPresentFlag[ i ]; }
void setCprmsPresentFlag( bool val, uint32_t i ) { m_cprmsPresentFlag[ i ] = val; }
int getVPSId() const { return m_VPSId; }
void setVPSId(int i) { m_VPSId = i; }
uint32_t getMaxTLayers() const { return m_uiMaxTLayers; }
void setMaxTLayers(uint32_t t) { m_uiMaxTLayers = t; }
uint32_t getMaxLayers() const { return m_uiMaxLayers; }
void setMaxLayers(uint32_t l) { m_uiMaxLayers = l; }
bool getTemporalNestingFlag() const { return m_bTemporalIdNestingFlag; }
void setTemporalNestingFlag(bool t) { m_bTemporalIdNestingFlag = t; }
void setNumReorderPics(uint32_t v, uint32_t tLayer) { m_numReorderPics[tLayer] = v; }
uint32_t getNumReorderPics(uint32_t tLayer) const { return m_numReorderPics[tLayer]; }
void setMaxDecPicBuffering(uint32_t v, uint32_t tLayer) { CHECK(tLayer >= MAX_TLAYER, "Invalid T-layer"); m_uiMaxDecPicBuffering[tLayer] = v; }
uint32_t getMaxDecPicBuffering(uint32_t tLayer) const { return m_uiMaxDecPicBuffering[tLayer]; }
void setMaxLatencyIncrease(uint32_t v, uint32_t tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; }
uint32_t getMaxLatencyIncrease(uint32_t tLayer) const { return m_uiMaxLatencyIncrease[tLayer]; }
uint32_t getNumHrdParameters() const { return m_numHrdParameters; }
void setNumHrdParameters(uint32_t v) { m_numHrdParameters = v; }
uint32_t getMaxNuhReservedZeroLayerId() const { return m_maxNuhReservedZeroLayerId; }
void setMaxNuhReservedZeroLayerId(uint32_t v) { m_maxNuhReservedZeroLayerId = v; }
uint32_t getMaxOpSets() const { return m_numOpSets; }
void setMaxOpSets(uint32_t v) { m_numOpSets = v; }
bool getLayerIdIncludedFlag(uint32_t opsIdx, uint32_t id) const { return m_layerIdIncludedFlag[opsIdx][id]; }
void setLayerIdIncludedFlag(bool v, uint32_t opsIdx, uint32_t id) { m_layerIdIncludedFlag[opsIdx][id] = v; }
PTL* getPTL() { return &m_pcPTL; }
const PTL* getPTL() const { return &m_pcPTL; }
TimingInfo* getTimingInfo() { return &m_timingInfo; }
const TimingInfo* getTimingInfo() const { return &m_timingInfo; }
};
#else
class VPS
{
private:
......@@ -538,7 +457,6 @@ public:
void setVPSIncludedLayerId(uint32_t v, uint32_t Layer) { m_vpsIncludedLayerId[Layer] = v; }
uint32_t getVPSIncludedLayerId(uint32_t Layer) const { return m_vpsIncludedLayerId[Layer]; }
};
#endif
class Window
{
......@@ -745,9 +663,6 @@ private:
uint8_t m_MaxSbtSize;
#if INCLUDE_ISP_CFG_FLAG
bool m_ISP;
#endif
#if HEVC_VPS
int m_VPSId;
#endif
ChromaFormat m_chromaFormatIdc;
......@@ -863,10 +778,6 @@ public:
SPS();
virtual ~SPS();
#if HEVC_VPS
int getVPSId() const { return m_VPSId; }
void setVPSId(int i) { m_VPSId = i; }
#endif
int getSPSId() const { return m_SPSId; }
void setSPSId(int i) { m_SPSId = i; }
void setDecodingParameterSetId(int val) { m_decodingParameterSetId = val; }
......@@ -1508,9 +1419,6 @@ private:
// access channel
#if HEVC_VPS
const VPS* m_pcVPS;
#endif
const DPS* m_dps;
const SPS* m_pcSPS;
const PPS* m_pcPPS;
......@@ -1591,10 +1499,6 @@ public:
virtual ~Slice();
void initSlice();
int getRefIdx4MVPair( RefPicList eCurRefPicList, int nCurRefIdx );
#if HEVC_VPS
void setVPS( VPS* pcVPS ) { m_pcVPS = pcVPS; }
const VPS* getVPS() const { return m_pcVPS; }
#endif
void setDPS( DPS* dps ) { m_dps = dps; }
const DPS* getDPS() const { return m_dps; }
......@@ -2027,15 +1931,6 @@ public:
ParameterSetManager();
virtual ~ParameterSetManager();
#if HEVC_VPS
//! store sequence parameter set and take ownership of it
void storeVPS(VPS *vps, const std::vector<uint8_t> &naluData) { m_vpsMap.storePS( vps->getVPSId(), vps, &naluData); };
//! get pointer to existing video parameter set
VPS* getVPS(int vpsId) { return m_vpsMap.getPS(vpsId); };
bool getVPSChangedFlag(int vpsId) const { return m_vpsMap.getChangedFlag(vpsId); }
void clearVPSChangedFlag(int vpsId) { m_vpsMap.clearChangedFlag(vpsId); }
VPS* getFirstVPS() { return m_vpsMap.getFirstPS(); };
#endif
void storeDPS(DPS *dps, const std::vector<uint8_t> &naluData) { m_dpsMap.storePS( dps->getDecodingParameterSetId(), dps, &naluData); };
//! get pointer to existing video parameter set
......@@ -2063,11 +1958,7 @@ public:
//! \returns true, if activation is successful
// bool activateSPSWithSEI(int SPSId);
#if HEVC_VPS
//! activate a PPS and depending on isIDR parameter also SPS and VPS
#else
//! activate a PPS and depending on isIDR parameter also SPS
#endif
//! \returns true, if activation is successful
bool activatePPS(int ppsId, bool isIRAP);
APS** getAPSs() { return &m_apss[0]; }
......@@ -2078,16 +1969,10 @@ public:
void clearAPSChangedFlag(int apsId, int apsType) { m_apsMap.clearChangedFlag((apsId << NUM_APS_TYPE_LEN) + apsType); }
APS* getFirstAPS() { return m_apsMap.getFirstPS(); };
bool activateAPS(int apsId, int apsType);
#if HEVC_VPS
const VPS* getActiveVPS()const { return m_vpsMap.getPS(m_activeVPSId); };
#endif
const SPS* getActiveSPS()const { return m_spsMap.getPS(m_activeSPSId); };
const DPS* getActiveDPS()const { return m_dpsMap.getPS(m_activeDPSId); };
protected:
#if HEVC_VPS
ParameterSetMap<VPS> m_vpsMap;
#endif
ParameterSetMap<SPS> m_spsMap;
ParameterSetMap<PPS> m_ppsMap;
ParameterSetMap<APS> m_apsMap;
......@@ -2095,9 +1980,6 @@ protected:
APS* m_apss[MAX_NUM_APS];
#if HEVC_VPS
int m_activeVPSId; // -1 for nothing active
#endif
int m_activeDPSId; // -1 for nothing active
int m_activeSPSId; // -1 for nothing active
};
......
......@@ -103,9 +103,6 @@ typedef std::pair<int, int> TrCost;
#endif
// clang-format on
#ifndef HEVC_TOOLS
#define HEVC_TOOLS 0
#endif
#ifndef JVET_J0090_MEMORY_BANDWITH_MEASURE
#define JVET_J0090_MEMORY_BANDWITH_MEASURE 0
......@@ -156,10 +153,6 @@ typedef std::pair<int, int> TrCost;
#define WCG_EXT 1
#define WCG_WPSNR WCG_EXT
#if HEVC_TOOLS
#define HEVC_VPS 1
#else
#endif
#define KEEP_PRED_AND_RESI_SIGNALS 0
......
......@@ -835,9 +835,6 @@ void DecLib::xActivateParameterSets()
memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
m_pcPic->cs->lmcsAps = lmcsAPS;
#if HEVC_VPS
m_pcPic->cs->vps = pSlice->getVPS();
#endif
m_pcPic->cs->pcv = pps->pcv;
// Initialise the various objects for the new set of settings
......@@ -916,9 +913,6 @@ void DecLib::xActivateParameterSets()
memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
m_pcPic->cs->lmcsAps = lmcsAPS;
#if HEVC_VPS
m_pcPic->cs->vps = pSlice->getVPS();
#endif
m_pcPic->cs->pcv = pps->pcv;
// check that the current active PPS has not changed...
......
......@@ -89,9 +89,6 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
cs.lmcsAps = slice->getLmcsAPS();
#if HEVC_VPS
cs.vps = slice->getVPS();
#endif
cs.pcv = slice->getPPS()->pcv;
cs.chromaQpAdj = 0;
......
......@@ -453,9 +453,6 @@ void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, uint32
uint32_t val;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
#if HEVC_VPS
sei_read_code( pDecodedMessageOutputStream, 4, val, "active_video_parameter_set_id"); sei.activeVPSId = val;
#endif
sei_read_flag( pDecodedMessageOutputStream, val, "self_contained_cvs_flag"); sei.m_selfContainedCvsFlag = (val != 0);
sei_read_flag( pDecodedMessageOutputStream, val, "no_parameter_set_update_flag"); sei.m_noParameterSetUpdateFlag = (val != 0);
sei_read_uvlc( pDecodedMessageOutputStream, val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
......
......@@ -1008,9 +1008,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
xTraceSPSHeader ();
#endif
READ_CODE( 4, uiCode, "sps_decoding_parameter_set_id"); pcSPS->setDecodingParameterSetId( uiCode );
#if HEVC_VPS
READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode );
#endif
READ_CODE(3, uiCode, "sps_max_sub_layers_minus1"); pcSPS->setMaxTLayers (uiCode + 1);
CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled");
READ_CODE(5, uiCode, "sps_reserved_zero_5bits");
......@@ -1413,102 +1410,6 @@ void HLSyntaxReader::parseDPS(DPS* dps)
xReadRbspTrailingBits();
}
#if HEVC_VPS
void HLSyntaxReader::parseVPS(VPS* pcVPS)
{
#if ENABLE_TRACING
xTraceVPSHeader ();
#endif
uint32_t uiCode;
READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode );
READ_FLAG( uiCode, "vps_base_layer_internal_flag" ); CHECK(uiCode != 1, "Invalid code");
READ_FLAG( uiCode, "vps_base_layer_available_flag" ); CHECK(uiCode != 1, "Invalid code");
READ_CODE( 6, uiCode, "vps_max_layers_minus1" );
READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); CHECK(uiCode+1 > MAX_TLAYER, "Invalid code");
READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false );
CHECK (pcVPS->getMaxTLayers()<=1&&!pcVPS->getTemporalNestingFlag(), "Invalid VPS state");
READ_CODE( 16, uiCode, "vps_reserved_0xffff_16bits" ); CHECK(uiCode != 0xffff, "Invalid value for reserved bits");
parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
uint32_t subLayerOrderingInfoPresentFlag;
READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag");
for(uint32_t i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
{
READ_UVLC( uiCode, "vps_max_dec_pic_buffering_minus1[i]" ); pcVPS->setMaxDecPicBuffering( uiCode + 1, i );
READ_UVLC( uiCode, "vps_max_num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i );
READ_UVLC( uiCode, "vps_max_latency_increase_plus1[i]" ); pcVPS->setMaxLatencyIncrease( uiCode, i );
if (!subLayerOrderingInfoPresentFlag)
{
for (i++; i <= pcVPS->getMaxTLayers()-1; i++)
{
pcVPS->setMaxDecPicBuffering(pcVPS->getMaxDecPicBuffering(0), i);
pcVPS->setNumReorderPics(pcVPS->getNumReorderPics(0), i);
pcVPS->setMaxLatencyIncrease(pcVPS->getMaxLatencyIncrease(0), i);
}
break;
}
}
CHECK( pcVPS->getNumHrdParameters() >= MAX_VPS_OP_SETS_PLUS1, "Too many HDR parameters" );
CHECK( pcVPS->getMaxNuhReservedZeroLayerId() >= MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1, "Reserved zero layer id too big" );
READ_CODE( 6, uiCode, "vps_max_layer_id" ); pcVPS->setMaxNuhReservedZeroLayerId( uiCode );
READ_UVLC( uiCode, "vps_num_layer_sets_minus1" ); pcVPS->setMaxOpSets( uiCode + 1 );
for( uint32_t opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ )
{
// Operation point set
for( uint32_t i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
{
READ_FLAG( uiCode, "layer_id_included_flag[opsIdx][i]" ); pcVPS->setLayerIdIncludedFlag( uiCode == 1 ? true : false, opsIdx, i );
}
}
TimingInfo *timingInfo = pcVPS->getTimingInfo();
READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false);
if(timingInfo->getTimingInfoPresentFlag())
{
READ_CODE( 32, uiCode, "vps_num_units_in_tick"); timingInfo->setNumUnitsInTick (uiCode);
READ_CODE( 32, uiCode, "vps_time_scale"); timingInfo->setTimeScale (uiCode);
READ_FLAG( uiCode, "vps_poc_proportional_to_timing_flag"); timingInfo->setPocProportionalToTimingFlag(uiCode ? true : false);
if(timingInfo->getPocProportionalToTimingFlag())
{
READ_UVLC( uiCode, "vps_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode);
}
READ_UVLC( uiCode, "vps_num_hrd_parameters" ); pcVPS->setNumHrdParameters( uiCode );
if( pcVPS->getNumHrdParameters() > 0 )
{
pcVPS->createHrdParamBuffer();
}
for( uint32_t i = 0; i < pcVPS->getNumHrdParameters(); i ++ )
{
READ_UVLC( uiCode, "hrd_layer_set_idx[i]" ); pcVPS->setHrdOpSetIdx( uiCode, i );
if( i > 0 )
{
READ_FLAG( uiCode, "cprms_present_flag[i]" ); pcVPS->setCprmsPresentFlag( uiCode == 1 ? true : false, i );
}
else
{
pcVPS->setCprmsPresentFlag( true, i );
}
parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
}
}
READ_FLAG( uiCode, "vps_extension_flag" );
if (uiCode)
{
while ( xMoreRbspData() )
{
READ_FLAG( uiCode, "vps_extension_data_flag");
}
}
xReadRbspTrailingBits();
}
#else
void HLSyntaxReader::parseVPS(VPS* pcVPS)
{
#if ENABLE_TRACING
......@@ -1535,7 +1436,6 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS)
xReadRbspTrailingBits();
}
#endif
void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *parameterSetManager, const int prevTid0POC)
{
......
......@@ -59,11 +59,7 @@ static std::vector<uint32_t> writeAnnexB(std::ostream& out, const AccessUnit& au
uint32_t size = 0; /* size of annexB unit in bytes */
static const uint8_t start_code_prefix[] = {0,0,0,1};
#if HEVC_VPS
if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DPS || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
#else
if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
#endif
{
/* From AVC, When any of the following conditions are fulfilled, the
* zero_byte syntax element shall be present:
......
......@@ -482,11 +482,7 @@ void EncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const SPS
if(m_pcCfg->getActiveParameterSetsSEIEnabled())
{
SEIActiveParameterSets *sei = new SEIActiveParameterSets;
#if HEVC_VPS
m_seiEncoder.initSEIActiveParameterSets (sei, m_pcCfg->getVPS(), sps);
#else
m_seiEncoder.initSEIActiveParameterSets(sei, sps);
#endif
seiMessages.push_back(sei);
}
......@@ -3240,11 +3236,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
if( ( *it )->m_nalUnitType != NAL_UNIT_PREFIX_SEI && ( *it )->m_nalUnitType != NAL_UNIT_SUFFIX_SEI )
{
numRBSPBytes += numRBSPBytes_nal;
#if HEVC_VPS
if( it == accessUnit.begin() || ( *it )->m_nalUnitType == NAL_UNIT_VPS || ( *it )->m_nalUnitType == NAL_UNIT_DPS || ( *it )->m_nalUnitType == NAL_UNIT_SPS || ( *it )->m_nalUnitType == NAL_UNIT_PPS )
#else
if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_VPS || (*it)->m_nalUnitType == NAL_UNIT_DPS || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS)
#endif
{
numRBSPBytes += 4;
}
......
......@@ -230,11 +230,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
// initialize SPS
xInitSPS(sps0);
#if HEVC_VPS
xInitVPS(m_cVPS, sps0);
#else
xInitVPS(m_cVPS);
#endif
int dpsId = getDecodingParameterSetEnabled() ? 1 : 0;
xInitDPS(m_dps, sps0, dpsId);
......@@ -817,25 +813,6 @@ void EncLib::xGetNewPicBuffer ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Pict
}
#if HEVC_VPS
void EncLib::xInitVPS(VPS &vps, const SPS &sps)
{
// The SPS must have already been set up.
// set the VPS profile information.
*vps.getPTL() = *sps.getPTL();
vps.setMaxOpSets(1);
vps.getTimingInfo()->setTimingInfoPresentFlag ( false );
vps.setNumHrdParameters( 0 );
vps.createHrdParamBuffer();
for( uint32_t i = 0; i < vps.getNumHrdParameters(); i ++ )
{
vps.setHrdOpSetIdx( 0, i );
vps.setCprmsPresentFlag( false, i );
// Set up HrdParameters here.
}
}
#else
void EncLib::xInitVPS(VPS &vps)
{
// The SPS must have already been set up.
......@@ -846,7 +823,6 @@ void EncLib::xInitVPS(VPS &vps)
vps.setVPSIncludedLayerId(0, i);
}
}
#endif
void EncLib::xInitDPS(DPS &dps, const SPS &sps, const int dpsId)
{
...