Commit 2ba8bab2 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1050_EFAP_ALLOC

parent 9b726eeb
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1458,17 +1458,9 @@ typedef enum
/*----------------------------------------------------------------------------------*
 * Amplitude Panning (EFAP, VBAP) constants
 *----------------------------------------------------------------------------------*/
#ifndef FIX_1050_EFAP_ALLOC
#define PANNING_AZI_RESOLUTION                  2
#define PANNING_ELE_RESOLUTION                  5
#endif

#define EFAP_MAX_CHAN_NUM                       5                           /* Maximum number of channels that constitute a polygon, 4 or 5 */
#ifdef FIX_1050_EFAP_ALLOC
#define EFAP_MAX_POLY_SET                       54                          /* Upper bound on number of polygons; found to be 54 in the worst case for a speaker setup of 16.0 */
#else
#define EFAP_MAX_POLY_SET                       50                          /* Upper bound on number of polygons; with a Speaker setup of 16.0, we obtain 44 polygons/triangles in the matlab implementation. */
#endif

#define EFAP_MODE_EFAP                          0                           /* EFAP Panning */
#define EFAP_MODE_EFIP                          1                           /* EFIP Panning */
+0 −1
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@
#define FIX_1082_INSTRUM_FAILED_LC3PLUS                 /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */


#define FIX_1050_EFAP_ALLOC                             /* FhG: issue 1050: reduction of memory allocated to EFAP handle */
#define FIX_1099_JBM_MD_HANDLE_ALLOC                    /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */


+0 −4
Original line number Diff line number Diff line
@@ -66,14 +66,10 @@ ivas_error ivas_ism_renderer_open(
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer\n" ) );
    }

#ifdef FIX_1050_EFAP_ALLOC
    if ( st_ivas->hIntSetup.is_loudspeaker_setup &&
         st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO &&
         st_ivas->hIntSetup.ls_azimuth != NULL && st_ivas->hIntSetup.ls_elevation != NULL &&
         st_ivas->hEFAPdata == NULL )
#else
    if ( st_ivas->hIntSetup.is_loudspeaker_setup && st_ivas->hIntSetup.ls_azimuth != NULL && st_ivas->hIntSetup.ls_elevation != NULL && st_ivas->hEFAPdata == NULL )
#endif
    {
        if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
        {
+0 −18
Original line number Diff line number Diff line
@@ -38,9 +38,7 @@
#include "prot.h"
#include "ivas_prot.h"
#include "ivas_prot_rend.h"
#ifdef FIX_1050_EFAP_ALLOC
#include "ivas_rom_rend.h"
#endif
#include "ivas_stat_dec.h"
#ifdef DEBUGGING
#include "debug.h"
@@ -54,12 +52,10 @@
#define EFAP_MAX_SIZE_TMP_BUFF 30
#define EFAP_MAX_GHOST_LS      5 /* Maximum number of ghost Loudspeakers, for memory allocation purpose */
#define POLY_THRESH            1e-4f
#ifdef FIX_1050_EFAP_ALLOC
#ifdef DEBUG_EFAP_POLY_TOFILE
#define PANNING_AZI_RESOLUTION 2
#define PANNING_ELE_RESOLUTION 5
#endif
#endif


/*-----------------------------------------------------------------------*
@@ -156,9 +152,7 @@ ivas_error efap_init_data(
)
{
    /* Handle instance declaration  */
#ifdef FIX_1050_EFAP_ALLOC
    int8_t polyset_size;
#endif
    EFAP *efap;
    ivas_error error;

@@ -202,7 +196,6 @@ ivas_error efap_init_data(
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) );
    }
#ifdef FIX_1050_EFAP_ALLOC
    /* get upper bound of number of polygons required */
    polyset_size = efap_poly_limit[num_speaker_nodes - 1];

@@ -217,7 +210,6 @@ ivas_error efap_init_data(
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) );
    }
#endif

    /*-----------------------------------------------------------------*
     * Initialize values
@@ -361,14 +353,12 @@ void efap_free_data(

    free( ( *hEFAPdata )->vtxData.vtxOrder );
    ( *hEFAPdata )->vtxData.vtxOrder = NULL;
#ifdef FIX_1050_EFAP_ALLOC

    free( ( *hEFAPdata )->polyData.polysetArray );
    ( *hEFAPdata )->vtxData.vtxOrder = NULL;

    free( ( *hEFAPdata )->polyData.triArray );
    ( *hEFAPdata )->vtxData.vtxOrder = NULL;
#endif

    free( ( *hEFAPdata )->bufferLong );
    ( *hEFAPdata )->bufferLong = NULL;
@@ -437,11 +427,7 @@ static ivas_error poly_init(
        if ( efap->vtxData.vertexArray[n].ele > 90.0 - 1e-6 ||
             efap->vtxData.vertexArray[n].ele < 1e-6 - 90.0 )
        {
#ifdef FIX_1050_EFAP_ALLOC
            efap->vtxData.vertexArray[n].isNaN = true;
#else
            efap->vtxData.vertexArray[n].isNaN = 1;
#endif
        }
    }

@@ -1534,11 +1520,7 @@ static void add_vertex(
    vtxArray[pos].idx = (int16_t) idxAziTmp + 181 * (int16_t) idxEleTmp;

/* Setting the nan flag to 0 */
#ifdef FIX_1050_EFAP_ALLOC
    vtxArray[pos].isNaN = false;
#else
    vtxArray[pos].isNaN = 0;
#endif

    /* Set the default downmix type */
    vtxArray[pos].dmxType = dmxType;
+0 −2
Original line number Diff line number Diff line
@@ -388,7 +388,6 @@ const float ivas_reverb_default_DSR[IVAS_REVERB_DEFAULT_N_BANDS] =
const float ls_azimuth_CICP1[1] = { 0.0f };
const float ls_elevation_CICP1[1] = { 0.0f };

#ifdef FIX_1050_EFAP_ALLOC
/*----------------------------------------------------------------------------------*
 * EFAP ROM tables
 *----------------------------------------------------------------------------------*/
@@ -396,7 +395,6 @@ const float ls_elevation_CICP1[1] = { 0.0f };
const int8_t efap_poly_limit[MAX_OUTPUT_CHANNELS] = {22, 22, 22, 26, 30, 34, 36, 42, 42, 44, 47, 51, 52, 54, 54, 54};


#endif
/*----------------------------------------------------------------------------------*
 * LS Renderer ROM tables
 *----------------------------------------------------------------------------------*/
Loading