Commit 21cecc43 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'add_missing_instrumentation_for_881_bug_fix' into 'main'

Added missing instrumentation for MR !789 and bug fix in swb_tbe

See merge request !1082
parents aa507545 2544b74a
Loading
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -72,8 +72,9 @@ void GenSHBSynth_fx_32(
#ifdef FIX_881_HILBERT_FILTER
    Word16 shift = 0;
    Word32 maxm32, input_synspeech_temp[L_FRAME16k];
    move16();

    /* find the maximum value and derive the shift to improve precision of the Hilbert filter */
    /* find the maximum value and derive the shift to improve precision of the Hilber filter */
    maxm32 = L_deposit_l( 0 );
    FOR( i = 0; i < L_FRAME16k; i++ )
    {
@@ -98,7 +99,7 @@ void GenSHBSynth_fx_32(
        Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, shift );
        Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, shift );
    }
    else
    ELSE
    {
        Copy32( input_synspeech, input_synspeech_temp, L_FRAME16k );
    }
@@ -132,9 +133,9 @@ void GenSHBSynth_fx_32(
#ifdef FIX_881_HILBERT_FILTER
    IF( maxm32 != 0 )
    {
        Scale_sig32( shb_syn_speech_32k, L_FRAME32k, -shift );
        Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, -shift );
        Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, -shift );
        Scale_sig32( shb_syn_speech_32k, L_FRAME32k, negate( shift ) );
        Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, negate( shift ) );
        Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, negate( shift ) );
    }
#endif

+7 −0
Original line number Diff line number Diff line
@@ -3480,6 +3480,9 @@ void GenShapedSHBExcitation_ivas_enc_fx(
                    {
                        // g = 1.0f;
                        g = MAX16B; /* Q15 */
                        move16();
                        g_e = 0;
                        move16();
                    }
                    // else if ( g < shl( delta, ( 15 - g_e ) - 14 ) )
                    ELSE IF( BASOP_Util_Cmp_Mant32Exp( g, add( 16, g_e ), delta, 17 ) < 0 )
@@ -3487,8 +3490,12 @@ void GenShapedSHBExcitation_ivas_enc_fx(
                        /* prevent low gains to be quantized to 0 as this is reserved for plosives */
                        // g = delta;
                        g = shl( delta, 1 ); /* Q15 */
                        g_e = 0;
                        move16();
                    }

                    g = shl_sat( g, g_e ); /* Q15 */

                    *vf_ind = usquant_fx( g, &mix_factor, 0, delta, cbsize );
                    move16();
                }