diff --git a/cfg/per-class/classH1.cfg b/cfg/per-class/classH1.cfg index 8cf2b43f74ba8a85a2d2b8e71c06aebf7b4ed2d9..100f03dd5357de90d95b43254ee476ce1f9aef45 100644 --- a/cfg/per-class/classH1.cfg +++ b/cfg/per-class/classH1.cfg @@ -19,4 +19,7 @@ SameCQPTablesForAllChroma : 1 QpInValCb : 10 23 32 42 QpOutValCb : 10 24 32 37 -CclmCollocatedChroma : 1 \ No newline at end of file +CclmCollocatedChroma : 1 + +#======== HDR Metrics ============ +CalculateHdrMetrics : 1 # Calculate HDR metrics for Class H1 (PQ) content \ No newline at end of file diff --git a/cfg/per-sequence-HDR/H1_ShowGirl.cfg b/cfg/per-sequence-HDR/H1_ShowGirl.cfg index 1f7c5222ab4ea3adc9e382aacd597b77cef51561..cdda6c4c10d5f80c7a26e3c8d425a7d3cb0aeb79 100644 --- a/cfg/per-sequence-HDR/H1_ShowGirl.cfg +++ b/cfg/per-sequence-HDR/H1_ShowGirl.cfg @@ -12,4 +12,10 @@ Level : 4.1 #======== Chroma QP scale ============= WCGPPSCbQpScale : 1.04 # Scale factor depending on capture and representation color space -WCGPPSCrQpScale : 1.39 # Scale factor depending on capture and representation color space +WCGPPSCrQpScale : 1.39 # Scale factor depending on capture and representation color space + +#======== HDR Metrics ============ +CropOffsetLeft : 10 +CropOffsetTop : 10 +CropOffsetRight : -10 +CropOffsetBottom : -10 diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 7cd4eb6833dfac6655e8a530e028f52a107797c7..9383c53925ec0a425f10220dc695c28d6da2776d 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -838,7 +838,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("SummaryVerboseness", m_summaryVerboseness, 0u, "Specifies the level of the verboseness of the text output") ("Verbosity,v", m_verbosity, (int)VERBOSE, "Specifies the level of the verboseness") -#if JVET_O0756_CALCULATE_HDRMETRICS +#if JVET_O0756_CONFIG_HDRMETRICS || JVET_O0756_CALCULATE_HDRMETRICS ( "WhitePointDeltaE1", m_whitePointDeltaE[0], 100.0, "1st reference white point value") ( "WhitePointDeltaE2", m_whitePointDeltaE[1], 1000.0, "2nd reference white point value") ( "WhitePointDeltaE3", m_whitePointDeltaE[2], 5000.0, "3rd reference white point value") @@ -2034,6 +2034,14 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) } #endif +#if JVET_O0756_CONFIG_HDRMETRICS && !JVET_O0756_CALCULATE_HDRMETRICS + if ( m_calculateHdrMetrics == true) + { + printf ("Warning: Configuration enables HDR metric calculations. However, HDR metric support was not linked when compiling the VTM.\n"); + m_calculateHdrMetrics = false; + } +#endif + if ( m_loopFilterAcrossVirtualBoundariesDisabledFlag ) { CHECK( m_numVerVirtualBoundaries > 3, "Number of vertical virtual boundaries must be comprised between 0 and 3 included" ); diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index bafa421503205c5b1a49d4a00b438c34b0fee637..16d0993ce049104fdece32b202f8f273edc1794b 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -610,8 +610,12 @@ protected: friend class TExt360AppEncTop; #endif +#if JVET_O0756_CONFIG_HDRMETRICS || JVET_O0756_CALCULATE_HDRMETRICS #if JVET_O0756_CALCULATE_HDRMETRICS double m_whitePointDeltaE[hdrtoolslib::NB_REF_WHITE]; +#else + double m_whitePointDeltaE[3]; +#endif double m_maxSampleValue; int m_sampleRange; int m_colorPrimaries; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 413f61cc817b87e8fe55b01832d2bd36ec4716cf..6a791b08a751b2bffa3571a7fc74e0a0dc59312e 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -283,6 +283,7 @@ typedef std::pair<int, int> TrCost; #define EXTENSION_HDRTOOLS 0 //< extension for HDRTools/Metrics support; this macro should be controlled by makefile, as it would be used to control whether the library is built and linked #endif +#define JVET_O0756_CONFIG_HDRMETRICS 1 #if EXTENSION_HDRTOOLS #define JVET_O0756_CALCULATE_HDRMETRICS 1 #endif