Commit 7c1c6cef authored by vaclav's avatar vaclav
Browse files

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

- Merge remote-tracking branch 'remotes/origin/main' into basop-2264-out-of-bound-reading-in-log2_norm_lc
parents a16ec4a7 65ff022e
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

# Compiler output Unix
IVAS_cod
IVAS_cod_fmtsw
IVAS_dec
IVAS_rend
ISAR_post_rend
@@ -16,6 +17,7 @@ build*/**/*

# Compiler output VS2017
IVAS_cod.exe
IVAS_cod_fmtsw.exe
IVAS_dec.exe
IVAS_rend.exe
ISAR_post_rend.exe
+4 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND /* OR : Fix issue basop 2201 hrtf_file_reader crend differs between basop ivas-main and ivas-float-update */
#define FIX_2245_INIT_FD_CNG_EVS                        /* Dolby/VA: Issue 2245: initialize FD CNG with EVS-type of init function */
#define FIX_2252_SCALING_SAVE_HB_SYNTH                  /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */

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

@@ -97,7 +98,10 @@
#define FIX_2015_PREMPH_SAT_ALT_PART2                   /* VA: Add missing scaling factor to be passed to AVQ_cod() */
#define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH         /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */
#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */
#define FIX_1461_CNG_BW_SWITCHING                       /* Eri: float issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */
#define FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES      /* FhG: Using rounding in multiplication to improve precision in cngNoiseLevel[] */
#define FIX_2264_OUT_OF_BOUND_READING_IN_LOG2_NORM_LC   /* VA: Fix issue 2264 by adding a proper safeguard in log2 and by adding a missing normalization in swb_pre_proc_ivas_fx()*/

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

/* ################## End MAINTENANCE switches ######################### */
+8 −0
Original line number Diff line number Diff line
@@ -2334,9 +2334,17 @@ ivas_error acelp_core_dec_fx(

    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
#ifdef FIX_2252_SCALING_SAVE_HB_SYNTH
        IF( save_hb_synth_fx16 != NULL )
#else
        IF( save_hb_synth_fx16 )
#endif
        {
#ifdef FIX_2252_SCALING_SAVE_HB_SYNTH
            Copy_Scale_sig_32_16( save_hb_synth_fx, save_hb_synth_fx16, output_frame, 0 ); // Q0
#else
            Copy_Scale_sig_32_16( save_hb_synth_fx, save_hb_synth_fx16, L_FRAME48k, 0 ); // Q0
#endif
        }
        Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2
    }
+19 −3
Original line number Diff line number Diff line
@@ -1200,7 +1200,11 @@ Word16 ApplyFdCng_fx(
                        s = s_max( s_min( s, sub( WORD32_BITS, 1 ) ), negate( sub( WORD32_BITS, 1 ) ) );
                        FOR( ; j <= hFdCngCom->part[k]; j++ )
                        {
#ifdef FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES
                            cngNoiseLevel[j] = L_shl_r( Mpy_32_16_r( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/
#else
                            cngNoiseLevel[j] = L_shl( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s );                                            /*Q31 - hFdCngDec->bandNoiseShape_exp*/
#endif
                            move32();
                        }
                    }
@@ -1811,7 +1815,11 @@ void perform_noise_estimation_dec_ivas_fx(
                    FOR( p = 0; p < npart; p++ )
                    {
                        temp = L_shl( msPeriodog[p], q_shift );
#ifdef FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES
                        msNoiseEst[p] = Madd_32_16( Mpy_32_16_r( msNoiseEst[p], sub( MAX_16, alpha ) ), temp, alpha ); /*Q31 - hFdCngDec->msNoiseEst_exp*/
#else
                        msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], sub( MAX_16, alpha ) ), temp, alpha );                                        /*Q31 - hFdCngDec->msNoiseEst_exp*/
#endif
                        move32();
                    }
                }
@@ -1889,7 +1897,11 @@ void perform_noise_estimation_dec_ivas_fx(
                        L_tmp = L_shr( msPeriodog[p], sub( sub( 31, hFdCngDec->hFdCngCom->periodog_exp ), 4 ) );
                        IF( LT_32( L_tmp, msNoiseEst[p] ) )
                        {
#ifdef FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES
                            msNoiseEst[p] = Madd_32_16( Mpy_32_16_r( msNoiseEst[p], wght ), L_tmp, (Word16) L_sub( shr( MAX_16, sub( 15, scale ) ), wght ) ); /*temp_q_msNoiseEst[p]*/
#else
                            msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], wght ), L_tmp, (Word16) L_sub( shr( MAX_16, sub( 15, scale ) ), wght ) ); /*temp_q_msNoiseEst[p]*/
#endif
                            move32();
                            temp_q_msNoiseEst[p] = sub( add( hFdCngDec->msNoiseEst_exp, scale ), 15 );
                            move16();
@@ -1912,7 +1924,11 @@ void perform_noise_estimation_dec_ivas_fx(
                        L_tmp = L_shr_sat( hFdCngDec->msPeriodog_ST_fx[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_ST_exp ) ); /*Q31 - hFdCngDec->msPeriodog_ST_exp*/
                        IF( LT_32( L_tmp, msNoiseEst[p] ) )
                        {
#ifdef FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES
                            msNoiseEst[p] = Madd_32_16( Mpy_32_16_r( msNoiseEst[p], CNA_ACT_DN_FACT_Q15 ), L_tmp, ONE_IN_Q15 - CNA_ACT_DN_FACT_Q15 ); /*Q31 - hFdCngDec->msNoiseEst_exp*/
#else
                            msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], CNA_ACT_DN_FACT_Q15 ), L_tmp, ONE_IN_Q15 - CNA_ACT_DN_FACT_Q15 );         /*Q31 - hFdCngDec->msNoiseEst_exp*/
#endif
                            move32();
                        }
                    }
+9 −0
Original line number Diff line number Diff line
@@ -130,6 +130,9 @@ ivas_error ivas_cpe_enc_fx(
    Word16 old_wsp_fx[CPE_CHANNELS][L_WSP];
    Word16 e_old_wsp[CPE_CHANNELS], q_old_wsp;
    Word16 Q_new[CPE_CHANNELS] = { 0 };
#ifdef FIX_1461_CNG_BW_SWITCHING
    Word16 NFFT_inner;
#endif
    move16();
    move16();
    Word16 q_com, shift, q_min, gb;
@@ -1124,6 +1127,12 @@ ivas_error ivas_cpe_enc_fx(
            IF( EQ_32( sts[0]->core_brate, SID_2k40 ) || sts[0]->core_brate == FRAME_NO_DATA )
            {
                /* Reconfigure DFT Stereo for inactive frames */
#ifdef FIX_1461_CNG_BW_SWITCHING
                /* -- nbands may need to be updated here in case the bandwidth was changed due to inactive frames */
                NFFT_inner = shl( inner_frame_tbl[sts[0]->bwidth], 1 );
                hCPE->hStereoDft->nbands = stereo_dft_band_config_fx( hCPE->hStereoDft->band_limits, hCPE->hStereoDft->hConfig->band_res, NFFT_inner, ENC );
                move16();
#endif
                IF( EQ_32( sts[0]->core_brate, SID_2k40 ) )
                {
                    stereo_dft_config_fx( hConfigDft, IVAS_SID_5k2, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
Loading