Commit be1e7ba4 authored by Gregory Pallone's avatar Gregory Pallone
Browse files

use of wrapped_angle

parent 3cae6e18
Loading
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -312,11 +312,6 @@ typedef enum
#define ADJUST_ISM_BRATE_POS                    8000

#define ISM_AZIMUTH_NBITS                       7
#ifdef FIX_2570_BUF_OVFL   
#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX         28                          /* -90.0f in ism metadata */
#define ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX        64                          /* 0.0f in ism metadata */
#define ISM_AZIMUTH_MAX_NON_DIEGETIC_FX         100                         /* 90.0f in ism metadata */
#endif
#define ISM_AZIMUTH_MIN                         -180.0f
#define ISM_AZIMUTH_MAX                         180.0f
#define ISM_AZIMUTH_LOW_BORDER                  -140.0f
+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@
#define FIX_1559                                        /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */
#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_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW     /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */
#define FIX_FLOAT_1578_OMASA_REND_SPIKES                /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */

/* ##################### End NON-BE switches ########################### */
+0 −11
Original line number Diff line number Diff line
@@ -871,17 +871,6 @@ static void decode_angle_indices(
    }
    else
    {
#ifdef FIX_2570_BUF_OVFL
        /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */
        if ( idx_angle1 > ISM_AZIMUTH_MAX_NON_DIEGETIC_FX )
        {
            idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX;
        }
        else if ( idx_angle1 < ISM_AZIMUTH_MIN_NON_DIEGETIC_FX )
        {
            idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX;
        }
#endif
        idx_angle2 = angle->last_angle2_idx; /* second MD parameter is not transmitted for non-diegetic object */
    }

+23 −2
Original line number Diff line number Diff line
@@ -227,9 +227,30 @@ void ivas_apply_non_diegetic_panning(
    const int16_t output_frame         /* i  : output frame length per channel      */
)
{
    float pan_left, pan_right;
    float pan_left, pan_right, pan;
#ifdef FIX_2570_BUF_OVFL
    float wrapped_angle; // -90 <= wrapped_angle <= 90
#endif

    float pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f;
#ifdef FIX_2570_BUF_OVFL
    if ( non_diegetic_pan_gain < -90.0 )
    {
        wrapped_angle = -180.0 - non_diegetic_pan_gain;
    }
    else if ( non_diegetic_pan_gain > 90.0 )
    {
        wrapped_angle = 180.0 - non_diegetic_pan_gain;
    }
    else
    {
        wrapped_angle = non_diegetic_pan_gain;
    }
    pan = ( wrapped_angle + 1.f ) * 0.5f;
#else
    pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f;
#endif

    pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f;
    pan_left = sinf( pan * EVS_PI * 0.5f );
    pan_right = cosf( pan * EVS_PI * 0.5f );
    v_multc( input_f, pan_right, output_f[1], output_frame );
+19 −0
Original line number Diff line number Diff line
@@ -318,6 +318,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    float pan;
#endif
#ifdef FIX_2570_BUF_OVFL
    float wrapped_angle; // -90 <= wrapped_angle <= 90
#endif

    /* Evaluate the HR filters from the source and listener positions and orientations */
    Listener_p = hBinRendererTd->Listener_p;
@@ -392,7 +395,23 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
        set_f( hrf_left, 0.0f, *filterlength );
        set_f( hrf_right, 0.0f, *filterlength );
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
#ifdef FIX_2570_BUF_OVFL
        if ( SrcSpatial_p->Pos_p[1] < -90.0 )
        {
            wrapped_angle = -180.0 - SrcSpatial_p->Pos_p[1];
        }
        else if ( SrcSpatial_p->Pos_p[1] > 90.0 )
        {
            wrapped_angle = 180.0 - SrcSpatial_p->Pos_p[1];
        }
        else
        {
            wrapped_angle = SrcSpatial_p->Pos_p[1];
        }
        pan = ( wrapped_angle + 1.f ) * 0.5f;
#else
        pan = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f;
#endif
        hrf_left[0] = sinf( pan * EVS_PI * 0.5f );
        hrf_right[0] = cosf( pan * EVS_PI * 0.5f );
#else
Loading