Commit dd5db31f authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into OPTIMIZE_FFT_STACK

parents 5da1c71b 398d808c
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -93,8 +93,12 @@
#define FIX_BASOP_2475_ASSERT_IN_MASA2_REND_TO_MONO     /* Nokia: basop issue 2475: Fix MASA2 to MONO rendering within IVAS_rend */
#define FIX_2346_DUPLICATED_IGF_FUNCTIONS               /* FhG: basop issue 2346: Review potentially duplicated IGF functions */
#define FIX_1525_UNINIT_FORMAT_SWITCHING_DEC            /* VA: float issue 1525: fix reading of uninitialized memory in format switching at the decoder */
#define FIX_BASOP_2457_HARM_GEN                         /* FhG: harmonization of function generate_comfort_noise_dec_hf_ivas_fx()*/
#define HARMONIZE_2446_CON_TCX_FX                       /* FhG: basop issue: 2446 harmonization of function con_tcx_fx() */
#define FIX_BASOP_2478_HARM_ENC_PRM_HM                  /* FhG: basop issue 2478: harmonize enc_prm_hm() and enc_prm_hm_ivas_fx() */
#define FIX_2433_ARITH_OVERFLOW_IN_QMETA_ENC            /* Nokia: Fix to convert non-converted binary operations */
#define FIX_2455_HARMONIZE_generate_comfort_noise_enc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */
#define FIX_2455_HARMONIZE_configureFdCngEnc          /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */
#define OPTIMIZE_FFT_STACK                              /* VA: removal of intermediate FFT buffers */
#define HARMONIZE_DCT                                   /* VA: removal of duplicated DCT functions */

@@ -111,6 +115,7 @@
#define FIX_BASOP_2472_IGF_SP_AUD_DEC_CHAN              /* FhG: always use channel 1 for sp_aud_decision0[] being passed to ProcessIGF_ivas_fx() */
#define FIX_BASOP_REMOVE_SYNTH2_FX                      /* FhG: Replace 32bit olapBufferSynth2_fx with 16bit olapBufferSynth2 buffer */
#define FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION  /* Nokia: float issue 1528: Fixes incorrect compensation for ISM metadata delay in 5ms TD rendering */
#define FIX_2398_PRECISSION_ORIENTATION_TRACKING        /* FhG: use refinement of Sqrt32 within certain functions*/
#define FIX_2462_PARCOR_FIX                             /* VA: issue 2462: Fix bug in calculating parcor coefficient in Calc_rc0_h() */

/* ##################### End NON-BE switches ########################### */
+13 −9
Original line number Diff line number Diff line
@@ -6780,19 +6780,21 @@ void generate_comfort_noise_dec_ivas_fx(
    const Word16 nchan_out /* i  : number of output channels     */
);

void generate_comfort_noise_dec_hf_fx(
    Word32 **bufferReal, /* o   : matrix to real part of i   bands */
    Word32 **bufferImag, /* o   : matrix to imaginary part of i   bands */
    Word16 *bufferScale, /* o   : pointer to scalefactor for real and imaginary part of i   bands */
    Decoder_State *stdec );

#ifndef FIX_BASOP_2457_HARM_GEN
void generate_comfort_noise_dec_hf_ivas_fx(
    Word32 **bufferReal,         /* o   : matrix to real part of input bands */
    Word32 **bufferImag,         /* o   : matrix to imaginary part of input bands */
    Word32 **bufferReal,         /* o   : matrix to real part of input bands   bufferScale*/
    Word32 **bufferImag,         /* o   : matrix to imaginary part of input bands  bufferScale*/
    Word16 *bufferScale,         /* o   : pointer to scalefactor for real and imaginary part of input bands */
    HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables  */
    const Word16 cng_coh_flag    /* i  : CNG Flag for coherence handling                        */
    const Word16 cng_coh_flag    /* i  : CNG Flag for coherence handling                        Q0*/
);
#endif

void generate_comfort_noise_dec_hf_fx(
    Word32 **bufferReal, /* o   : matrix to real part of input bands   bufferScale*/
    Word32 **bufferImag, /* o   : matrix to imaginary part of input bands  bufferScale*/
    Word16 *bufferScale, /* o   : pointer to scalefactor for real and imaginary part of input bands */
    Decoder_State *st );

