Commit d6ab6885 authored by vaillancour's avatar vaillancour Committed by Sandesh Venkatesh
Browse files

change to no_sat on the encoder side for all the scale sig that had a risk of...

change to no_sat on the encoder side for all the scale sig that had a risk of overflowing depending of the past exp
parent 5f3c33d7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -145,8 +145,11 @@ void hq_core_enc_ivas_fx(
        Q_audio = sub( Q16, q );
        TCX_MDCT( wtda_audio_fx16, t_audio_fx, &Q_audio, left_overlap, sub( L_spec, shr( add( left_overlap, right_overlap ), 1 ) ), right_overlap, st->element_mode );
        Q_audio = sub( Q31, Q_audio );
#ifdef FIX_ISSUE_1237
        Copy_Scale_sig_16_32_no_sat( wtda_audio_fx16, wtda_audio_fx32, 2 * L_FRAME48k, sub( Q_audio, q ) ); /* Q_audio */
#else
        Copy_Scale_sig_16_32_DEPREC( wtda_audio_fx16, wtda_audio_fx32, 2 * L_FRAME48k, sub( Q_audio, q ) ); /* Q_audio */

#endif
        inner_frame = inner_frame_tbl[st->bwidth]; /* Q0 */
        L_spec = l_spec_ext_tbl[st->bwidth];       /* Q0 */
        is_transient = 0;
+10 −0
Original line number Diff line number Diff line
@@ -262,8 +262,13 @@ ivas_error pre_proc_front_ivas_fx(

    IF( hSCE != NULL )
    {
#ifdef FIX_ISSUE_1237
        Copy_Scale_sig_16_32_no_sat( hSCE->hCoreCoder[n]->input_fx, hSCE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_inp ) );                                 /* Q11 */
        Copy_Scale_sig_16_32_no_sat( hSCE->hCoreCoder[n]->input_fx - input_frame, hSCE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */
#else
        Copy_Scale_sig_16_32_DEPREC( hSCE->hCoreCoder[n]->input_fx, hSCE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_inp ) );                                 /* Q11 */
        Copy_Scale_sig_16_32_DEPREC( hSCE->hCoreCoder[n]->input_fx - input_frame, hSCE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */
#endif
        hSCE->hCoreCoder[n]->q_inp32 = Q11;
        move16();
        Scale_sig( hSCE->hCoreCoder[n]->input_fx, input_frame, sub( -1, hSCE->hCoreCoder[n]->q_inp ) ); /* Q(-1) */
@@ -280,8 +285,13 @@ ivas_error pre_proc_front_ivas_fx(
    }
    ELSE
    {
#ifdef FIX_ISSUE_1237
        Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->input_fx, hCPE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_inp ) );                                 /* Q11 */
        Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->input_fx - input_frame, hCPE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */
#else
        Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[n]->input_fx, hCPE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_inp ) );                                 /* Q11 */
        Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[n]->input_fx - input_frame, hCPE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */
#endif
        hCPE->hCoreCoder[n]->q_inp32 = Q11;
        move16();
        Scale_sig( hCPE->hCoreCoder[n]->input_fx, input_frame, sub( -1, hCPE->hCoreCoder[n]->q_inp ) ); /* Q(-1) */
+5 −1
Original line number Diff line number Diff line
@@ -362,9 +362,13 @@ ivas_error ivas_cpe_enc_fx(
     * Set TD stereo parameters
     *----------------------------------------------------------------*/

#ifdef FIX_ISSUE_1237
    Copy_Scale_sig_16_32_no_sat( sts[1]->input_fx, sts[1]->input32_fx, input_frame, sub( Q11, sts[1]->q_inp ) ); /* Q11 */
    Copy_Scale_sig_16_32_no_sat( sts[0]->input_fx, sts[0]->input32_fx, input_frame, sub( Q11, sts[0]->q_inp ) ); /* Q11 */
#else
    Copy_Scale_sig_16_32_DEPREC( sts[1]->input_fx, sts[1]->input32_fx, input_frame, sub( Q11, sts[1]->q_inp ) ); /* Q11 */
    Copy_Scale_sig_16_32_DEPREC( sts[0]->input_fx, sts[0]->input32_fx, input_frame, sub( Q11, sts[0]->q_inp ) ); /* Q11 */

#endif
    Word16 shift = getScaleFactor32( sts[1]->input32_fx, input_frame );
    scale_sig32( sts[1]->input32_fx, input_frame, shift ); /* Q11 + shift */
    sts[1]->q_inp32 = add( Q11, shift );
+4 −0
Original line number Diff line number Diff line
@@ -280,7 +280,11 @@ ivas_error ivas_ism_enc_fx(
        test();
        IF( st_ivas->hSCE[j] && st_ivas->hSCE[j]->hCoreCoder[0] )
        {
#ifdef FIX_ISSUE_1237
            Copy_Scale_sig_16_32_no_sat( st_ivas->hSCE[j]->hCoreCoder[0]->input_fx, st_ivas->hSCE[j]->hCoreCoder[0]->input32_fx, input_frame, sub( Q11, st_ivas->hSCE[j]->hCoreCoder[0]->q_inp ) ); /* Q11 */
#else
            Copy_Scale_sig_16_32_DEPREC( st_ivas->hSCE[j]->hCoreCoder[0]->input_fx, st_ivas->hSCE[j]->hCoreCoder[0]->input32_fx, input_frame, sub( Q11, st_ivas->hSCE[j]->hCoreCoder[0]->q_inp ) ); /* Q11 */
#endif
            st_ivas->hSCE[j]->hCoreCoder[0]->q_inp32 = Q11;
            move16();
        }