Commit b3e3f296 authored by liksonov's avatar liksonov
Browse files

Update proximity-based mixing code.

parent ee1649a4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -425,11 +425,19 @@ int main(
        IVAS_RENDER_CONFIG_DATA renderConfig;

        /* sanity check */
#ifndef I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER
        if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM )
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n" );
            goto cleanup;
        }
#else
        if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_MONO )
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM or MONO is used as output. Exiting. \n" );
            goto cleanup;
        }
#endif

        if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK )
        {
+3 −0
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
    int16_t override;
    int16_t use_brir;
    int16_t late_reverb_on;
#ifdef I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER
    int16_t do_proximity_mixing;
#endif
    int16_t nBands;                                   /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */
    float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX];      /* Center frequencies for which following values are provided: */
    float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /*  - The room's T60 per center frequency */
+7 −0
Original line number Diff line number Diff line
@@ -4753,9 +4753,16 @@ void computeReferencePower_enc(
);


#ifndef I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER
ivas_error ivas_mono_dmx_renderer_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                           */
);
#else /* I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER */
ivas_error ivas_mono_dmx_renderer_open(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                           */
    const int16_t do_proximity_mixing                           /* i  : flag to enable proximity-based mixing            */
);
#endif /* I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER */

void ivas_mono_downmix_render_passive(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                */
+1 −2
Original line number Diff line number Diff line
@@ -134,8 +134,6 @@

/* ################# Start DEVELOPMENT switches ######################## */

/* #define ENABLE_PROX_BASED_MIXING */                  /* Enable proximity-based mixing */

#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
#define BITSTREAM_INDICES_MEMORY                        /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */

@@ -150,6 +148,7 @@
/*#define FIX_IVAS_185_MDCT_ST_PLC_FADEOUT*/            /* IVAS-185 fix bug in TCX-PLC fadeout for MDCT-Stereo and improve fadeout by fading to background noise instead of white noise */
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER       /* Implement proximity-based mixing in ISM decoder/renderer */

#define DIRAC_DRCT_GAIN_TUNING                          /* issue 64: tuning of DirAC energy-compensation gains */
#define MDFT_ROM_OPTIMIZE                               /*Optimise ROM tables for MDFT/iMDFT*/
+9 −0
Original line number Diff line number Diff line
@@ -584,7 +584,12 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize Binaural Renderer configuration handle
     *--------------------------------------------------------------------*/

#ifndef I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER
    if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM )
#else
    if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM ||
        st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO )
#endif
    {
        if ( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ) != IVAS_ERR_OK )
        {
@@ -1244,7 +1249,11 @@ ivas_error ivas_init_decoder(
    }
    else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
    {
#ifndef I15_IMPLEMENT_PROX_MIXING_FOR_ISM_DECODER
        if ( ( error = ivas_mono_dmx_renderer_open( st_ivas ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_mono_dmx_renderer_open( st_ivas, st_ivas->hRenderConfig->roomAcoustics.do_proximity_mixing ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
Loading