From ca0d2c59c188630dbccb94425196e8871da93715 Mon Sep 17 00:00:00 2001 From: rickxu <lidong.xu@intel.com> Date: Fri, 7 Jun 2019 23:45:34 -0700 Subject: [PATCH] Fixed tab format issue. --- source/App/DecoderApp/DecApp.cpp | 2 +- source/App/Parcat/parcat.cpp | 2 +- source/App/StreamMergeApp/StreamMergeApp.h | 222 +++++++++--------- .../App/StreamMergeApp/StreamMergeAppCfg.cpp | 10 +- source/Lib/CommonLib/Slice.cpp | 2 +- source/Lib/CommonLib/Slice.h | 2 +- source/Lib/CommonLib/TypeDef.h | 2 +- source/Lib/DecoderLib/NALread.cpp | 2 +- source/Lib/DecoderLib/VLCReader.cpp | 12 +- source/Lib/EncoderLib/AnnexBwrite.h | 2 +- source/Lib/EncoderLib/EncGOP.cpp | 4 +- source/Lib/EncoderLib/EncLib.cpp | 2 +- source/Lib/EncoderLib/VLCWriter.cpp | 4 +- 13 files changed, 134 insertions(+), 134 deletions(-) diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp index c3b35b5ea5..490a284182 100644 --- a/source/App/DecoderApp/DecApp.cpp +++ b/source/App/DecoderApp/DecApp.cpp @@ -154,7 +154,7 @@ uint32_t DecApp::decode() read(nalu); #if JVET_N0278_HLS - if ((m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || !isNaluTheTargetLayer(&nalu)) + 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 diff --git a/source/App/Parcat/parcat.cpp b/source/App/Parcat/parcat.cpp index acb4df67c3..4388d32cfd 100644 --- a/source/App/Parcat/parcat.cpp +++ b/source/App/Parcat/parcat.cpp @@ -231,7 +231,7 @@ const char * NALU_TYPE[] = #if HEVC_VPS "VPS_NUT", #elif JVET_N0278_HLS - "VPS_NUT", + "VPS_NUT", #else "unk", #endif diff --git a/source/App/StreamMergeApp/StreamMergeApp.h b/source/App/StreamMergeApp/StreamMergeApp.h index cca09b6d2b..b679037133 100644 --- a/source/App/StreamMergeApp/StreamMergeApp.h +++ b/source/App/StreamMergeApp/StreamMergeApp.h @@ -75,119 +75,119 @@ public: class SingleLayerStream { public: - /** - * Create a bytestream reader that will extract bytes from - * istream. - * - * NB, it isn't safe to access istream while in use by a - * InputByteStream. - * - * Side-effects: the exception mask of istream is set to eofbit - */ - SingleLayerStream() - : m_NumFutureBytes(0) - , m_FutureBytes(0) - { - } - - /** - * Reset the internal state. Must be called if input stream is - * modified externally to this class - */ - void reset() - { - m_NumFutureBytes = 0; - m_FutureBytes = 0; - } - - void init(std::istream& istream) - { - istream.exceptions(std::istream::eofbit | std::istream::badbit); - } - - /** - * returns true if an EOF will be encountered within the next - * n bytes. - */ - bool eofBeforeNBytes(uint32_t n, std::istream& m_Input) - { - CHECK(n > 4, "Unsupported look-ahead value"); - if (m_NumFutureBytes >= n) - { - return false; - } - - n -= m_NumFutureBytes; - try - { - for (uint32_t i = 0; i < n; i++) - { - m_FutureBytes = (m_FutureBytes << 8) | m_Input.get(); - m_NumFutureBytes++; - } - } - catch (...) - { - return true; - } - return false; - } - - /** - * return the next n bytes in the stream without advancing - * the stream pointer. - * - * Returns: an unsigned integer representing an n byte bigendian - * word. - * - * If an attempt is made to read past EOF, an n-byte word is - * returned, but the portion that required input bytes beyond EOF - * is undefined. - * - */ - uint32_t peekBytes(uint32_t n, std::istream& m_Input) - { - eofBeforeNBytes(n, m_Input); - return m_FutureBytes >> 8 * (m_NumFutureBytes - n); - } - - /** - * consume and return one byte from the input. - * - * If bytestream is already at EOF prior to a call to readByte(), - * an exception std::ios_base::failure is thrown. - */ - uint8_t readByte(std::istream& m_Input) - { - if (!m_NumFutureBytes) - { - uint8_t byte = m_Input.get(); - return byte; - } - m_NumFutureBytes--; - uint8_t wanted_byte = m_FutureBytes >> 8 * m_NumFutureBytes; - m_FutureBytes &= ~(0xff << 8 * m_NumFutureBytes); - return wanted_byte; - } - - /** - * consume and return n bytes from the input. n bytes from - * bytestream are interpreted as bigendian when assembling - * the return value. - */ - uint32_t readBytes(uint32_t n, std::istream& m_Input) - { - uint32_t val = 0; - for (uint32_t i = 0; i < n; i++) - { - val = (val << 8) | readByte(m_Input); - } - return val; - } + /** + * Create a bytestream reader that will extract bytes from + * istream. + * + * NB, it isn't safe to access istream while in use by a + * InputByteStream. + * + * Side-effects: the exception mask of istream is set to eofbit + */ + SingleLayerStream() + : m_numFutureBytes(0) + , m_futureBytes(0) + { + } + + /** + * Reset the internal state. Must be called if input stream is + * modified externally to this class + */ + void reset() + { + m_numFutureBytes = 0; + m_futureBytes = 0; + } + + void init(std::istream& istream) + { + istream.exceptions(std::istream::eofbit | std::istream::badbit); + } + + /** + * returns true if an EOF will be encountered within the next + * n bytes. + */ + bool eofBeforeNBytes(uint32_t n, std::istream& m_Input) + { + CHECK(n > 4, "Unsupported look-ahead value"); + if (m_numFutureBytes >= n) + { + return false; + } + + n -= m_numFutureBytes; + try + { + for (uint32_t i = 0; i < n; i++) + { + m_futureBytes = (m_futureBytes << 8) | m_Input.get(); + m_numFutureBytes++; + } + } + catch (...) + { + return true; + } + return false; + } + + /** + * return the next n bytes in the stream without advancing + * the stream pointer. + * + * Returns: an unsigned integer representing an n byte bigendian + * word. + * + * If an attempt is made to read past EOF, an n-byte word is + * returned, but the portion that required input bytes beyond EOF + * is undefined. + * + */ + uint32_t peekBytes(uint32_t n, std::istream& m_Input) + { + eofBeforeNBytes(n, m_Input); + return m_futureBytes >> 8 * (m_numFutureBytes - n); + } + + /** + * consume and return one byte from the input. + * + * If bytestream is already at EOF prior to a call to readByte(), + * an exception std::ios_base::failure is thrown. + */ + uint8_t readByte(std::istream& m_Input) + { + if (!m_numFutureBytes) + { + uint8_t byte = m_Input.get(); + return byte; + } + m_numFutureBytes--; + uint8_t wanted_byte = m_futureBytes >> 8 * m_numFutureBytes; + m_futureBytes &= ~(0xff << 8 * m_numFutureBytes); + return wanted_byte; + } + + /** + * consume and return n bytes from the input. n bytes from + * bytestream are interpreted as bigendian when assembling + * the return value. + */ + uint32_t readBytes(uint32_t n, std::istream& m_Input) + { + uint32_t val = 0; + for (uint32_t i = 0; i < n; i++) + { + val = (val << 8) | readByte(m_Input); + } + return val; + } private: - uint32_t m_NumFutureBytes; /* number of valid bytes in m_FutureBytes */ - uint32_t m_FutureBytes; /* bytes that have been peeked */ + uint32_t m_numFutureBytes; /* number of valid bytes in m_futureBytes */ + uint32_t m_futureBytes; /* bytes that have been peeked */ }; bool byteStreamNALUnit(SingleLayerStream& bs, std::istream& istream, vector<uint8_t>& nalUnit, AnnexBStats& stats); diff --git a/source/App/StreamMergeApp/StreamMergeAppCfg.cpp b/source/App/StreamMergeApp/StreamMergeAppCfg.cpp index 608e3aa59d..900dc4488d 100644 --- a/source/App/StreamMergeApp/StreamMergeAppCfg.cpp +++ b/source/App/StreamMergeApp/StreamMergeAppCfg.cpp @@ -73,11 +73,11 @@ bool StreamMergeAppCfg::parseCfg(int argc, char* argv[]) 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") - ; + ("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; diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 855a66c99f..3c5ed9d375 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -2852,7 +2852,7 @@ uint32_t PreCalcValues::getMinQtSize( const Slice &slice, const ChannelType chTy } #if ENABLE_TRACING -#if HEVC_VPS +#if HEVC_VPS || JVET_N0278_HLS void xTraceVPSHeader() { DTRACE( g_trace_ctx, D_HEADER, "=========== Video Parameter Set ===========\n" ); diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index f0251bbdde..a51a25ce17 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -2634,7 +2634,7 @@ public: }; #if ENABLE_TRACING -#if HEVC_VPS +#if HEVC_VPS || JVET_N0278_HLS void xTraceVPSHeader(); #endif #if JVET_N0349_DPS diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 5148cb3cbc..d1753f87c3 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -280,7 +280,7 @@ typedef std::pair<int, int> TrCost; #define K0238_SAO_GREEDY_MERGE_ENCODING 1 #ifndef ENABLE_TRACING -#define ENABLE_TRACING 0 // DISABLE by default (enable only when debugging, requires 15% run-time in decoding) -- see documentation in 'doc/DTrace for NextSoftware.pdf' +#define ENABLE_TRACING 1 // DISABLE by default (enable only when debugging, requires 15% run-time in decoding) -- see documentation in 'doc/DTrace for NextSoftware.pdf' #endif #if ENABLE_TRACING diff --git a/source/Lib/DecoderLib/NALread.cpp b/source/Lib/DecoderLib/NALread.cpp index 403e9e0ffa..c52db64998 100644 --- a/source/Lib/DecoderLib/NALread.cpp +++ b/source/Lib/DecoderLib/NALread.cpp @@ -228,7 +228,7 @@ void readNalUnitHeader(InputNALUnit& nalu) || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA #if JVET_N0278_HLS - || nalu.m_nalUnitType == NAL_UNIT_VPS + || nalu.m_nalUnitType == NAL_UNIT_VPS #endif || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_EOS diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 25efef2169..9079888995 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1757,17 +1757,17 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) READ_CODE(8, uiCode, "vps_max_layers_minus1"); pcVPS->setMaxLayers(uiCode + 1); CHECK(uiCode + 1 > MAX_VPS_LAYERS, "Invalid code"); for (uint32_t i = 0; i <= pcVPS->getMaxLayers() - 1; i++) { - READ_CODE(7, uiCode, "vps_included_layer_id"); pcVPS->setVPSIncludedLayerId(uiCode, i); - READ_FLAG(uiCode, "vps_reserved_zero_1bit"); + READ_CODE(7, uiCode, "vps_included_layer_id"); pcVPS->setVPSIncludedLayerId(uiCode, i); + READ_FLAG(uiCode, "vps_reserved_zero_1bit"); } READ_FLAG(uiCode, "vps_extension_flag"); if (uiCode) { - while (xMoreRbspData()) - { - READ_FLAG(uiCode, "vps_extension_data_flag"); - } + while (xMoreRbspData()) + { + READ_FLAG(uiCode, "vps_extension_data_flag"); + } } xReadRbspTrailingBits(); diff --git a/source/Lib/EncoderLib/AnnexBwrite.h b/source/Lib/EncoderLib/AnnexBwrite.h index 3b49c99ba7..4067197af9 100644 --- a/source/Lib/EncoderLib/AnnexBwrite.h +++ b/source/Lib/EncoderLib/AnnexBwrite.h @@ -74,7 +74,7 @@ static std::vector<uint32_t> writeAnnexB(std::ostream& out, const AccessUnit& au #endif #else #if JVET_N0278_HLS - if (it == au.begin() || 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_SPS || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_PPS) #else if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS) #endif diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 39ee29db7c..7fd84d5293 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -3406,13 +3406,13 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni #else #if JVET_N0349_DPS #if JVET_N0278_HLS - 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) #else if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_DPS || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS) #endif #else #if JVET_N0278_HLS - if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_VPS || (*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_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS) #else if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS) #endif diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index fa1e0f612f..232d6436ce 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -895,7 +895,7 @@ void EncLib::xInitVPS(VPS &vps) vps.setMaxLayers(1); for (uint32_t i = 0; i < vps.getMaxLayers(); i++) { - vps.setVPSIncludedLayerId(0, i); + vps.setVPSIncludedLayerId(0, i); } } #endif diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 638b2076f6..290f8dd778 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1291,8 +1291,8 @@ void HLSWriter::codeVPS(const VPS* pcVPS) WRITE_CODE(pcVPS->getMaxLayers() - 1, 8, "vps_max_layers_minus1"); for (uint32_t i = 0; i <= pcVPS->getMaxLayers() - 1; i++) { - WRITE_CODE(pcVPS->getVPSIncludedLayerId(i), 7, "vps_included_layer_id"); - WRITE_FLAG(0, "vps_reserved_zero_1bit"); + WRITE_CODE(pcVPS->getVPSIncludedLayerId(i), 7, "vps_included_layer_id"); + WRITE_FLAG(0, "vps_reserved_zero_1bit"); } WRITE_FLAG(0, "vps_extension_flag"); -- GitLab