Commit 407ad654 authored by norvell's avatar norvell
Browse files

Merge branch '235-proper-allocation-deallocation-of-bspline-hr-filter-model-data' into 'main'

Resolve Issue 235

See merge request !374
parents 1c856bf4 d68129bd
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -514,7 +514,14 @@ cleanup:
#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
#endif

#ifdef FIX_235
    if ( arg.hrtfReaderEnabled )
    {
        IVAS_DEC_HRTF_HANDLE hHrtfTD;
        IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
        dealloc_HRTF_binary( hHrtfTD );
    }
#endif
    IVAS_DEC_Close( &hIvasDec );
    CustomLsReader_close( &hLsCustomReader );
    hrtfFileReader_close( &hrtfReader );
+2 −0
Original line number Diff line number Diff line
@@ -5119,9 +5119,11 @@ void BSplineModelEvalDealloc(
    ModelEval_t *modelEval                                      /* i  : Model evaluation structure              */
);

#ifndef FIX_235 
void BSplineModelEvalITDDealloc(
    ModelParamsITD_t *model                                     /* i  : Model parameters                        */
);
#endif

#ifdef TDREND_HRTF_TABLE_METHODS
void TDREND_HRFILT_SetFiltSet(

lib_com/options.h

100644 → 100755
+2 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@
#define FIX_ANGLE_WRAPPING								/* Issue 244: Problems with angle wrapping*/
#define FIX_245_RANGE_CODER_VOIP_MSAN                   /* Issue 245: fix use-of-uninitialized-value in range coder in VoIP mode */
#define FIX_272_COV                                     /* Issue 272: Cleanup for code coverage related to calls to ivas_binaural_cldfb() */
#define FIX_235                                         /* Issue 235: Deallocation of HR filter memory separately for lib_rend (ROM) and lib_util (from file) */


/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+2 −1
Original line number Diff line number Diff line
@@ -1713,12 +1713,13 @@ void ivas_destroy_dec(
    }
    else if ( st_ivas->hHrtfTD != NULL )
    {
#ifndef FIX_235
        /* Case when HRTF filter is mistakenly specified but TD renderer was not active */
        if ( st_ivas->hHrtfTD->ModelParams.UseItdModel && !st_ivas->hHrtfTD->ModelParams.modelROM )
        {
            BSplineModelEvalITDDealloc( &st_ivas->hHrtfTD->ModelParamsITD );
        }

#endif
        BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );

        ivas_HRTF_binary_close( &st_ivas->hHrtfTD );
+2 −1
Original line number Diff line number Diff line
@@ -210,12 +210,13 @@ ivas_error ivas_sba_dec_reinit(
    }
    else if ( st_ivas->hHrtfTD != NULL )
    {
#ifndef FIX_235
        /* Case when HRTF filter is mistakenly specified but TD renderer was not active */
        if ( st_ivas->hHrtfTD->ModelParams.UseItdModel && !st_ivas->hHrtfTD->ModelParams.modelROM )
        {
            BSplineModelEvalITDDealloc( &st_ivas->hHrtfTD->ModelParamsITD );
        }

#endif
        BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );

        ivas_HRTF_binary_close( &st_ivas->hHrtfTD );
Loading