Commit 639456e7 authored by emerit's avatar emerit
Browse files

fix panning law for non diegetic panning in case of object and in renderer,...

fix panning law for non diegetic panning in case of object and in renderer, improve panning precision
parent 82ef8f7d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@
#define FIX_BASOP_REMOVE_SYNTH2_FX                      /* FhG: Replace 32bit olapBufferSynth2_fx with 16bit olapBufferSynth2 buffer */
#define FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION  /* Nokia: float issue 1528: Fixes incorrect compensation for ISM metadata delay in 5ms TD rendering */
#define FIX_2462_PARCOR_FIX                             /* VA: issue 2462: Fix bug in calculating parcor coefficient in Calc_rc0_h() */
#define FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION /* Orange: float issue 2482: Non-diegetic panning: Limitation/Saturation for BASOP */

/* ##################### End NON-BE switches ########################### */

+6 −3
Original line number Diff line number Diff line
@@ -320,11 +320,14 @@ void ivas_apply_non_diegetic_panning_fx(
    const Word16 output_frame              /* i  : output frame length per channel      */
)
{

#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
    Word16 pan = add( mult_r( non_diegetic_pan_gain_fx, 256 ), 256 );
    v_multc_fx_16( input_f_fx, cos_scale_tbl_512[pan], output_fx[1], output_frame );
    v_multc_fx_16( input_f_fx, sin_scale_tbl_512[pan], output_fx[0], output_frame );
#else
    Word16 pan = add( mult_r( non_diegetic_pan_gain_fx, 32 ), 32 ); // 0.5.Q15 = 16384                             // Q15
    v_multc_fx_16( input_f_fx, cos_table_129[pan], output_fx[1], output_frame );
    v_multc_fx_16( input_f_fx, cos_table_129[64 - pan], output_fx[0], output_frame );


#endif
    return;
}
+9 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@
#include "ivas_prot_rend_fx.h"
#include "wmc_auto.h"
#include "ivas_prot_fx.h"
#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
#include "rom_com.h"
#endif


/*---------------------------------------------------------------------*
@@ -457,10 +460,16 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx(
        move32();
        set32_fx( hrf_left, 0, *filterlength );
        set32_fx( hrf_right, 0, *filterlength );
#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
        Word16 pan = add( mult_r( extract_h( SrcSpatial_p->Pos_p_fx[1] ), 16384 ), 256 );
        hrf_left[0] = L_shl_r( sin_scale_tbl_512[pan], 10 );
        hrf_right[0] = L_shl_r( cos_scale_tbl_512[pan], 10 );
#else
        hrf_left[0] = L_shr( L_add( SrcSpatial_p->Pos_p_fx[1], ONE_IN_Q25 ), 1 ); // Q25
        move32();
        hrf_right[0] = L_sub( ONE_IN_Q25, hrf_left[0] ); // Q25
        move32();
#endif
        hrf_left_e = 6;
        move16();
        hrf_right_e = 6;
+22 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@
#include "ivas_cnst.h"
#include "ivas_rom_com.h"
#include "ivas_rom_rend.h"
#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
#include "rom_com.h"
#endif
#include "wmc_auto.h"
#ifdef DEBUGGING
#include "debug.h"
@@ -2653,6 +2656,24 @@ static ivas_error updateMcPanGainsForMcOut(
        test();
        IF( EQ_32( inputMc->base.inConfig, IVAS_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) )
        {
#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
            IF( EQ_32( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
            {
                inputMc->panGains_fx[0][0] = ONE_IN_Q31;
                inputMc->panGains_fx[0][1] = 0;
            }
            ELSE IF( EQ_32( L_add( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ), 0 ) )
            {
                inputMc->panGains_fx[0][0] = 0;
                inputMc->panGains_fx[0][1] = ONE_IN_Q31;
            }
            ELSE
            {
                Word16 pan = add( mult_r( extract_h( inputMc->nonDiegeticPanGain_fx ), 256 ), 256 );
                inputMc->panGains_fx[0][0] = L_deposit_h( sin_scale_tbl_512[pan] );
                inputMc->panGains_fx[0][1] = L_deposit_h( cos_scale_tbl_512[pan] );
            }
#else
            IF( EQ_32( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
            {
                inputMc->panGains_fx[0][0] = ONE_IN_Q31;
@@ -2664,6 +2685,7 @@ static ivas_error updateMcPanGainsForMcOut(
            move32();
            inputMc->panGains_fx[0][1] = L_sub( ONE_IN_Q31, inputMc->panGains_fx[0][0] );
            move32();
#endif
            error = IVAS_ERR_OK;
            move32();
        }