Commit ab46715e authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1050_EFAP_ALLOC

parent 923553f9
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1613,17 +1613,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
@@ -86,7 +86,6 @@

/* #################### Start BASOP porting switches ############################ */

#define FIX_1050_EFAP_ALLOC                             /* FhG: issue 1050: reduction of memory allocated to EFAP handle */
#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS            /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */
#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/
#define LC3PLUS_LEA_COMPAT_BITRATES_48_6                /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel)  */
+0 −4
Original line number Diff line number Diff line
@@ -70,15 +70,11 @@ ivas_error ivas_ism_renderer_open_fx(
    test();
    test();
    test();
#ifdef FIX_1050_EFAP_ALLOC
    test();
    IF( st_ivas->hIntSetup.is_loudspeaker_setup &&
        st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO &&
        st_ivas->hIntSetup.ls_azimuth_fx != NULL && st_ivas->hIntSetup.ls_elevation_fx != NULL &&
        st_ivas->hEFAPdata == NULL )
#else
    IF( st_ivas->hIntSetup.is_loudspeaker_setup && st_ivas->hIntSetup.ls_azimuth_fx != NULL && st_ivas->hIntSetup.ls_elevation_fx != NULL && st_ivas->hEFAPdata == NULL )
#endif
    {
        IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) )
        {
+0 −18
Original line number Diff line number Diff line
@@ -37,9 +37,7 @@
#include "options.h"
#include "prot_fx.h"
#include "ivas_prot_rend_fx.h"
#ifdef FIX_1050_EFAP_ALLOC
#include "ivas_rom_rend.h"
#endif
#include "ivas_stat_dec.h"
#include "wmc_auto.h"
#include "ivas_prot_fx.h"
@@ -52,12 +50,10 @@
#define EFAP_MAX_GHOST_LS      5       /* Maximum number of ghost Loudspeakers, for memory allocation purpose */
#define POLY_THRESH_Q29        53687LL // Q29
#define POLY_THRESH_Q28        26843   // Q28
#ifdef FIX_1050_EFAP_ALLOC
#ifdef DEBUG_EFAP_POLY_TOFILE
#define PANNING_AZI_RESOLUTION 2
#define PANNING_ELE_RESOLUTION 5
#endif
#endif
#define Q22_1       4194304
#define Q22_45_DEG  188743680
#define Q22_90_DEG  377487360
@@ -133,9 +129,7 @@ ivas_error efap_init_data_fx(
)
{
/* Handle instance declaration  */
#ifdef FIX_1050_EFAP_ALLOC
    Word8 polyset_size;
#endif
    EFAP *efap;
    ivas_error error;

@@ -181,7 +175,6 @@ ivas_error efap_init_data_fx(
    {
        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];

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

    /*-----------------------------------------------------------------*
     * Initialize values
@@ -360,14 +352,12 @@ void efap_free_data_fx(

    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_fx );
    ( *hEFAPdata )->bufferLong_fx = NULL;
@@ -439,11 +429,7 @@ static ivas_error poly_init_fx(
        if ( GT_32( efap->vtxData.vertexArray[n].ele /*Q22*/, ( Q22_90_DEG /*90.0 Q22*/ - 4 /*1e-6 Q22*/ ) ) ||
             LT_32( efap->vtxData.vertexArray[n].ele /*Q22*/, ( 4 /*1e-6 Q22*/ - Q22_90_DEG /*90.0 Q22*/ ) ) )
        {
#ifdef FIX_1050_EFAP_ALLOC
            efap->vtxData.vertexArray[n].isNaN = true;
#else
            efap->vtxData.vertexArray[n].isNaN = 1;
#endif
            move16();
        }
    }
@@ -1704,11 +1690,7 @@ static void add_vertex_fx(
    vtxArray[pos].idx = add( extract_l( idxAziTmp ), i_mult( 181, extract_l( L_shr( idxEleTmp, Q22 ) ) ) ); // q0

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

    /* Set the default downmix type */
+0 −2
Original line number Diff line number Diff line
@@ -114,7 +114,6 @@ extern const Word32 ivas_reverb_default_DSR_fx[]; /*Q-30*/
 * Renderer SBA & MC enc/dec matrices
 *----------------------------------------------------------------------------------*/

#ifdef FIX_1050_EFAP_ALLOC
/*----------------------------------------------------------------------------------*
 * EFAP ROM tables
 *----------------------------------------------------------------------------------*/
@@ -122,7 +121,6 @@ extern const Word32 ivas_reverb_default_DSR_fx[]; /*Q-30*/
extern const Word8 efap_poly_limit[MAX_OUTPUT_CHANNELS];


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