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

Merge branch '3gpp_issue_1267_fix_3' into 'main'

Fix for 3GPP issue 1267: High MLD for ParamMC 5.1 at 80 kbps with +10dB Input gain [allow regression]

See merge request !1678
parents 7801edbb 75dbe818
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ ivas_error ivas_core_enc_fx(
    Word16 diff_nBits;
    ivas_error error;
    Word16 max_num_indices_BWE;
    Word16 i;
    Word16 i, shift, Q_min;

    set32_fx( new_swb_speech_buffer_fx, 0, L_FRAME48k + STEREO_DFT_OVL_MAX );
    set16_fx( new_swb_speech_buffer_fx_16, 0, L_FRAME48k + STEREO_DFT_OVL_MAX );
@@ -531,11 +531,16 @@ ivas_error ivas_core_enc_fx(
                        st->hTcxEnc->exp_buf_speech_ltp = st->exp_buf_speech_enc;
                        move16();
                    }
                    Scale_sig( st->input_fx, input_frame, sub( -1, st->q_inp ) );
                    Scale_sig( st->input_fx - input_frame, input_frame, sub( -1, st->q_old_inp ) );
                    st->q_inp = -1;
                    shift = norm_arr( st->input_fx, input_frame );
                    Q_min = s_max( -2, add( st->q_inp, shift ) );
                    scale_sig( st->input_fx, input_frame, sub( Q_min, st->q_inp ) );
                    st->q_inp = Q_min;
                    move16();
                    st->q_old_inp = -1;

                    shift = norm_arr( st->input_fx - input_frame, input_frame );
                    Q_min = s_max( -2, add( st->q_old_inp, shift ) );
                    scale_sig( st->input_fx - input_frame, input_frame, sub( Q_min, st->q_old_inp ) );
                    st->q_old_inp = Q_min;
                    move16();
                }

@@ -707,7 +712,7 @@ ivas_error ivas_core_enc_fx(

        Word16 Q_shb_spch_16 = Q_shb_spch;
        move16();
        Word16 shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 );
        shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 );
        Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift ); // Q_shb_spch
        Q_shb_spch = add( Q_shb_spch, shift );

+2 −2
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 Q_min = add( sub( 15, st->exp_old_inp_12k8 ), norm_arr( st->old_inp_12k8_fx, L_INP_MEM ) );
    Word16 input_frame_full = shl( input_frame, 1 ); //(old frame input length + new frame input length)
    Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) );
    Q_min = s_max( -1, Q_min );
    Q_min = s_max( -2, Q_min );
    Copy_Scale_sig_32_16( st->input32_fx - input_frame, st->input_fx - input_frame, input_frame_full, sub( Q_min, st->q_inp32 ) ); // Q_min
    st->q_inp = Q_min;
    move16();
@@ -682,7 +682,7 @@ ivas_error pre_proc_front_ivas_fx(
    }
    st->mem_preemph_fx = shl_sat( st->mem_preemph_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1) saturation added as float value goes above 65536 for +10 dB test (ltv48_MC512.wav and ltv48_MC51.wav) */
    move16();
    st->mem_preemph_DFT_fx = shl( st->mem_preemph_DFT_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1)*/
    st->mem_preemph_DFT_fx = shl_sat( st->mem_preemph_DFT_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1)*/
    move16();
    st->mem_preemph_q = st->q_inp;
    move16();