Commit 285fdabc authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into basop-2248-basop-assert-in-evs-encoder

parents 93f27ef3 cf4064b3
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
+6 −1
Original line number Diff line number Diff line
@@ -57,10 +57,15 @@ Word16 Log2_norm_lc( /* (o) : Fractional part of Log2. (range: 0<=val
{
    Word16 i, a;
    Word16 y;

#ifndef FIX_2264_OUT_OF_BOUND_READING_IN_LOG2_NORM_LC
    if ( L_x <= 0 )
        L_x = L_deposit_h( 0x4000 );
#else

    if ( L_x > 0 )                   /* There are many cases in the code where L_x == 0 */
        assert( L_x >= 0x40000000 ); /* If assert fail, means input is not normalized as it should be */
    L_x = L_max( L_x, 0x40000000 );
#endif
    L_x = L_shr( L_x, 9 );
    a = extract_l( L_x ); /* Extract b10-b24 of fraction */
    a = lshr( a, 1 );
+5 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@
/*#define DISABLE_LIMITER*/

/* ################### Start MAINTENANCE switches ########################### */
#define FIX_2255_ISAR_RENDER_POSES                           /* VA: issue 2255: fix missing check in isar_render_poses() */

/* ################### Start BE switches ################################# */
/* only BE switches wrt wrt. TS 26.251 V3.0 */
@@ -87,6 +88,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 */
#define FIX_2248_EVS_ASSERT                             /* VA: Include _sat in an EVS related part of the code */

/* #################### End BE switches ################################## */
@@ -98,6 +100,9 @@
#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 ########################### */

+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();
                        }
                    }
Loading