Commit dc36cb5b authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Cleanup macros in options.h

Cleared up below macros:
FIX_1378_ACELP_OUT_OF_BOUNDS , FIX_1379_MASA_ANGLE_ROUND , OPT_BIN_RENDERER_V1 , OPT_BIN_RENDERER_V2 , OPT_STEREO_32KBPS_V1 , OPT_AVOID_STATE_BUF_RESCALE , FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx , FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot , IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE , HARM_PUSH_BIT , HARM_ENC_INIT , DIV32_OPT_NEWTON , IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE , MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE , MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE , FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat , FIX_1439_SPEEDUP_stereo_icBWE_dec_fx , FIX_1439_SPEEDUP_ivas_swb_tbe_dec_fx , FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic , FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 , FIX_1481_HARDCODE_DIV , VEC_ARITH_OPT_v1 , FIX_1486_IND_SHB_RES , FIX_1511_POC_RENORM , TEST_HR , REMOVE_EVS_DUPLICATES , FIX_1713_EXP , FIX_1733_CLDFB_BUG
parent 097e2392
Loading
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1062,7 +1062,6 @@ Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x, Word32 y, Word16 *s )
    return z;
}

#ifdef DIV32_OPT_NEWTON
Word32 div_w_newton( Word32 num, Word32 den );
/*
Table of 256 precalculated estimates to be used by the "div_w_newton"
@@ -1462,7 +1461,6 @@ Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, Word32 y, Word16 *s )

    return z;
}
#endif /* DIV32_OPT_NEWTON */

Word16 BASOP_Util_Divide3232_Scale( Word32 x, Word32 y, Word16 *s )
{
+0 −2
Original line number Diff line number Diff line
@@ -333,11 +333,9 @@ Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x, /*!< i : Numerator*/
                                            Word16 *s ); /*!< o  : Additional scalefactor difference*/


#ifdef DIV32_OPT_NEWTON
Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x,    /*!< i  : Numerator*/
                                           Word32 y,    /*!< i  : Denominator*/
                                           Word16 *s ); /*!< o  : Additional scalefactor difference*/
#endif


/************************************************************************/
+0 −334
Original line number Diff line number Diff line
@@ -242,130 +242,6 @@ Word16 rate2EVSmode(
 *
 * Push a new indice into the buffer
 *-------------------------------------------------------------------*/
#ifndef HARM_PUSH_BIT
void push_indice_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    Word16 id,             /* i  : ID of the indice */
    UWord16 value,         /* i  : value of the quantized indice */
    Word16 nb_bits         /* i  : number of bits used to quantize the indice */
)
{
    Word16 i;


    IF( EQ_16( hBstr->last_ind_fx, id ) )
    {
        /* indice with the same name as the previous one */
        i = hBstr->next_ind_fx;
        move16();
    }
    ELSE
    {
        /* new indice - find an empty slot in the list */
        i = id;
        move16();
        WHILE( hBstr->ind_list[i].nb_bits != -1 )
        {
            i = add( i, 1 );
        }
    }

    /* store the values in the list */
    hBstr->ind_list[i].value = value;
    move16();
    hBstr->ind_list[i].nb_bits = nb_bits;
    move16();

    /* updates */
    hBstr->next_ind_fx = add( i, 1 );
    move16();
    hBstr->last_ind_fx = id;
    move16();
    hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits );
    move16();

    return;
}
/*-------------------------------------------------------------------*
 * push_next_indice()            *
 * Push a new indice into the buffer at the next position
 *-------------------------------------------------------------------*/

void push_next_indice_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    UWord16 value,         /* i  : value of the quantized indice */
    Word16 nb_bits         /* i  : number of bits used to quantize the indice */
)
{

    /* store the values in the list */
    hBstr->ind_list[hBstr->next_ind_fx].value = value;
    move16();
    hBstr->ind_list[hBstr->next_ind_fx].nb_bits = nb_bits;
    move16();
    hBstr->next_ind_fx = add( hBstr->next_ind_fx, 1 );
    move16();

    /* update the total number of bits already written */
    hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits );
    move16();

    return;
}


/*-------------------------------------------------------------------*
 * push_next_bits()
 * Push a bit buffer into the buffer at the next position
 *-------------------------------------------------------------------*/

void push_next_bits_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    Word16 bits[],         /* i  : bit buffer to pack, sequence of single bits */
    Word16 nb_bits         /* i  : number of bits to pack */
)
{
    UWord16 code;
    Word16 i, nb_bits_m15;
    Indice *ptr;

    ptr = &hBstr->ind_list[hBstr->next_ind_fx];
    nb_bits_m15 = sub( nb_bits, 15 );
    i = 0;
    move16();
    IF( nb_bits_m15 > 0 )
    {
        FOR( ; i < nb_bits_m15; i += 16 )
        {
            code = s_or( lshl( bits[i], 15 ), s_or( lshl( bits[i + 1], 14 ), s_or( lshl( bits[i + 2], 13 ), s_or( lshl( bits[i + 3], 12 ),
                                                                                                                  s_or( lshl( bits[i + 4], 11 ), s_or( lshl( bits[i + 5], 10 ), s_or( lshl( bits[i + 6], 9 ), s_or( lshl( bits[i + 7], 8 ),
                                                                                                                                                                                                                    s_or( lshl( bits[i + 8], 7 ), s_or( lshl( bits[i + 9], 6 ), s_or( lshl( bits[i + 10], 5 ), s_or( lshl( bits[i + 11], 4 ),
                                                                                                                                                                                                                                                                                                                     s_or( lshl( bits[i + 12], 3 ), s_or( lshl( bits[i + 13], 2 ), s_or( lshl( bits[i + 14], 1 ), bits[i + 15] ) ) ) ) ) ) ) ) ) ) ) ) ) ) );

            ptr->value = code;
            move16();
            ptr->nb_bits = 16;
            move16();
            ++ptr;
        }
    }
    IF( LT_16( i, nb_bits ) )
    {
        FOR( ; i < nb_bits; ++i )
        {
            ptr->value = bits[i];
            move16();
            ptr->nb_bits = 1;
            move16();
            ++ptr;
        }
    }
    hBstr->next_ind_fx = (Word16) ( ptr - hBstr->ind_list );
    move16();
    hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits );
    move16();
}
#endif

/*-------------------------------------------------------------------*
 * get_next_indice_fx( )
@@ -528,12 +404,6 @@ void reset_indices_enc_fx(
    move16();
    hBstr->nb_bits_tot = 0;
    move16();
#ifndef HARM_PUSH_BIT
    hBstr->next_ind_fx = 0;
    move16();
    hBstr->last_ind_fx = -1;
    move16();
#endif
    FOR( i = 0; i < max_num_indices; i++ )
    {
        hBstr->ind_list[i].nb_bits = -1;
@@ -564,215 +434,11 @@ void reset_indices_dec_fx(
 *
 * Write the buffer of indices to a file
 *-------------------------------------------------------------------*/
#ifndef HARM_PUSH_BIT
void write_indices_fx(
    Encoder_State *st_fx,  /* i/o: encoder state structure */
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    FILE *file             /* i  : output bitstream file   */
    ,
    UWord8 *pFrame,    /* i: byte array with bit packet and byte aligned coded speech data */
    Word16 pFrame_size /* i: size of the binary encoded access unit [bits] */
)
{
    Word16 i, k;
    Word16 stream[2 + MAX_BITS_PER_FRAME], *pt_stream;
    Word32 mask;
    UWord8 header;
    Word16 isAmrWb = 0;
    move16();

    IF( st_fx->bitstreamformat == G192 )
    {
        /*-----------------------------------------------------------------*
         * Encode Sync Header and Frame Length
         *-----------------------------------------------------------------*/
        pt_stream = stream;
        FOR( i = 0; i < ( 2 + MAX_BITS_PER_FRAME ); ++i )
        {
            stream[i] = 0;
            move16();
        }
        *pt_stream++ = SYNC_GOOD_FRAME;
        move16();
        *pt_stream++ = hBstr->nb_bits_tot;
        move16();

        /*----------------------------------------------------------------*
         * Bitstream packing (conversion of individual indices into a serial stream)
         * Writing the serial stream into file
         *----------------------------------------------------------------*/

        FOR( i = 0; i < MAX_NUM_INDICES; i++ )
        {
            IF( NE_16( hBstr->ind_list[i].nb_bits, -1 ) )
            {
                /* mask from MSB to LSB */
                mask = L_shl( 1, sub( hBstr->ind_list[i].nb_bits, 1 ) );

                /* write bit by bit */
                FOR( k = 0; k < hBstr->ind_list[i].nb_bits; k++ )
                {
                    IF( L_and( hBstr->ind_list[i].value, mask ) )
                    {
                        *pt_stream++ = G192_BIN1;
                        move16();
                    }
                    ELSE
                    {
                        *pt_stream++ = G192_BIN0;
                        move16();
                    }

                    mask = L_shr( mask, 1 );
                }
            }
        }
    }
    ELSE
    {
        /* Create and write ToC header */
        /*  qbit always  set to  1 on encoder side  for AMRWBIO ,  no qbit in use for EVS, but set to 0(bad)  */
        header = (UWord8) ( s_or( s_or( shl( st_fx->Opt_AMR_WB, 5 ), shl( st_fx->Opt_AMR_WB, 4 ) ), rate2EVSmode( L_mult0( hBstr->nb_bits_tot, 50 ), &isAmrWb ) ) );
        move16();
        fwrite( &header, sizeof( UWord8 ), 1, file );
        /* Write speech bits */
        fwrite( pFrame, sizeof( UWord8 ), shr( add( pFrame_size, 7 ), 3 ), file );
    }

    /* Clearing of indices */
    FOR( i = 0; i < MAX_NUM_INDICES; i++ )
    {
        hBstr->ind_list[i].nb_bits = -1;
        move16();
    }


    IF( st_fx->bitstreamformat == G192 )
    {
        /* write the serial stream into file */
        fwrite( stream, sizeof( unsigned short ), 2 + stream[1], file );
    }
    /* reset index pointers */
    hBstr->nb_bits_tot = 0;
    move16();
    hBstr->next_ind_fx = 0;
    move16();
    hBstr->last_ind_fx = -1;
    move16();

    return;
}
#endif
/*-------------------------------------------------------------------*
 * write_indices_buf_fx()
 *
 * Write the buffer of indices to a file
 *-------------------------------------------------------------------*/
