Commit c765d162 authored by vaclav's avatar vaclav
Browse files

Merge branch '1881-basop-PortFlpMr1641' into 'main'

Port MR1641 from float to BASOP

Closes #1881

See merge request !2018
parents 439040f8 afb52b19
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@
#define NONBE_FIX_MC_LFE_LPF                                  /* Dlb: Adding the LFE LPF filter back for MC content. */
#define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR            /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */
#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS              /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */
#define NONBE_FIX_1130_DIV_ZERO_LEV_DUR                 /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */

#define FIX_1111_TDM_LSP_BUFFER                         /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */
#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC              /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */
+15 −0
Original line number Diff line number Diff line
@@ -784,6 +784,15 @@ void wb_tbe_enc_fx(

    autocorr_fx( hb_old_speech, LPC_SHB_ORDER_WB + 1, R_h, R_l, &Q_R, WBTBE_LPCWIN_LENGTH, win_lpc_hb_wb_fx, 0, 1 );

#ifdef NONBE_FIX_1130_DIV_ZERO_LEV_DUR
    if ( st_fx->element_mode > EVS_MONO )
    {
        /* Ensure R[0] isn't zero when entering Levinson-Durbin */
        R_l[0] = s_max( R_l[0], 1 );
        move16();
    }
#endif

    E_LPC_lev_dur( R_h, R_l, lpc_wb_temp_fx, LepsP, LPC_SHB_ORDER_WB, NULL );

    Copy_Scale_sig( lpc_wb_temp_fx, lpc_wb_temp_fx, LPC_SHB_ORDER_WB + 1, sub( norm_s( lpc_wb_temp_fx[0] ), 2 ) );
@@ -1381,6 +1390,12 @@ void wb_tbe_enc_ivas_fx(

    autocorr_fx( hb_old_speech, LPC_SHB_ORDER_WB + 1, R_h, R_l, &Q_R, ( ( NS2SA( INT_FS_12k8, 5000000L ) + L_SUBFR + L_FRAME ) * 5 / 16 ), win_lpc_hb_wb_ivas_fx, 0, 1 );

#ifdef NONBE_FIX_1130_DIV_ZERO_LEV_DUR
    /* Ensure R[0] isn't zero when entering Levinson-Durbin */
    R_l[0] = s_max( R_l[0], 1 );
    move16();
#endif

    E_LPC_lev_dur( R_h, R_l, lpc_wb_temp_fx, LepsP, LPC_SHB_ORDER_WB, NULL ); // Since 0th index will be 1 in floating point buffer, in fixed point one has to take norm of 0th index to identify the Q-factor

    Copy_Scale_sig( lpc_wb_temp_fx, lpc_wb_temp_fx, LPC_SHB_ORDER_WB + 1, sub( norm_s( lpc_wb_temp_fx[0] ), 2 ) ); // Q12