Commit b6aa4985 authored by multrus's avatar multrus
Browse files

Merge branch 'main' into 1640_basop_port-mr-1347-from-float

parents 46b60697 dc75a20e
Loading
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -488,18 +488,30 @@ int main(
            goto cleanup;
        }

#ifdef CONF_DISTATT
        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK )
#else
        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
            goto cleanup;
        }
#ifndef CONF_DISTATT
        FOR( Word16 i = 0; i < 4; i++ )
        {
            renderConfig.directivity_fx[i * 3] = (Word16) ( renderConfig.directivity[i * 3] * ( 1u << 6 ) );
            renderConfig.directivity_fx[i * 3 + 1] = (Word16) ( renderConfig.directivity[i * 3 + 1] * ( 1u << 6 ) );
            renderConfig.directivity_fx[i * 3 + 2] = (Word16) ( renderConfig.directivity[i * 3 + 2] * ( ( 1u << 15 ) - 1 ) );
        }

#endif
#ifdef CONF_DISTATT
        if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt_fx ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
            goto cleanup;
        }
#endif
        if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
               arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
+4 −0
Original line number Diff line number Diff line
@@ -347,6 +347,10 @@ typedef struct _IVAS_RENDER_CONFIG
    ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15}
#ifdef CONF_DISTATT
    float distAtt[3];
    Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

typedef struct
+5 −0
Original line number Diff line number Diff line
@@ -95,6 +95,10 @@
#define NONBE_FIX_984_OMASA_EXT_OUTPUT                        /* Nokia: issue #984: complete the OMASA EXT output implementation */
#define USE_NEW_HRTF_BINARY_FILE_FORMAT                 /* Orange: to activate when decided to change the hrtf binary file format */
#define FIX_WARNING_RENDER_CONFIG                       /* Orange: fix warning on windows build */

#define FIX_1052_EXT_OUTPUT                             /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ 


#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_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define FIX_1831_REVERB_REGRESSION                      /* Philips: fixes reverb regression issues  */
@@ -103,6 +107,7 @@
#define NONBE_FIX_ISM_XOVER_BR                          /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */
#define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP               /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */
#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */

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

+43 −0
Original line number Diff line number Diff line
@@ -1284,7 +1284,19 @@ ivas_error ivas_init_decoder_fx(
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
        test();
#endif
#ifdef FIX_1052_EXT_OUTPUT
        IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
        {
            hDecoderConfig->nchan_out = CPE_CHANNELS;
        }
        ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
        {
            hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config );
        }
        ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
#else
        IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
#endif
        {
            hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 );
            move16();
@@ -1316,7 +1328,22 @@ ivas_error ivas_init_decoder_fx(

    st_ivas->intern_config = output_config;
    move32();

#ifdef FIX_1052_EXT_OUTPUT
    IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
    {
        ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->transport_config );
        st_ivas->intern_config = st_ivas->transport_config;
        move32();
    }
    ELSE
    {
        ivas_output_init( &( st_ivas->hOutSetup ), output_config );
    }
#else
    ivas_output_init( &( st_ivas->hOutSetup ), output_config );
#endif

    test();
    IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) )
    {
@@ -3845,11 +3872,26 @@ static ivas_error doSanityChecks_IVAS(
        test();
        test();
        test();
#ifdef FIX_1052_EXT_OUTPUT
        test();
        IF( NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
#else
        IF( NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) )
#endif
        {
            return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" );
        }
    }
#ifdef FIX_1052_EXT_OUTPUT
    /* Verify output configuration for other formats */
    ELSE
    {
        IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_INVALID ) )
        {
            return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" );
        }
    }
#else
    ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) )
    {
        /* Verify ISM output configuration */
@@ -3882,6 +3924,7 @@ static ivas_error doSanityChecks_IVAS(
            return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" );
        }
    }
#endif

    IF( ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && NE_32( output_Fs, 48000 ) )
    {
+7 −2
Original line number Diff line number Diff line
@@ -1336,11 +1336,16 @@ ivas_error ivas_jbm_dec_tc_fx(
                test();
                test();
                test();
#ifdef FIX_1052_EXT_OUTPUT
                test();
                /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */
                IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) ||
                    EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) ||
                    EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || ( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && st_ivas->hOutSetup.num_lfe > 0 ) )
                    EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || ( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && st_ivas->hOutSetup.num_lfe > 0 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
#else
                /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */
                IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) ||
                    EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || ( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && st_ivas->hOutSetup.num_lfe > 0 ) )
#endif
                {
                    ivas_lfe_synth_with_filters_fx( st_ivas->hMasa->hMasaLfeSynth, p_output_fx, output_frame, n, LFE_CHANNEL );
                }
Loading