Commit 86df3c3d authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Q fixes in inov_encode function

parent 5156ee35
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
#include "options.h"
#include "cnst.h"
#include "rom_com_fx.h"
//#include "prot_fx.h"
#include "rom_com.h"     /* Common constants                       */
#include "prot_fx.h"     /* Function prototypes                    */
#include "prot_fx_enc.h" /* Function prototypes                    */
+7 −7
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ void corr_xh_ivas_fx(
    const Word16 Qx,
    Word16 dn[], /* o  : correlation between x[] and h[]                 Qdn*/
    Word16 *Qdn,
    const Word16 h[],    /* i  : impulse response (of weighted synthesis filter) (Q15 - norm_s(h[0]))*/
    const Word16 h[],    /* i  : impulse response (of weighted synthesis filter) (Q14 - norm_s(h[0]))*/
    const Word16 L_subfr /* i  : length of the subframe                          Q0*/
)
{
@@ -152,16 +152,16 @@ void corr_xh_ivas_fx(
        L_maxloc = L_deposit_l( 0 );
        FOR( i = k; i < L_subfr; i += STEP )
        {
            L_tmp = L_mac( 0, x[i], h[0] ); // Qx+(15 - norm_s(h[0]))
            L_tmp = L_mac( 0, x[i], h[0] ); // Qx+(14 - norm_s(h[0])) + 1
            FOR( j = i; j < L_subfr - 1; j++ )
            {
                L_tmp = L_mac_o( L_tmp, x[j + 1], h[j + 1 - i], &Overflow ); // Qx+(15 - norm_s(h[0]))
                L_tmp = L_mac_o( L_tmp, x[j + 1], h[j + 1 - i], &Overflow ); // Qx+(14 - norm_s(h[0])) + 1
            }

            y32[i] = L_tmp; // Qx+(15 - norm_s(h[0]))
            y32[i] = L_tmp; // Qx+(14 - norm_s(h[0])) + 1
            move32();
            L_tmp = L_abs( L_tmp );
            L_maxloc = L_max( L_tmp, L_maxloc ); // Qx+(15 - norm_s(h[0]))
            L_maxloc = L_max( L_tmp, L_maxloc ); // Qx+(14 - norm_s(h[0])) +1 
        }
        /* tot += 3*max / 8 */
        L_maxloc = L_shr( L_maxloc, 2 );
@@ -176,11 +176,11 @@ void corr_xh_ivas_fx(

    FOR( i = 0; i < L_subfr; i++ )
    {
        dn[i] = round_fx( L_shl( y32[i], j ) ); // Qx+(15 - norm_s(h[0])) +j - 16
        dn[i] = round_fx( L_shl( y32[i], j ) ); // Qx+(14 - norm_s(h[0])) + 1 +j - 16
        move16();
    }

    *Qdn = sub( add( add( Qx, sub( 15, norm_s( h[0] ) ) ), j ), 16 );
    *Qdn = sub( add( add( Qx, add( sub( 14, norm_s( h[0] ) ), 1 ) ), j ), 16 );
    move16();
    return;
}
+1 −1
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ void encod_gen_voic_ivas_fx(

        Copy( &res_fx[i_subfr_fx], &exc_fx[i_subfr_fx], L_SUBFR ); /*Q_new*/

        find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
        find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
                                  res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );

        q_h1 = sub( 14, norm_s( h1_fx[0] ) );
+1 −1
Original line number Diff line number Diff line
@@ -721,7 +721,7 @@ void enc_pit_exc_ivas_fx(
        Copy( &res[i_subfr], &exc[i_subfr], L_subfr ); /* Q_new */
        /* condition on target (compared to float) has been put outside the loop */

        find_targets_ivas_new_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq,
        find_targets_ivas_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq,
                                  res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 );

        q_h1 = sub( 14, norm_s( h1[0] ) );
+2 −1
Original line number Diff line number Diff line
@@ -545,7 +545,8 @@ Word16 encod_tran_ivas_fx(

        Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */

        find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,

        find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
                                  res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 );

        q_h1 = sub( 14, norm_s( h1[0] ) );
Loading