Commit cab4983c authored by vaclav's avatar vaclav
Browse files

fix Issue 78: compute consumption of Stack memory in DirAC decoder as...

fix Issue 78: compute consumption of Stack memory in DirAC decoder as intra-frame heap; under INTRAFRAME_HEAP_MANAGEMENT
parent c7ed4df7
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -164,6 +164,9 @@
#define FIX_ITD_CNG                                     /* Eri: Fix for CNG ITD */


#define INTRAFRAME_HEAP_MANAGEMENT                      /* Issue 78: compute consumption of Stack memory in DirAC decoder as intra-frame heap */


/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+12 −1
Original line number Diff line number Diff line
@@ -759,12 +759,14 @@ ivas_error ivas_dirac_dec_config(
    /* output synthesis */
    ivas_dirac_dec_output_synthesis_init( hDirAC, nchan_out_woLFE );

#ifndef INTRAFRAME_HEAP_MANAGEMENT
    /* Allocate stack memory */
    if ( flag_config != DIRAC_OPEN )
    {
        ivas_dirac_free_mem( &( hDirAC->stack_mem ) );
    }
    ivas_dirac_alloc_mem( hDirAC, st_ivas->renderer_type, &( hDirAC->stack_mem ) );
#endif

    mvs2s( DirAC_block_grouping, hDirAC->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 );

@@ -1090,8 +1092,9 @@ void ivas_dirac_dec_close(
        hDirAC->masa_stereo_type_detect = NULL;
    }

#ifndef INTRAFRAME_HEAP_MANAGEMENT
    ivas_dirac_free_mem( &( hDirAC->stack_mem ) );

#endif
    count_free( hDirAC );

    return;
@@ -1827,7 +1830,11 @@ void ivas_dirac_dec(

    /* Initialize aux buffers */
    hDirAC = st_ivas->hDirAC;
#ifdef INTRAFRAME_HEAP_MANAGEMENT
    ivas_dirac_alloc_mem( hDirAC, st_ivas->renderer_type, &DirAC_mem );
#else
    DirAC_mem = st_ivas->hDirAC->stack_mem;
#endif

    reference_power = DirAC_mem.reference_power;
    reference_power_smooth = DirAC_mem.reference_power + hDirAC->num_freq_bands;
@@ -2495,6 +2502,10 @@ void ivas_dirac_dec(
        }
    }

#ifdef INTRAFRAME_HEAP_MANAGEMENT
    ivas_dirac_free_mem( &DirAC_mem );
#endif

    wmops_sub_end();

    return;
+2 −1
Original line number Diff line number Diff line
@@ -704,8 +704,9 @@ typedef struct ivas_dirac_dec_data_structure
    float *proto_frame_f;
    float *proto_frame_dec_f;

#ifndef INTRAFRAME_HEAP_MANAGEMENT
    DIRAC_DEC_STACK_MEM stack_mem;

#endif
    MASA_STEREO_TYPE_DETECT *masa_stereo_type_detect;

    int16_t num_ele_spk_no_diffuse_rendering;