Commit f7a0e207 authored by norvell's avatar norvell
Browse files

Synch with BASOP ivas-float-update a61a71ef, 2024-06-12

parent debe2188
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -144,6 +144,11 @@
#define NON_BE_FIX_1048_THRESHOLD_COH_BASOP             /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/
#define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX               /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */
#define NONBE_FIX_738_QUATERNION_SLERP_PRECISION        /* Philips: issue 738: Quaternion spherical linear interpolation precision handling issues */
#define FIX_1033_MEMORY_LEAK_OMASA                      /* Nokia / Orange: issue #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching */
#define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR                 /* Ericsson:  premature cast to unsigned detected by USAN corrected  */
#define FIX_1027_GSC_INT_OVERFLOW                       /* VA: issue 2207: overflow in GSC */
#define NONBE_FIX_1096_NAN_VALUES_IN_DIRAC_TO_STEREO    /* FhG: avoid sidegain DFT-Stereo param to be larger than 1 when converting from Dirac parameters */
#define NON_BE_1055_RESET_LP_MEMORIES                   /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */
#define NONBE_FIX_1069_SVD_TUNING                       /* FhG: issue 1069: tune SVD constants */
#define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO           /* Eri: Issue 1010: Division by zero in Stereo CNG */
/* #################### End FIXES switches ############################ */
+4 −0
Original line number Diff line number Diff line
@@ -643,7 +643,11 @@ void gsc_dec(
                }
                if ( concat_out[j] < 0 )
                {
#ifdef FIX_1027_GSC_INT_OVERFLOW
                    seed_init = (int16_t) ( (int32_t) seed_init + 3 );
#else
                    seed_init += 3;
#endif
                }
            }

+9 −2
Original line number Diff line number Diff line
@@ -1214,8 +1214,15 @@ static ivas_error ivas_mc_dec_reconfig(

            if ( st_ivas->hBinRendererTd != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) )
            {
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                    ivas_td_binaural_close( &st_ivas->hBinRendererTd );
                    st_ivas->hHrtfTD = NULL;
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif
            }

#ifdef SPLIT_REND_WITH_HEAD_ROT
+19 −4
Original line number Diff line number Diff line
@@ -322,10 +322,17 @@ ivas_error ivas_omasa_dec_config(
            if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC )
            {
                /* Allocate TD renderer for the objects in DISC mode */
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd == NULL )
                {
#endif
                    if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK )
                    {
                        return error;
                    }
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif

                /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */
                if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK )
@@ -336,8 +343,16 @@ ivas_error ivas_omasa_dec_config(
            else
            {
                /* TD renderer handle */
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd != NULL && st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                    /* TD renderer handle */
                    ivas_td_binaural_close( &st_ivas->hBinRendererTd );
                    st_ivas->hHrtfTD = NULL;
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif

                /* ISM renderer handle + ISM data handle */
                ivas_omasa_separate_object_renderer_close( st_ivas );
+13 −0
Original line number Diff line number Diff line
@@ -395,10 +395,23 @@ static void map_params_dirac_to_stereo(
                }
            }

#ifdef NONBE_FIX_1096_NAN_VALUES_IN_DIRAC_TO_STEREO
            /* Clamp values here. [-1, 1] is the allowed range, but due to precision issues they can be slightly off which can cause problems later. */
            side_gain[b] *= sqrtf( 1.f - diffuseness[b] );
            side_gain[b] = max( min( side_gain[b], 1 ), -1 );
            side_gain[b + STEREO_DFT_BAND_MAX] *= sqrtf( 1.f - diffuseness[b] );
            side_gain[b + STEREO_DFT_BAND_MAX] = max( min( side_gain[b + STEREO_DFT_BAND_MAX], 1 ), -1 );
            /* for residual prediction gain, allowed range is [0, 1]*/
            res_pred_gain[b] = diffuseness[b] * ( 1.0f - surrCoh[b] );
            res_pred_gain[b] = max( min( res_pred_gain[b], 1 ), 0 );
            res_pred_gain[b + STEREO_DFT_BAND_MAX] = diffuseness[b] * ( 1.0f - surrCoh[b] );
            res_pred_gain[b + STEREO_DFT_BAND_MAX] = max( min( res_pred_gain[b + STEREO_DFT_BAND_MAX], 1 ), 0 );
#else
            side_gain[b] *= sqrtf( 1.f - diffuseness[b] );
            side_gain[b + STEREO_DFT_BAND_MAX] *= sqrtf( 1.f - diffuseness[b] );
            res_pred_gain[b] = diffuseness[b] * ( 1.0f - surrCoh[b] );
            res_pred_gain[b + STEREO_DFT_BAND_MAX] = diffuseness[b] * ( 1.0f - surrCoh[b] );
#endif
        }
    }

Loading