Commit e8e88453 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for crashes observed with scaled inputs in LTV test

[x] Fixes issue for:
+10dB
	1 ISM with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, EXT out, DTX on
-10dB
	4 ISM with and without extended metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out
	4 ISM with and without metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, HOA3 out

[x] Changes done in Q for generate_comfort_noise_dec_hf_ivas_fx and vas_ism_param_dec_tc_gain_ajust_fx updated with additional checks.
parent 629213ec
Loading
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -4479,7 +4479,7 @@ void generate_comfort_noise_dec_hf_ivas_fx(
        move16();
    }

    randGaussExp = CNG_RAND_GAUSS_SHIFT;
    randGaussExp = add( CNG_RAND_GAUSS_SHIFT, 1 );
    move16();

    /*
@@ -4503,16 +4503,16 @@ void generate_comfort_noise_dec_hf_ivas_fx(

                IF( cng_coh_flag )
                {
                    tmp1 = rand_gauss( seed );
                    tmp2 = rand_gauss( seed2 );
                    rand_gauss_fx( &tmp1, seed, Q28 );
                    rand_gauss_fx( &tmp2, seed2, Q28 );

                    bufferReal[i][j] = L_add( Mpy_32_16_1( tmp1, c1 ), Mpy_32_16_1( tmp2, c2 ) );
                    move32();
                    bufferReal[i][j] = L_shl( Mpy_32_32( bufferReal[i][j], sqrtNoiseLevel ), s );
                    move32();

                    tmp1 = rand_gauss( seed );
                    tmp2 = rand_gauss( seed2 );
                    rand_gauss_fx( &tmp1, seed, Q28 );
                    rand_gauss_fx( &tmp2, seed2, Q28 );

                    bufferImag[i][j] = L_add( Mpy_32_16_1( tmp1, c1 ), Mpy_32_16_1( tmp2, c2 ) );
                    move32();
@@ -4522,11 +4522,11 @@ void generate_comfort_noise_dec_hf_ivas_fx(
                ELSE
                {
                    /* Real part in CLDFB band */
                    bufferReal[i][j] = L_shl( Mpy_32_32( rand_gauss( seed ), sqrtNoiseLevel ), s );
                    bufferReal[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s );
                    move32();

                    /* Imaginary part in CLDFB band */
                    bufferImag[i][j] = L_shl( Mpy_32_32( rand_gauss( seed ), sqrtNoiseLevel ), s );
                    bufferImag[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s );
                    move32();
                }
            }
+14 −5
Original line number Diff line number Diff line
@@ -2591,12 +2591,21 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
    }
    ELSE
    {
        /*handling denominator equals to zero*/
        IF( ene_tc_fx == 0 ) /*handling numerator equals to zero*/
        {
            gain_fx = 0;
            move16();
            tmp_e1 = 31;
            move16();
        }
        ELSE
        { /*handling denominator equals to zero*/
            gain_fx = 1;
            move16();
            tmp_e1 = -32767;
            move16();
        }
    }
    tmp_e1 = add( tmp_e1, sub( ene_tc_e, ene_sum_e ) ); /* tmp_e1 + (ene_tc_e - ene_sum_e)*/
    gain_fx = Sqrt16( gain_fx, &tmp_e1 );