Commit 546a923f authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Macros cleanup

parent 7225ebdc
Loading
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
@@ -598,11 +598,6 @@ void cng_params_postupd_fx(
    const Word16 *const cng_Qexc_buf,  /* i  : Q_exc buffer                                       Q0    */
    const Word32 *const cng_brate_buf, /* i  : bit rate buffer                                    Q0    */
    Word32 ho_env_circ[]               /* i/o: Envelope buffer                                    Q6    */
#ifdef IVAS_CODE_CNG_COM
    ,
    const Word16 element_mode, /* i  : Element mode                        */
    const Word16 bwidth        /* i  : Audio bandwidth                     */
#endif
)
{
    Word16 i, j;
@@ -662,15 +657,6 @@ void cng_params_postupd_fx(
        }

        Copy32( sp, env, NUM_ENV_CNG );
#ifdef IVAS_CODE_CNG_COM
        if ( element_mode == IVAS_SCE || element_mode == IVAS_CPE_DFT )
        {
            att = 0.0f;
            apply_scale( &att, bwidth, last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO );
            att = powf( 10, att / 10.0f );
        }
        else
#endif
        {

            CNG_mode = get_cng_mode( last_active_brate );
@@ -860,11 +846,6 @@ void cng_params_upd_fx(
    Word16 cng_Qexc_buf[],         /* i/o: Q_exc buffer                                       Q0    */
    Word32 cng_brate_buf[],        /* i/o: last_active_brate buffer                           Q0    */
    const Word32 last_active_brate /* i  : Last active bit rate                               Q0    */
#ifdef IVAS_CODE_CNG_COM
    ,
    const Word16 element_mode, /* i  : Element mode                        */
    const Word16 bwidth        /* i  : Audio bandwidth                     */
#endif
)
{
    Word32 L_ener, L_tmp;
@@ -986,15 +967,6 @@ void cng_params_upd_fx(
        }

        Copy32( sp, env, NUM_ENV_CNG );
#ifdef IVAS_CODE_CNG_COM
        if ( element_mode == IVAS_SCE || element_mode == IVAS_CPE_DFT )
        {
            att = 0.0f;
            apply_scale( &att, bwidth, last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO );
            att = powf( 10, att / 10.0f );
        }
        else
#endif
        {
            CNG_mode = get_cng_mode( last_active_brate );
            /* att = 1/pow(2,ENR_ATT_fx[CNG_mode]); */
+0 −134
Original line number Diff line number Diff line
@@ -469,140 +469,6 @@ void tcxInvertWindowGrouping(
    }
}

#ifdef IVAS_CODE_TCX_COM

/*-------------------------------------------------------------------*
 * tcx5SpectrumInterleaving()
 *
 *
 *-------------------------------------------------------------------*/

void tcx5SpectrumInterleaving(
    const int16_t tcx5Size,
    float *spectrum )
{
    int16_t i;
    float interleaveBuf[N_TCX10_MAX];

    set_f( interleaveBuf, 0.0f, N_TCX10_MAX );

    /* group sub-windows: interleave bins according to their frequencies */
    for ( i = 0; i < tcx5Size; i++ )
    {
        interleaveBuf[2 * i] = spectrum[i];
        interleaveBuf[2 * i + 1] = spectrum[tcx5Size + i];
    }

    mvr2r( interleaveBuf, spectrum, 2 * tcx5Size );

    return;
}


/*-------------------------------------------------------------------*
 * tcx5SpectrumDeinterleaving()
 *
 *
 *-------------------------------------------------------------------*/

void tcx5SpectrumDeinterleaving(
    const int16_t tcx5Size,
    float *spectrum )
{
    int16_t i;
    float interleaveBuf[N_TCX10_MAX];

    set_f( interleaveBuf, 0.0f, N_TCX10_MAX );

    /* ungroup sub-windows: interleave bins according to their frequencies */
    for ( i = 0; i < tcx5Size; i++ )
    {
        interleaveBuf[i] = spectrum[2 * i];
        interleaveBuf[tcx5Size + i] = spectrum[2 * i + 1];
    }

    mvr2r( interleaveBuf, spectrum, 2 * tcx5Size );

    return;
}


/*-------------------------------------------------------------------*
 * tcx5TnsGrouping()
 *
 *
 *-------------------------------------------------------------------*/

void tcx5TnsGrouping(
    const int16_t L_frame, /* i  : frame length (TCX5)                                 */
    const int16_t L_spec,  /* i  : coded spec length (TCX5, derived from filter borders*/
    float *spectrum )
{
    /* rearrange LF sub-window lines prior to TNS synthesis filtering */
    if ( L_spec < L_frame )
    {
        mvr2r( spectrum + 8, spectrum + 16, L_spec - 8 );
        mvr2r( spectrum + L_frame, spectrum + 8, 8 );
        mvr2r( spectrum + L_frame + 8, spectrum + L_spec + 8, L_spec - 8 );
    }
    else
    {
        float buff[8]; /* Buffer for the rearrangement of LF TCX5 */
        mvr2r( spectrum + L_spec, buff, 8 );
        mvr2r( spectrum + 8, spectrum + 16, L_spec - 8 );
        mvr2r( buff, spectrum + 8, 8 );
    }

    return;
}


/*-------------------------------------------------------------------*
 * tcx5TnsUngrouping()
 *
 *
 *-------------------------------------------------------------------*/

void tcx5TnsUngrouping(
    const int16_t L_frame, /* i  : frame length (TCX5)                                 */
    const int16_t L_spec,  /* i  : coded spec length (TCX5, derived from filter borders*/
    float *spectrum,
    const int16_t enc_dec /* i  : 0: encoder, else decoder                            */
)
{
    /* undo rearrangement of LF sub-window lines prior to TNS analysis */
    if ( L_spec < L_frame )
    {
        mvr2r( spectrum + L_spec + 8, spectrum + L_frame + 8, L_spec - 8 );
        mvr2r( spectrum + 8, spectrum + L_frame, 8 );
        mvr2r( spectrum + 16, spectrum + 8, L_spec - 8 );
        set_zero( spectrum + L_spec, L_frame - L_spec );
        set_zero( spectrum + L_frame + L_spec, L_frame - L_spec );
    }
    else
    {
        float buff[8]; /* Buffer for the rearrangement of LF TCX5 */

        mvr2r( spectrum + 8, buff, 8 );

        if ( enc_dec == ENC )
        {
            mvr2r( spectrum + 16, spectrum + 8, L_frame - 8 );
            mvr2r( buff, spectrum + L_frame, 8 );
        }
        else
        {
            mvr2r( spectrum + 16, spectrum + 8, L_spec - 8 );
            mvr2r( buff, spectrum + L_spec, 8 );
        }
    }

    return;
}

#endif


/*-------------------------------------------------------------------*
 * tcx5SpectrumInterleaving()
 *
+0 −98
Original line number Diff line number Diff line
@@ -1109,12 +1109,6 @@ void minimum_statistics(
            move16();
        }
    }
#ifdef IVAS_CODE_CNG_COM
    if ( enc_dec == DEC && element_mode == IVAS_CPE_TD )
    {
        v_multc( msNoiseEst, 1.4125f, msNoiseEst, NPART_SHAPING );
    }
#endif
    /* Collect buffers */
    Copy( msPeriodog, msPeriodogBuf + len * ( *msPeriodogBufPtr ), len );

@@ -2624,18 +2618,6 @@ void SynthesisSTFT(
        move16();
    }
    /* Generate excitation */
#ifdef IVAS_CODE_CNG_COM
    PME()
    if ( ( element_mode == IVAS_CPE_TD || element_mode == IVAS_CPE_DFT ) && nchan_out == 2 )
    {
        for ( i = 0; i < hFdCngCom->frameSize / 2; i++ )
        {
            buf[i + ( M + 1 )] += olapBuffer[i + hFdCngCom->frameSize / 4];
        }
        v_multc( buf, (float) ( hFdCngCom->fftlen / 2 ), buf, M + 1 + hFdCngCom->frameSize );
    }
    else
#endif
    {
        FOR( i = 0; i < M + 1 + hFdCngCom->frameSize; i++ )
        {
@@ -2749,18 +2731,6 @@ void SynthesisSTFT_ivas_fx(
        move16();
    }
    /* Generate excitation */
#ifdef IVAS_CODE_CNG_COM
    PME()
    if ( ( element_mode == IVAS_CPE_TD || element_mode == IVAS_CPE_DFT ) && nchan_out == 2 )
    {
        for ( i = 0; i < hFdCngCom->frameSize / 2; i++ )
        {
            buf[i + ( M + 1 )] += olapBuffer[i + hFdCngCom->frameSize / 4];
        }
        v_multc( buf, (float) ( hFdCngCom->fftlen / 2 ), buf, M + 1 + hFdCngCom->frameSize );
    }
    else
#endif
    {
        FOR( i = 0; i < M + 1 + hFdCngCom->frameSize; i++ )
        {
@@ -2788,74 +2758,6 @@ void SynthesisSTFT_ivas_fx(
    }
}

#ifdef IVAS_CODE_CNG_COM
/*-------------------------------------------------------------------
 * SynthesisSTFT_dirac()
 *
 * STFT synthesis filterbank
 *-------------------------------------------------------------------*/

void SynthesisSTFT_dirac(
    float *fftBuffer, /* i  : FFT bins */
    float *timeDomainOutput,
    float *olapBuffer,
    const float *olapWin,
    const int16_t samples_out,
    HANDLE_FD_CNG_COM hFdCngCom /* i/o: FD_CNG structure containing all buffers and variables */
)
{
    int16_t i;
    float buf[M + 1 + 320], tmp;

    /* Perform IFFT */
    RFFTN( fftBuffer, hFdCngCom->fftSineTab, hFdCngCom->fftlen, 1 );

    /* Handle overlap in P/S domain for stereo */
    mvr2r( olapBuffer + hFdCngCom->frameSize, olapBuffer, hFdCngCom->frameSize );
    set_f( olapBuffer + hFdCngCom->frameSize, 0.0f, hFdCngCom->frameSize ); /*olapBuffer, fftBuffer, olapWin*/

    for ( i = hFdCngCom->frameSize / 4; i < 3 * hFdCngCom->frameSize / 4; i++ )
    {
        olapBuffer[i] += fftBuffer[i] * olapWin[i - hFdCngCom->frameSize / 4];
    }
    for ( ; i < 5 * hFdCngCom->frameSize / 4; i++ )
    {
        olapBuffer[i] = fftBuffer[i];
    }

    for ( ; i < 7 * hFdCngCom->frameSize / 4; i++ )
    {
        olapBuffer[i] = fftBuffer[i];
    }

    for ( ; i < hFdCngCom->fftlen; i++ )
    {
        olapBuffer[i] = 0;
    }

    /* Get time-domain signal */
    v_multc( olapBuffer + hFdCngCom->frameSize / 4, (float) ( hFdCngCom->fftlen / 2 ), timeDomainOutput, samples_out );

    /* Get excitation */
    v_multc( olapBuffer + hFdCngCom->frameSize / 4 - ( M + 1 ), (float) ( hFdCngCom->fftlen / 2 ), buf, M + 1 + hFdCngCom->frameSize );
    tmp = buf[0];
    preemph( buf + 1, PREEMPH_FAC, M + hFdCngCom->frameSize, &tmp );
    residu( hFdCngCom->A_cng, M, buf + 1 + M, hFdCngCom->exc_cng, hFdCngCom->frameSize );

    /* update and window olapBuf if we have a output frame that is shorter than the default frame size...*/
    if ( samples_out < hFdCngCom->frameSize )
    {
        mvr2r( olapBuffer + samples_out, olapBuffer + hFdCngCom->frameSize, 3 * hFdCngCom->frameSize / 4 );
    }
    for ( i = 5 * hFdCngCom->frameSize / 4; i < 7 * hFdCngCom->frameSize / 4; i++ )
    {
        olapBuffer[i] *= olapWin[i - 3 * hFdCngCom->frameSize / 4];
    }

    return;
}
#endif

/**************************************************************************************
 * Compute some values used in the bias correction of the minimum statistics algorithm *
 **************************************************************************************/
+1 −293
Original line number Diff line number Diff line
@@ -3301,71 +3301,6 @@ Word16 tcxlpc_get_cdk(
    return cdk;
}

#ifdef IVAS_MSVQ
/*--------------------------------------------------------------------------*
 * dec_FDCNG_MSVQ_stage1()
 *
 *
 *--------------------------------------------------------------------------*/

void dec_FDCNG_MSVQ_stage1(
    int16_t j_full,            /* i  : index full range                     */
    int16_t n,                 /* i  : dimension to generate                */
    const float *invTrfMatrix, /* i  : IDCT matrix for synthesis            */
    const DCTTYPE idcttype,    /* i  : specify which IDCT                   */
    float *uq,                 /* o  : synthesized stage1 vector            */
    Word16 *uq_ind             /* o  : synthesized stage1 vector in BASOP   */
)
{
    int16_t col, segm_ind, j;
    float dct_vec[FDCNG_VQ_MAX_LEN];
    float idct_vec[FDCNG_VQ_MAX_LEN];
    const Word8 *cbpW8;
    const Word16 *dct_col_shift_tab;

    assert( n <= FDCNG_VQ_MAX_LEN );
    assert( n >= FDCNG_VQ_DCT_MINTRUNC );

    segm_ind = 0;
    for ( col = 1; col <= FDCNG_VQ_DCT_NSEGM; col++ )
    {
        if ( j_full >= cdk1_ivas_cum_entries_per_segment[col] )
        {
            segm_ind++;
        }
    }

    j = j_full - cdk1_ivas_cum_entries_per_segment[segm_ind]; /* j  is the local segment index */

    assert( j < cdk1_ivas_entries_per_segment[segm_ind] );

    /* Word8 column variable Qx storage*/
    cbpW8 = cdk_37bits_ivas_stage1_W8Qx_dct_sections[segm_ind]; /*   Word8 storage fixed  ptr_init */
    cbpW8 += j * cdk1_ivas_cols_per_segment[segm_ind];          /*    adaptive ptr init */
    dct_col_shift_tab = stage1_dct_col_syn_shift[segm_ind];

    for ( col = 0; col < cdk1_ivas_cols_per_segment[segm_ind]; col++ )
    {
        dct_vec[col] = (float) shl( (Word16) cbpW8[col], dct_col_shift_tab[col] );
        /*             LOGIC( 1 )        , SHIFT( 1 );
           in BASOP:   s_and(for W8->W16), shl()
         */
    }
    dctT2_N_apply_matrix( (const float *) dct_vec, idct_vec, cdk1_ivas_cols_per_segment[segm_ind], n, invTrfMatrix, FDCNG_VQ_DCT_MAXTRUNC, idcttype );

    /*scale down to original fdcngvq domain and move to Q0  */
    v_multc( idct_vec, fdcng_dct_scaleF[1], idct_vec, n );
    /* fdcng_dct_scaleF[1] --> 0.0625-->scale down from  search Q4 domain  to Q0 ,
       not really  relevant for  BASOP loop */

    /*add common  mid fdcng vector,  in fdcng bands domain */
    v_add( idct_vec, cdk1r_tr_midQ_truncQ, uq, n );
    assert( uq_ind == NULL );

    return;
}

#endif
void msvq_dec(
    const Word16 *const *cb, /* i  : Codebook (indexed cb[*stages][levels][p]) (14Q1*1.28)*/
    const Word16 dims[],     /* i  : Dimension of each codebook stage (NULL: full dim.)   */
@@ -3374,10 +3309,6 @@ void msvq_dec(
    const Word16 N,          /* i  : Vector dimension                                     */
    const Word16 maxN,       /* i  : Codebook dimension                                   */
    const Word16 Idx[],      /* i  : Indices                                              */
#ifdef IVAS_MSVQ
    const int16_t applyIDCT_flag, /* i  : applyIDCT flag                                       */
    const float *invTrfMatrix,    /* i  :   matrix for IDCT synthesis                          */
#endif
    Word16 *uq               /* o  : quantized vector                          (14Q1*1.28)*/
)
{
@@ -3414,15 +3345,6 @@ void msvq_dec(
            start = offs[i];
            move16();
        }
#ifdef IVAS_MSVQ
        test();
        IF( i == 0 && applyIDCT_flag != 0 )
        {
            assert( start == 0 );
            dec_FDCNG_MSVQ_stage1( Idx[0], N, invTrfMatrix, IDCT_T2_XX_24, uq, uq_ind ); /* IDCT_T2 N=24 used for all synthesis  */
        }
        ELSE
#endif
        {
            /*vr_add( uq+start, cb[i]+Idx[i]*maxn, uq+start, n );, where uq = a zero vector*/
            offset = i_mult2( Idx[i], N34 );
@@ -4499,217 +4421,3 @@ void create_IDCT_N_Matrix_fx(

    return;
}
#ifdef IVAS_MSVQ

/*-------------------------------------------------------------------*
 * dctT2_N_apply_matrix()
 *
 * dct/idct truncated matrix appl. for DCT basis vector lengths of N
 *-------------------------------------------------------------------*/

void dctT2_N_apply_matrix(
    const float *input,           /* i  : input  in fdcng or DCT(fdcng) domain     */
    float *output,                /* o  : output in DCT(fdcng) or fdcng ordomain   */
    const int16_t dct_dim,        /* i  : dct processing dim possibly truncated    */
    const int16_t fdcngvq_dim,    /* i  : fdcng domain length                      */
    const float *matrix,          /* i  : IDCT matrix                              */
    const int16_t matrix_row_dim, /* i  :                                          */
    const DCTTYPE dcttype         /* i  : matrix  operation type                   */
)
{
    int16_t i, j, dim_in, dim_out;
    int16_t mat_step_col, mat_step_row, mat_step_col_flag;
    const float *pt_x, *pt_A;
    float tmp_y[FDCNG_VQ_MAX_LEN];
    float *pt_y;

    /* non-square DCT_N and IDCT_N matrix application,
       using a  stored format of  an IDCT_Nx(FDCNG_VQ_DCT_MAXTRUNC)   matrix  */
    /* efficiently parallelized in SIMD */

    assert( dct_dim <= FDCNG_VQ_DCT_MAXTRUNC );
    assert( fdcngvq_dim <= FDCNG_VQ_MAX_LEN );

    if ( ( dcttype & 1 ) == 0 ) /* even entries are DCTs */
    {
        /*  DCT_typeII   24,21  -> XX   in worst case  */
        dim_in = fdcngvq_dim;
        dim_out = dct_dim;
        mat_step_col = matrix_row_dim; /* matrix maximum storage size dependent,  width of first row in matrix  */
        mat_step_row = 0;
        mat_step_col_flag = 1;
        assert( dcttype == DCT_T2_21_XX || dcttype == DCT_T2_24_XX );
    }
    else
    {
        assert( ( dcttype & 1 ) != 0 ); /* idct */
        dim_in = dct_dim;
        dim_out = fdcngvq_dim;
        mat_step_col = 1;
        mat_step_row = matrix_row_dim;
        mat_step_col_flag = 0;
        assert( dcttype == IDCT_T2_XX_24 );
    }

    pt_y = tmp_y;
    for ( i = 0; i < dim_out; i++ )
    {
        pt_x = input;
        *pt_y = 0;

        /* +i(DCT)  or   +i*maxTrunc(IDCT) */
#define WMC_TOOL_SKIP
        pt_A = &( matrix[i * ( mat_step_row + mat_step_col_flag )] ); /* ptr indexing */
        PTR_INIT( 1 );
#undef WMC_TOOL_SKIP
        for ( j = 0; j < dim_in; j++ )
        {
#define WMC_TOOL_SKIP
            *pt_y += ( *pt_x++ ) * ( *pt_A );
            pt_A += mat_step_col; /* step +maxtrunc   or  +1 */ /* ptr indexing*/
            MAC( 1 );
#undef WMC_TOOL_SKIP
        }
        pt_y++;
    }

    mvr2r( tmp_y, output, dim_out );

    return;
}


/*-------------------------------------------------------------------*
 * extend_dctN_input()
 *
 * (inputN, dctN) -> idct(N_ext)    idct_N matrix application loop for
 *  extending, extrapolating  a  DCT basis vector length of N to N_ext
 *-------------------------------------------------------------------*/

void extend_dctN_input(
    const float *input,     /* i  :  input in fdcng domain                        */
    const float *dct_input, /* i  :  input in dctN(fdcng) domain                  */
    const int16_t in_dim,   /* i  :  in_dim == N                                  */
    float *ext_sig,         /* o  :  extended output in fdcng domain              */
    const int16_t out_dim,  /* i  :  output total dim                             */
    float *matrix,          /* i  : idct synthesis matrix N rows, n_cols  columns */
    const int16_t n_cols,   /* i  : number of columns ==  DCT truncation length   */
    const DCTTYPE dcttype   /* i  : matrix operation type                         */
)
{
    int16_t i, j, i_rev;
    const float( *ptr )[FDCNG_VQ_DCT_MAXTRUNC] = (void *) matrix;

    /* stored format is an IDCT_Nx(FDCNG_VQ_DCT_MAXTRUNC)   matrix  */
    assert( in_dim < FDCNG_VQ_MAX_LEN );
    assert( out_dim <= FDCNG_VQ_MAX_LEN );
    assert( out_dim > in_dim );
    assert( n_cols == FDCNG_VQ_DCT_MAXTRUNC ); /* for *ptr[MAX_TRUNC] adressing*/
    assert( ( dcttype & 1 ) != 0 );            /* idct tables always in use for this basis vector extension */

    mvr2r( input, ext_sig, in_dim ); /* copy initial part,  i.e.  only  last/tail  parts are  extended */
    set_f( &( ext_sig[in_dim] ), 0.0, out_dim - in_dim );

    i_rev = in_dim; /*ptr init*/
    for ( i = in_dim; i < out_dim; i++ )
    { /* for each extension sample */
        /*   i  = 21  22  23;
          i_rev = 20  19  18;    for odd dctII  reflect basis vector
         */
        i_rev--;

        for ( j = 0; j < n_cols; j++ ) /* for each available  DCT coeff */
        {
            /* DCTcoeff * reflected basis vector */
#define WMC_TOOL_SKIP
            /*  pure ptr MAC   operations */
            ext_sig[i] += dct_input[j] * ptr[i_rev][j]; /* sum up scaled and extended basis vector */
            MAC( 1 );
#undef WMC_TOOL_SKIP
        }
    }

    return;
}


/*-------------------------------------------------------------------*
 * create_IDCT_N_Matrix()
 *
 * inititate idct24 FDCNG_VQ_DCT_MAXTRUNCx N matrix in
 * RAM  from a  quantized compressed ROM format
 *-------------------------------------------------------------------*/

void create_IDCT_N_Matrix(
    float *inv_matrixFloatQ, /* i/o: RAM buffer                                     */
    const int16_t N,         /* i  : DCT length, number of time samples             */
    const int16_t n_cols,    /* i  : number of dct coeffs (as DCT may be truncated) */
    const int16_t alloc_size /* i  : RAM buffer size in elements                    */
)
{
    int16_t c, c1, r, r_flip, W16_val;
    int16_t len;
    int16_t mat_cpy_size;
    const Word16 *absval_ptr;
    const Word8 *idx_ptr;
    Word16 idx;
    float( *ptr )[FDCNG_VQ_DCT_MAXTRUNC] = (void *) inv_matrixFloatQ; /*  fixed number of columns pointers, to   simplifies adressing in ANSIC   */

    absval_ptr = unique_idctT2_24coeffsQ16;
    idx_ptr = idctT2_24_compressed_idx;
    len = FDCNG_VQ_MAX_LEN;

    if ( N == FDCNG_VQ_MAX_LEN_WB )
    {
        absval_ptr = unique_idctT2_21coeffsQ16;
        idx_ptr = idctT2_21_compressed_idx;
        len = N;
    }

    assert( alloc_size >= ( n_cols * len ) ); /* enough space for the full expanded IDCT matrix  */
    assert( N <= len );

    mat_cpy_size = ( n_cols ) * ( len >> 1 ); /* NB   integer division of "len" */

    if ( ( len & 1 ) != 0 )
    { /* odd sized DCT with a non-reflected center row  */
        mat_cpy_size += n_cols;
    }

    for ( c = 0; c < mat_cpy_size; c++ )
    {
        idx = (Word16) ( idx_ptr[c] );
        W16_val = absval_ptr[abs( idx )];

        if ( idx < 0 )
        {
            W16_val = -( W16_val );
        }
        inv_matrixFloatQ[c] = ( +1.52587890625e-05f ) * ( (float) W16_val ); /* 1.0/2.^16 scaling to a float-"Q0"  , a scaling that is not done  in   BASOP */
    }

    /* for even number of coeffs DCT24,
       flip symmetry for odd, even is used to save 50%   IDCT Table ROM */
    /* for an odd DCT  center  is not flipped  e.g  for DCT21  */

    assert( n_cols == FDCNG_VQ_DCT_MAXTRUNC );
    assert( ( n_cols & 1 ) == 0 );

    for ( c = 0; c < ( n_cols ); c += 2 )
    {
        c1 = c + 1;
        r_flip = len - 1;
        for ( r = 0; r < ( len / 2 ); r++, r_flip-- )
        {
#define WMC_TOOL_SKIP
            ptr[r_flip][c] = ptr[r][c];        /* flipped */
            ptr[r_flip][c1] = -( ptr[r][c1] ); /* flipped and sign swapped */
            MOVE( 2 );
            MULT( 1 ); /* for negate */
#undef WMC_TOOL_SKIP
        }
    }

    return;
}
#endif
+7 −42
Original line number Diff line number Diff line
@@ -916,10 +916,6 @@ void msvq_dec(
    const Word16 N,          /* i  : Vector dimension                                     */
    const Word16 maxN,       /* i  : Codebook dimension                                   */
    const Word16 Idx[],      /* i  : Indices                                              */
#ifdef IVAS_MSVQ
    const int16_t applyIDCT_flag, /* i  : applyIDCT flag                                       */
    const float *invTrfMatrix,    /* i  :   matrix for IDCT synthesis                          */
#endif
    Word16 *uq               /* o  : quantized vector                              (3Q12) */
);
@@ -6449,12 +6445,7 @@ void DetectTonalComponents(
    const Word16 nSamples,
    const Word16 nSamplesCore,
    Word16 floorPowerSpectrum, /* i: lower limit for power spectrum bins  */
    Word16 element_mode
#ifdef IVAS_CODE_MDCT_GSHAPE
    ,
    const PsychoacousticParameters *psychParamsCurrent
#endif
);
    Word16 element_mode );
void RefineTonalComponents(
    Word16 indexOfTonalPeak[],
@@ -6474,12 +6465,7 @@ void RefineTonalComponents(
    const Word16 nSamples,
    const Word16 nSamplesCore,
    const Word16 floorPowerSpectrum, /* i: lower limit for power spectrum bins  */
    Word16 element_mode
#ifdef IVAS_CODE_MDCT_GSHAPE
    ,
    const PsychoacousticParameters *psychParamsCurrent
#endif
);
    Word16 element_mode );
void ivas_RefineTonalComponents_fx(
    Word16 indexOfTonalPeak[],
@@ -6561,19 +6547,12 @@ void TonalMDCTConceal_Detect(
    const Word32 pitchLag,          /*IN */
    Word16 *umIndices,              /*OUT*/
    Word16 element_mode             /* IN */
#ifdef IVAS_CODE_MDCT_GSHAPE
    ,
    const PsychoacousticParameters *psychParamsCurrent
#endif
);
void TonalMDCTConceal_Apply(
    const TonalMDCTConcealPtr hTonalMDCTConc, /*IN */
    Word32 *mdctSpectrum,                     /*IN/OUT*/
    Word16 *mdctSpectrum_exp                  /*IN */
#ifdef IVAS_CODE_MDCT_GSHAPE
    , const PsychoacousticParameters* psychParamsCurrent)
#endif
);
void TonalMDCTConceal_Apply_ivas_fx(
@@ -9137,15 +9116,8 @@ Word16 decode_lpc_avq_fx(
    Decoder_State *st,   /* i/o: decoder state structure     */
    const Word16 numlpc, /* i  : Number of sets of lpc       */
    Word16 *param_lpc    /* o  : lpc parameters              */
#ifdef IVAS_CODE_AVQ_LPC
    ,
    const Word16 ch,             /* i  : channel                     */
    const Word16 element_mode,   /* i  : element mode                */
    const Word16 sns_low_br_mode /* i  : SNS low-bitrate mode        */
#endif
);
// decode_lpc_avq_ivas_fx declaration with IVAS_CODE_AVQ_LPC enabled
Word16 decode_lpc_avq_ivas_fx(
    Decoder_State *st,   /* i/o: decoder state structure     */
    const Word16 numlpc, /* i  : Number of sets of lpc       */
@@ -9369,13 +9341,6 @@ void modify_lsf(
void con_tcx_fx(
    Decoder_State *st,                                      /* i/o: coder memory state            */
    Word16 synth[] /* i/o:   synth[]                     */ /*Q0 */
#ifdef IVAS_CODE_CON_TCX
    ,
    const Word16 coh,      /* i  : coherence of stereo signal  */
    Word16 *noise_seed,    /* i/o: noise seed for stereo       */
    const Word16 only_left /* i  : TD-PLC only in left channel */
#endif
);
// er_scale_sync.c
Loading