Commit 946a84bb authored by vaclav's avatar vaclav
Browse files

accept SRAM_REDUCTION_BINRENDERER

parent 227c76f9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -147,7 +147,6 @@
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define FIX_I13_TCX_TNS_ISSUE                           /* Issue 13: Fix reported artifacts. Bug in TNS with TCX5 */
#define SRAM_REDUCTION_BINRENDERER                      /* Issue 145: reduction of static RAM usage in fastconv binaural renderer */
#define SRAM_REDUCTION_BINRENDERER_ROOM                 /* Issue 145: reduction of static RAM usage in fastconv binaural room renderer */
#define FIX_I120_INV_SQRT                               /* Issue 120: inv_sqrt() shall be used instead of 1 / sqrt() to measure the correct complexity */

+2 −14
Original line number Diff line number Diff line
@@ -186,7 +186,6 @@ static ivas_error ivas_binRenderer_convModuleOpen(
        }
    }

#ifdef SRAM_REDUCTION_BINRENDERER
    /* allocate memory for filter states */
    if ( ( hBinRenConvModule->filterTapsLeftReal = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL )
    {
@@ -266,7 +265,6 @@ static ivas_error ivas_binRenderer_convModuleOpen(
            }
        }
    }
#endif

    /* set memories */
    for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
@@ -308,13 +306,8 @@ static ivas_error ivas_binRenderer_convModuleOpen(
            if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && hRenderConfig->roomAcoustics.use_brir )
            {
                /* set the memories to zero */
#ifdef SRAM_REDUCTION_BINRENDERER
                set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
                set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
#else
                set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTaps );
                set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTaps );
#endif

                if ( isLoudspeaker )
                {
@@ -662,7 +655,7 @@ ivas_error ivas_binRenderer_open(
    return error;
}

#ifdef SRAM_REDUCTION_BINRENDERER

/*-------------------------------------------------------------------------
 * ivas_binRenderer_convModuleClose()
 *
@@ -741,7 +734,7 @@ static void ivas_binRenderer_convModuleClose(

    return;
}
#endif


/*-------------------------------------------------------------------------
 * ivas_binRenderer_close()
@@ -760,12 +753,7 @@ void ivas_binRenderer_close(

    if ( ( *hBinRenderer )->hBinRenConvModule != NULL )
    {
#ifdef SRAM_REDUCTION_BINRENDERER
        ivas_binRenderer_convModuleClose( hBinRenderer );
#else
        count_free( ( *hBinRenderer )->hBinRenConvModule );
        ( *hBinRenderer )->hBinRenConvModule = NULL;
#endif
    }

    if ( ( *hBinRenderer )->hReverb != NULL )
+0 −22
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@

/* Binaural rendering data set based on HRIRs */
extern const float FASTCONV_HRIR_latency_s;
#ifdef SRAM_REDUCTION_BINRENDERER
extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7];
extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][7];
extern float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7];
@@ -58,35 +57,14 @@ extern float rightHRIRImag[BINAURAL_CONVBANDS][15][7];
extern float FASTCONV_HOA3_latency_s;
extern float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];
extern float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];
#else
extern const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7];
extern const float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][7];
extern const float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7];
extern const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][16][7];

extern const float leftHRIRReal[BINAURAL_CONVBANDS][15][7];
extern const float leftHRIRImag[BINAURAL_CONVBANDS][15][7];
extern const float rightHRIRReal[BINAURAL_CONVBANDS][15][7];
extern const float rightHRIRImag[BINAURAL_CONVBANDS][15][7];

extern const float FASTCONV_HOA3_latency_s;
extern const float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];
extern const float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];
#endif

/* Binaural rendering data set based on BRIRs */
extern const float FASTCONV_BRIR_latency_s;
#ifdef SRAM_REDUCTION_BINRENDERER
extern float leftBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
extern float leftBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
extern float rightBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
extern float rightBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
#else
extern const float leftBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
extern const float leftBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
extern const float rightBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
extern const float rightBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX];
#endif

/* Reverberation parameters based on BRIRs for fastconv */
extern float fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX];
+0 −12
Original line number Diff line number Diff line
@@ -1303,25 +1303,13 @@ typedef struct ivas_dirac_dec_binaural_data_structure

typedef struct ivas_binaural_rendering_conv_module_struct
{
#ifdef SRAM_REDUCTION_BINRENDERER
    float ***filterTapsLeftReal;
    float ***filterTapsLeftImag;
    float ***filterTapsRightReal;
    float ***filterTapsRightImag;
#else
    const float *filterTapsLeftReal[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS];
    const float *filterTapsLeftImag[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS];
    const float *filterTapsRightReal[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS];
    const float *filterTapsRightImag[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS];
#endif

#ifdef SRAM_REDUCTION_BINRENDERER
    float ***filterStatesLeftReal;
    float ***filterStatesLeftImag;
#else
    float filterStatesLeftReal[BINAURAL_CONVBANDS][MAX_OUTPUT_CHANNELS][BINAURAL_NTAPS_MAX];
    float filterStatesLeftImag[BINAURAL_CONVBANDS][MAX_OUTPUT_CHANNELS][BINAURAL_NTAPS_MAX];
#endif

    int16_t numTapsArray[BINAURAL_CONVBANDS];
    int16_t numTaps;