Commit 3757acae authored by vaclav's avatar vaclav
Browse files

port MR

parent 70ac6cfe
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,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 */

/* #################### End BASOP porting switches ############################ */

+18 −1
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 ) );
@@ -1379,8 +1388,16 @@ void wb_tbe_enc_ivas_fx(
        }
    }

    //autocorr( hb_old_speech, R, LPC_SHB_ORDER_WB + 1, ( NS2SA( INT_FS_12k8, 5000000L ) + L_SUBFR + L_FRAME ) * 5 / 16, win_lpc_hb_wb, 0, 1, 1 );
    //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 );
    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