Commit 298e556c authored by Jan Kiene's avatar Jan Kiene
Browse files

Accept FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW

parent f7647073
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -3066,11 +3066,7 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0;
        }

#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        /* Wrap azimuth to lie within [0, 360) range */
#else
        /* Wrap azimuth to lie within (-180, 180] range */
#endif
        while ( objectMetadataBuffer->positions[objIdx].azimuth < 0.0f )
        {
            objectMetadataBuffer->positions[objIdx].azimuth += 360.0f;
@@ -3080,13 +3076,11 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].azimuth -= 360.0f;
        }

#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        if ( objectMetadataBuffer->positions[objIdx].non_diegetic_flag && objectMetadataBuffer->positions[objIdx].azimuth >= 180.0f )
        {
            /* Wrap azimuth to lie within [-180, 180) range for non-diegetic panning */
            objectMetadataBuffer->positions[objIdx].azimuth -= 360.0f;
        }
#endif


        /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */
+0 −1
Original line number Diff line number Diff line
@@ -169,7 +169,6 @@
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#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 */
#define FIX_2585_BIT_ALLOCATION_DIFF                    /* VA : issue 2585, bit allocation different behaviors between float and fixed-point for corner cases */

+0 −7
Original line number Diff line number Diff line
@@ -315,9 +315,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
    float hrf_right[SFX_SPAT_BIN_MAX_FILTER_LENGTH];
    float azim_delta;
    float elev_delta;
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    float pan;
#endif
    float wrapped_angle; // -90 <= wrapped_angle <= 90

    /* Evaluate the HR filters from the source and listener positions and orientations */
@@ -392,7 +390,6 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
        *Gain = 1.0f;
        set_f( hrf_left, 0.0f, *filterlength );
        set_f( hrf_right, 0.0f, *filterlength );
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        if ( SrcSpatial_p->Pos_p[1] < -1.f )
        {
            wrapped_angle = -2.f - SrcSpatial_p->Pos_p[1];
@@ -408,10 +405,6 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
        pan = ( wrapped_angle + 1.f ) * 0.5f;
        hrf_left[0] = sinf( pan * EVS_PI * 0.5f );
        hrf_right[0] = cosf( pan * EVS_PI * 0.5f );
#else
        hrf_left[0] = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f;
        hrf_right[0] = 1.f - hrf_left[0];
#endif
        *intp_count = MAX_INTERPOLATION_STEPS;
        Src_p->elev_prev = 0;
        Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */
+0 −21
Original line number Diff line number Diff line
@@ -2211,9 +2211,7 @@ static ivas_error updateMcPanGainsForMcOut(
    const AUDIO_CONFIG outConfig )
{
    ivas_error error;
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    float pan;
#endif

    /* "if" conditions below realize the following mapping:

@@ -2237,14 +2235,9 @@ static ivas_error updateMcPanGainsForMcOut(
    {
        if ( ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) )
        {
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
            pan = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f;
            inputMc->panGains[0][0] = sinf( pan * EVS_PI * 0.5f );
            inputMc->panGains[0][1] = cosf( pan * EVS_PI * 0.5f );
#else
            inputMc->panGains[0][0] = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f;
            inputMc->panGains[0][1] = 1.f - inputMc->panGains[0][0];
#endif
            error = IVAS_ERR_OK;
        }
        else
@@ -2375,21 +2368,14 @@ static ivas_error updateMcPanGainsForAmbiOut(
static ivas_error updateMcPanGainsForBinauralOut(
    input_mc *inputMc )
{
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    float pan;
#endif

    setZeroPanMatrix( inputMc->panGains );
    if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO )
    {
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        pan = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f;
        inputMc->panGains[0][0] = sinf( pan * EVS_PI * 0.5f );
        inputMc->panGains[0][1] = cosf( pan * EVS_PI * 0.5f );
#else
        inputMc->panGains[0][0] = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f;
        inputMc->panGains[0][1] = 1.f - inputMc->panGains[0][0];
#endif
    }
    else
    {
@@ -6001,9 +5987,7 @@ static ivas_error renderIsmToMc(
    int8_t position_changed;
    pan_vector currentPanGains;
    ivas_error error;
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    float pan;
#endif


    push_wmops( "renderIsmToMc" );
@@ -6013,14 +5997,9 @@ static ivas_error renderIsmToMc(
    {
        if ( ismInput->nonDiegeticPan )
        {
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
            pan = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f;
            ismInput->prev_pan_gains[0] = currentPanGains[0] = sinf( pan * EVS_PI * 0.5f );
            ismInput->prev_pan_gains[1] = currentPanGains[1] = cosf( pan * EVS_PI * 0.5f );
#else
            ismInput->prev_pan_gains[0] = currentPanGains[0] = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f;
            ismInput->prev_pan_gains[1] = currentPanGains[1] = 1.f - currentPanGains[0];
#endif
        }
        else
        {