Commit 55a766f7 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'encoder_updates_code_cleanup' into 'main'

Acelp core encoder cleanup, pre_proc_front cleanup

See merge request !804
parents 551026b9 bbbf7ccb
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -383,6 +383,8 @@ ivas_error ivas_FB_mixer_open_fx(
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" );
        }
        set32_fx( hFbMixer->ppFilterbank_prior_input_fx[i], 0, fb_cfg->prior_input_length );
        hFbMixer->q_ppFilterbank_prior_input_fx[i] = Q31;
        move16();
    }

    test();
+18 −3
Original line number Diff line number Diff line
@@ -617,6 +617,7 @@ static void L_lerp_proc_fx(
    Word32 pos_fx, shift_fx, diff_fx;
    Word32 buf_fx[2 * L_FRAME_MAX];
    Word16 tmp;
    Word32 ffxsub;

    IF( EQ_16( bufferNewSize, bufferOldSize ) )
    {
@@ -644,8 +645,15 @@ static void L_lerp_proc_fx(
    ELSE
    {
        idx = extract_l( L_shr( pos_fx, 21 ) );
        diff_fx = L_sub( pos_fx, L_shl( idx, 21 ) );                                                                   /*Q21*/
        buf_fx[0] = L_add( f_fx[idx], L_shl( Mpy_32_32( diff_fx, L_sub( f_fx[( idx + 1 )], f_fx[idx] ) ), 31 - 21 ) ); /*Qx*/

        diff_fx = L_sub( pos_fx, L_shl( idx, 21 ) );
        ffxsub = L_sub( f_fx[idx + 1], f_fx[idx] );

        Word64 f_fx64 = W_shl( f_fx[idx], 21 );
        Word64 mult64 = W_mult0_32_32( diff_fx, ffxsub );
        Word64 add64 = W_add( f_fx64, mult64 );

        buf_fx[0] = W_extract_l( W_shr( add64, 21 ) );
        move32();
    }

@@ -656,8 +664,15 @@ static void L_lerp_proc_fx(
        idx = extract_l( L_shr( pos_fx, 21 ) );
        diff_fx = L_sub( pos_fx, L_shl( idx, 21 ) ); /*Q21*/

        buf_fx[i] = L_add( f_fx[idx], L_shl( Mpy_32_32( diff_fx, L_sub( f_fx[idx + 1], f_fx[idx] ) ), 31 - 21 ) ); /*Qx*/
        ffxsub = L_sub( f_fx[idx + 1], f_fx[idx] );

        Word64 f_fx64 = W_shl( f_fx[idx], 21 );
        Word64 mult64 = W_mult0_32_32( diff_fx, ffxsub );
        Word64 add64 = W_add( f_fx64, mult64 );

        buf_fx[i] = W_extract_l( W_shr( add64, 21 ) );
        move32();

        pos_fx = L_add( pos_fx, shift_fx ); /*Q21*/
    }

+16 −20
Original line number Diff line number Diff line
@@ -2391,25 +2391,21 @@ ivas_error acelp_core_enc(
ivas_error acelp_core_enc(
    Encoder_State *st,                  /* i/o: encoder state structure                 */
    /*const*/ float inp[],              /* i  : input signal of the current frame       */
    // const float ener,                    /* i  : residual energy from Levinson-Durbin    */
    float A[NB_SUBFR16k * ( M + 1 )],    /* i  : A(z) unquantized for the 4 subframes    */
    float Aw[NB_SUBFR16k * ( M + 1 )],   /* i  : weighted A(z) unquant. for subframes    */
    const float epsP[M + 1],             /* i  : LP prediction errors                    */
    float lsp_new[M],                    /* i  : LSPs at the end of the frame            */
    float lsp_mid[M],                    /* i  : LSPs in the middle of the frame         */
    const int16_t vad_hover_flag,        /* i  : VAD hangover flag                       */
    const int16_t attack_flag,           /* i  : attack flag (GSC or TC)                 */
    Word16 A[NB_SUBFR16k * ( M + 1 )],  /* i  : A(z) unquantized for the 4 subframes    */
    Word16 Aw[NB_SUBFR16k * ( M + 1 )], /* i  : weighted A(z) unquant. for subframes    */
    const Word32 epsP[M + 1],           /* i  : LP prediction errors                    */
    Word16 lsp_new[M],                  /* i  : LSPs at the end of the frame            */
    Word16 lsp_mid[M],                  /* i  : LSPs in the middle of the frame         */
    const Word16 vad_hover_flag,        /* i  : VAD hangover flag                       */
    const Word16 attack_flag,           /* i  : attack flag (GSC or TC)                 */
    Word32 bwe_exc_extended_fx[],       /* i/o: bandwidth extended excitation   2*Q_new */
#ifndef IVAS_FLOAT_FIXED
    float *voice_factors,                /* o  : voicing factors                         */
#else
    Word16 *voice_factors_fx,           /* o  : voicing factors                      Q15 */
#endif
    float old_syn_12k8_16k[],            /* o  : ACELP core synthesis at 12.8kHz or 16kHz to be used by SWB BWE */
    float pitch_buf[NB_SUBFR16k],        /* o  : floating pitch for each subframe        */
    int16_t *unbits,                     /* o  : number of unused bits                   */
    Word16 old_syn_12k8_16k[],          /* o  : ACELP core synthesis at 12.8kHz or 16kHz to be used by SWB BWE */
    Word16 *q_old_syn_12k8_16,
    Word16 pitch_buf[NB_SUBFR16k],       /* o  : floating pitch for each subframe        */
    Word16 *unbits,                      /* o  : number of unused bits                   */
    STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle                */
    float tdm_lsfQ_PCh[M],               /* i  : Q LSFs for primary channel              */
    Word16 tdm_lsfQ_PCh[M],              /* i  : Q LSFs for primary channel              */
    Word16 Q_new );
#endif
+84 −312

File changed.

Preview size limit exceeded, changes collapsed.

+434 −14

File changed.

Preview size limit exceeded, changes collapsed.

Loading