Commit 735576df authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch '1623_basop_port_fl1450_1459_cleanup' into 'main-pc'

Port MRs 1450 and 1459 into main-pc

See merge request !1832
parents 8a6654bb d3da440b
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1155,9 +1155,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 +4921,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()
+0 −8
Original line number Diff line number Diff line
@@ -119,17 +119,9 @@
#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_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 */


/* #################### End BASOP porting switches ############################ */
+0 −6
Original line number Diff line number Diff line
@@ -1015,7 +1015,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 ) )
            {
@@ -1038,7 +1037,6 @@ static void ivas_binaural_obtain_DMX_fx(
                }
            }
            else
#endif
            {
                FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
                {
@@ -1397,11 +1395,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++ )
+0 −83
Original line number Diff line number Diff line
@@ -2752,42 +2752,6 @@ void ivas_dirac_dec_render_sf_fx(
        {
            masa_band_mapping = st_ivas->hMasa->data.band_mapping;
        }
#ifndef FIX_998_UNUSED_FUNCTION
        test();
        test();
        IF( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && EQ_16( st_ivas->hCombinedOrientationData->shd_rot_max_order, 1 ) )
        {
            ivas_dirac_dec_compute_directional_responses_fx( hSpatParamRendCom,
                                                             hDirACRend,
                                                             st_ivas->hVBAPdata,
                                                             masa_band_mapping,
                                                             st_ivas->hMasaIsmData,
                                                             azimuth,
                                                             elevation,
                                                             md_idx,
                                                             surCohRatio_fx,
                                                             surCohRatio_q_fx,
                                                             st_ivas->hCombinedOrientationData->shd_rot_max_order,
                                                             p_Rmat_fx,
                                                             hodirac_flag );
        }
        ELSE
        {
            ivas_dirac_dec_compute_directional_responses_fx( hSpatParamRendCom,
                                                             hDirACRend,
                                                             st_ivas->hVBAPdata,
                                                             masa_band_mapping,
                                                             st_ivas->hMasaIsmData,
                                                             azimuth,
                                                             elevation,
                                                             md_idx,
                                                             surCohRatio_fx,
                                                             surCohRatio_q_fx,
                                                             0,
                                                             NULL,
                                                             hodirac_flag );
        }
#else
        ivas_dirac_dec_compute_directional_responses_fx( hSpatParamRendCom,
                                                         hDirACRend,
                                                         st_ivas->hVBAPdata,
@@ -2799,8 +2763,6 @@ void ivas_dirac_dec_render_sf_fx(
                                                         surCohRatio_fx,
                                                         surCohRatio_q_fx,
                                                         hodirac_flag );

#endif
    }

    test();
@@ -3316,50 +3278,6 @@ void ivas_dirac_dec_render_sf_fx(
            move16();
        }

#ifndef FIX_998_UNUSED_FUNCTION
        test();
        test();
        IF( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 )
        {
            ivas_dirac_dec_output_synthesis_process_slot_fx( reference_power_fx,
                                                             DirAC_mem.reference_power_q,
                                                             p_onset_filter_fx,
                                                             azimuth,
                                                             elevation,
                                                             hSpatParamRendCom->diffuseness_vector_fx[md_idx],
                                                             hSpatParamRendCom->q_diffuseness_vector,
                                                             hSpatParamRendCom,
                                                             hDirACRend,
                                                             st_ivas->hCombinedOrientationData->shd_rot_max_order,
                                                             p_Rmat_fx,
                                                             st_ivas->hVBAPdata,
                                                             hDirACRend->hOutSetup,
                                                             nchan_transport,
                                                             md_idx,
                                                             hodirac_flag,
                                                             hDirAC->hConfig->dec_param_estim );
        }
        ELSE
        {
            ivas_dirac_dec_output_synthesis_process_slot_fx( reference_power_fx,
                                                             DirAC_mem.reference_power_q,
                                                             p_onset_filter_fx,
                                                             azimuth,
                                                             elevation,
                                                             hSpatParamRendCom->diffuseness_vector_fx[md_idx],
                                                             hSpatParamRendCom->q_diffuseness_vector,
                                                             hSpatParamRendCom,
                                                             hDirACRend,
                                                             0,
                                                             0,
                                                             st_ivas->hVBAPdata,
                                                             hDirACRend->hOutSetup,
                                                             nchan_transport,
                                                             md_idx,
                                                             hodirac_flag,
                                                             hDirAC->hConfig->dec_param_estim );
        }
#else
        ivas_dirac_dec_output_synthesis_process_slot_fx( reference_power_fx,
                                                         DirAC_mem.reference_power_q,
                                                         p_onset_filter_fx,
@@ -3376,7 +3294,6 @@ void ivas_dirac_dec_render_sf_fx(
                                                         hodirac_flag,
                                                         hDirAC->hConfig->dec_param_estim );

#endif

        IF( hDirAC->hConfig->dec_param_estim )
        {
Loading