Commit 00e7c8fc authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

MSAN fixes

parent 9cb31d7d
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -947,6 +947,9 @@ void core_signal_analysis_high_bitrate_ivas_fx(
                Copy_Scale_sig_16_32( tcx20Win, windowed_samples + frameno * L_FRAME_MAX + 2, L_subframe + ( left_overlap + right_overlap ) / 2, 0 );
                *q_win = s_min( *q_win, sub( L_norm_arr( windowed_samples + frameno * L_FRAME_MAX + 2, L_subframe + ( left_overlap + right_overlap ) / 2 ), 1 ) );
                move16();
#ifdef MSAN_FIX
                Scale_sig32( windowed_samples + frameno * L_FRAME_MAX + 2, win_len, *q_win );
#endif
            }
        }

@@ -1400,6 +1403,7 @@ void core_signal_analysis_high_bitrate_ivas_fx(
        }
    }

#ifndef MSAN_FIX
    IF( windowed_samples != NULL )
    {
        FOR( frameno = 0; frameno < nSubframes; frameno++ )
@@ -1410,6 +1414,7 @@ void core_signal_analysis_high_bitrate_ivas_fx(
            }
        }
    }
#endif

    IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
    {
+16 −0
Original line number Diff line number Diff line
@@ -126,7 +126,9 @@ ivas_error ivas_core_enc(
    FOR( i = 0; i < CPE_CHANNELS; i++ )
    {
        set_zero_fx( bwe_exc_extended_fx[i], L_FRAME32k + NL_BUFF_OFFSET );
        set16_fx( old_syn_12k8_16k_fx[i], 0, L_FRAME16k );
    }
    set16_fx( shb_speech_fx, 0, L_FRAME16k );
#endif

    push_wmops( "ivas_core_enc" );
@@ -216,6 +218,19 @@ ivas_error ivas_core_enc(
        /*---------------------------------------------------------------------*
         * Pre-processing, incl. Decision matrix
         *---------------------------------------------------------------------*/
#ifdef MSAN_FIX
        IF( st->cldfbAnaEnc )
        {
            Word16 tmp_shift = getScaleFactor32( enerBuffer_fx[n], st->cldfbAnaEnc->no_channels );
            tmp_shift = sub( tmp_shift, 5 );
            IF( tmp_shift < 0 )
            {
                scale_sig32( enerBuffer_fx[n], st->cldfbAnaEnc->no_channels, tmp_shift );
                enerBuffer_fx_exp[n] = sub( enerBuffer_fx_exp[n], tmp_shift );
                move16();
            }
        }
#else
        Word16 tmp_shift = getScaleFactor32( enerBuffer_fx[n], CLDFB_NO_CHANNELS_MAX );
        tmp_shift = sub( tmp_shift, 5 );
        IF( tmp_shift < 0 )
@@ -224,6 +239,7 @@ ivas_error ivas_core_enc(
            enerBuffer_fx_exp[n] = sub( enerBuffer_fx_exp[n], tmp_shift );
            move16();
        }
#endif

        Scale_sig( fft_buff_fx[n], ( 2 * L_FFT ), -1 ); // To create 1 headroom for addition of magnitude square spectrum
                                                        // fft_buff_fx_exp = add(fft_buff_fx_exp,1);
+4 −0
Original line number Diff line number Diff line
@@ -568,6 +568,10 @@ void stereo_mdct_core_enc_fx(

    FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
    {
#ifdef MSAN_FIX
        set32_fx( mdst_spectrum_long_fx[ch], 0, N_MAX );
        set32_fx( orig_spectrum_long_fx[ch], 0, N_MAX );
#endif
        p_mdst_spectrum_long_fx[ch] = mdst_spectrum_long_fx[ch];
        p_orig_spectrum_long_fx[ch] = orig_spectrum_long_fx[ch];
        orig_spectrum_fx[ch][0] = orig_spectrum_long_fx[ch];
+1 −1
Original line number Diff line number Diff line
@@ -4434,7 +4434,7 @@ static void tonal_context_improv_fx(
    test();
    IF( st_fx->sp_aud_decision1 == 1 &&
        ( GT_32( L_min( L_min( tonality1, tonality2 ), tonality3 ), 1638400 ) ) &&
        ( GT_32( L_add( tonality1, tonality2 ), 6553600 ) && GT_32( L_add( tonality2, tonality3 ), 6553600 ) && GT_32( L_add( tonality1, tonality3 ), 6553600 ) ) &&
        ( GT_32( L_add_sat( tonality1, tonality2 ), 6553600 ) && GT_32( L_add_sat( tonality2, tonality3 ), 6553600 ) && GT_32( L_add_sat( tonality1, tonality3 ), 6553600 ) ) &&
        ( LT_32( hSpMusClas->lt_tonality, 655360000 ) ) &&
        ( ( GT_32( hSpMusClas->lt_tonality, 32768000 ) && GT_16( s_max( hSpMusClas->lt_voicing, voi_mean ), 32440 ) ) ||
          ( GT_32( hSpMusClas->lt_tonality, 49152000 ) && GT_16( hSpMusClas->lt_corr, 32440 ) ) ||