Commit 10208226 authored by emerit's avatar emerit
Browse files

fix usan

parent e52e4fa9
Loading
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3134,6 +3134,16 @@ static void IsmPositionProvider_getNextFrame(
        }

        /* Wrap azimuth to lie within (-180, 180] range */
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        while ( LT_32( objectMetadataBuffer->positions[objIdx].azimuth_fx, -DEG_180_IN_Q22 ) )
        {
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_add( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }
        while ( GE_32( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_180_IN_Q22 ) )
        {
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_sub( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }
#else
        while ( LT_32( objectMetadataBuffer->positions[objIdx].azimuth_fx, 0 ) )
        {
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_add( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
@@ -3142,6 +3152,7 @@ static void IsmPositionProvider_getNextFrame(
        {
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_sub( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }
#endif

        /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */
        objectMetadataBuffer->positions[objIdx].elevation_fx = L_min( L_max( objectMetadataBuffer->positions[objIdx].elevation_fx, -DEG_90_IN_Q22 ), DEG_90_IN_Q22 );
+0 −8
Original line number Diff line number Diff line
@@ -320,17 +320,9 @@ void ivas_apply_non_diegetic_panning_fx(
    const Word16 output_frame              /* i  : output frame length per channel      */
)
{

#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
    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;
}
+3 −3
Original line number Diff line number Diff line
@@ -487,9 +487,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx(
        set32_fx( hrf_right, 0, *filterlength );

#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        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 );
        Word16 pan = add( mult_r( extract_h( SrcSpatial_p->Pos_p_fx[1] ), 2048 ), 32 );
        hrf_left[0] = L_shl_r( cos_table_129[64 - pan], 10 );
        hrf_right[0] = L_shl_r( cos_table_129[pan], 10 );
#else
        hrf_left[0] = L_shr( L_add( SrcSpatial_p->Pos_p_fx[1], ONE_IN_Q25 ), 1 ); // Q25
        move32();
+9 −9
Original line number Diff line number Diff line
@@ -2667,9 +2667,9 @@ static ivas_error updateMcPanGainsForMcOut(
            }
            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] );
                Word16 pan = add( mult_r( extract_h( inputMc->nonDiegeticPanGain_fx ), 32 ), 32 );
                inputMc->panGains_fx[0][0] = L_deposit_h( cos_table_129[64 - pan] );
                inputMc->panGains_fx[0][1] = L_deposit_h( cos_table_129[pan] );
            }
#else
            IF( EQ_32( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
@@ -2891,9 +2891,9 @@ static ivas_error updateMcPanGainsForBinauralOut(
        }
        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] );
            Word16 pan = add( mult_r( extract_h( inputMc->nonDiegeticPanGain_fx ), 32 ), 32 );
            inputMc->panGains_fx[0][0] = L_deposit_h( cos_table_129[64 - pan] );
            inputMc->panGains_fx[0][1] = L_deposit_h( cos_table_129[pan] );
        }
#else
        IF( EQ_32( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
@@ -7014,9 +7014,9 @@ static ivas_error renderIsmToMc(
            }
            ELSE
            {
                Word16 pan = add( mult_r( extract_h( ismInput->nonDiegeticPanGain_fx ), 256 ), 256 );
                currentPanGains_fx[0] = L_deposit_h( sin_scale_tbl_512[pan] );
                currentPanGains_fx[1] = L_deposit_h( cos_scale_tbl_512[pan] );
                Word16 pan = add( mult_r( extract_h( ismInput->nonDiegeticPanGain_fx ), 32 ), 32 );
                currentPanGains_fx[0] = L_deposit_h( cos_table_129[64 - pan] );
                currentPanGains_fx[1] = L_deposit_h( cos_table_129[pan] );
            }
#else
            currentPanGains_fx[0] = L_add( L_shr( ismInput->nonDiegeticPanGain_fx, 1 ), ONE_IN_Q30 ); /* Q31 */