Commit 9b4e5fb7 authored by vaclav's avatar vaclav
Browse files

updt

parent 764c841d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1359,8 +1359,12 @@ void stereo_tcx_init_dec_fx(

void stereo_icBWE_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                */
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             Q0*/
#else
    const Word32 shb_speech_ref_fx[],                           /* i  : SHB speech ref channel               */
    const Word16 shb_speech_ref_e,                              /* i  : SHB speech ref channel               */
#endif
#ifdef SCALING_SWB_SPEECH_32
    Word16 shb_speech_nonref_fx_16[],                           /* i/o: SHB speech non-ref channel           Q15-shb_speech_nonref_e*/
#else
+6 −4
Original line number Diff line number Diff line
@@ -10491,9 +10491,11 @@ void swb_pre_proc_ivas_fx(
    Encoder_State *st,                                          /* i/o: encoder state structure                  */
    Word16 *new_swb_speech,                                     /* o  : original input signal at 32kHz - Q0      */
#ifndef SCALING_SWB_SPEECH_32
    Word32 *new_swb_speech_fx, /* o  : original input signal at 32kHz - Q - q_reImBuffer */
    Word32 *new_swb_speech_fx,                                  /* o  : original input signal at 32kHz - Q0      */
#endif
#ifndef REMOVE_SCALING_SHB_SPEECH_BE
    Word16 *shb_speech, /* o  : SHB target signal (6-14kHz) at 16kHz- Q(Q_shb_spch) */
#endif
    Word16 *Q_shb_spch,
    Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i  : real buffer Q - q_reImbuffer             */
    Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i  : imag buffer Q - q_reImbuffer             */
+3 −13
Original line number Diff line number Diff line
@@ -2973,12 +2973,7 @@ void swb_CNG_enc_fx(
void swb_CNG_enc_ivas_fx(
#endif
    Encoder_State *st,            /* i/o: State structure                              */
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
    const Word16 *shb_speech_fx_orig, /* i  : SHB target signal (6-14kHz) at 16kHz    Q_shb_spch */
    const Word16 Q_shb_spch,
#else
    const Word16 *shb_speech_fx,  /* i  : SHB target signal (6-14kHz) at 16kHz      Q0 */
#endif
    const Word16 *syn_12k8_16k_fx /* i  : ACELP core synthesis at 12.8kHz or 16kHz  Q0 */
)
{
@@ -2992,11 +2987,6 @@ void swb_CNG_enc_ivas_fx(
            test();
            IF( GE_32( st->input_Fs, L_FRAME32k * FRAMES_PER_SEC ) )
            {
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
                Word16 shb_speech_fx[L_FRAME16k];
                Copy_Scale_sig( shb_speech_fx_orig, shb_speech_fx, L_FRAME16k, negate( Q_shb_spch ) ); // Q0
#endif

                /* decide if SHB SID encoding or not */
#ifdef HARM_NON_LINEARITY
                shb_SID_updt = shb_DTX_fx( st, shb_speech_fx, syn_12k8_16k_fx );
+0 −4
Original line number Diff line number Diff line
@@ -528,11 +528,7 @@ ivas_error evs_enc_fx(
    test();
    IF( st->Opt_DTX_ON && GE_16( input_frame, L_FRAME32k ) )
    {
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
        swb_CNG_enc_fx( st, shb_speech, 0, old_syn_12k8_16k );
#else
        swb_CNG_enc_fx( st, shb_speech, old_syn_12k8_16k );
#endif
    }

    /*---------------------------------------------------------------------*
+31 −19
Original line number Diff line number Diff line
@@ -87,13 +87,17 @@ ivas_error ivas_core_enc_fx(
    STEREO_ICBWE_ENC_HANDLE hStereoICBWE;
    STEREO_TD_ENC_DATA_HANDLE hStereoTD;
    Word16 voice_factors_fx[CPE_CHANNELS][NB_SUBFR16k]; /* Q15 */
#ifndef REMOVE_SCALING_SHB_SPEECH_BE
    Word32 shb_speech_fx32[L_FRAME16k];
#endif
#ifndef SCALING_SWB_SPEECH_32
    Word32 *new_swb_speech_fx;
#endif
    Word16 *inp_fx[CPE_CHANNELS];
    Word16 *shb_speech_fx;
#ifndef REMOVE_SCALING_SHB_SPEECH_BE
    Word16 Q_shb_spch;
#endif
#ifndef SCALING_SWB_SPEECH_32
    Word32 new_swb_speech_buffer_fx[L_FRAME48k + STEREO_DFT_OVL_MAX];
#endif
@@ -131,9 +135,10 @@ ivas_error ivas_core_enc_fx(
    error = IVAS_ERR_OK;
    move32();

#ifndef REMOVE_SCALING_SHB_SPEECH_BE
    Q_shb_spch = 0;
    move16();

#endif
    /*------------------------------------------------------------------*
     * General initialization
     *-----------------------------------------------------------------*/
@@ -777,7 +782,11 @@ ivas_error ivas_core_enc_fx(
            }

#ifdef SCALING_SWB_SPEECH_32
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
            swb_pre_proc_ivas_fx( st, new_swb_speech_fx_16, shb_speech_fx, realBuffer_fx[n], imagBuffer_fx[n], q_re_im_buf[n], hCPE );
#else
            swb_pre_proc_ivas_fx( st, new_swb_speech_fx_16, shb_speech_fx, &Q_shb_spch, realBuffer_fx[n], imagBuffer_fx[n], q_re_im_buf[n], hCPE );
#endif
#else
            swb_pre_proc_ivas_fx( st, new_swb_speech_fx_16, new_swb_speech_fx, shb_speech_fx, &Q_shb_spch, realBuffer_fx[n], imagBuffer_fx[n], q_re_im_buf[n], hCPE );
#endif
@@ -792,27 +801,21 @@ ivas_error ivas_core_enc_fx(
            }
        }

#ifdef REMOVE_SCALING_SHB_SPEECH_NONBE
        Word16 shift_shb_spch = 0;
#endif
        Q_shb_spch = 0;
#ifndef REMOVE_SCALING_SHB_SPEECH_BE
        Word16 Q_shb_spch_16 = Q_shb_spch;
        move16();
#endif
#ifdef FIX_2344_ALIGN_PREPROC
        IF( st->tcxonly == 0 || hStereoICBWE != NULL || st->core == ACELP_CORE ) // temp. fix to keep BE until #1504 (FLP) is solved, then it will become:
                                                                                 // IF( st->tcxonly == 0 )
#endif
        {
#ifndef REMOVE_SCALING_SHB_SPEECH_BE
            shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 );
#ifdef REMOVE_SCALING_SHB_SPEECH_NONBE
            shift_shb_spch = shift;
#endif
#ifndef REMOVE_SCALING_SHB_SPEECH_NONBE
            Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift ); // Q_shb_spch
#endif
            Q_shb_spch = add( Q_shb_spch, shift );

            IF( st->hBWE_FD )
#endif
            IF( st->hBWE_FD ) // VE: to be moved to the end of swb_pre_proc_ivas_fx()
            {
                shift = getScaleFactor16( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k );
                st->Q_old_wtda = add( st->Q_old_wtda, shift );
@@ -832,7 +835,11 @@ ivas_error ivas_core_enc_fx(
                Word16 Q_fb_exc;
                Word16 fb_exc_fx[L_FRAME16k];

#ifdef REMOVE_SCALING_SHB_SPEECH_BE
                swb_tbe_enc_ivas_fx( st, hStereoICBWE, shb_speech_fx, bwe_exc_extended_fx[n], voice_factors_fx[n], fb_exc_fx, &Q_fb_exc, Q_new[n], 0, st->voicing_fx, pitch_buf_fx[n] );
#else
                swb_tbe_enc_ivas_fx( st, hStereoICBWE, shb_speech_fx, bwe_exc_extended_fx[n], voice_factors_fx[n], fb_exc_fx, &Q_fb_exc, Q_new[n], Q_shb_spch_16, st->voicing_fx, pitch_buf_fx[n] );
#endif

                IF( EQ_16( st->extl, FB_TBE ) )
                {
@@ -847,7 +854,11 @@ ivas_error ivas_core_enc_fx(
            Copy_Scale_sig_32_16( shb_speech_fx32, shb_speech_fx, L_FRAME16k, -Q16 ); // Q_shb_spch - 16
#endif
            /* SWB(FB) BWE encoder */
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
            swb_bwe_enc_ivas_fx( st, last_element_mode, old_inp_12k8_fx[n], old_inp_16k_fx[n], old_syn_12k8_16k_fx[n], new_swb_speech_fx_16, st->q_inp, shb_speech_fx, sub( Q_new[n], 1 ) );
#else
            swb_bwe_enc_ivas_fx( st, last_element_mode, old_inp_12k8_fx[n], old_inp_16k_fx[n], old_syn_12k8_16k_fx[n], new_swb_speech_fx_16, st->q_inp, shb_speech_fx, sub( Q_shb_spch, Q16 ), sub( Q_new[n], 1 ) );
#endif
        }

        Scale_sig( old_syn_12k8_16k_fx[n], L_FRAME16k, sub( Q1, Q_new[n] ) ); // Q0
@@ -866,11 +877,7 @@ ivas_error ivas_core_enc_fx(
            Copy_Scale_sig_32_16( shb_speech_fx32, shb_speech_fx, L_FRAME16k, negate( Q_shb_spch ) ); // Q0
#endif
#ifdef HARM_NON_LINEARITY
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
            swb_CNG_enc_fx( st, shb_speech_fx, Q_shb_spch_16, old_syn_12k8_16k_fx[n] );
#else
            swb_CNG_enc_fx( st, shb_speech_fx /* Unmodified */, old_syn_12k8_16k_fx[n] );
#endif
            swb_CNG_enc_fx( st, shb_speech_fx, old_syn_12k8_16k_fx[n] );
#else
            swb_CNG_enc_ivas_fx( st, shb_speech_fx /* Unmodified */, old_syn_12k8_16k_fx[n] );
#endif
@@ -899,12 +906,17 @@ ivas_error ivas_core_enc_fx(
            Copy_Scale_sig_16_32_no_sat( voice_factors_fx[0], voice_factors_fx32[0], NB_SUBFR16k, Q16 );                                // Q31
#endif

#ifdef REMOVE_SCALING_SHB_SPEECH_NONBE
            Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift_shb_spch ); // Q_shb_spch
#ifdef REMOVE_SCALING_SHB_SPEECH_BEaaa
            Q_shb_spch = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 );
            Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, Q_shb_spch ); // Q_shb_spch
#endif

#ifdef SCALING_SWB_SPEECH_32
#ifdef REMOVE_SCALING_SHB_SPEECH_BE
            stereo_icBWE_enc_fx( hCPE, shb_speech_fx, new_swb_speech_buffer_fx_16, sub( Q31, q_new_swb_speech_buffer ), voice_factors_fx[0] );
#else
            stereo_icBWE_enc_fx( hCPE, shb_speech_fx32, sub( Q31, Q_shb_spch ), new_swb_speech_buffer_fx_16, sub( Q31, q_new_swb_speech_buffer ), voice_factors_fx[0] );
#endif
#else
            stereo_icBWE_enc_fx( hCPE, shb_speech_fx32, sub( Q31, Q_shb_spch ), new_swb_speech_buffer_fx, sub( Q31, q_new_swb_speech_buffer ), voice_factors_fx32[0] );
#endif
Loading