aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Bhavikatti <nikhilbhavikatti19@gmail.com>2022-11-29 11:47:23 +0530
committerNikhil Bhavikatti <nikhilbhavikatti19@gmail.com>2022-11-29 11:47:23 +0530
commit42a0d6d68c3356c39dee2ad90e3678a9baa37cb1 (patch)
tree38753929a2f90a29e5570a8c547b6c55801bd23c
parent28c50d3f2393a045bbe7528923a1fd4ed61d42ea (diff)
downloadlibxaac-42a0d6d68c3356c39dee2ad90e3678a9baa37cb1.tar.gz
Transform length 960 support for xHEAAC decoder
-rw-r--r--decoder/armv7/ixheaacd_function_selector_arm_non_neon.c4
-rw-r--r--decoder/armv7/ixheaacd_function_selector_armv7.c17
-rw-r--r--decoder/armv8/ixheaacd_function_selector_armv8.c22
-rw-r--r--decoder/generic/ixheaacd_function_selector_generic.c13
-rw-r--r--decoder/ixheaacd_aac_config.h3
-rw-r--r--decoder/ixheaacd_aac_imdct.c984
-rw-r--r--decoder/ixheaacd_aac_imdct.h48
-rw-r--r--decoder/ixheaacd_aac_rom.c791
-rw-r--r--decoder/ixheaacd_aac_rom.h37
-rw-r--r--decoder/ixheaacd_aacdecoder.c57
-rw-r--r--decoder/ixheaacd_api.c68
-rw-r--r--decoder/ixheaacd_basic_ops32.h18
-rw-r--r--decoder/ixheaacd_basic_ops40.h13
-rw-r--r--decoder/ixheaacd_block.c95
-rw-r--r--decoder/ixheaacd_block.h23
-rw-r--r--decoder/ixheaacd_channel.c37
-rw-r--r--decoder/ixheaacd_defines.h14
-rw-r--r--decoder/ixheaacd_env_calc.c106
-rw-r--r--decoder/ixheaacd_env_extr.c91
-rw-r--r--decoder/ixheaacd_env_extr.h2
-rw-r--r--decoder/ixheaacd_error_codes.h52
-rw-r--r--decoder/ixheaacd_function_selector.h28
-rw-r--r--decoder/ixheaacd_headerdecode.c3
-rw-r--r--decoder/ixheaacd_initfuncs.c61
-rw-r--r--decoder/ixheaacd_lpfuncs.c494
-rw-r--r--decoder/ixheaacd_lpp_tran.c204
-rw-r--r--decoder/ixheaacd_lpp_tran.h16
-rw-r--r--decoder/ixheaacd_mps_parse.c2
-rw-r--r--decoder/ixheaacd_mps_pre_mix.c7
-rw-r--r--decoder/ixheaacd_mps_smoothing.c10
-rw-r--r--decoder/ixheaacd_peak_limiter.c8
-rw-r--r--decoder/ixheaacd_pns_js_thumb.c139
-rw-r--r--decoder/ixheaacd_process.c2
-rw-r--r--decoder/ixheaacd_ps_bitdec.c18
-rw-r--r--decoder/ixheaacd_ps_bitdec.h2
-rw-r--r--decoder/ixheaacd_ps_dec.h6
-rw-r--r--decoder/ixheaacd_qmf_dec.c2
-rw-r--r--decoder/ixheaacd_sbr_const.h4
-rw-r--r--decoder/ixheaacd_sbr_dec.c35
-rw-r--r--decoder/ixheaacd_sbr_rom.c28
-rw-r--r--decoder/ixheaacd_sbr_rom.h2
-rw-r--r--decoder/ixheaacd_sbrdec_lpfuncs.c6
-rw-r--r--decoder/ixheaacd_sbrdecoder.c4
-rw-r--r--decoder/ixheaacd_sbrdecoder.h2
-rw-r--r--decoder/ixheaacd_sbrdecsettings.h2
-rw-r--r--decoder/ixheaacd_stereo.c41
-rw-r--r--decoder/ixheaacd_stereo.h2
-rw-r--r--decoder/ixheaacd_struct_def.h2
-rw-r--r--decoder/ixheaacd_thumb_ps_dec.c17
-rw-r--r--decoder/x86/ixheaacd_function_selector_x86.c21
-rw-r--r--decoder/x86_64/ixheaacd_function_selector_x86_64.c21
-rw-r--r--test/ixheaacd_error.c14
-rw-r--r--test/ixheaacd_main.c25
53 files changed, 3202 insertions, 521 deletions
diff --git a/decoder/armv7/ixheaacd_function_selector_arm_non_neon.c b/decoder/armv7/ixheaacd_function_selector_arm_non_neon.c
index d15cf74..ac633bf 100644
--- a/decoder/armv7/ixheaacd_function_selector_arm_non_neon.c
+++ b/decoder/armv7/ixheaacd_function_selector_arm_non_neon.c
@@ -61,11 +61,11 @@
WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_armv7;
VOID(*ixheaacd_covariance_matrix_calc)
-(WORD32 *, ixheaacd_lpp_trans_cov_matrix *,
+(WORD32 *, ia_lpp_trans_cov_matrix *,
WORD32) = &ixheaacd_covariance_matrix_calc_armv7;
VOID(*ixheaacd_covariance_matrix_calc_2)
-(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32,
+(ia_lpp_trans_cov_matrix *, WORD32 *, WORD32,
WORD16) = &ixheaacd_covariance_matrix_calc_2_armv7;
VOID(*ixheaacd_over_lap_add1)
diff --git a/decoder/armv7/ixheaacd_function_selector_armv7.c b/decoder/armv7/ixheaacd_function_selector_armv7.c
index d3a17d7..230594b 100644
--- a/decoder/armv7/ixheaacd_function_selector_armv7.c
+++ b/decoder/armv7/ixheaacd_function_selector_armv7.c
@@ -68,11 +68,11 @@
WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_armv7;
VOID(*ixheaacd_covariance_matrix_calc)
-(WORD32 *, ixheaacd_lpp_trans_cov_matrix *,
+(WORD32 *, ia_lpp_trans_cov_matrix *,
WORD32) = &ixheaacd_covariance_matrix_calc_armv7;
VOID(*ixheaacd_covariance_matrix_calc_2)
-(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32,
+(ia_lpp_trans_cov_matrix *, WORD32 *, WORD32,
WORD16) = &ixheaacd_covariance_matrix_calc_2_armv7;
VOID(*ixheaacd_over_lap_add1)
@@ -232,3 +232,16 @@ VOID(*ixheaacd_scale_factor_process)
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_armv7;
+
+VOID(*ixheaacd_covariance_matrix_calc_960)
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec_960;
+
+VOID(*ixheaacd_aac_ld_dec_rearrange_960)
+(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
+ WORD16 *re_arr_tab) = &ixheaacd_dec_rearrange_short;
+
+VOID(*ixheaacd_pretwiddle_compute_960)
+(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_960_dec;
diff --git a/decoder/armv8/ixheaacd_function_selector_armv8.c b/decoder/armv8/ixheaacd_function_selector_armv8.c
index 8cb4067..ce1b3fb 100644
--- a/decoder/armv8/ixheaacd_function_selector_armv8.c
+++ b/decoder/armv8/ixheaacd_function_selector_armv8.c
@@ -66,11 +66,11 @@
WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_dec;
VOID(*ixheaacd_covariance_matrix_calc)
-(WORD32 *, ixheaacd_lpp_trans_cov_matrix *,
- WORD32) = &ixheaacd_covariance_matrix_calc_dec;
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec;
VOID(*ixheaacd_covariance_matrix_calc_2)
-(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32,
+(ia_lpp_trans_cov_matrix *, WORD32 *, WORD32,
WORD16) = &ixheaacd_covariance_matrix_calc_2_dec;
VOID(*ixheaacd_over_lap_add1)
@@ -178,7 +178,7 @@ VOID(*ixheaacd_overlap_buf_out)
VOID(*ixheaacd_overlap_out_copy)
(WORD32 *out_samples, WORD32 *ptr_overlap_buf, WORD32 *ptr_overlap_buf1,
- const WORD16 ch_fac) = &ixheaacd_overlap_out_copy_dec;
+ const WORD16 ch_fac, WORD16 size_01) = &ixheaacd_overlap_out_copy_dec;
VOID(*ixheaacd_pretwiddle_compute)
(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
@@ -230,3 +230,17 @@ VOID(*ixheaacd_scale_factor_process)
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_armv8;
+
+VOID(*ixheaacd_covariance_matrix_calc_960)
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec_960;
+
+VOID(*ixheaacd_aac_ld_dec_rearrange_960)
+(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
+ WORD16 *re_arr_tab) = &ixheaacd_dec_rearrange_short;
+
+VOID(*ixheaacd_pretwiddle_compute_960)
+(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_960_dec;
+
diff --git a/decoder/generic/ixheaacd_function_selector_generic.c b/decoder/generic/ixheaacd_function_selector_generic.c
index 9354159..9ceab86 100644
--- a/decoder/generic/ixheaacd_function_selector_generic.c
+++ b/decoder/generic/ixheaacd_function_selector_generic.c
@@ -67,11 +67,15 @@
WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_dec;
VOID(*ixheaacd_covariance_matrix_calc)
-(WORD32 *, ixheaacd_lpp_trans_cov_matrix *,
+(WORD32 *, ia_lpp_trans_cov_matrix *,
WORD32) = &ixheaacd_covariance_matrix_calc_dec;
+VOID(*ixheaacd_covariance_matrix_calc_960)
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec_960;
+
VOID(*ixheaacd_covariance_matrix_calc_2)
-(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32,
+(ia_lpp_trans_cov_matrix *, WORD32 *, WORD32,
WORD16) = &ixheaacd_covariance_matrix_calc_2_dec;
VOID(*ixheaacd_over_lap_add1)
@@ -186,6 +190,11 @@ VOID(*ixheaacd_pretwiddle_compute)
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_dec;
+VOID(*ixheaacd_pretwiddle_compute_960)
+(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_960_dec;
+
VOID(*ixheaacd_imdct_using_fft)
(ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 npoints,
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_imdct_using_fft_dec;
diff --git a/decoder/ixheaacd_aac_config.h b/decoder/ixheaacd_aac_config.h
index a98b088..6b10e7c 100644
--- a/decoder/ixheaacd_aac_config.h
+++ b/decoder/ixheaacd_aac_config.h
@@ -49,7 +49,6 @@
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LEVEL 0x0019
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP 0x001A
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE 0x001B
-#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ELD_SBR_PRESENT 0x001C
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING 0x001D
#define IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR 0x001E
@@ -64,4 +63,6 @@
#define IA_ENHAACPLUS_DEC_DRC_IS_CONFIG_CHANGED 0x0027
#define IA_ENHAACPLUS_DEC_DRC_APPLY_CROSSFADE 0x0028
+#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG 0x0030
+
#endif /* IXHEAACD_AAC_CONFIG_H */
diff --git a/decoder/ixheaacd_aac_imdct.c b/decoder/ixheaacd_aac_imdct.c
index 6b158de..dc810e4 100644
--- a/decoder/ixheaacd_aac_imdct.c
+++ b/decoder/ixheaacd_aac_imdct.c
@@ -51,20 +51,29 @@
#define MPYHIRC(x, y) \
\
- (((WORD32)((short)(x >> 16) * (unsigned short)(y & 0x0000FFFF) + 0x4000) >> \
+ (((WORD32)((WORD16)(x >> 16) * (UWORD16)(y & 0x0000FFFF) + 0x4000) >> \
15) + \
- ((WORD32)((short)(x >> 16) * (short)((y) >> 16)) << 1))
+ ((WORD32)((WORD16)(x >> 16) * (WORD16)((y) >> 16)) << 1))
#define MPYLUHS(x, y) \
- ((WORD32)((unsigned short)(x & 0x0000FFFF) * (short)(y >> 16)))
+ ((WORD32)((UWORD16)(x & 0x0000FFFF) * (WORD16)(y >> 16)))
+
+#define MPYLIRC(x, y) \
+ (((WORD32)((WORD16)(x) * (UWORD16)(y & 0x0000FFFF) + 0x4000) >> 15)+ \
+((WORD32)((WORD16)(x) * (WORD16)((y) >> 16)) << 1))
+
+WORD32 rev_dig[] = { 0, 8, 2, 10 };
#define MDCT_LEN 480
#define FFT15X2 30
#define MDCT_LEN_BY2 240
#define FFT5 5
#define FFT16 16
+#define FFT4 4
+#define FFT3 3
#define FFT15 15
#define FFT16X2 32
+#define MDCT_LEN_960 960
WORD32 ixheaacd_fft5out[FFT15X2];
@@ -125,6 +134,59 @@ WORD16 ixheaacd_neg_expo_inc_dec(WORD16 neg_expo) { return (neg_expo + 2); }
WORD16 ixheaacd_neg_expo_inc_arm(WORD16 neg_expo) { return (neg_expo + 3); }
+VOID ixheaacd_pretwiddle_compute_960_dec(
+ WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo) {
+
+ WORD32 i;
+ WORD32 tempr, tempi;
+
+ WORD16 c, c1, s, s1;
+ WORD32 *out_ptr1 = out_ptr + ((npoints4 << 2) - 1);
+ const WORD16 *cos_sin_ptr = ptr_imdct_tables->cosine_array_240;
+
+ for (i = 0; i < npoints4; i++) {
+ c = *cos_sin_ptr++;
+ s = *cos_sin_ptr++;
+
+ tempr = *spec_data1++;
+ tempi = *spec_data2--;
+
+ *out_ptr =
+ ixheaacd_mac32x16in32(ixheaacd_mult32x16in32(tempr, c), tempi, s);
+
+
+ *out_ptr = ixheaacd_shl32(*out_ptr, neg_expo);
+ out_ptr++;
+
+ *out_ptr = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, c),
+ ixheaacd_mult32x16in32(tempr, s));
+
+ *out_ptr = ixheaacd_shl32(*out_ptr, neg_expo);
+ out_ptr++;
+
+ c1 = *cos_sin_ptr++;
+ s1 = *cos_sin_ptr++;
+
+ tempi = *spec_data1++;
+ tempr = *spec_data2--;
+
+
+ *out_ptr1 = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, c1),
+ ixheaacd_mult32x16in32(tempr, s1));
+
+ *out_ptr1 = ixheaacd_shl32(*out_ptr1, neg_expo);
+ out_ptr1--;
+
+ *out_ptr1 =
+ ixheaacd_mac32x16in32(ixheaacd_mult32x16in32(tempr, c1), tempi, s1);
+
+ *out_ptr1 = ixheaacd_shl32(*out_ptr1, neg_expo);
+ out_ptr1--;
+ }
+}
+
VOID ixheaacd_pretwiddle_compute_dec(
WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
@@ -1584,6 +1646,39 @@ VOID ixheaacd_imdct_using_fft_dec(
}
}
+VOID ixheaacd_inverse_transform_960(
+ WORD32 spec_data[], WORD32 scratch[],
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 expo,
+ WORD32 *imdct_scale) {
+
+ WORD32 n;
+ WORD32 Nd2;
+ WORD16 const_mltfac;
+ WORD32 neg_expo;
+
+ WORD32 i;
+
+ n = 120;
+ Nd2 = n >> 1;
+ neg_expo = 4;
+
+ ixheaacd_pre_twiddle_120(spec_data, scratch, n, ptr_imdct_tables->cosine_array_240,
+ neg_expo - expo);
+
+ ixheaacd_fft_120(ptr_imdct_tables, Nd2, spec_data, scratch);
+
+ neg_expo += 2;
+ *imdct_scale = neg_expo + 1;
+
+ ixheaacd_post_twiddle_120(spec_data, scratch, ptr_imdct_tables->cosine_array_240,
+ n);
+ const_mltfac = 17476;
+ for (i = 0; i < 120; i++)
+ {
+ spec_data[i] = ixheaacd_mult32x16in32_shl(spec_data[i], const_mltfac);
+ }
+}
+
WORD32 ixheaacd_inverse_transform(
WORD32 spec_data[], WORD32 scratch[],
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 expo,
@@ -1599,6 +1694,41 @@ WORD32 ixheaacd_inverse_transform(
return expo;
}
+VOID ixheaacd_mdct_960(WORD32 *inp, WORD32 *scratch, WORD32 *mdct_scale,
+ WORD32 mdct_flag,
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
+ WORD32 expo, neg_expo = 0, k;
+
+ WORD16 const_mltfac = 17476;
+
+ expo = (*ixheaacd_calc_max_spectral_line)(inp, MDCT_LEN_960) - 1;
+ ;
+
+ memcpy(scratch, inp, sizeof(WORD32) * MDCT_LEN_960);
+
+ neg_expo = 7 - expo;
+
+ ixheaacd_pre_twiddle_960(inp, scratch, MDCT_LEN_960, imdct_tables_ptr->cosine_array_1920,
+ neg_expo);
+
+ ixheaacd_fft_960(inp, scratch, imdct_tables_ptr);
+
+ ixheaacd_post_twiddle_960(inp, scratch, imdct_tables_ptr->cosine_array_1920,
+ MDCT_LEN_960);
+
+ if (0 == mdct_flag) {
+ WORD32 *data = inp;
+
+ for (k = MDCT_LEN_960 - 1; k >= 0; k -= 2) {
+ *data = ixheaacd_mult32x16in32_shl(*data, const_mltfac);
+ data++;
+ *data = ixheaacd_mult32x16in32_shl(*data, const_mltfac);
+ data++;
+ }
+ }
+ *mdct_scale = neg_expo + 1 + 1 + 1;
+}
+
VOID ixheaacd_mdct_480_ld(WORD32 *inp, WORD32 *scratch, WORD32 *mdct_scale,
WORD32 mdct_flag,
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
@@ -1684,6 +1814,676 @@ VOID ixheaacd_inverse_transform_512(
ixheaacd_post_twiddle_ld((data), temp, cos_sin_ptr, n);
}
+VOID ixheaacd_fft_960(WORD32 *inp, WORD32 *op,
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
+ WORD32 i;
+ WORD32 *buf1, *buf2;
+ WORD16 *re_arr_tab_sml_480_ptr;
+
+ (*ixheaacd_aac_ld_dec_rearrange_960)(inp, op, 480,
+ imdct_tables_ptr->re_arr_tab_32);
+
+ buf1 = op;
+ buf2 = inp;
+
+ for (i = 0; i < FFT15; i++) {
+ ixheaacd_fft_32_points(imdct_tables_ptr->w_32,
+ 32, buf1, buf2);
+
+ buf1 += (FFT16X2 * 2);
+ buf2 += (FFT16X2 * 2);
+ }
+
+ re_arr_tab_sml_480_ptr = imdct_tables_ptr->re_arr_tab_sml_480;
+ buf1 = inp;
+
+ for (i = 0; i < FFT16 * 2; i++) {
+ ixheaacd_ld_dec_fft_15_opt(buf1, op,
+ ixheaacd_fft5out, re_arr_tab_sml_480_ptr);
+ buf1 += 2;
+ re_arr_tab_sml_480_ptr += FFT15;
+ }
+}
+
+VOID ixheaacd_fft_32_points(WORD16 *ptr_w, WORD32 npoints,
+ WORD32* ptr_x, WORD32* ptr_y) {
+ WORD32 i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp;
+ WORD32 xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
+ WORD32 xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
+ WORD32 x_0, x_1, x_l1_0, x_l1_1, x_l2_0, x_l2_1;
+ WORD32 x_h2_0, x_h2_1;
+ WORD16 si10, si20, si30, co10, co20, co30;
+ WORD16 *w;
+ WORD32 *x, *x2, *x0;
+ WORD32 *y0, *y1, *y2, *y3;
+ WORD32 n0, j0;
+ WORD32 radix;
+ WORD32 norm;
+
+ radix = 2;
+ norm = 25;
+
+ stride = 32;
+ tw_offset = 0;
+ fft_jmp = 192;
+
+ while (stride > radix) {
+ j = 0;
+ fft_jmp >>= 2;
+
+ h2 = stride >> 1;
+ l1 = stride;
+ l2 = stride + (stride >> 1);
+
+ x = ptr_x;
+ w = ptr_w + tw_offset;
+ tw_offset += fft_jmp;
+
+ for (i = 0; i < npoints; i += 4) {
+ co10 = w[j + 1]; si10 = w[j + 0];
+ co20 = w[j + 3]; si20 = w[j + 2];
+ co30 = w[j + 5]; si30 = w[j + 4];
+
+ x_0 = x[0]; x_1 = x[1];
+ x_l1_0 = x[l1]; x_l1_1 = x[l1 + 1];
+ x_l2_0 = x[l2]; x_l2_1 = x[l2 + 1];
+ x_h2_0 = x[h2]; x_h2_1 = x[h2 + 1];
+
+ xh0_0 = ixheaacd_add32_sat(x_0, x_l1_0);
+ xh1_0 = ixheaacd_add32_sat(x_1, x_l1_1);
+ xl0_0 = ixheaacd_sub32_sat(x_0, x_l1_0);
+ xl1_0 = ixheaacd_sub32_sat(x_1, x_l1_1);
+ xh20_0 = ixheaacd_add32_sat(x_h2_0, x_l2_0);
+ xh21_0 = ixheaacd_add32_sat(x_h2_1, x_l2_1);
+ xl20_0 = ixheaacd_sub32_sat(x_h2_0, x_l2_0);
+ xl21_0 = ixheaacd_sub32_sat(x_h2_1, x_l2_1);
+
+ x0 = x;
+ x2 = x0;
+
+ j += 6;
+ x += 2;
+ predj = (j - fft_jmp);
+ if (!predj) x += fft_jmp;
+ if (!predj) j = 0;
+
+ x0[0] = ixheaacd_add32_sat(xh0_0, xh20_0);
+ x0[1] = ixheaacd_add32_sat(xh1_0, xh21_0);
+ xt0_0 = ixheaacd_sub32_sat(xh0_0, xh20_0);
+ yt0_0 = ixheaacd_sub32_sat(xh1_0, xh21_0);
+ xt1_0 = ixheaacd_add32_sat(xl0_0, xl21_0);
+ yt2_0 = ixheaacd_add32_sat(xl1_0, xl20_0);
+ xt2_0 = ixheaacd_sub32_sat(xl0_0, xl21_0);
+ yt1_0 = ixheaacd_sub32_sat(xl1_0, xl20_0);
+
+ x2[h2] = ixheaacd_add32_sat(MPYLIRC(si10, yt1_0), MPYLIRC(co10, xt1_0));
+
+ x2[h2 + 1] = ixheaacd_sub32_sat(MPYLIRC(co10, yt1_0), MPYLIRC(si10, xt1_0));
+
+ x2[l1] = ixheaacd_add32_sat(MPYLIRC(si20, yt0_0), MPYLIRC(co20, xt0_0));
+
+ x2[l1 + 1] = ixheaacd_sub32_sat(MPYLIRC(co20, yt0_0), MPYLIRC(si20, xt0_0));
+ yt0_0 = MPYLIRC(si20, yt0_0);
+
+ x2[l2] = ixheaacd_add32_sat(MPYLIRC(si30, yt2_0), MPYLIRC(co30, xt2_0));
+
+ x2[l2 + 1] = ixheaacd_sub32_sat(MPYLIRC(co30, yt2_0), MPYLIRC(si30, xt2_0));
+ yt2_0 = MPYLIRC(si30, yt2_0);
+
+ }
+ stride >>= 2;
+ }
+
+ y0 = ptr_y;
+ y2 = ptr_y + (int)npoints;
+ x0 = ptr_x;
+ x2 = ptr_x + (int)(npoints >> 1);
+
+ y1 = y0 + (int)(npoints >> 2);
+ y3 = y2 + (int)(npoints >> 2);
+ l1 = norm + 1;
+ j0 = 8;
+ n0 = npoints >> 1;
+
+ j = 0;
+ for (i = 0; i < 4; i++) {
+ int t1, t2;
+ h2 = rev_dig[i];
+
+ t1 = h2 << 1;
+ t2 = t1 + 1;
+
+ y0[t1] = ixheaacd_add32_sat(x0[0], x0[2]);
+ y2[t1] = ixheaacd_sub32_sat(x0[0], x0[2]);
+ y0[t2] = ixheaacd_add32_sat(x0[1], x0[3]);
+ y2[t2] = ixheaacd_sub32_sat(x0[1], x0[3]);
+ y1[t1] = ixheaacd_add32_sat(x0[4], x0[6]);
+ y3[t1] = ixheaacd_sub32_sat(x0[4], x0[6]);
+ y1[t2] = ixheaacd_add32_sat(x0[5], x0[7]);
+ y3[t2] = ixheaacd_sub32_sat(x0[5], x0[7]);
+ x0 += 8;
+
+ t1 += 2;
+ t2 += 2;
+
+ y0[t1] = ixheaacd_add32_sat(x2[0], x2[2]);
+ y2[t1] = ixheaacd_sub32_sat(x2[0], x2[2]);
+ y0[t2] = ixheaacd_add32_sat(x2[1], x2[3]);
+ y2[t2] = ixheaacd_sub32_sat(x2[1], x2[3]);
+ y1[t1] = ixheaacd_add32_sat(x2[4], x2[6]);
+ y3[t1] = ixheaacd_sub32_sat(x2[4], x2[6]);
+ y1[t2] = ixheaacd_add32_sat(x2[5], x2[7]);
+ y3[t2] = ixheaacd_sub32_sat(x2[5], x2[7]);
+ x2 += 8;
+
+ j += j0;
+
+ if (j == n0)
+ {
+ j += n0;
+ x0 += (int)npoints >> 1;
+ x2 += (int)npoints >> 1;
+ }
+ }
+}
+
+VOID ixheaacd_dec_rearrange_short(WORD32 *ip, WORD32 *op, WORD32 N,
+ WORD16 *re_arr_tab) {
+ WORD32 n, i = 0;
+
+ for (n = 0; n < N; n++) {
+ WORD32 idx = re_arr_tab[n] << 1;
+ op[i++] = ip[idx];
+ op[i++] = ip[idx + 1];
+ }
+}
+
+VOID ixheaacd_ld_dec_fft_15_opt(WORD32 *inp, WORD32 *op, WORD32 *fft3out,
+ WORD16 *ptr_re_arr_tab_sml_240) {
+ WORD32 i, n, idx;
+ WORD32 *buf1, *buf2, *buf1a;
+ WORD32 add_r, sub_r;
+ WORD32 add_i, sub_i;
+ WORD32 x_01_r, x_01_i, temp;
+ WORD32 p1, p2, p3, p4;
+
+ WORD32 sinmu = 1859775393;
+ WORD32 c_51 = 2042378317;
+ WORD32 c_52 = -1652318768;
+ WORD32 c_53 = -780119100;
+ WORD32 c_54 = 1200479854;
+ WORD32 c_55 = -1342177280;
+
+ WORD32 r1, r2, r3, r4;
+ WORD32 s1, s2, s3, s4, t, temp1, temp2;
+ WORD32 *fft3outptr = fft3out;
+
+ WORD32 xr_0, xr_1, xr_2;
+ WORD32 xi_0, xi_1, xi_2;
+
+ buf2 = fft3out;
+ buf1 = buf1a = fft3out;
+ n = 0;
+
+ {
+ *buf1++ = inp[0];
+ *buf1++ = inp[1];
+
+ *buf1++ = inp[192];
+ *buf1++ = inp[193];
+
+ *buf1++ = inp[384];
+ *buf1++ = inp[385];
+
+ *buf1++ = inp[576];
+ *buf1++ = inp[577];
+
+ *buf1++ = inp[768];
+ *buf1++ = inp[769];
+
+ r1 = ixheaacd_add32_sat(buf1a[2], buf1a[8]);
+ r4 = ixheaacd_sub32_sat(buf1a[2], buf1a[8]);
+ r3 = ixheaacd_add32_sat(buf1a[4], buf1a[6]);
+ r2 = ixheaacd_sub32_sat(buf1a[4], buf1a[6]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(r1, r3), c_54);
+
+ r1 = ixheaacd_add32_sat(r1, r3);
+
+ temp1 = ixheaacd_add32_sat(buf1a[0], r1);
+
+ r1 = ixheaacd_add32_sat(temp1, (ixheaacd_mult32_shl(r1, c_55) << 1));
+
+ r3 = ixheaacd_sub32_sat(r1, t);
+ r1 = ixheaacd_add32_sat(r1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(r4, r2), c_51);
+ r4 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(r4, c_52) << 1));
+ r2 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(r2, c_53));
+
+ s1 = ixheaacd_add32_sat(buf1a[3], buf1a[9]);
+ s4 = ixheaacd_sub32_sat(buf1a[3], buf1a[9]);
+ s3 = ixheaacd_add32_sat(buf1a[5], buf1a[7]);
+ s2 = ixheaacd_sub32_sat(buf1a[5], buf1a[7]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(s1, s3), c_54);
+
+ s1 = ixheaacd_add32_sat(s1, s3);
+
+ temp2 = ixheaacd_add32_sat(buf1a[1], s1);
+
+
+ s1 = ixheaacd_add32_sat(temp2, (ixheaacd_mult32_shl(s1, c_55) << 1));
+
+ s3 = ixheaacd_sub32_sat(s1, t);
+ s1 = ixheaacd_add32_sat(s1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(s4, s2), c_51);
+ s4 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(s4, c_52) << 1));
+ s2 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(s2, c_53)));
+
+ *buf2++ = temp1;
+ *buf2++ = temp2;
+ *buf2++ = ixheaacd_add32_sat(r1, s2);
+ *buf2++ = ixheaacd_sub32_sat(s1, r2);
+ *buf2++ = ixheaacd_sub32_sat(r3, s4);
+ *buf2++ = ixheaacd_add32_sat(s3, r4);
+ *buf2++ = ixheaacd_add32_sat(r3, s4);
+ *buf2++ = ixheaacd_sub32_sat(s3, r4);
+ *buf2++ = ixheaacd_sub32_sat(r1, s2);
+ *buf2++ = ixheaacd_add32_sat(s1, r2);
+ buf1a = buf1;
+
+ *buf1++ = inp[320];
+ *buf1++ = inp[321];
+
+ *buf1++ = inp[512];
+ *buf1++ = inp[513];
+
+ *buf1++ = inp[704];
+ *buf1++ = inp[705];
+
+ *buf1++ = inp[896];
+ *buf1++ = inp[897];
+
+ *buf1++ = inp[128];
+ *buf1++ = inp[129];
+
+ r1 = ixheaacd_add32_sat(buf1a[2], buf1a[8]);
+ r4 = ixheaacd_sub32_sat(buf1a[2], buf1a[8]);
+ r3 = ixheaacd_add32_sat(buf1a[4], buf1a[6]);
+ r2 = ixheaacd_sub32_sat(buf1a[4], buf1a[6]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(r1, r3), c_54);
+
+ r1 = ixheaacd_add32_sat(r1, r3);
+
+ temp1 = ixheaacd_add32_sat(buf1a[0], r1);
+
+ r1 = ixheaacd_add32_sat(temp1, (ixheaacd_mult32_shl(r1, c_55) << 1));
+
+ r3 = ixheaacd_sub32_sat(r1, t);
+ r1 = ixheaacd_add32_sat(r1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(r4, r2), c_51);
+ r4 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(r4, c_52) << 1));
+ r2 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(r2, c_53));
+
+ s1 = ixheaacd_add32_sat(buf1a[3], buf1a[9]);
+ s4 = ixheaacd_sub32_sat(buf1a[3], buf1a[9]);
+ s3 = ixheaacd_add32_sat(buf1a[5], buf1a[7]);
+ s2 = ixheaacd_sub32_sat(buf1a[5], buf1a[7]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(s1, s3), c_54);
+
+ s1 = ixheaacd_add32_sat(s1, s3);
+
+ temp2 = ixheaacd_add32_sat(buf1a[1], s1);
+
+ s1 = ixheaacd_add32_sat(temp2, (ixheaacd_mult32_shl(s1, c_55) << 1));
+
+ s3 = ixheaacd_sub32_sat(s1, t);
+ s1 = ixheaacd_add32_sat(s1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(s4, s2), c_51);
+ s4 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(s4, c_52) << 1));
+ s2 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(s2, c_53));
+
+ *buf2++ = temp1;
+ *buf2++ = temp2;
+ *buf2++ = ixheaacd_add32_sat(r1, s2);
+ *buf2++ = ixheaacd_sub32_sat(s1, r2);
+ *buf2++ = ixheaacd_sub32_sat(r3, s4);
+ *buf2++ = ixheaacd_add32_sat(s3, r4);
+ *buf2++ = ixheaacd_add32_sat(r3, s4);
+ *buf2++ = ixheaacd_sub32_sat(s3, r4);
+ *buf2++ = ixheaacd_sub32_sat(r1, s2);
+ *buf2++ = ixheaacd_add32_sat(s1, r2);
+ buf1a = buf1;
+
+ *buf1++ = inp[640];
+ *buf1++ = inp[641];
+
+ *buf1++ = inp[832];
+ *buf1++ = inp[833];
+
+ *buf1++ = inp[64];
+ *buf1++ = inp[65];
+
+ *buf1++ = inp[256];
+ *buf1++ = inp[257];
+
+ *buf1++ = inp[448];
+ *buf1++ = inp[449];
+
+ r1 = ixheaacd_add32_sat(buf1a[2], buf1a[8]);
+ r4 = ixheaacd_sub32_sat(buf1a[2], buf1a[8]);
+ r3 = ixheaacd_add32_sat(buf1a[4], buf1a[6]);
+ r2 = ixheaacd_sub32_sat(buf1a[4], buf1a[6]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(r1, r3), c_54);
+
+ r1 = ixheaacd_add32_sat(r1, r3);
+
+ temp1 = ixheaacd_add32_sat(buf1a[0], r1);
+
+ r1 = ixheaacd_add32_sat(temp1, (ixheaacd_mult32_shl(r1, c_55) << 1));
+
+ r3 = ixheaacd_sub32_sat(r1, t);
+ r1 = ixheaacd_add32_sat(r1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(r4, r2), c_51);
+ r4 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(r4, c_52) << 1);
+ r2 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(r2, c_53));
+
+ s1 = ixheaacd_add32_sat(buf1a[3], buf1a[9]);
+ s4 = ixheaacd_sub32_sat(buf1a[3], buf1a[9]);
+ s3 = ixheaacd_add32_sat(buf1a[5], buf1a[7]);
+ s2 = ixheaacd_sub32_sat(buf1a[5], buf1a[7]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(s1, s3), c_54);
+
+ s1 = ixheaacd_add32_sat(s1, s3);
+
+ temp2 = ixheaacd_add32_sat(buf1a[1], s1);
+
+ s1 = ixheaacd_add32_sat(temp2, (ixheaacd_mult32_shl(s1, c_55) << 1));
+
+ s3 = ixheaacd_sub32_sat(s1, t);
+ s1 = ixheaacd_add32_sat(s1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(s4, s2), c_51);
+ s4 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(s4, c_52) << 1));
+ s2 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(s2, c_53));
+
+ *buf2++ = temp1;
+ *buf2++ = temp2;
+ *buf2++ = ixheaacd_add32_sat(r1, s2);
+ *buf2++ = ixheaacd_sub32_sat(s1, r2);
+ *buf2++ = ixheaacd_sub32_sat(r3, s4);
+ *buf2++ = ixheaacd_add32_sat(s3, r4);
+ *buf2++ = ixheaacd_add32_sat(r3, s4);
+ *buf2++ = ixheaacd_sub32_sat(s3, r4);
+ *buf2++ = ixheaacd_sub32_sat(r1, s2);
+ *buf2++ = ixheaacd_add32_sat(s1, r2);
+ buf1a = buf1;
+ }
+
+ n = 0;
+ for (i = 0; i < FFT5; i++) {
+ xr_0 = fft3outptr[0];
+ xi_0 = fft3outptr[1];
+
+ xr_1 = fft3outptr[10];
+ xi_1 = fft3outptr[11];
+
+ xr_2 = fft3outptr[20];
+ xi_2 = fft3outptr[21];
+
+ x_01_r = ixheaacd_add32_sat(xr_0, xr_1);
+ x_01_i = ixheaacd_add32_sat(xi_0, xi_1);
+
+ add_r = ixheaacd_add32_sat(xr_1, xr_2);
+ add_i = ixheaacd_add32_sat(xi_1, xi_2);
+
+ sub_r = ixheaacd_sub32_sat(xr_1, xr_2);
+ sub_i = ixheaacd_sub32_sat(xi_1, xi_2);
+
+ p1 = add_r >> 1;
+
+ p2 = ixheaacd_mult32_shl(sub_i, sinmu);
+ p3 = ixheaacd_mult32_shl(sub_r, sinmu);
+
+ p4 = add_i >> 1;
+
+ temp = ixheaacd_sub32_sat(xr_0, p1);
+ temp1 = ixheaacd_add32_sat(xi_0, p3);
+ temp2 = ixheaacd_sub32_sat(xi_0, p3);
+
+ idx = ptr_re_arr_tab_sml_240[n++] << 1;
+ op[idx] = ixheaacd_add32_sat(x_01_r, xr_2);
+ op[idx + 1] = ixheaacd_add32_sat(x_01_i, xi_2);
+
+ idx = ptr_re_arr_tab_sml_240[n++] << 1;
+ op[idx] = ixheaacd_add32_sat(temp, p2);
+ op[idx + 1] = ixheaacd_sub32_sat(temp2, p4);
+
+ idx = ptr_re_arr_tab_sml_240[n++] << 1;
+ op[idx] = ixheaacd_sub32_sat(temp, p2);
+ op[idx + 1] = ixheaacd_sub32_sat(temp1, p4);
+ fft3outptr += 2;
+ }
+ return;
+}
+
+VOID ixheaacd_fft_120(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
+ WORD32 npoints, WORD32* ptr_x, WORD32* ptr_y) {
+ WORD32 i;
+ WORD32 *buf1, *buf2;
+ WORD32 *inp, *op;
+
+ inp = ptr_x;
+ op = ptr_y;
+
+ ixheaacd_dec_rearrange_short(inp, op, 60, imdct_tables_ptr->re_arr_tab_4);
+ buf1 = op;
+ buf2 = inp;
+
+ for (i = 0; i < FFT15; i++) {
+ {
+ WORD32 x_0, x_1, x_2, x_3, x_4, x_5, x_6, x_7;
+ WORD32 *y0, *y1, *y2, *y3;
+ WORD32 *x0;
+ WORD32 xh0_0, xh1_0, xh0_1, xh1_1, xl0_0, xl1_0, xl0_1, xl1_1;
+ WORD32 h2;
+ WORD32 n00, n01, n10, n11, n20, n21, n30, n31;
+
+ ptr_x = buf1;
+ ptr_y = buf2;
+ npoints = 4;
+ h2 = 0;
+
+ y0 = ptr_y;
+ y2 = ptr_y + (WORD32)npoints;
+ x0 = ptr_x;
+
+ y1 = y0 + (WORD32)(npoints >> 1);
+ y3 = y2 + (WORD32)(npoints >> 1);
+
+ x_0 = x0[0]; x_1 = x0[1];
+ x_2 = x0[2]; x_3 = x0[3];
+ x_4 = x0[4]; x_5 = x0[5];
+ x_6 = x0[6]; x_7 = x0[7];
+ x0 += 8;
+
+ xh0_0 = ixheaacd_add32_sat(x_0, x_4);
+ xh1_0 = ixheaacd_add32_sat(x_1, x_5);
+ xl0_0 = ixheaacd_sub32_sat(x_0, x_4);
+ xl1_0 = ixheaacd_sub32_sat(x_1, x_5);
+ xh0_1 = ixheaacd_add32_sat(x_2, x_6);
+ xh1_1 = ixheaacd_add32_sat(x_3, x_7);
+ xl0_1 = ixheaacd_sub32_sat(x_2, x_6);
+ xl1_1 = ixheaacd_sub32_sat(x_3, x_7);
+
+ n00 = ixheaacd_add32_sat(xh0_0, xh0_1);
+ n01 = ixheaacd_add32_sat(xh1_0, xh1_1);
+ n10 = ixheaacd_add32_sat(xl0_0, xl1_1);
+ n11 = ixheaacd_sub32_sat(xl1_0, xl0_1);
+ n20 = ixheaacd_sub32_sat(xh0_0, xh0_1);
+ n21 = ixheaacd_sub32_sat(xh1_0, xh1_1);
+ n30 = ixheaacd_sub32_sat(xl0_0, xl1_1);
+ n31 = ixheaacd_add32_sat(xl1_0, xl0_1);
+
+ y0[2 * h2] = n00; y0[2 * h2 + 1] = n01;
+ y1[2 * h2] = n10; y1[2 * h2 + 1] = n11;
+ y2[2 * h2] = n20; y2[2 * h2 + 1] = n21;
+ y3[2 * h2] = n30; y3[2 * h2 + 1] = n31;
+ }
+ buf1 += (FFT4 * 2);
+ buf2 += (FFT4 * 2);
+ }
+
+ ixheaacd_dec_rearrange_short(inp, op, 60, imdct_tables_ptr->re_arr_tab_15_4);
+
+ buf1 = op;
+ buf2 = inp;
+
+ for (i = 0; i < FFT4; i++) {
+ ixheaacd_fft_960_15(buf1, buf2, imdct_tables_ptr);
+ buf1 += (FFT15 * 2);
+ buf2 += (FFT15 * 2);
+ }
+
+ ixheaacd_dec_rearrange_short(inp, op, 60, imdct_tables_ptr->re_arr_tab_120);
+}
+
+VOID ixheaacd_fft_960_15(WORD32 *inp, WORD32 *op,
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
+ WORD32 i;
+ WORD32 *buf1, *buf2;
+
+ ixheaacd_dec_rearrange_short(inp, op, FFT15, imdct_tables_ptr->re_arr_tab_5);
+
+ buf1 = op;
+ buf2 = inp;
+
+ for (i = 0; i < FFT3; i++) {
+ ixheaacd_fft_5(buf1, buf2);
+
+ buf1 += (FFT5 * 2);
+ buf2 += (FFT5 * 2);
+ }
+
+ ixheaacd_dec_rearrange_short(inp, op, FFT15, imdct_tables_ptr->re_arr_tab_3);
+
+ buf1 = op;
+ buf2 = inp;
+
+ for (i = 0; i < FFT5; i++) {
+ ixheaacd_fft_3(buf1, buf2);
+
+ buf1 += (FFT3 * 2);
+ buf2 += (FFT3 * 2);
+ }
+
+ ixheaacd_dec_rearrange_short(inp, op, FFT15, imdct_tables_ptr->re_arr_tab_sml);
+}
+
+VOID ixheaacd_fft_3(WORD32 *inp, WORD32 *op) {
+ WORD32 add_r, sub_r;
+ WORD32 add_i, sub_i;
+ WORD32 x_01_r, x_01_i, temp;
+
+ WORD32 p1, p2, p3, p4;
+ WORD32 sinmu = 1859775393;
+
+ x_01_r = ixheaacd_add32_sat(inp[0], inp[2]);
+ x_01_i = ixheaacd_add32_sat(inp[1], inp[3]);
+
+ add_r = ixheaacd_add32_sat(inp[2], inp[4]);
+ add_i = ixheaacd_add32_sat(inp[3], inp[5]);
+
+ sub_r = ixheaacd_sub32_sat(inp[2], inp[4]);
+ sub_i = ixheaacd_sub32_sat(inp[3], inp[5]);
+
+ p1 = add_r >> 1;
+ p2 = ixheaacd_mult32_shl(sub_i, sinmu);
+ p3 = ixheaacd_mult32_shl(sub_r, sinmu);
+ p4 = add_i >> 1;
+
+ temp = ixheaacd_sub32_sat(inp[0], p1);
+
+ op[0] = ixheaacd_add32_sat(x_01_r, inp[4]);
+ op[1] = ixheaacd_add32_sat(x_01_i, inp[5]);
+ op[2] = ixheaacd_add32_sat(temp, p2);
+ op[3] = ixheaacd_sub32_sat(ixheaacd_sub32_sat(inp[1], p3), p4);
+ op[4] = ixheaacd_sub32_sat(temp, p2);
+ op[5] = ixheaacd_sub32_sat(ixheaacd_add32_sat(inp[1], p3), p4);
+}
+
+VOID ixheaacd_fft_5(WORD32 *inp, WORD32 *op) {
+ WORD32 c_51 = 2042378317;
+ WORD32 c_52 = -1652318768;
+ WORD32 c_53 = -780119100;
+ WORD32 c_54 = 1200479854;
+ WORD32 c_55 = -1342177280;
+
+ WORD32 r1, r2, r3, r4;
+ WORD32 s1, s2, s3, s4, t, temp1, temp2;
+
+ r1 = ixheaacd_add32_sat(inp[2], inp[8]);
+ r4 = ixheaacd_sub32_sat(inp[2], inp[8]);
+ r3 = ixheaacd_add32_sat(inp[4], inp[6]);
+ r2 = ixheaacd_sub32_sat(inp[4], inp[6]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(r1, r3), c_54);
+ r1 = ixheaacd_add32_sat(r1, r3);
+
+ temp1 = ixheaacd_add32_sat(inp[0], r1);
+ r1 = ixheaacd_add32_sat(
+ temp1, ixheaacd_shl32_sat((ixheaacd_mult32_shl(r1, c_55)), 1));
+
+ r3 = ixheaacd_sub32_sat(r1, t);
+ r1 = ixheaacd_add32_sat(r1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(r4, r2), c_51);
+ r4 = ixheaacd_add32_sat(
+ t, ixheaacd_shl32_sat(ixheaacd_mult32_shl(r4, c_52), 1));
+ r2 = ixheaacd_add32_sat(t, ixheaacd_mult32_shl(r2, c_53));
+
+ s1 = ixheaacd_add32_sat(inp[3], inp[9]);
+ s4 = ixheaacd_sub32_sat(inp[3], inp[9]);
+ s3 = ixheaacd_add32_sat(inp[5], inp[7]);
+ s2 = ixheaacd_sub32_sat(inp[5], inp[7]);
+
+ t = ixheaacd_mult32_shl(ixheaacd_sub32_sat(s1, s3), c_54);
+ s1 = ixheaacd_add32_sat(s1, s3);
+
+ temp2 = ixheaacd_add32_sat(inp[1], s1);
+
+ s1 = ixheaacd_add32_sat(
+ temp2, ixheaacd_shl32_sat((ixheaacd_mult32_shl(s1, c_55)), 1));
+
+ s3 = ixheaacd_sub32_sat(s1, t);
+ s1 = ixheaacd_add32_sat(s1, t);
+
+ t = ixheaacd_mult32_shl(ixheaacd_add32_sat(s4, s2), c_51);
+ s4 = ixheaacd_add32_sat(
+ t, ixheaacd_shl32_sat((ixheaacd_mult32_shl(s4, c_52)), 1));
+ s2 = ixheaacd_add32_sat(t, (ixheaacd_mult32_shl(s2, c_53)));
+
+ op[0] = temp1;
+ op[1] = temp2;
+ op[2] = ixheaacd_add32_sat(r1, s2);
+ op[3] = ixheaacd_sub32_sat(s1, r2);
+ op[4] = ixheaacd_sub32_sat(r3, s4);
+ op[5] = ixheaacd_add32_sat(s3, r4);
+ op[6] = ixheaacd_add32_sat(r3, s4);
+ op[7] = ixheaacd_sub32_sat(s3, r4);
+ op[8] = ixheaacd_sub32_sat(r1, s2);
+ op[9] = ixheaacd_add32_sat(s1, r2);
+}
+
VOID ixheaacd_fft_480_ld(WORD32 *inp, WORD32 *op,
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
WORD32 i;
@@ -1712,6 +2512,94 @@ VOID ixheaacd_fft_480_ld(WORD32 *inp, WORD32 *op,
}
}
+VOID ixheaacd_pre_twiddle_960(WORD32 *xptr, WORD32 *data, WORD32 n,
+ WORD32 *cos_sin_ptr, WORD32 neg_expo) {
+ WORD npoints_4, i;
+ WORD32 tempr, tempi, temp;
+ WORD32 c, c1, s, s1;
+ WORD32 *in_ptr1, *in_ptr2;
+ WORD32 *xprt1 = xptr + (n - 1);
+
+ npoints_4 = n >> 2;
+
+ in_ptr1 = data;
+ in_ptr2 = data + n - 1;
+
+ for (i = 0; i < npoints_4; i++) {
+ c = *cos_sin_ptr++;
+ s = *cos_sin_ptr++;
+
+ tempr = *in_ptr1++;
+ tempi = *in_ptr2--;
+
+ temp = -ixheaacd_add32(ixheaacd_mult32x32in32(tempr, c),
+ ixheaacd_mult32x32in32(tempi, s));
+ *xptr++ = shr32_dir_sat(temp, neg_expo);
+
+ temp = -ixheaacd_sub32(ixheaacd_mult32x32in32(tempi, c),
+ ixheaacd_mult32x32in32(tempr, s));
+ *xptr++ = shr32_dir_sat(temp, neg_expo);
+
+ c1 = *cos_sin_ptr++;
+ s1 = *cos_sin_ptr++;
+
+ tempi = *in_ptr1++;
+ tempr = *in_ptr2--;
+
+ temp = -ixheaacd_sub32(ixheaacd_mult32x32in32(tempi, c1),
+ ixheaacd_mult32x32in32(tempr, s1));
+ *xprt1-- = shr32_dir_sat(temp, neg_expo);
+
+ temp = -ixheaacd_add32(ixheaacd_mult32x32in32(tempr, c1),
+ ixheaacd_mult32x32in32(tempi, s1));
+ *xprt1-- = shr32_dir_sat(temp, neg_expo);
+ }
+}
+
+VOID ixheaacd_pre_twiddle_120(WORD32 *xptr, WORD32 *data, WORD32 n,
+ WORD16 *cos_sin_ptr, WORD32 neg_expo) {
+ WORD npoints_4, i;
+ WORD32 tempr, tempi, temp;
+ WORD16 c, c1, s, s1;
+ WORD32 *in_ptr1, *in_ptr2;
+ WORD32 *xprt1 = xptr + (n - 1);
+
+ npoints_4 = n >> 2;
+
+ in_ptr1 = data;
+ in_ptr2 = data + n - 1;
+
+ for (i = 0; i < npoints_4; i++) {
+ c = *cos_sin_ptr++;
+ s = *cos_sin_ptr++;
+
+ tempr = *in_ptr1++;
+ tempi = *in_ptr2--;
+
+ temp = -ixheaacd_add32(ixheaacd_mult32x16in32(tempr, c),
+ ixheaacd_mult32x16in32(tempi, s));
+ *xptr++ = shr32_dir_sat(temp, neg_expo);
+
+ temp = -ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, c),
+ ixheaacd_mult32x16in32(tempr, s));
+ *xptr++ = shr32_dir_sat(temp, neg_expo);
+
+ c1 = *cos_sin_ptr++;
+ s1 = *cos_sin_ptr++;
+
+ tempi = *in_ptr1++;
+ tempr = *in_ptr2--;
+
+ temp = -ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, c1),
+ ixheaacd_mult32x16in32(tempr, s1));
+ *xprt1-- = shr32_dir_sat(temp, neg_expo);
+
+ temp = -ixheaacd_add32(ixheaacd_mult32x16in32(tempr, c1),
+ ixheaacd_mult32x16in32(tempi, s1));
+ *xprt1-- = shr32_dir_sat(temp, neg_expo);
+ }
+}
+
VOID ixheaacd_pre_twiddle(WORD32 *xptr, WORD32 *data, WORD32 n,
WORD32 *cos_sin_ptr, WORD32 neg_expo) {
WORD npoints_4, i;
@@ -1799,6 +2687,86 @@ VOID ixheaacd_pre_twiddle(WORD32 *xptr, WORD32 *data, WORD32 n,
}
}
+VOID ixheaacd_post_twiddle_120(WORD32 out[], WORD32 x[],
+ const WORD16 *cos_sin_ptr, WORD m) {
+ WORD i;
+ WORD16 c, c1, s, s1;
+ WORD32 tempr, tempi, temp;
+ WORD32 *in_ptr2 = x + (m - 1);
+ WORD32 *in_ptr1 = x;
+ WORD32 *xptr = out;
+ WORD32 *xptr1 = out + (m - 1);
+
+ for (i = 0; i < m; i += 4) {
+ c = *cos_sin_ptr++;
+ s = *cos_sin_ptr++;
+ c1 = *cos_sin_ptr++;
+ s1 = *cos_sin_ptr++;
+
+ tempr = *in_ptr1++;
+ tempi = *in_ptr1++;
+
+ temp = -ixheaacd_sub32_sat(ixheaacd_mult32x16in32(tempr, s),
+ ixheaacd_mult32x16in32(tempi, c));
+ *xptr1-- = temp;
+
+ temp = -ixheaacd_add32_sat(ixheaacd_mult32x16in32(tempr, c),
+ ixheaacd_mult32x16in32(tempi, s));
+ *xptr++ = temp;
+
+ tempi = *in_ptr2--;
+ tempr = *in_ptr2--;
+
+ temp = -ixheaacd_sub32_sat(ixheaacd_mult32x16in32(tempr, s1),
+ ixheaacd_mult32x16in32(tempi, c1));
+ *xptr++ = temp;
+
+ temp = -ixheaacd_add32_sat(ixheaacd_mult32x16in32(tempr, c1),
+ ixheaacd_mult32x16in32(tempi, s1));
+ *xptr1-- = temp;
+ }
+}
+
+VOID ixheaacd_post_twiddle_960(WORD32 out[], WORD32 x[],
+ const WORD32 *cos_sin_ptr, WORD m) {
+ WORD i;
+ WORD32 c, c1, s, s1;
+ WORD32 tempr, tempi, temp;
+ WORD32 *in_ptr2 = x + (m - 1);
+ WORD32 *in_ptr1 = x;
+ WORD32 *xptr = out;
+ WORD32 *xptr1 = out + (m - 1);
+
+ for (i = 0; i < m; i += 4) {
+ c = *cos_sin_ptr++;
+ s = *cos_sin_ptr++;
+ c1 = *cos_sin_ptr++;
+ s1 = *cos_sin_ptr++;
+
+ tempr = *in_ptr1++;
+ tempi = *in_ptr1++;
+
+ temp = -ixheaacd_sub32_sat(ixheaacd_mult32x32in32(tempr, s),
+ ixheaacd_mult32x32in32(tempi, c));
+ *xptr1-- = temp;
+
+ temp = -ixheaacd_add32_sat(ixheaacd_mult32x32in32(tempr, c),
+ ixheaacd_mult32x32in32(tempi, s));
+ *xptr++ = temp;
+
+ tempi = *in_ptr2--;
+ tempr = *in_ptr2--;
+
+ temp = -ixheaacd_sub32_sat(ixheaacd_mult32x32in32(tempr, s1),
+ ixheaacd_mult32x32in32(tempi, c1));
+ *xptr++ = temp;
+
+ temp = -ixheaacd_add32_sat(ixheaacd_mult32x32in32(tempr, c1),
+ ixheaacd_mult32x32in32(tempi, s1));
+ *xptr1-- = temp;
+ }
+}
+
VOID ixheaacd_post_twiddle_ld(WORD32 out[], WORD32 x[],
const WORD32 *cos_sin_ptr, WORD m) {
WORD i;
@@ -1951,7 +2919,7 @@ VOID ixheaacd_post_twiddle_eld(WORD32 out[], WORD32 x[],
VOID ixheaacd_fft32x32_ld_dec(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
WORD32 npoints, WORD32 *ptr_x, WORD32 *ptr_y) {
- WORD32 i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp;
+ WORD32 i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp, k;
WORD32 xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
WORD32 xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
WORD32 xh0_1, xh1_1, xl0_1, xl1_1;
@@ -1973,6 +2941,8 @@ VOID ixheaacd_fft32x32_ld_dec(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
if (npoints == 256)
ptr_w = imdct_tables_ptr->w_256;
+ else if (npoints == 32)
+ ptr_w = (WORD32*)imdct_tables_ptr->w_32;
else
ptr_w = imdct_tables_ptr->w_16;
@@ -2089,9 +3059,13 @@ VOID ixheaacd_fft32x32_ld_dec(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
}
j = 0;
+ k = 0;
for (i = 0; i < npoints; i += 8) {
- DIG_REV(j, l1, h2);
+ if (npoints == 32)
+ h2 = rev_dig[k++];
+ else
+ DIG_REV(j, l1, h2);
x_0 = x0[0];
x_1 = x0[1];
diff --git a/decoder/ixheaacd_aac_imdct.h b/decoder/ixheaacd_aac_imdct.h
index 950eef9..ddba1a8 100644
--- a/decoder/ixheaacd_aac_imdct.h
+++ b/decoder/ixheaacd_aac_imdct.h
@@ -25,6 +25,11 @@ WORD32 ixheaacd_inverse_transform(
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 expo,
WORD32 npoints);
+VOID ixheaacd_inverse_transform_960(
+ WORD32 spec_data[], WORD32 scratch[],
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 expo,
+ WORD32 *imdct_scale);
+
VOID ixheaacd_post_twiddle_dec(WORD32 out_ptr[], WORD32 spec_data[],
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables,
WORD32 npoints);
@@ -60,6 +65,11 @@ VOID ixheaacd_pretwiddle_compute_dec(
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
WORD32 neg_expo);
+VOID ixheaacd_pretwiddle_compute_960_dec(
+ WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo);
+
VOID ixheaacd_pretwiddle_compute_armv7(
WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
@@ -85,12 +95,46 @@ VOID ixheaacd_imdct_using_fft_armv8(
VOID ixheaacd_fft_480_ld(WORD32 *inp, WORD32 *op,
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr);
+VOID ixheaacd_fft_5(WORD32 *inp, WORD32 *op);
+
+VOID ixheaacd_fft_3(WORD32 *inp, WORD32 *op);
+
+VOID ixheaacd_fft_960_15(WORD32 *inp, WORD32 *op,
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr);
+
+VOID ixheaacd_fft_960(WORD32 *inp, WORD32 *op,
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr);
+
+VOID ixheaacd_fft_120(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
+ WORD32 npoints, WORD32* ptr_x, WORD32* ptr_y);
+
+VOID ixheaacd_fft_32_points(WORD16 *ptr_w, WORD32 npoints,
+ WORD32* ptr_x, WORD32* ptr_y);
+
+VOID ixheaacd_ld_dec_fft_15_opt(WORD32 *inp, WORD32 *op, WORD32 *fft3out,
+ WORD16 *re_arr_tab_sml_240_ptr);
+
+VOID ixheaacd_dec_rearrange_short(WORD32 *ip, WORD32 *op, WORD32 n,
+ WORD16 *re_arr_tab);
+
VOID ixheaacd_pre_twiddle(WORD32 *xptr, WORD32 *data, WORD32 n,
WORD32 *cos_array_ptr, WORD32 neg_expo);
+VOID ixheaacd_pre_twiddle_960(WORD32 *xptr, WORD32 *data, WORD32 n,
+ WORD32 *cos_array_ptr, WORD32 neg_expo);
+
+VOID ixheaacd_pre_twiddle_120(WORD32 *xptr, WORD32 *data, WORD32 n,
+ WORD16 *cos_array_ptr, WORD32 neg_expo);
+
VOID ixheaacd_post_twiddle_ld(WORD32 out[], WORD32 x[],
const WORD32 *cos_sin_ptr, WORD m);
+VOID ixheaacd_post_twiddle_960(WORD32 out[], WORD32 x[],
+ const WORD32 *cos_sin_ptr, WORD m);
+
+VOID ixheaacd_post_twiddle_120(WORD32 out[], WORD32 x[],
+ const WORD16 *cos_sin_ptr, WORD m);
+
VOID ixheaacd_post_twiddle_eld(WORD32 out[], WORD32 x[],
const WORD32 *cos_sin_ptr, WORD m);
@@ -125,6 +169,10 @@ VOID ixheaacd_inverse_transform_512(
WORD32 data[], WORD32 temp[], WORD32 *imdct_scale, WORD32 *cos_sin_ptr,
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 object_type);
+VOID ixheaacd_mdct_960(WORD32 *inp, WORD32 *scratch, WORD32 *mdct_scale,
+ WORD32 mdct_flag,
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr);
+
VOID ixheaacd_mdct_480_ld(WORD32 *inp, WORD32 *scratch, WORD32 *mdct_scale,
WORD32 mdct_flag,
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
diff --git a/decoder/ixheaacd_aac_rom.c b/decoder/ixheaacd_aac_rom.c
index 8c3d426..9e07777 100644
--- a/decoder/ixheaacd_aac_rom.c
+++ b/decoder/ixheaacd_aac_rom.c
@@ -395,6 +395,122 @@ const ia_aac_dec_huffman_tables_struct ixheaacd_aac_huffmann_tables = {
12, 16, 20, 24, 28, 32, 32, 32, 32, 32, 32, 32, 32, 32, -1,
},
+ // static const WORD16 sfb_96_960[41] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4,
+ 4, 4, 8, 8, 8, 8,
+ 8, 12, 12, 12, 12, 12,
+ 16, 16, 24, 28, 36, 44,
+ 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, -1
+},
+
+/* 13 scfbands */
+
+// static const WORD16 sfb_96_120[13] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 8, 8, 8, 16, 28, 28,
+ -1
+},
+
+/* 47 scfbands*/
+// static const WORD16 sfb_64_960[47] =
+{
+ 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4,
+ 8, 8, 8, 8, 12, 12, 12,
+ 16, 16, 16, 20, 24, 24, 28,
+ 36, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 16, -1
+},
+
+/* 49 scfbands */
+// static const WORD16 sfb_48_960[50] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 8, 8,
+ 8, 8, 8, 8, 8, 12,
+ 12, 12, 12, 16, 16, 20,
+ 20, 24, 24, 28, 28, 32,
+ 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,
+ 32, -1
+},
+
+/* 14 scfbands */
+// static const WORD16 sfb_48_120[15] =
+{
+ 4, 4, 4, 4, 4, 8,
+ 8, 8, 12, 12, 12, 16,
+ 16, 8, -1
+},
+
+
+/* 47 scfbands */
+// static const WORD16 sfb_24_960[47] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 8,
+ 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 12, 12, 12,
+ 12, 16, 16, 16, 20, 20,
+ 24, 24, 28, 28, 32, 36,
+ 36, 40, 44, 48, 52, 52,
+ 64, 64, 64, 64, -1
+},
+
+/* 15 scfbands */
+// static const WORD16 sfb_24_120[16] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 4, 8, 8, 8, 12, 12,
+ 16, 16, 12, -1
+},
+
+/* 43 scfbands */
+// static const WORD16 sfb_16_960[43] =
+{
+ 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 12,
+ 12, 12, 12, 12, 12, 12,
+ 12, 12, 16, 16, 16, 16,
+ 20, 20, 20, 24, 24, 28,
+ 28, 32, 36, 40, 40, 44,
+ 48, 52, 56, 60, 64, 64,
+ -1
+},
+
+/* 15 scfbands */
+// static const WORD16 sfb_16_120[16] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 4, 4, 8, 8, 12, 12,
+ 16, 20, 12, -1
+},
+
+/* 40 scfbands */
+// static const WORD16 sfb_8_960[41] =
+{
+ 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12,
+ 12, 16, 16, 16, 16, 16,
+ 16, 16, 20, 20, 20, 20,
+ 24, 24, 24, 28, 28, 32,
+ 36, 36, 40, 44, 48, 52,
+ 56, 60, 64, 16, -1
+},
+
+/* 15 scfbands */
+// static const WORD16 sfb_8_120[16] =
+{
+ 4, 4, 4, 4, 4, 4,
+ 4, 8, 8, 8, 8, 12,
+ 16, 20, 12, -1
+},
}; // end of ia_aac_dec_huffman_tables_struct
const ia_aac_dec_block_tables_struct ixheaacd_aac_block_tables = {
@@ -539,7 +655,7 @@ const ia_aac_dec_block_tables_struct ixheaacd_aac_block_tables = {
0, 0,
}},
- // const Word8 tns_max_bands_tbl_ld[12][4] =
+ // const WORD8 tns_max_bands_tbl_ld[12][4] =
{
/*{*/ 31, /* 96000 */
/*{*/ 31, /* 88200 */
@@ -554,7 +670,7 @@ const ia_aac_dec_block_tables_struct ixheaacd_aac_block_tables = {
/*{*/ 31, /* 11025 */
/*{*/ 31, /* 8000 */
},
- // const Word8 tns_max_bands_tbl_480[12][4] =
+ // const WORD8 tns_max_bands_tbl_480[12][4] =
{
/*{*/ 31, /* 96000 */
/*{*/ 31, /* 88200 */
@@ -568,8 +684,13 @@ const ia_aac_dec_block_tables_struct ixheaacd_aac_block_tables = {
/*{*/ 30, /* 12000 */
/*{*/ 30, /* 11025 */
/*{*/ 30, /* 8000 */
- }
-
+ },
+ // const WORD16 scale_table_960[4] =
+ {
+ /* Q14 format */
+ /* table of 2^(r/4) for r=0, 1, 2, 3 */
+ 16385, 19486, 23172, 27557
+ },
}; // end of ia_aac_dec_block_tables_struct */
const ia_aac_dec_imdct_tables_struct ixheaacd_imdct_tables = {
@@ -2260,6 +2381,666 @@ const ia_aac_dec_imdct_tables_struct ixheaacd_imdct_tables = {
-23, -23, -23, -23, -23, -23, -23, -23, -23, -22,
-22, -22, -22, -22, -22, -22, -22, -21, -21, -21,
-21, -21, -21, -20, -20, -20, -20, -20, -20, -19,
- -19, -19, -19, -18, -18, -18, -18, -18}
+ -19, -19, -19, -18, -18, -18, -18, -18},
+
+ // const WORD16 only_long_window_sine_960[960] =
+ {
+ 0x001B, 0x7FFF, 0x0050, 0x7FFF, 0x0086, 0x7FFF, 0x00BC, 0x7FFE, 0x00F1, 0x7FFE,
+ 0x0127, 0x7FFE, 0x015C, 0x7FFD, 0x0192, 0x7FFD, 0x01C8, 0x7FFC, 0x01FD, 0x7FFB,
+ 0x0233, 0x7FFA, 0x0269, 0x7FF9, 0x029E, 0x7FF8, 0x02D4, 0x7FF7, 0x0309, 0x7FF6,
+ 0x033F, 0x7FF4, 0x0375, 0x7FF3, 0x03AA, 0x7FF2, 0x03E0, 0x7FF0, 0x0415, 0x7FEE,
+ 0x044B, 0x7FED, 0x0480, 0x7FEB, 0x04B6, 0x7FE9, 0x04EC, 0x7FE7, 0x0521, 0x7FE5,
+ 0x0557, 0x7FE2, 0x058C, 0x7FE0, 0x05C2, 0x7FDE, 0x05F7, 0x7FDB, 0x062D, 0x7FD9,
+ 0x0663, 0x7FD6, 0x0698, 0x7FD3, 0x06CE, 0x7FD1, 0x0703, 0x7FCE, 0x0739, 0x7FCB,
+ 0x076E, 0x7FC8, 0x07A4, 0x7FC5, 0x07D9, 0x7FC1, 0x080F, 0x7FBE, 0x0844, 0x7FBB,
+ 0x087A, 0x7FB7, 0x08AF, 0x7FB3, 0x08E5, 0x7FB0, 0x091A, 0x7FAC, 0x0950, 0x7FA8,
+ 0x0985, 0x7FA4, 0x09BB, 0x7FA0, 0x09F0, 0x7F9C, 0x0A26, 0x7F98, 0x0A5B, 0x7F94,
+ 0x0A90, 0x7F8F, 0x0AC6, 0x7F8B, 0x0AFB, 0x7F86, 0x0B31, 0x7F82, 0x0B66, 0x7F7D,
+ 0x0B9C, 0x7F78, 0x0BD1, 0x7F73, 0x0C06, 0x7F6E, 0x0C3C, 0x7F69, 0x0C71, 0x7F64,
+ 0x0CA6, 0x7F5F, 0x0CDC, 0x7F59, 0x0D11, 0x7F54, 0x0D46, 0x7F4E, 0x0D7C, 0x7F49,
+ 0x0DB1, 0x7F43, 0x0DE6, 0x7F3D, 0x0E1C, 0x7F37, 0x0E51, 0x7F31, 0x0E86, 0x7F2B,
+ 0x0EBB, 0x7F25, 0x0EF1, 0x7F1F, 0x0F26, 0x7F19, 0x0F5B, 0x7F12, 0x0F90, 0x7F0C,
+ 0x0FC6, 0x7F05, 0x0FFB, 0x7EFF, 0x1030, 0x7EF8, 0x1065, 0x7EF1, 0x109A, 0x7EEA,
+ 0x10D0, 0x7EE3, 0x1105, 0x7EDC, 0x113A, 0x7ED5, 0x116F, 0x7ECE, 0x11A4, 0x7EC6,
+ 0x11D9, 0x7EBF, 0x120E, 0x7EB7, 0x1243, 0x7EB0, 0x1278, 0x7EA8, 0x12AD, 0x7EA0,
+ 0x12E2, 0x7E98, 0x1317, 0x7E90, 0x134C, 0x7E88, 0x1381, 0x7E80, 0x13B6, 0x7E78,
+ 0x13EB, 0x7E70, 0x1420, 0x7E67, 0x1455, 0x7E5F, 0x148A, 0x7E56, 0x14BF, 0x7E4E,
+ 0x14F4, 0x7E45, 0x1529, 0x7E3C, 0x155E, 0x7E33, 0x1593, 0x7E2A, 0x15C7, 0x7E21,
+ 0x15FC, 0x7E18, 0x1631, 0x7E0F, 0x1666, 0x7E05, 0x169B, 0x7DFC, 0x16CF, 0x7DF2,
+ 0x1704, 0x7DE9, 0x1739, 0x7DDF, 0x176E, 0x7DD5, 0x17A2, 0x7DCC, 0x17D7, 0x7DC2,
+ 0x180C, 0x7DB8, 0x1840, 0x7DAD, 0x1875, 0x7DA3, 0x18AA, 0x7D99, 0x18DE, 0x7D8F,
+ 0x1913, 0x7D84, 0x1947, 0x7D7A, 0x197C, 0x7D6F, 0x19B0, 0x7D64, 0x19E5, 0x7D59,
+ 0x1A19, 0x7D4F, 0x1A4E, 0x7D44, 0x1A82, 0x7D39, 0x1AB7, 0x7D2D, 0x1AEB, 0x7D22,
+ 0x1B20, 0x7D17, 0x1B54, 0x7D0B, 0x1B88, 0x7D00, 0x1BBD, 0x7CF4, 0x1BF1, 0x7CE9,
+ 0x1C25, 0x7CDD, 0x1C5A, 0x7CD1, 0x1C8E, 0x7CC5, 0x1CC2, 0x7CB9, 0x1CF6, 0x7CAD,
+ 0x1D2B, 0x7CA1, 0x1D5F, 0x7C95, 0x1D93, 0x7C88, 0x1DC7, 0x7C7C, 0x1DFB, 0x7C6F,
+ 0x1E2F, 0x7C63, 0x1E64, 0x7C56, 0x1E98, 0x7C49, 0x1ECC, 0x7C3C, 0x1F00, 0x7C30,
+ 0x1F34, 0x7C22, 0x1F68, 0x7C15, 0x1F9C, 0x7C08, 0x1FD0, 0x7BFB, 0x2004, 0x7BEE,
+ 0x2037, 0x7BE0, 0x206B, 0x7BD3, 0x209F, 0x7BC5, 0x20D3, 0x7BB7, 0x2107, 0x7BA9,
+ 0x213B, 0x7B9C, 0x216E, 0x7B8E, 0x21A2, 0x7B80, 0x21D6, 0x7B71, 0x220A, 0x7B63,
+ 0x223D, 0x7B55, 0x2271, 0x7B47, 0x22A4, 0x7B38, 0x22D8, 0x7B29, 0x230C, 0x7B1B,
+ 0x233F, 0x7B0C, 0x2373, 0x7AFD, 0x23A6, 0x7AEE, 0x23DA, 0x7ADF, 0x240D, 0x7AD0,
+ 0x2441, 0x7AC1, 0x2474, 0x7AB2, 0x24A7, 0x7AA3, 0x24DB, 0x7A93, 0x250E, 0x7A84,
+ 0x2541, 0x7A74, 0x2575, 0x7A65, 0x25A8, 0x7A55, 0x25DB, 0x7A45, 0x260E, 0x7A35,
+ 0x2642, 0x7A25, 0x2675, 0x7A15, 0x26A8, 0x7A05, 0x26DB, 0x79F5, 0x270E, 0x79E4,
+ 0x2741, 0x79D4, 0x2774, 0x79C4, 0x27A7, 0x79B3, 0x27DA, 0x79A2, 0x280D, 0x7992,
+ 0x2840, 0x7981, 0x2873, 0x7970, 0x28A6, 0x795F, 0x28D8, 0x794E, 0x290B, 0x793D,
+ 0x293E, 0x792B, 0x2971, 0x791A, 0x29A3, 0x7909, 0x29D6, 0x78F7, 0x2A09, 0x78E6,
+ 0x2A3B, 0x78D4, 0x2A6E, 0x78C2, 0x2AA1, 0x78B0, 0x2AD3, 0x789F, 0x2B06, 0x788D,
+ 0x2B38, 0x787B, 0x2B6B, 0x7868, 0x2B9D, 0x7856, 0x2BCF, 0x7844, 0x2C02, 0x7831,
+ 0x2C34, 0x781F, 0x2C66, 0x780C, 0x2C99, 0x77FA, 0x2CCB, 0x77E7, 0x2CFD, 0x77D4,
+ 0x2D2F, 0x77C1, 0x2D61, 0x77AE, 0x2D94, 0x779B, 0x2DC6, 0x7788, 0x2DF8, 0x7775,
+ 0x2E2A, 0x7762, 0x2E5C, 0x774E, 0x2E8E, 0x773B, 0x2EC0, 0x7727, 0x2EF1, 0x7714,
+ 0x2F23, 0x7700, 0x2F55, 0x76EC, 0x2F87, 0x76D8, 0x2FB9, 0x76C4, 0x2FEA, 0x76B0,
+ 0x301C, 0x769C, 0x304E, 0x7688, 0x307F, 0x7674, 0x30B1, 0x765F, 0x30E3, 0x764B,
+ 0x3114, 0x7636, 0x3146, 0x7622, 0x3177, 0x760D, 0x31A9, 0x75F8, 0x31DA, 0x75E4,
+ 0x320B, 0x75CF, 0x323D, 0x75BA, 0x326E, 0x75A5, 0x329F, 0x758F, 0x32D0, 0x757A,
+ 0x3302, 0x7565, 0x3333, 0x754F, 0x3364, 0x753A, 0x3395, 0x7524, 0x33C6, 0x750F,
+ 0x33F7, 0x74F9, 0x3428, 0x74E3, 0x3459, 0x74CD, 0x348A, 0x74B7, 0x34BB, 0x74A1,
+ 0x34EC, 0x748B, 0x351C, 0x7475, 0x354D, 0x745F, 0x357E, 0x7448, 0x35AF, 0x7432,
+ 0x35DF, 0x741B, 0x3610, 0x7405, 0x3640, 0x73EE, 0x3671, 0x73D7, 0x36A1, 0x73C0,
+ 0x36D2, 0x73AA, 0x3702, 0x7393, 0x3733, 0x737B, 0x3763, 0x7364, 0x3793, 0x734D,
+ 0x37C4, 0x7336, 0x37F4, 0x731E, 0x3824, 0x7307, 0x3854, 0x72EF, 0x3884, 0x72D8,
+ 0x38B5, 0x72C0, 0x38E5, 0x72A8, 0x3915, 0x7290, 0x3945, 0x7278, 0x3974, 0x7260,
+ 0x39A4, 0x7248, 0x39D4, 0x7230, 0x3A04, 0x7218, 0x3A34, 0x71FF, 0x3A64, 0x71E7,
+ 0x3A93, 0x71CF, 0x3AC3, 0x71B6, 0x3AF2, 0x719D, 0x3B22, 0x7185, 0x3B52, 0x716C,
+ 0x3B81, 0x7153, 0x3BB1, 0x713A, 0x3BE0, 0x7121, 0x3C0F, 0x7108, 0x3C3F, 0x70EF,
+ 0x3C6E, 0x70D5, 0x3C9D, 0x70BC, 0x3CCC, 0x70A2, 0x3CFB, 0x7089, 0x3D2B, 0x706F,
+ 0x3D5A, 0x7056, 0x3D89, 0x703C, 0x3DB8, 0x7022, 0x3DE7, 0x7008, 0x3E16, 0x6FEE,
+ 0x3E44, 0x6FD4, 0x3E73, 0x6FBA, 0x3EA2, 0x6FA0, 0x3ED1, 0x6F86, 0x3EFF, 0x6F6B,
+ 0x3F2E, 0x6F51, 0x3F5D, 0x6F36, 0x3F8B, 0x6F1C, 0x3FBA, 0x6F01, 0x3FE8, 0x6EE6,
+ 0x4017, 0x6ECC, 0x4045, 0x6EB1, 0x4073, 0x6E96, 0x40A2, 0x6E7B, 0x40D0, 0x6E60,
+ 0x40FE, 0x6E44, 0x412C, 0x6E29, 0x415A, 0x6E0E, 0x4189, 0x6DF2, 0x41B7, 0x6DD7,
+ 0x41E5, 0x6DBB, 0x4213, 0x6DA0, 0x4240, 0x6D84, 0x426E, 0x6D68, 0x429C, 0x6D4C,
+ 0x42CA, 0x6D30, 0x42F8, 0x6D14, 0x4325, 0x6CF8, 0x4353, 0x6CDC, 0x4380, 0x6CC0,
+ 0x43AE, 0x6CA4, 0x43DB, 0x6C87, 0x4409, 0x6C6B, 0x4436, 0x6C4E, 0x4464, 0x6C32,
+ 0x4491, 0x6C15, 0x44BE, 0x6BF8, 0x44EB, 0x6BDB, 0x4519, 0x6BBE, 0x4546, 0x6BA1,
+ 0x4573, 0x6B84, 0x45A0, 0x6B67, 0x45CD, 0x6B4A, 0x45FA, 0x6B2D, 0x4626, 0x6B0F,
+ 0x4653, 0x6AF2, 0x4680, 0x6AD5, 0x46AD, 0x6AB7, 0x46D9, 0x6A99, 0x4706, 0x6A7C,
+ 0x4733, 0x6A5E, 0x475F, 0x6A40, 0x478C, 0x6A22, 0x47B8, 0x6A04, 0x47E4, 0x69E6,
+ 0x4811, 0x69C8, 0x483D, 0x69AA, 0x4869, 0x698B, 0x4896, 0x696D, 0x48C2, 0x694F,
+ 0x48EE, 0x6930, 0x491A, 0x6911, 0x4946, 0x68F3, 0x4972, 0x68D4, 0x499E, 0x68B5,
+ 0x49C9, 0x6896, 0x49F5, 0x6877, 0x4A21, 0x6858, 0x4A4D, 0x6839, 0x4A78, 0x681A,
+ 0x4AA4, 0x67FB, 0x4ACF, 0x67DC, 0x4AFB, 0x67BC, 0x4B26, 0x679D, 0x4B52, 0x677D,
+ 0x4B7D, 0x675E, 0x4BA8, 0x673E, 0x4BD3, 0x671E, 0x4BFF, 0x66FF, 0x4C2A, 0x66DF,
+ 0x4C55, 0x66BF, 0x4C80, 0x669F, 0x4CAB, 0x667F, 0x4CD6, 0x665E, 0x4D01, 0x663E,
+ 0x4D2B, 0x661E, 0x4D56, 0x65FE, 0x4D81, 0x65DD, 0x4DAB, 0x65BD, 0x4DD6, 0x659C,
+ 0x4E01, 0x657B, 0x4E2B, 0x655B, 0x4E55, 0x653A, 0x4E80, 0x6519, 0x4EAA, 0x64F8,
+ 0x4ED4, 0x64D7, 0x4EFF, 0x64B6, 0x4F29, 0x6495, 0x4F53, 0x6474, 0x4F7D, 0x6453,
+ 0x4FA7, 0x6431, 0x4FD1, 0x6410, 0x4FFB, 0x63EE, 0x5025, 0x63CD, 0x504E, 0x63AB,
+ 0x5078, 0x638A, 0x50A2, 0x6368, 0x50CB, 0x6346, 0x50F5, 0x6324, 0x511E, 0x6302,
+ 0x5148, 0x62E0, 0x5171, 0x62BE, 0x519B, 0x629C, 0x51C4, 0x627A, 0x51ED, 0x6257,
+ 0x5216, 0x6235, 0x523F, 0x6213, 0x5268, 0x61F0, 0x5291, 0x61CE, 0x52BA, 0x61AB,
+ 0x52E3, 0x6188, 0x530C, 0x6166, 0x5335, 0x6143, 0x535E, 0x6120, 0x5386, 0x60FD,
+ 0x53AF, 0x60DA, 0x53D7, 0x60B7, 0x5400, 0x6094, 0x5428, 0x6070, 0x5451, 0x604D,
+ 0x5479, 0x602A, 0x54A1, 0x6006, 0x54C9, 0x5FE3, 0x54F2, 0x5FBF, 0x551A, 0x5F9C,
+ 0x5542, 0x5F78, 0x556A, 0x5F54, 0x5591, 0x5F31, 0x55B9, 0x5F0D, 0x55E1, 0x5EE9,
+ 0x5609, 0x5EC5, 0x5630, 0x5EA1, 0x5658, 0x5E7D, 0x5680, 0x5E58, 0x56A7, 0x5E34,
+ 0x56CF, 0x5E10, 0x56F6, 0x5DEB, 0x571D, 0x5DC7, 0x5745, 0x5DA2, 0x576C, 0x5D7E,
+ 0x5793, 0x5D59, 0x57BA, 0x5D34, 0x57E1, 0x5D10, 0x5808, 0x5CEB, 0x582F, 0x5CC6,
+ 0x5856, 0x5CA1, 0x587C, 0x5C7C, 0x58A3, 0x5C57, 0x58CA, 0x5C32, 0x58F0, 0x5C0C,
+ 0x5917, 0x5BE7, 0x593D, 0x5BC2, 0x5964, 0x5B9C, 0x598A, 0x5B77, 0x59B0, 0x5B51,
+ 0x59D7, 0x5B2C, 0x59FD, 0x5B06, 0x5A23, 0x5AE0, 0x5A49, 0x5ABB, 0x5A6F, 0x5A95
+ },
+ // const WORD16 only_long_window_kbd_960[960] =
+ {
+ 0x000A, 0x7FFF, 0x000F, 0x7FFF, 0x0013, 0x7FFF, 0x0016, 0x7FFF, 0x001A, 0x7FFF,
+ 0x001D, 0x7FFF, 0x0021, 0x7FFF, 0x0025, 0x7FFF, 0x0028, 0x7FFF, 0x002C, 0x7FFF,
+ 0x002F, 0x7FFF, 0x0033, 0x7FFF, 0x0037, 0x7FFF, 0x003B, 0x7FFF, 0x003F, 0x7FFF,
+ 0x0043, 0x7FFF, 0x0047, 0x7FFF, 0x004B, 0x7FFF, 0x0050, 0x7FFF, 0x0054, 0x7FFF,
+ 0x0059, 0x7FFF, 0x005D, 0x7FFF, 0x0062, 0x7FFF, 0x0067, 0x7FFF, 0x006C, 0x7FFF,
+ 0x0071, 0x7FFF, 0x0076, 0x7FFF, 0x007B, 0x7FFF, 0x0080, 0x7FFF, 0x0086, 0x7FFF,
+ 0x008C, 0x7FFF, 0x0091, 0x7FFF, 0x0097, 0x7FFF, 0x009D, 0x7FFF, 0x00A3, 0x7FFF,
+ 0x00A9, 0x7FFF, 0x00B0, 0x7FFF, 0x00B6, 0x7FFE, 0x00BD, 0x7FFE, 0x00C3, 0x7FFE,
+ 0x00CA, 0x7FFE, 0x00D1, 0x7FFE, 0x00D8, 0x7FFE, 0x00E0, 0x7FFE, 0x00E7, 0x7FFE,
+ 0x00EF, 0x7FFE, 0x00F6, 0x7FFE, 0x00FE, 0x7FFE, 0x0106, 0x7FFE, 0x010E, 0x7FFE,
+ 0x0116, 0x7FFE, 0x011F, 0x7FFE, 0x0127, 0x7FFE, 0x0130, 0x7FFE, 0x0139, 0x7FFE,
+ 0x0142, 0x7FFD, 0x014B, 0x7FFD, 0x0154, 0x7FFD, 0x015E, 0x7FFD, 0x0167, 0x7FFD,
+ 0x0171, 0x7FFD, 0x017B, 0x7FFD, 0x0185, 0x7FFD, 0x018F, 0x7FFD, 0x019A, 0x7FFC,
+ 0x01A4, 0x7FFC, 0x01AF, 0x7FFC, 0x01BA, 0x7FFC, 0x01C5, 0x7FFC, 0x01D0, 0x7FFC,
+ 0x01DC, 0x7FFC, 0x01E7, 0x7FFB, 0x01F3, 0x7FFB, 0x01FF, 0x7FFB, 0x020B, 0x7FFB,
+ 0x0218, 0x7FFB, 0x0224, 0x7FFA, 0x0231, 0x7FFA, 0x023E, 0x7FFA, 0x024B, 0x7FFA,
+ 0x0258, 0x7FFA, 0x0265, 0x7FF9, 0x0273, 0x7FF9, 0x0281, 0x7FF9, 0x028F, 0x7FF8,
+ 0x029D, 0x7FF8, 0x02AC, 0x7FF8, 0x02BA, 0x7FF8, 0x02C9, 0x7FF7, 0x02D8, 0x7FF7,
+ 0x02E7, 0x7FF7, 0x02F7, 0x7FF6, 0x0306, 0x7FF6, 0x0316, 0x7FF5, 0x0326, 0x7FF5,
+ 0x0336, 0x7FF5, 0x0347, 0x7FF4, 0x0357, 0x7FF4, 0x0368, 0x7FF3, 0x0379, 0x7FF3,
+ 0x038A, 0x7FF2, 0x039C, 0x7FF2, 0x03AE, 0x7FF1, 0x03BF, 0x7FF1, 0x03D2, 0x7FF0,
+ 0x03E4, 0x7FF0, 0x03F7, 0x7FEF, 0x0409, 0x7FEF, 0x041C, 0x7FEE, 0x0430, 0x7FED,
+ 0x0443, 0x7FED, 0x0457, 0x7FEC, 0x046B, 0x7FEB, 0x047F, 0x7FEB, 0x0493, 0x7FEA,
+ 0x04A8, 0x7FE9, 0x04BD, 0x7FE9, 0x04D2, 0x7FE8, 0x04E7, 0x7FE7, 0x04FD, 0x7FE6,
+ 0x0513, 0x7FE5, 0x0529, 0x7FE4, 0x053F, 0x7FE3, 0x0555, 0x7FE3, 0x056C, 0x7FE2,
+ 0x0583, 0x7FE1, 0x059A, 0x7FE0, 0x05B2, 0x7FDF, 0x05CA, 0x7FDD, 0x05E2, 0x7FDC,
+ 0x05FA, 0x7FDB, 0x0612, 0x7FDA, 0x062B, 0x7FD9, 0x0644, 0x7FD8, 0x065D, 0x7FD6,
+ 0x0677, 0x7FD5, 0x0690, 0x7FD4, 0x06AA, 0x7FD3, 0x06C5, 0x7FD1, 0x06DF, 0x7FD0,
+ 0x06FA, 0x7FCE, 0x0715, 0x7FCD, 0x0730, 0x7FCB, 0x074C, 0x7FCA, 0x0768, 0x7FC8,
+ 0x0784, 0x7FC6, 0x07A0, 0x7FC5, 0x07BD, 0x7FC3, 0x07D9, 0x7FC1, 0x07F6, 0x7FC0,
+ 0x0814, 0x7FBE, 0x0832, 0x7FBC, 0x084F, 0x7FBA, 0x086E, 0x7FB8, 0x088C, 0x7FB6,
+ 0x08AB, 0x7FB4, 0x08CA, 0x7FB2, 0x08E9, 0x7FB0, 0x0909, 0x7FAD, 0x0928, 0x7FAB,
+ 0x0949, 0x7FA9, 0x0969, 0x7FA6, 0x098A, 0x7FA4, 0x09AA, 0x7FA1, 0x09CC, 0x7F9F,
+ 0x09ED, 0x7F9C, 0x0A0F, 0x7F9A, 0x0A31, 0x7F97, 0x0A53, 0x7F94, 0x0A76, 0x7F91,
+ 0x0A99, 0x7F8F, 0x0ABC, 0x7F8C, 0x0ADF, 0x7F89, 0x0B03, 0x7F86, 0x0B27, 0x7F82,
+ 0x0B4B, 0x7F7F, 0x0B70, 0x7F7C, 0x0B94, 0x7F79, 0x0BBA, 0x7F75, 0x0BDF, 0x7F72,
+ 0x0C05, 0x7F6E, 0x0C2B, 0x7F6B, 0x0C51, 0x7F67, 0x0C77, 0x7F63, 0x0C9E, 0x7F5F,
+ 0x0CC5, 0x7F5B, 0x0CED, 0x7F58, 0x0D14, 0x7F53, 0x0D3C, 0x7F4F, 0x0D65, 0x7F4B,
+ 0x0D8D, 0x7F47, 0x0DB6, 0x7F42, 0x0DDF, 0x7F3E, 0x0E08, 0x7F39, 0x0E32, 0x7F35,
+ 0x0E5C, 0x7F30, 0x0E86, 0x7F2B, 0x0EB1, 0x7F26, 0x0EDC, 0x7F21, 0x0F07, 0x7F1C,
+ 0x0F32, 0x7F17, 0x0F5E, 0x7F12, 0x0F8A, 0x7F0D, 0x0FB6, 0x7F07, 0x0FE3, 0x7F02,
+ 0x1010, 0x7EFC, 0x103D, 0x7EF6, 0x106A, 0x7EF0, 0x1098, 0x7EEA, 0x10C6, 0x7EE4,
+ 0x10F4, 0x7EDE, 0x1123, 0x7ED8, 0x1152, 0x7ED2, 0x1181, 0x7ECB, 0x11B0, 0x7EC5,
+ 0x11E0, 0x7EBE, 0x1210, 0x7EB7, 0x1240, 0x7EB0, 0x1271, 0x7EA9, 0x12A2, 0x7EA2,
+ 0x12D3, 0x7E9B, 0x1304, 0x7E93, 0x1336, 0x7E8C, 0x1368, 0x7E84, 0x139A, 0x7E7C,
+ 0x13CD, 0x7E75, 0x1400, 0x7E6D, 0x1433, 0x7E64, 0x1466, 0x7E5C, 0x149A, 0x7E54,
+ 0x14CE, 0x7E4B, 0x1502, 0x7E43, 0x1537, 0x7E3A, 0x156C, 0x7E31, 0x15A1, 0x7E28,
+ 0x15D6, 0x7E1F, 0x160C, 0x7E15, 0x1642, 0x7E0C, 0x1678, 0x7E02, 0x16AE, 0x7DF8,
+ 0x16E5, 0x7DEF, 0x171C, 0x7DE4, 0x1754, 0x7DDA, 0x178B, 0x7DD0, 0x17C3, 0x7DC5,
+ 0x17FB, 0x7DBB, 0x1833, 0x7DB0, 0x186C, 0x7DA5, 0x18A5, 0x7D9A, 0x18DE, 0x7D8F,
+ 0x1918, 0x7D83, 0x1952, 0x7D78, 0x198C, 0x7D6C, 0x19C6, 0x7D60, 0x1A00, 0x7D54,
+ 0x1A3B, 0x7D48, 0x1A76, 0x7D3B, 0x1AB1, 0x7D2F, 0x1AED, 0x7D22, 0x1B29, 0x7D15,
+ 0x1B65, 0x7D08, 0x1BA1, 0x7CFA, 0x1BDE, 0x7CED, 0x1C1B, 0x7CDF, 0x1C58, 0x7CD2,
+ 0x1C95, 0x7CC4, 0x1CD3, 0x7CB5, 0x1D11, 0x7CA7, 0x1D4F, 0x7C98, 0x1D8D, 0x7C8A,
+ 0x1DCC, 0x7C7B, 0x1E0B, 0x7C6C, 0x1E4A, 0x7C5C, 0x1E89, 0x7C4D, 0x1EC9, 0x7C3D,
+ 0x1F08, 0x7C2D, 0x1F48, 0x7C1D, 0x1F89, 0x7C0D, 0x1FC9, 0x7BFD, 0x200A, 0x7BEC,
+ 0x204B, 0x7BDB, 0x208C, 0x7BCA, 0x20CE, 0x7BB9, 0x210F, 0x7BA7, 0x2151, 0x7B95,
+ 0x2193, 0x7B84, 0x21D6, 0x7B71, 0x2218, 0x7B5F, 0x225B, 0x7B4D, 0x229E, 0x7B3A,
+ 0x22E1, 0x7B27, 0x2325, 0x7B14, 0x2369, 0x7B00, 0x23AC, 0x7AED, 0x23F1, 0x7AD9,
+ 0x2435, 0x7AC5, 0x2479, 0x7AB0, 0x24BE, 0x7A9C, 0x2503, 0x7A87, 0x2548, 0x7A72,
+ 0x258D, 0x7A5D, 0x25D3, 0x7A48, 0x2619, 0x7A32, 0x265F, 0x7A1C, 0x26A5, 0x7A06,
+ 0x26EB, 0x79F0, 0x2731, 0x79D9, 0x2778, 0x79C2, 0x27BF, 0x79AB, 0x2806, 0x7994,
+ 0x284D, 0x797C, 0x2895, 0x7965, 0x28DC, 0x794C, 0x2924, 0x7934, 0x296C, 0x791C,
+ 0x29B4, 0x7903, 0x29FC, 0x78EA, 0x2A45, 0x78D1, 0x2A8E, 0x78B7, 0x2AD6, 0x789D,
+ 0x2B1F, 0x7883, 0x2B68, 0x7869, 0x2BB2, 0x784F, 0x2BFB, 0x7834, 0x2C45, 0x7819,
+ 0x2C8E, 0x77FE, 0x2CD8, 0x77E2, 0x2D22, 0x77C6, 0x2D6D, 0x77AA, 0x2DB7, 0x778E,
+ 0x2E01, 0x7771, 0x2E4C, 0x7754, 0x2E97, 0x7737, 0x2EE2, 0x771A, 0x2F2D, 0x76FC,
+ 0x2F78, 0x76DE, 0x2FC3, 0x76C0, 0x300F, 0x76A2, 0x305A, 0x7683, 0x30A6, 0x7664,
+ 0x30F2, 0x7645, 0x313D, 0x7625, 0x318A, 0x7606, 0x31D6, 0x75E5, 0x3222, 0x75C5,
+ 0x326E, 0x75A4, 0x32BB, 0x7584, 0x3307, 0x7562, 0x3354, 0x7541, 0x33A1, 0x751F,
+ 0x33EE, 0x74FD, 0x343B, 0x74DB, 0x3488, 0x74B8, 0x34D5, 0x7496, 0x3522, 0x7472,
+ 0x356F, 0x744F, 0x35BD, 0x742B, 0x360A, 0x7407, 0x3658, 0x73E3, 0x36A5, 0x73BF,
+ 0x36F3, 0x739A, 0x3741, 0x7375, 0x378F, 0x734F, 0x37DD, 0x732A, 0x382B, 0x7304,
+ 0x3879, 0x72DD, 0x38C7, 0x72B7, 0x3915, 0x7290, 0x3963, 0x7269, 0x39B1, 0x7242,
+ 0x3A00, 0x721A, 0x3A4E, 0x71F2, 0x3A9C, 0x71CA, 0x3AEB, 0x71A1, 0x3B39, 0x7178,
+ 0x3B88, 0x714F, 0x3BD7, 0x7126, 0x3C25, 0x70FC, 0x3C74, 0x70D2, 0x3CC2, 0x70A8,
+ 0x3D11, 0x707D, 0x3D60, 0x7052, 0x3DAE, 0x7027, 0x3DFD, 0x6FFC, 0x3E4C, 0x6FD0,
+ 0x3E9B, 0x6FA4, 0x3EEA, 0x6F78, 0x3F38, 0x6F4B, 0x3F87, 0x6F1E, 0x3FD6, 0x6EF1,
+ 0x4025, 0x6EC4, 0x4073, 0x6E96, 0x40C2, 0x6E68, 0x4111, 0x6E39, 0x4160, 0x6E0B,
+ 0x41AF, 0x6DDC, 0x41FD, 0x6DAD, 0x424C, 0x6D7D, 0x429B, 0x6D4D, 0x42E9, 0x6D1D,
+ 0x4338, 0x6CED, 0x4387, 0x6CBC, 0x43D5, 0x6C8B, 0x4424, 0x6C5A, 0x4472, 0x6C28,
+ 0x44C1, 0x6BF7, 0x450F, 0x6BC4, 0x455E, 0x6B92, 0x45AC, 0x6B5F, 0x45FA, 0x6B2C,
+ 0x4648, 0x6AF9, 0x4697, 0x6AC6, 0x46E5, 0x6A92, 0x4733, 0x6A5E, 0x4781, 0x6A29,
+ 0x47CF, 0x69F5, 0x481D, 0x69C0, 0x486B, 0x698A, 0x48B8, 0x6955, 0x4906, 0x691F,
+ 0x4954, 0x68E9, 0x49A1, 0x68B3, 0x49EF, 0x687C, 0x4A3C, 0x6845, 0x4A89, 0x680E,
+ 0x4AD7, 0x67D6, 0x4B24, 0x679F, 0x4B71, 0x6767, 0x4BBE, 0x672E, 0x4C0B, 0x66F6,
+ 0x4C57, 0x66BD, 0x4CA4, 0x6684, 0x4CF0, 0x664A, 0x4D3D, 0x6611, 0x4D89, 0x65D7,
+ 0x4DD5, 0x659D, 0x4E21, 0x6562, 0x4E6D, 0x6527, 0x4EB9, 0x64EC, 0x4F05, 0x64B1,
+ 0x4F51, 0x6476, 0x4F9C, 0x643A, 0x4FE8, 0x63FE, 0x5033, 0x63C1, 0x507E, 0x6385,
+ 0x50C9, 0x6348, 0x5114, 0x630B, 0x515E, 0x62CE, 0x51A9, 0x6290, 0x51F3, 0x6252,
+ 0x523E, 0x6214, 0x5288, 0x61D6, 0x52D2, 0x6197, 0x531C, 0x6158, 0x5365, 0x6119,
+ 0x53AF, 0x60DA, 0x53F8, 0x609A, 0x5441, 0x605B, 0x548A, 0x601B, 0x54D3, 0x5FDA,
+ 0x551C, 0x5F9A, 0x5564, 0x5F59, 0x55AD, 0x5F18, 0x55F5, 0x5ED7, 0x563D, 0x5E95,
+ 0x5685, 0x5E53, 0x56CD, 0x5E12, 0x5714, 0x5DCF, 0x575B, 0x5D8D, 0x57A3, 0x5D4A,
+ 0x57E9, 0x5D08, 0x5830, 0x5CC4, 0x5877, 0x5C81, 0x58BD, 0x5C3E, 0x5903, 0x5BFA,
+ 0x5949, 0x5BB6, 0x598F, 0x5B72, 0x59D5, 0x5B2E, 0x5A1A, 0x5AE9, 0x5A5F, 0x5AA4
+ },
+
+ // const WORD16 only_short_window_sine_120[120] =
+ {
+ 0x00D6, 0x7FFE, 0x0283, 0x7FF9, 0x0430, 0x7FED, 0x05DD, 0x7FDD, 0x0789, 0x7FC6,
+ 0x0935, 0x7FAA, 0x0AE1, 0x7F88, 0x0C8C, 0x7F61, 0x0E36, 0x7F34, 0x0FE0, 0x7F02,
+ 0x1189, 0x7ECA, 0x1332, 0x7E8C, 0x14DA, 0x7E49, 0x1680, 0x7E01, 0x1826, 0x7DB3,
+ 0x19CB, 0x7D5F, 0x1B6E, 0x7D06, 0x1D11, 0x7CA7, 0x1EB2, 0x7C43, 0x2051, 0x7BD9,
+ 0x21F0, 0x7B6A, 0x238D, 0x7AF6, 0x2528, 0x7A7C, 0x26C1, 0x79FD, 0x2859, 0x7978,
+ 0x29EF, 0x78EE, 0x2B84, 0x785F, 0x2D16, 0x77CB, 0x2EA7, 0x7731, 0x3035, 0x7692,
+ 0x31C1, 0x75EE, 0x334B, 0x7545, 0x34D3, 0x7496, 0x3659, 0x73E3, 0x37DC, 0x732A,
+ 0x395D, 0x726C, 0x3ADB, 0x71AA, 0x3C56, 0x70E2, 0x3DCF, 0x7015, 0x3F45, 0x6F44,
+ 0x40B9, 0x6E6D, 0x4229, 0x6D92, 0x4397, 0x6CB2, 0x4502, 0x6BCD, 0x466A, 0x6AE3,
+ 0x47CE, 0x69F5, 0x4930, 0x6902, 0x4A8E, 0x680B, 0x4BE9, 0x670E, 0x4D41, 0x660E,
+ 0x4E95, 0x6509, 0x4FE6, 0x63FF, 0x5133, 0x62F1, 0x527D, 0x61DF, 0x53C3, 0x60C8,
+ 0x5506, 0x5FAE, 0x5644, 0x5E8F, 0x577F, 0x5D6B, 0x58B6, 0x5C44, 0x59EA, 0x5B19
+ },
+
+ // const WORD16 only_short_window_kbd_120[120] =
+ {
+ 0x0001, 0x7FFF, 0x0004, 0x7FFF, 0x0008, 0x7FFF, 0x000E, 0x7FFF, 0x0016, 0x7FFF,
+ 0x0021, 0x7FFF, 0x0030, 0x7FFF, 0x0042, 0x7FFF, 0x0059, 0x7FFF, 0x0075, 0x7FFF,
+ 0x0097, 0x7FFF, 0x00C1, 0x7FFE, 0x00F2, 0x7FFE, 0x012D, 0x7FFE, 0x0171, 0x7FFD,
+ 0x01C1, 0x7FFC, 0x021D, 0x7FFB, 0x0286, 0x7FF9, 0x02FE, 0x7FF6, 0x0385, 0x7FF3,
+ 0x041E, 0x7FEE, 0x04C9, 0x7FE8, 0x0586, 0x7FE0, 0x0658, 0x7FD7, 0x0740, 0x7FCA,
+ 0x083E, 0x7FBB, 0x0953, 0x7FA8, 0x0A80, 0x7F91, 0x0BC7, 0x7F74, 0x0D27, 0x7F52,
+ 0x0EA0, 0x7F28, 0x1035, 0x7EF7, 0x11E3, 0x7EBD, 0x13AD, 0x7E7A, 0x1591, 0x7E2A,
+ 0x1790, 0x7DCF, 0x19A8, 0x7D66, 0x1BDA, 0x7CEE, 0x1E25, 0x7C65, 0x2087, 0x7BCB,
+ 0x2300, 0x7B1E, 0x258E, 0x7A5D, 0x2830, 0x7986, 0x2AE5, 0x7898, 0x2DA9, 0x7793,
+ 0x307D, 0x7675, 0x335D, 0x753D, 0x3647, 0x73EB, 0x393A, 0x727E, 0x3C33, 0x70F5,
+ 0x3F2F, 0x6F50, 0x422D, 0x6D90, 0x452A, 0x6BB4, 0x4823, 0x69BC, 0x4B16, 0x67A9,
+ 0x4E01, 0x657B, 0x50E2, 0x6334, 0x53B5, 0x60D4, 0x567A, 0x5E5D, 0x592F, 0x5BD0
+ },
+
+ // WORD16 re_arr_tab_32[480];
+ {
+ 0, 15, 30, 45, 60, 75, 90, 105, 120, 135,
+ 150, 165, 180, 195, 210, 225, 240, 255, 270, 285,
+ 300, 315, 330, 345, 360, 375, 390, 405, 420, 435,
+ 450, 465, 32, 47, 62, 77, 92, 107, 122, 137,
+ 152, 167, 182, 197, 212, 227, 242, 257, 272, 287,
+ 302, 317, 332, 347, 362, 377, 392, 407, 422, 437,
+ 452, 467, 2, 17, 64, 79, 94, 109, 124, 139,
+ 154, 169, 184, 199, 214, 229, 244, 259, 274, 289,
+ 304, 319, 334, 349, 364, 379, 394, 409, 424, 439,
+ 454, 469, 4, 19, 34, 49, 96, 111, 126, 141,
+ 156, 171, 186, 201, 216, 231, 246, 261, 276, 291,
+ 306, 321, 336, 351, 366, 381, 396, 411, 426, 441,
+ 456, 471, 6, 21, 36, 51, 66, 81, 128, 143,
+ 158, 173, 188, 203, 218, 233, 248, 263, 278, 293,
+ 308, 323, 338, 353, 368, 383, 398, 413, 428, 443,
+ 458, 473, 8, 23, 38, 53, 68, 83, 98, 113,
+ 160, 175, 190, 205, 220, 235, 250, 265, 280, 295,
+ 310, 325, 340, 355, 370, 385, 400, 415, 430, 445,
+ 460, 475, 10, 25, 40, 55, 70, 85, 100, 115,
+ 130, 145, 192, 207, 222, 237, 252, 267, 282, 297,
+ 312, 327, 342, 357, 372, 387, 402, 417, 432, 447,
+ 462, 477, 12, 27, 42, 57, 72, 87, 102, 117,
+ 132, 147, 162, 177, 224, 239, 254, 269, 284, 299,
+ 314, 329, 344, 359, 374, 389, 404, 419, 434, 449,
+ 464, 479, 14, 29, 44, 59, 74, 89, 104, 119,
+ 134, 149, 164, 179, 194, 209, 256, 271, 286, 301,
+ 316, 331, 346, 361, 376, 391, 406, 421, 436, 451,
+ 466, 1, 16, 31, 46, 61, 76, 91, 106, 121,
+ 136, 151, 166, 181, 196, 211, 226, 241, 288, 303,
+ 318, 333, 348, 363, 378, 393, 408, 423, 438, 453,
+ 468, 3, 18, 33, 48, 63, 78, 93, 108, 123,
+ 138, 153, 168, 183, 198, 213, 228, 243, 258, 273,
+ 320, 335, 350, 365, 380, 395, 410, 425, 440, 455,
+ 470, 5, 20, 35, 50, 65, 80, 95, 110, 125,
+ 140, 155, 170, 185, 200, 215, 230, 245, 260, 275,
+ 290, 305, 352, 367, 382, 397, 412, 427, 442, 457,
+ 472, 7, 22, 37, 52, 67, 82, 97, 112, 127,
+ 142, 157, 172, 187, 202, 217, 232, 247, 262, 277,
+ 292, 307, 322, 337, 384, 399, 414, 429, 444, 459,
+ 474, 9, 24, 39, 54, 69, 84, 99, 114, 129,
+ 144, 159, 174, 189, 204, 219, 234, 249, 264, 279,
+ 294, 309, 324, 339, 354, 369, 416, 431, 446, 461,
+ 476, 11, 26, 41, 56, 71, 86, 101, 116, 131,
+ 146, 161, 176, 191, 206, 221, 236, 251, 266, 281,
+ 296, 311, 326, 341, 356, 371, 386, 401, 448, 463,
+ 478, 13, 28, 43, 58, 73, 88, 103, 118, 133,
+ 148, 163, 178, 193, 208, 223, 238, 253, 268, 283,
+ 298, 313, 328, 343, 358, 373, 388, 403, 418, 433
+ },
+
+ // const WORD16 re_arr_tab_sml[FFT15 + 1] =
+ {
+ 0, 4, 8, 9, 13, 2, 3, 7,
+ 11, 12, 1, 5, 6, 10, 14, 0
+ },
+
+ // const WORD16 re_arr_tab_4[60] =
+ {
+ 0, 15, 30, 45, 4, 19, 34, 49, 8, 23,
+ 38, 53, 12, 27, 42, 57, 16, 31, 46, 1,
+ 20, 35, 50, 5, 24, 39, 54, 9, 28, 43,
+ 58, 13, 32, 47, 2, 17, 36, 51, 6, 21,
+ 40, 55, 10, 25, 44, 59, 14, 29, 48, 3,
+ 18, 33, 52, 7, 22, 37, 56, 11, 26, 41
+ },
+
+ // const WORD16 re_arr_tab_15_4[60] =
+ {
+ 0, 4, 8, 12, 16, 20, 24, 28, 32, 36,
+ 40, 44, 48, 52, 56, 1, 5, 9, 13, 17,
+ 21, 25, 29, 33, 37, 41, 45, 49, 53, 57,
+ 2, 6, 10, 14, 18, 22, 26, 30, 34, 38,
+ 42, 46, 50, 54, 58, 3, 7, 11, 15, 19,
+ 23, 27, 31, 35, 39, 43, 47, 51, 55, 59
+ },
+
+ // const WORD16 re_arr_tab_120[60] =
+ {
+ 0, 16, 32, 48, 4, 20, 36, 52, 8, 24,
+ 40, 56, 12, 28, 44, 45, 1, 17, 33, 49,
+ 5, 21, 37, 53, 9, 25, 41, 57, 13, 29,
+ 30, 46, 2, 18, 34, 50, 6, 22, 38, 54,
+ 10, 26, 42, 58, 14, 15, 31, 47, 3, 19,
+ 35, 51, 7, 23, 39, 55, 11, 27, 43, 59
+ },
+
+ // WORD16 re_arr_tab_5[FFT15 + 1] =
+ {
+ 0, 3, 6, 9, 12, 5, 8, 11,
+ 14, 2, 10, 13, 1, 4, 7, 0
+ },
+
+ // WORD16 re_arr_tab_3[FFT15 + 1] =
+ {
+ 0, 5, 10, 1, 6, 11, 2, 7,
+ 12, 3, 8, 13, 4, 9, 14, 0
+ },
+
+ // WORD16 re_arr_tab_sml_480[480] =
+ {
+ 0, 160, 320, 96, 256, 416, 192, 352,
+ 32, 288, 448, 128, 384, 64, 224, 225,
+ 385, 65, 321, 1, 161, 417, 97, 257,
+ 33, 193, 353, 129, 289, 449, 450, 130,
+ 290, 66, 226, 386, 162, 322, 2, 258,
+ 418, 98, 354, 34, 194, 195, 355, 35,
+ 291, 451, 131, 387, 67, 227, 3, 163,
+ 323, 99, 259, 419, 420, 100, 260, 36,
+ 196, 356, 132, 292, 452, 228, 388, 68,
+ 324, 4, 164, 165, 325, 5, 261, 421,
+ 101, 357, 37, 197, 453, 133, 293, 69,
+ 229, 389, 390, 70, 230, 6, 166, 326,
+ 102, 262, 422, 198, 358, 38, 294, 454,
+ 134, 135, 295, 455, 231, 391, 71, 327,
+ 7, 167, 423, 103, 263, 39, 199, 359,
+ 360, 40, 200, 456, 136, 296, 72, 232,
+ 392, 168, 328, 8, 264, 424, 104, 105,
+ 265, 425, 201, 361, 41, 297, 457, 137,
+ 393, 73, 233, 9, 169, 329, 330, 10,
+ 170, 426, 106, 266, 42, 202, 362, 138,
+ 298, 458, 234, 394, 74, 75, 235, 395,
+ 171, 331, 11, 267, 427, 107, 363, 43,
+ 203, 459, 139, 299, 300, 460, 140, 396,
+ 76, 236, 12, 172, 332, 108, 268, 428,
+ 204, 364, 44, 45, 205, 365, 141, 301,
+ 461, 237, 397, 77, 333, 13, 173, 429,
+ 109, 269, 270, 430, 110, 366, 46, 206,
+ 462, 142, 302, 78, 238, 398, 174, 334,
+ 14, 15, 175, 335, 111, 271, 431, 207,
+ 367, 47, 303, 463, 143, 399, 79, 239,
+ 240, 400, 80, 336, 16, 176, 432, 112,
+ 272, 48, 208, 368, 144, 304, 464, 465,
+ 145, 305, 81, 241, 401, 177, 337, 17,
+ 273, 433, 113, 369, 49, 209, 210, 370,
+ 50, 306, 466, 146, 402, 82, 242, 18,
+ 178, 338, 114, 274, 434, 435, 115, 275,
+ 51, 211, 371, 147, 307, 467, 243, 403,
+ 83, 339, 19, 179, 180, 340, 20, 276,
+ 436, 116, 372, 52, 212, 468, 148, 308,
+ 84, 244, 404, 405, 85, 245, 21, 181,
+ 341, 117, 277, 437, 213, 373, 53, 309,
+ 469, 149, 150, 310, 470, 246, 406, 86,
+ 342, 22, 182, 438, 118, 278, 54, 214,
+ 374, 375, 55, 215, 471, 151, 311, 87,
+ 247, 407, 183, 343, 23, 279, 439, 119,
+ 120, 280, 440, 216, 376, 56, 312, 472,
+ 152, 408, 88, 248, 24, 184, 344, 345,
+ 25, 185, 441, 121, 281, 57, 217, 377,
+ 153, 313, 473, 249, 409, 89, 90, 250,
+ 410, 186, 346, 26, 282, 442, 122, 378,
+ 58, 218, 474, 154, 314, 315, 475, 155,
+ 411, 91, 251, 27, 187, 347, 123, 283,
+ 443, 219, 379, 59, 60, 220, 380, 156,
+ 316, 476, 252, 412, 92, 348, 28, 188,
+ 444, 124, 284, 285, 445, 125, 381, 61,
+ 221, 477, 157, 317, 93, 253, 413, 189,
+ 349, 29, 30, 190, 350, 126, 286, 446,
+ 222, 382, 62, 318, 478, 158, 414, 94,
+ 254, 255, 415, 95, 351, 31, 191, 447,
+ 127, 287, 63, 223, 383, 159, 319, 479
+ },
+
+ // WORD32 cosine_array_1920[960] =
+ {
+ 32767, 13, 94, 32767, 32767, 121, 201, 32767,
+ 32767, 228, 308, 32767, 32766, 335, 416, 32765,
+ 32765, 442, 523, 32764, 32763, 550, 630, 32762,
+ 32761, 657, 737, 32760, 32759, 764, 844, 32757,
+ 32756, 871, 952, 32754, 32753, 978, 1059, 32751,
+ 32750, 1086, 1166, 32747, 32746, 1193, 1273, 32743,
+ 32742, 1300, 1380, 32739, 32738, 1407, 1487, 32734,
+ 32733, 1514, 1594, 32729, 32728, 1621, 1702, 32724,
+ 32722, 1728, 1809, 32718, 32717, 1835, 1916, 32712,
+ 32710, 1942, 2023, 32706, 32704, 2049, 2130, 32699,
+ 32697, 2157, 2237, 32692, 32690, 2263, 2344, 32684,
+ 32682, 2370, 2451, 32676, 32674, 2477, 2558, 32668,
+ 32666, 2584, 2664, 32659, 32657, 2691, 2771, 32651,
+ 32648, 2798, 2878, 32641, 32639, 2905, 2985, 32632,
+ 32629, 3012, 3092, 32622, 32619, 3118, 3198, 32612,
+ 32609, 3225, 3305, 32601, 32598, 3332, 3412, 32590,
+ 32587, 3439, 3518, 32579, 32576, 3545, 3625, 32567,
+ 32564, 3652, 3732, 32555, 32552, 3758, 3838, 32542,
+ 32539, 3865, 3945, 32530, 32526, 3971, 4051, 32517,
+ 32513, 4078, 4157, 32503, 32500, 4184, 4264, 32489,
+ 32486, 4290, 4370, 32475, 32472, 4397, 4476, 32461,
+ 32457, 4503, 4583, 32446, 32442, 4609, 4689, 32431,
+ 32427, 4715, 4795, 32415, 32411, 4821, 4901, 32399,
+ 32395, 4927, 5007, 32383, 32379, 5033, 5113, 32367,
+ 32362, 5139, 5219, 32350, 32345, 5245, 5325, 32333,
+ 32328, 5351, 5430, 32315, 32310, 5457, 5536, 32297,
+ 32292, 5562, 5642, 32279, 32274, 5668, 5747, 32260,
+ 32255, 5774, 5853, 32241, 32236, 5879, 5958, 32222,
+ 32217, 5985, 6064, 32202, 32197, 6090, 6169, 32182,
+ 32177, 6195, 6274, 32162, 32157, 6301, 6380, 32141,
+ 32136, 6406, 6485, 32120, 32115, 6511, 6590, 32099,
+ 32093, 6616, 6695, 32077, 32071, 6721, 6800, 32055,
+ 32049, 6826, 6905, 32032, 32027, 6931, 7009, 32010,
+ 32004, 7036, 7114, 31986, 31981, 7140, 7219, 31963,
+ 31957, 7245, 7323, 31939, 31933, 7349, 7428, 31915,
+ 31909, 7454, 7532, 31891, 31884, 7558, 7637, 31866,
+ 31859, 7663, 7741, 31841, 31834, 7767, 7845, 31815,
+ 31809, 7871, 7949, 31789, 31783, 7975, 8053, 31763,
+ 31756, 8079, 8157, 31737, 31730, 8183, 8261, 31710,
+ 31703, 8287, 8364, 31682, 31676, 8390, 8468, 31655,
+ 31648, 8494, 8572, 31627, 31620, 8597, 8675, 31599,
+ 31592, 8701, 8778, 31570, 31563, 8804, 8882, 31541,
+ 31534, 8907, 8985, 31512, 31505, 9011, 9088, 31483,
+ 31475, 9114, 9191, 31453, 31445, 9217, 9294, 31422,
+ 31415, 9319, 9397, 31392, 31384, 9422, 9499, 31361,
+ 31353, 9525, 9602, 31330, 31322, 9627, 9704, 31298,
+ 31290, 9730, 9807, 31266, 31258, 9832, 9909, 31234,
+ 31226, 9934, 10011, 31201, 31193, 10037, 10113, 31168,
+ 31160, 10139, 10215, 31135, 31127, 10241, 10317, 31102,
+ 31093, 10342, 10419, 31068, 31059, 10444, 10520, 31033,
+ 31025, 10546, 10622, 30999, 30990, 10647, 10723, 30964,
+ 30955, 10748, 10824, 30929, 30920, 10850, 10926, 30893,
+ 30884, 10951, 11027, 30857, 30848, 11052, 11128, 30821,
+ 30812, 11153, 11228, 30784, 30775, 11253, 11329, 30747,
+ 30738, 11354, 11430, 30710, 30701, 11455, 11530, 30672,
+ 30663, 11555, 11630, 30635, 30625, 11655, 11730, 30596,
+ 30587, 11756, 11831, 30558, 30548, 11856, 11930, 30519,
+ 30509, 11955, 12030, 30480, 30470, 12055, 12130, 30440,
+ 30430, 12155, 12230, 30400, 30390, 12254, 12329, 30360,
+ 30350, 12354, 12428, 30320, 30309, 12453, 12527, 30279,
+ 30269, 12552, 12626, 30238, 30227, 12651, 12725, 30196,
+ 30186, 12750, 12824, 30154, 30144, 12849, 12923, 30112,
+ 30102, 12947, 13021, 30070, 30059, 13046, 13119, 30027,
+ 30016, 13144, 13218, 29984, 29973, 13242, 13316, 29941,
+ 29930, 13340, 13414, 29897, 29886, 13438, 13511, 29853,
+ 29842, 13536, 13609, 29808, 29797, 13633, 13706, 29764,
+ 29752, 13731, 13804, 29719, 29707, 13828, 13901, 29673,
+ 29662, 13925, 13998, 29628, 29616, 14022, 14095, 29582,
+ 29570, 14119, 14192, 29535, 29524, 14216, 14288, 29489,
+ 29477, 14312, 14385, 29442, 29430, 14409, 14481, 29395,
+ 29383, 14505, 14577, 29347, 29335, 14601, 14673, 29299,
+ 29287, 14697, 14769, 29251, 29239, 14793, 14864, 29203,
+ 29190, 14888, 14960, 29154, 29142, 14984, 15055, 29105,
+ 29092, 15079, 15150, 29055, 29043, 15174, 15245, 29006,
+ 28993, 15269, 15340, 28955, 28943, 15364, 15435, 28905,
+ 28892, 15459, 15529, 28854, 28842, 15553, 15624, 28803,
+ 28791, 15647, 15718, 28752, 28739, 15741, 15812, 28701,
+ 28688, 15835, 15906, 28649, 28636, 15929, 15999, 28596,
+ 28583, 16023, 16093, 28544, 28531, 16116, 16186, 28491,
+ 28478, 16210, 16279, 28438, 28425, 16303, 16372, 28385,
+ 28371, 16396, 16465, 28331, 28317, 16488, 16558, 28277,
+ 28263, 16581, 16650, 28223, 28209, 16673, 16743, 28168,
+ 28154, 16766, 16835, 28113, 28099, 16858, 16927, 28058,
+ 28044, 16949, 17018, 28002, 27988, 17041, 17110, 27946,
+ 27932, 17133, 17201, 27890, 27876, 17224, 17292, 27834,
+ 27820, 17315, 17383, 27777, 27763, 17406, 17474, 27720,
+ 27706, 17497, 17565, 27663, 27648, 17587, 17655, 27605,
+ 27591, 17678, 17745, 27547, 27533, 17768, 17835, 27489,
+ 27474, 17858, 17925, 27430, 27416, 17948, 18015, 27372,
+ 27357, 18037, 18104, 27312, 27298, 18127, 18194, 27253,
+ 27238, 18216, 18283, 27193, 27178, 18305, 18372, 27133,
+ 27118, 18394, 18460, 27073, 27058, 18483, 18549, 27013,
+ 26997, 18571, 18637, 26952, 26936, 18659, 18725, 26891,
+ 26875, 18747, 18813, 26829, 26814, 18835, 18901, 26767,
+ 26752, 18923, 18988, 26705, 26690, 19010, 19076, 26643,
+ 26628, 19098, 19163, 26581, 26565, 19185, 19250, 26518,
+ 26502, 19271, 19336, 26455, 26439, 19358, 19423, 26391,
+ 26375, 19444, 19509, 26327, 26312, 19531, 19595, 26264,
+ 26247, 19617, 19681, 26199, 26183, 19702, 19767, 26135,
+ 26119, 19788, 19852, 26070, 26054, 19873, 19937, 26005,
+ 25988, 19959, 20022, 25939, 25923, 20043, 20107, 25874,
+ 25857, 20128, 20192, 25808, 25791, 20213, 20276, 25742,
+ 25725, 20297, 20360, 25675, 25658, 20381, 20444, 25608,
+ 25592, 20465, 20528, 25541, 25524, 20549, 20611, 25474,
+ 25457, 20632, 20694, 25406, 25389, 20715, 20777, 25339,
+ 25322, 20798, 20860, 25270, 25253, 20881, 20943, 25202,
+ 25185, 20963, 21025, 25133, 25116, 21046, 21107, 25064,
+ 25047, 21128, 21189, 24995, 24978, 21210, 21271, 24926,
+ 24908, 21291, 21352, 24856, 24838, 21373, 21434, 24786,
+ 24768, 21454, 21515, 24716, 24698, 21535, 21595, 24645,
+ 24627, 21616, 21676, 24574, 24557, 21696, 21756, 24503,
+ 24485, 21776, 21836, 24432, 24414, 21856, 21916, 24360,
+ 24342, 21936, 21996, 24288, 24270, 22016, 22075, 24216,
+ 24198, 22095, 22154, 24144, 24126, 22174, 22233, 24071,
+ 24053, 22253, 22312, 23998, 23980, 22331, 22390, 23925,
+ 23907, 22410, 22468, 23852, 23834, 22488, 22546, 23778,
+ 23760, 22566, 22624, 23704, 23686, 22643, 22701, 23630,
+ 23612, 22721, 22779, 23556, 23537, 22798, 22856, 23481,
+ 23462, 22875, 22932, 23406, 23387, 22951, 23009, 23331,
+ 23312, 23028, 23085, 23256, 23237, 23104, 23161, 23180
+ },
+
+
+ // const WORD16 w_512[2 * 510] =
+ {
+ 0, 32767, 0, 32767, 0, 32767, 402, 32766, 804, 32758,
+ 1206, 32746, 804, 32758, 1608, 32729, 2411, 32679, 1206, 32746,
+ 2411, 32679, 3612, 32568, 1608, 32729, 3212, 32610, 4808, 32413,
+ 2009, 32706, 4011, 32522, 5998, 32214, 2411, 32679, 4808, 32413,
+ 7180, 31972, 2811, 32647, 5602, 32286, 8351, 31686, 3212, 32610,
+ 6393, 32138, 9512, 31357, 3612, 32568, 7180, 31972, 10660, 30986,
+ 4011, 32522, 7962, 31786, 11793, 30572, 4410, 32470, 8740, 31581,
+ 12910, 30118, 4808, 32413, 9512, 31357, 14010, 29622, 5205, 32352,
+ 10279, 31114, 15091, 29086, 5602, 32286, 11039, 30853, 16151, 28511,
+ 5998, 32214, 11793, 30572, 17190, 27897, 6393, 32138, 12540, 30274,
+ 18205, 27246, 6787, 32058, 13279, 29957, 19195, 26557, 7180, 31972,
+ 14010, 29622, 20160, 25833, 7571, 31881, 14733, 29269, 21097, 25073,
+ 7962, 31786, 15447, 28899, 22006, 24279, 8351, 31686, 16151, 28511,
+ 22884, 23453, 8740, 31581, 16846, 28106, 23732, 22595, 9127, 31471,
+ 17531, 27684, 24548, 21706, 9512, 31357, 18205, 27246, 25330, 20788,
+ 9896, 31238, 18868, 26791, 26078, 19841, 10279, 31114, 19520, 26320,
+ 26791, 18868, 10660, 30986, 20160, 25833, 27467, 17869, 11039, 30853,
+ 20788, 25330, 28106, 16846, 11417, 30715, 21403, 24812, 28707, 15800,
+ 11793, 30572, 22006, 24279, 29269, 14733, 12167, 30425, 22595, 23732,
+ 29792, 13646, 12540, 30274, 23170, 23170, 30274, 12540, 12910, 30118,
+ 23732, 22595, 30715, 11417, 13279, 29957, 24279, 22006, 31114, 10279,
+ 13646, 29792, 24812, 21403, 31471, 9127, 14010, 29622, 25330, 20788,
+ 31786, 7962, 14373, 29448, 25833, 20160, 32058, 6787, 14733, 29269,
+ 26320, 19520, 32286, 5602, 15091, 29086, 26791, 18868, 32470, 4410,
+ 15447, 28899, 27246, 18205, 32610, 3212, 15800, 28707, 27684, 17531,
+ 32706, 2009, 16151, 28511, 28106, 16846, 32758, 804, 16500, 28311,
+ 28511, 16151, 32766, -402, 16846, 28106, 28899, 15447, 32729, -1608,
+ 17190, 27897, 29269, 14733, 32647, -2811, 17531, 27684, 29622, 14010,
+ 32522, -4011, 17869, 27467, 29957, 13279, 32352, -5205, 18205, 27246,
+ 30274, 12540, 32138, -6393, 18538, 27020, 30572, 11793, 31881, -7571,
+ 18868, 26791, 30853, 11039, 31581, -8740, 19195, 26557, 31114, 10279,
+ 31238, -9896, 19520, 26320, 31357, 9512, 30853, -11039, 19841, 26078,
+ 31581, 8740, 30425, -12167, 20160, 25833, 31786, 7962, 29957, -13279,
+ 20475, 25583, 31972, 7180, 29448, -14373, 20788, 25330, 32138, 6393,
+ 28899, -15447, 21097, 25073, 32286, 5602, 28311, -16500, 21403, 24812,
+ 32413, 4808, 27684, -17531, 21706, 24548, 32522, 4011, 27020, -18538,
+ 22006, 24279, 32610, 3212, 26320, -19520, 22302, 24008, 32679, 2411,
+ 25583, -20475, 22595, 23732, 32729, 1608, 24812, -21403, 22884, 23453,
+ 32758, 804, 24008, -22302, 23170, 23170, 32767, 0, 23170, -23170,
+ 23453, 22884, 32758, -804, 22302, -24008, 23732, 22595, 32729, -1608,
+ 21403, -24812, 24008, 22302, 32679, -2411, 20475, -25583, 24279, 22006,
+ 32610, -3212, 19520, -26320, 24548, 21706, 32522, -4011, 18538, -27020,
+ 24812, 21403, 32413, -4808, 17531, -27684, 25073, 21097, 32286, -5602,
+ 16500, -28311, 25330, 20788, 32138, -6393, 15447, -28899, 25583, 20475,
+ 31972, -7180, 14373, -29448, 25833, 20160, 31786, -7962, 13279, -29957,
+ 26078, 19841, 31581, -8740, 12167, -30425, 26320, 19520, 31357, -9512,
+ 11039, -30853, 26557, 19195, 31114, -10279, 9896, -31238, 26791, 18868,
+ 30853, -11039, 8740, -31581, 27020, 18538, 30572, -11793, 7571, -31881,
+ 27246, 18205, 30274, -12540, 6393, -32138, 27467, 17869, 29957, -13279,
+ 5205, -32352, 27684, 17531, 29622, -14010, 4011, -32522, 27897, 17190,
+ 29269, -14733, 2811, -32647, 28106, 16846, 28899, -15447, 1608, -32729,
+ 28311, 16500, 28511, -16151, 402, -32766, 28511, 16151, 28106, -16846,
+ - 804, -32758, 28707, 15800, 27684, -17531, -2009, -32706, 28899, 15447,
+ 27246, -18205, -3212, -32610, 29086, 15091, 26791, -18868, -4410, -32470,
+ 29269, 14733, 26320, -19520, -5602, -32286, 29448, 14373, 25833, -20160,
+ - 6787, -32058, 29622, 14010, 25330, -20788, -7962, -31786, 29792, 13646,
+ 24812, -21403, -9127, -31471, 29957, 13279, 24279, -22006, -10279, -31114,
+ 30118, 12910, 23732, -22595, -11417, -30715, 30274, 12540, 23170, -23170,
+ - 12540, -30274, 30425, 12167, 22595, -23732, -13646, -29792, 30572, 11793,
+ 22006, -24279, -14733, -29269, 30715, 11417, 21403, -24812, -15800, -28707,
+ 30853, 11039, 20788, -25330, -16846, -28106, 30986, 10660, 20160, -25833,
+ - 17869, -27467, 31114, 10279, 19520, -26320, -18868, -26791, 31238, 9896,
+ 18868, -26791, -19841, -26078, 31357, 9512, 18205, -27246, -20788, -25330,
+ 31471, 9127, 17531, -27684, -21706, -24548, 31581, 8740, 16846, -28106,
+ - 22595, -23732, 31686, 8351, 16151, -28511, -23453, -22884, 31786, 7962,
+ 15447, -28899, -24279, -22006, 31881, 7571, 14733, -29269, -25073, -21097,
+ 31972, 7180, 14010, -29622, -25833, -20160, 32058, 6787, 13279, -29957,
+ - 26557, -19195, 32138, 6393, 12540, -30274, -27246, -18205, 32214, 5998,
+ 11793, -30572, -27897, -17190, 32286, 5602, 11039, -30853, -28511, -16151,
+ 32352, 5205, 10279, -31114, -29086, -15091, 32413, 4808, 9512, -31357,
+ - 29622, -14010, 32470, 4410, 8740, -31581, -30118, -12910, 32522, 4011,
+ 7962, -31786, -30572, -11793, 32568, 3612, 7180, -31972, -30986, -10660,
+ 32610, 3212, 6393, -32138, -31357, -9512, 32647, 2811, 5602, -32286,
+ - 31686, -8351, 32679, 2411, 4808, -32413, -31972, -7180, 32706, 2009,
+ 4011, -32522, -32214, -5998, 32729, 1608, 3212, -32610, -32413, -4808,
+ 32746, 1206, 2411, -32679, -32568, -3612, 32758, 804, 1608, -32729,
+ - 32679, -2411, 32766, 402, 804, -32758, -32746, -1206, 0, 32767,
+ 0, 32767, 0, 32767, 1608, 32729, 3212, 32610, 4808, 32413,
+ 3212, 32610, 6393, 32138, 9512, 31357, 4808, 32413, 9512, 31357,
+ 14010, 29622, 6393, 32138, 12540, 30274, 18205, 27246, 7962, 31786,
+ 15447, 28899, 22006, 24279, 9512, 31357, 18205, 27246, 25330, 20788,
+ 11039, 30853, 20788, 25330, 28106, 16846, 12540, 30274, 23170, 23170,
+ 30274, 12540, 14010, 29622, 25330, 20788, 31786, 7962, 15447, 28899,
+ 27246, 18205, 32610, 3212, 16846, 28106, 28899, 15447, 32729, -1608,
+ 18205, 27246, 30274, 12540, 32138, -6393, 19520, 26320, 31357, 9512,
+ 30853, -11039, 20788, 25330, 32138, 6393, 28899, -15447, 22006, 24279,
+ 32610, 3212, 26320, -19520, 23170, 23170, 32767, 0, 23170, -23170,
+ 24279, 22006, 32610, -3212, 19520, -26320, 25330, 20788, 32138, -6393,
+ 15447, -28899, 26320, 19520, 31357, -9512, 11039, -30853, 27246, 18205,
+ 30274, -12540, 6393, -32138, 28106, 16846, 28899, -15447, 1608, -32729,
+ 28899, 15447, 27246, -18205, -3212, -32610, 29622, 14010, 25330, -20788,
+ - 7962, -31786, 30274, 12540, 23170, -23170, -12540, -30274, 30853, 11039,
+ 20788, -25330, -16846, -28106, 31357, 9512, 18205, -27246, -20788, -25330,
+ 31786, 7962, 15447, -28899, -24279, -22006, 32138, 6393, 12540, -30274,
+ - 27246, -18205, 32413, 4808, 9512, -31357, -29622, -14010, 32610, 3212,
+ 6393, -32138, -31357, -9512, 32729, 1608, 3212, -32610, -32413, -4808,
+ 0, 32767, 0, 32767, 0, 32767, 6393, 32138, 12540, 30274,
+ 18205, 27246, 12540, 30274, 23170, 23170, 30274, 12540, 18205, 27246,
+ 30274, 12540, 32138, -6393, 23170, 23170, 32767, 0, 23170, -23170,
+ 27246, 18205, 30274, -12540, 6393, -32138, 30274, 12540, 23170, -23170,
+ - 12540, -30274, 32138, 6393, 12540, -30274, -27246, -18205, 0, 32767,
+ 0, 32767, 0, 32767, 23170, 23170, 32767, 0, 23170, -23170,
+ },
+
+
+ // WORD16 w_32[60]=
+ {
+ 0, 32767, 0, 32767, 0, 32767,
+ 6393, 32137, 12539, 30273, 18204, 27245,
+ 12539, 30273, 23170, 23170, 30273, 12539,
+ 18204, 27245, 30273, 12539, 32137, -6392,
+ 23170, 23170, 32767, 0, 23170, -23169,
+ 27245, 18204, 30273, -12538, 6393, -32136,
+ 30273, 12539, 23170, -23169, -12538, -30272,
+ 32137, 6393, 12539, -30272, -27244, -18203,
+ 0, 32767, 0, 32767, 0, 32767,
+ 23170, 23170, 32767, 0, 23170, -23169
+ },
+
+ // const WORD16 cosine_array_240[120] =
+ {
+ 32767, 107, 751, 32759, 32754, 965, 1608, 32729,
+ 32717, 1822, 2464, 32675, 32658, 2678, 3319, 32600,
+ 32577, 3532, 4171, 32501, 32473, 4383, 5020, 32381,
+ 32348, 5232, 5866, 32239, 32200, 6077, 6708, 32074,
+ 32029, 6918, 7545, 31887, 31837, 7754, 8377, 31679,
+ 31624, 8585, 9204, 31449, 31388, 9409, 10024, 31197,
+ 31131, 10228, 10837, 30924, 30853, 11039, 11643, 30630,
+ 30553, 11843, 12441, 30315, 30232, 12639, 13230, 29979,
+ 29891, 13426, 14010, 29622, 29530, 14204, 14781, 29245,
+ 29148, 14972, 15541, 28848, 28746, 15730, 16291, 28431,
+ 28324, 16477, 17030, 27995, 27883, 17213, 17757, 27540,
+ 27423, 17937, 18472, 27066, 26944, 18648, 19174, 26573,
+ 26447, 19347, 19863, 26062, 25931, 20033, 20538, 25533,
+ 25398, 20705, 21199, 24986, 24847, 21363, 21846, 24423,
+ 24279, 22006, 22478, 23843, 23695, 22634, 23095, 23246
+ },
};
diff --git a/decoder/ixheaacd_aac_rom.h b/decoder/ixheaacd_aac_rom.h
index a6a8142..d4afbaa 100644
--- a/decoder/ixheaacd_aac_rom.h
+++ b/decoder/ixheaacd_aac_rom.h
@@ -40,7 +40,7 @@ typedef struct {
WORD8 tns_max_bands_tbl_ld[12];
WORD8 tns_max_bands_tbl_480[12];
-
+ WORD32 scale_table_960[4];
} ia_aac_dec_block_tables_struct;
extern const ia_aac_dec_block_tables_struct ixheaacd_aac_block_tables;
@@ -95,6 +95,17 @@ typedef struct {
WORD8 ixheaacd_sfb_32_480[38];
WORD8 ixheaacd_sfb_24_480[31];
+ WORD8 ixheaacd_sfb_96_960[41];
+ WORD8 ixheaacd_sfb_96_120[13];
+ WORD8 ixheaacd_sfb_64_960[47];
+ WORD8 ixheaacd_sfb_48_960[50];
+ WORD8 ixheaacd_sfb_48_120[15];
+ WORD8 ixheaacd_sfb_24_960[47];
+ WORD8 ixheaacd_sfb_24_120[16];
+ WORD8 ixheaacd_sfb_16_960[43];
+ WORD8 ixheaacd_sfb_16_120[16];
+ WORD8 ixheaacd_sfb_8_960[41];
+ WORD8 ixheaacd_sfb_8_120[16];
} ia_aac_dec_huffman_tables_struct;
extern const ia_aac_dec_huffman_tables_struct ixheaacd_aac_huffmann_tables;
@@ -133,6 +144,26 @@ typedef struct {
WORD16 window_sine_480_eld[1920];
WORD16 window_sine_512_eld[2048];
+ WORD16 only_long_window_sine_960[960];
+ WORD16 only_long_window_kbd_960[960];
+ WORD16 only_short_window_sine_120[120];
+ WORD16 only_short_window_kbd_120[120];
+
+ WORD16 re_arr_tab_32[480];
+ WORD16 re_arr_tab_sml[16];
+ WORD16 re_arr_tab_4[60];
+ WORD16 re_arr_tab_15_4[60];
+ WORD16 re_arr_tab_120[60];
+ WORD16 re_arr_tab_5[16];
+ WORD16 re_arr_tab_3[16];
+
+ WORD16 re_arr_tab_sml_480[480];
+
+ WORD32 cosine_array_1920[960];
+
+ WORD16 w_512[2 * 510];
+ WORD16 w_32[60];
+ WORD16 cosine_array_240[120];
} ia_aac_dec_imdct_tables_struct;
extern const ia_aac_dec_imdct_tables_struct ixheaacd_imdct_tables;
@@ -149,8 +180,8 @@ typedef struct {
ia_aac_dec_imdct_tables_struct *pstr_imdct_tables;
ia_aac_sfb_info str_aac_sfb_info[4];
- WORD8 *scale_factor_bands_long[12];
- WORD8 *scale_factor_bands_short[12];
+ WORD8 *scale_factor_bands_long[24];
+ WORD8 *scale_factor_bands_short[24];
WORD16 sfb_long_table[52];
WORD16 sfb_short_table[16];
diff --git a/decoder/ixheaacd_aacdecoder.c b/decoder/ixheaacd_aacdecoder.c
index 8bbfc6a..7c67a4d 100644
--- a/decoder/ixheaacd_aacdecoder.c
+++ b/decoder/ixheaacd_aacdecoder.c
@@ -183,23 +183,43 @@ WORD32 ixheaacd_aacdec_decodeframe(
pstr_imdct_tables = aac_dec_handle->pstr_aac_tables->pstr_imdct_tables;
- aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_long_window[0] =
- pstr_imdct_tables->only_long_window_sine;
- aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_short_window[0] =
- pstr_imdct_tables->only_short_window_sine;
- aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_long_window[1] =
- pstr_imdct_tables->only_long_window_kbd;
- aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_short_window[1] =
- pstr_imdct_tables->only_short_window_kbd;
-
- aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_long_window[0] =
- pstr_imdct_tables->only_long_window_sine;
- aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_short_window[0] =
- pstr_imdct_tables->only_short_window_sine;
- aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_long_window[1] =
- pstr_imdct_tables->only_long_window_kbd;
- aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_short_window[1] =
- pstr_imdct_tables->only_short_window_kbd;
+ if (960 != frame_length) {
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_long_window[0] =
+ pstr_imdct_tables->only_long_window_sine;
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_short_window[0] =
+ pstr_imdct_tables->only_short_window_sine;
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_long_window[1] =
+ pstr_imdct_tables->only_long_window_kbd;
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_short_window[1] =
+ pstr_imdct_tables->only_short_window_kbd;
+
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_long_window[0] =
+ pstr_imdct_tables->only_long_window_sine;
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_short_window[0] =
+ pstr_imdct_tables->only_short_window_sine;
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_long_window[1] =
+ pstr_imdct_tables->only_long_window_kbd;
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_short_window[1] =
+ pstr_imdct_tables->only_short_window_kbd;
+ } else {
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_long_window[0] =
+ pstr_imdct_tables->only_long_window_sine_960;
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_short_window[0] =
+ pstr_imdct_tables->only_short_window_sine_120;
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_long_window[1] =
+ pstr_imdct_tables->only_long_window_kbd_960;
+ aac_dec_handle->pstr_aac_dec_overlap_info[ch]->ptr_short_window[1] =
+ pstr_imdct_tables->only_short_window_kbd_120;
+
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_long_window[0] =
+ pstr_imdct_tables->only_long_window_sine_960;
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_short_window[0] =
+ pstr_imdct_tables->only_short_window_sine_120;
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_long_window[1] =
+ pstr_imdct_tables->only_long_window_kbd_960;
+ aac_dec_handle->ptr_aac_dec_static_channel_info[ch]->ptr_short_window[1] =
+ pstr_imdct_tables->only_short_window_kbd_120;
+ }
if (object_type == AOT_ER_AAC_ELD || object_type == AOT_ER_AAC_LD ||
object_type == AOT_AAC_LTP) {
@@ -642,6 +662,9 @@ WORD32 ixheaacd_aacdec_decodeframe(
object_type, pstr_aac_dec_ch_info->common_window,
aac_dec_handle->samples_per_frame);
if (error_code) {
+ aac_dec_handle->pstr_aac_dec_ch_info[RIGHT]->str_ics_info =
+ aac_dec_handle->pstr_aac_dec_ch_info[LEFT]->str_ics_info;
+
if (it_bit_buff->cnt_bits < 0) {
error_code = (WORD16)(
(WORD32)
diff --git a/decoder/ixheaacd_api.c b/decoder/ixheaacd_api.c
index f91ab5f..6f9ae13 100644
--- a/decoder/ixheaacd_api.c
+++ b/decoder/ixheaacd_api.c
@@ -454,6 +454,7 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
p_obj_exhaacplus_dec->aac_config.ui_disable_sync = 0;
p_obj_exhaacplus_dec->aac_config.ui_auto_sbr_upsample = 1;
p_obj_exhaacplus_dec->aac_config.ui_samp_freq = 0;
+ p_obj_exhaacplus_dec->aac_config.ui_frame_size = 0;
p_obj_exhaacplus_dec->aac_config.ui_channel_mode = 3;
p_obj_exhaacplus_dec->aac_config.ui_sbr_mode = 0;
p_obj_exhaacplus_dec->aac_config.ui_effect_type = 0;
@@ -551,6 +552,13 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
p_obj_exhaacplus_dec->aac_config.ui_samp_freq = *pui_value;
break;
}
+ case IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG: {
+ if ((*pui_value != 1) && (*pui_value != 0)) {
+ return(IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMELENGTHFLAG);
+ }
+ p_obj_exhaacplus_dec->aac_config.ui_frame_size = *pui_value;
+ break;
+ }
case IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ: {
if ((*pui_value != 16) && (*pui_value != 24)) {
p_obj_exhaacplus_dec->aac_config.ui_pcm_wdsz = 16;
@@ -710,16 +718,6 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
break;
}
- case IA_ENHAACPLUS_DEC_CONFIG_PARAM_ELD_SBR_PRESENT: {
- if (*pui_value == 1) {
- p_obj_exhaacplus_dec->aac_config.eld_sbr_present = 1;
- } else if (*pui_value == 0) {
- p_obj_exhaacplus_dec->aac_config.eld_sbr_present = 0;
- } else {
- return (IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_ELDSBR);
- }
- break;
- }
case IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL: {
if (*pui_value > 16) {
p_obj_exhaacplus_dec->aac_config.ui_coupling_channel = 1;
@@ -1582,6 +1580,15 @@ IA_ERRORCODE ixheaacd_dec_init(
p_state_enhaacplus_dec->i_bytes_consumed = 0;
return IA_NO_ERROR;
}
+
+ if (1 == p_obj_exhaacplus_dec->aac_config.ui_frame_size) {
+ p_state_enhaacplus_dec->frame_len_flag = 1;
+ p_state_enhaacplus_dec->frame_length = 960;
+ } else {
+ p_state_enhaacplus_dec->frame_len_flag = 0;
+ p_state_enhaacplus_dec->frame_length = 1024;
+ }
+
p_state_enhaacplus_dec->ui_init_done = 0;
memset(&(p_state_enhaacplus_dec->eld_specific_config), 0,
sizeof(ia_eld_specific_config_struct));
@@ -1677,6 +1684,14 @@ IA_ERRORCODE ixheaacd_dec_init(
p_state_enhaacplus_dec->sampling_rate =
p_obj_exhaacplus_dec->aac_config.ui_samp_freq;
+
+ if (1 == p_obj_exhaacplus_dec->aac_config.ui_frame_size) {
+ p_state_enhaacplus_dec->frame_len_flag = 1;
+ p_state_enhaacplus_dec->frame_length = 960;
+ } else {
+ p_state_enhaacplus_dec->frame_len_flag = 0;
+ p_state_enhaacplus_dec->frame_length = 1024;
+ }
}
p_state_enhaacplus_dec->pstr_bit_buf = ixheaacd_create_bit_buf(
@@ -1952,11 +1967,8 @@ IA_ERRORCODE ixheaacd_dec_init(
0, sizeof(ltp_info));
{
- if ((p_state_enhaacplus_dec->audio_object_type != AOT_ER_AAC_LD) &&
- (p_state_enhaacplus_dec->audio_object_type != AOT_ER_AAC_ELD))
- frame_size_1 = 1024;
- else
- frame_size_1 = p_state_enhaacplus_dec->frame_length;
+
+ frame_size_1 = p_state_enhaacplus_dec->frame_length;
sample_rate_1 =
p_state_enhaacplus_dec->pstr_aac_dec_info[ch_idx]->sampling_rate;
num_channels_1 =
@@ -2038,7 +2050,7 @@ IA_ERRORCODE ixheaacd_dec_init(
&sbr_scratch_struct, 1, 1, 0, NULL, NULL,
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_flag_present,
p_state_enhaacplus_dec->audio_object_type, 1,
- p_state_enhaacplus_dec->ldmps_present) != SBRDEC_OK) {
+ p_state_enhaacplus_dec->ldmps_present, frame_size_1) != SBRDEC_OK) {
p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] = 0;
return -1;
} else {
@@ -2516,7 +2528,8 @@ IA_ERRORCODE ixheaacd_dec_execute(
p_obj_exhaacplus_dec->p_state_aac->ui_out_bytes = 0;
if (p_state_enhaacplus_dec->ui_in_bytes == 0) {
- WORD32 i, j;
+ UWORD32 i;
+ WORD32 j;
if (p_state_enhaacplus_dec->peak_lim_init == 1) {
p_obj_exhaacplus_dec->p_state_aac->ui_out_bytes =
(p_state_enhaacplus_dec->peak_limiter.attack_time_samples) *
@@ -2528,7 +2541,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
p_state_enhaacplus_dec->peak_limiter.delayed_input_index);
i++) {
*(time_data + total_channels * i + j) = ixheaacd_round16(
- *(p_state_enhaacplus_dec->peak_limiter.delayed_input +
+ (WORD32)*(p_state_enhaacplus_dec->peak_limiter.delayed_input +
(p_state_enhaacplus_dec->peak_limiter.delayed_input_index) *
total_channels +
total_channels * i + j));
@@ -2545,8 +2558,8 @@ IA_ERRORCODE ixheaacd_dec_execute(
total_channels +
total_channels * i + j) =
ixheaacd_round16(
- *(p_state_enhaacplus_dec->peak_limiter.delayed_input +
- total_channels * i + j));
+ (WORD32)*(p_state_enhaacplus_dec->peak_limiter.delayed_input +
+ total_channels * i + j));
}
}
@@ -2854,8 +2867,9 @@ IA_ERRORCODE ixheaacd_dec_execute(
if (p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_ELD ||
p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_LD)
frame_size = p_state_enhaacplus_dec->frame_length;
- else
- frame_size = 1024;
+ else {
+ frame_size = p_state_enhaacplus_dec->frame_length;
+ }
sample_rate_dec =
p_state_enhaacplus_dec->pstr_aac_dec_info[ch_idx]->sampling_rate;
@@ -2934,7 +2948,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
slot_ele, NULL, &p_state_enhaacplus_dec->str_drc_dec_info,
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_flag_present,
p_state_enhaacplus_dec->audio_object_type, 0,
- p_state_enhaacplus_dec->ldmps_present) != SBRDEC_OK) {
+ p_state_enhaacplus_dec->ldmps_present, frame_size) != SBRDEC_OK) {
p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] = 0;
return -1;
} else {
@@ -2958,8 +2972,8 @@ IA_ERRORCODE ixheaacd_dec_execute(
if (p_state_enhaacplus_dec->mps_dec_handle.ldmps_config
.ldmps_present_flag == 1 &&
- p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] &&
- p_state_enhaacplus_dec->mps_dec_handle.mps_init_done == 1) {
+ p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] &&
+ p_state_enhaacplus_dec->mps_dec_handle.mps_init_done == 1) {
ixheaacd_ld_mps_apply(p_obj_exhaacplus_dec, actual_out_buffer);
}
if (sample_rate < sample_rate_dec) {
@@ -2973,7 +2987,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
} else {
num_of_out_samples =
frame_size -
- MIN(p_obj_exhaacplus_dec->p_state_aac->delay_in_samples, frame_size);
+ MIN((WORD16)p_obj_exhaacplus_dec->p_state_aac->delay_in_samples, frame_size);
}
p_obj_exhaacplus_dec->aac_config.ui_samp_freq = sample_rate;
@@ -3101,7 +3115,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
p_obj_exhaacplus_dec->p_state_aac->delay_in_samples =
p_obj_exhaacplus_dec->p_state_aac->delay_in_samples -
- MIN(p_obj_exhaacplus_dec->p_state_aac->delay_in_samples, frame_size);
+ MIN(p_obj_exhaacplus_dec->p_state_aac->delay_in_samples, (UWORD16)frame_size);
}
if ((total_channels > 2) && (1 == p_obj_exhaacplus_dec->aac_config.downmix)) {
diff --git a/decoder/ixheaacd_basic_ops32.h b/decoder/ixheaacd_basic_ops32.h
index 365bfbe..f6b0de0 100644
--- a/decoder/ixheaacd_basic_ops32.h
+++ b/decoder/ixheaacd_basic_ops32.h
@@ -131,12 +131,22 @@ static PLATFORM_INLINE WORD32 ixheaacd_mult16x16in32(WORD16 a, WORD16 b) {
return product;
}
-static PLATFORM_INLINE WORD32 mult16x16in32_32(WORD32 a, WORD32 b) {
- WORD32 product;
+static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32_sat(WORD32 a, WORD16 b) {
+ WORD32 result;
+ WORD64 temp_result;
- product = (WORD32)a * (WORD32)b;
+ temp_result = (WORD64)a * (WORD64)b;
- return product;
+ if (temp_result < (WORD64)MIN_32)
+ result = MIN_32;
+
+ else if (temp_result > (WORD64)MAX_32)
+ result = MAX_32;
+
+ else
+ result = (WORD32)(temp_result);
+
+ return(result);
}
static PLATFORM_INLINE WORD32 ixheaacd_mult16x16in32_shl(WORD16 a, WORD16 b) {
diff --git a/decoder/ixheaacd_basic_ops40.h b/decoder/ixheaacd_basic_ops40.h
index c8a308c..ae684fb 100644
--- a/decoder/ixheaacd_basic_ops40.h
+++ b/decoder/ixheaacd_basic_ops40.h
@@ -72,7 +72,7 @@ static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32_shl(WORD32 a, WORD16 b) {
return (result << 1);
}
-static PLATFORM_INLINE WORD32 mult32x16hin32_shl(WORD32 a, WORD32 b) {
+static PLATFORM_INLINE WORD32 mult32x32hin32_shl(WORD32 a, WORD32 b) {
WORD32 product;
WORD64 temp_product;
@@ -93,6 +93,17 @@ static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32(WORD32 a, WORD16 b) {
return (result);
}
+static PLATFORM_INLINE WORD32 ixheaacd_mult32x32in32(WORD32 a, WORD32 b) {
+ WORD32 result;
+ WORD64 temp_result;
+
+ temp_result = (WORD64)a * (WORD64)b;
+
+ result = (WORD32)(temp_result >> 16);
+
+ return (result);
+}
+
static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32_shl_sat(WORD32 a,
WORD16 b) {
WORD32 result;
diff --git a/decoder/ixheaacd_block.c b/decoder/ixheaacd_block.c
index 472bf09..18df3ce 100644
--- a/decoder/ixheaacd_block.c
+++ b/decoder/ixheaacd_block.c
@@ -75,28 +75,11 @@ static PLATFORM_INLINE WORD32 ixheaacd_shr32_drc(WORD32 a, WORD32 b) {
return out_val;
}
-static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32_drc(WORD32 a, WORD16 b) {
- WORD32 result;
- WORD64 temp_result;
-
- temp_result = (WORD64)a * (WORD64)b;
-
- if (temp_result < (WORD64)MIN_32)
- result = MIN_32;
-
- else if (temp_result > (WORD64)MAX_32)
- result = MAX_32;
-
- else
- result = (WORD32)(temp_result);
-
- return (result);
-}
-static PLATFORM_INLINE WORD32 ixheaacd_mac32x16in32_drc(WORD32 a, WORD32 b,
+static PLATFORM_INLINE WORD32 ixheaacd_mac32x16in32_sat(WORD32 a, WORD32 b,
WORD16 c) {
WORD32 acc;
- acc = ixheaacd_mult32x16in32_drc(b, c);
+ acc = ixheaacd_mult32x16in32_sat(b, c);
acc = ixheaacd_add32_sat(a, acc);
@@ -162,7 +145,7 @@ VOID ixheaacd_inverse_quantize(WORD32 *x_invquant, WORD no_band,
static PLATFORM_INLINE WORD ixheaacd_huffman_dec_word1(
ia_bit_buf_struct *it_bit_buff, WORD32 *spec_coef, WORD16 *offsets,
WORD no_bands, WORD group_len, const UWORD16 *code_book_tbl,
- WORD32 *ixheaacd_pow_table_Q13, const UWORD32 *idx_table) {
+ WORD32 *ixheaacd_pow_table_Q13, const UWORD32 *idx_table, WORD32 maximum_bins_short) {
WORD32 sp1, sp2;
WORD32 flush_cw;
WORD32 i, value, norm_val, off;
@@ -318,12 +301,29 @@ static PLATFORM_INLINE WORD ixheaacd_huffman_dec_word1(
idx -= 2;
} while (idx != 0);
- spec_coef += (MAX_BINS_SHORT - offsets[1]);
+ if (maximum_bins_short == 120)
+ {
+ spec_coef += (maximum_bins_short - offsets[1]);
+ }
+ else
+ {
+ spec_coef += (MAX_BINS_SHORT - offsets[1]);
+ }
+
grp_idx--;
} while (grp_idx != 0);
offsets++;
- spec_coef -= (MAX_BINS_SHORT * group_len);
+
+ if (maximum_bins_short == 120)
+ {
+ spec_coef -= (maximum_bins_short * group_len);
+ }
+ else
+ {
+ spec_coef -= (MAX_BINS_SHORT * group_len);
+ }
+
no_bands--;
} while (no_bands >= 0);
@@ -501,7 +501,8 @@ static PLATFORM_INLINE WORD ixheaacd_huffman_dec_word2_11(
static PLATFORM_INLINE WORD ixheaacd_huffman_dec_quad(
ia_bit_buf_struct *it_bit_buff, WORD32 *spec_coef, WORD16 *offsets,
WORD no_bands, WORD group_len, const UWORD16 *code_book_tbl,
- WORD32 *ixheaacd_pow_table_Q13, WORD32 tbl_sign, const UWORD32 *idx_table) {
+ WORD32 *ixheaacd_pow_table_Q13, WORD32 tbl_sign, const UWORD32 *idx_table,
+ WORD32 maximum_bins_short) {
WORD idx, grp_idx;
WORD idx_len;
WORD32 *spec_orig;
@@ -624,7 +625,15 @@ static PLATFORM_INLINE WORD ixheaacd_huffman_dec_quad(
idx -= 4;
} while (idx != 0);
- spec_coef += (MAX_BINS_SHORT - offsets[1]);
+ if (maximum_bins_short == 120)
+ {
+ spec_coef += (maximum_bins_short - offsets[1]);
+ }
+ else
+ {
+ spec_coef += (MAX_BINS_SHORT - offsets[1]);
+ }
+
grp_idx--;
} while (grp_idx != 0);
offsets++;
@@ -807,7 +816,7 @@ static PLATFORM_INLINE WORD ixheaacd_huffman_dec_pair(
ia_bit_buf_struct *it_bit_buff, WORD32 *spec_coef, WORD16 *offsets,
WORD no_bands, WORD group_len, const UWORD16 *code_book_tbl,
WORD32 *ixheaacd_pow_table_Q13, WORD32 tbl_sign, const UWORD32 *idx_table,
- WORD32 huff_mode)
+ WORD32 huff_mode, WORD32 maximum_bins_short)
{
WORD idx, grp_idx;
@@ -887,7 +896,11 @@ static PLATFORM_INLINE WORD ixheaacd_huffman_dec_pair(
idx -= 2;
} while (idx != 0);
- spec_coef += (MAX_BINS_SHORT - offsets[1]);
+ if (maximum_bins_short == 120)
+ spec_coef += (maximum_bins_short - offsets[1]);
+ else
+ spec_coef += (MAX_BINS_SHORT - offsets[1]);
+
grp_idx--;
} while (grp_idx != 0);
@@ -1012,7 +1025,8 @@ static PLATFORM_INLINE WORD ixheaacd_huffman_dec_word2_pair(
WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
WORD32 *spec_coef, WORD16 *sfb_offset, WORD start,
WORD sfb, WORD group_len,
- ia_aac_dec_tables_struct *ptr_aac_tables) {
+ ia_aac_dec_tables_struct *ptr_aac_tables,
+ WORD32 maximum_bins_short) {
WORD ret_val = 0;
WORD start_bit_pos = it_bit_buff->bit_pos;
UWORD8 *start_read_pos = it_bit_buff->ptr_read_next;
@@ -1032,7 +1046,7 @@ WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
ret_val = ixheaacd_huffman_dec_word1(it_bit_buff, spec_coef, band_offset,
no_bands, group_len, cb_table,
- pow_table, idx_table);
+ pow_table, idx_table, maximum_bins_short);
} else if (cb_no <= 4) {
WORD32 tbl_sign = 0;
@@ -1042,7 +1056,7 @@ WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
}
ret_val = ixheaacd_huffman_dec_quad(it_bit_buff, spec_coef, band_offset,
no_bands, group_len, cb_table,
- pow_table, tbl_sign, idx_table);
+ pow_table, tbl_sign, idx_table, maximum_bins_short);
}
else if (cb_no <= 10) {
@@ -1057,7 +1071,7 @@ WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
}
ret_val = ixheaacd_huffman_dec_pair(
it_bit_buff, spec_coef, band_offset, no_bands, group_len, cb_table,
- pow_table, tbl_sign, idx_table, huff_mode);
+ pow_table, tbl_sign, idx_table, huff_mode, maximum_bins_short);
}
{
@@ -1141,11 +1155,18 @@ WORD ixheaacd_huffman_dec_word2(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
return ret_val;
}
-void ixheaacd_lap1_512_480(WORD32 *coef, WORD32 *prev, VOID *out_tmp,
+VOID ixheaacd_dec_copy_outsample(WORD32 *out_samples, WORD32 *p_overlap_buffer,
+ WORD32 size, WORD16 stride) {
+ WORD32 i;
+
+ for (i = 0; i < size; i++) {
+ out_samples[stride*i] = (ixheaacd_shl16_sat((WORD16)(p_overlap_buffer[i]), 1) << 14);
+ }
+}
+
+VOID ixheaacd_lap1_512_480(WORD32 *coef, WORD32 *prev, VOID *out_tmp,
const WORD16 *window, WORD16 q_shift, WORD16 size,
WORD16 stride , WORD slot_element) {
-
-
WORD32 accu;
WORD32 i;
WORD16 rounding_fac = -0x2000;
@@ -1211,14 +1232,14 @@ VOID ixheaacd_over_lap_add1_dec(WORD32 *coef, WORD32 *prev, WORD32 *out,
accu = ixheaacd_sub32_sat(
ixheaacd_shl32_dir_sat_limit(
ixheaacd_mult32x16in32(coef[size * 2 - 1 - i], window2), q_shift),
- ixheaacd_mac32x16in32_drc(rounding_fac, prev[i], window1));
+ ixheaacd_mac32x16in32_sat(rounding_fac, prev[i], window1));
out[ch_fac * (size - i - 1)] = accu;
accu = ixheaacd_sub32_sat(
ixheaacd_shl32_dir_sat_limit(
- ixheaacd_mult32x16in32(ixheaacd_negate32(coef[size * 2 - 1 - i]),
+ ixheaacd_mult32x16in32(ixheaacd_negate32_sat(coef[size * 2 - 1 - i]),
window1),
q_shift),
- ixheaacd_mac32x16in32_drc(rounding_fac, prev[i], window2));
+ ixheaacd_mac32x16in32_sat(rounding_fac, prev[i], window2));
out[ch_fac * (size + i)] = accu;
}
}
@@ -1349,7 +1370,7 @@ VOID ixheaacd_scale_factor_process_dec(WORD32 *x_invquant, WORD16 *scale_fact,
}
}
-void ixheaacd_right_shift_block(WORD32 *p_spectrum, WORD32 length,
+VOID ixheaacd_right_shift_block(WORD32 *p_spectrum, WORD32 length,
WORD32 shift_val) {
WORD32 i;
WORD32 temp1, temp2;
diff --git a/decoder/ixheaacd_block.h b/decoder/ixheaacd_block.h
index 51dd6c2..cc7119e 100644
--- a/decoder/ixheaacd_block.h
+++ b/decoder/ixheaacd_block.h
@@ -47,13 +47,14 @@ VOID ixheaacd_scale_factor_process_armv8(WORD32 *x_invquant, WORD16 *scale_fact,
WORD32 object_type,
WORD32 aac_sf_data_resil_flag);
-void ixheaacd_right_shift_block(WORD32 *p_spectrum, WORD length,
+VOID ixheaacd_right_shift_block(WORD32 *p_spectrum, WORD length,
WORD shift_val);
WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
WORD32 *spec_coef, WORD16 *sfb_offset, WORD start,
WORD sfb, WORD group_len,
- ia_aac_dec_tables_struct *ptr_aac_tables);
+ ia_aac_dec_tables_struct *ptr_aac_tables,
+ WORD32 maximum_bins_short);
WORD ixheaacd_huffman_dec_word2(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
WORD32 width,
@@ -140,6 +141,9 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
VOID ixheaacd_neg_shift_spec_dec(WORD32 *coef, WORD32 *out, WORD16 q_shift,
WORD16 ch_fac);
+VOID ixheaacd_nolap_dec(WORD32 *coef, WORD32 *out, WORD16 q_shift,
+ WORD16 ch_fac, WORD16 size_01);
+
VOID ixheaacd_neg_shift_spec_armv7(WORD32 *coef, WORD32 *out, WORD16 q_shift,
WORD16 ch_fac);
@@ -147,11 +151,11 @@ VOID ixheaacd_neg_shift_spec_armv8(WORD32 *coef, WORD32 *out, WORD16 q_shift,
WORD16 ch_fac);
VOID ixheaacd_nolap1_32(WORD32 *coef, WORD32 *out, WORD16 cu_scale,
- WORD16 stride);
+ WORD16 stride, WORD16 size_01);
VOID ixheaacd_overlap_out_copy_dec(WORD32 *out_samples, WORD32 *ptr_overlap_buf,
WORD32 *ptr_overlap_buf1,
- const WORD16 ch_fac);
+ const WORD16 ch_fac, WORD16 size_01);
VOID ixheaacd_overlap_out_copy_armv7(WORD32 *out_samples,
WORD32 *ptr_overlap_buf,
@@ -162,7 +166,7 @@ VOID ixheaacd_long_short_win_seq(WORD32 *current, WORD32 *prev, WORD32 *out,
const WORD16 *short_window,
const WORD16 *short_window_prev,
const WORD16 *long_window_prev, WORD16 q_shift,
- WORD16 ch_fac);
+ WORD16 ch_fac, WORD16 size_01);
WORD32 ixheaacd_cnt_leading_ones(WORD32 a);
@@ -170,12 +174,12 @@ VOID ixheaacd_huffman_decode(WORD32 it_bit_buff, WORD16 *huff_index,
WORD16 *len, const UWORD16 *input_table,
const UWORD32 *idx_table);
-void ixheaacd_eld_dec_windowing(WORD32 *ptr_spect_coeff, const WORD16 *ptr_win,
+VOID ixheaacd_eld_dec_windowing(WORD32 *ptr_spect_coeff, const WORD16 *ptr_win,
WORD32 framesize, WORD16 q_shift,
WORD32 *ptr_overlap_buf, const WORD16 stride,
VOID *out_samples, WORD slot_element);
-void ixheaacd_eld_dec_windowing_32bit(WORD32 *ptr_spect_coeff,
+VOID ixheaacd_eld_dec_windowing_32bit(WORD32 *ptr_spect_coeff,
const WORD16 *ptr_win, WORD32 framesize,
WORD16 q_shift, WORD32 *ptr_overlap_buf,
const WORD16 stride, WORD32 *out_samples);
@@ -185,8 +189,11 @@ VOID ixheaacd_process_single_scf(WORD32 scale_factor, WORD32 *x_invquant,
WORD32 total_channels, WORD32 object_type,
WORD32 aac_sf_data_resil_flag);
-void ixheaacd_lap1_512_480(WORD32 *coef, WORD32 *prev, VOID *out_tmp,
+VOID ixheaacd_lap1_512_480(WORD32 *coef, WORD32 *prev, VOID *out_tmp,
const WORD16 *window, WORD16 q_shift, WORD16 size,
WORD16 stride, WORD slot_element);
+VOID ixheaacd_dec_copy_outsample(WORD32 *out_samples, WORD32 *p_overlap_buffer,
+ WORD32 size, WORD16 stride);
+
#endif /* #ifndef IXHEAACD_BLOCK_H */
diff --git a/decoder/ixheaacd_channel.c b/decoder/ixheaacd_channel.c
index 9e6dd2c..0d9482f 100644
--- a/decoder/ixheaacd_channel.c
+++ b/decoder/ixheaacd_channel.c
@@ -351,8 +351,12 @@ WORD16 ixheaacd_ics_read(ia_bit_buf_struct *it_bit_buff,
ptr_ics_info->window_sequence = 0;
ptr_ics_info->window_shape = 1;
} else {
- if (object_type != AOT_ER_AAC_LD) {
- ptr_ics_info->frame_length = 1024;
+ if (object_type != AOT_ER_AAC_LD)
+ {
+ if (frame_size == 960)
+ ptr_ics_info->frame_length = 960;
+ else
+ ptr_ics_info->frame_length = 1024;
}
value = ixheaacd_read_bits_buf(it_bit_buff, 4);
ptr_ics_info->window_sequence = (WORD16)((value & 0x6) >> 1);
@@ -612,8 +616,10 @@ IA_ERRORCODE ixheaacd_channel_pair_process(
ixheaacd_ms_stereo_process(ptr_aac_dec_channel_info, ptr_aac_tables);
}
- ixheaacd_intensity_stereo_process(ptr_aac_dec_channel_info, ptr_aac_tables,
- object_type, aac_sf_data_resil_flag);
+ ixheaacd_intensity_stereo_process(
+ ptr_aac_dec_channel_info, ptr_aac_tables, object_type,
+ aac_sf_data_resil_flag,
+ ptr_aac_dec_channel_info[LEFT]->str_ics_info.frame_length);
}
for (channel = 0; channel < num_ch; channel++) {
@@ -742,6 +748,8 @@ IA_ERRORCODE ixheaacd_read_spectral_data(
ia_ics_info_struct *ptr_ics_info = &ptr_aac_dec_channel_info->str_ics_info;
WORD16 *swb_offset;
+ WORD32 maximum_bins_short = ptr_ics_info->frame_length >> 3;
+
WORD32 *ptr_spec_coef_out;
ptr_code_book = ptr_aac_dec_channel_info->ptr_code_book;
@@ -824,7 +832,11 @@ IA_ERRORCODE ixheaacd_read_spectral_data(
WORD grp_len = ptr_ics_info->window_group_length[num_win_grp];
ptr_code_book_no =
&ptr_code_book[num_win_grp * MAX_SCALE_FACTOR_BANDS_SHORT];
- ptr_spec_coef_out = &ptr_spec_coef[grp_offset * MAX_BINS_SHORT];
+
+ if (maximum_bins_short == 120)
+ ptr_spec_coef_out = &ptr_spec_coef[grp_offset * maximum_bins_short];
+ else
+ ptr_spec_coef_out = &ptr_spec_coef[grp_offset * MAX_BINS_SHORT];
for (sfb = 0; sfb < max_sfb;) {
WORD sect_cb = *ptr_code_book_no;
@@ -838,7 +850,7 @@ IA_ERRORCODE ixheaacd_read_spectral_data(
if (sect_cb > ZERO_HCB && (sect_cb < NOISE_HCB)) {
ret_val = ixheaacd_decode_huffman(
it_bit_buff, sect_cb, ptr_spec_coef_out, (WORD16 *)swb_offset,
- start, sfb, grp_len, ptr_aac_tables);
+ start, sfb, grp_len, ptr_aac_tables, maximum_bins_short);
if (ret_val != 0) {
return (WORD16)(
@@ -851,7 +863,13 @@ IA_ERRORCODE ixheaacd_read_spectral_data(
}
}
{
- WORD32 *ptr_scale_table = ptr_aac_tables->pstr_block_tables->scale_table;
+ WORD32 *ptr_scale_table;
+
+ if (maximum_bins_short != 120)
+ ptr_scale_table = ptr_aac_tables->pstr_block_tables->scale_table;
+ else
+ ptr_scale_table = ptr_aac_tables->pstr_block_tables->scale_table_960;
+
WORD8 *ptr_sfb_width =
ptr_aac_tables->str_aac_sfb_info[ptr_ics_info->window_sequence]
.sfb_width;
@@ -866,7 +884,10 @@ IA_ERRORCODE ixheaacd_read_spectral_data(
(WORD8 *)ptr_sfb_width, ptr_scale_table, total_channels,
object_type, aac_sf_data_resil_flag);
- ptr_spec_coef += MAX_BINS_SHORT;
+ if (maximum_bins_short == 120)
+ ptr_spec_coef += maximum_bins_short;
+ else
+ ptr_spec_coef += MAX_BINS_SHORT;
}
ptr_scale_factor += MAX_SCALE_FACTOR_BANDS_SHORT;
diff --git a/decoder/ixheaacd_defines.h b/decoder/ixheaacd_defines.h
index ed85be2..99d0753 100644
--- a/decoder/ixheaacd_defines.h
+++ b/decoder/ixheaacd_defines.h
@@ -42,21 +42,7 @@
#define CHANNELS 2
#define SIZE01 (MAX_BINS_LONG / 16)
-#define SIZE02 2 * SIZE01
-#define SIZE03 3 * SIZE01
-#define SIZE04 4 * SIZE01
-#define SIZE05 5 * SIZE01
-#define SIZE06 6 * SIZE01
#define SIZE07 7 * SIZE01
-#define SIZE08 8 * SIZE01
-#define SIZE09 9 * SIZE01
-#define SIZE10 10 * SIZE01
-#define SIZE11 11 * SIZE01
-#define SIZE12 12 * SIZE01
-#define SIZE13 13 * SIZE01
-#define SIZE14 14 * SIZE01
-#define SIZE15 15 * SIZE01
-#define SIZE16 16 * SIZE01
typedef struct { WORD32 sampling_frequency; } ia_sampling_rate_info_struct;
diff --git a/decoder/ixheaacd_env_calc.c b/decoder/ixheaacd_env_calc.c
index 2302135..c132476 100644
--- a/decoder/ixheaacd_env_calc.c
+++ b/decoder/ixheaacd_env_calc.c
@@ -474,7 +474,7 @@ static PLATFORM_INLINE VOID ixheaacd_adapt_noise_gain_calc(
WORD32 sub_band_start, WORD32 lb_scale, FLAG noise_absc_flag,
WORD32 smooth_length, WORD32 **anal_buf_real_mant,
WORD32 **anal_buf_imag_mant, WORD32 low_pow_flag,
- ia_sbr_tables_struct *ptr_sbr_tables) {
+ ia_sbr_tables_struct *ptr_sbr_tables, WORD16 max_cols) {
WORD32 l, k;
WORD32 scale_change;
WORD32 bands = num_sub_bands - skip_bands;
@@ -506,15 +506,35 @@ static PLATFORM_INLINE VOID ixheaacd_adapt_noise_gain_calc(
}
for (l = start_pos; l < end_pos; l++) {
- if ((l < MAX_COLS)) {
- scale_change = (adj_e - input_e);
- } else {
- scale_change = (final_e - input_e);
- if (((l == MAX_COLS)) && ((start_pos < MAX_COLS))) {
- WORD32 diff = final_e - noise_e;
- noise_e = final_e;
- ixheaacd_noise_level_rescaling(noise_level_mant, diff, bands, 2);
+ if (max_cols != 30)
+ {
+ if ((l < MAX_COLS)) {
+ scale_change = (adj_e - input_e);
+ }
+ else {
+ scale_change = (final_e - input_e);
+
+ if (((l == MAX_COLS)) && ((start_pos < MAX_COLS))) {
+ WORD32 diff = final_e - noise_e;
+ noise_e = final_e;
+ ixheaacd_noise_level_rescaling(noise_level_mant, diff, bands, 2);
+ }
+ }
+ }
+ else
+ {
+ if ((l < max_cols)) {
+ scale_change = (adj_e - input_e);
+ }
+ else {
+ scale_change = (final_e - input_e);
+
+ if (((l == max_cols)) && ((start_pos < max_cols))) {
+ WORD32 diff = final_e - noise_e;
+ noise_e = final_e;
+ ixheaacd_noise_level_rescaling(noise_level_mant, diff, bands, 2);
+ }
}
}
@@ -694,6 +714,10 @@ IA_ERRORCODE ixheaacd_calc_sbrenvelope(
WORD32 sub_band_start = pstr_freq_band_data->sub_band_start;
WORD32 sub_band_end = pstr_freq_band_data->sub_band_end;
+
+ WORD16 num_timeslots = ptr_header_data->num_time_slots;
+ WORD16 max_cols = ptr_header_data->num_time_slots * 2;
+
WORD32 num_sub_bands;
WORD32 skip_bands;
WORD32 bands;
@@ -783,15 +807,32 @@ IA_ERRORCODE ixheaacd_calc_sbrenvelope(
temp_val = ((max_sfb_nrg_exp + 13) >> 1);
- if ((ptr_border_vec[i] < SBR_TIME_SLOTS)) {
- if ((temp_val > adj_e)) {
- adj_e = (WORD16)temp_val;
+ if (num_timeslots != 15)
+ {
+ if ((ptr_border_vec[i] < SBR_TIME_SLOTS)) {
+ if ((temp_val > adj_e)) {
+ adj_e = (WORD16)temp_val;
+ }
+ }
+
+ if ((ptr_border_vec[i + 1] > SBR_TIME_SLOTS)) {
+ if ((temp_val > final_e)) {
+ final_e = (WORD16)temp_val;
+ }
}
}
+ else
+ {
+ if ((ptr_border_vec[i] < num_timeslots)) {
+ if ((temp_val > adj_e)) {
+ adj_e = (WORD16)temp_val;
+ }
+ }
- if ((ptr_border_vec[i + 1] > SBR_TIME_SLOTS)) {
- if ((temp_val > final_e)) {
- final_e = (WORD16)temp_val;
+ if ((ptr_border_vec[i + 1] > num_timeslots)) {
+ if ((temp_val > final_e)) {
+ final_e = (WORD16)temp_val;
+ }
}
}
}
@@ -867,10 +908,23 @@ IA_ERRORCODE ixheaacd_calc_sbrenvelope(
pstr_common_tables);
}
- if ((start_pos < MAX_COLS)) {
- noise_e = adj_e;
- } else {
- noise_e = final_e;
+ if (max_cols != 30)
+ {
+ if ((start_pos < MAX_COLS)) {
+ noise_e = adj_e;
+ }
+ else {
+ noise_e = final_e;
+ }
+ }
+ else
+ {
+ if ((start_pos < max_cols)) {
+ noise_e = adj_e;
+ }
+ else {
+ noise_e = final_e;
+ }
}
bands = num_sub_bands - skip_bands;
@@ -894,7 +948,7 @@ IA_ERRORCODE ixheaacd_calc_sbrenvelope(
noise_level_mant, nrg_sine, start_pos, end_pos, input_e, adj_e, final_e,
ptr_frame_data->max_qmf_subband_aac, lb_scale, noise_absc_flag,
smooth_length, anal_buf_real_mant, anal_buf_imag_mant, low_pow_flag,
- ptr_sbr_tables);
+ ptr_sbr_tables, max_cols);
}
first_start = ptr_border_vec[0] * SBR_TIME_STEP;
@@ -910,10 +964,20 @@ IA_ERRORCODE ixheaacd_calc_sbrenvelope(
ptr_frame_data->max_qmf_subband_aac, sub_band_end, 0, first_start,
low_pow_flag);
- reserve = (*ixheaacd_ixheaacd_expsubbandsamples)(
+ if (max_cols != 30)
+ {
+ reserve = (*ixheaacd_ixheaacd_expsubbandsamples)(
anal_buf_real_mant, anal_buf_imag_mant,
ptr_frame_data->max_qmf_subband_aac, sub_band_end, first_start,
MAX_COLS, low_pow_flag);
+ }
+ else
+ {
+ reserve = (*ixheaacd_ixheaacd_expsubbandsamples)(
+ anal_buf_real_mant, anal_buf_imag_mant,
+ ptr_frame_data->max_qmf_subband_aac, sub_band_end, first_start,
+ max_cols, low_pow_flag);
+ }
}
}
diff --git a/decoder/ixheaacd_env_extr.c b/decoder/ixheaacd_env_extr.c
index 11d5660..5c0e3db 100644
--- a/decoder/ixheaacd_env_extr.c
+++ b/decoder/ixheaacd_env_extr.c
@@ -337,6 +337,8 @@ WORD32 ixheaacd_sbr_read_header_data(
ia_sbr_header_data_struct *pstr_sbr_header, ia_bit_buf_struct *it_bit_buff,
FLAG stereo_flag, ia_sbr_header_data_struct *pstr_sbr_dflt_header) {
ia_sbr_header_data_struct prev_header_info;
+ prev_header_info.start_freq = 0;
+ prev_header_info.noise_bands = 0;
FLAG header_extra_1 = 0, header_extra_2 = 0;
WORD32 tmp;
WORD32 usac_independency_flag = pstr_sbr_header->usac_independency_flag;
@@ -536,12 +538,26 @@ static WORD16 ixheaacd_validate_frame_info(
if (start_pos > SBR_OV_SLOTS) return 0;
if (audio_object_type != AOT_ER_AAC_ELD &&
audio_object_type != AOT_ER_AAC_LD) {
- if (end_pos < SBR_TIME_SLOTS) return 0;
+ if (num_time_slots != 15)
+ {
+ if (end_pos < SBR_TIME_SLOTS) return 0;
+ }
+ else
+ {
+ if (end_pos < num_time_slots) return 0;
+ }
} else {
if (end_pos < num_time_slots) return 0;
}
- if (end_pos > add_d(SBR_TIME_SLOTS, SBR_OV_SLOTS)) return 0;
+ if (num_time_slots != 15)
+ {
+ if (end_pos > add_d(SBR_TIME_SLOTS, SBR_OV_SLOTS)) return 0;
+ }
+ else
+ {
+ if (end_pos > add_d(num_time_slots, SBR_OV_SLOTS)) return 0;
+ }
for (i = 0; i < num_env_sf; i++) {
if (pstr_frame_info->border_vec[i] > pstr_frame_info->border_vec[i + 1])
@@ -719,7 +735,8 @@ IA_ERRORCODE ixheaacd_sbr_read_sce(
}
} else {
if (!ixheaacd_sbr_time_freq_grid_info(it_bit_buff, ptr_frame_data,
- env_extr_tables_ptr))
+ env_extr_tables_ptr,
+ ptr_header_data->num_time_slots))
return 0;
}
@@ -746,7 +763,8 @@ IA_ERRORCODE ixheaacd_sbr_read_sce(
}
ptr_frame_data->num_time_slots = ptr_header_data->num_time_slots;
if (!ixheaacd_sbr_time_freq_grid_info(it_bit_buff, ptr_frame_data,
- env_extr_tables_ptr))
+ env_extr_tables_ptr,
+ ptr_header_data->num_time_slots))
return 0;
if (!ixheaacd_validate_frame_info(&ptr_frame_data->str_frame_info_details,
@@ -906,7 +924,8 @@ IA_ERRORCODE ixheaacd_sbr_read_cpe(
}
} else {
if (!ixheaacd_sbr_time_freq_grid_info(it_bit_buff, ptr_frame_data[i],
- env_extr_tables_ptr))
+ env_extr_tables_ptr,
+ ptr_header_data->num_time_slots))
return 0;
}
@@ -1242,14 +1261,12 @@ WORD16 ixheaacd_read_sbr_env_data(
WORD32 lav;
WORD32 i;
WORD16 no_band[MAX_ENVELOPES];
- WORD32 delta;
WORD32 amp_res, num_env, env_data_tbl_comp_factor, start_bits,
start_bits_balance;
WORD16 *p_freq_res = ptr_frame_data->str_frame_info_details.freq_res;
WORD16 *p_num_sf_bands = ptr_header_data->pstr_freq_band_data->num_sf_bands;
ia_huffman_data_type hcb_t, hcb_f;
- delta = 0;
amp_res = ptr_header_data->amp_res;
num_env = ptr_frame_data->str_frame_info_details.num_env;
@@ -1335,7 +1352,7 @@ WORD16 ixheaacd_read_sbr_env_data(
IA_ERRORCODE ixheaacd_extract_frame_info_ld(
ia_bit_buf_struct *it_bit_buff,
ia_sbr_frame_info_data_struct *h_frame_data) {
- int abs_bord_lead = 0, num_rel_lead = 0, num_rel_trail = 0, bs_num_env = 0,
+ int abs_bord_lead = 0, num_rel_lead = 0, bs_num_env = 0,
frame_class, temp, env, k, abs_bord_trail = 0, middle_bord = 0,
bs_num_noise, transient_env_temp = 0, bs_transient_position = 0;
@@ -1387,7 +1404,6 @@ IA_ERRORCODE ixheaacd_extract_frame_info_ld(
abs_bord_lead = 0;
abs_bord_trail = numTimeSlots;
num_rel_lead = bs_num_env - 1;
- num_rel_trail = 0;
for (k = 0; k < num_rel_lead; k++) {
rel_bord_lead[k] = ixheaacd_ld_env_table_time_slot[num_rel_lead - 1];
@@ -1554,7 +1570,7 @@ WORD32 ixheaacd_pvc_time_freq_grid_info(
WORD16 ixheaacd_sbr_time_freq_grid_info(
ia_bit_buf_struct *it_bit_buff,
ia_sbr_frame_info_data_struct *ptr_frame_data,
- ia_env_extr_tables_struct *env_extr_tables_ptr) {
+ ia_env_extr_tables_struct *env_extr_tables_ptr, WORD16 number_of_time_slots) {
WORD32 i, k, bs_num_rel = 0;
WORD32 bs_pointer_bits = 0, bs_num_env = 0, border, bs_pointer,
bs_var_bord = 0, temp = 0;
@@ -1572,7 +1588,16 @@ WORD16 ixheaacd_sbr_time_freq_grid_info(
temp =
ixheaacd_read_bits_buf(it_bit_buff, SBR_ENV_BITS + SBR_FRQ_RES_BITS);
bs_num_env = (temp & 0x6) >> SBR_FRQ_RES_BITS;
- p_fixfix_tab = &env_extr_tables_ptr->sbr_frame_info1_2_4_16[bs_num_env];
+
+ if (number_of_time_slots != 15)
+ {
+ p_fixfix_tab = &env_extr_tables_ptr->sbr_frame_info1_2_4_16[bs_num_env];
+ }
+ else
+ {
+ p_fixfix_tab = &env_extr_tables_ptr->sbr_frame_info1_2_4_16[bs_num_env + 4];
+ }
+
memcpy(p_frame_info, p_fixfix_tab, sizeof(ia_frame_info_struct));
bs_num_env = (1 << bs_num_env);
freq_res_0 = temp & 0x1;
@@ -1588,7 +1613,16 @@ WORD16 ixheaacd_sbr_time_freq_grid_info(
bs_var_bord = bs_var_bord >> SBR_NUM_BITS;
bs_num_env = bs_num_rel + 1;
p_frame_info->border_vec[0] = 0;
- border = bs_var_bord + SBR_TIME_SLOTS;
+
+ if (number_of_time_slots != 15)
+ {
+ border = bs_var_bord + SBR_TIME_SLOTS;
+ }
+ else
+ {
+ border = bs_var_bord + number_of_time_slots;
+ }
+
p_frame_info->border_vec[bs_num_env] = border;
for (k = bs_num_rel; k > 0; k--) {
temp = ixheaacd_read_bits_buf(it_bit_buff, SBR_REL_BITS);
@@ -1632,10 +1666,27 @@ WORD16 ixheaacd_sbr_time_freq_grid_info(
for (k = 1; k <= bs_num_rel; k++) {
temp = ixheaacd_read_bits_buf(it_bit_buff, SBR_REL_BITS);
border = border + ((temp << 1) + 2);
- if (border > SBR_TIME_SLOTS) border = SBR_TIME_SLOTS;
+
+ if (number_of_time_slots != 15)
+ {
+ if (border > SBR_TIME_SLOTS) border = SBR_TIME_SLOTS;
+ }
+ else
+ {
+ if (border > number_of_time_slots) border = number_of_time_slots;
+ }
+
p_frame_info->border_vec[k] = border;
}
- p_frame_info->border_vec[k] = SBR_TIME_SLOTS;
+
+ if (number_of_time_slots != 15)
+ {
+ p_frame_info->border_vec[k] = SBR_TIME_SLOTS;
+ }
+ else
+ {
+ p_frame_info->border_vec[k] = number_of_time_slots;
+ }
bs_pointer_bits = pointer_bits_array[bs_num_rel];
@@ -1673,8 +1724,18 @@ WORD16 ixheaacd_sbr_time_freq_grid_info(
case VARVAR:
abs_bord_lead = ixheaacd_read_bits_buf(
it_bit_buff, 2 * SBR_VAR_BORD_BITS + 2 * SBR_NUM_BITS);
- abs_bord_trail =
+
+ if (number_of_time_slots != 15)
+ {
+ abs_bord_trail =
(((abs_bord_lead & 0x30) >> (2 * SBR_NUM_BITS)) + SBR_TIME_SLOTS);
+ }
+ else
+ {
+ abs_bord_trail =
+ (((abs_bord_lead & 0x30) >> (2 * SBR_NUM_BITS)) + number_of_time_slots);
+ }
+
num_rel_trail = ((abs_bord_lead & 0xc) >> SBR_NUM_BITS);
num_rel_lead = (abs_bord_lead & 0x3);
abs_bord_lead = abs_bord_lead >> (SBR_VAR_BORD_BITS + 2 * SBR_NUM_BITS);
diff --git a/decoder/ixheaacd_env_extr.h b/decoder/ixheaacd_env_extr.h
index 3e679a7..b6eea96 100644
--- a/decoder/ixheaacd_env_extr.h
+++ b/decoder/ixheaacd_env_extr.h
@@ -149,7 +149,7 @@ WORD32 ixheaacd_pvc_time_freq_grid_info(
WORD16 ixheaacd_sbr_time_freq_grid_info(
ia_bit_buf_struct *it_bit_buff,
ia_sbr_frame_info_data_struct *ptr_frame_data,
- ia_env_extr_tables_struct *env_extr_tables_ptr);
+ ia_env_extr_tables_struct *env_extr_tables_ptr, WORD16 number_of_timeslots);
WORD16 ixheaacd_read_sbr_env_data(
ia_sbr_header_data_struct *ptr_header_data,
diff --git a/decoder/ixheaacd_error_codes.h b/decoder/ixheaacd_error_codes.h
index 4820704..4794b96 100644
--- a/decoder/ixheaacd_error_codes.h
+++ b/decoder/ixheaacd_error_codes.h
@@ -41,35 +41,33 @@
/* Non Fatal Errors */
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_PCM_WDSZ 0x00000800
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DOWNMIX 0x00000801
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_OUT08KHZ 0x00000802
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_OUT16KHZ 0x00000803
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TOSTEREO 0x00000804
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DSAMPLE 0x00000805
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMEOK 0x00000806
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_MP4FLAG 0x00000807
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_MAX_CHANNEL 0x00000808
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_COUP_CHANNEL 0x00000809
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_FEATURE_NOT_SUPPORTED 0x0000080A
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_SYNCFLAG 0x0000080B
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_SBRUPFLAG 0x0000080C
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TOSTEREO 0x00000802
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DSAMPLE 0x00000803
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMEOK 0x00000804
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_MP4FLAG 0x00000805
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_MAX_CHANNEL 0x00000806
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_COUP_CHANNEL 0x00000807
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_FEATURE_NOT_SUPPORTED 0x00000808
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_SYNCFLAG 0x00000809
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_SBRUPFLAG 0x0000080A
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LOASFLAG 0x0000080D
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LOASFLAG 0x0000080B
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRCFLAG 0x0000080E
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_CUT 0x0000080F
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_BOOST 0x00000810
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET 0x00000811
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMSZ 0x00000812
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_ELDSBR 0x00000813
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LD_CONFIG 0x00000814
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000815
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000816
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000817
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000818
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000819
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CONST_DELAY_MODE 0x0000081A
-#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE 0x0000081B
-#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS 0x0000081C
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRCFLAG 0x0000080C
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_CUT 0x0000080D
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_BOOST 0x0000080E
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET 0x0000080F
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMSZ 0x00000810
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LD_CONFIG 0x00000811
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000812
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000813
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000814
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000815
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000816
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CONST_DELAY_MODE 0x00000817
+#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE 0x00000818
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS 0x00000819
+#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMELENGTHFLAG 0x0000081A
// Fatal Errors
#define IA_ENHAACPLUS_DEC_CONFIG_FATAL_INVALID_SAMPLE_RATE 0xFFFF8800
diff --git a/decoder/ixheaacd_function_selector.h b/decoder/ixheaacd_function_selector.h
index b2882f8..5003b6c 100644
--- a/decoder/ixheaacd_function_selector.h
+++ b/decoder/ixheaacd_function_selector.h
@@ -57,10 +57,15 @@
extern WORD32 (*ixheaacd_fix_div)(WORD32, WORD32);
extern VOID (*ixheaacd_covariance_matrix_calc)(WORD32 *,
- ixheaacd_lpp_trans_cov_matrix *,
- WORD32);
+ ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32);
+
+extern VOID(*ixheaacd_covariance_matrix_calc_960)(WORD32 *,
+ ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32);
+
extern VOID (*ixheaacd_covariance_matrix_calc_2)(
- ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32, WORD16);
+ ia_lpp_trans_cov_matrix *, WORD32 *, WORD32, WORD16);
extern VOID (*ixheaacd_over_lap_add1)(WORD32 *, WORD32 *, WORD32 *,
const WORD16 *, WORD16, WORD16, WORD16);
extern VOID (*ixheaacd_over_lap_add2)(WORD32 *, WORD32 *, WORD32 *,
@@ -132,12 +137,16 @@ extern VOID (*ixheaacd_overlap_buf_out)(WORD32 *, WORD32 *, WORD32,
const WORD16);
extern VOID (*ixheaacd_overlap_out_copy)(WORD32 *, WORD32 *, WORD32 *,
- const WORD16);
+ const WORD16, WORD16);
extern VOID (*ixheaacd_pretwiddle_compute)(WORD32 *, WORD32 *, WORD32 *,
ia_aac_dec_imdct_tables_struct *,
WORD, WORD32);
+extern VOID(*ixheaacd_pretwiddle_compute_960)(WORD32 *, WORD32 *, WORD32 *,
+ ia_aac_dec_imdct_tables_struct *,
+ WORD, WORD32);
+
extern VOID (*ixheaacd_imdct_using_fft)(ia_aac_dec_imdct_tables_struct *,
WORD32, WORD32 *, WORD32 *);
@@ -161,10 +170,17 @@ extern VOID (*ixheaacd_mps_synt_out_calc)(WORD32 resolution, FLOAT32 *out,
extern VOID (*ixheaacd_fft_15_ld)(WORD32 *inp, WORD32 *op, WORD32 *fft3out,
UWORD8 *re_arr_tab_sml_240_ptr);
+extern VOID(*ixheaacd_fft_15_960_dec)(WORD32 *inp, WORD32 *op, WORD32 *fft3out,
+ UWORD8 *re_arr_tab_sml_480_ptr);
+
extern VOID (*ixheaacd_aac_ld_dec_rearrange)(WORD32 *ip, WORD32 *op,
WORD32 mdct_len_2,
UWORD8 *re_arr_tab);
+extern VOID(*ixheaacd_aac_ld_dec_rearrange_960)(WORD32 *ip, WORD32 *op,
+ WORD32 mdct_len_2,
+ WORD16 *re_arr_tab);
+
extern VOID (*ixheaacd_fft32x32_ld)(
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
WORD32 *ptr_x, WORD32 *ptr_y);
@@ -173,6 +189,10 @@ extern VOID (*ixheaacd_fft32x32_ld2)(
ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
WORD32 *ptr_x, WORD32 *ptr_y);
+extern VOID(*ixheaacd_fft32_points_960)(
+ ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
+ WORD32 *ptr_x, WORD32 *ptr_y);
+
extern WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo);
extern VOID (*ixheaacd_inv_dit_fft_8pt)(WORD32 *x, WORD32 *real, WORD32 *imag);
diff --git a/decoder/ixheaacd_headerdecode.c b/decoder/ixheaacd_headerdecode.c
index 3ff0ffd..66667a3 100644
--- a/decoder/ixheaacd_headerdecode.c
+++ b/decoder/ixheaacd_headerdecode.c
@@ -493,7 +493,6 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
struct ia_bit_buf_struct *it_bit_buff) {
WORD32 tmp;
WORD32 cnt_bits = it_bit_buff->cnt_bits;
- WORD32 dummy = 0;
UWORD32 aot_init;
UWORD32 tmp_aot;
@@ -663,7 +662,7 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
}
{
- dummy = ixheaacd_skip_bits_buf(it_bit_buff, it_bit_buff->cnt_bits);
+ ixheaacd_skip_bits_buf(it_bit_buff, it_bit_buff->cnt_bits);
if ((SIZE_T)it_bit_buff->ptr_read_next ==
(SIZE_T)it_bit_buff->ptr_bit_buf_base) {
diff --git a/decoder/ixheaacd_initfuncs.c b/decoder/ixheaacd_initfuncs.c
index 1558fe7..1955776 100644
--- a/decoder/ixheaacd_initfuncs.c
+++ b/decoder/ixheaacd_initfuncs.c
@@ -218,6 +218,31 @@ VOID ixheaacd_huff_tables_create(ia_aac_dec_tables_struct *ptr_aac_tables) {
ptr_aac_tables->scale_factor_bands_short[11] =
ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_8_128;
+ ptr_aac_tables->scale_factor_bands_short[12] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_96_120;
+ ptr_aac_tables->scale_factor_bands_short[13] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_96_120;
+ ptr_aac_tables->scale_factor_bands_short[14] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_96_120;
+ ptr_aac_tables->scale_factor_bands_short[15] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_120;
+ ptr_aac_tables->scale_factor_bands_short[16] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_120;
+ ptr_aac_tables->scale_factor_bands_short[17] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_120;
+ ptr_aac_tables->scale_factor_bands_short[18] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_24_120;
+ ptr_aac_tables->scale_factor_bands_short[19] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_24_120;
+ ptr_aac_tables->scale_factor_bands_short[20] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_16_120;
+ ptr_aac_tables->scale_factor_bands_short[21] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_16_120;
+ ptr_aac_tables->scale_factor_bands_short[22] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_16_120;
+ ptr_aac_tables->scale_factor_bands_short[23] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_8_120;
+
ptr_aac_tables->scale_factor_bands_long[0] =
ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_96_1024;
ptr_aac_tables->scale_factor_bands_long[1] =
@@ -243,6 +268,31 @@ VOID ixheaacd_huff_tables_create(ia_aac_dec_tables_struct *ptr_aac_tables) {
ptr_aac_tables->scale_factor_bands_long[11] =
ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_8_1024;
+ ptr_aac_tables->scale_factor_bands_long[12] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_96_960;
+ ptr_aac_tables->scale_factor_bands_long[13] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_96_960;
+ ptr_aac_tables->scale_factor_bands_long[14] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_64_960;
+ ptr_aac_tables->scale_factor_bands_long[15] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_960;
+ ptr_aac_tables->scale_factor_bands_long[16] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_960;
+ ptr_aac_tables->scale_factor_bands_long[17] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_960;
+ ptr_aac_tables->scale_factor_bands_long[18] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_24_960;
+ ptr_aac_tables->scale_factor_bands_long[19] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_24_960;
+ ptr_aac_tables->scale_factor_bands_long[20] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_16_960;
+ ptr_aac_tables->scale_factor_bands_long[21] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_16_960;
+ ptr_aac_tables->scale_factor_bands_long[22] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_16_960;
+ ptr_aac_tables->scale_factor_bands_long[23] =
+ ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_8_960;
+
ptr_aac_tables->scale_fac_bands_512[0] =
ptr_aac_tables->pstr_huffmann_tables->ixheaacd_sfb_48_512;
ptr_aac_tables->scale_fac_bands_512[1] =
@@ -369,6 +419,7 @@ ia_aac_decoder_struct *ixheaacd_aac_decoder_init(
sizeof(ia_sampling_rate_info_struct);
WORD32 sampling_rate = p_state_enhaacplus_dec->sampling_rate;
+ WORD sfidx;
i = 0;
while ((i < num_entries) &&
@@ -383,18 +434,22 @@ ia_aac_decoder_struct *ixheaacd_aac_decoder_init(
if (i == num_entries) {
return NULL;
}
+ sfidx = i;
- if (frame_length == 1024) {
+ if (frame_length == 1024 || frame_length == 960) {
WORD16 *psfb_table_idx[2];
const WORD8 *psfb_width[2];
WORD width_idx;
WORD32 j;
+ if (frame_length == 960)
+ sfidx += 12;
+
psfb_table_idx[0] = ptr_aac_tables->sfb_long_table;
psfb_table_idx[1] = ptr_aac_tables->sfb_short_table;
- psfb_width[0] = ptr_aac_tables->scale_factor_bands_long[i];
- psfb_width[1] = ptr_aac_tables->scale_factor_bands_short[i];
+ psfb_width[0] = ptr_aac_tables->scale_factor_bands_long[sfidx];
+ psfb_width[1] = ptr_aac_tables->scale_factor_bands_short[sfidx];
for (j = 1; j >= 0; j--) {
const WORD8 *ptr_width = psfb_width[j];
diff --git a/decoder/ixheaacd_lpfuncs.c b/decoder/ixheaacd_lpfuncs.c
index fc4aa00..14a0cfd 100644
--- a/decoder/ixheaacd_lpfuncs.c
+++ b/decoder/ixheaacd_lpfuncs.c
@@ -103,81 +103,69 @@ static PLATFORM_INLINE WORD32 ixheaacd_shr32_drc(WORD32 a, WORD32 b) {
return out_val;
}
-static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32_drc(WORD32 a, WORD16 b) {
- WORD32 result;
- WORD64 temp_result;
-
- temp_result = (WORD64)a * (WORD64)b;
-
- if (temp_result < (WORD64)MIN_32)
- result = MIN_32;
-
- else if (temp_result > (WORD64)MAX_32)
- result = MAX_32;
-
- else
- result = (WORD32)(temp_result);
-
- return (result);
-}
-
VOID ixheaacd_process_win_seq(WORD32 *coef, WORD32 *prev, WORD32 *out,
const WORD16 *window_long,
const WORD16 *window_short, WORD16 q_shift,
- WORD16 ch_fac, WORD16 flag) {
+ WORD16 ch_fac, WORD16 flag, WORD16 size_01) {
WORD32 i, accu;
WORD32 *coef_1;
const WORD16 *temp_win_sh, *temp_win_long;
WORD32 *out1, *out2;
WORD32 *temp_prev;
+ WORD16 size_07 = 7 * size_01;
+ WORD16 size_08 = 8 * size_01;
+ WORD16 size_09 = 9 * size_01;
+ WORD16 size_14 = 14 * size_01;
+ WORD16 size_15 = 15 * size_01;
+
if (flag == 1) {
- for (i = 0; i < SIZE07; i++) {
+ for (i = 0; i < size_07; i++) {
WORD32 temp1 = ixheaacd_shl32_dir_sat_limit(
- ixheaacd_mult32x16in32(coef[SIZE08 + i], window_long[2 * i]),
+ ixheaacd_mult32x16in32(coef[size_08 + i], window_long[2 * i]),
(q_shift + 1));
accu = ixheaacd_add32_sat(temp1, ((WORD32)prev[i] << 16));
out[ch_fac * i] = accu;
accu = ixheaacd_shl32_dir_sat_limit(
- ixheaacd_mult32x16in32(-(coef[SIZE15 - 1 - i]),
- window_long[2 * (SIZE07 - i) - 1]),
+ ixheaacd_mult32x16in32(-(coef[size_15 - 1 - i]),
+ window_long[2 * (size_07 - i) - 1]),
q_shift);
- out[ch_fac * (i + SIZE09)] = (accu << 1);
+ out[ch_fac * (i + size_09)] = (accu << 1);
}
temp_win_sh = &(window_short[0]);
- coef_1 = &(coef[SIZE15]);
- temp_win_long = &(window_long[SIZE14]);
- temp_prev = &(prev[SIZE08 - 1]);
- out1 = &(out[ch_fac * (SIZE07)]);
- out2 = &(out[ch_fac * (SIZE09 - 1)]);
+ coef_1 = &(coef[size_15]);
+ temp_win_long = &(window_long[size_14]);
+ temp_prev = &(prev[size_08 - 1]);
+ out1 = &(out[ch_fac * (size_07)]);
+ out2 = &(out[ch_fac * (size_09 - 1)]);
} else {
- for (i = 0; i < SIZE07; i++) {
- accu = ixheaacd_mult32x16in32_drc(
- prev[SIZE08 - 1 - i], ixheaacd_negate16(window_long[2 * i + 1]));
+ for (i = 0; i < size_07; i++) {
+ accu = ixheaacd_mult32x16in32_sat(
+ prev[size_08 - 1 - i], ixheaacd_negate16(window_long[2 * i + 1]));
out[ch_fac * i] = accu;
accu = ixheaacd_sub32_sat(
- ixheaacd_shl32_dir_sat_limit(-(coef[SIZE15 - 1 - i]), (q_shift - 1)),
- ixheaacd_mult32x16in32_drc(prev[i + SIZE01],
- window_long[2 * SIZE07 - 2 - 2 * i]));
+ ixheaacd_shl32_dir_sat_limit(-(coef[size_15 - 1 - i]), (q_shift - 1)),
+ ixheaacd_mult32x16in32_sat(prev[i + size_01],
+ window_long[2 * size_07 - 2 - 2 * i]));
- out[ch_fac * (SIZE09 + i)] = accu;
+ out[ch_fac * (size_09 + i)] = accu;
}
- temp_win_sh = &(window_long[SIZE14]);
- coef_1 = &(coef[SIZE15]);
+ temp_win_sh = &(window_long[size_14]);
+ coef_1 = &(coef[size_15]);
temp_win_long = &(window_short[0]);
- temp_prev = &(prev[SIZE01 - 1]);
- out1 = &(out[ch_fac * (SIZE07)]);
- out2 = &(out[ch_fac * (SIZE09 - 1)]);
+ temp_prev = &(prev[size_01 - 1]);
+ out1 = &(out[ch_fac * (size_07)]);
+ out2 = &(out[ch_fac * (size_09 - 1)]);
}
- for (i = SIZE01 - 1; i >= 0; i--) {
+ for (i = size_01 - 1; i >= 0; i--) {
WORD32 temp_coef = *coef_1++;
WORD16 win1 = *temp_win_long++;
WORD16 win2 = *temp_win_long++;
@@ -187,7 +175,7 @@ VOID ixheaacd_process_win_seq(WORD32 *coef, WORD32 *prev, WORD32 *out,
accu = ixheaacd_sub32_sat(
ixheaacd_shl32_dir_sat_limit(ixheaacd_mult32x16in32(temp_coef, win1),
q_shift),
- ixheaacd_mult32x16in32_drc(prev1, win3));
+ ixheaacd_mult32x16in32_sat(prev1, win3));
*out1 = accu << flag;
out1 += ch_fac;
@@ -195,7 +183,7 @@ VOID ixheaacd_process_win_seq(WORD32 *coef, WORD32 *prev, WORD32 *out,
ixheaacd_shl32_dir_sat_limit(
ixheaacd_mult32x16in32(ixheaacd_negate32_sat(temp_coef), win2),
q_shift),
- ixheaacd_mult32x16in32_drc(prev1, win4));
+ ixheaacd_mult32x16in32_sat(prev1, win4));
*out2 = accu << flag;
out2 -= ch_fac;
}
@@ -204,14 +192,17 @@ VOID ixheaacd_process_win_seq(WORD32 *coef, WORD32 *prev, WORD32 *out,
static PLATFORM_INLINE VOID ixheaacd_long_short_win_process(
WORD32 *current, WORD32 *prev, WORD32 *out, const WORD16 *short_window,
const WORD16 *long_window_prev, WORD16 q_shift, WORD16 ch_fac,
- WORD32 flag) {
+ WORD32 flag, WORD16 size_01) {
+
+ WORD16 size_02 = 2 * size_01;
+ WORD16 size_03 = 3 * size_01;
WORD i;
WORD32 accu;
- WORD32 *current_tmp1 = &(current[(SIZE03 - 1)]);
- WORD32 *current_tmp2 = &(current[-SIZE01]);
- const WORD16 *short_ptr = &(short_window[SIZE02 - 1]);
+ WORD32 *current_tmp1 = &(current[(size_03 - 1)]);
+ WORD32 *current_tmp2 = &(current[-size_01]);
+ const WORD16 *short_ptr = &(short_window[size_02 - 1]);
- for (i = SIZE01 - 1; i >= 0; i--) {
+ for (i = size_01 - 1; i >= 0; i--) {
WORD32 tmp1_cur = *current_tmp1--;
WORD32 tmp2_cur = *current_tmp2++;
WORD16 short1 = *short_ptr--;
@@ -220,18 +211,18 @@ static PLATFORM_INLINE VOID ixheaacd_long_short_win_process(
ixheaacd_shl32_dir_sat_limit((ixheaacd_mult32x16in32(tmp1_cur, short2) -
ixheaacd_mult32x16in32(tmp2_cur, short1)),
q_shift),
- ixheaacd_mult32x16in32_drc(prev[i], long_window_prev[0 - 2 - 2 * i]));
+ ixheaacd_mult32x16in32_sat(prev[i], long_window_prev[0 - 2 - 2 * i]));
out[ch_fac * (0 + i)] = accu;
if (flag) {
accu = ixheaacd_sub32_sat(
ixheaacd_shl32_dir_sat_limit(
- (ixheaacd_mult32x16in32(-(tmp1_cur), short1) -
+ (ixheaacd_mult32x16in32(ixheaacd_negate32_sat(tmp1_cur), short1) -
ixheaacd_mult32x16in32(tmp2_cur, short2)),
q_shift),
- ixheaacd_mult32x16in32_drc(prev[SIZE02 - 1 - i],
- long_window_prev[-2 * SIZE02 + 2 * i]));
- out[ch_fac * (SIZE02 - 1 - i)] = accu;
+ ixheaacd_mult32x16in32_sat(prev[size_02 - 1 - i],
+ long_window_prev[-2 * size_02 + 2 * i]));
+ out[ch_fac * (size_02 - 1 - i)] = accu;
}
}
}
@@ -240,71 +231,78 @@ VOID ixheaacd_long_short_win_seq(WORD32 *current, WORD32 *prev, WORD32 *out,
const WORD16 *short_window,
const WORD16 *short_window_prev,
const WORD16 *long_window_prev, WORD16 q_shift,
- WORD16 ch_fac) {
+ WORD16 ch_fac, WORD16 size_01) {
+
+ WORD16 size_02 = 2 * size_01;
+ WORD16 size_06 = 6 * size_01;
+ WORD16 size_07 = 7 * size_01;
+ WORD16 size_08 = 8 * size_01;
+ WORD16 size_09 = 9 * size_01;
+ WORD16 size_10 = 10 * size_01;
+ WORD16 size_16 = 16 * size_01;
+
WORD32 i, flag;
WORD32 accu;
- for (i = 0; i < SIZE07; i++) {
- accu = ixheaacd_mult32x16in32_drc(
- prev[SIZE08 - 1 - i], ixheaacd_negate16(long_window_prev[2 * i + 1]));
+ for (i = 0; i < size_07; i++) {
+ accu = ixheaacd_mult32x16in32_sat(
+ prev[size_08 - 1 - i], ixheaacd_negate16(long_window_prev[2 * i + 1]));
out[ch_fac * i] = accu;
}
- for (i = 0; i < SIZE01; i++) {
+ for (i = 0; i < size_01; i++) {
accu = ixheaacd_sub32_sat(
ixheaacd_shl32_dir_sat_limit(
- ixheaacd_mult32x16in32(current[SIZE01 + i],
+ ixheaacd_mult32x16in32(current[size_01 + i],
short_window_prev[2 * i]),
q_shift),
- ixheaacd_mult32x16in32_drc(prev[SIZE01 - 1 - i],
- long_window_prev[2 * SIZE07 + 1 + 2 * i]));
- out[ch_fac * (SIZE07 + i)] = accu;
+ ixheaacd_mult32x16in32_sat(prev[size_01 - 1 - i],
+ long_window_prev[2 * size_07 + 1 + 2 * i]));
+ out[ch_fac * (size_07 + i)] = accu;
}
- for (i = 0; i < SIZE01; i++) {
+ for (i = 0; i < size_01; i++) {
accu = ixheaacd_sub32_sat(
ixheaacd_shl32_dir_sat_limit(
- ixheaacd_mult32x16in32(-(current[SIZE02 - 1 - i]),
- short_window_prev[SIZE02 - 2 * i - 1]),
+ ixheaacd_mult32x16in32(ixheaacd_negate32_sat(current[size_02 - 1 - i]),
+ short_window_prev[size_02 - 2 * i - 1]),
q_shift),
- ixheaacd_mult32x16in32_drc(prev[i],
- long_window_prev[SIZE16 - 2 - (2 * i)]));
- out[ch_fac * (SIZE08 + i)] = accu;
+ ixheaacd_mult32x16in32_sat(prev[i],
+ long_window_prev[size_16 - 2 - (2 * i)]));
+ out[ch_fac * (size_08 + i)] = accu;
}
flag = 1;
for (i = 0; i < 4; i++) {
- WORD32 inc = i * SIZE02;
+ WORD32 inc = i * size_02;
if (i == 3) {
flag = 0;
}
- ixheaacd_long_short_win_process(&current[SIZE01 + inc], &prev[SIZE01 + inc],
- &out[ch_fac * (SIZE09 + inc)], short_window,
- &long_window_prev[2 * (SIZE07 - inc)],
- q_shift, ch_fac, flag);
+ ixheaacd_long_short_win_process(&current[size_01 + inc], &prev[size_01 + inc],
+ &out[ch_fac * (size_09 + inc)], short_window,
+ &long_window_prev[2 * (size_07 - inc)],
+ q_shift, ch_fac, flag, size_01);
}
- for (i = 0; i < SIZE01; i++) {
- accu = (ixheaacd_mult32x16in32(-(current[SIZE10 - 1 - i]),
- short_window[SIZE02 - 2 * i - 1]) -
- ixheaacd_mult32x16in32(current[SIZE06 + i],
- short_window[SIZE02 - 2 * i - 2]));
+ for (i = 0; i < size_01; i++) {
+ accu = (ixheaacd_mult32x16in32(-(current[size_10 - 1 - i]),
+ short_window[size_02 - 2 * i - 1]) -
+ ixheaacd_mult32x16in32(current[size_06 + i],
+ short_window[size_02 - 2 * i - 2]));
prev[i] =
ixheaacd_round16(ixheaacd_shl32_dir_sat_limit(accu, (q_shift + 1)));
}
}
-VOID ixheaacd_nolap1_32(WORD32 *coef,
-
- WORD32 *out,
-
- WORD16 q_shift, WORD16 ch_fac) {
+VOID ixheaacd_nolap1_32(WORD32 *coef, WORD32 *out, WORD16 q_shift,
+ WORD16 ch_fac, WORD16 size_01) {
+ WORD16 size_07 = 7 * size_01;
WORD32 i;
- for (i = 0; i < SIZE07; i++) {
+ for (i = 0; i < size_07; i++) {
out[ch_fac * i] = ixheaacd_shr32_drc(
- ixheaacd_negate32_sat(coef[SIZE07 - 1 - i]), 16 - q_shift);
+ ixheaacd_negate32_sat(coef[size_07 - 1 - i]), 16 - q_shift);
}
}
@@ -317,6 +315,16 @@ VOID ixheaacd_neg_shift_spec_dec(WORD32 *coef, WORD32 *out, WORD16 q_shift,
}
}
+VOID ixheaacd_Nolap_dec(WORD32 *coef, WORD32 *out, WORD16 q_shift,
+ WORD16 ch_fac, WORD16 size_01) {
+ WORD16 size_07 = 7 * size_01;
+ WORD32 i;
+ for (i = 0; i < size_07; i++) {
+ out[ch_fac * i] = ixheaacd_shl32_dir_sat_limit(
+ ixheaacd_negate32_sat(coef[size_07 - 1 - i]), q_shift);
+ }
+}
+
VOID ixheaacd_spec_to_overlapbuf_dec(WORD32 *ptr_overlap_buf,
WORD32 *ptr_spec_coeff, WORD32 q_shift,
WORD32 size) {
@@ -338,10 +346,10 @@ VOID ixheaacd_overlap_buf_out_dec(WORD32 *out_samples, WORD32 *ptr_overlap_buf,
VOID ixheaacd_overlap_out_copy_dec(WORD32 *out_samples, WORD32 *ptr_overlap_buf,
WORD32 *ptr_overlap_buf1,
- const WORD16 ch_fac) {
+ const WORD16 ch_fac, WORD16 size_01) {
WORD32 i;
- for (i = 0; i < SIZE01; i++) {
+ for (i = 0; i < size_01; i++) {
out_samples[ch_fac * i] =
ixheaacd_shl32_sat((WORD16)ptr_overlap_buf[i], 15);
ptr_overlap_buf[i] = ptr_overlap_buf1[i];
@@ -358,6 +366,21 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
WORD32 *ptr_overlap_buf;
const WORD16 *ptr_long_window;
const WORD16 *ptr_short_window;
+ WORD16 max_bin_long = ptr_ics_info->frame_length;
+ WORD16 size_01;
+ if (max_bin_long == 960)
+ size_01 = (max_bin_long / 16);
+ else
+ size_01 = (MAX_BINS_LONG / 16);
+ WORD16 size_02 = 2 * size_01;
+ WORD16 size_04 = 4 * size_01;
+ WORD16 size_06 = 6 * size_01;
+ WORD16 size_07 = 7 * size_01;
+ WORD16 size_08 = 8 * size_01;
+ WORD16 size_09 = 9 * size_01;
+ WORD16 size_10 = 10 * size_01;
+ WORD16 size_14 = 14 * size_01;
+ WORD16 size_15 = 15 * size_01;
ptr_overlap_buf = ptr_aac_dec_overlap_info->ptr_overlap_buf;
ptr_long_window =
@@ -396,9 +419,10 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
ptr_spec_coeff[i + N + N / 2] = -ptr_spec_coeff[i + N / 2];
}
}
- } else
-
- {
+ } else if (960 == ptr_ics_info->frame_length) {
+ ixheaacd_mdct_960(ptr_spec_coeff, scratch, &imdct_scale, 0,
+ ptr_aac_tables->pstr_imdct_tables);
+ } else {
expo = (*ixheaacd_calc_max_spectral_line)(ptr_spec_coeff, 1024) - 1;
expo = 8 - expo;
@@ -428,15 +452,28 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
ptr_ics_info->qshift_adj = 2;
ptr_ics_info = tmp_ptr_ics_info;
}
+
+ if (960 == ptr_ics_info->frame_length)
+ {
+ ixheaacd_over_lap_add1_dec(ptr_spec_coeff, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window, q_shift,
+ 480, ch_fac);
+
+ ixheaacd_spec_to_overlapbuf(ptr_overlap_buf, ptr_spec_coeff,
+ q_shift, 480);
+
+ ptr_ics_info->qshift_adj = 2;
+ }
+
if ((512 == ptr_ics_info->frame_length) ||
(480 == ptr_ics_info->frame_length)) {
if (object_type != AOT_ER_AAC_ELD) {
if (512 == ptr_ics_info->frame_length) {
ixheaacd_lap1_512_480(ptr_spec_coeff, ptr_overlap_buf,
(WORD16 *)out_samples, ptr_long_window,
- q_shift, SIZE04, ch_fac, slot_element);
+ q_shift, size_04, ch_fac, slot_element);
ixheaacd_spec_to_overlapbuf(ptr_overlap_buf, ptr_spec_coeff,
- q_shift, SIZE04);
+ q_shift, size_04);
} else if (480 == ptr_ics_info->frame_length) {
ixheaacd_lap1_512_480(ptr_spec_coeff, ptr_overlap_buf,
(WORD16 *)out_samples, ptr_long_window,
@@ -466,22 +503,32 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
if (1024 == ptr_ics_info->frame_length) {
(*ixheaacd_post_twiddle)(scratch, ptr_spec_coeff,
ptr_aac_tables->pstr_imdct_tables, 1024);
+ ixheaacd_process_win_seq(scratch, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ ptr_short_window, q_shift, ch_fac, 1,
+ size_01);
+ (*ixheaacd_spec_to_overlapbuf)(ptr_overlap_buf, scratch, q_shift,
+ size_08);
+ }
+
+ if (960 == ptr_ics_info->frame_length) {
+ ixheaacd_process_win_seq(ptr_spec_coeff, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ ptr_short_window, q_shift, ch_fac, 1,
+ size_01);
+ ixheaacd_spec_to_overlapbuf(ptr_overlap_buf, ptr_spec_coeff,
+ q_shift, 480);
}
- ixheaacd_process_win_seq(scratch, ptr_overlap_buf,
- (WORD32 *)out_samples, ptr_long_window,
- ptr_short_window, q_shift, ch_fac, 1);
ptr_ics_info->qshift_adj = 1;
if (512 == ptr_ics_info->frame_length) {
ixheaacd_spec_to_overlapbuf(ptr_overlap_buf, ptr_spec_coeff,
- q_shift, SIZE04);
- } else if (480 == ptr_ics_info->frame_length) {
+ q_shift, size_04);
+ }
+ if (480 == ptr_ics_info->frame_length) {
ixheaacd_spec_to_overlapbuf(ptr_overlap_buf, ptr_spec_coeff,
q_shift, 240);
- } else {
- (*ixheaacd_spec_to_overlapbuf)(ptr_overlap_buf, scratch, q_shift,
- SIZE08);
}
break;
}
@@ -497,28 +544,51 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
case ONLY_LONG_SEQUENCE:
case LONG_STOP_SEQUENCE:
- (*ixheaacd_over_lap_add1)(scratch, ptr_overlap_buf,
- (WORD32 *)out_samples, ptr_long_window,
- q_shift, SIZE08, ch_fac);
-
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_over_lap_add1)(scratch, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ q_shift, size_08, ch_fac);
+ } else {
+ ixheaacd_over_lap_add1_dec(ptr_spec_coeff, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ q_shift, size_08, ch_fac);
+ }
ptr_ics_info->qshift_adj = 2;
break;
case LONG_START_SEQUENCE:
case EIGHT_SHORT_SEQUENCE:
- ixheaacd_process_win_seq(scratch, ptr_overlap_buf,
- (WORD32 *)out_samples, ptr_long_window,
- ptr_short_window, q_shift, ch_fac, 1);
+ if (1024 == ptr_ics_info->frame_length) {
+ ixheaacd_process_win_seq(scratch, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ ptr_short_window, q_shift, ch_fac, 1,
+ size_01);
+ } else {
+ ixheaacd_process_win_seq(ptr_spec_coeff, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ ptr_short_window, q_shift, ch_fac, 1,
+ size_01);
+ }
+
ptr_ics_info->qshift_adj = 1;
break;
}
- ixheaacd_nolap1_32(&scratch[SIZE01], ptr_overlap_buf, q_shift, 1);
+ if (960 != ptr_ics_info->frame_length) {
+ ixheaacd_nolap1_32(&scratch[size_01], ptr_overlap_buf, q_shift, 1,
+ size_01);
+
+ (*ixheaacd_spec_to_overlapbuf)(&ptr_overlap_buf[size_07], scratch,
+ q_shift, size_01);
+ } else {
+ ixheaacd_nolap1_32(&ptr_spec_coeff[size_01], ptr_overlap_buf,
+ q_shift, 1, size_01);
- (*ixheaacd_spec_to_overlapbuf)(&ptr_overlap_buf[SIZE07], scratch,
- q_shift, SIZE01);
+ (*ixheaacd_spec_to_overlapbuf)(&ptr_overlap_buf[size_07],
+ ptr_spec_coeff, q_shift, size_01);
+ }
break;
@@ -532,20 +602,36 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
case EIGHT_SHORT_SEQUENCE:
case LONG_START_SEQUENCE:
- (*ixheaacd_overlap_buf_out)((WORD32 *)out_samples, ptr_overlap_buf,
- SIZE07, ch_fac);
-
- (*ixheaacd_over_lap_add1)(
- &scratch[SIZE14], &ptr_overlap_buf[SIZE07],
- ((WORD32 *)out_samples + ch_fac * (SIZE07)), ptr_short_window,
- q_shift, SIZE01, ch_fac);
+ if (960 != ptr_ics_info->frame_length) {
+ (*ixheaacd_overlap_buf_out)((WORD32*)out_samples,
+ ptr_overlap_buf, size_07, ch_fac);
+ (*ixheaacd_over_lap_add1)(
+ &scratch[size_14], &ptr_overlap_buf[size_07],
+ ((WORD32*)out_samples + ch_fac * (size_07)),
+ ptr_short_window, q_shift, size_01, ch_fac);
+ } else {
+ ixheaacd_dec_copy_outsample((WORD32*)out_samples,
+ ptr_overlap_buf, size_07, ch_fac);
+ ixheaacd_over_lap_add1_dec(&ptr_spec_coeff[size_14],
+ &ptr_overlap_buf[size_07],
+ ((WORD32*)out_samples + ch_fac * (size_07)),
+ ptr_short_window, q_shift, size_01,
+ ch_fac);
+ }
{
- WORD16 q_shift1 = q_shift - 1;
+ if (960 != ptr_ics_info->frame_length) {
- (*ixheaacd_neg_shift_spec)(
- &scratch[SIZE08], ((WORD32 *)out_samples + ch_fac * SIZE09),
- q_shift1, ch_fac);
+ WORD16 q_shift1 = q_shift - 1;
+ (*ixheaacd_neg_shift_spec)(&scratch[size_08],
+ ((WORD32*)out_samples + ch_fac * size_09),
+ q_shift1, ch_fac);
+ } else {
+ WORD16 q_shift1 = q_shift - 1;
+ ixheaacd_Nolap_dec(&ptr_spec_coeff[size_08],
+ ((WORD32*)out_samples + ch_fac * size_09),
+ q_shift1, ch_fac, size_01);
+ }
}
ptr_ics_info->qshift_adj = 2;
@@ -553,16 +639,29 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
case ONLY_LONG_SEQUENCE:
case LONG_STOP_SEQUENCE:
- ixheaacd_process_win_seq(scratch, ptr_overlap_buf,
- (WORD32 *)out_samples, ptr_long_window,
- ptr_short_window, q_shift, ch_fac, 0);
+ if (1024 == ptr_ics_info->frame_length) {
+ ixheaacd_process_win_seq(scratch, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ ptr_short_window, q_shift, ch_fac, 0,
+ size_01);
+ } else {
+ ixheaacd_process_win_seq(ptr_spec_coeff, ptr_overlap_buf,
+ (WORD32*)out_samples, ptr_long_window,
+ ptr_short_window, q_shift, ch_fac, 0,
+ size_01);
+ }
ptr_ics_info->qshift_adj = 2;
break;
}
- (*ixheaacd_spec_to_overlapbuf)(ptr_overlap_buf, scratch, q_shift,
- SIZE08);
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_spec_to_overlapbuf)(ptr_overlap_buf, scratch, q_shift,
+ size_08);
+ } else {
+ (*ixheaacd_spec_to_overlapbuf)(ptr_overlap_buf, ptr_spec_coeff,
+ q_shift, size_08);
+ }
break;
}
@@ -578,56 +677,91 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
{
WORD32 expo;
- expo = (*ixheaacd_calc_max_spectral_line)(ptr_spec_coeff, 1024) - 1;
+ if (1024 == ptr_ics_info->frame_length) {
+ expo = (*ixheaacd_calc_max_spectral_line)(ptr_spec_coeff, 1024) - 1;
- expo = 5 - expo;
+ expo = 5 - expo;
- for (i = 0; i < MAX_WINDOWS; i++) {
- imdct_scale[i] = ixheaacd_inverse_transform(
- &ptr_spec_coeff[i * SIZE02], &scratch[i * SIZE02],
- ptr_aac_tables->pstr_imdct_tables, expo, 128);
+ for (i = 0; i < MAX_WINDOWS; i++) {
+ imdct_scale[i] = ixheaacd_inverse_transform(
+ &ptr_spec_coeff[i * size_02], &scratch[i * size_02],
+ ptr_aac_tables->pstr_imdct_tables, expo, 128);
- (*ixheaacd_post_twiddle)(&scratch[i * SIZE02],
- &ptr_spec_coeff[i * SIZE02],
+ (*ixheaacd_post_twiddle)(&scratch[i * size_02],
+ &ptr_spec_coeff[i * size_02],
ptr_aac_tables->pstr_imdct_tables, 128);
- }
- }
+ }
+ max_scale = 31 + imdct_scale[0];
+ q_shift = max_scale + (-16 - 6 - 1);
+ } else {
+ expo = (*ixheaacd_calc_max_spectral_line)(ptr_spec_coeff, 960) - 1;
+ memcpy(scratch, ptr_spec_coeff, sizeof(WORD32) * 960);
- max_scale = 31 + imdct_scale[0];
+ for (i = 0; i < MAX_WINDOWS; i++) {
+ ixheaacd_inverse_transform_960(
+ &ptr_spec_coeff[i * size_02], &scratch[i * size_02],
+ ptr_aac_tables->pstr_imdct_tables, expo, &imdct_scale[i]);
- q_shift = max_scale + (-16 - 6 - 1);
+ imdct_scale[i] -= expo;
+ }
+ max_scale = 31 + imdct_scale[0];
+ q_shift = max_scale + (-16 - 6 - 1);
+ }
+ }
switch (ptr_aac_dec_overlap_info->window_sequence) {
- WORD32 overlap_buf_loc[SIZE01];
+ WORD32 overlap_buf_loc[64];
case EIGHT_SHORT_SEQUENCE:
case LONG_START_SEQUENCE:
(*ixheaacd_overlap_buf_out)((WORD32 *)out_samples, ptr_overlap_buf,
- SIZE07, ch_fac);
+ size_07, ch_fac);
- (*ixheaacd_over_lap_add1)(&scratch[0], &ptr_overlap_buf[SIZE07],
- ((WORD32 *)out_samples + ch_fac * SIZE07),
- ptr_short_window, q_shift, SIZE01, ch_fac);
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_over_lap_add1)(&scratch[0], &ptr_overlap_buf[size_07],
+ ((WORD32*)out_samples + ch_fac * size_07),
+ ptr_short_window, q_shift, size_01, ch_fac);
+ } else {
+ ixheaacd_over_lap_add1_dec(&ptr_spec_coeff[0], &ptr_overlap_buf[size_07],
+ ((WORD32*)out_samples + ch_fac * size_07),
+ ptr_short_window, q_shift, size_01, ch_fac);
+ }
for (i = 0; i < 3; i++) {
- WORD32 inc = (i * SIZE02);
- (*ixheaacd_spec_to_overlapbuf)(overlap_buf_loc, &scratch[inc],
- q_shift, SIZE01);
-
- (*ixheaacd_over_lap_add1)(
- &scratch[SIZE02 + inc], overlap_buf_loc,
- ((WORD32 *)out_samples + ch_fac * (SIZE09 + inc)), short_window,
- q_shift, SIZE01, ch_fac);
+ WORD32 inc = (i * size_02);
+
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_spec_to_overlapbuf)(overlap_buf_loc, &scratch[inc],
+ q_shift, size_01);
+
+ (*ixheaacd_over_lap_add1)(&scratch[size_02 + inc], overlap_buf_loc,
+ ((WORD32*)out_samples + ch_fac * (size_09 + inc)),
+ short_window, q_shift, size_01, ch_fac);
+ } else {
+ (*ixheaacd_spec_to_overlapbuf)(overlap_buf_loc, &ptr_spec_coeff[inc],
+ q_shift, size_01);
+
+ ixheaacd_over_lap_add1_dec(&ptr_spec_coeff[size_02 + inc], overlap_buf_loc,
+ ((WORD32*)out_samples + ch_fac * (size_09 + inc)),
+ short_window, q_shift, size_01, ch_fac);
+ }
}
- (*ixheaacd_over_lap_add2)(&scratch[SIZE08], &scratch[SIZE06],
- ptr_overlap_buf, short_window, q_shift,
- SIZE01, 1);
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_over_lap_add2)(&scratch[size_08], &scratch[size_06],
+ ptr_overlap_buf, short_window, q_shift,
+ size_01, 1);
+ } else {
+ ixheaacd_over_lap_add2_dec(&ptr_spec_coeff[size_08], &ptr_spec_coeff[size_06],
+ ptr_overlap_buf, short_window, q_shift,
+ size_01, 1);
+ }
- (*ixheaacd_overlap_out_copy)(((WORD32 *)out_samples + ch_fac * SIZE15),
- ptr_overlap_buf, &ptr_overlap_buf[SIZE01],
- ch_fac);
+
+ (*ixheaacd_overlap_out_copy)(((WORD32 *)out_samples + ch_fac * size_15),
+ ptr_overlap_buf, &ptr_overlap_buf[size_01],
+ ch_fac, size_01);
ptr_ics_info->qshift_adj = 2;
@@ -636,35 +770,53 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
case ONLY_LONG_SEQUENCE:
case LONG_STOP_SEQUENCE:
- ixheaacd_long_short_win_seq(
- scratch, ptr_overlap_buf, (WORD32 *)out_samples, short_window,
- ptr_short_window, ptr_long_window, q_shift, ch_fac);
+ if (1024 == ptr_ics_info->frame_length) {
+
+ ixheaacd_long_short_win_seq(
+ scratch, ptr_overlap_buf, (WORD32*)out_samples, short_window,
+ ptr_short_window, ptr_long_window, q_shift, ch_fac, size_01);
+ } else {
+ ixheaacd_long_short_win_seq(
+ ptr_spec_coeff, ptr_overlap_buf, (WORD32*)out_samples, short_window,
+ ptr_short_window, ptr_long_window, q_shift, ch_fac, size_01);
+ }
ptr_ics_info->qshift_adj = 2;
-
break;
}
for (i = 0; i < 3; i++) {
- WORD32 inc = (i * SIZE02);
- (*ixheaacd_over_lap_add2)(&scratch[SIZE10 + inc], &scratch[SIZE08 + inc],
- &ptr_overlap_buf[SIZE01 + inc], short_window,
- q_shift, SIZE01, 1);
+ WORD32 inc = (i * size_02);
+
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_over_lap_add2)(&scratch[size_10 + inc], &scratch[size_08 + inc],
+ &ptr_overlap_buf[size_01 + inc], short_window,
+ q_shift, size_01, 1);
+ } else {
+ ixheaacd_over_lap_add2_dec(&ptr_spec_coeff[size_10 + inc],
+ &ptr_spec_coeff[size_08 + inc],
+ &ptr_overlap_buf[size_01 + inc],
+ short_window, q_shift, size_01, 1);
+ }
}
- (*ixheaacd_spec_to_overlapbuf)(&ptr_overlap_buf[SIZE07], &scratch[SIZE14],
- q_shift, SIZE01);
+ if (1024 == ptr_ics_info->frame_length) {
+ (*ixheaacd_spec_to_overlapbuf)(&ptr_overlap_buf[size_07], &scratch[size_14],
+ q_shift, size_01);
+ } else {
+ (*ixheaacd_spec_to_overlapbuf)(&ptr_overlap_buf[size_07], &ptr_spec_coeff[size_14],
+ q_shift, size_01);
+ }
}
ptr_aac_dec_overlap_info->window_shape = ptr_ics_info->window_shape;
ptr_aac_dec_overlap_info->window_sequence = ptr_ics_info->window_sequence;
}
+
void ixheaacd_eld_dec_windowing(WORD32 *ptr_spect_coeff, const WORD16 *p_win,
WORD32 framesize, WORD16 q_shift,
WORD32 *p_overlap_buffer, const WORD16 stride,
- VOID *out_samples_t, WORD slot_element)
-
-{
+ VOID *out_samples_t, WORD slot_element) {
int i = 0;
int loop_size;
WORD32 *ptr_z = ptr_spect_coeff;
diff --git a/decoder/ixheaacd_lpp_tran.c b/decoder/ixheaacd_lpp_tran.c
index 2605673..8af8ca9 100644
--- a/decoder/ixheaacd_lpp_tran.c
+++ b/decoder/ixheaacd_lpp_tran.c
@@ -74,6 +74,9 @@
#define LPC_SCALE_FACTOR 2
+#define AUTO_CORR_LEN_1024 38
+#define AUTO_CORR_LEN_960 36
+
#define SHIFT 5
static PLATFORM_INLINE WORD32 ixheaacd_mult32x16hin32(WORD32 a, WORD32 b) {
@@ -171,17 +174,17 @@ VOID ixheaacd_filterstep3(WORD16 a0r, WORD16 a0i, WORD16 a1r, WORD16 a1i,
}
}
-VOID ixheaacd_covariance_matrix_calc_dec(
- WORD32 *sub_sign_xlow, ixheaacd_lpp_trans_cov_matrix *cov_matrix,
- WORD32 count) {
+VOID ixheaacd_covariance_matrix_calc_dec_960(
+ WORD32 *sub_sign_xlow, ia_lpp_trans_cov_matrix *cov_matrix,
+ WORD32 count, WORD32 len) {
WORD32 j, k;
WORD32 ixheaacd_drc_offset = 2;
- WORD32 len = 38;
WORD32 factor;
WORD32 max_val, q_factor;
WORD32 temp1, temp2, temp3, temp4;
WORD32 *temp_buf_ptr = sub_sign_xlow;
+ temp3 = 0;
for (k = count; k > 0; k--) {
WORD32 t_phi_01 = 0, t_phi_02 = 0, t_phi_11 = 0;
WORD32 t_phi_12 = 0, t_phi_22 = 0;
@@ -196,7 +199,7 @@ VOID ixheaacd_covariance_matrix_calc_dec(
temp2 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
sub_sign_xlow += 64;
- for (; (j = j + 3) < ixheaacd_drc_offset + len;) {
+ for (; (j = j + 3) <= ixheaacd_drc_offset + len;) {
temp3 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
sub_sign_xlow += 64;
@@ -219,19 +222,128 @@ VOID ixheaacd_covariance_matrix_calc_dec(
t_phi_11 += ixheaacd_mult32x16hin32(temp1, temp1);
}
- temp3 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
- sub_sign_xlow += 64;
+ if (AUTO_CORR_LEN_1024 == len) {
+ temp3 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp3, temp2);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp3, temp1);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp2, temp2);
+
+ temp1 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp1, temp3);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp1, temp2);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp3, temp3);
+ }
+
+ temp2 = ixheaacd_shl32_dir(*temp_buf_ptr, factor);
+ temp4 = ixheaacd_shl32_dir(*(temp_buf_ptr + 64), factor);
+
+ if (AUTO_CORR_LEN_960 == len) {
+ temp3 = ixheaacd_shl32_dir(sub_sign_xlow[-128], factor);
+ temp1 = ixheaacd_shl32_dir(sub_sign_xlow[-64], factor);
+ }
+
+ t_phi_12 = (t_phi_01 - ixheaacd_mult32x16hin32(temp1, temp3) +
+ ixheaacd_mult32x16hin32(temp4, temp2));
+
+ t_phi_22 = (t_phi_11 - ixheaacd_mult32x16hin32(temp3, temp3) +
+ ixheaacd_mult32x16hin32(temp2, temp2));
+
+ max_val = ixheaacd_abs32_nrm(t_phi_01);
+ max_val = max_val | ixheaacd_abs32_nrm(t_phi_02);
+ max_val = max_val | ixheaacd_abs32_nrm(t_phi_12);
+ max_val = max_val | (t_phi_11);
+ max_val = max_val | (t_phi_22);
+
+ q_factor = ixheaacd_pnorm32(max_val);
+
+ cov_matrix->phi_11 = (t_phi_11 << q_factor);
+ cov_matrix->phi_22 = (t_phi_22 << q_factor);
+ cov_matrix->phi_01 = (t_phi_01 << q_factor);
+ cov_matrix->phi_02 = (t_phi_02 << q_factor);
+ cov_matrix->phi_12 = (t_phi_12 << q_factor);
+
+ cov_matrix->d = ixheaacd_sub32_sat(
+ ixheaacd_mult32(cov_matrix->phi_22, cov_matrix->phi_11),
+ ixheaacd_mult32(cov_matrix->phi_12, cov_matrix->phi_12));
+
+ cov_matrix++;
+ temp_buf_ptr++;
+ }
+ return;
+}
+
+VOID ixheaacd_covariance_matrix_calc_dec(
+ WORD32 *sub_sign_xlow, ia_lpp_trans_cov_matrix *cov_matrix,
+ WORD32 count, WORD32 len) {
+ WORD32 j, k;
+ WORD32 ixheaacd_drc_offset = 2;
+ WORD32 factor;
+ WORD32 max_val, q_factor;
+ WORD32 temp1, temp2, temp3, temp4;
+ WORD32 *temp_buf_ptr = sub_sign_xlow;
- t_phi_01 += ixheaacd_mult32x16hin32(temp3, temp2);
- t_phi_02 += ixheaacd_mult32x16hin32(temp3, temp1);
- t_phi_11 += ixheaacd_mult32x16hin32(temp2, temp2);
+ for (k = count; k > 0; k--) {
+ WORD32 t_phi_01 = 0, t_phi_02 = 0, t_phi_11 = 0;
+ WORD32 t_phi_12 = 0, t_phi_22 = 0;
+
+ factor = -3;
+ j = ixheaacd_drc_offset;
+ sub_sign_xlow = temp_buf_ptr;
temp1 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
sub_sign_xlow += 64;
- t_phi_01 += ixheaacd_mult32x16hin32(temp1, temp3);
- t_phi_02 += ixheaacd_mult32x16hin32(temp1, temp2);
- t_phi_11 += ixheaacd_mult32x16hin32(temp3, temp3);
+ temp2 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ for (; (j = j + 3) <= ixheaacd_drc_offset + len;) {
+ temp3 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp3, temp2);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp3, temp1);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp2, temp2);
+
+ temp1 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp1, temp3);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp1, temp2);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp3, temp3);
+
+ temp2 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp2, temp1);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp2, temp3);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp1, temp1);
+ }
+
+ if (AUTO_CORR_LEN_960 != len) {
+ temp3 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp3, temp2);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp3, temp1);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp2, temp2);
+
+ temp1 = ixheaacd_shl32_dir(*sub_sign_xlow, factor);
+ sub_sign_xlow += 64;
+
+ t_phi_01 += ixheaacd_mult32x16hin32(temp1, temp3);
+ t_phi_02 += ixheaacd_mult32x16hin32(temp1, temp2);
+ t_phi_11 += ixheaacd_mult32x16hin32(temp3, temp3);
+ }
+ if (AUTO_CORR_LEN_960 == len) {
+ temp3 = ixheaacd_shl32_dir(sub_sign_xlow[-128], factor);
+
+ temp3 = ixheaacd_shl32_dir(sub_sign_xlow[-64], factor);
+
+ }
temp2 = ixheaacd_shl32_dir(*temp_buf_ptr, factor);
temp4 = ixheaacd_shl32_dir(*(temp_buf_ptr + 64), factor);
@@ -268,13 +380,13 @@ VOID ixheaacd_covariance_matrix_calc_dec(
}
VOID ixheaacd_covariance_matrix_calc_2_dec(
- ixheaacd_lpp_trans_cov_matrix *cov_matrix,
+ ia_lpp_trans_cov_matrix *cov_matrix,
WORD32 *real_buffer, WORD32 num_bands, WORD16 slots) {
WORD32 k;
WORD32 *img_buffer;
WORD32 *ptr_real = real_buffer;
- ixheaacd_lpp_trans_cov_matrix *pac_arr = cov_matrix;
+ ia_lpp_trans_cov_matrix *pac_arr = cov_matrix;
for (k = 0; k < num_bands; k++) {
WORD32 t_phi_11 = 0, t_phi_01 = 0, t_phi_01_i = 0;
@@ -561,7 +673,7 @@ static PLATFORM_INLINE VOID ixheaacd_filt_step3_lp(WORD len, WORD32 coef1,
}
VOID ixheaacd_filter1_lp(ia_sbr_hf_generator_struct *hf_generator,
- ixheaacd_lpp_trans_cov_matrix *cov_matrix_seq,
+ ia_lpp_trans_cov_matrix *cov_matrix_seq,
WORD32 *bw_array, WORD16 *degree_alias,
WORD32 start_idx, WORD32 stop_idx,
WORD32 max_qmf_subband, WORD32 start_patch,
@@ -582,7 +694,7 @@ VOID ixheaacd_filter1_lp(ia_sbr_hf_generator_struct *hf_generator,
memset(bw_index, 0, sizeof(WORD32) * num_patches);
for (low_band = start_patch; low_band < stop_patch; low_band++) {
- ixheaacd_lpp_trans_cov_matrix *p_cov_matrix = &cov_matrix_seq[low_band];
+ ia_lpp_trans_cov_matrix *p_cov_matrix = &cov_matrix_seq[low_band];
alpha_real[1] = 0;
alpha_real[0] = 0;
@@ -751,10 +863,11 @@ VOID ixheaacd_low_pow_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
ia_patch_param_struct *patch_param =
hf_generator->pstr_settings->str_patch_param;
WORD32 patch;
- ixheaacd_lpp_trans_cov_matrix cov_matrix_seq[MAX_COLS];
+ ia_lpp_trans_cov_matrix cov_matrix_seq[MAX_COLS];
WORD32 actual_stop_band;
WORD32 num_patches = hf_generator->pstr_settings->num_patches;
+ WORD32 auto_corr_length = hf_generator->pstr_settings->num_columns + 6;
stop_idx = (hf_generator->pstr_settings->num_columns + stop_idx);
@@ -798,13 +911,20 @@ VOID ixheaacd_low_pow_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
}
}
if (norm_max != 30) {
- (*ixheaacd_covariance_matrix_calc)(sub_sig_x + start_patch,
- &cov_matrix_seq[start_patch],
- (stop_patch - start_patch));
-
+ if (30 == hf_generator->pstr_settings->num_columns) {
+ (*ixheaacd_covariance_matrix_calc_960)(sub_sig_x + start_patch,
+ &cov_matrix_seq[start_patch],
+ (stop_patch - start_patch),
+ auto_corr_length);
+ }
+ else
+ (*ixheaacd_covariance_matrix_calc)(sub_sig_x + start_patch,
+ &cov_matrix_seq[start_patch],
+ (stop_patch - start_patch),
+ auto_corr_length);
} else {
memset(&cov_matrix_seq[0], 0,
- sizeof(ixheaacd_lpp_trans_cov_matrix) * stop_patch);
+ sizeof(ia_lpp_trans_cov_matrix) * stop_patch);
}
ixheaacd_filter1_lp(hf_generator, cov_matrix_seq, bw_array, degree_alias,
@@ -867,13 +987,15 @@ VOID ixheaacd_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
WORD16 bw = 0;
- ixheaacd_lpp_trans_cov_matrix cov_matrix;
- ixheaacd_lpp_trans_cov_matrix cov_matrix_seq[MAX_COLS];
+ ia_lpp_trans_cov_matrix cov_matrix;
+ ia_lpp_trans_cov_matrix cov_matrix_seq[MAX_COLS];
WORD32 common_scale;
WORD32 actual_stop_band;
WORD32 num_patches = hf_generator->pstr_settings->num_patches;
+ WORD32 auto_corr_length = hf_generator->pstr_settings->num_columns + 6;
+
start_idx = (start_idx * factor);
stop_idx = (hf_generator->pstr_settings->num_columns + (stop_idx * factor));
@@ -915,15 +1037,31 @@ VOID ixheaacd_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
}
if (audio_object_type != AOT_ER_AAC_ELD &&
audio_object_type != AOT_ER_AAC_LD) {
- (*ixheaacd_covariance_matrix_calc_2)(
- &cov_matrix_seq[start_patch],
- (sub_sig_x + start_patch + LPC_ORDER * 128), (stop_patch - start_patch),
- 38);
+ if (auto_corr_length == 36) {
+ (*ixheaacd_covariance_matrix_calc_2)(
+ &cov_matrix_seq[start_patch],
+ (sub_sig_x + start_patch + LPC_ORDER * 128),
+ (stop_patch - start_patch), auto_corr_length);
+ } else {
+ (*ixheaacd_covariance_matrix_calc_2)(
+ &cov_matrix_seq[start_patch],
+ (sub_sig_x + start_patch + LPC_ORDER * 128),
+ (stop_patch - start_patch), 38);
+ }
} else {
- (*ixheaacd_covariance_matrix_calc_2)(
- &cov_matrix_seq[start_patch],
- (sub_sig_x + start_patch + LPC_ORDER * 128), (stop_patch - start_patch),
- 16);
+ if (hf_generator->pstr_settings->num_columns == 15)
+ {
+ (*ixheaacd_covariance_matrix_calc_2)(
+ &cov_matrix_seq[start_patch],
+ (sub_sig_x + start_patch + LPC_ORDER * 128),
+ (stop_patch - start_patch),
+ hf_generator->pstr_settings->num_columns);
+ } else {
+ (*ixheaacd_covariance_matrix_calc_2)(
+ &cov_matrix_seq[start_patch],
+ (sub_sig_x + start_patch + LPC_ORDER * 128),
+ (stop_patch - start_patch), 16);
+ }
}
for (low_band = start_patch; low_band < stop_patch; low_band++) {
diff --git a/decoder/ixheaacd_lpp_tran.h b/decoder/ixheaacd_lpp_tran.h
index e741412..7c27d72 100644
--- a/decoder/ixheaacd_lpp_tran.h
+++ b/decoder/ixheaacd_lpp_tran.h
@@ -34,7 +34,7 @@ typedef struct {
WORD32 phi_02_im;
WORD32 phi_12_im;
WORD32 d;
-} ixheaacd_lpp_trans_cov_matrix;
+} ia_lpp_trans_cov_matrix;
typedef struct {
WORD16 src_start_band;
@@ -88,19 +88,23 @@ struct ixheaacd_lpp_trans_patch {
};
VOID ixheaacd_covariance_matrix_calc_dec(
- WORD32 *sub_sign_xlow, ixheaacd_lpp_trans_cov_matrix *cov_matrix,
- WORD32 count);
+ WORD32 *sub_sign_xlow, ia_lpp_trans_cov_matrix *cov_matrix,
+ WORD32 count, WORD32 auto_corr_length);
+
+VOID ixheaacd_covariance_matrix_calc_dec_960(
+ WORD32 *sub_sign_xlow, ia_lpp_trans_cov_matrix *cov_matrix,
+ WORD32 count, WORD32 auto_corr_length);
VOID ixheaacd_covariance_matrix_calc_armv7(
- WORD32 *sub_sign_xlow, ixheaacd_lpp_trans_cov_matrix *cov_matrix,
+ WORD32 *sub_sign_xlow, ia_lpp_trans_cov_matrix *cov_matrix,
WORD32 count);
VOID ixheaacd_covariance_matrix_calc_2_dec(
- ixheaacd_lpp_trans_cov_matrix *cov_matrix, WORD32 *real_buffer,
+ ia_lpp_trans_cov_matrix *cov_matrix, WORD32 *real_buffer,
WORD32 ixheaacd_num_bands, WORD16 slots);
VOID ixheaacd_covariance_matrix_calc_2_armv7(
- ixheaacd_lpp_trans_cov_matrix *cov_matrix, WORD32 *real_buffer,
+ ia_lpp_trans_cov_matrix *cov_matrix, WORD32 *real_buffer,
WORD32 ixheaacd_num_bands, WORD16 slots);
#endif /* IXHEAACD_LPP_TRAN_H */
diff --git a/decoder/ixheaacd_mps_parse.c b/decoder/ixheaacd_mps_parse.c
index 1212c4c..7f1f8e8 100644
--- a/decoder/ixheaacd_mps_parse.c
+++ b/decoder/ixheaacd_mps_parse.c
@@ -1405,7 +1405,7 @@ WORD32 ixheaacd_mps_header_decode(ia_mps_dec_state_struct *self) {
ixheaacd_hybrid_band_71_to_processing_band_7_map;
break;
case 10:
- self->hyb_band_to_processing_band_table =
+ self->hyb_band_to_processing_band_table =
ixheaacd_hybrid_band_71_to_processing_band_10_map;
break;
case 14:
diff --git a/decoder/ixheaacd_mps_pre_mix.c b/decoder/ixheaacd_mps_pre_mix.c
index b61d7e3..ffbf1e1 100644
--- a/decoder/ixheaacd_mps_pre_mix.c
+++ b/decoder/ixheaacd_mps_pre_mix.c
@@ -64,6 +64,9 @@
#define P_PI 3.1415926535897932
#define PI_IN_Q28 843314880
+#define Q28_FLOAT_VAL ((FLOAT32)(1 << 28))
+#define ONE_BY_Q28_FLOAT_VAL (1.0f / Q28_FLOAT_VAL)
+
extern const WORD32 ixheaacd_atan_table_Q28[16][8][31];
extern const WORD32 ixheaacd_ipd_de_quant_table_q28[16];
@@ -270,8 +273,6 @@ VOID ixheaacd_mps_par2umx_ps_ipd_opd(ia_mps_dec_state_struct *self,
WORD32 ipd_idx = curr_bit_stream->ipd_idx[param_set_idx][band] & 15;
WORD32 ipd = ixheaacd_ipd_de_quant_table_q28[ipd_idx];
-#define Q28_FLOAT_VAL ((float)(1 << 28))
-#define ONE_BY_Q28_FLOAT_VAL (1.0f / Q28_FLOAT_VAL)
self->phase_l[param_set_idx][band] =
ixheaacd_mps_phase_wraping(opd[band]) * ONE_BY_Q28_FLOAT_VAL;
self->phase_r[param_set_idx][band] =
@@ -428,7 +429,7 @@ WORD32 ixheaacd_mps_apply_mix_matrix(ia_mps_dec_state_struct *self) {
return err;
if (complex_m2 && !phase_interpolation) {
- err = ixheaacd_mps_upmix_interp(self->m2_decor_im, self->r_out_diff_im_in_m2,
+ err = ixheaacd_mps_upmix_interp(self->m2_decor_im, self->r_out_diff_im_in_m2,
self->m2_decor_im_prev, self->out_ch_count,
(self->dir_sig_count + self->decor_sig_count),
self, 1);
diff --git a/decoder/ixheaacd_mps_smoothing.c b/decoder/ixheaacd_mps_smoothing.c
index 63c6154..c4354b9 100644
--- a/decoder/ixheaacd_mps_smoothing.c
+++ b/decoder/ixheaacd_mps_smoothing.c
@@ -42,6 +42,9 @@
#include "ixheaacd_basic_ops32.h"
#include "ixheaacd_basic_ops40.h"
+#define Q28_FLOAT_VAL ((float)(1 << 28))
+#define ONE_BY_Q28_FLOAT_VAL (1.0f / Q28_FLOAT_VAL)
+
VOID ixheaacd_mps_pre_matrix_mix_matrix_smoothing(
ia_mps_dec_state_struct *self) {
WORD32 smooth_band;
@@ -166,8 +169,6 @@ VOID ixheaacd_mps_smoothing_opd(ia_mps_dec_state_struct *self) {
for (pb = 0; pb < self->bs_param_bands; pb++) {
WORD32 ltemp, rtemp, tmp;
-#define Q28_FLOAT_VAL ((float)(1 << 28))
-#define ONE_BY_Q28_FLOAT_VAL (1.0 / Q28_FLOAT_VAL)
ltemp = ((WORD32)(self->phase_l[ps][pb] * Q28_FLOAT_VAL)) >> 1;
rtemp = ((WORD32)(self->phase_r[ps][pb] * Q28_FLOAT_VAL)) >> 1;
@@ -209,10 +210,7 @@ VOID ixheaacd_mps_smoothing_opd(ia_mps_dec_state_struct *self) {
self->opd_smooth.smooth_r_phase[pb] -= 2 * PI_IN_Q27;
while (self->opd_smooth.smooth_r_phase[pb] < 0)
self->opd_smooth.smooth_r_phase[pb] += 2 * PI_IN_Q27;
-#define Q28_FLOAT_VAL ((float)(1 << 28))
-#ifndef ONE_BY_Q28_FLOAT_VAL
-#define ONE_BY_Q28_FLOAT_VAL (1.0f / Q28_FLOAT_VAL)
-#endif
+
self->phase_l[ps][pb] =
(self->opd_smooth.smooth_l_phase[pb] << 1) * ONE_BY_Q28_FLOAT_VAL;
self->phase_r[ps][pb] =
diff --git a/decoder/ixheaacd_peak_limiter.c b/decoder/ixheaacd_peak_limiter.c
index 9c99e94..a35c474 100644
--- a/decoder/ixheaacd_peak_limiter.c
+++ b/decoder/ixheaacd_peak_limiter.c
@@ -111,7 +111,7 @@ VOID ixheaacd_peak_limiter_process(ia_peak_limiter_struct *peak_limiter,
tmp = 0.0f;
for (j = 0; j < num_channels; j++) {
FLOAT32 gain_t = (FLOAT32)(1 << *(qshift_adj + j));
- tmp = MAX(tmp, fabs((samples[i * num_channels + j] * gain_t)));
+ tmp = (FLOAT32)MAX(tmp, fabs((samples[i * num_channels + j] * gain_t)));
}
max_buf[peak_limiter->cir_buf_pnt] = tmp;
@@ -167,14 +167,14 @@ VOID ixheaacd_peak_limiter_process(ia_peak_limiter_struct *peak_limiter,
tmp *= gain;
- tmp_fix = tmp;
+ tmp_fix = (WORD64)tmp;
if (tmp_fix > limit_threshold)
tmp_fix = limit_threshold;
else if (tmp_fix < -limit_threshold)
tmp_fix = -limit_threshold;
- samples[i * num_channels + j] = tmp_fix;
+ samples[i * num_channels + j] = (WORD32)tmp_fix;
}
delayed_input_index++;
@@ -189,7 +189,7 @@ VOID ixheaacd_peak_limiter_process(ia_peak_limiter_struct *peak_limiter,
FLOAT32 gain_t = (FLOAT32)(1 << *(qshift_adj + j));
delayed_input[delayed_input_index * num_channels + j] =
samples[i * num_channels + j] * gain_t;
- samples[i * num_channels + j] = tmp;
+ samples[i * num_channels + j] = (WORD32)tmp;
}
delayed_input_index++;
diff --git a/decoder/ixheaacd_pns_js_thumb.c b/decoder/ixheaacd_pns_js_thumb.c
index 39985dc..47b2aaf 100644
--- a/decoder/ixheaacd_pns_js_thumb.c
+++ b/decoder/ixheaacd_pns_js_thumb.c
@@ -113,6 +113,7 @@ VOID ixheaacd_pns_process(
&ptr_aac_dec_channel_info[channel]->str_pns_info;
ia_ics_info_struct *ptr_ics_info =
&ptr_aac_dec_channel_info[channel]->str_ics_info;
+ WORD16 maximum_bins_short = ptr_ics_info->frame_length >> 3;
WORD32 *ptr_scale_mant_tab =
ptr_aac_tables->pstr_block_tables->scale_mant_tab;
@@ -181,7 +182,10 @@ VOID ixheaacd_pns_process(
}
}
- spec += 128;
+ if (maximum_bins_short == 120)
+ spec += maximum_bins_short;
+ else
+ spec += 128;
}
}
}
@@ -252,6 +256,7 @@ VOID ixheaacd_aac_tns_process(
WORD win, filt, start, stop, size, scale_spec;
ia_ics_info_struct *ptr_ics_info = &ptr_aac_dec_channel_info->str_ics_info;
WORD num_window, tns_max_bands, win_seq;
+ WORD16 maximum_bins_short = ptr_ics_info->frame_length >> 3;
WORD position;
WORD32 parcor_coef[MAX_ORDER + 1];
@@ -262,6 +267,8 @@ VOID ixheaacd_aac_tns_process(
const WORD16 *ptr_sfb_table;
+ WORD16 max_bin_long = ptr_ics_info->frame_length;
+
win_seq = ptr_ics_info->window_sequence == 0
? 0
: (ptr_ics_info->window_sequence % 2 == 0);
@@ -348,16 +355,36 @@ VOID ixheaacd_aac_tns_process(
}
{
- WORD32 *ptr_tmp = spec + (win << 7) + start;
+ WORD32 *ptr_tmp;
+
+ if (maximum_bins_short == 120)
+ ptr_tmp = spec + (win * maximum_bins_short) + start;
+ else
+ ptr_tmp = spec + (win << 7) + start;
+
scale_spec = (*ixheaacd_calc_max_spectral_line)(ptr_tmp, size);
}
if (filter->direction == -1) {
position = stop - 1;
- if (((win << 7) + position) < filter->order) continue;
+
+ if (maximum_bins_short == 120)
+ {
+ if (((win * maximum_bins_short) + position) < filter->order) continue;
+ }
+ else
+ {
+ if (((win << 7) + position) < filter->order) continue;
+ }
+
} else {
position = start;
- if ((((win << 7) + position) + filter->order) > MAX_BINS_LONG) continue;
+ if (maximum_bins_short == 120) {
+ if ((((win * maximum_bins_short) + position) + filter->order) > max_bin_long)
+ continue;
+ } else {
+ if ((((win << 7) + position) + filter->order) > MAX_BINS_LONG) continue;
+ }
}
if ((num_ch <= 2) &&
@@ -378,28 +405,52 @@ VOID ixheaacd_aac_tns_process(
if ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_AAC_LTP) ||
(num_ch > 2)) {
if (ar_flag)
- (*ixheaacd_tns_ar_filter_fixed)(&spec[(win << 7) + position], size,
- filter->direction,
- (WORD32 *)lpc_coef, filter->order,
- (WORD32)scale_lpc, scale_spec);
- else
- ixheaacd_tns_ma_filter_fixed_ld(&spec[(win << 7) + position], size,
- filter->direction, lpc_coef,
- filter->order, scale_lpc);
-
+ {
+ if (maximum_bins_short == 120) {
+ (*ixheaacd_tns_ar_filter_fixed)(&spec[(win * maximum_bins_short) + position],
+ size, filter->direction,
+ (WORD32 *)lpc_coef, filter->order,
+ (WORD32)scale_lpc, scale_spec);
+ } else {
+ (*ixheaacd_tns_ar_filter_fixed)(&spec[(win << 7) + position], size,
+ filter->direction,
+ (WORD32 *)lpc_coef, filter->order,
+ (WORD32)scale_lpc, scale_spec);
+ }
+ } else {
+ if (maximum_bins_short == 120) {
+ ixheaacd_tns_ma_filter_fixed_ld(&spec[(win * maximum_bins_short) + position],
+ size, filter->direction, lpc_coef,
+ filter->order, scale_lpc);
+ } else {
+ ixheaacd_tns_ma_filter_fixed_ld(&spec[(win << 7) + position], size,
+ filter->direction, lpc_coef,
+ filter->order, scale_lpc);
+ }
+ }
} else {
if (object_type == AOT_ER_AAC_ELD) scale_spec = scale_spec - 1;
-
- (*ixheaacd_tns_ar_filter)(&spec[(win << 7) + position], size,
- filter->direction, lpc_coef_16,
- filter->order, (WORD32)scale_lpc,
- scale_spec, scratch_buf);
+ if (maximum_bins_short == 120) {
+ (*ixheaacd_tns_ar_filter)(&spec[(win * maximum_bins_short) + position], size,
+ filter->direction, lpc_coef_16,
+ filter->order, (WORD32)scale_lpc,
+ scale_spec, scratch_buf);
+ } else {
+ (*ixheaacd_tns_ar_filter)(&spec[(win << 7) + position], size,
+ filter->direction, lpc_coef_16,
+ filter->order, (WORD32)scale_lpc,
+ scale_spec, scratch_buf);
+ }
}
-
}
else {
- WORD32 *ptr_tmp = spec + (win << 7) + start;
+ WORD32 *ptr_tmp;
+
+ if (maximum_bins_short == 120)
+ ptr_tmp = spec + (win * maximum_bins_short) + start;
+ else
+ ptr_tmp = spec + (win >> 7) + start;
scale_spec = -scale_spec;
scale_spec = ixheaacd_min32(scale_spec, 31);
@@ -411,25 +462,47 @@ VOID ixheaacd_aac_tns_process(
if ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_AAC_LTP) ||
num_ch > 2) {
- if (ar_flag)
- (*ixheaacd_tns_ar_filter_fixed)(
- &spec[(win << 7) + position], size, filter->direction,
- (WORD32 *)lpc_coef, filter->order, scale_lpc, 0);
-
- else
- ixheaacd_tns_ma_filter_fixed_ld(&spec[(win << 7) + position], size,
- filter->direction, lpc_coef,
- filter->order, scale_lpc);
+ if (ar_flag) {
+ if (maximum_bins_short == 120) {
+ (*ixheaacd_tns_ar_filter_fixed)(
+ &spec[(win * maximum_bins_short) + position], size, filter->direction,
+ (WORD32 *)lpc_coef, filter->order, scale_lpc, 0);
+ } else {
+ (*ixheaacd_tns_ar_filter_fixed)(
+ &spec[(win << 7) + position], size, filter->direction,
+ (WORD32 *)lpc_coef, filter->order, scale_lpc, 0);
+ }
+ } else {
+ if (maximum_bins_short == 120) {
+ ixheaacd_tns_ma_filter_fixed_ld(&spec[(win * maximum_bins_short) + position],
+ size, filter->direction, lpc_coef,
+ filter->order, scale_lpc);
+ } else {
+ ixheaacd_tns_ma_filter_fixed_ld(&spec[(win << 7) + position], size,
+ filter->direction, lpc_coef,
+ filter->order, scale_lpc);
+ }
+ }
} else {
if (object_type == AOT_ER_AAC_ELD) {
scale_lpc = scale_lpc - 1;
}
- (*ixheaacd_tns_ar_filter)(&spec[(win << 7) + position], size,
- filter->direction, lpc_coef_16,
- filter->order, scale_lpc, 0, scratch_buf);
+
+ if (maximum_bins_short == 120) {
+ (*ixheaacd_tns_ar_filter)(&spec[(win * maximum_bins_short) + position], size,
+ filter->direction, lpc_coef_16,
+ filter->order, scale_lpc, 0, scratch_buf);
+ } else {
+ (*ixheaacd_tns_ar_filter)(&spec[(win << 7) + position], size,
+ filter->direction, lpc_coef_16,
+ filter->order, scale_lpc, 0, scratch_buf);
+ }
}
- ptr_tmp = spec + (win << 7) + start;
+ if (maximum_bins_short == 120)
+ ptr_tmp = spec + (win * maximum_bins_short) + start;
+ else
+ ptr_tmp = spec + (win << 7) + start;
for (i = size; i != 0; i--) {
*ptr_tmp = (*ptr_tmp << scale_spec);
diff --git a/decoder/ixheaacd_process.c b/decoder/ixheaacd_process.c
index 13513d9..426ab59 100644
--- a/decoder/ixheaacd_process.c
+++ b/decoder/ixheaacd_process.c
@@ -135,7 +135,7 @@ IA_ERRORCODE ixheaacd_esbr_process(ia_usac_data_struct *usac_data,
err_code = ixheaacd_applysbr(self, esbr_bit_str, NULL, &num_channels, 1, 0, 0,
&sbr_scratch_struct, 0, 1, 0, it_bit_buff, NULL,
- 0, audio_object_type, 0, 0);
+ 0, audio_object_type, 0, 0, 1024);
usac_data->sbr_mode = self->sbr_mode;
diff --git a/decoder/ixheaacd_ps_bitdec.c b/decoder/ixheaacd_ps_bitdec.c
index 786bad7..298b602 100644
--- a/decoder/ixheaacd_ps_bitdec.c
+++ b/decoder/ixheaacd_ps_bitdec.c
@@ -95,12 +95,18 @@ WORD16 ixheaacd_divideby3(WORD op) {
return (WORD16)ret;
}
-VOID ixheaacd_decode_ps_data(ia_ps_dec_struct *ptr_ps_dec) {
+VOID ixheaacd_decode_ps_data(ia_ps_dec_struct *ptr_ps_dec, WORD32 frame_size) {
WORD e, i, temp;
WORD16 iid_mode = (WORD16)((ptr_ps_dec->iid_mode) ? 1 : 2);
WORD16 icc_mode = (WORD16)((ptr_ps_dec->icc_mode) ? 1 : 2);
WORD16 num_iid_levels =
(WORD16)(ptr_ps_dec->iid_quant ? NUM_IID_LEVELS_FINE : NUM_IID_LEVELS);
+ WORD32 max_num_columns;
+
+ if (frame_size == 960)
+ max_num_columns = MAX_NUM_COLUMNS_960;
+ else
+ max_num_columns = MAX_NUM_COLUMNS;
if (!ptr_ps_dec->ps_data_present) {
ptr_ps_dec->num_env = 0;
@@ -231,16 +237,16 @@ VOID ixheaacd_decode_ps_data(ia_ps_dec_struct *ptr_ps_dec) {
env_count = 0;
for (e = 1; e < ptr_ps_dec->num_env; e++) {
- env_count = add_d(env_count, MAX_NUM_COLUMNS);
+ env_count = add_d(env_count, max_num_columns);
ptr_ps_dec->border_position[e] = (WORD16)(env_count >> shift);
}
- ptr_ps_dec->border_position[ptr_ps_dec->num_env] = MAX_NUM_COLUMNS;
+ ptr_ps_dec->border_position[ptr_ps_dec->num_env] = max_num_columns;
} else {
ptr_ps_dec->border_position[0] = 0;
- if (ptr_ps_dec->border_position[ptr_ps_dec->num_env] < MAX_NUM_COLUMNS) {
+ if (ptr_ps_dec->border_position[ptr_ps_dec->num_env] < max_num_columns) {
ptr_ps_dec->num_env++;
- ptr_ps_dec->border_position[ptr_ps_dec->num_env] = MAX_NUM_COLUMNS;
+ ptr_ps_dec->border_position[ptr_ps_dec->num_env] = max_num_columns;
memcpy(ptr_ps_dec->iid_par_table[ptr_ps_dec->num_env - 1],
ptr_ps_dec->iid_par_table[ptr_ps_dec->num_env - 2],
@@ -253,7 +259,7 @@ VOID ixheaacd_decode_ps_data(ia_ps_dec_struct *ptr_ps_dec) {
for (e = 1; e < ptr_ps_dec->num_env; e++) {
WORD threshold;
- threshold = sub_d(MAX_NUM_COLUMNS, sub_d(ptr_ps_dec->num_env, e));
+ threshold = sub_d(max_num_columns, sub_d(ptr_ps_dec->num_env, e));
if (ptr_ps_dec->border_position[e] > threshold) {
ptr_ps_dec->border_position[e] = threshold;
diff --git a/decoder/ixheaacd_ps_bitdec.h b/decoder/ixheaacd_ps_bitdec.h
index 67f6106..aee58f0 100644
--- a/decoder/ixheaacd_ps_bitdec.h
+++ b/decoder/ixheaacd_ps_bitdec.h
@@ -26,7 +26,7 @@ WORD16 ixheaacd_read_ps_data(ia_ps_dec_struct *ptr_ps_dec,
ia_bit_buf_struct *it_bit_buff, WORD16 n_bits_left,
ia_ps_tables_struct *ps_tables_ptr);
-VOID ixheaacd_decode_ps_data(ia_ps_dec_struct *ptr_ps_dec);
+VOID ixheaacd_decode_ps_data(ia_ps_dec_struct *ptr_ps_dec, WORD32 frame_size);
extern VOID ixheaacd_map_34_params_to_20(WORD16 *a_idx);
diff --git a/decoder/ixheaacd_ps_dec.h b/decoder/ixheaacd_ps_dec.h
index f441d35..e241a63 100644
--- a/decoder/ixheaacd_ps_dec.h
+++ b/decoder/ixheaacd_ps_dec.h
@@ -21,6 +21,8 @@
#define IXHEAACD_PS_DEC_H
#define MAX_NUM_COLUMNS 32
+
+#define MAX_NUM_COLUMNS_960 30
#define NUM_OF_QUAD_MIRROR_FILTER_CHNLS 64
#define NUM_OF_ALL_PASS_CHNLS 23
#define NUM_OF_DEL_CHNLS \
@@ -40,6 +42,8 @@
#define NUM_OF_BINS (20)
#define NUM_BANDS_FINE (34)
+#define NUM_SUB_SAMPLES_960 30
+
typedef WORD16((*REVERB_BUFFERS_RI)[NUM_SER_AP_LINKS])[32 * 2];
typedef WORD16((REVERB_BUFFERS_CH_RI[5])[NUM_SER_AP_LINKS])[16 * 2];
@@ -160,7 +164,7 @@ VOID ixheaacd_apply_ps(ia_ps_dec_struct *ptr_ps_dec, WORD32 **real_buf_left,
WORD32 **imag_buf_left, WORD32 *real_buf_right,
WORD32 *imag_buf_right,
ia_sbr_scale_fact_struct *sbr_scale_factor, WORD16 slot,
- ia_sbr_tables_struct *sbr_tables_ptr);
+ ia_sbr_tables_struct *sbr_tables_ptr, WORD no_col);
VOID ixheaacd_apply_rot_dec(ia_ps_dec_struct *ptr_ps_dec, WORD32 *p_qmf_left_re,
WORD32 *p_qmf_left_im, WORD32 *p_qmf_right_re,
diff --git a/decoder/ixheaacd_qmf_dec.c b/decoder/ixheaacd_qmf_dec.c
index dc3799a..05cd7e7 100644
--- a/decoder/ixheaacd_qmf_dec.c
+++ b/decoder/ixheaacd_qmf_dec.c
@@ -1008,7 +1008,7 @@ VOID ixheaacd_cplx_synt_qmffilt(
ixheaacd_apply_ps(ptr_ps_dec, &qmf_real[i], &qmf_imag[i], qmf_real_tmp,
qmf_imag_tmp, sbr_scale_factor, (WORD16)i,
- sbr_tables_ptr);
+ sbr_tables_ptr, num_time_slots);
}
if (1 == drc_on) {
WORD32 loop_val;
diff --git a/decoder/ixheaacd_sbr_const.h b/decoder/ixheaacd_sbr_const.h
index ecf3478..2fe3793 100644
--- a/decoder/ixheaacd_sbr_const.h
+++ b/decoder/ixheaacd_sbr_const.h
@@ -99,8 +99,12 @@
#define SBR_HF_ADJ_OFFSET 2
#define MPS_SBR_DELAY 6 /* 6 qmf samples */
+#define MPS_SBR_DELAY_960 5
+
#define ESBR_HBE_DELAY_OFFSET 32 /* 32 qmf samples */
+#define ESBR_HBE_DELAY_OFFSET_960 30
+
#define HBE_OPER_WIN_LEN (13)
#define NO_QMF_SYNTH_CHANNELS 64
#define TWICE_QMF_SYNTH_CHANNELS_NUM 128
diff --git a/decoder/ixheaacd_sbr_dec.c b/decoder/ixheaacd_sbr_dec.c
index f8af386..7f3aca2 100644
--- a/decoder/ixheaacd_sbr_dec.c
+++ b/decoder/ixheaacd_sbr_dec.c
@@ -590,6 +590,13 @@ WORD32 ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
FLOAT32 *pvc_qmf_enrg_arr = (FLOAT32 *)ptr_sbr_dec->pvc_qmf_enrg_arr;
+ WORD32 esbr_hbe_delay_offsets;
+
+ if (ptr_header_data->num_time_slots == 15)
+ esbr_hbe_delay_offsets = ESBR_HBE_DELAY_OFFSET_960;
+ else
+ esbr_hbe_delay_offsets = ESBR_HBE_DELAY_OFFSET;
+
memset(pvc_dec_out_buf, 0, 1024 * sizeof(FLOAT32));
memset(pvc_qmf_enrg_arr, 0, 512 * sizeof(FLOAT32));
if (audio_object_type == AOT_ER_AAC_ELD) {
@@ -615,9 +622,16 @@ WORD32 ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
WORD32 *ptr_pers_qmf_real = ptr_sbr_dec->ptr_sbr_overlap_buf;
WORD32 *p_scr_qmf_real = ptr_work_buf_core + (2 << (6 + !low_pow_flag));
- if ((no_bins < LPC_ORDER) ||
- ((no_bins + op_delay + add_slot) > MAX_ENV_COLS))
- return -1;
+ if (ptr_header_data->num_time_slots != 15)
+ {
+ if ((no_bins < LPC_ORDER) || ((no_bins + op_delay) > MAX_ENV_COLS))
+ return -1;
+ }
+ else
+ {
+ if ((no_bins < LPC_ORDER) || ((no_bins + op_delay) > MAX_ENV_COLS_960))
+ return -1;
+ }
if (!low_pow_flag) {
num = num << 1;
@@ -654,14 +668,21 @@ WORD32 ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
WORD32 core_frame_size = ptr_header_data->core_frame_size;
if (hbe_flag) {
- codec_x_delay = ESBR_HBE_DELAY_OFFSET;
+ codec_x_delay = esbr_hbe_delay_offsets;
}
if (upsample_ratio_idx == SBR_UPSAMPLE_IDX_4_1) {
codec_x_delay = 2 * codec_x_delay;
}
/* fixed decoder delay for bitstreams with SBR 4:1 and stereoConfigIndex 3
*/
- if (mps_sbr_flag) op_delay = MPS_SBR_DELAY;
+ if (ptr_header_data->num_time_slots != 15)
+ {
+ if (mps_sbr_flag) op_delay = MPS_SBR_DELAY;
+ }
+ else
+ {
+ if (mps_sbr_flag) op_delay = MPS_SBR_DELAY_960;
+ }
frame_move = 9 * num_anal_bands;
@@ -712,9 +733,9 @@ WORD32 ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
err_code = ixheaacd_qmf_hbe_apply(
ptr_sbr_dec->p_hbe_txposer,
ptr_sbr_dec->qmf_buf_real + (op_delay + SBR_HF_ADJ_OFFSET) +
- ESBR_HBE_DELAY_OFFSET,
+ esbr_hbe_delay_offsets,
ptr_sbr_dec->qmf_buf_imag + (op_delay + SBR_HF_ADJ_OFFSET) +
- ESBR_HBE_DELAY_OFFSET,
+ esbr_hbe_delay_offsets,
ptr_sbr_dec->str_codec_qmf_bank.num_time_slots,
ptr_sbr_dec->ph_vocod_qmf_real + (op_delay + SBR_HF_ADJ_OFFSET),
ptr_sbr_dec->ph_vocod_qmf_imag + (op_delay + SBR_HF_ADJ_OFFSET),
diff --git a/decoder/ixheaacd_sbr_rom.c b/decoder/ixheaacd_sbr_rom.c
index 6457671..f45f55c 100644
--- a/decoder/ixheaacd_sbr_rom.c
+++ b/decoder/ixheaacd_sbr_rom.c
@@ -1972,6 +1972,34 @@ const ia_env_extr_tables_struct ixheaacd_aac_dec_env_extr_tables = {
{1, 1, 1, 1, 1, 1, 1, 1},
{0, 8, 16}},
+ //960 Adding new tables for 960 frame length implementation
+ //const ia_frame_info_struct sbr_frame_info1_16_960 =
+ {0,
+ 1,
+ -1,
+ 1,
+ {0, 15, 0, 0, 0, 0},
+ {1, 0, 0, 0, 0},
+ {0, 15, 0}},
+
+ //const ia_frame_info_struct sbr_frame_info2_16_960 =
+ {0,
+ 2,
+ -1,
+ 2,
+ {0, 8, 15, 0, 0, 0},
+ {1, 1, 0, 0, 0},
+ {0, 8, 15}},
+
+ //const ia_frame_info_struct sbr_frame_info4_16_960 =
+ {0,
+ 4,
+ -1,
+ 2,
+ {0, 4, 8, 12, 15},
+ {1, 1, 1, 1},
+ {0, 8, 15}},
+
},
// const ia_sbr_header_data_struct sbr_default_header =
diff --git a/decoder/ixheaacd_sbr_rom.h b/decoder/ixheaacd_sbr_rom.h
index e6d06f0..fc15fce 100644
--- a/decoder/ixheaacd_sbr_rom.h
+++ b/decoder/ixheaacd_sbr_rom.h
@@ -101,7 +101,7 @@ typedef struct {
extern const ia_qmf_dec_tables_struct ixheaacd_aac_qmf_dec_tables;
typedef struct {
- ia_frame_info_struct sbr_frame_info1_2_4_16[3 + 1];
+ ia_frame_info_struct sbr_frame_info1_2_4_16[3 + 1 + 3];
ia_sbr_header_data_struct str_sbr_default_header;
WORD16 ixheaacd_t_huffman_env_bal_1_5db_inp_table[50];
diff --git a/decoder/ixheaacd_sbrdec_lpfuncs.c b/decoder/ixheaacd_sbrdec_lpfuncs.c
index 473b3a8..33920c2 100644
--- a/decoder/ixheaacd_sbrdec_lpfuncs.c
+++ b/decoder/ixheaacd_sbrdec_lpfuncs.c
@@ -689,7 +689,11 @@ WORD16 ixheaacd_read_ps_data(ia_ps_dec_struct *ptr_ps_dec,
}
if (ptr_ps_dec->enable_ext) {
- WORD32 cnt = ixheaacd_read_bits_buf(it_bit_buff, 4);
+ WORD32 cnt;
+ if (it_bit_buff->cnt_bits < 4)
+ cnt = ixheaacd_read_bits_buf(it_bit_buff, it_bit_buff->cnt_bits);
+ else
+ cnt = ixheaacd_read_bits_buf(it_bit_buff, 4);
if (cnt == 15) {
cnt += ixheaacd_read_bits_buf(it_bit_buff, 8);
diff --git a/decoder/ixheaacd_sbrdecoder.c b/decoder/ixheaacd_sbrdecoder.c
index bd33fd9..5159b11 100644
--- a/decoder/ixheaacd_sbrdecoder.c
+++ b/decoder/ixheaacd_sbrdecoder.c
@@ -244,7 +244,7 @@ IA_ERRORCODE ixheaacd_applysbr(
FLAG down_mix_flag, ia_sbr_scr_struct *sbr_scratch_struct, WORD32 ps_enable,
WORD32 ch_fac, WORD32 slot_element, ia_bit_buf_struct *it_bit_buff,
ia_drc_dec_struct *pstr_drc_dec, WORD eld_sbr_flag,
- WORD32 audio_object_type, WORD32 init_flag, WORD32 ldmps_present) {
+ WORD32 audio_object_type, WORD32 init_flag, WORD32 ldmps_present, WORD32 frame_size) {
WORD32 k;
FLAG prev_ps_flag = 0;
FLAG ps_flag = 0;
@@ -597,7 +597,7 @@ IA_ERRORCODE ixheaacd_applysbr(
if (ptr_header_data[0]->channel_mode == PS_STEREO &&
(audio_object_type != AOT_ER_AAC_ELD &&
audio_object_type != AOT_ER_AAC_LD)) {
- ixheaacd_decode_ps_data(self->pstr_ps_stereo_dec);
+ ixheaacd_decode_ps_data(self->pstr_ps_stereo_dec, frame_size);
ps_flag = 1;
self->ps_present = ps_flag;
}
diff --git a/decoder/ixheaacd_sbrdecoder.h b/decoder/ixheaacd_sbrdecoder.h
index c181c0a..8af17b3 100644
--- a/decoder/ixheaacd_sbrdecoder.h
+++ b/decoder/ixheaacd_sbrdecoder.h
@@ -71,7 +71,7 @@ IA_ERRORCODE ixheaacd_applysbr(
FLAG down_mix_flag, ia_sbr_scr_struct *sbr_scratch_struct, WORD32 ps_enable,
WORD32 ch_fac, WORD32 slot_element, ia_bit_buf_struct *it_bit_buff,
ia_drc_dec_struct *pstr_drc_dec, WORD eld_sbr_flag, WORD audio_object_type,
- WORD32 init_flag, WORD32 ldmps_present);
+ WORD32 init_flag, WORD32 ldmps_present, WORD32 frame_size);
WORD32 ixheaacd_getsize_sbr_persistent();
diff --git a/decoder/ixheaacd_sbrdecsettings.h b/decoder/ixheaacd_sbrdecsettings.h
index ab9664e..5d183e4 100644
--- a/decoder/ixheaacd_sbrdecsettings.h
+++ b/decoder/ixheaacd_sbrdecsettings.h
@@ -70,6 +70,8 @@
#define MAX_OV_COLS 6
#define MAX_ENV_COLS (MAX_COLS + MAX_OV_COLS)
+#define MAX_ENV_COLS_960 (30 + MAX_OV_COLS)
+
#define SBR_FREQ_SCALE_DEFAULT 2
#define SBR_ALTER_SCALE_DEFAULT 1
#define SBR_NOISE_BANDS_DEFAULT 2
diff --git a/decoder/ixheaacd_stereo.c b/decoder/ixheaacd_stereo.c
index 28a3e31..d0fd906 100644
--- a/decoder/ixheaacd_stereo.c
+++ b/decoder/ixheaacd_stereo.c
@@ -56,6 +56,8 @@ VOID ixheaacd_ms_stereo_process(
WORD32 win_grp, grp_len, k;
WORD32 *l_spec = ptr_aac_dec_channel_info[LEFT]->ptr_spec_coeff;
WORD32 *r_spec = ptr_aac_dec_channel_info[RIGHT]->ptr_spec_coeff;
+ WORD16 maximum_bins_short =
+ (ptr_aac_dec_channel_info[LEFT]->str_ics_info.frame_length) >> 3;
WORD8 *ptr_group_len =
ptr_aac_dec_channel_info[LEFT]->str_ics_info.window_group_length;
const WORD8 *ptr_sfb_width =
@@ -96,8 +98,17 @@ VOID ixheaacd_ms_stereo_process(
}
}
ptr_ms_used -= ptr_aac_dec_channel_info[LEFT]->str_ics_info.max_sfb;
- l_spec = l_spec + 128 - ixheaacd_drc_offset;
- r_spec = r_spec + 128 - ixheaacd_drc_offset;
+
+ if (maximum_bins_short == 120)
+ {
+ l_spec = l_spec + maximum_bins_short - ixheaacd_drc_offset;
+ r_spec = r_spec + maximum_bins_short - ixheaacd_drc_offset;
+ }
+ else
+ {
+ l_spec = l_spec + 128 - ixheaacd_drc_offset;
+ r_spec = r_spec + 128 - ixheaacd_drc_offset;
+ }
}
ptr_ms_used += JOINT_STEREO_MAX_BANDS;
@@ -118,7 +129,7 @@ static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32l(WORD32 a, WORD32 b) {
VOID ixheaacd_intensity_stereo_process(
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[2],
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 object_type,
- WORD32 aac_sf_data_resil_flag) {
+ WORD32 aac_sf_data_resil_flag, WORD16 framelength) {
UWORD8 *ptr_ms_used =
&ptr_aac_dec_channel_info[LEFT]->pstr_stereo_info->ms_used[0][0];
WORD8 *ptr_code_book = &ptr_aac_dec_channel_info[RIGHT]->ptr_code_book[0];
@@ -126,6 +137,8 @@ VOID ixheaacd_intensity_stereo_process(
&ptr_aac_dec_channel_info[RIGHT]->ptr_scale_factor[0];
WORD32 *r_spec = &ptr_aac_dec_channel_info[RIGHT]->ptr_spec_coeff[0];
WORD32 *l_spec = &ptr_aac_dec_channel_info[LEFT]->ptr_spec_coeff[0];
+ WORD16 maximum_bins_short =
+ (ptr_aac_dec_channel_info[LEFT]->str_ics_info.frame_length) >> 3;
WORD8 *ptr_group_len =
ptr_aac_dec_channel_info[RIGHT]->str_ics_info.window_group_length;
const WORD8 *ptr_sfb_width =
@@ -133,7 +146,14 @@ VOID ixheaacd_intensity_stereo_process(
->str_aac_sfb_info[ptr_aac_dec_channel_info[RIGHT]
->str_ics_info.window_sequence]
.sfb_width;
- WORD32 *ptr_scale_table = ptr_aac_tables->pstr_block_tables->scale_table;
+
+ WORD32 *ptr_scale_table;
+
+ if (960 == framelength)
+ ptr_scale_table = ptr_aac_tables->pstr_block_tables->scale_table_960;
+ else
+ ptr_scale_table = ptr_aac_tables->pstr_block_tables->scale_table;
+
WORD32 win_grp, grp_len, k;
for (win_grp = 0;
@@ -194,8 +214,17 @@ VOID ixheaacd_intensity_stereo_process(
r_spec += ptr_sfb_width[sfb];
}
}
- l_spec += 128 - ixheaacd_drc_offset;
- r_spec += 128 - ixheaacd_drc_offset;
+
+ if (maximum_bins_short == 120)
+ {
+ l_spec += maximum_bins_short - ixheaacd_drc_offset;
+ r_spec += maximum_bins_short - ixheaacd_drc_offset;
+ }
+ else
+ {
+ l_spec += 128 - ixheaacd_drc_offset;
+ r_spec += 128 - ixheaacd_drc_offset;
+ }
}
ptr_ms_used += 64;
ptr_code_book += 16;
diff --git a/decoder/ixheaacd_stereo.h b/decoder/ixheaacd_stereo.h
index e294798..8a68c60 100644
--- a/decoder/ixheaacd_stereo.h
+++ b/decoder/ixheaacd_stereo.h
@@ -30,6 +30,6 @@ VOID ixheaacd_ms_stereo_process(
VOID ixheaacd_intensity_stereo_process(
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[2],
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 object_type,
- WORD32 aac_sf_data_resil_flag);
+ WORD32 aac_sf_data_resil_flag, WORD16 framelength);
#endif /* #ifndef IXHEAACD_STEREO_H */
diff --git a/decoder/ixheaacd_struct_def.h b/decoder/ixheaacd_struct_def.h
index 9700ec7..f57895c 100644
--- a/decoder/ixheaacd_struct_def.h
+++ b/decoder/ixheaacd_struct_def.h
@@ -127,6 +127,8 @@ typedef struct {
WORD32 i_loud_ref_level;
UWORD8 dup_stereo_flag;
+ UWORD32 ui_frame_size;
+
} ia_aac_dec_config_struct;
typedef struct ia_aac_dec_state_struct {
diff --git a/decoder/ixheaacd_thumb_ps_dec.c b/decoder/ixheaacd_thumb_ps_dec.c
index 39b7b72..6cb4413 100644
--- a/decoder/ixheaacd_thumb_ps_dec.c
+++ b/decoder/ixheaacd_thumb_ps_dec.c
@@ -67,10 +67,19 @@ VOID ixheaacd_apply_ps(ia_ps_dec_struct *ptr_ps_dec, WORD32 **p_buf_left_real,
WORD32 **p_buf_left_imag, WORD32 *p_buf_right_real,
WORD32 *p_buf_right_imag,
ia_sbr_scale_fact_struct *sbr_scale_factor, WORD16 slot,
- ia_sbr_tables_struct *sbr_tables_ptr) {
- WORD16 shiftdelay =
- (WORD16)((slot < (32 - MAX_OV_COLS)) ? 0 : (sbr_scale_factor->lb_scale -
- sbr_scale_factor->ps_scale));
+ ia_sbr_tables_struct *sbr_tables_ptr, WORD no_col) {
+
+ WORD16 shiftdelay;
+
+ if (no_col != 30) {
+ shiftdelay =
+ (WORD16)((slot < (32 - MAX_OV_COLS)) ? 0 : (sbr_scale_factor->lb_scale -
+ sbr_scale_factor->ps_scale));
+ } else {
+ shiftdelay =
+ (WORD16)((slot < (no_col - MAX_OV_COLS)) ? 0 : (sbr_scale_factor->lb_scale -
+ sbr_scale_factor->ps_scale));
+ }
ixheaacd_hybrid_analysis(p_buf_left_real[HYBRID_FILTER_DELAY],
ptr_ps_dec->ptr_hyb_left_re,
diff --git a/decoder/x86/ixheaacd_function_selector_x86.c b/decoder/x86/ixheaacd_function_selector_x86.c
index 431d3c9..dbeb987 100644
--- a/decoder/x86/ixheaacd_function_selector_x86.c
+++ b/decoder/x86/ixheaacd_function_selector_x86.c
@@ -66,11 +66,11 @@
WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_dec;
VOID(*ixheaacd_covariance_matrix_calc)
-(WORD32 *, ixheaacd_lpp_trans_cov_matrix *,
- WORD32) = &ixheaacd_covariance_matrix_calc_dec;
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec;
VOID(*ixheaacd_covariance_matrix_calc_2)
-(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32,
+(ia_lpp_trans_cov_matrix *, WORD32 *, WORD32,
WORD16) = &ixheaacd_covariance_matrix_calc_2_dec;
VOID(*ixheaacd_over_lap_add1)
@@ -178,7 +178,7 @@ VOID(*ixheaacd_overlap_buf_out)
VOID(*ixheaacd_overlap_out_copy)
(WORD32 *out_samples, WORD32 *ptr_overlap_buf, WORD32 *ptr_overlap_buf1,
- const WORD16 ch_fac) = &ixheaacd_overlap_out_copy_dec;
+ const WORD16 ch_fac, WORD16 size_01) = &ixheaacd_overlap_out_copy_dec;
VOID(*ixheaacd_pretwiddle_compute)
(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
@@ -230,3 +230,16 @@ VOID(*ixheaacd_scale_factor_process)
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_dec;
+
+VOID(*ixheaacd_covariance_matrix_calc_960)
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec_960;
+
+VOID(*ixheaacd_aac_ld_dec_rearrange_960)
+(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
+ WORD16 *re_arr_tab) = &ixheaacd_dec_rearrange_short;
+
+VOID(*ixheaacd_pretwiddle_compute_960)
+(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_960_dec;
diff --git a/decoder/x86_64/ixheaacd_function_selector_x86_64.c b/decoder/x86_64/ixheaacd_function_selector_x86_64.c
index 431d3c9..3eff5ac 100644
--- a/decoder/x86_64/ixheaacd_function_selector_x86_64.c
+++ b/decoder/x86_64/ixheaacd_function_selector_x86_64.c
@@ -66,11 +66,11 @@
WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_dec;
VOID(*ixheaacd_covariance_matrix_calc)
-(WORD32 *, ixheaacd_lpp_trans_cov_matrix *,
- WORD32) = &ixheaacd_covariance_matrix_calc_dec;
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec;
VOID(*ixheaacd_covariance_matrix_calc_2)
-(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32,
+(ia_lpp_trans_cov_matrix *, WORD32 *, WORD32,
WORD16) = &ixheaacd_covariance_matrix_calc_2_dec;
VOID(*ixheaacd_over_lap_add1)
@@ -178,7 +178,7 @@ VOID(*ixheaacd_overlap_buf_out)
VOID(*ixheaacd_overlap_out_copy)
(WORD32 *out_samples, WORD32 *ptr_overlap_buf, WORD32 *ptr_overlap_buf1,
- const WORD16 ch_fac) = &ixheaacd_overlap_out_copy_dec;
+ const WORD16 ch_fac, WORD16 size_01) = &ixheaacd_overlap_out_copy_dec;
VOID(*ixheaacd_pretwiddle_compute)
(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
@@ -230,3 +230,16 @@ VOID(*ixheaacd_scale_factor_process)
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_dec;
+
+VOID(*ixheaacd_covariance_matrix_calc_960)
+(WORD32 *, ia_lpp_trans_cov_matrix *,
+ WORD32, WORD32) = &ixheaacd_covariance_matrix_calc_dec_960;
+
+VOID(*ixheaacd_aac_ld_dec_rearrange_960)
+(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
+ WORD16 *re_arr_tab) = &ixheaacd_dec_rearrange_short;
+
+VOID(*ixheaacd_pretwiddle_compute_960)
+(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
+ ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
+ WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_960_dec; \ No newline at end of file
diff --git a/test/ixheaacd_error.c b/test/ixheaacd_error.c
index 279f819..b6ed649 100644
--- a/test/ixheaacd_error.c
+++ b/test/ixheaacd_error.c
@@ -36,12 +36,7 @@
pWORD8 ixheaacd_ppb_api_non_fatal[IA_MAX_ERROR_SUB_CODE] = {
(pWORD8) "No Error",
(pWORD8) "API Command not supported",
- (pWORD8) "API Command type not supported",
- (pWORD8) "DRC Unexpected Error",
- (pWORD8) "DRC Param Error",
- (pWORD8) "DRC External Error",
- (pWORD8) "DRC Errorhandling",
- (pWORD8) "DRC Bitstream Error"};
+ (pWORD8) "API Command type not supported"};
/* Fatal Errors */
pWORD8 ixheaacd_ppb_api_fatal[IA_MAX_ERROR_SUB_CODE] = {
(pWORD8) "Invalid Memory Table Index",
@@ -59,8 +54,6 @@ pWORD8 ixheaacd_ppb_api_fatal[IA_MAX_ERROR_SUB_CODE] = {
pWORD8 ixheaacd_ppb_config_non_fatal[IA_MAX_ERROR_SUB_CODE] = {
(pWORD8) "Invalid Output PCM WORD Size. Setting to default, 16 ",
(pWORD8) "Invalid Down-mix flag option. Setting to default, 0 ",
- (pWORD8) "Invalid 8 khz output flag option. Setting to default, 0 ",
- (pWORD8) "Invalid 16 khz output flag option. Setting to default, 0 ",
(pWORD8) "Invalid interleave to stereo flag option. Setting to default, 1 ",
(pWORD8) "Invalid downsample flag option. Setting to default, 0 ",
(pWORD8) "Invalid Frame OK option. Setting to default, 1 ",
@@ -76,13 +69,16 @@ pWORD8 ixheaacd_ppb_config_non_fatal[IA_MAX_ERROR_SUB_CODE] = {
(pWORD8) "Invalid DRC boost value",
(pWORD8) "Invalid DRC target",
(pWORD8) "Invalid Frame size",
+ (pWORD8) "Invalid LD testing flag option. Setting to default 0",
(pWORD8) "Invalid delay mode",
(pWORD8) "Invalid decode type",
(pWORD8) "Invalid peak limiter flag",
(pWORD8) "Invalid control param index",
(pWORD8) "Inalid gain delay",
(pWORD8) "Invalid constant delay mode",
- (pWORD8) "Invalid effect type"};
+ (pWORD8) "Invalid effect type",
+ (pWORD8) "Invalid target loudness value",
+ (pWORD8) "Invalid frame length flag option. Setting to default 0"};
/* Fatal Errors */
pWORD8 ixheaacd_ppb_config_fatal[IA_MAX_ERROR_SUB_CODE] = {
(pWORD8) "Invalid Sample rate specified for RAW decoding"};
diff --git a/test/ixheaacd_main.c b/test/ixheaacd_main.c
index ba70b3d..a340d78 100644
--- a/test/ixheaacd_main.c
+++ b/test/ixheaacd_main.c
@@ -536,6 +536,17 @@ IA_ERRORCODE ixheaacd_set_config_param(WORD32 argc, pWORD8 argv[],
&ui_auto_sbr_upsample);
_IA_HANDLE_ERROR(p_proc_err_info, (pWORD8) "", err_code);
}
+ /* To indicate frame length for a RAW bit-stream. */
+ if (!strncmp((pCHAR8)argv[i], "-flflag:", 8)) {
+ pCHAR8 pb_arg_val = (pCHAR8)(argv[i] + 8);
+ UWORD32 ui_fl_flag = atoi(pb_arg_val);
+ err_code =
+ (*p_ia_process_api)(p_ia_process_api_obj, IA_API_CMD_SET_CONFIG_PARAM,
+ IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG,
+ &ui_fl_flag);
+ _IA_HANDLE_ERROR(p_proc_err_info, (pWORD8) "", err_code);
+ }
+
/* To indicate sample rate for a RAW bit-stream. */
if (!strncmp((pCHAR8)argv[i], "-fs:", 4)) {
pCHAR8 pb_arg_val = (pCHAR8)(argv[i] + 4);
@@ -818,6 +829,8 @@ int ixheaacd_main_process(WORD32 argc, pWORD8 argv[]) {
WORD32 samples_written = 0;
WORD32 init_iteration = 1;
+ WORD32 fatal_error_chk;
+
#ifdef ARM_PROFILE_HW
int frame_count_b = 0;
long long cycles_b = 0;
@@ -1680,6 +1693,8 @@ int ixheaacd_main_process(WORD32 argc, pWORD8 argv[]) {
_IA_HANDLE_ERROR(p_proc_err_info, (pWORD8) "", err_code);
+ fatal_error_chk = err_code & IA_FATAL_ERROR;
+
/* Checking for end of processing */
err_code = (*p_ia_process_api)(pv_ia_process_api_obj, IA_API_CMD_EXECUTE,
IA_CMD_TYPE_DONE_QUERY, &ui_exec_done);
@@ -2009,7 +2024,7 @@ int ixheaacd_main_process(WORD32 argc, pWORD8 argv[]) {
#endif
/* Do till the process execution is done */
- } while (!ui_exec_done);
+ } while (!ui_exec_done && !fatal_error_chk);
#ifdef ARM_PROFILE_HW
fprintf(stdout, "\n Peak MCPS = %f\n", Peak_b);
@@ -2077,6 +2092,7 @@ void print_usage() {
printf("\n[-sbrup:<auto_sbr_upsample>]");
printf("\n[-maxchannel:<maximum_num_channels>]");
+ printf("\n[-flflag:<framelength_flag>}");
#ifdef MULTICHANNEL_ENABLE
printf("\n[-coupchannel:<coupling_channel>]");
printf("\n[-downmix:<down_mix_stereo>]");
@@ -2107,9 +2123,15 @@ void print_usage() {
printf(
"\n in case of stream changing from SBR present to SBR not present. "
"Default 1");
+
printf("\n <maximum_num_channels> is the number of maxiumum ");
printf("\n channels the input may have. Default is 6 (5.1)");
+ printf("\n <framelength_flag> is flag for Decoding framelength of 1024 or 960.");
+ printf("\n 1 to decode 960 frame length, 0 to decode 1024 frame length");
+ printf("\n Frame length value in the GA header will override this option.");
+ printf("\n Default 0 ");
+
#ifdef MULTICHANNEL_ENABLE
printf("\n <coupling_channel> is element instance tag of ");
printf("\n independent coupling channel to be mixed. Default is 0");
@@ -2142,6 +2164,7 @@ void print_usage() {
/* DD MM YYYY Author Changes */
/* 04 09 2005 Ittiam Created */
/* */
+/* */
/*******************************************************************************/
int main(WORD32 argc, char *argv[]) {