Commit 96d8de9f authored by malenov's avatar malenov
Browse files

activate TEMP_FIX_BSPLINE_MALLOC - temporary fix for CI builds

parent 6bf45de5
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@
#define NTT_REDUC_COMP_POC                              /* NTT Contribution 10: Complexity reduction of phase spectrum in stereo downmix*/
#define FIX_ISM_DECODER_PRINTOUT                        /* Issue 229: fix ISM decoder printout */


#define TEMP_FIX_BSPLINE_MALLOC                         /* temporary fix for malloc_() free() mismatch reported by the WMC tool */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+3 −0
Original line number Diff line number Diff line
@@ -1189,6 +1189,7 @@ void HRTF_model_precalc(
    return;
}

#ifndef TEMP_FIX_BSPLINE_MALLOC

/*-------------------------------------------------------------------*
 * BSplineModelEvalDealloc()
@@ -1262,6 +1263,8 @@ void BSplineModelEvalITDDealloc(
    return;
}

#endif


/*-------------------------------------------------------------------*
 * SkipSmallest_ValueIndex()
+17 −0
Original line number Diff line number Diff line
@@ -135,6 +135,23 @@ void TDREND_MIX_Dealloc(
                BSplineModelEvalITDDealloc( &hBinRendererTd->HrFiltSet_p->ModelParamsITD );
            }
            BSplineModelEvalDealloc( &hBinRendererTd->HrFiltSet_p->ModelParams, &hBinRendererTd->HrFiltSet_p->ModelEval );

#ifdef TEMP_FIX_BSPLINE_MALLOC
            {
                ModelParams_t *model = &hBinRendererTd->HrFiltSet_p->ModelParams;
                ModelEval_t *modelEval = &hBinRendererTd->HrFiltSet_p->ModelEval;
                if ( !model->modelROM )
                {
                    free_( model->EL_dyn );
                    free_( model->ER_dyn );
                }
                if ( modelEval != NULL )
                {
                    free_( modelEval->hrfModL );
                    free_( modelEval->hrfModR );
                }
            }
#endif
        }
        else
        {
+66 −0
Original line number Diff line number Diff line
@@ -305,6 +305,72 @@ static ivas_error LoadBSplineBinary(
    return IVAS_ERR_OK;
}

#ifdef TEMP_FIX_BSPLINE_MALLOC
/*-------------------------------------------------------------------*
 * BSplineModelEvalDealloc()
 *
 * Deallocate BSpline HR Filter model
 --------------------------------------------------------------------*/

void BSplineModelEvalDealloc(
    ModelParams_t *model,  /* i  : Model parameters           */
    ModelEval_t *modelEval /* i  : Model evaluation structure */
)
{
    /* Allocated in LoadBSplineBinary() */
    int16_t i;

    if ( !model->modelROM )
    {
        free( model->elevKSeq_dyn );
        free( model->azim_start_idx_dyn );
        free( model->azimDim2_dyn );
        free( model->azimDim3_dyn );
        free( model->AlphaL_dyn );
        free( model->AlphaR_dyn );
        free( model->azimSegSamples_dyn );

        free( model->azimShapeIdx_dyn );
        free( model->azimShapeSampFactor_dyn );
        free( model->elevBsShape_dyn );

        for ( i = 0; i < model->num_unique_azim_splines; i++ )
        {
            free( model->azimBsShape_dyn[i] );
        }
        free( model->azimBsShape_dyn );
    }
    free( (void *) model->azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */
    for ( i = 0; i < model->elevDim3; i++ )
    {
        free( model->azimKSeq[i] );
    }
    free( model->azimKSeq );

    return;
}


/*-------------------------------------------------------------------*
 * BSplineModelEvalITDDealloc()
 *
 * Deallocates the ITD model.
 --------------------------------------------------------------------*/

void BSplineModelEvalITDDealloc(
    ModelParamsITD_t *model /* i  : Model parameters        */
)
{
    free( model->elevKSeq_dyn );
    free( model->azimKSeq_dyn );
    free( model->W_dyn );
    free( model->azimBsShape_dyn );
    free( model->elevBsShape_dyn );

    return;
}

#endif

/*-------------------------------------------------------------------*
 * TDREND_MIX_LoadHRTF()