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;
}
......
This diff is collapsed.
......@@ -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)
{
......
......@@ -152,11 +152,7 @@ public:
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.
#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
#endif
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 xInitPPS (PPS &pps, const SPS &sps); ///< initialize PPS from encoder options
......
......@@ -44,22 +44,12 @@ std::string hashToString(const PictureHash &digest, int numChar);
//! \ingroup EncoderLib
//! \{
#if HEVC_VPS
void SEIEncoder::initSEIActiveParameterSets (SEIActiveParameterSets *seiActiveParameterSets, const VPS *vps, const SPS *sps)
#else
void SEIEncoder::initSEIActiveParameterSets (SEIActiveParameterSets *seiActiveParameterSets, const SPS *sps)
#endif
{
CHECK(!(m_isInitialized), "Unspecified error");
CHECK(!(seiActiveParameterSets!=NULL), "Unspecified error");
#if HEVC_VPS
CHECK(!(vps!=NULL), "Unspecified error");
#endif
CHECK(!(sps!=NULL), "Unspecified error");
#if HEVC_VPS
seiActiveParameterSets->activeVPSId = vps->getVPSId();
#endif
seiActiveParameterSets->m_selfContainedCvsFlag = false;
seiActiveParameterSets->m_noParameterSetUpdateFlag = false;
seiActiveParameterSets->numSpsIdsMinus1 = 0;
......
......@@ -67,11 +67,7 @@ public:
};
// leading SEIs
#if HEVC_VPS
void initSEIActiveParameterSets (SEIActiveParameterSets *sei, const VPS *vps, const SPS *sps);
#else
void initSEIActiveParameterSets (SEIActiveParameterSets *sei, const SPS *sps);
#endif
void initSEIFramePacking(SEIFramePacking *sei, int currPicNum);
void initSEIDisplayOrientation(SEIDisplayOrientation *sei);
void initSEIToneMappingInfo(SEIToneMappingInfo *sei);
......
......@@ -229,9 +229,6 @@ void SEIWriter::xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei)
void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei)
{
#if HEVC_VPS
WRITE_CODE(sei.activeVPSId, 4, "active_video_parameter_set_id");
#endif
WRITE_FLAG(sei.m_selfContainedCvsFlag, "self_contained_cvs_flag");
WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag");
WRITE_UVLC(sei.numSpsIdsMinus1, "num_sps_ids_minus1");
......
......@@ -665,9 +665,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
xTraceSPSHeader ();
#endif
WRITE_CODE( pcSPS->getDecodingParameterSetId (), 4, "sps_decoding_parameter_set_id" );
#if HEVC_VPS
WRITE_CODE( pcSPS->getVPSId (), 4, "sps_video_parameter_set_id" );
#endif
CHECK(pcSPS->getMaxTLayers() == 0, "Maximum number of temporal sub-layers is '0'");
WRITE_CODE(pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1");
......@@ -990,81 +987,6 @@ void HLSWriter::codeDPS( const DPS* dps )
xWriteRbspTrailingBits();
}
#if HEVC_VPS
void HLSWriter::codeVPS( const VPS* pcVPS )
{
#if ENABLE_TRACING
xTraceVPSHeader();
#endif
WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" );
WRITE_FLAG( 1, "vps_base_layer_internal_flag" );
WRITE_FLAG( 1, "vps_base_layer_available_flag" );
WRITE_CODE( 0, 6, "vps_max_layers_minus1" );
WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "vps_max_sub_layers_minus1" );
WRITE_FLAG( pcVPS->getTemporalNestingFlag(), "vps_temporal_id_nesting_flag" );
CHECK(pcVPS->getMaxTLayers()<=1&&!pcVPS->getTemporalNestingFlag(), "Invalud parameters");
WRITE_CODE( 0xffff, 16, "vps_reserved_0xffff_16bits" );
codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 );
const bool subLayerOrderingInfoPresentFlag = 1;
WRITE_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag");
for(uint32_t i=0; i <= pcVPS->getMaxTLayers()-1; i++)
{
WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i) - 1, "vps_max_dec_pic_buffering_minus1[i]" );
WRITE_UVLC( pcVPS->getNumReorderPics(i), "vps_max_num_reorder_pics[i]" );
WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "vps_max_latency_increase_plus1[i]" );
if (!subLayerOrderingInfoPresentFlag)
{
break;
}
}
CHECK( pcVPS->getNumHrdParameters() > MAX_VPS_NUM_HRD_PARAMETERS, "Too many HRD parameters" );
CHECK( pcVPS->getMaxNuhReservedZeroLayerId() >= MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1, "Invalid parameters read" );
WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6, "vps_max_layer_id" );
WRITE_UVLC( pcVPS->getMaxOpSets() - 1, "vps_num_layer_sets_minus1" );
for( uint32_t opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ )
{
// Operation point set
for( uint32_t i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
{
// Only applicable for version 1
// pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );
WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" );
}
}
const TimingInfo *timingInfo = pcVPS->getTimingInfo();
WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vps_timing_info_present_flag");
if(timingInfo->getTimingInfoPresentFlag())
{
WRITE_CODE(timingInfo->getNumUnitsInTick(), 32, "vps_num_units_in_tick");
WRITE_CODE(timingInfo->getTimeScale(), 32, "vps_time_scale");
WRITE_FLAG(timingInfo->getPocProportionalToTimingFlag(), "vps_poc_proportional_to_timing_flag");
if(timingInfo->getPocProportionalToTimingFlag())
{
WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(), "vps_num_ticks_poc_diff_one_minus1");
}
WRITE_UVLC( pcVPS->getNumHrdParameters(), "vps_num_hrd_parameters" );
if( pcVPS->getNumHrdParameters() > 0 )
{
for( uint32_t i = 0; i < pcVPS->getNumHrdParameters(); i ++ )
{
// Only applicable for version 1
WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ), "hrd_layer_set_idx" );
if( i > 0 )
{
WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" );
}
codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
}
}
}
WRITE_FLAG( 0, "vps_extension_flag" );
//future extensions here..
xWriteRbspTrailingBits();
}
#else
void HLSWriter::codeVPS(const VPS* pcVPS)
{
#if ENABLE_TRACING
......@@ -1083,7 +1005,6 @@ void HLSWriter::codeVPS(const VPS* pcVPS)
//future extensions here..
xWriteRbspTrailingBits();
}
#endif
void HLSWriter::codeSliceHeader ( Slice* pcSlice )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment