diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 306a35769a5223ec01cc333155fca429c16b68d1..3b5d8e0e89da8060ad4ca733f44d9871ce8c81b9 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1376,8 +1376,7 @@ ivas_error ivas_rend_initCrend( const int32_t output_Fs ) { int16_t i, j, tmp; - int16_t nchan_in; - bool use_brir; + int16_t nchan_in, use_brir; IVAS_REND_AudioConfigType inConfigType; HRTFS_HANDLE hHrtf; ivas_error error; @@ -1403,7 +1402,7 @@ ivas_error ivas_rend_initCrend( } /* set BRIR flag */ - use_brir = false; + use_brir = FALSE; #ifdef FIX_197_CREND_INTERFACE if ( ( ( hRendCfg != NULL ) && hRendCfg->roomAcoustics.use_brir ) || ( ( hRendCfg == NULL ) && ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) ) ) { @@ -1412,7 +1411,7 @@ ivas_error ivas_rend_initCrend( #else if ( ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir ) || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) { - use_brir = true; + use_brir = TRUE; } #endif diff --git a/lib_rend/ivas_ls_custom_dec.c b/lib_rend/ivas_ls_custom_dec.c index f764982a3676c1f537d4290a9de3aa856800d786..0e3a4d980120b7629efdf38d71d6fd14642ffb29 100644 --- a/lib_rend/ivas_ls_custom_dec.c +++ b/lib_rend/ivas_ls_custom_dec.c @@ -92,8 +92,8 @@ void ivas_ls_custom_setup( hOutSetup->num_lfe = hLsSetupCustom->num_lfe; hOutSetup->index_lfe[0] = hLsSetupCustom->lfe_idx[0]; /* IVAS_OUTPUT_SETUP only supports 1 LFE */ - hOutSetup->is_loudspeaker_setup = true; - hOutSetup->is_planar_setup = (uint8_t) hLsSetupCustom->is_planar_setup; + hOutSetup->is_loudspeaker_setup = TRUE; + hOutSetup->is_planar_setup = (int8_t) hLsSetupCustom->is_planar_setup; return; } diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index fc6c3cfecd14358a8734768634ae2f3d8fdd5771..a27fc58f2dfefef6a77c44074ee4c813c19ee262 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -112,7 +112,7 @@ ivas_error ivas_render_config_init_from_rom( #ifdef DEBUGGING ( *hRenderConfig )->renderer_type_override = RENDER_TYPE_OVERRIDE_NONE; #endif - ( *hRenderConfig )->roomAcoustics.override = false; + ( *hRenderConfig )->roomAcoustics.override = FALSE; ( *hRenderConfig )->roomAcoustics.use_brir = room_flag_on; ( *hRenderConfig )->roomAcoustics.late_reverb_on = room_flag_on; ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 6941c3971fbac4475a9d89be5065dbf996c986aa..6defca610ff175237ed13373eb6da227f62829cd 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -52,6 +52,8 @@ #define CLDFB_CONVOLVER_NTAPS_MAX ( 16 ) #define FFT_SPECTRUM_SIZE ( 1 + ( RV_FILTER_MAX_FFT_SIZE / 2 ) ) +#define N_INITIAL_IGNORED_FRAMES 4 +#define NUM_CLDFB_TAPES 7 /*-----------------------------------------------------------------------------------------* * Local function prototypes @@ -204,11 +206,7 @@ static void get_IR_from_filter_taps( float *pOut_l, float *pOut_r ) { - const int16_t n_initial_ignored_frames = 4; - const int16_t num_cldfb_taps = 7; - int16_t i, j, band_idx, block_idx, block_len, block_count, input_sample_idx, output_sample_idx, array_idx; - int16_t is_ambisonics; HANDLE_CLDFB_FILTER_BANK handle_cldfb_analysis, handle_cldfb_synthesis_l, handle_cldfb_synthesis_r; cldfb_convolver_state convolver_state; float real_buffer_in[CLDFB_NO_CHANNELS_MAX]; @@ -217,17 +215,8 @@ static void get_IR_from_filter_taps( float out_CLDFB_imag[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* o : imag part of Binaural signals */ float dirac_pls[CLDFB_NO_CHANNELS_MAX + 1]; - if ( ( input_audio_config == AUDIO_CONFIG_FOA ) || ( input_audio_config == AUDIO_CONFIG_HOA2 ) || ( input_audio_config == AUDIO_CONFIG_HOA3 ) ) - { - is_ambisonics = true; - } - else - { - is_ambisonics = false; - } - block_len = (int16_t) ( sampling_rate * INV_CLDFB_BANDWIDTH ); - block_count = n_initial_ignored_frames + ( pulse_length / block_len ); + block_count = N_INITIAL_IGNORED_FRAMES + ( pulse_length / block_len ); set_f( dirac_pls, 0, block_len + 1 ); dirac_pls[0] = 1.0f; @@ -235,7 +224,7 @@ static void get_IR_from_filter_taps( output_sample_idx = 0; /* Assign CLDFB taps */ - if ( is_ambisonics ) + if ( input_audio_config == AUDIO_CONFIG_FOA || input_audio_config == AUDIO_CONFIG_HOA2 || input_audio_config == AUDIO_CONFIG_HOA3 ) { for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) { @@ -323,7 +312,7 @@ static void get_IR_from_filter_taps( } } - ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, num_cldfb_taps ); + ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, NUM_CLDFB_TAPES ); ppRealBuf[0] = out_CLDFB_real[0]; ppImagBuf[0] = out_CLDFB_imag[0]; @@ -338,7 +327,7 @@ static void get_IR_from_filter_taps( input_sample_idx = 1; } - if ( block_idx >= n_initial_ignored_frames ) + if ( block_idx >= N_INITIAL_IGNORED_FRAMES ) { output_sample_idx += block_len; } diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index a9c85e0546bbe11963c880c21174a3ef23d92124..1a0b4f39b3a7ca229ff753fbce9a1d8fe4c26fe8 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -90,17 +90,17 @@ static int16_t read_bool( if ( sscanf( pLine, "%s", (char *) &value ) != 1 ) { - return true; + return TRUE; } if ( strcmp( value, "TRUE" ) == 0 ) { - *pTarget = true; - return false; + *pTarget = TRUE; + return FALSE; } if ( strcmp( value, "FALSE" ) == 0 ) { - *pTarget = false; - return false; + *pTarget = FALSE; + return FALSE; } return true; @@ -418,7 +418,7 @@ ivas_error RenderConfigReader_read( pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { - hRenderConfig->room_acoustics.override = true; + hRenderConfig->room_acoustics.override = TRUE; params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); #ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue );