Commit 49904b57 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] update EFAP max polygon count with values from worst case testing

parent a661a1c4
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1465,7 +1465,7 @@ typedef enum

#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                       40                          /* Upper bound on number of polygons; (2 * num_spk + 8) = 40 for a speaker setup of 16.0 */
#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
+5 −2
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@
#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"
@@ -200,8 +203,8 @@ 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
    /* calculate upper bound of number of polygons required (heuristic) */
    polyset_size = (int8_t) ( 2 * num_speaker_nodes + 8 );
    /* get upper bound of number of polygons required */
    polyset_size = efap_poly_limit[num_speaker_nodes - 1];

    /* Memory allocation for the polyset array */
    if ( ( efap->polyData.polysetArray = (EFAP_POLYSET *) malloc( polyset_size * sizeof( EFAP_POLYSET ) ) ) == NULL )
+7 −0
Original line number Diff line number Diff line
@@ -388,8 +388,15 @@ 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
 *----------------------------------------------------------------------------------*/

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
 *----------------------------------------------------------------------------------*/
+9 −0
Original line number Diff line number Diff line
@@ -125,6 +125,15 @@ extern const float ls_azimuth_CICP1[1];
extern const float ls_elevation_CICP1[1];


#ifdef FIX_1050_EFAP_ALLOC
/*----------------------------------------------------------------------------------*
 * EFAP ROM tables
 *----------------------------------------------------------------------------------*/

extern const int8_t efap_poly_limit[MAX_OUTPUT_CHANNELS];


#endif
/*----------------------------------------------------------------------------------*
 * LS Configuration Converter ROM tables
 *----------------------------------------------------------------------------------*/