Unverified Commit 6d69b736 authored by norvell's avatar norvell
Browse files

Merge with main

parents 7545a6cb 187213dc
Loading
Loading
Loading
Loading
Loading
+19 −11
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ void Comp_and_apply_gain_fx(

    return;
}
#ifndef FIX_2338_HARM_GSC_GAIN_COMP


void Comp_and_apply_gain_ivas_fx(
@@ -238,6 +239,7 @@ void Comp_and_apply_gain_ivas_fx(

    return;
}
#endif


/*========================================================================*/
@@ -258,7 +260,6 @@ void Comp_and_apply_gain_ivas_fx(
/* _ (Word32*) etmp14    : Energy band 14                  Q_exc_diff*2+1 */
/* _ (Word32*) etmp15    : Energy band 15                  Q_exc_diff*2+1 */
/*------------------------------------------------------------------------*/

/*------------------------------------------------------------------------*/
/* RETURN ARGUMENTS :                                                     */
/* _ None                                                                 */
@@ -285,6 +286,7 @@ static Word16 Comp_band_log_ener(
    return tmp16;
}


void Ener_per_band_comp_fx(
    const Word16 exc_diff_fx[], /* i  : target signal                     Q_exc_diff     */
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
@@ -403,6 +405,7 @@ static void GSC_gain_adj(
    /* Gain adjustment to fit ACELP generic inactive coding gain at low rate */
    Word16 Gain_off, i;
    Word16 Fac_div;

    Fac_div = 102;
    move16();

@@ -540,6 +543,7 @@ Word16 gsc_gaindec_fx(
            idx_g_fx = (Word16) get_next_indice_fx( st_fx, 7 );
            VDQ_vec_fx( y_gainQ_fx + 6, Mean_dic_NB_fx + 6, Gain_dic3_NBHR_fx, idx_g_fx, 4 );
        }

        test();
        IF( LE_32( core_brate_fx, ACELP_9k60 ) && ( coder_type == INACTIVE ) )
        {
@@ -576,7 +580,9 @@ Word16 gsc_gaindec_fx(
             *--------------------------------------------------------------------------------------*/

            idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 );

            VDQ_vec_fx( y_gainQ_fx, YGain_mean_LR_fx, YGain_dic1_LR_fx, idx_g_fx, 3 );

            IF( !( coder_type == INACTIVE && st_fx->tdm_LRTD_flag == 0 && EQ_16( st_fx->idchan, 1 ) ) || GT_32( st_fx->core_brate, GSC_LRES_GAINQ_LIMIT ) )
            {
                idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 );
@@ -600,7 +606,9 @@ Word16 gsc_gaindec_fx(
                move16();
                y_gainQ_fx[11] = 0;
                move16();

                ifft_rel_fx( y_gainQ_fx + 8, 8, 3 );

                FOR( i = 8; i < 16; i++ )
                {
                    y_gainQ_fx[i] = round_fx( L_shl( L_mult( y_gainQ_fx[i], 23101 ), 1 ) ); /*Q12 */
+4 −2
Original line number Diff line number Diff line
@@ -1364,9 +1364,10 @@ void highband_exc_dct_in_ivas_fx(
            move16();
        }
    }

#ifndef FIX_2338_HARM_GSC_GAIN_COMP
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
#endif
        Comp_and_apply_gain_fx( exc_diffQ, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 0, Qexc_diffQ, *Q_exc );

        IF( exc_wo_nf != NULL )
@@ -1374,6 +1375,7 @@ void highband_exc_dct_in_ivas_fx(
            Comp_and_apply_gain_fx( exc_wo_nf, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 1, Qexc_diffQ, *Q_exc );
            Vr_add( exc_dct_in, exc_wo_nf, exc_wo_nf, L_frame );
        }
#ifndef FIX_2338_HARM_GSC_GAIN_COMP
    }
    ELSE
    {
@@ -1404,7 +1406,7 @@ void highband_exc_dct_in_ivas_fx(
            Scale_sig( exc_dct_in, L_frame, sub( *Q_exc, Q_old ) );
        }
    }

#endif
    /*--------------------------------------------------------------------------------------*
     * add the correction layer to the LF bins,
     * and add the quantized pulses or the noise for the higher part of the spectrum
+9 −0
Original line number Diff line number Diff line
@@ -102,6 +102,12 @@
#define FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK           /* Nokia: basop issue 2333: Add missing free for direction_vector_e to ivas_mcmasa_ana_fx.c */
#define HARM_COREDECODER_FUNCTIONS                      /* VA: basop issue 2347: Remove various duplicated code in core-decoder  */
#define FIX_2235_TD_RENDERER_WORD16                     /* Eri: Use Word16 in TD renderer without converting to Word32 */
#define FIX_BASOP_2351_EXTREND_SCALE                    /* FhG: basop issue 2351: Only scale initialized samples in renderer, related to 2326 */
#define FIX_2331_CLANG18_MSAN_UNINIT_VARIABLE           /* FhG: Fix issue 2331: Uninitialized variable */
#define FIX_2362_TOTAL_BRATE_CALCULATION                /* FhG: basop issue 2362: fix calculation of st->total_brate in ivas_cpe_enc_fx() */
#define FIX_2330_CLANG_18_WARNINGS_REND                 /* FhG: Fix renderer warnings */
#define FIX_BASOP_2350_HARM_0B_BWE                      /* VA: basop issue 2350: harmonization of the 0b BWE */
#define FIX_2349_HARM_FIND_UV                           /* VA: basop issue 2349: harmonization of find_uv() function */

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

@@ -111,6 +117,9 @@
#define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT  /* Dolby: Issue 2250:  random vector generation in GenShapedSHBExcitation() */
#define FIX_2320_OOB_SCE_SWITCHING                      /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */
#define FIX_2302_LSF_CDBK_THRESHOLD                     /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision  */
#define FIX_1500_ISM_MD_DTX                             /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */
#define FIX_2348_REPLACE_FEC_ENC                        /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx  */
#define FIX_2338_HARM_GSC_GAIN_COMP                     /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */

/* ##################### End NON-BE switches ########################### */

+21 −4
Original line number Diff line number Diff line
@@ -1711,7 +1711,7 @@ void Comp_and_apply_gain_fx(
    const Word16 ReUseGain,  /* i  : Reuse the gain in Ener_per_bd_yQ     */
    Word16 Qexc_diff,
    Word16 Q_exc );
#ifndef FIX_2338_HARM_GSC_GAIN_COMP
void Comp_and_apply_gain_ivas_fx(
    Word16 exc_diffQ[],      /* i/o: Quantized excitation                  */
    Word16 Ener_per_bd_iQ[], /* i  : Target ener per band              Q13 */
@@ -1720,7 +1720,7 @@ void Comp_and_apply_gain_ivas_fx(
    const Word16 ReUseGain,  /* i  : Reuse the gain in Ener_per_bd_yQ      */
    Word16 Qexc_diff,
    Word16 *Q_exc );
#endif
void pre_echo_att_fx(
    Word32 *Last_frame_ener_fx,      /* i/o: Energy of the last frame         2*Q_new+1*/
    Word16 *exc_fx,                  /* i/o: Excitation of the current frame  Q_new*/
@@ -6395,6 +6395,7 @@ void hf_synth_reset_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero /* o  : zero BWE decoder handle */
);
#ifndef FIX_BASOP_2350_HARM_0B_BWE
void hf_synth_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters      */
    const Word32 core_brate,       /* i  : core bitrate                      Q0*/
@@ -6406,7 +6407,6 @@ void hf_synth_fx(
    const Word16 Q_exc,            /* i  : excitation scaling             */
    const Word16 Q_syn2            /* i  : synthesis scaling              */
);
void hf_synth_ivas_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters      */
    const Word32 core_brate,       /* i  : core bitrate                      Q0*/
@@ -6418,7 +6418,23 @@ void hf_synth_ivas_fx(
    const Word16 Q_exc,            /* i  : excitation scaling             */
    const Word16 Q_syn2            /* i  : synthesis scaling              */
);
#else
void hf_synth_fx(
    ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters      */
#ifdef FIX_BASOP_2350_HARM_0B_BWE
    const Word16 element_mode,     /* i  : element mode                      Q0*/
#endif
    const Word32 core_brate,       /* i  : core bitrate                      Q0*/
    const Word16 output_frame,     /* i  : output frame length               Q0*/
    const Word16 *Aq,              /* i  : quantized Az                     Q12*/
    const Word16 *exc,             /* i  : excitation at 12.8 kHz         Q_exc*/
    Word16 *synth,                 /* i  : 12.8kHz synthesis signal      Q_syn2*/
    Word16 *synth16k,              /* o  : 16kHz synthesis signal        Q_syn2*/
    const Word16 Q_exc,            /* i  : excitation scaling             */
    const Word16 Q_syn2            /* i  : synthesis scaling              */
);
#endif
void hf_synth_amr_wb_init_fx(
    AMRWB_IO_DEC_HANDLE hAmrwb_IO /* i/o: AMR-WB IO data handle   */
);
@@ -10655,6 +10671,7 @@ Word16 msvq_stage1_dct_recalc_candidates_fdcng_wb_fx(
    Word16 *dist_ptr_e                /* i/o: exp for updated  MSE vector for stage1 */
);
#ifndef FIX_2348_REPLACE_FEC_ENC
void FEC_encode_ivas_fx(
    BSTR_ENC_HANDLE hBstr,        /* i/o: encoder bitstream handle                                   */
    const ACELP_config acelp_cfg, /* i/o: configuration of the ACELP                                 */
@@ -10668,7 +10685,7 @@ void FEC_encode_ivas_fx(
    const Word32 total_brate,     /* i  : total codec bitrate                                     Q0*/
    const Word16 Q_synth          /* i  : input scaling                                             */
);
#endif
ivas_error IGF_Reconfig_fx(
    IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder  */
    const Word16 igf,                 /* i  : IGF on/off                      */
+12 −10
Original line number Diff line number Diff line
@@ -6073,6 +6073,7 @@ void create_random_vector_fx(
    Word16 i, j, k;
    Word16 scale1, scale2;
    Word32 L_tmp;

    /*
      Note: the constant 2144047674 is 0.0078f in Q38 from the float reference.
      It should read 0.0078125f, which is 1/128.Since 0.0078f is nor exactly
@@ -6083,34 +6084,34 @@ void create_random_vector_fx(
#ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT
    if ( element_mode != EVS_MONO )
    {
        L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[0] ) ) ); /*Q23 */
        j = shr( abs_s( Random( &seed[0] ) ), 7 ); /* Random( &seed[0] * 0.0078125f ) */
    }
    else
    {
        L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */
        j = extract_l( L_shr( L_tmp, 23 ) );
    }
#else
    L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) );                                           /*Q23 */
#endif

    j = extract_l( L_shr( L_tmp, 23 ) );
#endif
    j = s_and( j, 0xff );

#ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT
    if ( element_mode != EVS_MONO )
    {
        L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
        k = shr( abs_s( Random( &seed[1] ) ), 7 ); /* Random( &seed[0] * 0.0078125f ) */
    }
    else
    {
        L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
        k = extract_l( L_shr( L_tmp, 23 ) );
    }

#else
    L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
    k = extract_l( L_shr( L_tmp, 23 ) );
#endif

    k = extract_l( L_shr( L_tmp, 23 ) );
    k = s_and( k, 0xff );

    WHILE( EQ_16( k, j ) )
@@ -6118,17 +6119,18 @@ void create_random_vector_fx(
#ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT
        if ( element_mode != EVS_MONO )
        {
            L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
            k = shr( abs_s( Random( &seed[1] ) ), 7 );
        }
        else
        {
            L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
            k = extract_l( L_shr( L_tmp, 23 ) );
        }
#else
        L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
        k = extract_l( L_shr( L_tmp, 23 ) );
#endif

        k = extract_l( L_shr( L_tmp, 23 ) );
        k = s_and( k, 0xff );
    }

Loading