Commit 0f8223e9 authored by Manuel Jander's avatar Manuel Jander
Browse files

Merge remote-tracking branch 'origin' into...

Merge remote-tracking branch 'origin' into basop-2518-regression2553-artifact-in-hoa3-bitrate-switching
parents 437d10e8 7e3f3315
Loading
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3179,7 +3179,13 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0;
        }


#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        /* Wrap azimuth to lie within (0, 360] range */
#else
        /* Wrap azimuth to lie within (-180, 180] range */
#endif

        while ( LT_32( objectMetadataBuffer->positions[objIdx].azimuth_fx, 0 ) )
        {
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_add( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
@@ -3189,6 +3195,14 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_sub( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }

#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        IF( objectMetadataBuffer->positions[objIdx].non_diegetic_flag && objectMetadataBuffer->positions[objIdx].azimuth_fx >= DEG_180_IN_Q22 )
        {
            /* Wrap azimuth to lie within [-180, 180) range for non-diegetic panning */
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_sub( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }
#endif

        /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */
        objectMetadataBuffer->positions[objIdx].elevation_fx = L_min( L_max( objectMetadataBuffer->positions[objIdx].elevation_fx, -DEG_90_IN_Q22 ), DEG_90_IN_Q22 );

+14 −0
Original line number Diff line number Diff line
@@ -896,7 +896,21 @@ Word16 shr_o( Word16 var1, Word16 var2, Flag *Overflow )

Word16 shr( Word16 var1, Word16 var2 )
{
#ifdef FIX_BASOP_2563_CRASH_HQ_GENERIC_DEC
    Flag Overflow;
    Word16 result;

    Overflow = 0;

    result = shr_o( var1, var2, &Overflow );
    if ( Overflow )
    {
        assert( 0 );
    }
    return result;
#else
    return shr_o( var1, var2, NULL );
#endif
}
Word16 shr_sat( Word16 var1, Word16 var2 )
{
+3 −0
Original line number Diff line number Diff line
@@ -1948,6 +1948,9 @@ typedef enum
#define ONE_IN_Q31                              0x7fffffff
#define ONE_IN_Q45                              (Word64)0x200000000000
#define ONE_IN_Q62                              (Word64)0x4000000000000000
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
#define MINUS_ONE_IN_Q31                        ( -2147483647 - 1 ) /* same as (Word32)0x80000000 */
#endif

#define MAX_WORD16                              32767

+3 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@
#define FIX_BASOP_2555_FRAMELEN_CALC                    /* FhG: BASOP issue 2555: Simplify (sub-)framelength calculation in ivas_mdct_core_tns_ns_fx() */
#define FIX_BASOP_2095_REMOVE_TABLES_PT01               /* FhG: BASOP issue 2095: remove unused tables, part 01 */
#define FIX_2346_DUPLICATED_IGF_FUNCTIONS_2             /* FhG: part 2 of basop issue 2346: Review potentially duplicated IGF functions */
#define FIX_BASOP_2563_CRASH_HQ_GENERIC_DEC             /* Eri: BASOP issue 2563: Crash in hq_generic decoding. EVS code --> solve with _sat operator */
#define FIX_2095_REMOVE_UNUSED_ISAR_TABLES              /* Dolby: remove unused ISAR */
#define FIX_BASOP_2560_STEREO_DFT_DEC_RESET             /* FhG: BASOP issue 2560: align reset of hStereoDft->res_gains_ind_fx[][] between BASOP and float */
#define HARMONIZE_2539_cng_energy                       /* FhG: basop issue 2539: harmonize cng_energy with its ivas derivate */
@@ -135,6 +136,7 @@
#define FIX_BASOP_2531_MCT_CP_BITRATE                   /* FhG: BASOP issue 2531: Fix MCT cp_bitrate calculation; affects bitrate switching only */
#define FIX_BASOP_2541_OMASA_ENC_FIXES                  /* Nokia: BASOP issue 2541: Fix function ivas_encode_masaism_metadata_fx */
#define FIX_BASOP_2545_FIX_LTV_REGRESSION_2529          /* Nokia: BASOP issue 2545: Fix LTV regression caused by issue 2529 fix */
#define FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW     /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */
#define FIX_FLOAT_1573_POSITION_UPDATE                  /* Eri: Float issue 1573: For static orientation and listener movement, the PoseUpdated flag is cleared and prevents 5 ms update rate. */
#define FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS         /* FhG: BASOP issue 2521: Fix wrong porting for determination of first subframe length in ivas_sba_dirac_stereo_compute_td_stefi_nrgs() */
#define FIX_1452_DEFAULT_REVERB                         /* Nokia/Philips/FhG: Fix default room presets and their usage in renderer */
@@ -144,6 +146,7 @@
#define FIX_BASOP_2548_ProcessIGF_fx_PREDICTIONGAIN     /* FhG: fixes obvious bug for IVAS path. For EVS path, issue is still not resolved */
#define FIX_FMSW_DEC                                    /* float issue 1542: fix JBM issue in format switching */
#define FIX_FMSW_DEC_2                                  /* float issue 1575: fix crash for format switching when bitsream starts with EVS */
#define FIX_BASOP_2562_HQ_PREECHO_SAT                   /* Eri/Orange: Basop issue 2562: Add saturation to L_add in preecho calculations */
#define FIX_BASOP_2561_STEREO_DFT_ENC_COMPUTE_ITD       /* BASOP issue 2561: fix diffs in stereo_dft_enc_compute_itd() between float and BASOP */
#define FIX_BASOP_2517_CLICK_IN_OMASA_LTV               /* FhG: BASOP #2517: preserve precision by removing one-bit headroom from Q_min and allowing saturation during buffer scaling */
#define NONBE_FIX_ISSUE_2518                            /* FhG: Fix issue 2518, noise during ACELP switching from 16KHz to 12k8Hz by improving Q_new calculation. */
+5 −1
Original line number Diff line number Diff line
@@ -2748,7 +2748,11 @@ void hq_generic_decoding_fx(
    tmp1_fx = extract_h( L_shl( L_tmp1, exp1 ) );
    tmp2_fx = extract_h( L_shl( L_tmp2, exp2 ) );
    tmp3_fx = div_s( tmp2_fx, tmp1_fx ); /*15 + exp2 + 15 - (exp1 + 15) */
#ifdef FIX_BASOP_2563_CRASH_HQ_GENERIC_DEC
    tmp3_fx = shr_sat( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */
#else
    tmp3_fx = shr( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */
#endif

    if ( LT_16( tmp3_fx, 307 /*0.3 in Q10 */ ) )
    {
Loading