Commit 2dc2dccc authored by emerit's avatar emerit
Browse files

Merge branch 'main' into update_crend

parents 30fae9b2 0105b21a
Loading
Loading
Loading
Loading
+110 −78

File changed.

Preview size limit exceeded, changes collapsed.

+37 −37
Original line number Diff line number Diff line
@@ -104,17 +104,17 @@ void fft16_with_cmplx_data( cmplx *pInp, Word16 bsacle );
 *
 * \return   void
 */
static void fft5_with_cmplx_data( cmplx *inp )
static void fft5_with_cmplx_data( cmplx *inp /*Qx*/ )
{
    cmplx x0, x1, x2, x3, x4;
    cmplx y1, y2, y3, y4;
    cmplx t;

    x0 = CL_shr( inp[0], SCALEFACTOR5 );
    x1 = CL_shr( inp[1], SCALEFACTOR5 );
    x2 = CL_shr( inp[2], SCALEFACTOR5 );
    x3 = CL_shr( inp[3], SCALEFACTOR5 );
    x4 = CL_shr( inp[4], SCALEFACTOR5 );
    x0 = CL_shr( inp[0], SCALEFACTOR5 ); // Qx - 4
    x1 = CL_shr( inp[1], SCALEFACTOR5 ); // Qx - 4
    x2 = CL_shr( inp[2], SCALEFACTOR5 ); // Qx - 4
    x3 = CL_shr( inp[3], SCALEFACTOR5 ); // Qx - 4
    x4 = CL_shr( inp[4], SCALEFACTOR5 ); // Qx - 4

    y1 = CL_add( x1, x4 );
    y4 = CL_sub( x1, x4 );
@@ -162,14 +162,14 @@ static void fft5_with_cmplx_data( cmplx *inp )
 *
 * \return   void
 */
static void fft8_with_cmplx_data( cmplx *inp )
static void fft8_with_cmplx_data( cmplx *inp /*Qx*/ )
{
    cmplx x0, x1, x2, x3, x4, x5, x6, x7;
    cmplx s0, s1, s2, s3, s4, s5, s6, s7;
    cmplx t0, t1, t2, t3, t4, t5, t6, t7;

    /* Pre-additions */
    x0 = CL_shr( inp[0], SCALEFACTOR8 );
    x0 = CL_shr( inp[0], SCALEFACTOR8 ); // Qx - 4
    x1 = CL_shr( inp[1], SCALEFACTOR8 );
    x2 = CL_shr( inp[2], SCALEFACTOR8 );
    x3 = CL_shr( inp[3], SCALEFACTOR8 );
@@ -244,7 +244,7 @@ static void fft8_with_cmplx_data( cmplx *inp )
 * \return   void
 */

static void fft10_with_cmplx_data( cmplx *inp_data )
static void fft10_with_cmplx_data( cmplx *inp_data /*Qx*/ )
{
    cmplx r1, r2, r3, r4;
    cmplx x0, x1, x2, x3, x4, t;
@@ -252,7 +252,7 @@ static void fft10_with_cmplx_data( cmplx *inp_data )

    /* FOR i=0 */
    {
        x0 = CL_shr( inp_data[0], SCALEFACTOR10 );
        x0 = CL_shr( inp_data[0], SCALEFACTOR10 ); // Qx - 5
        x1 = CL_shr( inp_data[2], SCALEFACTOR10 );
        x2 = CL_shr( inp_data[4], SCALEFACTOR10 );
        x3 = CL_shr( inp_data[6], SCALEFACTOR10 );
@@ -280,7 +280,7 @@ static void fft10_with_cmplx_data( cmplx *inp_data )
    }
    /* FOR i=1 */
    {
        x0 = CL_shr( inp_data[5], SCALEFACTOR10 );
        x0 = CL_shr( inp_data[5], SCALEFACTOR10 ); // Qx - 5
        x1 = CL_shr( inp_data[1], SCALEFACTOR10 );
        x2 = CL_shr( inp_data[3], SCALEFACTOR10 );
        x3 = CL_shr( inp_data[7], SCALEFACTOR10 );
@@ -353,14 +353,14 @@ static void fft10_with_cmplx_data( cmplx *inp_data )
 * \return   void
 */

static void fft15_with_cmplx_data( cmplx *inp_data )
static void fft15_with_cmplx_data( cmplx *inp_data /*Qx*/ )
{
    cmplx c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14;
    cmplx c_z0, c_z1, c_z2, c_z3, c_z4, c_z5, c_z6, c_z7, c_z8, c_z9, c_z10, c_z11, c_z12, c_z13, c_z14;
    cmplx c_y1, c_y2, c_y3, c_y4;
    cmplx c_t;

    c0 = CL_shr( inp_data[0], SCALEFACTOR15 );
    c0 = CL_shr( inp_data[0], SCALEFACTOR15 ); // Qx - 5
    c1 = CL_shr( inp_data[3], SCALEFACTOR15 );
    c2 = CL_shr( inp_data[6], SCALEFACTOR15 );
    c3 = CL_shr( inp_data[9], SCALEFACTOR15 );
@@ -497,8 +497,8 @@ static void fft15_with_cmplx_data( cmplx *inp_data )
 *           WOPS with 32x16 bit multiplications (scale on ):  288 cycles
 *           WOPS with 32x16 bit multiplications (scale off):  256 cycles
 *
 * \param    [i/o] re    real input / output
 * \param    [i/o] im    imag input / output
 * \param    [i/o] re    real input / output Qx
 * \param    [i/o] im    imag input / output Qx
 * \param    [i  ] s     stride real and imag input / output
 *
 * \return   void
@@ -529,7 +529,7 @@ void fft16( Word32 *re, Word32 *im, Word16 s, Word16 bScale )
    }
}

void fft16_with_cmplx_data( cmplx *input, Word16 bScale )
void fft16_with_cmplx_data( cmplx *input /*Qx*/, Word16 bScale )
{
    cmplx x0, x1, x2, x3, temp;
    cmplx t0, t2, t4, t6, t7;
@@ -538,7 +538,7 @@ void fft16_with_cmplx_data( cmplx *input, Word16 bScale )
    IF( bScale )
    {
        {
            x0 = CL_shr( input[0], SCALEFACTOR16 );
            x0 = CL_shr( input[0], SCALEFACTOR16 ); // Qx - 5
            x1 = CL_shr( input[4], SCALEFACTOR16 );
            x2 = CL_shr( input[8], SCALEFACTOR16 );
            x3 = CL_shr( input[12], SCALEFACTOR16 );
@@ -553,7 +553,7 @@ void fft16_with_cmplx_data( cmplx *input, Word16 bScale )
            y[3] = CL_add( t2, t6 );


            x0 = CL_shr( input[1], SCALEFACTOR16 );
            x0 = CL_shr( input[1], SCALEFACTOR16 ); // Qx - 5
            x1 = CL_shr( input[5], SCALEFACTOR16 );
            x2 = CL_shr( input[9], SCALEFACTOR16 );
            x3 = CL_shr( input[13], SCALEFACTOR16 );
@@ -568,7 +568,7 @@ void fft16_with_cmplx_data( cmplx *input, Word16 bScale )
            y[7] = CL_add( t2, t6 );


            x0 = CL_shr( input[2], SCALEFACTOR16 );
            x0 = CL_shr( input[2], SCALEFACTOR16 ); // Qx - 5
            x1 = CL_shr( input[6], SCALEFACTOR16 );
            x2 = CL_shr( input[10], SCALEFACTOR16 );
            x3 = CL_shr( input[14], SCALEFACTOR16 );
@@ -584,7 +584,7 @@ void fft16_with_cmplx_data( cmplx *input, Word16 bScale )
            y[11] = CL_add( t2, t6 );


            x0 = CL_shr( input[3], SCALEFACTOR16 );
            x0 = CL_shr( input[3], SCALEFACTOR16 ); // Qx - 5
            x1 = CL_shr( input[7], SCALEFACTOR16 );
            x2 = CL_shr( input[11], SCALEFACTOR16 );
            x3 = CL_shr( input[15], SCALEFACTOR16 );
@@ -736,7 +736,7 @@ void fft16_with_cmplx_data( cmplx *input, Word16 bScale )
 *
 * \return   void
 */
static void fft20_with_cmplx_data( cmplx *inp_data )
static void fft20_with_cmplx_data( cmplx *inp_data /*Qx*/ )
{
    cmplx r1, r2, r3, r4;
    cmplx x0, x1, x2, x3, x4;
@@ -751,7 +751,7 @@ static void fft20_with_cmplx_data( cmplx *inp_data )
    y4 = &y[12];

    {
        x0 = CL_shr( inp_data[0], SCALEFACTOR20 );
        x0 = CL_shr( inp_data[0], SCALEFACTOR20 ); // Qx - 5
        x1 = CL_shr( inp_data[16], SCALEFACTOR20 );
        x2 = CL_shr( inp_data[12], SCALEFACTOR20 );
        x3 = CL_shr( inp_data[8], SCALEFACTOR20 );
@@ -778,7 +778,7 @@ static void fft20_with_cmplx_data( cmplx *inp_data )
        y4[0] = CL_msu_j( r3, r4 );
    }
    {
        x0 = CL_shr( inp_data[5], SCALEFACTOR20 );
        x0 = CL_shr( inp_data[5], SCALEFACTOR20 ); // Qx - 5
        x1 = CL_shr( inp_data[1], SCALEFACTOR20 );
        x2 = CL_shr( inp_data[17], SCALEFACTOR20 );
        x3 = CL_shr( inp_data[13], SCALEFACTOR20 );
@@ -805,7 +805,7 @@ static void fft20_with_cmplx_data( cmplx *inp_data )
        y4[1] = CL_msu_j( r3, r4 );
    }
    {
        x0 = CL_shr( inp_data[10], SCALEFACTOR20 );
        x0 = CL_shr( inp_data[10], SCALEFACTOR20 ); // Qx - 5
        x1 = CL_shr( inp_data[6], SCALEFACTOR20 );
        x2 = CL_shr( inp_data[2], SCALEFACTOR20 );
        x3 = CL_shr( inp_data[18], SCALEFACTOR20 );
@@ -832,7 +832,7 @@ static void fft20_with_cmplx_data( cmplx *inp_data )
        y4[2] = CL_msu_j( r3, r4 );
    }
    {
        x0 = CL_shr( inp_data[15], SCALEFACTOR20 );
        x0 = CL_shr( inp_data[15], SCALEFACTOR20 ); // Qx - 5
        x1 = CL_shr( inp_data[11], SCALEFACTOR20 );
        x2 = CL_shr( inp_data[7], SCALEFACTOR20 );
        x3 = CL_shr( inp_data[3], SCALEFACTOR20 );
@@ -985,7 +985,7 @@ static void fft20_with_cmplx_data( cmplx *inp_data )
 * \return   void
 */

static void fft30_with_cmplx_data( cmplx *inp )
static void fft30_with_cmplx_data( cmplx *inp /*Qx*/ )
{
    cmplx *l = &inp[0];
    cmplx *h = &inp[15];
@@ -994,19 +994,19 @@ static void fft30_with_cmplx_data( cmplx *inp )

    /* 1. FFT15 stage */

    x[0] = CL_shr( inp[0], SCALEFACTOR30_1 );
    x[0] = CL_shr( inp[0], SCALEFACTOR30_1 ); // Qx - 5
    x[1] = CL_shr( inp[18], SCALEFACTOR30_1 );
    x[2] = CL_shr( inp[6], SCALEFACTOR30_1 );
    x[3] = CL_shr( inp[24], SCALEFACTOR30_1 );
    x[4] = CL_shr( inp[12], SCALEFACTOR30_1 );

    x[5] = CL_shr( inp[20], SCALEFACTOR30_1 );
    x[5] = CL_shr( inp[20], SCALEFACTOR30_1 ); // Qx - 5
    x[6] = CL_shr( inp[8], SCALEFACTOR30_1 );
    x[7] = CL_shr( inp[26], SCALEFACTOR30_1 );
    x[8] = CL_shr( inp[14], SCALEFACTOR30_1 );
    x[9] = CL_shr( inp[2], SCALEFACTOR30_1 );

    x[10] = CL_shr( inp[10], SCALEFACTOR30_1 );
    x[10] = CL_shr( inp[10], SCALEFACTOR30_1 ); // Qx - 5
    x[11] = CL_shr( inp[28], SCALEFACTOR30_1 );
    x[12] = CL_shr( inp[16], SCALEFACTOR30_1 );
    x[13] = CL_shr( inp[4], SCALEFACTOR30_1 );
@@ -1140,19 +1140,19 @@ static void fft30_with_cmplx_data( cmplx *inp )

    /* 2. FFT15 stage */

    x[0] = CL_shr( inp[15], SCALEFACTOR30_1 );
    x[0] = CL_shr( inp[15], SCALEFACTOR30_1 ); // Qx - 5
    x[1] = CL_shr( inp[3], SCALEFACTOR30_1 );
    x[2] = CL_shr( inp[21], SCALEFACTOR30_1 );
    x[3] = CL_shr( inp[9], SCALEFACTOR30_1 );
    x[4] = CL_shr( inp[27], SCALEFACTOR30_1 );

    x[5] = CL_shr( inp[5], SCALEFACTOR30_1 );
    x[5] = CL_shr( inp[5], SCALEFACTOR30_1 ); // Qx - 5
    x[6] = CL_shr( inp[23], SCALEFACTOR30_1 );
    x[7] = CL_shr( inp[11], SCALEFACTOR30_1 );
    x[8] = CL_shr( inp[29], SCALEFACTOR30_1 );
    x[9] = CL_shr( inp[17], SCALEFACTOR30_1 );

    x[10] = CL_shr( inp[25], SCALEFACTOR30_1 );
    x[10] = CL_shr( inp[25], SCALEFACTOR30_1 ); // Qx - 5
    x[11] = CL_shr( inp[13], SCALEFACTOR30_1 );
    x[12] = CL_shr( inp[1], SCALEFACTOR30_1 );
    x[13] = CL_shr( inp[19], SCALEFACTOR30_1 );
@@ -1425,14 +1425,14 @@ static void fft30_with_cmplx_data( cmplx *inp )
 */


static void fft32_with_cmplx_data( cmplx *inp )
static void fft32_with_cmplx_data( cmplx *inp /*Qx*/ )
{
    cmplx x[32], y[32], t[32], s[32], temp, temp1;
    const cmplx_s *pRotVector_32 = (const cmplx_s *) RotVector_32;

    /* 1. FFT8 stage */

    x[0] = CL_shr( inp[0], SCALEFACTOR32_1 );
    x[0] = CL_shr( inp[0], SCALEFACTOR32_1 ); // Qx - 5
    x[1] = CL_shr( inp[4], SCALEFACTOR32_1 );
    x[2] = CL_shr( inp[8], SCALEFACTOR32_1 );
    x[3] = CL_shr( inp[12], SCALEFACTOR32_1 );
@@ -1478,7 +1478,7 @@ static void fft32_with_cmplx_data( cmplx *inp )

    /* 2. FFT8 stage */

    x[0] = CL_shr( inp[1], SCALEFACTOR32_1 );
    x[0] = CL_shr( inp[1], SCALEFACTOR32_1 ); // Qx - 5
    x[1] = CL_shr( inp[5], SCALEFACTOR32_1 );
    x[2] = CL_shr( inp[9], SCALEFACTOR32_1 );
    x[3] = CL_shr( inp[13], SCALEFACTOR32_1 );
@@ -1525,7 +1525,7 @@ static void fft32_with_cmplx_data( cmplx *inp )

    /* 3. FFT8 stage */

    x[0] = CL_shr( inp[2], SCALEFACTOR32_1 );
    x[0] = CL_shr( inp[2], SCALEFACTOR32_1 ); // Qx - 5
    x[1] = CL_shr( inp[6], SCALEFACTOR32_1 );
    x[2] = CL_shr( inp[10], SCALEFACTOR32_1 );
    x[3] = CL_shr( inp[14], SCALEFACTOR32_1 );
@@ -1572,7 +1572,7 @@ static void fft32_with_cmplx_data( cmplx *inp )

    /* 4. FFT8 stage */

    x[0] = CL_shr( inp[3], SCALEFACTOR32_1 );
    x[0] = CL_shr( inp[3], SCALEFACTOR32_1 ); // Qx - 5
    x[1] = CL_shr( inp[7], SCALEFACTOR32_1 );
    x[2] = CL_shr( inp[11], SCALEFACTOR32_1 );
    x[3] = CL_shr( inp[15], SCALEFACTOR32_1 );
+887 −866

File changed.

Preview size limit exceeded, changes collapsed.

+350 −350

File changed.

Preview size limit exceeded, changes collapsed.

+7 −7
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ void Comp_and_apply_gain_ivas_fx(
             * y_gain  = pow(10.0, (Ener_per_bd_iQ[i_band]-Ener_per_bd_yQ[i_band]))
             * = pow(2, 3.321928*(Ener_per_bd_iQ[i_band]-Ener_per_bd_yQ[i_band]))
             *-----------------------------------------------------------------*/
            L16 = sub( Ener_per_bd_iQ[i_band], Ener_per_bd_yQ[i_band] ); /*Q12 */
            L16 = sub_sat( Ener_per_bd_iQ[i_band], Ener_per_bd_yQ[i_band] ); /*Q12 */
            L32 = L_mult( L16, 27213 );                                      /* 3.321928 in Q13 -> Q26 */
            L32 = L_shr( L32, 10 );                                          /* From Q26 to Q16 */
            frac = L_Extract_lc( L32, &exp1 );                               /* Extract exponent of gcode0 */
Loading