Commit bb26a6a6 authored by Xiang Li's avatar Xiang Li

Merge branch 'clean5b' into 'master'

Remove macros from N meeting cycle and more

See merge request !638
parents cc2a3e03 7817ad84
Pipeline #1794 passed with stage
......@@ -153,11 +153,7 @@ uint32_t DecApp::decode()
{
read(nalu);
#if JVET_N0278_HLS
if ((m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || !isNaluTheTargetLayer(&nalu))
#else
if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) )
#endif
{
bNewPicture = false;
}
......@@ -237,16 +233,8 @@ uint32_t DecApp::decode()
m_cDecLib.setNoOutputPriorPicsFlag (false);
}
if ( bNewPicture &&
#if !JVET_M0101_HLS
( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
#else
( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP) )
#endif
{
xFlushOutput( pcListPic );
}
......@@ -256,16 +244,8 @@ uint32_t DecApp::decode()
m_cDecLib.setFirstSliceInPicture (false);
}
// write reconstruction to file -- for additional bumping as defined in C.5.2.3
#if JVET_N0067_NAL_Unit_Header
if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL_15)
|| (nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu.m_nalUnitType <= NAL_UNIT_CODED_SLICE_GRA)))
#else
#if !JVET_M0101_HLS
if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
#else
if (!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL15)
#endif
#endif
{
xWriteOutput( pcListPic, nalu.m_temporalId );
}
......@@ -313,9 +293,7 @@ void DecApp::xCreateDecLib()
);
m_cDecLib.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
#if JVET_N0278_HLS
m_cDecLib.setTargetDecLayer(m_iTargetLayer);
#endif
if (!m_outputDecodedSEIMessagesFilename.empty())
{
......@@ -409,9 +387,6 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
if ( !m_reconFileName.empty() )
{
const Window &conf = pcPicTop->cs->sps->getConformanceWindow();
#if !JVET_N0063_VUI
const Window defDisp = (m_respectDefDispWindow && pcPicTop->cs->sps->getVuiParametersPresentFlag()) ? pcPicTop->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
#endif
const bool isTff = pcPicTop->topField;
bool display = true;
......@@ -430,17 +405,10 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
m_cVideoIOYuvReconFile.write( pcPicTop->getRecoBuf(), pcPicBottom->getRecoBuf(),
m_outputColourSpaceConvert,
false, // TODO: m_packedYUVMode,
#if JVET_N0063_VUI
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#else
conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, isTff );
}
}
......@@ -484,24 +452,14 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
if (!m_reconFileName.empty())
{
const Window &conf = pcPic->cs->sps->getConformanceWindow();
#if !JVET_N0063_VUI
const Window defDisp = (m_respectDefDispWindow && pcPic->cs->sps->getVuiParametersPresentFlag()) ? pcPic->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
#endif
m_cVideoIOYuvReconFile.write( pcPic->getRecoBuf(),
m_outputColourSpaceConvert,
m_packedYUVMode,
#if JVET_N0063_VUI
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#else
conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
}
......@@ -556,25 +514,15 @@ void DecApp::xFlushOutput( PicList* pcListPic )
if ( !m_reconFileName.empty() )
{
const Window &conf = pcPicTop->cs->sps->getConformanceWindow();
#if !JVET_N0063_VUI
const Window defDisp = (m_respectDefDispWindow && pcPicTop->cs->sps->getVuiParametersPresentFlag()) ? pcPicTop->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
#endif
const bool isTff = pcPicTop->topField;
m_cVideoIOYuvReconFile.write( pcPicTop->getRecoBuf(), pcPicBottom->getRecoBuf(),
m_outputColourSpaceConvert,
false, // TODO: m_packedYUVMode,
#if JVET_N0063_VUI
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#else
conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, isTff );
}
......@@ -621,24 +569,14 @@ void DecApp::xFlushOutput( PicList* pcListPic )
if (!m_reconFileName.empty())
{
const Window &conf = pcPic->cs->sps->getConformanceWindow();
#if !JVET_N0063_VUI
const Window defDisp = (m_respectDefDispWindow && pcPic->cs->sps->getVuiParametersPresentFlag()) ? pcPic->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
#endif
m_cVideoIOYuvReconFile.write( pcPic->getRecoBuf(),
m_outputColourSpaceConvert,
m_packedYUVMode,
#if JVET_N0063_VUI
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#else
conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
}
......@@ -688,7 +626,6 @@ bool DecApp::isNaluWithinTargetDecLayerIdSet( InputNALUnit* nalu )
return false;
}
#if JVET_N0278_HLS
/** \param nalu Input nalu to check whether its LayerId is the specified target layer
*/
bool DecApp::isNaluTheTargetLayer(InputNALUnit* nalu)
......@@ -698,6 +635,5 @@ bool DecApp::isNaluTheTargetLayer(InputNALUnit* nalu)
return false;
}
#endif
//! \}
......@@ -81,9 +81,7 @@ private:
void xWriteOutput ( PicList* pcListPic , uint32_t tId); ///< write YUV to file
void xFlushOutput ( PicList* pcListPic ); ///< flush all remaining decoded pictures to file
bool isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet
#if JVET_N0278_HLS
bool isNaluTheTargetLayer(InputNALUnit* nalu); ///< check whether given Nalu is within targetDecLayerIdSet
#endif
};
//! \}
......
......@@ -87,9 +87,7 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
("OutputBitDepthC,d", m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0, "bit depth of YUV output chroma component (default: use luma output bit-depth)")
("OutputColourSpaceConvert", outputColourSpaceConvert, string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
#if JVET_N0278_HLS
("TargetLayer,p", m_iTargetLayer, -1, "Target bitstream Layer to be decoded.")
#endif
("SEIDecodedPictureHash,-dph",m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n"
"\t1: check hash in SEI messages if available in the bitstream\n"
"\t0: ignore SEI message")
......@@ -225,9 +223,7 @@ DecAppCfg::DecAppCfg()
, m_iSkipFrame(0)
// m_outputBitDepth array initialised below
, m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
#if JVET_N0278_HLS
, m_iTargetLayer(0)
#endif
, m_iMaxTemporalLayer(-1)
, m_decodedPictureHashSEIEnabled(0)
, m_decodedNoDisplaySEIEnabled(false)
......
......@@ -61,9 +61,7 @@ protected:
int m_iSkipFrame; ///< counter for frames prior to the random access point to skip
int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
InputColourSpaceConversion m_outputColourSpaceConvert;
#if JVET_N0278_HLS
int m_iTargetLayer; ///< target stream layer to be decoded
#endif
int m_iMaxTemporalLayer; ///< maximum temporal layer to be decoded
int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -59,9 +59,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
SPS* sps = NULL;
uint32_t firstSliceSegmentInPic;
#if !JVET_N0857_RECT_SLICES
READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" );
#endif
if( isRapPic )
{
READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored -- updated already
......@@ -74,21 +71,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
//!KS: need to add error handling code here, if SPS is not available
CHECK(sps==0, "Invalid SPS");
#if !JVET_N0857_RECT_SLICES
int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight());
uint32_t sliceSegmentAddress = 0;
int bitsSliceSegmentAddress = 0;
while(numCTUs>(1<<bitsSliceSegmentAddress))
{
bitsSliceSegmentAddress++;
}
if(!firstSliceSegmentInPic)
{
READ_CODE( bitsSliceSegmentAddress, sliceSegmentAddress, "slice_segment_address" );
}
#endif
#if JVET_N0857_RECT_SLICES
int bitsSliceAddress = 1;
if (!pps->getRectSliceFlag())
{
......@@ -128,7 +110,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
{
READ_UVLC(uiCode, "num_bricks_in_slice_minus1");
}
#endif
//set uiCode to equal slice start address (or dependent slice start address)
for (int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++)
{
......@@ -206,7 +187,6 @@ const bool verbose = false;
const char * NALU_TYPE[] =
{
#if JVET_N0067_NAL_Unit_Header
"NAL_UNIT_PPS",
"NAL_UNIT_ACCESS_UNIT_DELIMITER",
"NAL_UNIT_PREFIX_SEI",
......@@ -239,104 +219,6 @@ const char * NALU_TYPE[] =
"NAL_UNIT_UNSPECIFIED_29",
"NAL_UNIT_UNSPECIFIED_30",
"NAL_UNIT_UNSPECIFIED_31"
#else
#if !JVET_M0101_HLS
"TRAIL_N",
"TRAIL_R",
"TSA_N",
"TSA_R",
"STSA_N",
"STSA_R",
"RADL_N",
"RADL_R",
"RASL_N",
"RASL_R",
"RSV_VCL_N10",
"RSV_VCL_N12",
"RSV_VCL_N14",
"RSV_VCL_R11",
"RSV_VCL_R13",
"RSV_VCL_R15",
"BLA_W_LP",
"BLA_W_RADL",
"BLA_N_LP",
"IDR_W_RADL",
"IDR_N_LP",
"CRA_NUT",
"RSV_IRAP_VCL22",
"RSV_IRAP_VCL23",
"unk",
"unk",
"unk",
"unk",
"unk",
"unk",
"unk",
"unk",
#if HEVC_VPS
"VPS_NUT",
#elif JVET_N0278_HLS
"VPS_NUT",
#else
"unk",
#endif
"SPS_NUT",
"PPS_NUT",
#if JVET_M0132
"APS_NUT",
#endif
"AUD_NUT",
"EOS_NUT",
"EOB_NUT",
"FD_NUT",
"PREFIX_SEI_NUT",
"SUFFIX_SEI_NUT",
#else
"NAL_UNIT_CODED_SLICE_TRAIL",
"NAL_UNIT_CODED_SLICE_STSA",
"NAL_UNIT_CODED_SLICE_RADL",
"NAL_UNIT_CODED_SLICE_RASL",
"NAL_UNIT_RESERVED_VCL_4",
"NAL_UNIT_RESERVED_VCL_5",
"NAL_UNIT_RESERVED_VCL_6",
"NAL_UNIT_RESERVED_VCL_7",
"NAL_UNIT_CODED_SLICE_IDR_W_RADL",
"NAL_UNIT_CODED_SLICE_IDR_N_LP",
"NAL_UNIT_CODED_SLICE_CRA",
"NAL_UNIT_RESERVED_IRAP_VCL11",
"NAL_UNIT_RESERVED_IRAP_VCL12",
"NAL_UNIT_RESERVED_IRAP_VCL13",
"NAL_UNIT_RESERVED_VCL14",
#if HEVC_VPS || JVET_N0278_HLS
"NAL_UNIT_VPS",
#else
"NAL_UNIT_RESERVED_VCL15",
#endif
"NAL_UNIT_RESERVED_NVCL16",
"NAL_UNIT_SPS",
"NAL_UNIT_PPS",
"NAL_UNIT_APS",
"NAL_UNIT_ACCESS_UNIT_DELIMITER",
"NAL_UNIT_EOS",
"NAL_UNIT_EOB",
"NAL_UNIT_PREFIX_SEI",
"NAL_UNIT_SUFFIX_SEI",
"NAL_UNIT_FILLER_DATA",
"NAL_UNIT_RESERVED_NVCL26",
"NAL_UNIT_RESERVED_NVCL27",
"NAL_UNIT_UNSPECIFIED_28",
"NAL_UNIT_UNSPECIFIED_29",
"NAL_UNIT_UNSPECIFIED_30",
"NAL_UNIT_UNSPECIFIED_31"
#endif
#endif
};
int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
......@@ -358,15 +240,6 @@ int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
{
iPOCmsb = iPrevPOCmsb;
}
#if !JVET_M0101_HLS
if ( nalu_type == NAL_UNIT_CODED_SLICE_BLA_W_LP
|| nalu_type == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| nalu_type == NAL_UNIT_CODED_SLICE_BLA_N_LP )
{
// For BLA picture types, POCmsb is set to 0.
iPOCmsb = 0;
}
#endif
return iPOCmsb + iPOClsb;
}
......@@ -401,14 +274,10 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
p += nal_start;
std::vector<uint8_t> nalu(p, p + nal_end - nal_start);
#if JVET_N0067_NAL_Unit_Header
int nalu_header = nalu[0];
bool zeroTidRequiredFlag = (nalu_header & ( 1 << 7 )) >> 7;
int nalUnitTypeLsb = (((1 << 4) - 1) & nalu_header);
int nalu_type = ((zeroTidRequiredFlag << 4) + nalUnitTypeLsb);
#else
int nalu_type = nalu[0] >> 1;
#endif
int poc = -1;
int poc_lsb = -1;
int new_poc = -1;
......@@ -433,11 +302,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
{
PPS* pps = new PPS();
HLSReader.setBitstream( &inp_nalu.getBitstream() );
#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
HLSReader.parsePPS( pps, &parameterSetManager );
#else
HLSReader.parsePPS( pps );
#endif
parameterSetManager.storePPS( pps, inp_nalu.getBitstream().getFifo() );
}
......@@ -446,25 +311,12 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
poc = 0;
new_poc = *poc_base + poc;
}
#if JVET_N0067_NAL_Unit_Header
if((nalu_type > 7 && nalu_type < 15) || nalu_type == NAL_UNIT_CODED_SLICE_CRA)
#else
#if !JVET_M0101_HLS
if(nalu_type < 32 && nalu_type != NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu_type != NAL_UNIT_CODED_SLICE_IDR_N_LP)
#else
if(nalu_type < 15 && nalu_type != NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu_type != NAL_UNIT_CODED_SLICE_IDR_N_LP)
#endif
#endif
{
parcatHLSReader.setBitstream( &inp_nalu.getBitstream() );
bool isRapPic =
inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
#if !JVET_M0101_HLS
|| inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
|| inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
|| inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
#endif
|| inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA;
// beginning of slice header parsing, taken from VLCReader
......@@ -506,25 +358,9 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
}
#if HEVC_VPS
#if JVET_N0349_DPS
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_VPS || nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS))
#endif
#else
#if JVET_N0349_DPS
#if JVET_N0278_HLS
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))
#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_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
#endif
#else
#if JVET_N0278_HLS
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_SPS || nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
#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_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
#endif
#endif
#endif
|| (nalu_type == NAL_UNIT_SUFFIX_SEI && skip_next_sei))
{
......
......@@ -72,7 +72,6 @@ void read2(InputNALUnit& nalu)
{
InputBitstream& bs = nalu.getBitstream();
#if JVET_N0067_NAL_Unit_Header
bool zeroTidRequiredFlag = bs.read(1); // zero_tid_required_flag
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
CHECK(nalu.m_temporalId < 0, "Temporal ID is negative.");
......@@ -89,19 +88,6 @@ void read2(InputNALUnit& nalu)
CHECK((nalu.m_nuhLayerId < 0) || (nalu.m_nuhLayerId > 126), "Layer ID out of range");
uint32_t nuh_reserved_zero_bit = bs.read(1); // nuh_reserved_zero_bit
CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
#else
bool forbidden_zero_bit = bs.read(1); // forbidden_zero_bit
if(forbidden_zero_bit != 0) { THROW( "Forbidden zero-bit not '0'" );}
#if JVET_N0278_HLS
nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
nalu.m_nuhLayerId = bs.read(6); // nuh_layer_id
#else
nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type
nalu.m_nuhLayerId = bs.read(6); // nuh_layer_id
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
#endif
#endif
}
uint32_t SEIRemovalApp::decode()
......
......@@ -73,7 +73,6 @@ void read2(InputNALUnit& nalu)
{
InputBitstream& bs = nalu.getBitstream();
#if JVET_N0067_NAL_Unit_Header
bool zeroTidRequiredFlag = bs.read(1); // zero_tid_required_flag
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
CHECK(nalu.m_temporalId < 0, "Temporal ID is negative.");
......@@ -90,13 +89,6 @@ void read2(InputNALUnit& nalu)
CHECK((nalu.m_nuhLayerId < 0) || (nalu.m_nuhLayerId > 126), "Layer ID out of range");
uint32_t nuh_reserved_zero_bit = bs.read(1); // nuh_reserved_zero_bit
CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
#else
bool forbidden_zero_bit = bs.read(1); // forbidden_zero_bit
if (forbidden_zero_bit != 0) { THROW("Forbidden zero-bit not '0'"); }
nalu.m_nalUnitType = (NalUnitType)bs.read(6); // nal_unit_type
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
nalu.m_nuhLayerId = bs.read(6); // nuh_layer_id
#endif
}
static void
......@@ -246,7 +238,6 @@ void StreamMergeApp::writeNewVPS(ostream& out, int nLayerId, int nTemporalId)
OutputBitstream bsNALUHeader;
static const uint8_t start_code_prefix[] = { 0,0,0,1 };
#if JVET_N0067_NAL_Unit_Header
bsNALUHeader.write(1, 1); // zero_tid_required_flag
bsNALUHeader.write(nTemporalId + 1, 3); // nuh_temporal_id_plus1
uint32_t nalUnitTypeLsb = NAL_UNIT_VPS - (1 << 4);
......@@ -257,12 +248,6 @@ void StreamMergeApp::writeNewVPS(ostream& out, int nLayerId, int nTemporalId)
bsNALUHeader.write(nLayerId, 7); // nuh_layer_id
#endif
bsNALUHeader.write(0, 1); // nuh_reserved_zero_bit
#else
bsNALUHeader.write(0, 1); // forbidden_zero_bit
bsNALUHeader.write(NAL_UNIT_VPS, 6); // nal_unit_type
bsNALUHeader.write(1, 3); // nuh_temporal_id_plus1
bsNALUHeader.write(nLayerId, 6); // nuh_layer_id
#endif
out.write(reinterpret_cast<const char*>(start_code_prefix), 4);
out.write(reinterpret_cast<const char*>(bsNALUHeader.getByteStream()), bsNALUHeader.getByteStreamLength());
......@@ -356,15 +341,11 @@ uint32_t StreamMergeApp::mergeStreams()
//update the nul_layer_id
uint8_t *p = (uint8_t*)nalu.getBitstream().getFifo().data();
#if JVET_N0067_NAL_Unit_Header
#if EMULATION_PREVENTION_FIX
p[1] = ((layerId + 1) << 1) & 0xff;
#else
p[1] = (layerId << 1) & 0xff;
#endif
#else
p[1] = (p[1] & 0xc0) | layerId;
#endif
bitstreamFileOut.write((const char*)p, nalu.getBitstream().getFifo().size());
......
......@@ -56,7 +56,6 @@ namespace po = df::program_options_lite;
*/
bool StreamMergeAppCfg::parseCfg(int argc, char* argv[])
{
#if 1
int i;
m_numInputStreams = argc - 2;
......@@ -67,61 +66,6 @@ bool StreamMergeAppCfg::parseCfg(int argc, char* argv[])
}
m_bitstreamFileNameOut = argv[i + 1];
#else
bool do_help = false;
int warnUnknowParameter = 0;
po::Options opts;
opts.addOptions()
("help", do_help, false, "this help text")
("BitstreamFileIn0,-a", m_bitstreamFileNameIn[0], string(""), "bitstream input file name")
("BitstreamFileIn1,-b", m_bitstreamFileNameIn[1], string(""), "bitstream input file name")
("BitstreamFileOut,o", m_bitstreamFileNameOut, string(""), "bitstream output file name")
;
po::setDefaults(opts);
po::ErrorReporter err;
const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**)argv, err);
for (list<const char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
{
std::cerr << "Unhandled argument ignored: " << *it << std::endl;
}
if (argc == 1 || do_help)
{
po::doHelp(cout, opts);
return false;
}
if (err.is_errored)
{
if (!warnUnknowParameter)
{
/* errors have already been reported to stderr */
return false;
}
}
m_numInputStreams = 0;
for (int i = 0; i < MAX_VPS_LAYERS; i++)
{
if (!m_bitstreamFileNameIn[i].empty())
m_numInputStreams++;
}
if (m_numInputStreams < 2)
{
std::cerr << "Need at least two input bitstreams, aborting" << std::endl;
return false;
}
if (m_bitstreamFileNameOut.empty())
{
std::cerr << "No output file specified, aborting" << std::endl;
return false;
}
#endif
return true;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -91,11 +91,7 @@ void gradFilterCore(Pel* pSrc, int srcStride, int width, int height, int gradStr
Pel* srcTmp = pSrc + srcStride + 1;
Pel* gradXTmp = gradX + gradStride + 1;
Pel* gradYTmp = gradY + gradStride + 1;
#if JVET_N0325_BDOF
int shift1 = std::max<int>(6, (bitDepth - 6));
#else
int shift1 = std::max<int>(2, (IF_INTERNAL_PREC - bitDepth));
#endif
for (int y = 0; y < (height - 2 * BIO_EXTEND_SIZE); y++