/* Generate the comfort noise based on the target noise level */
void generate_masking_noise_fx(
@@ -10078,11 +10080,13 @@ void core_coder_mode_switch_ivas_fx(
    const Word16 MCT_flag          /* i  : hMCT handle allocated (1) or not (0)*/
);

#ifndef FIX_2455_HARMONIZE_configureFdCngEnc
void configureFdCngEnc_ivas_fx(
    HANDLE_FD_CNG_ENC hFdCngEnc, /* i/o: Contains the variables related to the FD-based CNG process */
    const Word16 bwidth,         /* Q0 */
    const Word32 total_brate     /* Q0 */
);
#endif

void SetModeIndex_ivas_fx(
    Encoder_State *st,              /* i  : Encoder state                          */
+5 −0
Original line number Diff line number Diff line
@@ -2003,7 +2003,12 @@ ivas_error acelp_core_dec_fx(
                {
                    Word16 tmpBufferScale = 0;
                    move16();
#ifndef FIX_BASOP_2457_HARM_GEN
                    generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag );
#else
                    generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st );
#endif // !FIX_BASOP_2457_HARM_GEN


                    FOR( i = 0; i < st->hFdCngDec->hFdCngCom->numSlots; i++ )
                    {
+61 −1
Original line number Diff line number Diff line
@@ -3434,6 +3434,7 @@ void generate_comfort_noise_dec_ivas_fx(
    return;
}

#ifndef FIX_BASOP_2457_HARM_GEN
void generate_comfort_noise_dec_hf_fx(
    Word32 **bufferReal, /* o   : matrix to real part of input bands  bufferScale*/
    Word32 **bufferImag, /* o   : matrix to imaginary part of input bands  bufferScale*/
@@ -3503,6 +3504,9 @@ void generate_comfort_noise_dec_hf_fx(
    }
}

#endif // !FIX_BASOP_2457_HARM_GEN

#ifndef FIX_BASOP_2457_HARM_GEN
void generate_comfort_noise_dec_hf_ivas_fx(
    Word32 **bufferReal,         /* o   : matrix to real part of input bands   bufferScale*/
    Word32 **bufferImag,         /* o   : matrix to imaginary part of input bands  bufferScale*/
@@ -3510,6 +3514,13 @@ void generate_comfort_noise_dec_hf_ivas_fx(
    HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables  */
    const Word16 cng_coh_flag    /* i  : CNG Flag for coherence handling                        Q0*/
)
#else
void generate_comfort_noise_dec_hf_fx(
    Word32 **bufferReal, /* o   : matrix to real part of input bands   bufferScale*/
    Word32 **bufferImag, /* o   : matrix to imaginary part of input bands  bufferScale*/
    Word16 *bufferScale, /* o   : pointer to scalefactor for real and imaginary part of input bands */
    Decoder_State *st )
#endif
{
    Word16 i, j, s, sc, sn;
    Word16 scaleCLDFB;
@@ -3522,6 +3533,10 @@ void generate_comfort_noise_dec_hf_ivas_fx(
    Word32 *ptr_level;
    Word32 *cngNoiseLevel;
    Word32 tmp1, tmp2;
#ifdef FIX_BASOP_2457_HARM_GEN
    HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec->hFdCngCom;
    Word16 cng_coh_flag = st->cng_ism_flag;
#endif // FIX_BASOP_2457_HARM_GEN

    cngNoiseLevel = hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); /*Q31 - hFdCngCom->cngNoiseLevelExp*/
    cngNoiseLevelExp = hFdCngCom->cngNoiseLevelExp;
@@ -3566,8 +3581,19 @@ void generate_comfort_noise_dec_hf_ivas_fx(
        cngNoiseLevelExp = add( cngNoiseLevelExp, sn );
        move16();
    }

#ifndef FIX_BASOP_2457_HARM_GEN
    randGaussExp = CNG_RAND_GAUSS_SHIFT + 1;
#else
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        randGaussExp = CNG_RAND_GAUSS_SHIFT;
    }
    ELSE
    {
        randGaussExp = CNG_RAND_GAUSS_SHIFT + 1;
    }
#endif // !FIX_BASOP_2457_HARM_GEN

    move16();

    /*
@@ -3582,12 +3608,21 @@ void generate_comfort_noise_dec_hf_ivas_fx(

        FOR( j = hFdCngCom->numCoreBands; j < hFdCngCom->regularStopBand; j++ )
        {
#ifdef FIX_BASOP_2457_HARM_GEN
            /* scaleCLDFB:  CLDFBinvScalingFactor_EXP + 1 */
            s = 0;
            move16();
            sqrtNoiseLevel = Sqrt32( L_shr( Mpy_32_16_1( *ptr_level, scaleCLDFB ), sn ), &s ); /*Q31 - s*/
#endif                                                                                         // FIX_BASOP_2457_HARM_GEN
            FOR( i = 0; i < hFdCngCom->numSlots; i++ )
            {
#ifndef FIX_BASOP_2457_HARM_GEN
                /* scaleCLDFB:  CLDFBinvScalingFactor_EXP + 1 */
                s = 0;
                move16();
                sqrtNoiseLevel = Sqrt32( L_shr( Mpy_32_16_1( *ptr_level, scaleCLDFB ), sn ), &s ); /*Q31 - s*/
#endif                                                                                             // FIX_BASOP_2457_HARM_GEN


                IF( cng_coh_flag )
                {
@@ -3609,6 +3644,29 @@ void generate_comfort_noise_dec_hf_ivas_fx(
                }
                ELSE
                {
#ifndef FIX_BASOP_2457_HARM_GEN
                    /* Real part in CLDFB band */
                    bufferReal[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/
                    move32();

                    /* Imaginary part in CLDFB band */
                    bufferImag[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/
                    move32();
#else
                    IF( EQ_16( st->element_mode, EVS_MONO ) )
                    {
                        /* Real part in CLDFB band */
                        bufferReal[i][j] = L_shl( Mpy_32_32( rand_gauss( seed ), sqrtNoiseLevel ), s ); /*bufferScale*/
                        move32();
                        /*fprintf(pFile,"%13.10f\n",WORD322FL_SCALE(bufferReal[i][j],sc));*/

                        /* Imaginary part in CLDFB band */
                        bufferImag[i][j] = L_shl( Mpy_32_32( rand_gauss( seed ), sqrtNoiseLevel ), s ); /*bufferScale*/
                        move32();
                        /*fprintf(pFile,"%13.10f\n",WORD322FL_SCALE(bufferImag[i][j],sc));*/
                    }
                    ELSE
                    {
                        /* Real part in CLDFB band */
                        bufferReal[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/
                        move32();
@@ -3617,6 +3675,8 @@ void generate_comfort_noise_dec_hf_ivas_fx(
                        bufferImag[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/
                        move32();
                    }
#endif // !FIX_BASOP_2457_HARM_GEN
                }
            }
            ptr_level = ptr_level + 1; /*Q31 - hFdCngCom->cngNoiseLevelExp*/
        }
+8 −1
Original line number Diff line number Diff line
@@ -366,8 +366,11 @@ ivas_error acelp_core_enc_fx(
                    st->hDtxEnc->last_CNG_L_frame = st->L_frame;
                    move16();
                }

#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
                generate_comfort_noise_enc_fx( st, Q_new, 1, st->element_mode );
#else
                generate_comfort_noise_enc_fx( st, Q_new, 1 );
#endif

                FdCng_exc( st->hFdCngEnc->hFdCngCom, &st->hDtxEnc->CNG_mode, st->L_frame, st->lsp_old_fx,
                           st->hDtxEnc->first_CNG, st->hDtxEnc->lspCNG_fx, Aq, lsp_new, lsf_new_fx, exc_fx, exc2_fx, bwe_exc_fx );
@@ -423,7 +426,11 @@ ivas_error acelp_core_enc_fx(
                st->hFdCngEnc->hFdCngCom->cngNoiseLevelExp = sub( st->hFdCngEnc->hFdCngCom->cngNoiseLevelExp, Q_cngNoise );
                move16();

#ifdef FIX_2455_HARMONIZE_generate_comfort_noise_enc
                generate_comfort_noise_enc_fx( st, Q_new, 1, st->element_mode );
#else
                generate_comfort_noise_enc_ivas_fx( st, Q_new, 1 );
#endif
                st->hTcxEnc->q_Txnq = Q_new;
                move16();

Loading