#ifndef HARM_PUSH_BIT
void write_indices_buf_fx(
    Encoder_State *st_fx,  /* i/o: encoder state structure */
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    UWord16 *out_buf,      /* i  : output bitstream buf   */
    UWord8 *pFrame,        /* i: byte array with bit packet and byte aligned coded speech data */
    Word16 pFrame_size,    /* i: size of the binary encoded access unit [bits] */
    UWord16 *num_bits )
{
    Word16 i, k;
    Word16 stream[2 + MAX_BITS_PER_FRAME], *pt_stream;
    Word32 mask;
    UWord8 header;
    Word16 isAmrWb = 0;

    IF( st_fx->bitstreamformat == G192 )
    {
        /*-----------------------------------------------------------------*
         * Encode Sync Header and Frame Length
         *-----------------------------------------------------------------*/
        pt_stream = stream;
        FOR( i = 0; i < ( 2 + MAX_BITS_PER_FRAME ); ++i )
        {
            stream[i] = 0;
            move16();
        }
        //*pt_stream++ = (Word16) SYNC_GOOD_FRAME;
        //*pt_stream++ = hBstr->nb_bits_tot;
        *num_bits = hBstr->nb_bits_tot;
        move16();
        /*----------------------------------------------------------------*
         * Bitstream packing (conversion of individual indices into a serial stream)
         * Writing the serial stream into file
         *----------------------------------------------------------------*/
        FOR( i = 0; i < MAX_NUM_INDICES; i++ )
        {
            IF( NE_16( hBstr->ind_list[i].nb_bits, -1 ) )
            {
                /* mask from MSB to LSB */
                mask = L_shl( 1, ( sub( hBstr->ind_list[i].nb_bits, 1 ) ) );

                /* write bit by bit */
                FOR( k = 0; k < hBstr->ind_list[i].nb_bits; k++ )
                {
                    IF( L_and( hBstr->ind_list[i].value, mask ) )
                    {
                        //*pt_stream++ = G192_BIN1;
                        *pt_stream++ = 1;
                        move16();
                    }
                    ELSE
                    {
                        //*pt_stream++ = G192_BIN0;
                        *pt_stream++ = 0;
                        move16();
                    }

                    mask = L_shr( mask, 1 );
                }
            }
        }
    }
    ELSE
    {
        /* Create and write ToC header */
        /*  qbit always  set to  1 on encoder side  for AMRWBIO ,  no qbit in use for EVS, but set to 0(bad)  */
        header = (UWord8) ( s_or( s_or( shl( st_fx->Opt_AMR_WB, 5 ), shl( st_fx->Opt_AMR_WB, 4 ) ), rate2EVSmode( i_mult( hBstr->nb_bits_tot, 50 ), &isAmrWb ) ) );
        // fwrite(&header, sizeof(UWord8), 1, file);
        memcpy( out_buf, &header, sizeof( UWord8 ) );
        *num_bits += sizeof( UWord8 );
        /* Write speech bits */
        // fwrite(pFrame, sizeof(UWord8), (pFrame_size + 7) >> 3, file);
        memcpy( out_buf, pFrame, sizeof( UWord8 ) * ( shr( add( pFrame_size, 7 ), 3 ) ) );
        *num_bits += sizeof( UWord8 ) * ( shr( ( add( pFrame_size, 7 ) ), 3 ) );
    }

    /* Clearing of indices */
    FOR( i = 0; i < MAX_NUM_INDICES; i++ )
    {
        hBstr->ind_list[i].nb_bits = -1;
        move16();
    }


    IF( st_fx->bitstreamformat == G192 )
    {
        /* write the serial stream into file */
        // fwrite(stream, sizeof(unsigned short), 2 + stream[1], file);
        // FILE *ftemp = fopen( "./output/bitstreams/out.COD", "ab" );
        // fwrite( stream, sizeof( unsigned short ), 2 + stream[1], ftemp );
        // fclose( ftemp );
        memcpy( out_buf, stream, sizeof( unsigned short ) * ( *num_bits ) );
        //*num_bits += sizeof( unsigned short ) * ( 2 + stream[1] );
    }
    /* reset index pointers */
    hBstr->nb_bits_tot = 0;
    hBstr->next_ind_fx = 0;
    hBstr->last_ind_fx = -1;
    move16();
    move16();
    move16();

    return;
}
#endif
/*-------------------------------------------------------------------*
 * indices_to_serial()
 *
+0 −59
Original line number Diff line number Diff line
@@ -508,13 +508,8 @@ void cldfbAnalysis_ts_fx(
            rr12_fx = L_sub( r1_fx, r2_fx );             // q -1
            ri12_fx = L_negate( L_add( i1_fx, i2_fx ) ); // q - 1
                                                         /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] );     // q - 3
            rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3
#else                                                                                                                  /* OPT_AVOID_STATE_BUF_RESCALE */
            rBuffer_fx[2 * k] = L_sub( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_im_fx[k] ) );                     // q - 3
            rBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_re_fx[k] ) );                 // q - 3
#endif                                                                                                                 /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();

@@ -522,13 +517,8 @@ void cldfbAnalysis_ts_fx(
            ir12_fx = L_add( r1_fx, r2_fx ); // q - 1
            ii12_fx = L_sub( i1_fx, i2_fx ); // q - 1
                                             /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] );     // q - 3
            iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3
#else                                                                                                                  /* OPT_AVOID_STATE_BUF_RESCALE */
            iBuffer_fx[2 * k] = L_sub( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_im_fx[k] ) );                     // q - 3
            iBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_re_fx[k] ) );                 // q - 3
#endif                                                                                                                 /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();
        }
@@ -595,13 +585,8 @@ void cldfbAnalysis_ts_fx(
            rr12_fx = L_add( r1_fx, r2_fx ); // q - 1
            ri12_fx = L_sub( i1_fx, i2_fx ); // q - 1
                                             /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] );     // q - 3
            rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3
#else                                                                                                                  /* OPT_AVOID_STATE_BUF_RESCALE */
            rBuffer_fx[2 * k] = L_sub( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_im_fx[k] ) );                                             // q - 3
            rBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_re_fx[k] ) );                                         // q - 3
#endif                                                                                                                 /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();

@@ -609,13 +594,8 @@ void cldfbAnalysis_ts_fx(
            ir12_fx = L_sub( r1_fx, r2_fx ); // q - 1
            ii12_fx = L_add( i1_fx, i2_fx ); // q - 1
                                             /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] );     // q - 3
            iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3
#else                                                                                                                  /* OPT_AVOID_STATE_BUF_RESCALE */
            iBuffer_fx[2 * k] = L_sub( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_im_fx[k] ) );                                             // q - 3
            iBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_re_fx[k] ) );                                         // q - 3
#endif                                                                                                                 /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();
        }
@@ -640,22 +620,6 @@ void cldfbAnalysis_ts_fx(
        }
        fft_cldfb_fx( rBuffer_fx, M2 );

#ifndef FIX_1733_CLDFB_BUG
        /* post modulation of DST IV */
        FOR( k = 0; k < M2; k++ )
        {
            /*cplxMult(&realBuffer[M1-1-(2*k)],&realBuffer[2*k],rBuffer[2*k],rBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ); // q - 5
            realBuffer_fx[2 * k] = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] );                      // q - 5
#else                                                                                                                                                              /* OPT_AVOID_STATE_BUF_RESCALE */
            realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = L_sub( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) ); // q - 5
            realBuffer_fx[2 * k] = L_add( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) );                      // q - 5
#endif                                                                                                                                                             /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();
        }
#endif
        *q_cldfb = sub( *q_cldfb, 2 );
        move16();

