From de01c2b3db889cb9a0b069cd565d7bee66bf7bfc Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 25 Mar 2025 12:35:08 +0100 Subject: [PATCH 1/5] port 1202 to basop --- lib_com/ivas_prot.h | 7 +++++++ lib_com/ivas_tools.c | 22 ++++++++++++++++++++++ lib_com/options.h | 2 +- lib_rend/ivas_crend.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 217d3cb6c..d1e720b8f 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2958,6 +2958,13 @@ int16_t check_bounds_s( const int16_t high /* i : High limit */ ); +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +void set_zero_l( + float *vec, /* o : input vector */ + const uint32_t lvec /* i : length of the vector */ +); +#endif + ivas_error stereo_memory_enc( CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const int32_t input_Fs, /* i : input sampling rate */ diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index c2183e0e0..8d31bd7da 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -581,6 +581,28 @@ int16_t check_bounds_s( return value_adj; } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +/*---------------------------------------------------------------------* + * set_zero_l() + * + * Set a vector vec[] of dimension lvec to zero + *---------------------------------------------------------------------*/ + +void set_zero_l( + float *vec, /* i/o: input/output vector */ + const uint32_t lvec /* i : length of the vector */ +) +{ + uint32_t i; + + for ( i = 0; i < lvec; i++ ) + { + *vec++ = 0.0f; + } + + return; +} +#endif /****************************************************************************/ /* matrix functions */ diff --git a/lib_com/options.h b/lib_com/options.h index ee26612db..82e453de4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,7 +183,7 @@ #define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ #define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ #define NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH /* FhG: issue 708: fix crash in OSBA BR switching with long test vectors */ - +#define FIX_1440_PORT_1202_FROM_FLT_REPO /* Orange : Fix crash when long BRIR is set */ #define NONBE_1319_M2R_PRECISION_ALIGN /* Nokia: bring updates from PC code related to OMASA masa2total ratios */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 06e91135c..f966fa991 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1249,7 +1249,11 @@ ivas_error ivas_rend_openCrend( ) { int16_t i, subframe_length; +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + int32_t max_total_ir_len; +#else int16_t max_total_ir_len; +#endif HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; @@ -1299,13 +1303,21 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + set_zero_l( hCrend->freq_buffer_re[i], max_total_ir_len ); +#else set_zero( hCrend->freq_buffer_re[i], max_total_ir_len ); +#endif if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + set_zero_l( hCrend->freq_buffer_im[i], max_total_ir_len ); +#else set_zero( hCrend->freq_buffer_im[i], max_total_ir_len ); +#endif } for ( i = 0; i < BINAURAL_CHANNELS; i++ ) @@ -1314,7 +1326,11 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + set_zero_l( hCrend->prev_out_buffer[i], subframe_length ); +#else set_zero( hCrend->prev_out_buffer[i], subframe_length ); +#endif } max_total_ir_len = hHrtf->num_iterations_diffuse[0] * subframe_length; @@ -1325,13 +1341,21 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); +#else set_zero( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); +#endif if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); +#else set_zero( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); +#endif } else { @@ -1346,7 +1370,11 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + set_zero_l( hCrend->lfe_delay_line, max_total_ir_len ); +#else set_zero( hCrend->lfe_delay_line, max_total_ir_len ); +#endif } else { @@ -1589,7 +1617,11 @@ static ivas_error ivas_rend_crendConvolver( int16_t i, j, k, m; int16_t subframe_length, idx_in; int16_t lfe_idx_in; +#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO + int32_t offset, offset_in, offset_diffuse; +#else int16_t offset, offset_in, offset_diffuse; +#endif int16_t nchan_in, nchan_out; const float *pIn; float *pFreq_buf_re, *pFreq_buf_im; -- GitLab From 5ada5d521df3360eabdf9c4fbecd2934704511d8 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Mon, 31 Mar 2025 12:12:06 +0200 Subject: [PATCH 2/5] merge with float_pc --- CMakeLists.txt | 4 ++-- lib_com/ivas_dirac_com.c | 40 +++++++++++++++++++++++++++++++------- lib_com/ivas_prot.h | 13 +++++++++++++ lib_com/options.h | 1 + lib_dec/ivas_dirac_dec.c | 8 ++++++++ lib_dec/ivas_init_dec.c | 11 +++++++++++ lib_dec/ivas_sba_dec.c | 6 ++++++ lib_enc/ivas_spar_md_enc.c | 30 ++++++++++++++++++++++++++++ 8 files changed, 104 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e2d69728..1b418d621 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ # cmake --build . --config Release -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.10) set(CMAKE_C_STANDARD 99) @@ -121,7 +121,7 @@ if(WMOPS) add_definitions("-DWMOPS=1") endif() -project(stereo-evs) +project(stereo-evs LANGUAGES C) set_property(GLOBAL PROPERTY USE_FOLDERS ON) # make Visual Studio projects look nicer include(CTest) diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index cc0b2de7b..b83057ede 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -195,11 +195,19 @@ ivas_error ivas_dirac_config( if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) { +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft, 1 ); +#else ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft ); +#endif } else { +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( band_grouping, hConfig->nbands, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft, 1 ); +#else ivas_dirac_config_bands( band_grouping, hConfig->nbands, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft ); +#endif } return error; @@ -207,11 +215,22 @@ ivas_error ivas_dirac_config( /*------------------------------------------------------------------------- - * ivas_dirac_sba_config_bands() + * ivas_dirac_config_bands() * * DirAC Configuration freq. band function; used also in MASA decoder *------------------------------------------------------------------------*/ +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING +void ivas_dirac_config_bands( + int16_t *band_grouping, /* o : band grouping */ + const int16_t nbands, /* i : number of bands */ + const int16_t max_band, /* i : maximal band index +1 */ + int16_t *dirac_to_spar_md_bands, + const int8_t useLowerBandRes, + const int16_t enc_param_start_band, + IVAS_FB_MIXER_HANDLE hFbMdft, + const int8_t BandGroupLowRes ) +#else void ivas_dirac_config_bands( int16_t *band_grouping, /* o : band grouping */ const int16_t nbands, /* i : number of bands */ @@ -220,6 +239,7 @@ void ivas_dirac_config_bands( const int8_t useLowerBandRes, const int16_t enc_param_start_band, IVAS_FB_MIXER_HANDLE hFbMdft ) +#endif { int16_t i; { @@ -270,14 +290,20 @@ void ivas_dirac_config_bands( { int16_t step = DIRAC_LOW_BANDRES_STEP; int16_t reduced_band; - for ( band = enc_param_start_band + 2, reduced_band = enc_param_start_band + 1; band <= DIRAC_MAX_NBANDS; band += step, reduced_band++ ) +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + if ( BandGroupLowRes ) +#endif { - band_grouping[reduced_band] = band_grouping[band]; - } - for ( ; reduced_band <= DIRAC_MAX_NBANDS; reduced_band++ ) - { - band_grouping[reduced_band] = max_band; + for ( band = enc_param_start_band + 2, reduced_band = enc_param_start_band + 1; band <= DIRAC_MAX_NBANDS; band += step, reduced_band++ ) + { + band_grouping[reduced_band] = band_grouping[band]; + } + for ( ; reduced_band <= DIRAC_MAX_NBANDS; reduced_band++ ) + { + band_grouping[reduced_band] = max_band; + } } + for ( band = enc_param_start_band + ( DIRAC_MAX_NBANDS - enc_param_start_band ) / 2 - 1, reduced_band = DIRAC_MAX_NBANDS - 1; band >= enc_param_start_band; band--, reduced_band -= step ) { dirac_to_spar_md_bands[reduced_band] = dirac_to_spar_md_bands[band]; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d1e720b8f..d44cafabe 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3669,6 +3669,18 @@ ivas_error ivas_dirac_config( const int16_t enc_dec /* i : encoder or decoder flag */ ); +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING +void ivas_dirac_config_bands( + int16_t *band_grouping, /* o : band grouping */ + const int16_t nbands, /* i : number of bands */ + const int16_t max_band, /* i : maximal band index +1 */ + int16_t *dirac_to_spar_md_bands, /* o : mapping of DirAC parameter band index to SPAR FB band index */ + const int8_t useLowerBandRes, /* i : flag indicating lower band resolution for DirAC */ + const int16_t enc_param_start_band, /* i : band index of first DirAC parameter band */ + IVAS_FB_MIXER_HANDLE hFbMdft, /* i : MDFT filterbank handle */ + const int8_t BandGroupLowRes /* i : flag indicating lower band grouping resolution for DirAC */ +); +#else void ivas_dirac_config_bands( int16_t *band_grouping, /* o : band grouping */ const int16_t nbands, /* i : number of bands */ @@ -3678,6 +3690,7 @@ void ivas_dirac_config_bands( const int16_t enc_param_start_band, /* i : band index of first DirAC parameter band */ IVAS_FB_MIXER_HANDLE hFbMdft ); +#endif void ivas_get_dirac_sba_max_md_bits( const int32_t sba_total_brate, diff --git a/lib_com/options.h b/lib_com/options.h index 82e453de4..b5e8f1ecc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -204,6 +204,7 @@ #define FIX_929_RENDERER_CMDL /* Nokia: issue #929: renderer command line option */ #define NONBE_FIX_BINAURAL_ROOM_IR_REVERBERATOR /* FhG: re-enable acidentially disabled reverberator for BINAURAL_ROOM_IR */ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ +#define NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING /* Dlb: issue 907: fix for band mapping at VLBR */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index c429686f7..da04827de 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1287,7 +1287,11 @@ void ivas_qmetadata_to_dirac( /* SID/zero-frame: 1 direction, 5 bands, nblocks re-generated out of SID decoder*/ start_band = 0; hDirAC->hConfig->nbands = 5; +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, NULL, 0, 0, NULL, 1 ); +#else ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, NULL, 0, 0, NULL ); +#endif nbands = 5; } else @@ -1302,7 +1306,11 @@ void ivas_qmetadata_to_dirac( hDirAC->hConfig->nbands = q_direction->cfg.nbands; } +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hDirAC->hConfig->enc_param_start_band, hDirAC->hFbMdft, 0 ); +#else ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hDirAC->hConfig->enc_param_start_band, hDirAC->hFbMdft ); +#endif nbands = hDirAC->hConfig->nbands; if ( hQMetaData->q_direction[0].cfg.nblocks == 0 ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 839a16a69..e9fd70202 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1356,8 +1356,14 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } + +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), + st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); +#else ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); +#endif } st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); @@ -1510,8 +1516,13 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), + st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); +#else ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); +#endif } for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index da3f566be..4218ff9f0 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -427,8 +427,14 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } + +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), + st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); +#else ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); +#endif if ( st_ivas->hDirAC ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 682c5d52e..be984bb40 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -492,6 +492,9 @@ ivas_error ivas_spar_md_enc_process( int16_t md_indices_allocated; int16_t max_num_indices_tmp; float Wscale[IVAS_MAX_NUM_BANDS]; +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + float P_quant_re_prior[SPAR_DIRAC_SPLIT_START_BAND][FOA_CHANNELS - 1]; +#endif /*extra 16 bits for arithmetic coder as overshoot check is after a symbol is written*/ md_indices_allocated = hMdEnc->spar_md_cfg.max_bits_per_blk + IVAS_SPAR_ARITH_OVERSHOOT_BITS; @@ -588,6 +591,16 @@ ivas_error ivas_spar_md_enc_process( } } +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) + { + for ( b = 0; b < num_bands * bands_bw; b++ ) + { + mvr2r( hMdEnc->spar_md.band_coeffs[b].P_quant_re, P_quant_re_prior[b], FOA_CHANNELS - 1 ); + } + } +#endif + ivas_compute_spar_params( cov_real, dm_fv_re, 0, hMdEnc->mixer_mat, 0, nB, dtx_vad, num_ch, bands_bw, active_w, active_w_vlbr, &hMdEnc->spar_md_cfg, &hMdEnc->spar_md, Wscale, 0, dyn_active_w_flag ); if ( dirac_mono_flag ) @@ -854,6 +867,19 @@ ivas_error ivas_spar_md_enc_process( #endif /* Reuse mixer matrix values for unsent bands */ +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) + { + for ( k = num_bands - 1; k >= 0; k-- ) + { + for ( b = bands_bw - 1; b >= 0; b-- ) + { + mvr2r( hMdEnc->spar_md.band_coeffs[k].P_quant_re, hMdEnc->spar_md.band_coeffs[bands_bw * k + b].P_quant_re, FOA_CHANNELS - 1 ); + } + } + } +#endif + if ( ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) && ( code_strat > 3 ) ) { for ( b = 0; b < num_bands * bands_bw; b += 2 * bands_bw ) @@ -870,6 +896,10 @@ ivas_error ivas_spar_md_enc_process( hMdEnc->mixer_mat[i][j][b + 1] = prior_mixer[i][j][b + 1]; } } +#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + mvr2r( P_quant_re_prior[b], hMdEnc->spar_md.band_coeffs[b].P_quant_re, FOA_CHANNELS - 1 ); + mvr2r( P_quant_re_prior[b + 1], hMdEnc->spar_md.band_coeffs[b + 1].P_quant_re, FOA_CHANNELS - 1 ); +#endif } } #ifdef DEBUG_LBR_SBA -- GitLab From 3fc19ec96b554e754150e0f3db37a62252565d97 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 8 Apr 2025 14:56:11 +0200 Subject: [PATCH 3/5] change switch name put back same as float repo --- lib_com/ivas_prot.h | 2 +- lib_com/ivas_tools.c | 2 +- lib_com/options.h | 2 +- lib_rend/ivas_crend.c | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 44600ec89..132922102 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2958,7 +2958,7 @@ int16_t check_bounds_s( const int16_t high /* i : High limit */ ); -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR void set_zero_l( float *vec, /* o : input vector */ const uint32_t lvec /* i : length of the vector */ diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index 8d31bd7da..7d4b0f2c6 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -581,7 +581,7 @@ int16_t check_bounds_s( return value_adj; } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR /*---------------------------------------------------------------------* * set_zero_l() * diff --git a/lib_com/options.h b/lib_com/options.h index 4310246ca..b937b8823 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,7 +183,6 @@ #define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ #define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ #define NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH /* FhG: issue 708: fix crash in OSBA BR switching with long test vectors */ -#define FIX_1440_PORT_1202_FROM_FLT_REPO /* Orange : Fix crash when long BRIR is set */ #define NONBE_1319_M2R_PRECISION_ALIGN /* Nokia: bring updates from PC code related to OMASA masa2total ratios */ @@ -209,6 +208,7 @@ #define FIX_910_REMOVE_DUPLICATION_TD_REND /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */ #define FIX_940_DEBUGGING_VARIABLE /* Nokia: issue #940: remove debugging variable */ #define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ +#define FIX_CRASH_LONG_BRIR /* Orange : Fix crash when long BRIR is set */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index f966fa991..a6fc32866 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1249,7 +1249,7 @@ ivas_error ivas_rend_openCrend( ) { int16_t i, subframe_length; -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR int32_t max_total_ir_len; #else int16_t max_total_ir_len; @@ -1303,7 +1303,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_re[i], max_total_ir_len ); #else set_zero( hCrend->freq_buffer_re[i], max_total_ir_len ); @@ -1313,7 +1313,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_im[i], max_total_ir_len ); #else set_zero( hCrend->freq_buffer_im[i], max_total_ir_len ); @@ -1326,7 +1326,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->prev_out_buffer[i], subframe_length ); #else set_zero( hCrend->prev_out_buffer[i], subframe_length ); @@ -1341,7 +1341,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); #else set_zero( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); @@ -1351,7 +1351,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); #else set_zero( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); @@ -1370,7 +1370,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->lfe_delay_line, max_total_ir_len ); #else set_zero( hCrend->lfe_delay_line, max_total_ir_len ); @@ -1617,7 +1617,7 @@ static ivas_error ivas_rend_crendConvolver( int16_t i, j, k, m; int16_t subframe_length, idx_in; int16_t lfe_idx_in; -#ifdef FIX_1440_PORT_1202_FROM_FLT_REPO +#ifdef FIX_CRASH_LONG_BRIR int32_t offset, offset_in, offset_diffuse; #else int16_t offset, offset_in, offset_diffuse; -- GitLab From 88b5d6ad326123d2f06d7b4aaea92b0b298d6e01 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 10 Apr 2025 18:44:11 +0200 Subject: [PATCH 4/5] align 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 b937b8823..1be21d8c9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -208,7 +208,7 @@ #define FIX_910_REMOVE_DUPLICATION_TD_REND /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */ #define FIX_940_DEBUGGING_VARIABLE /* Nokia: issue #940: remove debugging variable */ #define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ -#define FIX_CRASH_LONG_BRIR /* Orange : Fix crash when long BRIR is set */ +#define FIX_CRASH_LONG_BRIR /* Orange : Fix crash when long BRIR is set */ /* #################### End BASOP porting switches ############################ */ -- GitLab From a2327df2b3a4a61eec65bda6884b4f79ceabd4a4 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Fri, 11 Apr 2025 13:15:00 +0200 Subject: [PATCH 5/5] trigger-test -- GitLab