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() ...@@ -70,22 +70,6 @@ EncApp::~EncApp()
void EncApp::xInitLibCfg() 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 vps;
vps.setMaxLayers ( 1 ); vps.setMaxLayers ( 1 );
...@@ -95,7 +79,6 @@ void EncApp::xInitLibCfg() ...@@ -95,7 +79,6 @@ void EncApp::xInitLibCfg()
} }
vps.setVPSExtensionFlag ( false ); vps.setVPSExtensionFlag ( false );
m_cEncLib.setVPS(&vps); m_cEncLib.setVPS(&vps);
#endif
m_cEncLib.setProfile ( m_profile); m_cEncLib.setProfile ( m_profile);
m_cEncLib.setLevel ( m_levelTier, m_level); m_cEncLib.setLevel ( m_levelTier, m_level);
m_cEncLib.setSubProfile ( m_subProfile ); m_cEncLib.setSubProfile ( m_subProfile );
......
...@@ -357,11 +357,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int ...@@ -357,11 +357,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
idr_found = true; 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)) 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)) || (nalu_type == NAL_UNIT_SUFFIX_SEI && skip_next_sei))
{ {
} }
......
...@@ -768,11 +768,7 @@ void CodingStructure::initSubStructure( CodingStructure& subStruct, const Channe ...@@ -768,11 +768,7 @@ void CodingStructure::initSubStructure( CodingStructure& subStruct, const Channe
subStruct.picture = picture; subStruct.picture = picture;
subStruct.sps = sps; subStruct.sps = sps;
#if HEVC_VPS
subStruct.vps = vps;
#else
subStruct.vps = vps; subStruct.vps = vps;
#endif
subStruct.pps = pps; subStruct.pps = pps;
memcpy(subStruct.alfApss, alfApss, sizeof(alfApss)); memcpy(subStruct.alfApss, alfApss, sizeof(alfApss));
......
...@@ -97,11 +97,7 @@ public: ...@@ -97,11 +97,7 @@ public:
const PPS *pps; const PPS *pps;
APS* alfApss[MAX_NUM_APS]; APS* alfApss[MAX_NUM_APS];
APS * lmcsAps; APS * lmcsAps;
#if HEVC_VPS
const VPS *vps; const VPS *vps;
#else
const VPS *vps;
#endif
const PreCalcValues* pcv; const PreCalcValues* pcv;
CodingStructure(CUCache&, PUCache&, TUCache&); CodingStructure(CUCache&, PUCache&, TUCache&);
......
...@@ -167,14 +167,8 @@ static const int MAX_NUM_PICS_IN_SOP = 1024; ...@@ -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_OPS = 1024;
static const int MAX_NESTING_NUM_LAYER = 64; 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_NUM_HRD_PARAMETERS = 1;
static const int MAX_VPS_LAYERS = 256; static const int MAX_VPS_LAYERS = 256;
#endif
static const int MAXIMUM_INTRA_FILTERED_WIDTH = 16; static const int MAXIMUM_INTRA_FILTERED_WIDTH = 16;
static const int MAXIMUM_INTRA_FILTERED_HEIGHT = 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 ...@@ -920,9 +920,6 @@ void Picture::finalInit(const SPS& sps, const PPS& pps, APS** alfApss, APS& lmcs
memcpy(cs->alfApss, alfApss, sizeof(cs->alfApss)); memcpy(cs->alfApss, alfApss, sizeof(cs->alfApss));
cs->lmcsAps = &lmcsAps; cs->lmcsAps = &lmcsAps;
#if HEVC_VPS
cs->vps = nullptr;
#endif
cs->pcv = pps.pcv; cs->pcv = pps.pcv;
brickMap = new BrickMap; brickMap = new BrickMap;
......
...@@ -139,20 +139,12 @@ public: ...@@ -139,20 +139,12 @@ public:
PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
SEIActiveParameterSets() SEIActiveParameterSets()
#if HEVC_VPS
: activeVPSId (0)
, m_selfContainedCvsFlag (false)
#else
: m_selfContainedCvsFlag(false) : m_selfContainedCvsFlag(false)
#endif
, m_noParameterSetUpdateFlag (false) , m_noParameterSetUpdateFlag (false)
, numSpsIdsMinus1 (0) , numSpsIdsMinus1 (0)
{} {}
virtual ~SEIActiveParameterSets() {} virtual ~SEIActiveParameterSets() {}
#if HEVC_VPS
int activeVPSId;
#endif
bool m_selfContainedCvsFlag; bool m_selfContainedCvsFlag;
bool m_noParameterSetUpdateFlag; bool m_noParameterSetUpdateFlag;
int numSpsIdsMinus1; int numSpsIdsMinus1;
......
...@@ -70,9 +70,6 @@ Slice::Slice() ...@@ -70,9 +70,6 @@ Slice::Slice()
, m_biDirPred ( false ) , m_biDirPred ( false )
, m_iSliceQpDelta ( 0 ) , m_iSliceQpDelta ( 0 )
, m_iDepth ( 0 ) , m_iDepth ( 0 )
#if HEVC_VPS
, m_pcVPS ( NULL )
#endif
, m_dps ( nullptr ) , m_dps ( nullptr )
, m_pcSPS ( NULL ) , m_pcSPS ( NULL )
, m_pcPPS ( NULL ) , m_pcPPS ( NULL )
...@@ -1317,34 +1314,6 @@ unsigned Slice::getMinPictureDistance() const ...@@ -1317,34 +1314,6 @@ unsigned Slice::getMinPictureDistance() const
return (unsigned) minPicDist; 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) // Video parameter set (VPS)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
...@@ -1362,7 +1331,6 @@ VPS::VPS() ...@@ -1362,7 +1331,6 @@ VPS::VPS()
VPS::~VPS() VPS::~VPS()
{ {
} }
#endif
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Sequence parameter set (SPS) // Sequence parameter set (SPS)
...@@ -1395,9 +1363,6 @@ SPS::SPS() ...@@ -1395,9 +1363,6 @@ SPS::SPS()
#if INCLUDE_ISP_CFG_FLAG #if INCLUDE_ISP_CFG_FLAG
, m_ISP ( false ) , m_ISP ( false )
#endif #endif
#if HEVC_VPS
, m_VPSId ( 0)
#endif
, m_chromaFormatIdc (CHROMA_420) , m_chromaFormatIdc (CHROMA_420)
, m_uiMaxTLayers ( 1) , m_uiMaxTLayers ( 1)
// Structure // Structure
...@@ -1980,18 +1945,10 @@ void ScalingList::checkDcOfMatrix() ...@@ -1980,18 +1945,10 @@ void ScalingList::checkDcOfMatrix()
} }
ParameterSetManager::ParameterSetManager() ParameterSetManager::ParameterSetManager()
#if HEVC_VPS
: m_vpsMap(MAX_NUM_VPS)
, m_spsMap(MAX_NUM_SPS)
#else
: m_spsMap(MAX_NUM_SPS) : m_spsMap(MAX_NUM_SPS)
#endif
, m_ppsMap(MAX_NUM_PPS) , m_ppsMap(MAX_NUM_PPS)
, m_apsMap(MAX_NUM_APS * MAX_NUM_APS_TYPE) , m_apsMap(MAX_NUM_APS * MAX_NUM_APS_TYPE)
, m_dpsMap(MAX_NUM_DPS) , m_dpsMap(MAX_NUM_DPS)
#if HEVC_VPS
, m_activeVPSId(-1)
#endif
, m_activeDPSId(-1) , m_activeDPSId(-1)
, m_activeSPSId(-1) , m_activeSPSId(-1)
{ {
...@@ -2029,11 +1986,7 @@ ParameterSetManager::~ParameterSetManager() ...@@ -2029,11 +1986,7 @@ ParameterSetManager::~ParameterSetManager()
// return false; // 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 //! activate a PPS and depending on isIDR parameter also SPS
#endif
//! \returns true, if activation is successful //! \returns true, if activation is successful
bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP) bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
{ {
...@@ -2078,37 +2031,12 @@ 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.clear();
m_spsMap.setActive(spsId); 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_activeSPSId = spsId;
m_ppsMap.clear(); m_ppsMap.clear();
m_ppsMap.setActive(ppsId); m_ppsMap.setActive(ppsId);
return true; return true;
#endif
} }
else else
{ {
...@@ -2123,9 +2051,6 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP) ...@@ -2123,9 +2051,6 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
// Failed to activate if reach here. // Failed to activate if reach here.
m_activeSPSId=-1; m_activeSPSId=-1;
#if HEVC_VPS
m_activeVPSId=-1;
#endif
m_activeDPSId=-1; m_activeDPSId=-1;
return false; return false;
} }
......
This diff is collapsed.
...@@ -103,9 +103,6 @@ typedef std::pair<int, int> TrCost; ...@@ -103,9 +103,6 @@ typedef std::pair<int, int> TrCost;
#endif #endif
// clang-format on // clang-format on
#ifndef HEVC_TOOLS
#define HEVC_TOOLS 0
#endif
#ifndef JVET_J0090_MEMORY_BANDWITH_MEASURE #ifndef JVET_J0090_MEMORY_BANDWITH_MEASURE
#define JVET_J0090_MEMORY_BANDWITH_MEASURE 0 #define JVET_J0090_MEMORY_BANDWITH_MEASURE 0
...@@ -156,10 +153,6 @@ typedef std::pair<int, int> TrCost; ...@@ -156,10 +153,6 @@ typedef std::pair<int, int> TrCost;
#define WCG_EXT 1 #define WCG_EXT 1
#define WCG_WPSNR WCG_EXT #define WCG_WPSNR WCG_EXT
#if HEVC_TOOLS
#define HEVC_VPS 1
#else
#endif
#define KEEP_PRED_AND_RESI_SIGNALS 0 #define KEEP_PRED_AND_RESI_SIGNALS 0
......
...@@ -835,9 +835,6 @@ void DecLib::xActivateParameterSets() ...@@ -835,9 +835,6 @@ void DecLib::xActivateParameterSets()
memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss)); memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
m_pcPic->cs->lmcsAps = lmcsAPS; m_pcPic->cs->lmcsAps = lmcsAPS;
#if HEVC_VPS
m_pcPic->cs->vps = pSlice->getVPS();
#endif
m_pcPic->cs->pcv = pps->pcv; m_pcPic->cs->pcv = pps->pcv;
// Initialise the various objects for the new set of settings // Initialise the various objects for the new set of settings
...@@ -916,9 +913,6 @@ void DecLib::xActivateParameterSets() ...@@ -916,9 +913,6 @@ void DecLib::xActivateParameterSets()
memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss)); memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
m_pcPic->cs->lmcsAps = lmcsAPS; m_pcPic->cs->lmcsAps = lmcsAPS;
#if HEVC_VPS
m_pcPic->cs->vps = pSlice->getVPS();
#endif
m_pcPic->cs->pcv = pps->pcv; m_pcPic->cs->pcv = pps->pcv;
// check that the current active PPS has not changed... // check that the current active PPS has not changed...
......
...@@ -89,9 +89,6 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb ...@@ -89,9 +89,6 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
cs.lmcsAps = slice->getLmcsAPS(); cs.lmcsAps = slice->getLmcsAPS();
#if HEVC_VPS
cs.vps = slice->getVPS();
#endif
cs.pcv = slice->getPPS()->pcv; cs.pcv = slice->getPPS()->pcv;
cs.chromaQpAdj = 0; cs.chromaQpAdj = 0;
......
...@@ -453,9 +453,6 @@ void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, uint32 ...@@ -453,9 +453,6 @@ void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, uint32
uint32_t val; uint32_t val;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 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, "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_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; sei_read_uvlc( pDecodedMessageOutputStream, val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
......
...@@ -1008,9 +1008,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1008,9 +1008,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
xTraceSPSHeader (); xTraceSPSHeader ();
#endif #endif
READ_CODE( 4, uiCode, "sps_decoding_parameter_set_id"); pcSPS->setDecodingParameterSetId( uiCode ); 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); READ_CODE(3, uiCode, "sps_max_sub_layers_minus1"); pcSPS->setMaxTLayers (uiCode + 1);
CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled"); CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled");
READ_CODE(5, uiCode, "sps_reserved_zero_5bits"); READ_CODE(5, uiCode, "sps_reserved_zero_5bits");
...@@ -1413,102 +1410,6 @@ void HLSyntaxReader::parseDPS(DPS* dps) ...@@ -1413,102 +1410,6 @@ void HLSyntaxReader::parseDPS(DPS* dps)
xReadRbspTrailingBits(); 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) void HLSyntaxReader::parseVPS(VPS* pcVPS)
{ {
#if ENABLE_TRACING #if ENABLE_TRACING
...@@ -1535,7 +1436,6 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) ...@@ -1535,7 +1436,6 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS)
xReadRbspTrailingBits(); xReadRbspTrailingBits();
} }
#endif
void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *parameterSetManager, const int prevTid0POC) 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 ...@@ -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 */ uint32_t size = 0; /* size of annexB unit in bytes */
static const uint8_t start_code_prefix[] = {0,0,0,1}; 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) 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 /* From AVC, When any of the following conditions are fulfilled, the
* zero_byte syntax element shall be present: * zero_byte syntax element shall be present:
......
...@@ -482,11 +482,7 @@ void EncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const SPS ...@@ -482,11 +482,7 @@ void EncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const SPS
if(m_pcCfg->getActiveParameterSetsSEIEnabled()) if(m_pcCfg->getActiveParameterSetsSEIEnabled())
{ {
SEIActiveParameterSets *sei = new SEIActiveParameterSets; SEIActiveParameterSets *sei = new SEIActiveParameterSets;
#if HEVC_VPS
m_seiEncoder.initSEIActiveParameterSets (sei, m_pcCfg->getVPS(), sps);
#else
m_seiEncoder.initSEIActiveParameterSets(sei, sps); m_seiEncoder.initSEIActiveParameterSets(sei, sps);
#endif
seiMessages.push_back(sei); seiMessages.push_back(sei);
} }
...@@ -3240,11 +3236,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni ...@@ -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 ) if( ( *it )->m_nalUnitType != NAL_UNIT_PREFIX_SEI && ( *it )->m_nalUnitType != NAL_UNIT_SUFFIX_SEI )
{ {
numRBSPBytes += numRBSPBytes_nal; 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) 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; numRBSPBytes += 4;
} }
......
...@@ -230,11 +230,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) ...@@ -230,11 +230,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
// initialize SPS // initialize SPS
xInitSPS(sps0); xInitSPS(sps0);
#if HEVC_VPS
xInitVPS(m_cVPS, sps0);
#else
xInitVPS(m_cVPS); xInitVPS(m_cVPS);
#endif
int dpsId = getDecodingParameterSetEnabled() ? 1 : 0; int dpsId = getDecodingParameterSetEnabled() ? 1 : 0;
xInitDPS(m_dps, sps0, dpsId); xInitDPS(m_dps, sps0, dpsId);
...@@ -817,25 +813,6 @@ void EncLib::xGetNewPicBuffer ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Pict ...@@ -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) void EncLib::xInitVPS(VPS &vps)
{ {
// The SPS must have already been set up. // The SPS must have already been set up.
...@@ -846,7 +823,6 @@ void EncLib::xInitVPS(VPS &vps) ...@@ -846,7 +823,6 @@ void EncLib::xInitVPS(VPS &vps)
vps.setVPSIncludedLayerId(0, i); vps.setVPSIncludedLayerId(0, i);
} }
} }
#endif
void EncLib::xInitDPS(DPS &dps, const SPS &sps, const int dpsId) void EncLib::xInitDPS(DPS &dps, const SPS &sps, const int dpsId)
{ {
......
...@@ -152,11 +152,7 @@ public: ...@@ -152,11 +152,7 @@ public:
protected: protected:
void xGetNewPicBuffer ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Picture*& rpcPic, int ppsId ); ///< get picture buffer which will be processed. If ppsId<0, then the ppsMap will be queried for the first match. void xGetNewPicBuffer ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Picture*& rpcPic, int ppsId ); ///< get picture buffer which will be processed. If ppsId<0, then the ppsMap will be queried for the first match.
#if HEVC_VPS
void xInitVPS (VPS &vps, const SPS &sps); ///< initialize VPS from encoder options
#else
void xInitVPS (VPS &vps); ///< initialize VPS from encoder options void xInitVPS (VPS &vps); ///< initialize VPS from encoder options
#endif
void xInitDPS (DPS &dps, const SPS &sps, const int dpsId); ///< initialize DPS from encoder options void xInitDPS (DPS &dps, const SPS &sps, const int dpsId); ///< initialize DPS from encoder options
void xInitSPS (SPS &sps); ///< initialize SPS from encoder options void xInitSPS (SPS &sps); ///< initialize SPS from encoder options
void xInitPPS (PPS &pps, const SPS &sps); ///< initialize PPS from encoder options void xInitPPS (PPS &pps, const SPS &sps); ///< initialize PPS from encoder options
......