@@ -676,35 +640,23 @@ void cldfbAnalysis_ts_fx(
            move32();
        }

#ifdef FIX_1733_CLDFB_BUG
        /* post modulation of DST IV */
        FOR( k = 0; k < M2; k++ )
        {
            /*cplxMult(&realBuffer[M1-1-(2*k)],&realBuffer[2*k],rBuffer[2*k],rBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ); // q - 5
            realBuffer_fx[2 * k] = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] );                      // q - 5
#else                                                                                                                                                              /* OPT_AVOID_STATE_BUF_RESCALE */
            realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = L_sub( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) ); // q - 5
            realBuffer_fx[2 * k] = L_add( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) );                      // q - 5
#endif                                                                                                                                                             /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();
        }

#endif
        /* post modulation of DCT IV */
        FOR( k = 0; k < M2; k++ )
        {
            /* do it inplace */
            /*cplxMult(&imagBuffer[2*k],&imagBuffer[M1-1-(2*k)],iBuffer[2*k],iBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            imagBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_re_fx[k] ), iBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] );                  // q - 5
            imagBuffer_fx[( M1 - 1 ) - ( k * 2 )] = Madd_32_32( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_im_fx[k] ), iBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ); // q - 5
#else                                                                                                                                                          /* OPT_AVOID_STATE_BUF_RESCALE */
            imagBuffer_fx[2 * k] = L_sub( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( iBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) );                  // q - 5
            imagBuffer_fx[( M1 - 1 ) - ( k * 2 )] = L_add( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( iBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) ); // q - 5
#endif                                                                                                                                                         /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();
        }
@@ -725,13 +677,8 @@ void cldfbAnalysis_ts_fx(
                    /*cplxMult(&realBuffer[k], &imagBuffer[k], realBuffer[k], imagBuffer[k], rot_vctr_delay_re[k], rot_vctr_delay_im[k]);*/
                    /*realBuffer[k] = rBuffer[k];
                    imagBuffer[k] = iBuffer[k];*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
                    cplx_aux_fx = Msub_32_32( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_re_fx[k] ), imagBuffer_fx[k], rot_vctr_delay_im_fx[k] );      // q - 5
                    imagBuffer_fx[k] = Madd_32_32( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_im_fx[k] ), imagBuffer_fx[k], rot_vctr_delay_re_fx[k] ); // q - 5
#else                                                                                                                                                   /* OPT_AVOID_STATE_BUF_RESCALE */
                    cplx_aux_fx = L_sub( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_re_fx[k] ), Mpy_32_32( imagBuffer_fx[k], rot_vctr_delay_im_fx[k] ) );             // q - 5
                    imagBuffer_fx[k] = L_add( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_im_fx[k] ), Mpy_32_32( imagBuffer_fx[k], rot_vctr_delay_re_fx[k] ) );        // q - 5
#endif                                                                                                                                                  /* OPT_AVOID_STATE_BUF_RESCALE */
                    realBuffer_fx[k] = cplx_aux_fx;
                    move32();
                    move32();
@@ -1436,9 +1383,7 @@ void cldfbSynthesis_ivas_fx(
    Word32 *timeOut_fx,            /* o  : output time domain samples  Qx - 1*/
    const Word16 samplesToProcess, /* i  : number of processed samples */
    const Word16 shift,            /* i  : scale for state buffer */
#ifdef OPT_AVOID_STATE_BUF_RESCALE
    const Word16 out_shift,          /* i  : scale for output buffer */
#endif                               /* OPT_AVOID_STATE_BUF_RESCALE */
    HANDLE_CLDFB_FILTER_BANK h_cldfb /* i  : filter bank state           */
)
{
@@ -1675,16 +1620,13 @@ void cldfbSynthesis_ivas_fx(
            }
        }

#ifdef OPT_AVOID_STATE_BUF_RESCALE
        IF( 0 == out_shift )
        {
#endif /* OPT_AVOID_STATE_BUF_RESCALE */
            FOR( i = 0; i < M1; i++ )
            {
                ptr_time_out_fx[( M1 - 1 ) - i] = synthesisBuffer_fx[4 * L2 + M1 + i];
                move32();
            }
#ifdef OPT_AVOID_STATE_BUF_RESCALE
        }
        ELSE
        {
@@ -1694,7 +1636,6 @@ void cldfbSynthesis_ivas_fx(
                move32();
            }
        }
#endif /* OPT_AVOID_STATE_BUF_RESCALE */

        ptr_time_out_fx += M1;

+0 −8

File changed.

Preview size limit exceeded, changes collapsed.

Loading