Commit ddc29d8e authored by emerit's avatar emerit
Browse files

aligm with main float

parent b53fb4d3
Loading
Loading
Loading
Loading
Loading
+10 −16
Original line number Diff line number Diff line
@@ -3901,8 +3901,7 @@ static ivas_error load_hrtf_from_file(
    {
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL;
        Word16 initFromRom;
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics, &initFromRom ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfBinary->hHrtfStatistics ) ) != IVAS_ERR_OK )
#endif
@@ -3912,9 +3911,7 @@ static ivas_error load_hrtf_from_file(
        }

#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( initFromRom )
        {
            if ( ( error = load_reverb_binary( *hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
        if ( ( error = load_HrtfStatistics_from_binary( *hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#else
        if ( ( error = load_reverb_binary( *hHrtfBinary->hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#endif
@@ -3933,9 +3930,6 @@ static ivas_error load_hrtf_from_file(
#endif
            }
        }
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        }
#endif
    }

    return IVAS_ERR_OK;
+4 −0
Original line number Diff line number Diff line
@@ -1102,7 +1102,11 @@ int main(
            fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" );
            goto cleanup;
        }
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( ( error = load_HrtfStatistics_from_binary( *hHrtfStatistics, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
        if ( ( error = load_reverb_binary( *hHrtfStatistics, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
        {
            if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
            {
+9 −13
Original line number Diff line number Diff line
@@ -1800,22 +1800,17 @@ ivas_error ivas_init_decoder_fx(
    {
        /* Init HRTF statistics */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( st_ivas->hHrtfStatistics == NULL )
        {
            /* Allocate HRTF statistics */
            IF( NE_32( ( error = ivas_HRTF_statistics_binary_open_fx( &( st_ivas->hHrtfStatistics ) ) ), IVAS_ERR_OK ) )
        /* Allocate HRTF and init statistics */
        IF( NE_32( ( error = ivas_reverb_HRTF_statistics_open_fx( &( st_ivas->hHrtfStatistics ), output_Fs ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
        }
        /* Init HRTF statistics */
        IF( NE_32( ( error = ivas_HRTF_statistics_init_from_rom_fx( &st_ivas->hHrtfStatistics, output_Fs ) ), IVAS_ERR_OK ) )
#else
        IF( NE_32( ( error = ivas_HRTF_statistics_init_fx( &st_ivas->hHrtfStatistics, output_Fs ) ), IVAS_ERR_OK ) )
#endif
        {
            return error;
        }
#endif

        /* Get default reverb values based on format, if custom values were not given */
        IF( EQ_16( st_ivas->hDecoderConfig->Opt_RendConfigCustom, 0 ) )
@@ -3554,6 +3549,10 @@ void ivas_destroy_dec_fx(
    ivas_combined_orientation_close_fx( &st_ivas->hCombinedOrientationData );

    /* Time Domain binaural renderer handle */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd );
    ivas_HRTF_td_binary_close_fx( &st_ivas->hHrtfTD );
#else
    IF( st_ivas->hBinRendererTd != NULL )
    {
        ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd );
@@ -3561,14 +3560,11 @@ void ivas_destroy_dec_fx(

    IF( st_ivas->hHrtfTD != NULL )
    {
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        ivas_HRTF_td_binary_close_fx( &st_ivas->hHrtfTD );
#else
        BSplineModelEvalDealloc_fx( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );

        ivas_HRTF_binary_close_fx( &st_ivas->hHrtfTD );
#endif
    }
#endif

    /* CRend binaural renderer handle */
    ivas_HRTF_CRend_binary_close_fx( &st_ivas->hHrtfCrend );
+0 −5
Original line number Diff line number Diff line
@@ -440,11 +440,6 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle(
ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics       /* o  : HRTF statistics handle                                                  */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ,                          							/* o  : HRTF statistics handle    */
    Word16 *intialisedFromRom 							/* o  : int16_t handle    */
#endif

);

ivas_error IVAS_DEC_HRTF_binary_open(
+1 −13
Original line number Diff line number Diff line
@@ -2479,28 +2479,16 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle(

ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
    IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle       */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ,                         /* o  : HRTF statistics handle    */
    Word16 *intialisedFromRom /* o  : int16_t handle    */
#endif
)
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics )
{
    test();
    test();
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL || intialisedFromRom == NULL )
#else
    IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL )
#endif
    {
        return IVAS_ERR_WRONG_PARAMS;
    }

    *hHrtfStatistics = &hIvasDec->st_ivas->hHrtfStatistics;
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    *intialisedFromRom = hIvasDec->st_ivas->hHrtfStatistics->fromROM;
#endif

    return IVAS_ERR_OK;
}
Loading