Commit bce43b38 authored by vaclav's avatar vaclav
Browse files

Merge branch 'basop-2367-ic-bwe-obsolete-code' into 'main'

Remove IC-BWE obsolete code

Closes #2367

See merge request !2751
parents 95ec6447 d5aa02e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1357,7 +1357,7 @@ void stereo_tcx_init_dec_fx(
    const Word16 last_element_mode                              /* i  : element mode of previous frame      */
);

void stereo_icBWE_enc_ivas_fx(
void stereo_icBWE_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                */
    const Word32 shb_speech_ref_fx[],                           /* i  : SHB speech ref channel               */
    const Word16 shb_speech_ref_e,                              /* i  : SHB speech ref channel               */
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@
#define FIX_2363_FIND_WSP                               /* VA: basop issue 2363 : harmonizing find_wsp function */
#define FIX_2370_UNUSED_BUFFERS_CORE_ENC                /* VA: basop issue 2370: remove temporary input buffers in core-encoder  */
#define FIX_2376_FIX_USAN_PRE_PROC                      /* VA: basop issue 2376: Resolve "USAN: SEGV in ivas_compute_core_buffers_fx() */
#define FIX_2367_REMOVE_CODE_ICBWE                      /* VA: basop issue 2367: Remove IC-BWE obsolete code  */

/* #################### End BE switches ################################## */

+2 −0
Original line number Diff line number Diff line
@@ -1181,11 +1181,13 @@ ivas_error ivas_core_dec_fx(
            q = 11;
            move16();

#ifndef FIX_2367_REMOVE_CODE_ICBWE
            if ( hCPE->hStereoDft != NULL )
            {
                hCPE->hStereoDft->td_gain_fx[0] = 1;
                move32();
            }
#endif
            stereo_icBWE_dec_fx( hCPE, hb_synth_32_fx[0], hb_synth_32_fx[1], tmp_buffer_fx /*fb_synth_ref*/, voice_factors_fx[0], output_frame, &q, Q_white_exc );
            test();
            test();
+19 −10
Original line number Diff line number Diff line
@@ -112,6 +112,12 @@ static Word16 FindScale(
}


/*-------------------------------------------------------------------*
 * stereo_icBWE_dec()
 *
 * Spatial mapping of reference to the non-reference channels in SHB
 *-------------------------------------------------------------------*/

void stereo_icBWE_dec_fx(
    CPE_DEC_HANDLE hCPE,            /* i/o: CPE decoder structure                                       */
    Word32 *synthRef_fx,            /* i/o: Reference channel HB synthesis at output Fs             Q11 */
@@ -150,6 +156,14 @@ void stereo_icBWE_dec_fx(
    STEREO_ICBWE_DEC_HANDLE hStereoICBWE = hCPE->hStereoICBWE;
    st = hCPE->hCoreCoder[0];

#ifdef FIX_2367_REMOVE_CODE_ICBWE
    if ( hCPE->hStereoDft != NULL )
    {
        hCPE->hStereoDft->td_gain_fx[0] = 1;
        move32();
    }

#endif
    /*--------------------------------------------------------------------*
     * skip IC-BWE in case of mono DMX output                             *
     * -------------------------------------------------------------------*/
@@ -251,6 +265,7 @@ void stereo_icBWE_dec_fx(
    /*--------------------------------------------------------------------*
     * IC-BWE                                                             *
     * -------------------------------------------------------------------*/

    test();
    test();
    test();
@@ -265,7 +280,6 @@ void stereo_icBWE_dec_fx(
        return;
    }


    set16_fx( fb_synth_nonref_fx, 0, L_FRAME48k );

    /* core switching reset */
@@ -408,7 +422,6 @@ void stereo_icBWE_dec_fx(
    }

    // hStereoICBWE->prevgsMapping = powf( 10, hStereoICBWE->prevgsMapping );

    specMapping_fx = hStereoICBWE->prevSpecMapping_fx; // Q15
    move16();
    gsMapping_fx = hStereoICBWE->prevgsMapping_fx; // Q14
@@ -637,7 +650,6 @@ void stereo_icBWE_dec_fx(
        }

        /* generate 32kHz SHB synthesis from 12.8(16)kHz signal */

        tmp = 31;
        move16();
        tmp = FindScale( shb_synth_nonref_fx, L_FRAME16k + L_SHB_LAHEAD, Q_syn_shb, tmp );
@@ -669,7 +681,6 @@ void stereo_icBWE_dec_fx(
        alpha_fx = winSlope_fx;                                    /* Q15 */
        move16();


        IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) )
        {
            ratio_L_fx = 16384; /* 0.5 in Q15 */
@@ -685,7 +696,6 @@ void stereo_icBWE_dec_fx(
        move16();
        IF( hStereoICBWE->refChanIndx_bwe == L_CH_INDX )
        {

            IF( GE_16( ratio_L_fx, 3276 /* 0.1 in Q15 */ ) )
            {
                tmp = mult_r( sub( 32767 /* 1.0 in Q15 */, ratio_L_fx ), sub( 32767 /* 1.0 in Q15 */, ratio_L_fx ) ); // Q15
@@ -775,8 +785,6 @@ void stereo_icBWE_dec_fx(
    }

    /* resample to output FS */


    IF( EQ_32( st->output_Fs, 48000 /* Q0 */ ) )
    {
        tmp = 31;
@@ -829,7 +837,6 @@ void stereo_icBWE_dec_fx(
    }

    /* copy to outputHB and reset hb_synth values */

    IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) )
    {
        ratio_L_fx = 16384; /* 1.0 in Q15 */
@@ -926,6 +933,7 @@ void stereo_icBWE_dec_fx(
    return;
}


/*-------------------------------------------------------------------*
 * stereo_icBWE_decproc()
 *
@@ -1084,7 +1092,7 @@ void stereo_icBWE_decproc_fx(
                            move32();
                            BREAK;
                    }
                    // memOffset for 16K 32K 48K are 15 30 45 respectively.camera
                    // memOffset for 16K 32K 48K are 15 30 45 respectively
                }
                ELSE
                {
@@ -1172,7 +1180,7 @@ void stereo_icBWE_decproc_fx(
                                move16();
                                BREAK;
                        }
                        // memOffset for 16K 32K 48K are 15 30 45 respectively.camera
                        // memOffset for 16K 32K 48K are 15 30 45 respectively
                    }
                    ELSE
                    {
@@ -1354,6 +1362,7 @@ void stereo_icBWE_decproc_fx(
    return;
}


/*-------------------------------------------------------------------*
 * stereo_icBWE_init_dec()
 *
+8 −1
Original line number Diff line number Diff line
@@ -837,13 +837,18 @@ ivas_error ivas_core_enc_fx(
         *  Inter-channel BWE encoding
         *-------------------------------------------------------------------*/

#ifndef FIX_2367_REMOVE_CODE_ICBWE
        Word16 q_new_swb_speech_buffer = getScaleFactor16( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX );
        Scale_sig( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX, q_new_swb_speech_buffer ); // st->q_inp+q_new_swb_speech_buffer
        q_new_swb_speech_buffer = add( st->q_inp, q_new_swb_speech_buffer );
#endif
        test();
        test();
        IF( n == 0 && GE_32( input_Fs, 32000 ) && hStereoICBWE != NULL )
        {
#ifdef FIX_2367_REMOVE_CODE_ICBWE
            Word16 q_new_swb_speech_buffer = st->q_inp;
#endif
            Word32 voice_factors_fx32[CPE_CHANNELS][NB_SUBFR16k];
            stereo_icBWE_preproc_fx( hCPE, input_frame, new_swb_speech_buffer_fx_16 /*tmp buffer*/, q_new_swb_speech_buffer );

@@ -851,7 +856,8 @@ ivas_error ivas_core_enc_fx(
            Copy_Scale_sig_16_32_no_sat( new_swb_speech_buffer_fx_16, new_swb_speech_buffer_fx, L_FRAME48k + STEREO_DFT_OVL_MAX, Q16 ); // q_new_swb_speech_buffer+st->q_inp - 16 - > q_new_swb_speech_buffer+st->q_inp
            Copy_Scale_sig_16_32_no_sat( voice_factors_fx[0], voice_factors_fx32[0], NB_SUBFR16k, Q16 );                                // Q31

            stereo_icBWE_enc_ivas_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] );
            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] );
#ifndef FIX_2367_REMOVE_CODE_ICBWE

            IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) )
            {
@@ -867,6 +873,7 @@ ivas_error ivas_core_enc_fx(
                    move32();
                }
            }
#endif
        }

#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC
Loading