Commit 4f09f8bc authored by reutelhuber's avatar reutelhuber
Browse files

Merge branch '436-complexity-optimization-of-adaptive-smoothing-in-low-bitrate-sba' into 'main'

[Non-BE] Resolve "Complexity optimization of adaptive smoothing in low-bitrate SBA"

See merge request !610
parents 0f5c89cd 87a64e49
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@
#define FIX_427_MAXIMUM_S_INDEX                         /* VA: issue 427: fix return index of function maximum_s() */
#define FIX_431_PARAMMC_PLC_INTERPOLATOR                /* FhG: Issue 431: fix missing interpolator reset for ParamMC PCL */
#define FIX_391_SBA                                     /* Dlb: Fix for issue 391 for SBA */
#define LBR_ADAP_SMOOTHING_OPT                          /* FhG: Issue 436: complexity optimization of adaptive smoothing in low-bitrate SBA */

#define FIX_425_MASA_BRSW_RENDERER                      /* Nokia: Issue 425: renderer not reconfigure in MASA bitrate switching */

lib_dec/ivas_spar_decoder.c

100644 → 100755
+8 −0
Original line number Diff line number Diff line
@@ -1315,10 +1315,14 @@ void ivas_spar_dec_upmixer(

        if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) )
        {
#ifdef LBR_ADAP_SMOOTHING_OPT
            ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf );
#else
            for ( in_ch = 0; in_ch < numch_in; in_ch++ )
            {
                ivas_spar_calc_smooth_facs( cldfb_in_ts_re[in_ch], cldfb_in_ts_im[in_ch], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac[in_ch], hSpar->hMdDec->smooth_buf[in_ch] );
            }
#endif
        }

        for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ )
@@ -1334,7 +1338,11 @@ void ivas_spar_dec_upmixer(
                    {
                        for ( in_ch = 0; in_ch < numch_in; in_ch++ )
                        {
#ifdef LBR_ADAP_SMOOTHING_OPT
                            mixer_mat[out_ch][in_ch][spar_band] = ( 1 - hSpar->hMdDec->smooth_fac[spar_band] ) * mixer_mat[out_ch][in_ch][spar_band] + hSpar->hMdDec->smooth_fac[spar_band] * hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band];
#else
                            mixer_mat[out_ch][in_ch][spar_band] = ( 1 - hSpar->hMdDec->smooth_fac[in_ch][spar_band] ) * mixer_mat[out_ch][in_ch][spar_band] + hSpar->hMdDec->smooth_fac[in_ch][spar_band] * hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band];
#endif
                            hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band] = mixer_mat[out_ch][in_ch][spar_band];
                        }
                    }

lib_dec/ivas_spar_md_dec.c

100644 → 100755
+8 −0
Original line number Diff line number Diff line
@@ -618,6 +618,13 @@ ivas_error ivas_spar_md_dec_init(
    set_f( hMdDec->spar_md.en_ratio_slow, 0.0f, IVAS_MAX_NUM_BANDS );
    set_f( hMdDec->spar_md.ref_pow_slow, 0.0f, IVAS_MAX_NUM_BANDS );

#ifdef LBR_ADAP_SMOOTHING_OPT
    set_zero( hMdDec->smooth_fac, IVAS_MAX_NUM_BANDS );
    for ( i = 0; i < IVAS_MAX_NUM_BANDS; i++ )
    {
        set_zero( hMdDec->smooth_buf[i], 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 );
    }
#else
    for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ )
    {
        set_zero( hMdDec->smooth_fac[i], IVAS_MAX_NUM_BANDS );
@@ -629,6 +636,7 @@ ivas_error ivas_spar_md_dec_init(
            set_zero( hMdDec->smooth_buf[i][j], 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 );
        }
    }
#endif
    for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ )
    {
        for ( j = 0; j < IVAS_SPAR_MAX_CH; j++ )

lib_dec/ivas_stat_dec.h

100644 → 100755
+5 −2
Original line number Diff line number Diff line
@@ -809,14 +809,17 @@ typedef struct ivas_spar_md_dec_state_t
    int16_t table_idx;
    int16_t dtx_vad;
    int16_t spar_hoa_md_flag;

#ifdef SPAR_TUNING
    int16_t spar_hoa_dirac2spar_md_flag;
    int16_t HOA_md_ind[IVAS_SPAR_MAX_CH];
#endif

#ifdef LBR_ADAP_SMOOTHING_OPT
    float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1];
    float smooth_fac[IVAS_MAX_NUM_BANDS];
#else
    float smooth_buf[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1];
    float smooth_fac[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS];
#endif
    float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS];

} ivas_spar_md_dec_state_t;