Skip to content

Reverb structure memory non-optimality

This is a follow up to discussion from the thread at !2221 (comment 89845):

After the BASOP HRTF updates in !2221 (merged), the reverb HRIR structure contains memory allocated dynamically which is only a temporary solution. In case of using the model coefficients from ROM tables, the tables of constant lengths are stored in Word16 values but they are scaled and converted to Word32 values in ivas_HRTF_statistics_init_fx(). This is obviously non-optimal and the logic in BASOP diverges from that in the float framework.

The corresponding part of the code in the BASOP framework is currently under FIX_1990_SANITIZER_IN_REVERB_LOAD at the end of decoder main() function:

#ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD
    // TODO:
    /* This free differs from float version.
       This is needed as HRTF statistics from ROM are currently converted from Word16 values to scaled Word32 values. */
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL;
    IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics );
    destroy_hrtf_statistics( hHrtfStatistics );
#endif

and at the end of ivas_HRTF_statistics_init_fx():

#ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD
    HrtfStatistics->fromROM = FALSE; // TODO: temporary hack until HRTF statistics ROM tables are converted from Word16 to Word32
#endif