aboutsummaryrefslogtreecommitdiff
path: root/encoder/iusace_fd_fac.c
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-18 02:08:00 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-18 02:08:00 +0000
commite6fc6686b645f9fccaefb3cee563571344ec7b2e (patch)
tree73c3905e1fb2cc11b30be7d583bb500e2cef452d /encoder/iusace_fd_fac.c
parent68809fee6a051e4729360a217320da6fec700578 (diff)
parent49819412af46be1657ff041ca632d281acf9efac (diff)
downloadlibxaac-e6fc6686b645f9fccaefb3cee563571344ec7b2e.tar.gz
Change-Id: Ie58f8858306c59dae920e0c0b10f11021553a504
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];