Commit 7db9ee9d authored by emerit's avatar emerit
Browse files

Merge branch 'main' into 1963_basop_portFltMR-1568-1471-1690

parents 26432a61 655d660e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1769,7 +1769,7 @@ int main(
            int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
            {
                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK )
                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[sf_idx], &enableHeadRotation[sf_idx], &enableExternalOrientation[sf_idx], &enableRotationInterpolation[sf_idx], &numFramesToTargetOrientation[sf_idx] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in External Orientation File Reading: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
+8 −4
Original line number Diff line number Diff line
@@ -73,14 +73,20 @@

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */

#define ISSUE_1836_replace_overflow_libcom                   /* FhG: replace overflow operators by non-overflow-alternatives in lib_com - BE */
#define ISSUE_1836_replace_overflow_libcom                   /* FhG: BE - replace overflow operators by non-overflow-alternatives in lib_com */
#define ISSUE_1867_replace_overflow_libenc                   /* FhG: BE - replace overflow operators by non-overflow-alternatives all over the lib_enc module */
#define FIX_1942_ASSERTION_LOWSHELF                          /* FhG: Modified the target_gains_db_fx calculation in compute_t60_coeffs_fx() */
#define FIX_1944_CRASH_FOR_STEREO                            /* FhG: improve TonalMDCTConceal_InsertNoise calculation precision */
#define FIX_1970_SBA_CRASH                                   /* Dlb: Fix for issue 1970, SBA crash */

#define FIX_1978_SAT_MISSING_IN_GAIN_ENC                     /* VA:  Fix add saturation missing that lead to a crash in P800-10 */

#define FIX_1979_SAT_MISSING_IN_LSF_ENC                      /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */
#define FIX_1946_CRASH_JBM_PROCESSING                        /* FhG: Increased guard bits of DFT_fx */
#define FIX_1980_CRASH_FDCNG_ENCODESID                       /* FhG: Add one bit of headroom in e_fx calculation in FdCng_encodeSID_ivas_fx() */
#define FIX_1987_CRASH_OMASA_ENERGY                          /* FhG: Replace cldfbAnalysis_ts_fx_fix_q() with cldfbAnalysis_ts_fx_var_q() to avoid assertion error */
#define FIX_1985_SBA_714_HF_LOSS                             /* Dlb: Fix for issue 1985, improved dirac ref pow precision*/
#define FIX_1819_EIGENVALUE_ERROR                            /* FhG: Workaround for zero eigenvalue: replace with epsilon if det != 0*/
/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
@@ -88,9 +94,7 @@
#define NONBE_1302_FIX_OMASA_JBM_FLUSH                  /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */
#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328  */
#define FIX_1319_STACK_SBA_DECODER                      /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */
//de-activate FIX_1320_STACK_CPE_DECODER due to sanitizer issues in #1986; also review needed for patch within FIX_1946_CRASH_JBM_PROCESSING, which gets partially disabled
//#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */

#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */
#define FIX_1984_SAT_IN_PSYCHAD                         /* VA: Issue 1984: proposal to fix an assert */
#define FIX_CREND_SIMPLIFY_CODE   
#ifdef FIX_CREND_SIMPLIFY_CODE
+2 −2
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ void stat_noise_uv_mod_fx(
            {
                exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */
#ifdef ISSUE_1836_replace_overflow_libcom
                exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15  */ //??Sat
                exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15  */
#else
                exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15  */
#endif
@@ -197,7 +197,7 @@ void stat_noise_uv_mod_fx(
            tmp_den = shl( tmp_den, tmp_shift );
            tmp_res = div_s( tmp_nom, tmp_den );
#ifdef ISSUE_1836_replace_overflow_libcom
            tmp_res = shl_sat( tmp_res, tmp_shift ); //??Sat
            tmp_res = shl_sat( tmp_res, tmp_shift );
#else
            tmp_res = shl_o( tmp_res, tmp_shift, &Overflow );
#endif
+9 −5
Original line number Diff line number Diff line
@@ -1446,7 +1446,11 @@ void PsychAdaptLowFreqDeemph(
        tmp_e = min_e;
        move16();
        tmp = Inv16( min, &tmp_e ); /*Q15 - tmp_e*/
#ifdef FIX_1984_SAT_IN_PSYCHAD
        L_tmp = L_shl_sat( L_mult_sat( tmp, max_val ), add( tmp_e, max_e ) ); /* Q31 */
#else
        L_tmp = L_shl( L_mult( tmp, max_val ), add( tmp_e, max_e ) );                     /* Q31 */
#endif
        L_tmp = BASOP_Util_Log2( L_tmp );    /* Q25 */
        L_tmp = L_shr( L_tmp, 7 );           /* 0.0078125f = 1.f/(1<<7) */
        L_tmp = BASOP_Util_InvLog2( L_tmp ); /* Q31 */
+29 −10
Original line number Diff line number Diff line
@@ -77,8 +77,8 @@ ivas_error ivas_core_dec_fx(

    Word16 tmps, incr;
#ifdef FIX_1320_STACK_CPE_DECODER
    Word16 flag_bwe_bws, flaf_swb_tbe;
    Word32 *bwe_exc_extended_fx[CPE_CHANNELS] = { NULL, NULL };
    Word16 flag_bwe_bws;
#else
    Word32 bwe_exc_extended_fx[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET];
#endif
@@ -981,6 +981,24 @@ ivas_error ivas_core_dec_fx(
        Word16 Q_input, Q_hb_synth_fx, Q_synth_fx;
        Word16 Q_syn_hb, sf;

#ifdef FIX_1320_STACK_CPE_DECODER
        flaf_swb_tbe = 0;
        move16();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        if ( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, FB_TBE ) || ( NE_16( st->coder_type, AUDIO ) && NE_16( st->coder_type, INACTIVE ) && GE_32( st->core_brate, SID_2k40 ) && EQ_16( st->core, ACELP_CORE ) && !st->con_tcx && GE_32( output_Fs, 32000 ) && GT_16( st->bwidth, NB ) && st->bws_cnt > 0 ) )
        {
            flaf_swb_tbe = 1;
            move16();
        }
#endif

        sf = getScaleFactor32( output_32_fx[n], L_FRAME48k );

        Q_input = 0;
@@ -1005,7 +1023,6 @@ ivas_error ivas_core_dec_fx(
        IF( EQ_16( st->extl, WB_TBE ) )
        {
            /* WB TBE decoder */

            ivas_wb_tbe_dec_fx( st, st->coder_type, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], hb_synth_16_fx[n], &Q_hb_synth_fx );
        }
        ELSE IF( EQ_16( st->element_mode, IVAS_CPE_TD ) && EQ_16( n, 1 ) && !tdm_LRTD_flag && NE_16( st->extl, -1 ) && st->bws_cnt == 0 && st->extl_brate == 0 )
@@ -1020,9 +1037,7 @@ ivas_error ivas_core_dec_fx(

        /* Memories  Re-Scaling */
#ifdef FIX_1320_STACK_CPE_DECODER
        test();
        test();
        IF( EQ_16( st->extl, WB_TBE ) || ( EQ_16( st->extl, WB_BWE ) && st->bws_cnt == 0 ) )
        IF( !flaf_swb_tbe )
        {
#endif
            Copy_Scale_sig_16_32_no_sat( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11
@@ -1050,6 +1065,7 @@ ivas_error ivas_core_dec_fx(
        test();
        test();
        test();
        test();
        flag_bwe_bws = ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 );
        move16();
#endif
@@ -1057,7 +1073,11 @@ ivas_error ivas_core_dec_fx(
        Q_white_exc = 0;
        move16();

#ifndef FIX_1320_STACK_CPE_DECODER
#ifdef FIX_1320_STACK_CPE_DECODER
        test();
        test();
        IF( flaf_swb_tbe )
#else
        test();
        test();
        test();
@@ -1065,7 +1085,6 @@ ivas_error ivas_core_dec_fx(
        test();
        test();
        test();
#endif
        test();
        test();
        test();
@@ -1077,6 +1096,7 @@ ivas_error ivas_core_dec_fx(
        test();
        test();
        IF( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, FB_TBE ) || ( NE_16( st->coder_type, AUDIO ) && NE_16( st->coder_type, INACTIVE ) && GE_32( st->core_brate, SID_2k40 ) && EQ_16( st->core, ACELP_CORE ) && !st->con_tcx && GE_32( output_Fs, 32000 ) && GT_16( st->bwidth, NB ) && st->bws_cnt > 0 ) )
#endif
        {
            /* SWB TBE decoder */
            ivas_swb_tbe_dec_fx( st, hStereoICBWE, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], old_syn_12k8_16k_fx[n], tmp_buffer_fx /*fb_exc*/, hb_synth_32_fx[n], pitch_buf_fx[n], &Q_white_exc );
@@ -1098,7 +1118,7 @@ ivas_error ivas_core_dec_fx(
            }
        }
#ifdef FIX_1320_STACK_CPE_DECODER
        ELSE IF( st->extl == SWB_BWE || st->extl == FB_BWE || flag_bwe_bws )
        ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || flag_bwe_bws )
#else
        ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( EQ_16( st->nelp_mode_dec, 1 ) && EQ_16( st->bfi, 1 ) ) ) )
#endif
@@ -1115,11 +1135,10 @@ ivas_error ivas_core_dec_fx(
        test();
        test();
        test();
        IF( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 )
        IF( ( st->core == ACELP_CORE && ( EQ_16( st->extl, -1 ) || EQ_16( st->extl, SWB_CNG ) ) ) && flag_bwe_bws == 0 )
        {
            set32_fx( hb_synth_32_fx[n], 0, L_FRAME48k );
        }

#endif

        /*---------------------------------------------------------------------*
Loading