Commit 6b2abebf authored by vaillancour's avatar vaillancour
Browse files

Fixes concerning -rf encoder command line

parent 1f24ca82
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1678,7 +1678,11 @@ Word32 root_a_over_b_fx(
    }

    exp_num = norm_l( b );
#ifdef BASOP_NOGLOB
    num = round_fx_o( L_shl_o( b, exp_num, &Overflow ), &Overflow);
#else
    num = round_fx( L_shl( b, exp_num ) );
#endif
    exp_num = sub( sub( 30, exp_num ), Q_b );

    exp_den = norm_l( a );
@@ -1690,7 +1694,11 @@ Word32 root_a_over_b_fx(
    exp_den = sub( sub( 30, exp_den ), Q_a );

    scale = shr( sub( den, num ), 15 );
#ifdef BASOP_NOGLOB
    num = shl_o( num, scale, &Overflow );
#else
    num = shl( num, scale );
#endif
    exp_num = sub( exp_num, scale );

    tmp = div_s( num, den );
+16 −2
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ void core_encode_openloop(
    Word16 w_rf[M+1], lsf_uq_rf[M+1];
    Word16 lsf_q_1st_rf[M+1], lsf_q_d_rf[M+1], lsf_q_rf[M+1];
    Word16 lsp_old_q_rf[M+1], lsf_old_q_rf[M+1];
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc;
    RF_ENC_HANDLE hRF = st->hRF;

@@ -546,7 +549,11 @@ void core_encode_openloop(
            /*v_sub(lsf_uq_rf, lsf_q_1st_rf, lsf_q_d_rf, M);*/
            FOR (i=0; i<M; i++)
            {
#ifdef BASOP_NOGLOB
                lsf_q_d_rf[i] = shl_o(mult_r(sub_o(lsf_uq_rf[i],lsf_q_1st_rf[i], &Overflow), 25600),5, &Overflow);
#else
                lsf_q_d_rf[i] = shl(mult_r(sub(lsf_uq_rf[i],lsf_q_1st_rf[i]), 25600),5);
#endif
                /*input value is in Qx2.56, convert to Q6 to match table, quantizer table kept at Q6 to avoid losing precision */
                /*Assume this difference data max range can be represented by Q6*/
            }
@@ -743,7 +750,9 @@ static void closest_centroid_rf(
    Word16 tmp, tmpL;
    Word64 werr_64;
    Word32 L_tmp, best_werr, werr;

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif

    ind_vec[0] = 0;
    move16();
@@ -758,8 +767,13 @@ static void closest_centroid_rf(
        tmpL = i_mult2(i, length);
        FOR( j = 0; j < length; j++ )
        {
#ifdef BASOP_NOGLOB
            tmp = sub_o( data[j], quantizer[tmpL + j], &Overflow );
            L_tmp = L_mult_o(tmp, tmp, &Overflow);
#else
            tmp = sub( data[j], quantizer[tmpL + j] );
            L_tmp = L_mult(tmp, tmp);
#endif
            werr_64 = W_mac_32_16( werr_64, L_tmp, weights[j] );
        }		
		werr = W_sat_m( werr_64);		
+4 −1
Original line number Diff line number Diff line
@@ -147,8 +147,11 @@ Word16 gain_enc( /* o : quantization pitch index
    /* gain_inov = 1.0f / sqrt((dot_product(code, code, L_SUBFR) + 0.01) / L_SUBFR) */
    L_tmp = calc_gain_inov(code, lcode, &L_tmp1, &exp_L_tmp1);
    move16();
#ifdef BASOP_NOGLOB
    *gain_inov = round_fx_o(L_shl_o(L_tmp, 15-3, &Overflow), &Overflow);  /* gain_inov in Q12 */
#else
    *gain_inov = round_fx(L_shl(L_tmp, 15-3));  /* gain_inov in Q12 */

#endif
    /*----------------------------------------------------------------*
     * calculate the predicted gain code
     *----------------------------------------------------------------*/