From edf476fff3eb125579b60f4374ff4f3cad5278f5 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 15 Nov 2022 09:00:54 +0100 Subject: [PATCH 1/4] fix MSVC compilation warnings --- apps/renderer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 0d46dd05f4..cee003f972 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -485,7 +485,7 @@ static int16_t getTotalNumInChannels( } #ifdef NOKIA_MASA_EXTERNAL_RENDERER - for ( int32_t i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) + for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { if ( masaIds[i] == 0 ) { @@ -983,13 +983,12 @@ int main( #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { - int16_t numChannels; if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, masaIds[i], &numChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, args.inConfig.masaBuses[i].inputChannelIndex, numChannels ); + IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.masaBuses[i].inputChannelIndex, numChannels ); if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, masaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) { @@ -1390,7 +1389,7 @@ static IVAS_REND_AudioConfig parseAudioConfig( case '1': fprintf( stderr, "1TC MASA support is not functional and is pending on DirAC renderer refactoring.\n" ); exit( EXIT_FAILURE ); - return IVAS_REND_AUDIO_CONFIG_MASA1; + /*return IVAS_REND_AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings case '2': return IVAS_REND_AUDIO_CONFIG_MASA2; default: -- GitLab From 8b927983c01e17aa2fd75a97defd7a1d0444f4d3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 21 Nov 2022 15:06:00 +0100 Subject: [PATCH 2/4] - fix Issue 127: fix BER detected in ISM4 due to desynchronized 'GSC_IVAS_mode' parameter; under FIX_I217_GSC_FLAG_IN_ISM - + remove unnecessary assignments --- lib_com/options.h | 2 +- lib_dec/ivas_stereo_td_low_rate_dec.c | 20 +++++++------------- lib_enc/gs_enc.c | 1 - lib_enc/ivas_stereo_td_low_rate_enc.c | 25 +++++++++++++------------ 4 files changed, 21 insertions(+), 27 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a9fcac0178..1f7dd80611 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,7 @@ #define FIX_MCT_UNINIT_MEM /* Issue 166: Reading of uninitialized memory in TCX range coder */ #define FIX_IGF_NOISE_REPETITION /* Issue 182: fix repetition of same noise in IGF */ #define FIX_126_MDFT_FB_STATIC_MEM /* Issue 126: reduce static mem consumption of the MDFT FB for non-SBA formats */ - +#define FIX_I217_GSC_FLAG_IN_ISM /* Issue 127: fix BER detected in ISM4 due to desynchronized 'GSC_IVAS_mode' parameter */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_stereo_td_low_rate_dec.c b/lib_dec/ivas_stereo_td_low_rate_dec.c index 8a0757cd5e..0e1c34db1d 100644 --- a/lib_dec/ivas_stereo_td_low_rate_dec.c +++ b/lib_dec/ivas_stereo_td_low_rate_dec.c @@ -67,7 +67,6 @@ void tdm_low_rate_dec( int16_t Diff_len, nb_subfr; int16_t attack_flag; int16_t last_bin; - int16_t m_coder_type; float exc_wo_nf[L_FRAME]; hGSCDec = st->hGSCDec; @@ -76,26 +75,21 @@ void tdm_low_rate_dec( * Initialization *---------------------------------------------------------------*/ - m_coder_type = st->coder_type; - - Diff_len = 0; - - pit_band_idx = 10 + BAND1k2; nb_subfr = 2; - hGSCDec->Last_GSC_pit_band_idx = pit_band_idx; - +#ifdef FIX_I217_GSC_FLAG_IN_ISM + st->GSC_IVAS_mode = 0; +#endif st->GSC_noisy_speech = 1; hGSCDec->noise_lev = 14; - /*---------------------------------------------------------------* - * DCT transform - *---------------------------------------------------------------*/ + pit_band_idx = 10 + BAND1k2; + hGSCDec->Last_GSC_pit_band_idx = pit_band_idx; st->tilt_code = 0.0f; set_f( exc, 0, L_FRAME ); set_f( dct_epit, 0, L_FRAME ); - set_f( pitch_buf, 64, 4 ); + set_f( pitch_buf, L_SUBFR, NB_SUBFR ); st->bpf_off = 1; st->bfi_pitch = (int16_t) ( mean( pitch_buf, 4 ) + 0.5f ); @@ -127,7 +121,7 @@ void tdm_low_rate_dec( tmp_nb_bits_tot--; } - gsc_dec( st, dct_epit, pit_band_idx, Diff_len, tmp_nb_bits_tot, nb_subfr, m_coder_type, &last_bin, lsf_new, exc_wo_nf, tmp_noise ); + gsc_dec( st, dct_epit, pit_band_idx, Diff_len, tmp_nb_bits_tot, nb_subfr, st->coder_type, &last_bin, lsf_new, exc_wo_nf, tmp_noise ); /*--------------------------------------------------------------------------------------* * iDCT transform diff --git a/lib_enc/gs_enc.c b/lib_enc/gs_enc.c index cfee14b2ca..bd8897e554 100644 --- a/lib_enc/gs_enc.c +++ b/lib_enc/gs_enc.c @@ -97,7 +97,6 @@ void encod_audio( hGSCEnc = st->hGSCEnc; m_mean = 0.0f; - tmp_nb_bits_tot = 0; T0_tmp = 64; T0_frac_tmp = 0; diff --git a/lib_enc/ivas_stereo_td_low_rate_enc.c b/lib_enc/ivas_stereo_td_low_rate_enc.c index 92abf45e9a..563e1d1b39 100644 --- a/lib_enc/ivas_stereo_td_low_rate_enc.c +++ b/lib_enc/ivas_stereo_td_low_rate_enc.c @@ -72,28 +72,29 @@ void tdm_low_rate_enc( float exc_wo_nf[L_FRAME]; LPD_state_HANDLE hLPDmem = st->hLPDmem; - tmp_nb_bits_tot = 0; - /*---------------------------------------------------------------* - * DCT transform of the residual and create a subsample residual + * Initialization *---------------------------------------------------------------*/ - edct( res, dct_res, L_FRAME, st->element_mode ); - nb_subfr = 2; - /*---------------------------------------------------------------* - * Compute time domain excitation contribution in the subsample domain - *---------------------------------------------------------------*/ +#ifdef FIX_I217_GSC_FLAG_IN_ISM + st->GSC_IVAS_mode = 0; +#endif + st->GSC_noisy_speech = 1; + st->hGSCEnc->noise_lev = 14; hLPDmem->tilt_code = 0.0f; - - st->GSC_noisy_speech = 1; set_f( dct_epit, 0, L_FRAME ); - set_f( pitch_buf, 64, NB_SUBFR ); - st->hGSCEnc->noise_lev = 14; + set_f( pitch_buf, L_SUBFR, NB_SUBFR ); last_pit_bin = L_FRAME / 2; + /*---------------------------------------------------------------* + * DCT transform of the residual and create a subsample residual + *---------------------------------------------------------------*/ + + edct( res, dct_res, L_FRAME, st->element_mode ); + /*--------------------------------------------------------------------------------------* * GSC encoder *--------------------------------------------------------------------------------------*/ -- GitLab From 95aee2b01936871cc47ebdf0043e9de33747bcb3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 21 Nov 2022 15:17:45 +0100 Subject: [PATCH 3/4] rename two source files --- Workspace_msvc/lib_dec.vcxproj | 2 +- Workspace_msvc/lib_dec.vcxproj.filters | 12 +++--------- Workspace_msvc/lib_enc.vcxproj | 4 ++-- Workspace_msvc/lib_enc.vcxproj.filters | 6 +++--- ...ereo_td_low_rate_dec.c => ivas_td_low_rate_dec.c} | 0 ...ereo_td_low_rate_enc.c => ivas_td_low_rate_enc.c} | 0 6 files changed, 9 insertions(+), 15 deletions(-) rename lib_dec/{ivas_stereo_td_low_rate_dec.c => ivas_td_low_rate_dec.c} (100%) rename lib_enc/{ivas_stereo_td_low_rate_enc.c => ivas_td_low_rate_enc.c} (100%) diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index 1d7e5cd133..ad725ce034 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -314,10 +314,10 @@ - + diff --git a/Workspace_msvc/lib_dec.vcxproj.filters b/Workspace_msvc/lib_dec.vcxproj.filters index ffc999a2f1..5b52aabb77 100644 --- a/Workspace_msvc/lib_dec.vcxproj.filters +++ b/Workspace_msvc/lib_dec.vcxproj.filters @@ -466,9 +466,6 @@ dec_ivas_c - - dec_ivas_c - dec_ivas_c @@ -476,15 +473,9 @@ dec_ivas_c - - dec_ivas_c - dec_ivas_c - - dec_ivas_c - dec_ivas_c @@ -506,6 +497,9 @@ dec_ivas_c + + dec_ivas_c + diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index 3d46808cf3..a2d1e13ae7 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -330,8 +330,8 @@ - + @@ -423,4 +423,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_enc.vcxproj.filters b/Workspace_msvc/lib_enc.vcxproj.filters index 1d7ee5594f..8fe608e0a6 100644 --- a/Workspace_msvc/lib_enc.vcxproj.filters +++ b/Workspace_msvc/lib_enc.vcxproj.filters @@ -550,9 +550,6 @@ enc_ivas_c - - enc_ivas_c - enc_ivas_c @@ -584,6 +581,9 @@ enc_ivas_c + + enc_ivas_c + diff --git a/lib_dec/ivas_stereo_td_low_rate_dec.c b/lib_dec/ivas_td_low_rate_dec.c similarity index 100% rename from lib_dec/ivas_stereo_td_low_rate_dec.c rename to lib_dec/ivas_td_low_rate_dec.c diff --git a/lib_enc/ivas_stereo_td_low_rate_enc.c b/lib_enc/ivas_td_low_rate_enc.c similarity index 100% rename from lib_enc/ivas_stereo_td_low_rate_enc.c rename to lib_enc/ivas_td_low_rate_enc.c -- GitLab From 752203b623067d4bcb7c4d364c5c39b5185d2420 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 22 Nov 2022 07:18:50 +0000 Subject: [PATCH 4/4] fix typo in comment --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5e51b257c9..4e0d5ba58f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,7 @@ #define FIX_126_MDFT_FB_STATIC_MEM /* Issue 126: reduce static mem consumption of the MDFT FB for non-SBA formats */ #define FIX_I214_CLIPPING_STANDALONE_REND /* Issue 214: TD standalone renderer does not handle clipping */ #define FIX_I218_PARAMISM_NOISY_SPEECH /* Issue 218: Fix noisy speech buffer in ParamISM */ -#define FIX_I217_GSC_FLAG_IN_ISM /* Issue 127: fix BER detected in ISM4 due to desynchronized 'GSC_IVAS_mode' parameter */ +#define FIX_I217_GSC_FLAG_IN_ISM /* Issue 217: fix BER detected in ISM4 due to desynchronized 'GSC_IVAS_mode' parameter */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab