Commit 3c91afbd authored by Nicolas Roussin's avatar Nicolas Roussin
Browse files

Merge branch 'main' into 2180-implement-basop-w_negate-operation

parents 52cf8c92 5cb54858
Loading
Loading
Loading
Loading
Loading
+34 −6
Original line number Diff line number Diff line
@@ -3448,7 +3448,11 @@ static void do_object_editing_fx(

        if ( readInfo->bg_gain_edited )
        {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
            editableParameters->gain_bed_fx = (Word32) ( readInfo->bg_gain * 536870912 ); /* Q29 */
#else
            editableParameters->gain_bed_fx = (Word32) readInfo->bg_gain * 536870912;                                                                                                                                                       /* Q29 */
#endif
        }

        for ( obj_idx = 0; obj_idx < editableParameters->num_obj; obj_idx++ )
@@ -3461,11 +3465,19 @@ static void do_object_editing_fx(
                    if ( readInfo->obj_azi_relative[obj_idx] )
                    {
                        /* azimuth: apply relative edit + wrap */
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = ( ( editableParameters->ism_metadata[obj_idx].azimuth_fx + (Word32) ( readInfo->obj_azi[obj_idx] * 4194304 ) + 2264924160 ) % 1509949440 ) - 754974720; /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = ( ( editableParameters->ism_metadata[obj_idx].azimuth_fx + (Word32) readInfo->obj_azi[obj_idx] * 4194304 + 2264924160 ) % 1509949440 ) - 754974720;          /* Q22 */
#endif
                    }
                    else
                    {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = (Word32) ( readInfo->obj_azi[obj_idx] * 4194304 ); /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = (Word32) readInfo->obj_azi[obj_idx] * 4194304;                                                                                                               /* Q22 */
#endif
                    }
                }
                if ( readInfo->obj_ele_edited[obj_idx] )
@@ -3473,11 +3485,19 @@ static void do_object_editing_fx(
                    if ( readInfo->obj_ele_relative[obj_idx] )
                    {
                        /* elevation: apply relative edit + saturation */
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].elevation_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].elevation_fx + (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ), 377487360 ), -377487360 ); /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].elevation_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].elevation_fx + (Word32) readInfo->obj_ele[obj_idx] * 4194304, 377487360 ), -377487360 );           /* Q22 */
#endif
                    }
                    else
                    {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ); /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) readInfo->obj_ele[obj_idx] * 4194304;                                                                                                             /* Q22 */
#endif
                    }
                }
            }
@@ -3489,14 +3509,22 @@ static void do_object_editing_fx(
                {
                    /* gain: apply relative edit + saturation */
#ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                    editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( L_shl_sat( Mpy_32_32( editableParameters->ism_metadata[obj_idx].gain_fx, (Word32) ( readInfo->obj_gain[obj_idx] * 536870912 ) ), 2 ), OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29*Q29 -> Q27 shift back to Q29 */
#else
                    editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( L_shl_sat( Mpy_32_32( editableParameters->ism_metadata[obj_idx].gain_fx, (Word32) readInfo->obj_gain[obj_idx] * 536870912 ), 2 ), OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29*Q29 -> Q27 shift back to Q29 */
#endif
#else
                    editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].gain_fx * (Word32) readInfo->obj_gain[obj_idx] * 536870912, OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29 */
#endif
                }
                else
                {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                    editableParameters->ism_metadata[obj_idx].gain_fx = (Word32) ( readInfo->obj_gain[obj_idx] * 536870912 ); /* Q29 */
#else
                    editableParameters->ism_metadata[obj_idx].gain_fx = (Word32) readInfo->obj_gain[obj_idx] * 536870912;                                                                                                                   /* Q29 */
#endif
                }
            }
        }
