Commit d394fe4d authored by emerit's avatar emerit
Browse files

Merge branch 'main' into hrtf_binary

parents a07f86c5 a7f40356
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ void ivas_ls_custom_setup(
    hOutSetup->num_lfe = hLsSetupCustom->num_lfe;
    hOutSetup->index_lfe[0] = hLsSetupCustom->lfe_idx[0]; /* IVAS_OUTPUT_SETUP only supports 1 LFE */

    hOutSetup->is_loudspeaker_setup = true;
    hOutSetup->is_planar_setup = (uint8_t) hLsSetupCustom->is_planar_setup;
    hOutSetup->is_loudspeaker_setup = TRUE;
    hOutSetup->is_planar_setup = (int8_t) hLsSetupCustom->is_planar_setup;

    return;
}
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ ivas_error ivas_render_config_init_from_rom(
#ifdef DEBUGGING
    ( *hRenderConfig )->renderer_type_override = RENDER_TYPE_OVERRIDE_NONE;
#endif
    ( *hRenderConfig )->roomAcoustics.override = false;
    ( *hRenderConfig )->roomAcoustics.override = FALSE;
    ( *hRenderConfig )->roomAcoustics.use_brir = room_flag_on;
    ( *hRenderConfig )->roomAcoustics.late_reverb_on = room_flag_on;
    ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS;
+6 −17
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@
#define CLDFB_CONVOLVER_NTAPS_MAX ( 16 )
#define FFT_SPECTRUM_SIZE         ( 1 + ( RV_FILTER_MAX_FFT_SIZE / 2 ) )

#define N_INITIAL_IGNORED_FRAMES 4
#define NUM_CLDFB_TAPES          7

/*-----------------------------------------------------------------------------------------*
 * Local function prototypes
@@ -218,11 +220,7 @@ static void get_IR_from_filter_taps(
    float *pOut_l,
    float *pOut_r )
{
    const int16_t n_initial_ignored_frames = 4;
    const int16_t num_cldfb_taps = 7;

    int16_t i, j, band_idx, block_idx, block_len, block_count, input_sample_idx, output_sample_idx, array_idx;
    int16_t is_ambisonics;
    HANDLE_CLDFB_FILTER_BANK handle_cldfb_analysis, handle_cldfb_synthesis_l, handle_cldfb_synthesis_r;
    cldfb_convolver_state convolver_state;
    float real_buffer_in[CLDFB_NO_CHANNELS_MAX];
@@ -231,17 +229,8 @@ static void get_IR_from_filter_taps(
    float out_CLDFB_imag[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* o  : imag part of Binaural signals     */
    float dirac_pls[CLDFB_NO_CHANNELS_MAX + 1];

    if ( ( input_audio_config == AUDIO_CONFIG_FOA ) || ( input_audio_config == AUDIO_CONFIG_HOA2 ) || ( input_audio_config == AUDIO_CONFIG_HOA3 ) )
    {
        is_ambisonics = true;
    }
    else
    {
        is_ambisonics = false;
    }

    block_len = (int16_t) ( sampling_rate * INV_CLDFB_BANDWIDTH );
    block_count = n_initial_ignored_frames + ( pulse_length / block_len );
    block_count = N_INITIAL_IGNORED_FRAMES + ( pulse_length / block_len );

    set_f( dirac_pls, 0, block_len + 1 );
    dirac_pls[0] = 1.0f;
@@ -249,7 +238,7 @@ static void get_IR_from_filter_taps(
    output_sample_idx = 0;

    /* Assign CLDFB taps */
    if ( is_ambisonics )
    if ( input_audio_config == AUDIO_CONFIG_FOA || input_audio_config == AUDIO_CONFIG_HOA2 || input_audio_config == AUDIO_CONFIG_HOA3 )
    {
        for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ )
        {
@@ -358,7 +347,7 @@ static void get_IR_from_filter_taps(
            }
        }

        ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, num_cldfb_taps );
        ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, NUM_CLDFB_TAPES );

        ppRealBuf[0] = out_CLDFB_real[0];
        ppImagBuf[0] = out_CLDFB_imag[0];
@@ -373,7 +362,7 @@ static void get_IR_from_filter_taps(
            input_sample_idx = 1;
        }

        if ( block_idx >= n_initial_ignored_frames )
        if ( block_idx >= N_INITIAL_IGNORED_FRAMES )
        {
            output_sample_idx += block_len;
        }
+6 −6
Original line number Diff line number Diff line
@@ -90,17 +90,17 @@ static int16_t read_bool(

    if ( sscanf( pLine, "%s", (char *) &value ) != 1 )
    {
        return true;
        return TRUE;
    }
    if ( strcmp( value, "TRUE" ) == 0 )
    {
        *pTarget = true;
        return false;
        *pTarget = TRUE;
        return FALSE;
    }
    if ( strcmp( value, "FALSE" ) == 0 )
    {
        *pTarget = false;
        return false;
        *pTarget = FALSE;
        return FALSE;
    }

    return true;
@@ -418,7 +418,7 @@ ivas_error RenderConfigReader_read(
                pValue = (char *) calloc( strlen( pParams ), sizeof( char ) );
                while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 )
                {
                    hRenderConfig->room_acoustics.override = true;
                    hRenderConfig->room_acoustics.override = TRUE;
                    params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 );
#ifdef DEBUGGING
                    fprintf( stderr, "        PARAM: %s -> %s\n", item, pValue );