Commit a94b819d authored by vaillancour's avatar vaillancour
Browse files

propose fix for 826, increasing precision in icBWE and lowering noise floor in BWE in general

parent 96c285ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@
#define FIX_802__NON_BE_DECODING                    /* Fix possible difference float and fixed point when computing the GSC bit allocation */
#define FIX_802_1137_1137_GSC_IVAS_FXFLT_DECODING   /* VA: ISSUES 802 and 1137 Made sure that float and fixed point GCS bit allocation is the same during IVAS modes  */
#define FIX_810_PREVENT_UNECESSARY_SAT_IN_TC        /* VA : Prevent an unnecessary saturation that can happen in TC, have a minimal impact on most cases. Significant improvement for the last segment of LTV when TC is triggered */
#define FIX_826_PRECISION_LOST_AND_COMPL /// TV
/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+10 −0
Original line number Diff line number Diff line
@@ -1215,7 +1215,10 @@ ivas_error ivas_core_dec_fx(
            {
                Copy_Scale_sig_16_32( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, ( Q11 + q ) );
            }

#ifndef FIX_826_PRECISION_LOST_AND_COMPL            
            Copy_Scale_sig_16_32( synth_fxl, synth_32_fx[n], L_FRAME48k, ( Q11 + q ) );
#endif
            Scale_sig( st->hBWE_TD->state_lpc_syn_fx, LPC_SHB_ORDER, -( Q8 - st->prev_Q_bwe_syn ) );
            Scale_sig32( st->hBWE_TD->genSHBsynth_Hilbert_Mem_fx, HILBERT_MEM_SIZE, -( st->prev_Q_bwe_syn2 - Q11 ) );
            Copy_Scale_sig_16_32( st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, 2 * ALLPASSSECTIONS_STEEP, -( st->prev_Q_bwe_syn2 - Q11 ) );
@@ -1351,10 +1354,17 @@ ivas_error ivas_core_dec_fx(
                move16();
                FOR( i = 0; i < tmps; i++ )
                {

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
                    tmp_buffer_fx[i] = round_fx( L_add( L_shr( L_mult( st->hb_prev_synth_buffer_fx[i], sin_table256_fx[255 - tmp16] ), 1 ), L_shr( L_mult( st->hb_prev_synth_buffer_fx[sub( sub( st->old_bwe_delay, 1 ), i )], sin_table256_fx[tmp16] ), 1 ) ) );
                    move16();
                    tmp_buffer_fx[i] = shl_sat( tmp_buffer_fx[i], 1 );
                    move16();
#else
                    tmp_buffer_fx[i] = round_fx_sat( L_mac_sat( L_mult( st->hb_prev_synth_buffer_fx[i], sin_table256_fx[sub( 255, tmp16 )] ), st->hb_prev_synth_buffer_fx[sub( sub( st->old_bwe_delay, 1 ), i )], sin_table256_fx[tmp16] ) );
                    move16();
#endif

                    tmp16 = add( tmp16, incr );
                }
                Copy( tmp_buffer_fx, st->hb_prev_synth_buffer_fx, tmps );
+4 −0
Original line number Diff line number Diff line
@@ -322,7 +322,11 @@ typedef struct stereo_dft_dec_data_struct

    Word16 Q_nrg_subr;
    Word16 prev_Q_stefi_sig;
#ifdef FIX_826_PRECISION_LOST_AND_COMPL
    Word16 q_td_gain[STEREO_DFT_CORE_HIST_MAX];
#else
    Word32 q_td_gain[STEREO_DFT_CORE_HIST_MAX];
#endif
    Word16 q_hb_stefi_sig_fx;
#endif

+8 −1
Original line number Diff line number Diff line
@@ -202,8 +202,11 @@ void stereo_dft_dec_reset_fx(
    set32_fx( hStereoDft->hb_stefi_sig_fx, 0, L_FRAME48k + NS2SA( 48000, STEREO_DFT_TD_STEFI_DELAY_NS ) );
    set32_fx( hStereoDft->hb_nrg_fx, 0, STEREO_DFT_CORE_HIST_MAX );
    set32_fx( hStereoDft->td_gain_fx, 0, STEREO_DFT_CORE_HIST_MAX );
#ifdef FIX_826_PRECISION_LOST_AND_COMPL
    set16_fx( hStereoDft->q_td_gain, 0, STEREO_DFT_CORE_HIST_MAX );
#else
    set32_fx( hStereoDft->q_td_gain, 0, STEREO_DFT_CORE_HIST_MAX );

#endif
    hStereoDft->q_dft = 0;
    move16();

@@ -668,7 +671,11 @@ void stereo_dft_dec_update_fx(
    Copy32( hStereoDft->hb_stefi_sig_fx + output_frame, hStereoDft->hb_stefi_sig_fx, hStereoDft->hb_stefi_delay );
    Copy32( hStereoDft->hb_nrg_fx, hStereoDft->hb_nrg_fx + 1, STEREO_DFT_CORE_HIST_MAX - 1 );
    Copy32( hStereoDft->td_gain_fx, hStereoDft->td_gain_fx + 1, STEREO_DFT_CORE_HIST_MAX - 1 );
#ifdef FIX_826_PRECISION_LOST_AND_COMPL
    Copy( hStereoDft->q_td_gain, hStereoDft->q_td_gain + 1, STEREO_DFT_CORE_HIST_MAX - 1 );
#else
    Copy32( hStereoDft->q_td_gain, hStereoDft->q_td_gain + 1, STEREO_DFT_CORE_HIST_MAX - 1 );
#endif

    IF( sba_dirac_stereo_flag )
    {
+224 −11

File changed.

Preview size limit exceeded, changes collapsed.