+188 −71
Original line number Diff line number Diff line
@@ -2322,19 +2322,35 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    l = sub( shr( n, 3 ), 1 ); /* (3*m/8) - 1 = (n/8) - 1 */
    FOR( i = 0; i < l; i++ )
    {
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *RZ0++, 15 );                /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *RZ0++, 15 );                  /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0( acc, *RZ1, t_sin[c1_ind] );   /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0( acc, *IZ1, t_sin[s1_ind] );   // Q15 + Qx
        acc = L_mac0( acc, *RZ2, t_sin[c2_ind] );   // Q15 + Qx
        acc = L_mac0( acc, *IZ2, t_sin[s2_ind] );   // Q15 + Qx
#endif
        *RY++ = round_fx( acc ); /* bit growth = 1 (compensated by non-fractional mode MAC). Qx - 1*/
        move16();

#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#endif
        *IY-- = round_fx( acc ); // Qx - 1
        move16();

@@ -2348,19 +2364,35 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    l = shr( m, 3 ); /* (4*m/8) - (3*m/8) = m/8 */
    FOR( i = 0; i < l; i++ )
    {
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *RZ0++, 15 );                // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *RZ0++, 15 );                  // Q15 + Qx
        acc = L_mac0( acc, *RZ1, t_sin[c1_ind] );   /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0( acc, *IZ1, t_sin[s1_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *RZ2, t_sin[c2_ind] );   // Q15 + Qx
        acc = L_mac0( acc, *IZ2, t_sin[s2_ind] );   // Q15 + Qx
#endif
        *RY++ = round_fx( acc ); // Qx - 1
        move16();

#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#endif
        *IY-- = round_fx( acc ); // Qx - 1
        move16();

@@ -2371,9 +2403,15 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    }

    /* special case: i = m/2 i.e. 1/3 */
#ifdef FIX_2170_ASSERT_IN_FFT3
    acc = L_shl_sat( *RZ0--, 15 );                // Q15 + Qx
    acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx
    acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
#else
    acc = L_shl( *RZ0--, 15 );                      // Q15 + Qx
    acc = L_mac0( acc, *RZ1, t_sin[c1_ind] );       // Q15 + Qx
    acc = L_msu0( acc, *RZ2, t_sin[c2_ind] );       // Q15 + Qx
#endif
    *RY++ = round_fx( acc ); // Qx - 1
    move16();

