aboutsummaryrefslogtreecommitdiff
path: root/encoder/iusace_fd_fac.c
diff options
context:
space:
mode:
Diffstat (limited to 'encoder/iusace_fd_fac.c')
-rw-r--r--encoder/iusace_fd_fac.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/encoder/iusace_fd_fac.c b/encoder/iusace_fd_fac.c
index d4c5ff9..27824a3 100644
--- a/encoder/iusace_fd_fac.c
+++ b/encoder/iusace_fd_fac.c
@@ -173,7 +173,7 @@ IA_ERRORCODE iusace_fd_fac(WORD32 *sfb_offsets, WORD32 sfb_active, FLOAT64 *orig
FLOAT32 *zir_sig = NULL;
FLOAT32 *lpc_coeffs_q = NULL;
WORD32 index;
- WORD32 low_pass_line;
+ WORD32 low_pass_line = 0;
WORD32 fac_len;
FLOAT64 *left_fac_time_data = pstr_scratch->p_left_fac_time_data;
FLOAT32 *left_fac_timedata_flt = pstr_scratch->p_left_fac_timedata_flt;
@@ -185,13 +185,17 @@ IA_ERRORCODE iusace_fd_fac(WORD32 *sfb_offsets, WORD32 sfb_active, FLOAT64 *orig
*num_fac_bits = 0;
- if (window_sequence == EIGHT_SHORT_SEQUENCE)
- fac_len = (pstr_acelp->len_frame / 16);
- else
- fac_len = (pstr_acelp->len_frame / 8);
+ if (last_subfr_was_acelp || next_frm_lpd)
+ {
+ if (window_sequence == EIGHT_SHORT_SEQUENCE)
+ fac_len = (pstr_acelp->len_frame / 16);
+ else
+ fac_len = (pstr_acelp->len_frame / 8);
+
+ low_pass_line = (WORD32)(sfb_offsets[sfb_active] * fac_len /
+ (FLOAT32)pstr_acelp->len_frame);
+ }
- low_pass_line = (WORD32)((FLOAT32)sfb_offsets[sfb_active] * (FLOAT32)fac_len /
- (FLOAT32)pstr_acelp->len_frame);
if (last_subfr_was_acelp) {
FLOAT32 *tmp_lp_res = pstr_scratch->ptr_tmp_lp_res;
FLOAT32 lpc_coeffs[ORDER + 1];