Commit 8d60aca7 authored by multrus's avatar multrus
Browse files

work in progress - unclear, whether this works

parent 6d0d7634
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 ########################### */

+20 −4
Original line number Diff line number Diff line
@@ -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;
#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