Commit c1684780 authored by emerit's avatar emerit
Browse files

Update allowing loaded hrtf to be still used after bitrate switching

parent 6e695a35
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@
#define FIX_DIRAC_LS_SYNTHESIS_CONFIG_479               /* FhG: fix for issue 479, broken LS output with DirAC at high BRs */
#define HYBRID_ITD_MAX                                 /* FhG: Improvement for DFT-stereo for cases with large ITDs */
#define FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR             /* Eri: Fix for issue 462: Use-of-uninitialized memory in external HRTF deallocation in decoder together with BR switching */
#define FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_SIMPLIER             /* Ora: Fix for issue 462: Use-of-uninitialized memory in external HRTF deallocation in decoder together with BR switching */
#define FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_ORANGE             /* Ora: Fix for issue 462: Use-of-uninitialized memory in external HRTF deallocation in decoder together with BR switching */
#define FIX_487_LOWRATE_SBA_TUNING_FIX                  /* Dlb: TUning fix for low bitrate cases to match theoretical longest SPAR MD bitstream */
#define FIX_490_MASA_2TC_LBR_DTX                        /* Nokia: Fixes issue 490 by correcting condition. */

+84 −78
Original line number Diff line number Diff line
@@ -185,9 +185,7 @@ static ivas_error ivas_ism_bitrate_switching(
            ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin );

            /* Open the TD Binaural renderer */
#if defined FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR && !defined( FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_SIMPLIER )


#ifdef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR
            if ( st_ivas->hHrtfTD == NULL || st_ivas->hBinRendererTd == NULL )
            {
                if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK )
@@ -264,7 +262,15 @@ static ivas_error ivas_ism_bitrate_switching(

            /* Close the TD Binaural renderer */
#ifdef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR
#ifndef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_SIMPLIER
#ifdef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_ORANGE
            if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
            {
                if ( st_ivas->hHrtfTD != NULL )
                {
                    st_ivas->hHrtfTD = NULL;
                }
            }
#else
            if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
            {
#endif
@@ -273,13 +279,13 @@ static ivas_error ivas_ism_bitrate_switching(
                ivas_td_binaural_close( &st_ivas->hBinRendererTd );
            }

#ifndef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_SIMPLIER
#ifndef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_ORANGE
            if ( st_ivas->hHrtfTD != NULL )
            {
                st_ivas->hHrtfTD = NULL;
            }
#endif
        }
#endif
#else
            if ( st_ivas->hBinRendererTd != NULL )
            {
+8 −0
Original line number Diff line number Diff line
@@ -173,9 +173,17 @@ void TDREND_MIX_Dealloc(
            }
        }

#ifdef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR_ORANGE
        if ( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == 1 )
        {
            free( hBinRendererTd->HrFiltSet_p );
            hBinRendererTd->HrFiltSet_p = NULL;
        }
#else
        free( hBinRendererTd->HrFiltSet_p );
        hBinRendererTd->HrFiltSet_p = NULL;
#endif
    }

    return;
}