From 8d60aca7d3dba3cb18d45fee6efd404d01b5c55c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 14 Apr 2026 12:52:21 +0200 Subject: [PATCH] work in progress - unclear, whether this works --- lib_com/options.h | 1 + lib_rend/ivas_orient_trk_fx.c | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c274abb89..f28659d71 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -108,6 +108,7 @@ #define FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN /* Nokia: BASOP issue 2513: Removes extra return block */ #define FIX_BASOP_2514_EFAP_PORTING_ERROR /* Nokia: BASOP issue 2514: Fix wrongly ported line */ #define FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG /* Nokia: BASOP issue 2516: Fix porting bug in setting planar state for custom layout in renderer */ +#define FIX_BASOP_2534_ORIENT_TRK_AVG /* FhG: BASOP issue 2534: Fix Q-factors in ivas_orient_trk_Process_fx() */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/ivas_orient_trk_fx.c b/lib_rend/ivas_orient_trk_fx.c index 3c911bd0a..29482e2e3 100644 --- a/lib_rend/ivas_orient_trk_fx.c +++ b/lib_rend/ivas_orient_trk_fx.c @@ -955,23 +955,32 @@ ivas_error ivas_orient_trk_Process_fx( move16(); Word16 temp_result = BASOP_Util_Divide3232_Scale( angle_fx, pOTR->adaptationAngle_fx, &result_e ); relativeOrientationRate_fx = L_deposit_h( temp_result ); +#ifndef FIX_BASOP_2534_ORIENT_TRK_AVG Word32 one_fx = ONE_IN_Q30; move32(); - + IF( GT_32( relativeOrientationRate_fx, one_fx ) ) +#else + IF( GT_32( relativeOrientationRate_fx, ONE_IN_Q30 ) ) +#endif { +#ifdef FIX_BASOP_2534_ORIENT_TRK_AVG + relativeOrientationRate_fx = ONE_IN_Q30; +#else relativeOrientationRate_fx = 1; - move32(); - } +#endif + move32(); + } /* Compute range of the adaptation rate between center = lower rate and off-center = higher rate */ - rateRange_fx = L_sub( pOTR->offCenterAdaptationRate_fx, pOTR->centerAdaptationRate_fx ); + rateRange_fx = L_sub( pOTR->offCenterAdaptationRate_fx, pOTR->centerAdaptationRate_fx ); /* Q31 */ /* 'if' assumed to perform comparison to 0 */ if ( 0 > rateRange_fx ) { rateRange_fx = 0; move32(); } +#ifndef FIX_BASOP_2534_ORIENT_TRK_AVG IF( EQ_32( relativeOrientationRate_fx, 1 ) ) { cutoff_prod = rateRange_fx; @@ -983,10 +992,17 @@ ivas_error ivas_orient_trk_Process_fx( { cutoff_prod = Mpy_32_32( relativeOrientationRate_fx, rateRange_fx ); q_cutoff_prod = add( Q31, sub( sub( 31, result_e ), 31 ) ); +#else + cutoff_prod = L_shl( Mpy_32_32( relativeOrientationRate_fx, rateRange_fx ), 1); /* Q31 */ + q_cutoff_prod = Q31; +#endif + move16(); +#ifndef FIX_BASOP_2534_ORIENT_TRK_AVG } Word16 temp_diff; temp_diff = sub( 31, q_cutoff_prod ); cutoff_prod = L_shl( cutoff_prod, temp_diff ); +#endif /* Compute adaptivity cutoff frequency: interpolate between minimum (center) and maximum (off-center) values */ cutoffFrequency_fx = L_add( pOTR->centerAdaptationRate_fx, cutoff_prod ); // Q31 -- GitLab