From 0483e3bd3e64a380ac923edb0f2a9119db2faabf Mon Sep 17 00:00:00 2001 From: Frank Bossen <fbossen@gmail.com> Date: Thu, 19 Jan 2023 17:24:19 -0500 Subject: [PATCH] Adapt code to new SW guidelines Changes include: - use [[maybe_unused]] instead of cast to (void) - use generic lambda function and remove related comment about C++11 - update MSVC version check - don't condition '#pragma once' on MSVC version --- .../BitstreamExtractorApp.h | 2 - .../BitstreamExtractorAppCfg.h | 2 - source/App/DecoderApp/DecApp.h | 2 - source/App/DecoderApp/DecAppCfg.h | 2 - source/App/EncoderApp/EncAppCfg.cpp | 5 +- source/App/SEIFilmGrainApp/SEIFilmGrainApp.h | 2 - .../App/SEIFilmGrainApp/SEIFilmGrainAppCfg.h | 2 - source/App/SEIRemovalApp/SEIRemovalApp.h | 2 - source/App/SEIRemovalApp/SEIRemovalAppCfg.h | 2 - source/App/StreamMergeApp/StreamMergeApp.h | 2 - source/App/StreamMergeApp/StreamMergeAppCfg.h | 2 - source/Lib/CommonLib/BitStream.h | 2 - source/Lib/CommonLib/CommonDef.h | 20 ++-- source/Lib/CommonLib/ProfileLevelTier.h | 2 - source/Lib/CommonLib/Reshape.h | 2 - source/Lib/DecoderLib/DecCu.h | 2 - source/Lib/DecoderLib/DecSlice.h | 2 - source/Lib/DecoderLib/SEIread.h | 2 - source/Lib/EncoderLib/Analyze.h | 112 +++++++----------- source/Lib/EncoderLib/EncCfg.h | 2 - source/Lib/EncoderLib/EncCfgParam.h | 2 - source/Lib/EncoderLib/EncReshape.h | 3 +- source/Lib/EncoderLib/RateCtrl.h | 3 - 23 files changed, 55 insertions(+), 124 deletions(-) diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h index 7836e255a..a680d7d65 100644 --- a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h +++ b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h @@ -34,9 +34,7 @@ #ifndef __BITSTREAMEXTRACTORAPP__ #define __BITSTREAMEXTRACTORAPP__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <stdio.h> #include <fstream> diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.h b/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.h index dfbced83b..84c94a05b 100644 --- a/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.h +++ b/source/App/BitstreamExtractorApp/BitstreamExtractorAppCfg.h @@ -35,9 +35,7 @@ #ifndef __BITSTREAMEXTRACTORAPPCFG__ #define __BITSTREAMEXTRACTORAPPCFG__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include <vector> diff --git a/source/App/DecoderApp/DecApp.h b/source/App/DecoderApp/DecApp.h index a1ef4896b..f9c4d5a28 100644 --- a/source/App/DecoderApp/DecApp.h +++ b/source/App/DecoderApp/DecApp.h @@ -38,9 +38,7 @@ #ifndef __DECAPP__ #define __DECAPP__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "Utilities/VideoIOYuv.h" #include "CommonLib/Picture.h" diff --git a/source/App/DecoderApp/DecAppCfg.h b/source/App/DecoderApp/DecAppCfg.h index 7c45c7f82..4adfdf575 100644 --- a/source/App/DecoderApp/DecAppCfg.h +++ b/source/App/DecoderApp/DecAppCfg.h @@ -38,9 +38,7 @@ #ifndef __DECAPPCFG__ #define __DECAPPCFG__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include <vector> diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index c97e179e5..bd6524fdd 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -560,7 +560,7 @@ static uint32_t getMaxSlicesByLevel( Level::Name level ) \param argv array of arguments \retval true when success */ -#if _MSC_VER > 1000 +#ifdef _MSC_VER // Disable optimizations to avoid long compile times #pragma optimize( "", off ) #endif @@ -3410,7 +3410,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) return true; } -#if _MSC_VER > 1000 +#ifdef _MSC_VER +// Restore optimizations #pragma optimize( "", on ) #endif diff --git a/source/App/SEIFilmGrainApp/SEIFilmGrainApp.h b/source/App/SEIFilmGrainApp/SEIFilmGrainApp.h index bf2f746ec..a56c03bb3 100644 --- a/source/App/SEIFilmGrainApp/SEIFilmGrainApp.h +++ b/source/App/SEIFilmGrainApp/SEIFilmGrainApp.h @@ -38,9 +38,7 @@ #ifndef __SEIFILMGRAINAPP__ #define __SEIFILMGRAINAPP__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <stdio.h> #include <fstream> diff --git a/source/App/SEIFilmGrainApp/SEIFilmGrainAppCfg.h b/source/App/SEIFilmGrainApp/SEIFilmGrainAppCfg.h index 84459a1b8..d13e1a12f 100644 --- a/source/App/SEIFilmGrainApp/SEIFilmGrainAppCfg.h +++ b/source/App/SEIFilmGrainApp/SEIFilmGrainAppCfg.h @@ -38,9 +38,7 @@ #ifndef __SEIFILMGRAINAPPCFG__ #define __SEIFILMGRAINAPPCFG__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include <vector> diff --git a/source/App/SEIRemovalApp/SEIRemovalApp.h b/source/App/SEIRemovalApp/SEIRemovalApp.h index dc17579bf..a07a682b8 100644 --- a/source/App/SEIRemovalApp/SEIRemovalApp.h +++ b/source/App/SEIRemovalApp/SEIRemovalApp.h @@ -38,9 +38,7 @@ #ifndef __SEIREMOVALAPP__ #define __SEIREMOVALAPP__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <stdio.h> #include <fstream> diff --git a/source/App/SEIRemovalApp/SEIRemovalAppCfg.h b/source/App/SEIRemovalApp/SEIRemovalAppCfg.h index 568a922fc..610c1709e 100644 --- a/source/App/SEIRemovalApp/SEIRemovalAppCfg.h +++ b/source/App/SEIRemovalApp/SEIRemovalAppCfg.h @@ -38,9 +38,7 @@ #ifndef __SEIREMOVALAPPCFG__ #define __SEIREMOVALAPPCFG__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include <vector> diff --git a/source/App/StreamMergeApp/StreamMergeApp.h b/source/App/StreamMergeApp/StreamMergeApp.h index bd158a734..deca3e26d 100644 --- a/source/App/StreamMergeApp/StreamMergeApp.h +++ b/source/App/StreamMergeApp/StreamMergeApp.h @@ -38,9 +38,7 @@ #ifndef __STREAMMERGEAPP__ #define __STREAMMERGEAPP__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <stdio.h> #include <fstream> diff --git a/source/App/StreamMergeApp/StreamMergeAppCfg.h b/source/App/StreamMergeApp/StreamMergeAppCfg.h index ea6930055..98597bb5f 100644 --- a/source/App/StreamMergeApp/StreamMergeAppCfg.h +++ b/source/App/StreamMergeApp/StreamMergeAppCfg.h @@ -38,9 +38,7 @@ #ifndef __STREAMMERGEAPPCFG__ #define __STREAMMERGEAPPCFG__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include <vector> diff --git a/source/Lib/CommonLib/BitStream.h b/source/Lib/CommonLib/BitStream.h index f8ec4b871..52acb8d30 100644 --- a/source/Lib/CommonLib/BitStream.h +++ b/source/Lib/CommonLib/BitStream.h @@ -38,9 +38,7 @@ #ifndef __BITSTREAM__ #define __BITSTREAM__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <stdint.h> #include <vector> diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h index 379d040a9..4a8ede78b 100644 --- a/source/Lib/CommonLib/CommonDef.h +++ b/source/Lib/CommonLib/CommonDef.h @@ -47,27 +47,23 @@ #include <fstream> #endif +#ifdef _MSC_VER +#if _MSC_VER < 1910 +#error "MS Visual Studio version not supported. Please upgrade to Visual Studio 2017 or higher (or use other compilers)" +#endif + +#include <intrin.h> -#if _MSC_VER > 1000 // disable "signed and unsigned mismatch" #pragma warning( disable : 4018 ) // disable bool coercion "performance warning" #pragma warning( disable : 4800 ) -#endif // _MSC_VER > 1000 +#endif #include "CommonSimdCfg.h" #include "TypeDef.h" #include "version.h" -// MS Visual Studio before 2014 does not support required C++11 features -#ifdef _MSC_VER -#if _MSC_VER < 1900 -#error "MS Visual Studio version not supported. Please upgrade to Visual Studio 2015 or higher (or use other compilers)" -#endif - -#include <intrin.h> -#endif - //! \ingroup CommonLib //! \{ @@ -93,7 +89,7 @@ #ifdef __INTEL_COMPILER #define NVM_COMPILEDBY "[ICC %d]", __INTEL_COMPILER -#elif _MSC_VER +#elif defined _MSC_VER #define NVM_COMPILEDBY "[VS %d]", _MSC_VER #endif diff --git a/source/Lib/CommonLib/ProfileLevelTier.h b/source/Lib/CommonLib/ProfileLevelTier.h index 9dfe01be5..d685082c6 100644 --- a/source/Lib/CommonLib/ProfileLevelTier.h +++ b/source/Lib/CommonLib/ProfileLevelTier.h @@ -38,9 +38,7 @@ #ifndef __PROFILE_LEVEL_TIER__ #define __PROFILE_LEVEL_TIER__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include <stdint.h> diff --git a/source/Lib/CommonLib/Reshape.h b/source/Lib/CommonLib/Reshape.h index 2fea00690..ade245c94 100644 --- a/source/Lib/CommonLib/Reshape.h +++ b/source/Lib/CommonLib/Reshape.h @@ -38,9 +38,7 @@ #ifndef __RESHAPE__ #define __RESHAPE__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonDef.h" #include "Rom.h" diff --git a/source/Lib/DecoderLib/DecCu.h b/source/Lib/DecoderLib/DecCu.h index 32e2277d0..3adce7f3f 100644 --- a/source/Lib/DecoderLib/DecCu.h +++ b/source/Lib/DecoderLib/DecCu.h @@ -38,9 +38,7 @@ #ifndef __DECCU__ #define __DECCU__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CABACReader.h" diff --git a/source/Lib/DecoderLib/DecSlice.h b/source/Lib/DecoderLib/DecSlice.h index 97c37c233..acefcc512 100644 --- a/source/Lib/DecoderLib/DecSlice.h +++ b/source/Lib/DecoderLib/DecSlice.h @@ -38,9 +38,7 @@ #ifndef __DECSLICE__ #define __DECSLICE__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include "CommonLib/BitStream.h" diff --git a/source/Lib/DecoderLib/SEIread.h b/source/Lib/DecoderLib/SEIread.h index 4d3b7ac5a..dac2cff0f 100644 --- a/source/Lib/DecoderLib/SEIread.h +++ b/source/Lib/DecoderLib/SEIread.h @@ -39,9 +39,7 @@ #ifndef __SEIREAD__ #define __SEIREAD__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <fstream> //! \ingroup DecoderLib diff --git a/source/Lib/EncoderLib/Analyze.h b/source/Lib/EncoderLib/Analyze.h index 510d99d68..e3c2621ac 100644 --- a/source/Lib/EncoderLib/Analyze.h +++ b/source/Lib/EncoderLib/Analyze.h @@ -38,9 +38,7 @@ #ifndef __ANALYZE__ #define __ANALYZE__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include <stdio.h> #include <memory.h> @@ -187,27 +185,11 @@ public: void printOut(std::string &header, std::string &metrics, const std::string &delim, ChromaFormat chFmt, bool printMSEBasedSNR, bool printSequenceMSE, bool printMSSSIM, bool printHexPsnr, bool printRprPsnr, - const BitDepths &bitDepths, bool useWPSNR, bool printHdrMetrics) + const BitDepths &bitDepths, bool useWPSNR, [[maybe_unused]] bool printHdrMetrics) { -#if !JVET_O0756_CALCULATE_HDRMETRICS - (void) printHdrMetrics; // unused parameter -#endif - - std::ostringstream headeross,metricoss; - // no generic lambda in C++11... - auto addFieldD = [&](const std::string &header, const char *fmt, double x, bool withchroma = true) - { - if (!withchroma) - { - return; - } - char buffer[512]; - headeross<<header; - snprintf(buffer,512,fmt,x); - metricoss<<buffer; - }; + std::ostringstream headeross, metricoss; - auto addFieldL = [&](const std::string &header, const char *fmt, uint64_t x, bool withchroma = true) + auto addField = [&](const std::string &header, const char *fmt, auto x, bool withchroma = true) { if (!withchroma) { @@ -219,14 +201,6 @@ public: metricoss<<buffer; }; - auto addFieldS = [&](const std::string &header, const char *fmt, const char *s) - { - char buffer[512]; - headeross<<header; - snprintf(buffer,512,fmt,s); - metricoss<<buffer; - }; - auto hexValue = [](double x) -> uint64_t { uint64_t y; @@ -259,9 +233,9 @@ public: } } - addFieldL("\tTotal Frames","\t%-8d ",getNumPic()); - addFieldS(" | ", " %s ",delim.c_str()); - addFieldD("Bitrate ", "%-12.4lf ",getBits() * scale); + addField("\tTotal Frames", "\t%-8d ", getNumPic()); + addField(" | ", " %s ", delim.c_str()); + addField("Bitrate ", "%-12.4lf ", getBits() * scale); const bool withchroma=(chFmt != CHROMA_400); double psnrYUV = MAX_DOUBLE; @@ -273,23 +247,23 @@ public: if (useWPSNR) { - addFieldD("Y-WPSNR ", "%-8.4lf ", getWPSNR(COMPONENT_Y)); - addFieldD("U-WPSNR ", "%-8.4lf ", getWPSNR(COMPONENT_Cb), withchroma); - addFieldD("V-WPSNR ", "%-8.4lf ", getWPSNR(COMPONENT_Cr), withchroma); - addFieldD("YUV-WPSNR ", "%-8.4lf ", psnrYUV, withchroma); + addField("Y-WPSNR ", "%-8.4lf ", getWPSNR(COMPONENT_Y)); + addField("U-WPSNR ", "%-8.4lf ", getWPSNR(COMPONENT_Cb), withchroma); + addField("V-WPSNR ", "%-8.4lf ", getWPSNR(COMPONENT_Cr), withchroma); + addField("YUV-WPSNR ", "%-8.4lf ", psnrYUV, withchroma); } else { - addFieldD("Y-PSNR ", "%-8.4lf ", getPsnr(COMPONENT_Y) / (double) getNumPic()); - addFieldD("U-PSNR ", "%-8.4lf ", getPsnr(COMPONENT_Cb) / (double) getNumPic(), withchroma); - addFieldD("V-PSNR ", "%-8.4lf ", getPsnr(COMPONENT_Cr) / (double) getNumPic(), withchroma); - addFieldD("YUV-PSNR ", "%-8.4lf ", psnrYUV, withchroma); + addField("Y-PSNR ", "%-8.4lf ", getPsnr(COMPONENT_Y) / (double) getNumPic()); + addField("U-PSNR ", "%-8.4lf ", getPsnr(COMPONENT_Cb) / (double) getNumPic(), withchroma); + addField("V-PSNR ", "%-8.4lf ", getPsnr(COMPONENT_Cr) / (double) getNumPic(), withchroma); + addField("YUV-PSNR ", "%-8.4lf ", psnrYUV, withchroma); } #if JVET_O0756_CALCULATE_HDRMETRICS if (printHdrMetrics && withchroma) { - addFieldD("DeltaE ", "%-8.4lf ", getDeltaE() / (double) getNumPic()); - addFieldD("PSNRL ", "%-8.4lf ", getPsnrL() / (double) getNumPic()); + addField("DeltaE ", "%-8.4lf ", getDeltaE() / (double) getNumPic()); + addField("PSNRL ", "%-8.4lf ", getPsnrL() / (double) getNumPic()); } #endif #if EXTENSION_360_VIDEO @@ -299,55 +273,55 @@ public: { if (useWPSNR) { - addFieldL("xY-WPSNR ", "%-16" PRIx64 " ", hexValue(getWPSNR(COMPONENT_Y) )); - addFieldL("xU-WPSNR ", "%-16" PRIx64 " ", hexValue(getWPSNR(COMPONENT_Cb)), withchroma); - addFieldL("xV-WPSNR ", "%-16" PRIx64 " ", hexValue(getWPSNR(COMPONENT_Cr)), withchroma); + addField("xY-WPSNR ", "%-16" PRIx64 " ", hexValue(getWPSNR(COMPONENT_Y))); + addField("xU-WPSNR ", "%-16" PRIx64 " ", hexValue(getWPSNR(COMPONENT_Cb)), withchroma); + addField("xV-WPSNR ", "%-16" PRIx64 " ", hexValue(getWPSNR(COMPONENT_Cr)), withchroma); } else { - addFieldL("xY-PSNR ", "%-16" PRIx64 " ", hexValue(getPsnr(COMPONENT_Y) / (double) getNumPic())); - addFieldL("xU-PSNR ", "%-16" PRIx64 " ", hexValue(getPsnr(COMPONENT_Cb) / (double) getNumPic()), - withchroma); - addFieldL("xV-PSNR ", "%-16" PRIx64 " ", hexValue(getPsnr(COMPONENT_Cr) / (double) getNumPic()), - withchroma); + addField("xY-PSNR ", "%-16" PRIx64 " ", hexValue(getPsnr(COMPONENT_Y) / (double) getNumPic())); + addField("xU-PSNR ", "%-16" PRIx64 " ", hexValue(getPsnr(COMPONENT_Cb) / (double) getNumPic()), + withchroma); + addField("xV-PSNR ", "%-16" PRIx64 " ", hexValue(getPsnr(COMPONENT_Cr) / (double) getNumPic()), + withchroma); } } #if JVET_O0756_CALCULATE_HDRMETRICS if (printHdrMetrics && printHexPsnr && withchroma) { - addFieldL("xDeltaE ", "%-16" PRIx64 " ", hexValue(getDeltaE() / (double) getNumPic())); - addFieldL("xPSNRL ", "%-16" PRIx64 " " , hexValue(getPsnrL() / (double) getNumPic())); + addField("xDeltaE ", "%-16" PRIx64 " ", hexValue(getDeltaE() / (double) getNumPic())); + addField("xPSNRL ", "%-16" PRIx64 " ", hexValue(getPsnrL() / (double) getNumPic())); } #endif if (printMSSSIM) { - addFieldD("Y-MS-SSIM ", "%-9.7lf ", getMsssim(COMPONENT_Y) / (double) getNumPic()); - addFieldD("U-MS-SSIM ", "%-9.7lf ", getMsssim(COMPONENT_Cb) / (double) getNumPic(), withchroma); - addFieldD("V-MS-SSIM ", "%-9.7lf ", getMsssim(COMPONENT_Cr) / (double) getNumPic(), withchroma); + addField("Y-MS-SSIM ", "%-9.7lf ", getMsssim(COMPONENT_Y) / (double) getNumPic()); + addField("U-MS-SSIM ", "%-9.7lf ", getMsssim(COMPONENT_Cb) / (double) getNumPic(), withchroma); + addField("V-MS-SSIM ", "%-9.7lf ", getMsssim(COMPONENT_Cr) / (double) getNumPic(), withchroma); } if (printSequenceMSE) { - addFieldD("Y-MSE ", "%-10.4lf ", m_mseYuvFrame[COMPONENT_Y] / (double) getNumPic()); - addFieldD("U-MSE ", "%-10.4lf ", m_mseYuvFrame[COMPONENT_Cb] / (double) getNumPic(), withchroma); - addFieldD("V-MSE ", "%-10.4lf ", m_mseYuvFrame[COMPONENT_Cr] / (double) getNumPic(), withchroma); - addFieldD("YUV-MSE ", "%-10.4lf ",mseYUV, withchroma); + addField("Y-MSE ", "%-10.4lf ", m_mseYuvFrame[COMPONENT_Y] / (double) getNumPic()); + addField("U-MSE ", "%-10.4lf ", m_mseYuvFrame[COMPONENT_Cb] / (double) getNumPic(), withchroma); + addField("V-MSE ", "%-10.4lf ", m_mseYuvFrame[COMPONENT_Cr] / (double) getNumPic(), withchroma); + addField("YUV-MSE ", "%-10.4lf ", mseYUV, withchroma); } if (printMSEBasedSNR && !printRprPsnr) { - addFieldD("MSE-Y-PSNR ", "%-8.4lf ", mseBasedSNR[COMPONENT_Y]); - addFieldD("MSE-U-PSNR ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cb], withchroma); - addFieldD("MSE-V-PSNR ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cr], withchroma); - addFieldD("MSE-YUV-PSNR ", "%-8.4lf ", psnrYUV, withchroma); + addField("MSE-Y-PSNR ", "%-8.4lf ", mseBasedSNR[COMPONENT_Y]); + addField("MSE-U-PSNR ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cb], withchroma); + addField("MSE-V-PSNR ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cr], withchroma); + addField("MSE-YUV-PSNR ", "%-8.4lf ", psnrYUV, withchroma); } if (printRprPsnr) { - addFieldD("Y-PSNR1 ", "%-8.4lf ", mseBasedSNR[COMPONENT_Y]); - addFieldD("U-PSNR1 ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cb], withchroma); - addFieldD("V-PSNR1 ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cr], withchroma); - addFieldD("Y-PSNR2 ", "%-8.4lf ", m_upscaledPSNR[COMPONENT_Y]/ (double)getNumPic()); - addFieldD("U-PSNR2 ", "%-8.4lf ", m_upscaledPSNR[COMPONENT_Cb]/ (double)getNumPic(), withchroma); - addFieldD("V-PSNR2 ", "%-8.4lf ", m_upscaledPSNR[COMPONENT_Cr]/ (double)getNumPic(), withchroma); + addField("Y-PSNR1 ", "%-8.4lf ", mseBasedSNR[COMPONENT_Y]); + addField("U-PSNR1 ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cb], withchroma); + addField("V-PSNR1 ", "%-8.4lf ", mseBasedSNR[COMPONENT_Cr], withchroma); + addField("Y-PSNR2 ", "%-8.4lf ", m_upscaledPSNR[COMPONENT_Y] / (double) getNumPic()); + addField("U-PSNR2 ", "%-8.4lf ", m_upscaledPSNR[COMPONENT_Cb] / (double) getNumPic(), withchroma); + addField("V-PSNR2 ", "%-8.4lf ", m_upscaledPSNR[COMPONENT_Cr] / (double) getNumPic(), withchroma); } header=headeross.str(); metrics=metricoss.str(); diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 426146e5e..5eadea79d 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -38,9 +38,7 @@ #ifndef __ENCCFG__ #define __ENCCFG__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" #include "CommonLib/Slice.h" diff --git a/source/Lib/EncoderLib/EncCfgParam.h b/source/Lib/EncoderLib/EncCfgParam.h index 700aef410..ff2e93011 100644 --- a/source/Lib/EncoderLib/EncCfgParam.h +++ b/source/Lib/EncoderLib/EncCfgParam.h @@ -36,9 +36,7 @@ #ifndef __ENCCFGPARAMS__ #define __ENCCFGPARAMS__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "CommonLib/CommonDef.h" diff --git a/source/Lib/EncoderLib/EncReshape.h b/source/Lib/EncoderLib/EncReshape.h index f2d081fac..442289088 100644 --- a/source/Lib/EncoderLib/EncReshape.h +++ b/source/Lib/EncoderLib/EncReshape.h @@ -38,9 +38,8 @@ #ifndef __ENCRESHAPE__ #define __ENCRESHAPE__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 + #include "CommonLib/Reshape.h" //! \ingroup EncoderLib diff --git a/source/Lib/EncoderLib/RateCtrl.h b/source/Lib/EncoderLib/RateCtrl.h index 93c18c0c0..0ed7b6c62 100644 --- a/source/Lib/EncoderLib/RateCtrl.h +++ b/source/Lib/EncoderLib/RateCtrl.h @@ -38,10 +38,7 @@ #ifndef __ENCRATECTRL__ #define __ENCRATECTRL__ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 - #include "../CommonLib/CommonDef.h" -- GitLab