Commit f79666a4 authored by vaclav's avatar vaclav
Browse files

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

- Merge remote-tracking branch 'remotes/origin/main' into float-1478-clang18-msan-use-of-uninitialized-value-in-lib_com-gs_noisefill
parents 653af9ad 761786f3
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -133,7 +133,6 @@
    <ClCompile Include="..\lib_isar\isar_lc3plus_enc.c" />
    <ClCompile Include="..\lib_isar\isar_lc3plus_payload.c" />
    <ClCompile Include="..\lib_isar\isar_MSPred.c" />
    <ClCompile Include="..\lib_isar\isar_NoiseGen.c" />
    <ClCompile Include="..\lib_isar\isar_PerceptualModel.c" />
    <ClCompile Include="..\lib_isar\isar_PredDecoder.c" />
    <ClCompile Include="..\lib_isar\isar_PredEncoder.c" />
+7 −0
Original line number Diff line number Diff line
@@ -452,6 +452,13 @@ int main(
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }

#ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR
        if ( !arg.renderConfigEnabled && ( arg.renderFramesize != asked_frame_size ) )
        {
            fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" );
        }
#endif
    }

    /*------------------------------------------------------------------------------------------*
+4 −0
Original line number Diff line number Diff line
@@ -2731,7 +2731,11 @@ extern const Word16 Idx2Freq_Tbl[];
/* 'x' is converted to Q6, 'Freq_Tbl'/1000 in Q9 */
/* only works for 'fs' = [8000,12800,16000,25600,32000,48000] (unpredictable otherwise) */
/* 15625 is 1000000.0f/Q6 but we use the calculated value to avoid float point code */
#ifdef FIX_2286_GCC_WARNING_Idx2Freq_Tbl
#define NS2SA_FX2(fs,x)                         (chk_fs(fs) mult(Idx2Freq_Tbl[L_and(L_shr(fs,8),7)-2], (Word16)((x)/15625)))
#else
#define NS2SA_FX2(fs,x)                         (chk_fs(fs) mult((&Idx2Freq_Tbl[-2])[L_and(L_shr(fs,8),7)], (Word16)((x)/15625)))
#endif

#define L_FRAME_12k8                            256     /* Frame size at 12k8Hz: 20ms = 256 samples  */
#define L_FRAME_16k                             320     /* Frame size at 16kHz:  20ms = 320 samples  */
+26 −7
Original line number Diff line number Diff line
@@ -260,7 +260,8 @@ void Comp_and_apply_gain_ivas_fx(
/* _ None                                                                 */
/*========================================================================*/

static Word16 Comp_band_log_ener(                      /* o  : Band gain Q12 */
/* o  : Band gain Q12 */
static Word16 Comp_band_log_ener(
    const Word16 *pt_fx, /* i  : Dct input Q_sc */
    const Word16 Len,    /* i  : Lenght en energy accumulation */
    const Word16 Q_sc,   /* i  : scaling of input    */
@@ -269,12 +270,14 @@ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */
{
    Word32 L_tmp;
    Word16 e_tmp, f_tmp, tmp16, ener_exp;

    L_tmp = Calc_Energy_Autoscaled( pt_fx, Q_sc, Len, &ener_exp );
    e_tmp = norm_l( L_tmp );
    f_tmp = Log2_norm_lc( L_shl( L_tmp, e_tmp ) );
    e_tmp = sub( sub( add( 30, E_sc ), e_tmp ), ener_exp );
    L_tmp = Mpy_32_16( e_tmp, f_tmp, 19728 ); /* Q16 */ /*log10(2) in Q17 */
    tmp16 = round_fx( L_shl( L_tmp, 12 - 2 ) );         /* Q12 -1 is to compensate Q17 */

    return tmp16;
}

@@ -283,7 +286,12 @@ void Ener_per_band_comp_fx(
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
    const Word16 Q_exc,         /* i  : frame length                      */
    const Word16 Mband,         /* i  : Max band                          */
#ifdef FIX_1904_HARM_GSC_ENC
    const Word16 Eflag,  /* i  : flag of highest band              */
    const Word16 L_frame /* i  : frame length                      */
#else
    const Word16 Eflag /* i  : flag of highest band              */
#endif
)
{
    const Word16 *pt_fx;
@@ -311,9 +319,19 @@ void Ener_per_band_comp_fx(
        pt_fx += 32;
    }

    return;
#ifdef FIX_1904_HARM_GSC_ENC
    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
        y_gain4_fx[j + 2] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/
        move16();
        y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 64, Q_exc, -1 ); /*Q12*/
        move16();
    }
#endif

    return;
}
#ifndef FIX_1904_HARM_GSC_ENC
void Ener_per_band_comp_ivas_fx(
    const Word16 exc_diff_fx[], /* i  : target signal                     Q_exc_diff     */
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
@@ -359,6 +377,7 @@ void Ener_per_band_comp_ivas_fx(

    return;
}
#endif


/*-------------------------------------------------------------------*
+13 −0
Original line number Diff line number Diff line
@@ -77,7 +77,11 @@ void Inac_switch_ematch_fx(
    test();
    IF( ( EQ_16( coder_type, AUDIO ) || ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) ) ) && bfi == 0 )
    {
#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#endif

        /* reset long-term energy per band */
        FOR( i = 0; i < MBANDS_GN; i++ )
@@ -91,7 +95,11 @@ void Inac_switch_ematch_fx(
        /* Find spectrum and energy per band for GC and VC frames */
        edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode );

#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#endif

        /* reset long-term energy per band */
        FOR( i = 0; i < MBANDS_GN; i++ )
@@ -104,7 +112,12 @@ void Inac_switch_ematch_fx(
    {
        /* Find spectrum and energy per band for inactive frames */
        edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode );

#ifdef FIX_1904_HARM_GSC_ENC
        Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame );
#endif

        /* More agressive smoothing in the first 50 frames */
        pt_exc = dct_exc_tmp;
Loading