Commit 0a7ec391 authored by multrus's avatar multrus
Browse files

Merge branch 'main' into basop-1966-improve-tonal-detection-accuracy-using-32bit

parents 3b8c063f 06686cc2
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@
#define HARMONIZE_2539_cng_energy                       /* FhG: basop issue 2539: harmonize cng_energy with its ivas derivate */
#define FIX_1585_ASAN_FORMAT_SW_ALT                     /* VA,FhG: float issues 1585,1593: alternative fix memory leaks with format switching */
#define FIX_BASOP_2573_RF_MODE_UPDATE                   /* FhG: BASOP issue 2573: remove duplicated update of rf_mode parameters from evs_enc_fx(); was already done in updt_enc_common_fx() */
#define FIX_2570_BUF_OVFL                               /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */

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

+21 −1
Original line number Diff line number Diff line
@@ -332,6 +332,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx(
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    Word16 pan;
#endif
#ifdef FIX_2570_BUF_OVFL
    Word32 wrapped_angle;
#endif
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word16 pos_q;
    Word32 Src_p_tmp[3];
@@ -488,7 +491,24 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx(
        set32_fx( hrf_right, 0, *filterlength );
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        pan = add( extract_h( L_shl( SrcSpatial_p->Pos_p_fx[1], sub( Q21, SrcSpatial_p->q_Pos_p ) ) ), 32 );
#ifdef FIX_2570_BUF_OVFL
        IF( LT_32( L_add( ONE_IN_Q25, SrcSpatial_p->Pos_p_fx[1] ), 0 ) )
        {
            wrapped_angle = L_negate( L_add( ONE_IN_Q26, SrcSpatial_p->Pos_p_fx[1] ) );
        }
        ELSE IF( GT_32( L_sub( SrcSpatial_p->Pos_p_fx[1], ONE_IN_Q25 ), 0 ) )
        {
            wrapped_angle = L_sub( ONE_IN_Q26, SrcSpatial_p->Pos_p_fx[1] );
        }
        ELSE
        {
            wrapped_angle = SrcSpatial_p->Pos_p_fx[1];
            move32();
        }
        pan = add( extract_h( L_shr( wrapped_angle, sub( SrcSpatial_p->q_Pos_p, Q21 ) ) ), 32 );
#else
        pan = add( extract_h( L_shr( SrcSpatial_p->Pos_p_fx[1], sub( SrcSpatial_p->q_Pos_p, Q21 ) ) ), 32 );
#endif
#else
        pan = add( mult_r( extract_h( SrcSpatial_p->Pos_p_fx[1] ), 2048 ), 32 );
#endif