Commit ed77b9d6 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Merge branch 'main-pc' into '1746_basop_port_fl1489'

parents 656afa5c 6bbe1b69
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1286,7 +1286,11 @@ enum
#define MASA_RATIO_TOLERANCE                    0.1f
#define MASA_RATIO_THRESHOLD                    0.1f
#define MASA_ANGLE_TOLERANCE                    0.5f
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
#define MASA_RATIO_THRESHOLD_FX                 32212255    // 0.015 in Q31
#else
#define MASA_RATIO_THRESHOLD_FX                 214748365   // 0.1 in Q31
#endif
#define MASA_RATIO_TOLERANCE_FX                 107374182   // 0.1 in Q30
#define MASA_ANGLE_TOLERANCE_FX                 ONE_IN_Q21  // 0.5 in Q22
#define MASA_LIMIT_NO_BANDS_SUR_COH             8
+6 −12
Original line number Diff line number Diff line
@@ -1056,6 +1056,9 @@ ivas_error ivas_ism_renderer_open_fx(

void ivas_ism_render_sf_fx(
    Decoder_Struct *st_ivas,             /* i/o: IVAS decoder structure                      */
#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH
    const RENDERER_TYPE renderer_type,   /* i  : active renderer type                            */
#endif
    Word32 *output_fx[],                 /* i/o: core-coder transport channels/object output */
    const Word16 n_samples_to_render     /* i  : output frame length per channel             */
);
@@ -1155,9 +1158,7 @@ void ivas_mono_stereo_downmix_mcmasa_fx(
);

void ivas_apply_non_diegetic_panning_fx(
#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING
    Word32 *input_f_fx,                                             /* i  : non-diegetic object                                         */
#endif
    Word32 *output_f_fx[],                 /* i/o: core-coder transport mono channel/stereo output  */
    const Word16 non_diegetic_pan_gain_fx, /* i  : non-diegetic panning gain                        */
    const Word16 output_frame              /* i  : output frame length per channel                  */
@@ -4923,13 +4924,6 @@ ivas_error ivas_cldfb_dec_reconfig_fx(
ivas_error ivas_sba_enc_reconfigure_fx(
    Encoder_Struct *st_ivas /* i/o: IVAS encoder structure                  */
);
#ifndef FIX_993_REMOVE_SBA_GET_ORDER
Word16 ivas_sba_get_order_fx(
    const Word16 nb_channels, /* i  : Number of ambisonic channels            */
    const Word16 sba_planar   /* i  : SBA planar flag                         */
);

#endif
/*! r: Ambisonic (SBA) order used for analysis and coding */
Word16 ivas_sba_get_analysis_order(
    const Word32 ivas_total_brate, /* i  : IVAS total bitrate                      */
+0 −68
Original line number Diff line number Diff line
@@ -60,24 +60,7 @@ void ivas_sba_config_fx(
    Word16 *element_mode          /* o  : element mode of the core coder           */
)
{
#ifndef FIX_993_REMOVE_SBA_GET_ORDER
    test();
    IF( sba_order < 0 && nb_channels < 0 )
    {
        assert( 0 && "Either order or number of channels must be positive" );
    }
    ELSE IF( sba_order < 0 )
    {
        sba_order = ivas_sba_get_order_fx( nb_channels, sba_planar );
    }
    ELSE IF( nb_channels < 0 )
    {
        nb_channels = ivas_sba_get_nchan_fx( sba_order, sba_planar );
    }
    ELSE
#else
    IF( nb_channels > 0 )
#endif
    {
        IF( sba_planar )
        {
@@ -128,57 +111,6 @@ void ivas_sba_config_fx(
    return;
}

#ifndef FIX_993_REMOVE_SBA_GET_ORDER
/*-------------------------------------------------------------------*
 * ivas_sba_get_order()
 *
 * Get Ambisonic order from number of ambisonic channels
 *-------------------------------------------------------------------*/

/*! r: Ambisonic (SBA) order */
Word16 ivas_sba_get_order_fx(
    const Word16 nb_channels, /* i  : Number of ambisonic channels     */
    const Word16 sba_planar   /* i  : SBA Planar flag                  */
)
{
    Word16 sba_order;

    /* sba_order = (int16_t) sqrtf( (float) nb_channels ) - 1 */
    Word16 sba_order_non_sba_planar[MAX_INPUT_CHANNELS] = { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3 };
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();
    move16();

    IF( sba_planar )
    {
        sba_order = shr( sub( nb_channels, 1 ), 1 );
        assert( ( EQ_16( add( shl( sba_order, 1 ), 1 ), nb_channels ) ) && "Number of channels not supported in Planar SBA!" );
    }
    ELSE
    {
        sba_order = sba_order_non_sba_planar[nb_channels - 1];
        move16();
        assert( ( EQ_16( mult( add( sba_order, 1 ), add( sba_order, 1 ) ), nb_channels ) ) && "Number of channels not supported in SBA!" );
    }

    assert( ( sba_order <= 3 ) && "Error: SBA order must be <= 3!" );

    return ( sba_order );
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_get_analysis_order()
+7 −17
Original line number Diff line number Diff line
@@ -110,30 +110,20 @@
#endif

#define USE_NEW_HRTF_BINARY_FILE_FORMAT                 /* Orange: to activate when decided to change the hrtf binary file format */
#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT
#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES       /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers	*/
#endif

#define FIX_638_ENERGIE_IAC_ROM_TABLES                  /* Orange: Missing left/right and coherence late reverb tables in binary format*/
#define FIX_WARNING_RENDER_CONFIG                       /* Orange: fix warning on windows build */
#define FIX_INV_DIFFUSE_WEIGHT                          /* Orange : Fix error in energy compensation in late binaural */


#define FIX_993_REMOVE_SBA_GET_ORDER                    /* VA: issue 993: remove unused function ivas_sba_get_order() */

//#define FIX_777_COMBI_RENDER_CONFIG_FILE                /* Philips: Fix for combined renderer config file support */
#define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS            /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */
/* #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF   */           /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */

#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION          /* FhG: issue #1008, external orientation init was wrong for 5ms */
#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic swithcing of acoustic environment */
#define FIX_1009_ISM_NONDIEGETIC_PANNING                /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan      */
#define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER                  /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */
#define FIX_998_UNUSED_FUNCTION                         /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ 
#define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO              /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */
#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING       /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */
#define NONBE_FIX_1006_PAST_DMX_NRG_ERROR               /* Eri/FhG: Issue 1006: Bug fix in ivas_stereo_dft_dec not replicated in ivas_stereo_dft_dec_dmx */
#define FIX_777_COMBI_RENDER_CONFIG_FILE                /* Philips: Fix for combined renderer config file support */
#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF              /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */

#define FIX_1024_REMOVE_PARAMMC_MIXING_MAT              /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */
#define FIX_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define NONBE_FIX_1034_DRY_MASA_RATIOS                  /* Nokia: Fix issue 1034, use of wrong numDir state. */
#define NONBE_FIX_1021_ISM_BRIR_RS_FLUSH                /* FhG: issue #1021: fix ISM with JBM and RS renderer flushing*/

/* #################### End BASOP porting switches ############################ */

+0 −6
Original line number Diff line number Diff line
@@ -1034,7 +1034,6 @@ static void ivas_binaural_obtain_DMX_fx(
            set32_fx( outRealRightPtr_fx, 0, CLDFB_NO_CHANNELS_MAX );
            set32_fx( outImagRightPtr_fx, 0, CLDFB_NO_CHANNELS_MAX );

#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
            /*Ambisonics input requires different processing*/
            if ( EQ_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) )
            {
@@ -1057,7 +1056,6 @@ static void ivas_binaural_obtain_DMX_fx(
                }
            }
            else
#endif
            {
                FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
                {
@@ -1422,11 +1420,7 @@ ivas_error ivas_binRenderer_open_fx(
#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM
        IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 )
#else
#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
        IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) )
#else
        IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 )
#endif
#endif
        {
            FOR( k = 0; k < 11; k++ )
Loading