From 27c90944c6e0d6fe942a29276196fb3074fa461f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 18 Oct 2024 16:55:15 +0200 Subject: [PATCH 1/3] [cleanup] accept FIX_1158_FASTCONV_REVERB_HRTF --- apps/decoder.c | 23 ----------------------- lib_com/options.h | 1 - lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 28 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 681939cde2..79355ee179 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -408,27 +408,6 @@ int main( } } -#ifndef FIX_1158_FASTCONV_REVERB_HRTF - /*------------------------------------------------------------------------------------------* - * Open renderer configuration reader file - *------------------------------------------------------------------------------------------*/ - - if ( arg.renderConfigEnabled ) - { - /* sanity check */ - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false ) - { - fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); - goto cleanup; - } - - if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); - goto cleanup; - } - } -#endif /*------------------------------------------------------------------------------------------* * Configure the decoder @@ -624,13 +603,11 @@ int main( goto cleanup; } -#ifdef FIX_1158_FASTCONV_REVERB_HRTF if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); goto cleanup; } -#endif if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { diff --git a/lib_com/options.h b/lib_com/options.h index 30200d09d1..cd55b50ee5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,7 +169,6 @@ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ #define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index a3e62b9702..11e23d0b7b 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -141,11 +141,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef FIX_1158_FASTCONV_REVERB_HRTF if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } -- GitLab From 103a3ae8345dbc87a5dd9dd784fdf462504822f1 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 18 Oct 2024 16:56:54 +0200 Subject: [PATCH 2/3] [cleanup] accept FIX_VOIP_FUNCTIONS --- apps/decoder.c | 4 ---- lib_com/options.h | 1 - lib_dec/lib_dec.c | 58 ----------------------------------------------- lib_dec/lib_dec.h | 4 ---- 4 files changed, 67 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 79355ee179..7c28adcfce 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -570,15 +570,11 @@ int main( } } #else -#ifdef FIX_VOIP_FUNCTIONS if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#else - IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ); -#endif #endif /*-------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index cd55b50ee5..94825bdabc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,7 +170,6 @@ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ -#define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a67b3bc9a3..00a81cb14d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -444,9 +444,6 @@ ivas_error IVAS_DEC_Configure( DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifndef FIX_VOIP_FUNCTIONS - error = IVAS_ERR_OK; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -549,11 +546,7 @@ ivas_error IVAS_DEC_Configure( } #endif -#ifdef FIX_VOIP_FUNCTIONS return IVAS_ERR_OK; -#else - return error; -#endif } @@ -749,9 +742,6 @@ ivas_error IVAS_DEC_EnableVoIP( { DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifndef FIX_VOIP_FUNCTIONS - error = IVAS_ERR_OK; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -819,11 +809,7 @@ ivas_error IVAS_DEC_EnableVoIP( } #endif -#ifdef FIX_VOIP_FUNCTIONS return IVAS_ERR_OK; -#else - return error; -#endif } @@ -1679,13 +1665,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( int16_t ro_md_flag; IVAS_QUATERNION Quaternion; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif error = IVAS_ERR_OK; st_ivas = hIvasDec->st_ivas; output_config = st_ivas->hDecoderConfig->output_config; @@ -2129,13 +2113,11 @@ ivas_error IVAS_DEC_GetFormat( IVAS_DEC_BS_FORMAT *format /* o : format detected from bitstream fed to the decoder */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->hasDecodedFirstGoodFrame ) { *format = mapIvasFormat( hIvasDec->st_ivas->ivas_format ); @@ -2229,13 +2211,11 @@ ivas_error IVAS_DEC_GetNumOutputChannels( int16_t *numOutputChannels /* o : number of PCM output channels */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->hasDecodedFirstGoodFrame ) { *numOutputChannels = hIvasDec->st_ivas->hDecoderConfig->nchan_out; @@ -3113,13 +3093,11 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( int16_t partialCopyFrameType, partialCopyOffset; int16_t result; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL || au == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( auSize == 0 ) { return IVAS_ERR_OK; /* ignore empty/NO_DATA frame - shouldn't be transmitted in RTP */ @@ -3198,22 +3176,12 @@ ivas_error IVAS_DEC_VoIP_SetScale( const int16_t scale /* i : TSM scale to set in percent of the default frame size */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#else - ivas_error error; - - error = IVAS_ERR_OK; -#endif -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm == 0 ) -#else - if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm == false ) -#endif { return IVAS_ERR_TSM_NOT_ENABLED; } @@ -3223,11 +3191,7 @@ ivas_error IVAS_DEC_VoIP_SetScale( hIvasDec->tsm_max_scaling = maxScaling; } -#ifdef FIX_VOIP_FUNCTIONS return IVAS_ERR_OK; -#else - return error; -#endif } @@ -3251,13 +3215,11 @@ ivas_error IVAS_DEC_TSM_SetQuality( const float quality /* i : target TSM quality */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( !hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { return IVAS_ERR_TSM_NOT_ENABLED; @@ -3308,13 +3270,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif uint8_t nOutChannels; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->hVoIP == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; @@ -3585,13 +3545,11 @@ ivas_error IVAS_DEC_Flush( uint16_t nSamplesToRender; uint16_t nSamplesFlushedLocal; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); nSamplesToRender = (uint16_t) *nSamplesFlushed; @@ -3620,13 +3578,11 @@ bool IVAS_DEC_VoIP_IsEmpty( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesAsked ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->nSamplesAvailableNext < nSamplesAsked ) ); } @@ -3733,11 +3689,7 @@ ivas_error IVAS_DEC_GetJbmData( ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL || JbmTraceData == NULL ) -#else - if ( hIvasDec->hVoIP == NULL ) -#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -4049,29 +4001,19 @@ static ivas_error printConfigInfo_dec( * Print decoder set-up info *---------------------------------------------------------------------*/ -#ifdef FIX_VOIP_FUNCTIONS ivas_error IVAS_DEC_PrintConfig( -#else -void IVAS_DEC_PrintConfig( -#endif const IVAS_DEC_HANDLE hIvasDec, const bool quietModeEnabled, const bool voipMode ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif printConfigInfo_dec( hIvasDec->st_ivas, hIvasDec->bitstreamformat, voipMode, quietModeEnabled ); -#ifdef FIX_VOIP_FUNCTIONS return IVAS_ERR_OK; -#else - return; -#endif } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 50476c964b..ce6eff71a3 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -513,11 +513,7 @@ const char *IVAS_DEC_GetErrorMessage( ivas_error error /* i : decoder error code enum */ ); -#ifdef FIX_VOIP_FUNCTIONS ivas_error IVAS_DEC_PrintConfig( -#else -void IVAS_DEC_PrintConfig( -#endif const IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ const bool quietModeEnabled, /* i : quiet mode flag: if true, reduces the amount of config info printed */ const bool voipMode -- GitLab From 67e7fa30f489f281a5a2569b4271fad60abbeb52 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 18 Oct 2024 16:57:42 +0200 Subject: [PATCH 3/3] [cleanup] accept NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR --- lib_com/options.h | 1 - lib_enc/ivas_masa_enc.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 94825bdabc..e4c1c04bdb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ -#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_FIX_1197_OMASA_META_BUFFER /* Nokia: OMASA ISM_MASA_MODE_PARAM_ONE_OBJ history zero in rateswitching */ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index fcaad77e88..47571ae858 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1765,14 +1765,7 @@ static void reduce_metadata_further( /* Copy spread coherence to the rest of subframes for the coherence coding algorithm. */ for ( sf = 1; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { -#ifdef NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[0]; -#else - for ( band = 0; band < numCodingBands; band++ ) - { - hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[0]; - } -#endif } /* Surround coherence is already merged through time */ -- GitLab