@@ -2396,19 +2434,34 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    l = sub( shr( m, 2 ), 1 ); /* (6*m/8) - ((m/2)+1) = m/4 - 1 */
    FOR( i = 0; i < l; i++ )
    {
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *RZ0--, 15 );                // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_msu0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *RZ0--, 15 );                  // Q15 + Qx
        acc = L_mac0( acc, *RZ1, t_sin[c1_ind] );   /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_msu0( acc, *IZ1, t_sin[s1_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *RZ2, t_sin[c2_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *IZ2, t_sin[s2_ind] );   // Q15 + Qx
#endif
        *RY++ = round_fx( acc ); // Qx - 1
        move16();

        acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_msu0_sat( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx
#else
        acc = L_msu0( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx
#endif
        *IY-- = round_fx( acc ); // Qx - 1
        move16();

@@ -2423,19 +2476,34 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    l = shr( m, 2 );
    FOR( i = 0; i < l; i++ )
    {
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *RZ0--, 15 );                // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_msu0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *RZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1, t_sin[c1_ind] );   /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_msu0( acc, *IZ1, t_sin[s1_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *RZ2, t_sin[c2_ind] );   // Q15 + Qx
        acc = L_mac0( acc, *IZ2, t_sin[s2_ind] );   // Q15 + Qx
#endif
        *RY++ = round_fx( acc ); // Qx - 1
        move16();

        acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_msu0_sat( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx
#else
        acc = L_msu0( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx
#endif
        *IY-- = round_fx( acc ); // Qx - 1
        move16();

@@ -2446,15 +2514,26 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    }

    /* special case: i = m, i.e 2/3 */
#ifdef FIX_2170_ASSERT_IN_FFT3
    acc = L_shl_sat( *RZ0++, 15 );                // Q15 + Qx
    acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx
    acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
#else
    acc = L_shl( *RZ0++, 15 );                      // Q15 + Qx
    acc = L_msu0( acc, *RZ1, t_sin[c1_ind] );       // Q15 + Qx
    acc = L_msu0( acc, *RZ2, t_sin[c2_ind] );       // Q15 + Qx
#endif
    *RY++ = round_fx( acc ); // Qx - 1
    move16();

    acc = L_deposit_l( 0 );
#ifdef FIX_2170_ASSERT_IN_FFT3
    acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
    acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
#else
    acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] );     // Q15 + Qx
    acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] );     // Q15 + Qx
#endif
    *IY-- = round_fx( acc ); // Qx - 1
    move16();
    IZ0--; /* Just decrement the address counter */
@@ -2470,19 +2549,35 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    l = sub( shr( m, 3 ), 1 ); /* (9*m/8) - (m +1) = m/8 - 1 */
    FOR( i = 0; i < l; i++ )
    {
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *RZ0++, 15 );                // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *RZ0++, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1, t_sin[c1_ind] );   /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0( acc, *IZ1, t_sin[s1_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *RZ2, t_sin[c2_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *IZ2, t_sin[s2_ind] );   // Q15 + Qx
#endif
        *RY++ = round_fx( acc ); // Qx - 1
        move16();

#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#endif
        *IY-- = round_fx( acc ); // Qx - 1
        move16();

@@ -2496,19 +2591,35 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    l = shr( n, 3 ); /* (12*m/8) - (9*m/8) = 3*m/8 = n/8 */
    FOR( i = 0; i < l; i++ )
    {
#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *RZ0++, 15 );                // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *RZ0++, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1, t_sin[c1_ind] );   /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/
        acc = L_mac0( acc, *IZ1, t_sin[s1_ind] );   // Q15 + Qx
        acc = L_mac0( acc, *RZ2, t_sin[c2_ind] );   // Q15 + Qx
        acc = L_msu0( acc, *IZ2, t_sin[s2_ind] );   // Q15 + Qx
#endif
        *RY++ = round_fx( acc ); // Qx - 1
        move16();

#ifdef FIX_2170_ASSERT_IN_FFT3
        acc = L_shl_sat( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#else
        acc = L_shl( *IZ0--, 15 );                  // Q15 + Qx
        acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx
        acc = L_msu0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx
        acc = L_mac0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx
#endif
        *IY-- = round_fx( acc ); // Qx - 1
        move16();

@@ -2519,9 +2630,15 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n )
    }

    /* special case: i = 3*m/2 */
#ifdef FIX_2170_ASSERT_IN_FFT3
    acc = L_shl_sat( *RZ0, 15 );                  // Q15 + Qx
    acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx
    acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx
#else
    acc = L_shl( *RZ0, 15 );                        // Q15 + Qx
    acc = L_msu0( acc, *RZ1, t_sin[c1_ind] );       // Q15 + Qx
    acc = L_mac0( acc, *RZ2, t_sin[c2_ind] );       // Q15 + Qx
#endif
    *RY = round_fx( acc ); // Qx - 1
    move16();

+4 −0
Original line number Diff line number Diff line
@@ -87,10 +87,14 @@
#define FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT                  /* FhG: fix for issue 2166 - add missing averaging factor 0.5 in for the sum of energies in function stereo_dft_dmx_swb_nrg_fx()*/

#define FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE                /* FhG: Use dynamic Q factor for synth_fx and synthFB_fx to prevent overflow */
#define FIX_2170_ASSERT_IN_FFT3                              /* Eri: Assert in fft3_fx from EVS, adding _sat */
#define FIX_2082_FP_LEFTOVERS_OMASA_DEC                      /* Nokia: fix for issue 2082, cleaning remaining floating point code */
#define FIX_2174_JBM_BASOP_ALIGNMENT                         /* VoiceAge, Nokia: Fixes to JBM BASOP implementation and alignment to float */

#define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO          /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */
#define FIX_2015_PREMPH_SAT_ALT                              /* VA: saturation can happen during preemphasis filtering due to a too aggressive scaling factor, allows preemphis to get 1 more bit headroom */
#define FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE       /* Nokia: Fixes float  to fx conversion in decoder app with object edit file interface */

/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+28 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ void preemph_copy_fx(

    return;
}

#ifndef FIX_2015_PREMPH_SAT_ALT
void preemph_copy_32fx(
    const Word16 x[], /* i  : input signal             Qx  */
    Word32 y[],       /* o  : output signal            Qx  */
@@ -66,7 +66,34 @@ void preemph_copy_32fx(

    return;
}
#else
void preemph_copy_32fx2(
    const Word16 x[], /* i  : input signal             Qx  */
    Word32 y[],       /* o  : output signal            Qx-1*/
    const Word16 mu,  /* i  : preemphasis coefficient  Q15 */
    const Word16 lg,  /* i  : vector size              Q0  */
    Word16 *mem       /* i/o: memory (x[-1])           Qx  */
)
{
    Word16 i, temp;

    temp = x[lg - 1]; /* Qx */
    move16();

    FOR( i = lg - 1; i > 0; i-- )
    {
        y[i] = L_msu0_sat( L_mult( x[i], 16384 ), x[i - 1], mu ); /* Qx+16 */
        move16();
    }
    y[0] = L_msu0_sat( L_mult( x[0], 16384 ), *mem, mu ); /* Qx+16 */
    move16();

    *mem = temp; /* Qx */
    move16();

    return;
}
#endif
/*-------------------------------------------------------------*
 * preemph_ivas_fx()
 *
+15 −2
Original line number Diff line number Diff line
@@ -2754,8 +2754,11 @@ void lag_wind_32(
// preemp_fx.c
#define PREEMPH_FX( signal, mu, L, mem ) preemph_copy_fx( ( signal ), ( signal ), ( mu ), ( L ), ( mem ) )
#ifndef FIX_2015_PREMPH_SAT_ALT
#define PREEMPH_32FX( signal, signal_out, mu, L, mem ) preemph_copy_32fx( ( signal ), ( signal_out ), ( mu ), ( L ), ( mem ) )
#else
#define PREEMPH_32FX( signal, signal_out, mu, L, mem ) preemph_copy_32fx2( ( signal ), ( signal_out ), ( mu ), ( L ), ( mem ) )
#endif
void preemph_copy_fx(
    const Word16 x[], /* i  : i   signal             Qx  */
    Word16 y[],       /* o  : output signal            Qx  */
@@ -2764,6 +2767,7 @@ void preemph_copy_fx(
    Word16 *mem       /* i/o: memory (x[-1])           Qx  */
);
#ifndef FIX_2015_PREMPH_SAT_ALT
void preemph_copy_32fx(
    const Word16 x[], /* i  : i   signal             Qx  */
    Word32 y[],       /* o  : output signal            Qx  */
@@ -2771,6 +2775,15 @@ void preemph_copy_32fx(
    const Word16 lg,  /* i  : vector size              Q0  */
    Word16 *mem       /* i/o: memory (x[-1])           Qx  */
);
#else
void preemph_copy_32fx2(
    const Word16 x[], /* i  : i   signal             Qx  */
    Word32 y[],       /* o  : output signal            Qx  */
    const Word16 mu,  /* i  : preemphasis coefficient  Q15 */
    const Word16 lg,  /* i  : vector size              Q0  */
    Word16 *mem       /* i/o: memory (x[-1])           Qx  */
);
#endif
void E_UTIL_f_preemph2(
    Word16 shift,    /* Q0 */
Loading