Commit dc75a20e authored by vaclav's avatar vaclav
Browse files

Merge branch '1704_basop_PortFlpMR1487' into 'main'

Port MR1487 from float to BASOP

Closes #1704

See merge request !1788
parents a2c5446e 507e97b1
Loading
Loading
Loading
Loading
+4 −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  */
+43 −0
Original line number Diff line number Diff line
@@ -1270,7 +1270,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();
@@ -1302,7 +1314,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 ) )
    {
@@ -3822,11 +3849,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 */
@@ -3859,6 +3901,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 );
                }
+24 −0
Original line number Diff line number Diff line
@@ -532,7 +532,13 @@ ivas_error ivas_masa_decode_fx(
        hMasa->config.coherencePresent = !hQMetaData->all_coherence_zero;
        move16();

#ifdef FIX_1052_EXT_OUTPUT
        test();
        test();
        IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && ( EQ_32( ivas_format, MASA_FORMAT ) || EQ_32( ivas_format, MASA_ISM_FORMAT ) ) )
#else
        IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
#endif
        {
            index_16bits_fx( hQMetaData, hMasa->data.sph_grid16 );
        }
@@ -825,7 +831,13 @@ ivas_error ivas_masa_dec_open_fx(
    move16();

    /* Create spherical grid only for external output */
#ifdef FIX_1052_EXT_OUTPUT
    test();
    test();
    IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && ( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) )
#else
    IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
#endif
    {
        IF( ( hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ) ) == NULL )
        {
@@ -1366,13 +1378,25 @@ static ivas_error init_lfe_synth_data_fx(
    test();
    test();
    test();
#ifdef FIX_1052_EXT_OUTPUT
    test();
    IF( st_ivas->hOutSetup.separateChannelEnabled &&
        ( EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA2 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA3 ) ||
          ( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && ( st_ivas->hOutSetup.num_lfe > 0 ) ) ) )
#else
    IF( st_ivas->hOutSetup.separateChannelEnabled &&
        ( EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA2 ) ||
          EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA3 ) ||
          ( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && ( st_ivas->hOutSetup.num_lfe > 0 ) ) ) )
#endif
    {
        Word16 bufferSize;
        Word16 i;
+4 −0
Original line number Diff line number Diff line
@@ -165,7 +165,11 @@ ivas_error ivas_param_mc_dec_open_fx(
    test();
    test();
    test();
#ifdef FIX_1052_EXT_OUTPUT
    IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || EQ_32( st_ivas->transport_config, output_config ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
#else
    IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || EQ_32( st_ivas->transport_config, output_config ) )
#endif
    {
        hParamMC->synthesis_conf = PARAM_MC_SYNTH_DIRECT;
        move32();
Loading