diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 2cbafe556ef21691bcb6fdf5a7afc14cb24891c8..fdce40a52b0f364cce33db557f1fbc6f4b288d85 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -942,7 +942,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("UseNonLinearAlfChroma", m_useNonLinearAlfChroma, true, "Non-linear adaptive loop filters for Chroma Channels") #if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB ("MaxNumAlfAlternativesChroma", m_maxNumAlfAlternativesChroma, - (unsigned)MAX_NUM_ALF_ALTERNATIVES_CHROMA, "Maximum number of alternative Chroma filters (1-" MACRO_TO_STRING(MAX_NUM_ALF_ALTERNATIVES_CHROMA) ", inclusive)") + (unsigned)MAX_NUM_ALF_ALTERNATIVES_CHROMA, std::string("Maximum number of alternative Chroma filters (1-") + std::to_string(MAX_NUM_ALF_ALTERNATIVES_CHROMA) + std::string (", inclusive)") ) #endif ("MIP", m_MIP, true, "Enable MIP (matrix-based intra prediction)") ("FastMIP", m_useFastMIP, false, "Fast encoder search for MIP (matrix-based intra prediction)") @@ -1958,7 +1958,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) #if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB if ( m_alf ) { - CHECK( m_maxNumAlfAlternativesChroma < 1 || m_maxNumAlfAlternativesChroma > MAX_NUM_ALF_ALTERNATIVES_CHROMA, "The maximum number of ALF Chroma filter alternatives must be in the range (1-" MACRO_TO_STRING(MAX_NUM_ALF_ALTERNATIVES_CHROMA) ", inclusive)" ); + CHECK( m_maxNumAlfAlternativesChroma < 1 || m_maxNumAlfAlternativesChroma > MAX_NUM_ALF_ALTERNATIVES_CHROMA, std::string("The maximum number of ALF Chroma filter alternatives must be in the range (1-") + std::to_string(MAX_NUM_ALF_ALTERNATIVES_CHROMA) + std::string (", inclusive)") ); } #endif diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 8588f7a2dd09a4da342d67d1afc306f82c01ed72..1f7817faba04d938648ef2a3b1bfcc22b16dc1b5 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -860,11 +860,11 @@ void HLSyntaxReader::parseAlfAps( APS* aps ) if (param.newFilterFlag[CHANNEL_TYPE_CHROMA]) { #if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB -#if MAX_NUM_ALF_ALTERNATIVES_CHROMA > 1 - READ_UVLC( code, "alf_chroma_num_alts_minus1" ); -#else - code = 0; -#endif + if( MAX_NUM_ALF_ALTERNATIVES_CHROMA > 1 ) + READ_UVLC( code, "alf_chroma_num_alts_minus1" ); + else + code = 0; + param.numAlternativesChroma = code + 1; for( int altIdx=0; altIdx < param.numAlternativesChroma; ++altIdx ) diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 2477edcbcd2adfaffbf40f1cf8cb9be91b32bcf8..90f7a64f4bd26655c48861991b1521d5560b0877 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -536,9 +536,8 @@ void HLSWriter::codeAlfAps( APS* pcAPS ) if (param.newFilterFlag[CHANNEL_TYPE_CHROMA]) { #if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB -#if MAX_NUM_ALF_ALTERNATIVES_CHROMA > 1 - WRITE_UVLC( param.numAlternativesChroma - 1, "alf_chroma_num_alts_minus1" ); -#endif + if( MAX_NUM_ALF_ALTERNATIVES_CHROMA > 1 ) + WRITE_UVLC( param.numAlternativesChroma - 1, "alf_chroma_num_alts_minus1" ); for( int altIdx=0; altIdx < param.numAlternativesChroma; ++altIdx ) { WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_CHROMA][altIdx], "alf_nonlinear_enable_flag_chroma" );