Commit 83b45d2d authored by liksonov's avatar liksonov
Browse files

Merge branch 'main' into 15-move-proximity-mixing-to-the-decoder

parents aee5f1b4 abfc13af
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+6 −1
Original line number Diff line number Diff line
@@ -152,6 +152,11 @@

#define LBR_SBA_CORE_CODING_TUNING                      /* Contribution "3 Core Coder Tuning for low bitrate SBA with 2 TCs" */

#define FIX_WRONG_NBANDS_IN_ITD_ESTIMATION              /* Issue 85: fix incorrect setting of nbands in calc_mean_E_ratio() if bwidth is limited on commandline*/


#define FIX_I87                                         /*  fix for issue 86: incorrect Ambisonics order set for head rotation in SBA */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+25 −0
Original line number Diff line number Diff line
@@ -263,6 +263,10 @@ void ivas_renderer_select(
    AUDIO_CONFIG output_config;
    AUDIO_CONFIG transport_config;

 #ifdef FIX_I87
    int16_t nchan_internal;
#endif

    renderer_type = &( st_ivas->renderer_type );
    internal_config = &( st_ivas->intern_config );
    output_config = st_ivas->hDecoderConfig->output_config;
@@ -355,6 +359,26 @@ void ivas_renderer_select(

            if ( st_ivas->hDecoderConfig->Opt_Headrotation )
            {

#ifdef FIX_I87
                nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_order );
                if ( nchan_internal == 2 )
                {
                    st_ivas->hHeadTrackData->shd_rot_max_order = 1;
                }
                else if ( nchan_internal == 4 || nchan_internal == 3 )
                {
                    st_ivas->hHeadTrackData->shd_rot_max_order = 0;
                }
                else if ( nchan_internal == 6 || nchan_internal == 5 )
                {
                    st_ivas->hHeadTrackData->shd_rot_max_order = 2;
                }
                else if ( nchan_internal == 8 || nchan_internal == 7 )
                {
                    st_ivas->hHeadTrackData->shd_rot_max_order = 3;
                }
#else
                if ( st_ivas->nchan_transport == 2 )
                {
                    st_ivas->hHeadTrackData->shd_rot_max_order = 1;
@@ -371,6 +395,7 @@ void ivas_renderer_select(
                {
                    st_ivas->hHeadTrackData->shd_rot_max_order = 3;
                }
#endif
            }
        }
        else if ( st_ivas->ivas_format == MC_FORMAT )
+14 −0
Original line number Diff line number Diff line
@@ -446,7 +446,9 @@ static float calc_mean_E_ratio(
    ITD_DATA_HANDLE hItd,
    int16_t nbands,
    int16_t band_limits[],
#ifndef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
    const int16_t NFFT,
#endif
    const float sfm,
    const float nrg_L[STEREO_DFT_N_32k_ENC / 2],
    const float nrg_R[STEREO_DFT_N_32k_ENC / 2],
@@ -467,7 +469,11 @@ static float calc_mean_E_ratio(
    grand_sum_xcorr_img = 0.0f;

    /*take bands up to 32kHz bandwidth as ITD is always calculated at 32kHz sampling rate*/
#ifdef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
    nbands -= ( band_limits[nbands] > STEREO_DFT_N_32k_ENC / 2 );
#else
    nbands -= ( NFFT > STEREO_DFT_N_32k_ENC );
#endif

    sum_Er = 0;
    for ( b = 0; b < nbands; b++ )
@@ -1238,7 +1244,11 @@ void stereo_dft_enc_compute_itd(
    /*calculate mean E ratio of main to background signal for cohSNR*/
    if ( hCPE->element_mode == IVAS_CPE_DFT )
    {
#ifdef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
        mEr = calc_mean_E_ratio( hItd, hStereoDft->nbands, hStereoDft->band_limits, sfm_L, pNrgL, pNrgR, &total_mEr );
#else
        mEr = calc_mean_E_ratio( hItd, hStereoDft->nbands, hStereoDft->band_limits, hStereoDft->NFFT, sfm_L, pNrgL, pNrgR, &total_mEr );
#endif
    }
    else
    {
@@ -1247,7 +1257,11 @@ void stereo_dft_enc_compute_itd(

        set_s( band_limits, 0, STEREO_DFT_BAND_MAX + 1 );
        set_band_limits( &nbands, band_limits, hCPE->hStereoMdct->hDft_ana->NFFT );
#ifdef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
        mEr = calc_mean_E_ratio( hItd, nbands, band_limits, sfm_L, pNrgL, pNrgR, &total_mEr );
#else
        mEr = calc_mean_E_ratio( hItd, nbands, band_limits, hCPE->hStereoMdct->hDft_ana->NFFT, sfm_L, pNrgL, pNrgR, &total_mEr );
#endif
    }

    /*calculate total cohSNR for frame in dB*/