Commit 7a9a719e authored by Manuel Jander's avatar Manuel Jander
Browse files

Add one bit more headroom for IVAS_CPE_TD case. This fixes a spike artefact,...

Add one bit more headroom for IVAS_CPE_TD case. This fixes a spike artefact, but the root cause is not clear yet. Likely a saturation somewhere.
parent aa0c4f58
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -438,6 +438,10 @@ ivas_error ivas_cpe_enc_fx(
    shift = s_min( L_norm_arr( sts[0]->input_buff32_fx, input_frame_2 ), L_norm_arr( sts[1]->input_buff32_fx, input_frame_2 ) );
    q_min = add( sts[0]->q_inp32, sub( shift, find_guarded_bits_fx( input_frame ) ) );
#ifdef NONBE_FIX_ISSUE_2206
    IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) )
    {
        q_min = sub( q_min, 1 ); // Fixes spike artefact for IVAS_cod -stereo 32000 16 stvST16c+10dB.wav out.192 at sample 793800. Saturation somewhere ?
    }
    scale_sig32( sts[1]->input_buff32_fx, input_frame, sub( q_min, sts[1]->q_old_inp32 ) );           /* q_min */
    scale_sig32( sts[0]->input_buff32_fx, input_frame, sub( q_min, sts[0]->q_old_inp32 ) );           /* q_min */
    scale_sig32( sts[1]->input_buff32_fx + input_frame, input_frame, sub( q_min, sts[1]->q_inp32 ) ); /* q_min */