Unverified Commit 6fca072f authored by norvell's avatar norvell
Browse files

Fixes for extended ACELP->HQ switching frame

parent 78a10bb8
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -97,7 +97,21 @@ void ivas_fine_gain_pred_fx(
                }
                ELSE
                {
                    tmp1 = ivas_fine_gain_pred_sqrt_bw[bw_idx];
                    IF( EQ_16( sfm_size[0], 10 ) )
                    {
                        bw_idx = band_len_idx_ext[shr( bw, 3 )];
                        tmp1 = fine_gain_pred_sqrt_bw_ext[bw_idx];
                    }
                    ELSE
                    {
                        tmp1 = fine_gain_pred_sqrt_bw[bw_idx];
#ifdef HARM_HQ_CORE_KEEP_BE
                        if ( EQ_16( bw_idx, 0 ) )
                        {
                            tmp1--; /* Lookup table uses rounding while calculations use truncation */
                        }
#endif
                    }
                }
#else
                Word16 norm = norm_s( bw );
+6 −3
Original line number Diff line number Diff line
@@ -1492,8 +1492,11 @@ extern const Word16 fine_gain_pred_sqrt_bw[]; // Q11
#ifndef HARM_HQ_CORE
extern const Word16 ivas_band_len_idx[];           // Q0
extern const Word16 ivas_band_len_ener_shift[];    // Q0
#endif
extern const Word16 ivas_fine_gain_pred_sqrt_bw[]; // Q11
#else
extern const Word16 fine_gain_pred_sqrt_bw_ext[];                         // Q11
extern const Word16 band_len_idx_ext[1 + ( MAX_SFM_LEN_FX * 5 / 4 / 8 )]; // Q11
#endif
extern const Word16 Mean_isf_wb[];                     // Q2.56
extern const Word16 lsp_shb_prev_tbl_fx[];             // Q15
extern const Word16 lsp_shb_prev_tbl_swb_tbe_enc_fx[]; // Q15
+8 −6
Original line number Diff line number Diff line
@@ -25782,7 +25782,9 @@ const Word16 band_len_idx[1 + ( MAX_SFM_LEN_FX / 8 )] = {
};                                                                                                        // Q0
const Word16 band_len_ener_shift[9] = { 1, 2, 2, 2, 3, 3, 3, 4 /*sfm==80*/, 4 /*sfm==96*/ };              // Q0            /* 96 requires 1 bit more than 48 */
const Word16 fine_gain_pred_sqrt_bw[9] = { 5793, 8192, 10033, 11585, 12953, 14189, 16384, 18318, 20066 }; /* (Q11) */
const Word16 ivas_fine_gain_pred_sqrt_bw[9] = { 5792, 8192, 10033, 11585, 12953, 14189, 16384, 18318, 20066 }; /* (Q11) */
/* For extended frames in ACELP->HQ transitions in IVAS, map indices floor(sfms*1.25/8)=[1 2 3 5 7 10 12 15] from extended bws: */
const Word16 band_len_idx_ext[1 + ( MAX_SFM_LEN_FX * 5 / 4 / 8 )] = { -1, 0 /*10*/, 1 /*20*/, 2 /*30*/, -1, 3 /*40*/, -1, 4 /*60*/, -1, -1, 5 /*80*/, -1, 6 /*100*/ - 1, -1, 7 /*120*/ };
const Word16 fine_gain_pred_sqrt_bw_ext[9] = { 6476, 9159, 11217, 12953, 15863, 18317, 20480, 22434 }; /* (Q11) */
#else
const Word16 band_len_idx[1 + ( MAX_SFM_LEN_FX / 8 )] = {
    // Q0