From 3751d740015fdf3b9eddf4c51d9b7117760e57a9 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 6 Aug 2025 10:52:05 +0200 Subject: [PATCH 1/6] rename file to align with ivas-float-update --- lib_isar/{isar_lcld_rom_tables.c => isar_rom_lcld_tables.c} | 0 lib_isar/{isar_lcld_rom_tables.h => isar_rom_lcld_tables.h} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename lib_isar/{isar_lcld_rom_tables.c => isar_rom_lcld_tables.c} (100%) rename lib_isar/{isar_lcld_rom_tables.h => isar_rom_lcld_tables.h} (100%) diff --git a/lib_isar/isar_lcld_rom_tables.c b/lib_isar/isar_rom_lcld_tables.c similarity index 100% rename from lib_isar/isar_lcld_rom_tables.c rename to lib_isar/isar_rom_lcld_tables.c diff --git a/lib_isar/isar_lcld_rom_tables.h b/lib_isar/isar_rom_lcld_tables.h similarity index 100% rename from lib_isar/isar_lcld_rom_tables.h rename to lib_isar/isar_rom_lcld_tables.h -- GitLab From 76b70cabcd244a34a729b0e3dffd9cb757f8e2ef Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 6 Aug 2025 10:53:21 +0200 Subject: [PATCH 2/6] remove whitespace in preprocessor macros --- lib_lc3plus/adjust_global_gain_fx.c | 6 +- lib_lc3plus/ari_codec.c | 128 +++---- lib_lc3plus/basop_mpy_lc3plus.h | 16 +- lib_lc3plus/constants.c | 456 +++++++++++------------ lib_lc3plus/constants.h | 90 ++--- lib_lc3plus/dct4_fx.c | 14 +- lib_lc3plus/defines.h | 458 ++++++++++++------------ lib_lc3plus/enc_lc3.c | 8 +- lib_lc3plus/fft_lc3plus.c | 10 +- lib_lc3plus/functions.h | 14 +- lib_lc3plus/imdct_fx.c | 4 +- lib_lc3plus/lc3.h | 4 +- lib_lc3plus/mdct_fx.c | 38 +- lib_lc3plus/noise_factor_fx.c | 12 +- lib_lc3plus/plc_apply_fx.c | 12 +- lib_lc3plus/plc_classify_fx.c | 26 +- lib_lc3plus/plc_damping_scrambling_fx.c | 16 +- lib_lc3plus/plc_phecu_fec_hq_fx.c | 10 +- lib_lc3plus/quantize_spec_fx.c | 32 +- lib_lc3plus/rom_basop_util_lc3plus.c | 164 ++++----- lib_lc3plus/setup_dec_lc3.c | 18 +- lib_lc3plus/setup_dec_lc3.h | 4 +- lib_lc3plus/setup_enc_lc3.c | 132 +++---- 23 files changed, 836 insertions(+), 836 deletions(-) diff --git a/lib_lc3plus/adjust_global_gain_fx.c b/lib_lc3plus/adjust_global_gain_fx.c index c6067b591..fe2016d82 100644 --- a/lib_lc3plus/adjust_global_gain_fx.c +++ b/lib_lc3plus/adjust_global_gain_fx.c @@ -31,11 +31,11 @@ void processAdjustGlobalGain_fx(Word16 *gg_idx, Word16 gg_idx_min, Word16 gg_idx Word16 gg_idx_inc; Word16 gg_idx_inc_max; Word16 gg_idx_inc_s; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS Word32 factor; -# else +#else Word16 factor; -# endif +#endif #endif #ifdef DYNMEM_COUNT diff --git a/lib_lc3plus/ari_codec.c b/lib_lc3plus/ari_codec.c index 46ad0a532..72e5f0b12 100644 --- a/lib_lc3plus/ari_codec.c +++ b/lib_lc3plus/ari_codec.c @@ -88,7 +88,7 @@ static Word16 ac_dec_update_fx(UWord8 *ptr, Word16 *bp, Word16 *bp_side, Word16 /*************************************************************************/ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word16 processAriEncoder_fx(UWord8 *bytes, Word16 bp_side_in, Word16 mask_side_in, Word16 nbbits, Word32 xq[], Word16 *tns_order, Word16 tns_numfilters, Word16 *tns_idx, Word16 lastnz, @@ -412,7 +412,7 @@ Word16 processAriEncoder_fx(UWord8 *bytes, Word16 bp_side_in, Word16 mask_side_i return fill_bits; } -# else /* ENABLE_HR_MODE */ +#else /* ENABLE_HR_MODE */ Word16 processAriEncoder_fx(UWord8 *bytes, Word16 bp_side_in, Word16 mask_side_in, Word16 nbbits, Word16 xq[], Word16 *tns_order, Word16 tns_numfilters, Word16 *tns_idx, Word16 lastnz, @@ -747,24 +747,24 @@ void processAriDecoder_fx(UWord8 *bytes, Word16 *bp_side, Word16 *mask_side, Wor Word16 n_pc, Word16 be_bp_left, Word16 be_bp_right, Word16 mode, Word16 *spec_inv_idx, Word16 *b_left, Word16 *resBits, -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word32 *x, -# else +#else Word16 *x, -# endif +#endif Word16 *nf_seed, UWord8 *resQdata, Word16 *tns_idx, Word16 *zero_frame, Word8 *scratchBuffer -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , Word16 hrmode -# endif +#endif ) { Decoder_State_fx st; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word16 resbit, i1, i2; Word32 a, b; -# else +#else Word16 a, b; -# endif +#endif Word16 t, a1, b1, a1_i, b1_i, bp; Word16 esc_nb; Word16 rateFlag; @@ -787,11 +787,11 @@ struct _dynmem Decoder_State_fx st; Pc_State_fx pc; Word16 resbit, i1, i2; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word32 a, b; -# else +#else Word16 a, b; -# endif +#endif Word16 t, a1, b1, a1_i, b1_i, bp; Word16 esc_nb; Word16 rateFlag; @@ -809,21 +809,21 @@ Decoder_State_fx st; Dyn_Mem_In("processAriDecoder_fx", sizeof(struct _dynmem)); #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (hrmode == 1) { max_lev = max_lev + 8; } -# endif +#endif lsb_ind = (Word16 *)scratchAlign(scratchBuffer, 0); /* Size 2 * MAX_LEN bytes */ /* Rate flag */ rateFlag = 0; move16(); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (fs_idx != 5) /* Don't update rateFlag for 96000 Hz */ -# endif +#endif { if (sub(nbbits, add(160, DEPR_i_mult(fs_idx, 160))) > 0) { @@ -1059,21 +1059,21 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) GOTO ber_detect; } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE a = L_add(L_shl(read_bit(ptr, bp_side, mask_side), lev), a); -# else +#else a = add(shl(read_bit(ptr, bp_side, mask_side), lev), a); -# endif +#endif if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) { GOTO ber_detect; } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE b = L_add(L_shl(read_bit(ptr, bp_side, mask_side), lev), b); -# else +#else b = add(shl(read_bit(ptr, bp_side, mask_side), lev), b); -# endif +#endif } /* check for bitflip */ IF (sub(lev, max_lev) == 0) @@ -1084,13 +1084,13 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) b1 = shr_pos(r, 2); a1 = s_and(r, 0x3); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE a = L_add(L_shl(a1, lev), a); b = L_add(L_shl(b1, lev), b); -# else +#else a = add(shl(a1, lev), a); b = add(shl(b1, lev), b); -# endif +#endif IF (a > 0) { if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) @@ -1099,11 +1099,11 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) } if (read_bit(ptr, bp_side, mask_side) != 0) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE a = L_negate(a); -# else +#else a = negate(a); -# endif +#endif } } x[a1_i] = a; @@ -1116,11 +1116,11 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) } if (read_bit(ptr, bp_side, mask_side) != 0) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE b = L_negate(b); -# else +#else b = negate(b); -# endif +#endif } } x[b1_i] = b; @@ -1275,20 +1275,20 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) { GOTO ber_detect; } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE a = L_add(L_shl(read_bit(ptr, bp_side, mask_side), lev), a); -# else +#else a = add(shl(read_bit(ptr, bp_side, mask_side), lev), a); -# endif +#endif if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) { GOTO ber_detect; } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE b = L_add(L_shl(read_bit(ptr, bp_side, mask_side), lev), b); -# else +#else b = add(shl(read_bit(ptr, bp_side, mask_side), lev), b); -# endif +#endif } /* check for bitflip */ IF (sub(lev, max_lev) == 0) @@ -1298,13 +1298,13 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) b1 = shr_pos(r, 2); a1 = s_and(r, 0x3); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE a = L_add(L_shl(a1, lev), a); b = L_add(L_shl(b1, lev), b); -# else +#else a = add(shl(a1, lev), a); b = add(shl(b1, lev), b); -# endif +#endif IF (a > 0) { if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) @@ -1313,11 +1313,11 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) } if (read_bit(ptr, bp_side, mask_side) != 0) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE a = L_negate(a); -# else +#else a = negate(a); -# endif +#endif } } x[a1_i] = a; @@ -1330,11 +1330,11 @@ if (check_pc_bytes(&bp, bp_side, mask_side, a1_i, 0, &st.pc) != 0) } if (read_bit(ptr, bp_side, mask_side) != 0) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE b = L_negate(b); -# else +#else b = negate(b); -# endif +#endif } } x[b1_i] = b; @@ -1444,7 +1444,7 @@ GOTO ber_detect; } #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (hrmode) { Word16 idx_len = sub(*resBits, n); /* Number of nonzero bits */ @@ -1471,7 +1471,7 @@ GOTO ber_detect; n = sub(n, 1); } } -# endif +#endif *resBits = sub(*resBits, n); } @@ -1494,7 +1494,7 @@ GOTO ber_detect_res; n = sub(n, 1); IF (tmp > 0) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (a > 0) { a = L_add(a, 1); @@ -1503,7 +1503,7 @@ GOTO ber_detect_res; { a = L_sub(a, 1); } -# else +#else if (a > 0) { a = add(a, 1); @@ -1512,7 +1512,7 @@ GOTO ber_detect_res; { a = sub(a, 1); } -# endif +#endif IF (a == 0) { IF (n == 0) @@ -1548,7 +1548,7 @@ GOTO ber_detect_res; n = sub(n, 1); IF (tmp > 0) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (b > 0) { b = L_add(b, 1); @@ -1557,7 +1557,7 @@ GOTO ber_detect_res; { b = L_sub(b, 1); } -# else +#else if (b > 0) { b = add(b, 1); @@ -1566,7 +1566,7 @@ GOTO ber_detect_res; { b = sub(b, 1); } -# endif +#endif IF (b == 0) { IF (n == 0) @@ -1594,11 +1594,11 @@ if (check_pc_bytes(&bp, bp_side, mask_side, st.pc.inv_bin, 0, &st.pc) != 0) tmp32 = L_deposit_l(0); FOR (i = 0; i < L_spec; i++) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE tmp32 = L_mac0(tmp32, L_and(L_abs(x[i]), 32767), i); -# else +#else tmp32 = L_mac0(tmp32, abs_s(x[i]), i); -# endif +#endif } *nf_seed = extract_l(tmp32); move16(); @@ -1704,20 +1704,20 @@ Dyn_Mem_Deluxe_Out(); void processAriDecoderScaling_fx( -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word32 *datain, -# else +#else Word16 *data16, -# endif +#endif Word16 dataLen, Word32 *data32, Word16 *data_e) { Word32 i; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Dyn_Mem_Deluxe_In(Word16 shift; Word32 tmp, x_min, x_max;); -# else +#else Dyn_Mem_Deluxe_In(Word16 shift; Word16 tmp, x_min, x_max;); -# endif +#endif #ifdef ENABLE_HR_MODE diff --git a/lib_lc3plus/basop_mpy_lc3plus.h b/lib_lc3plus/basop_mpy_lc3plus.h index 72c7d91bb..7792b49fe 100644 --- a/lib_lc3plus/basop_mpy_lc3plus.h +++ b/lib_lc3plus/basop_mpy_lc3plus.h @@ -51,15 +51,15 @@ Word32 Mpy_32_32_lc3plus(Word32 x, Word32 y); #ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION -# ifdef ENABLE_HR_MODE -# define cplxMpy32_32_32_2(re, im, a, b, c, d) \ +#ifdef ENABLE_HR_MODE +#define cplxMpy32_32_32_2(re, im, a, b, c, d) \ do \ { \ re = L_sub(Mpy_32_32_0(a, c), Mpy_32_32_0(b, d)); \ im = L_add(Mpy_32_32_0(a, d), Mpy_32_32_0(b, c)); \ } while (0) -# endif -# define cplxMpy32_32_16_2(re, im, a, b, c, d) \ +#endif +#define cplxMpy32_32_16_2(re, im, a, b, c, d) \ do \ { \ re = L_sub(L_shr_pos(Mpy_32_16_lc3plus(a, c), 1), L_shr_pos(Mpy_32_16_lc3plus(b, d), 1)); \ @@ -69,15 +69,15 @@ Word32 Mpy_32_32_lc3plus(Word32 x, Word32 y); #else /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ -# ifdef ENABLE_HR_MODE -# define cplxMpy32_32_32_2(re, im, a, b, c, d) \ +#ifdef ENABLE_HR_MODE +#define cplxMpy32_32_32_2(re, im, a, b, c, d) \ do \ { \ re = L_sub(Mpy_32_32_0(a, c), Mpy_32_32_0(b, d)); \ im = L_add(Mpy_32_32_0(a, d), Mpy_32_32_0(b, c)); \ } while (0) -# endif -# define cplxMpy32_32_16_2(re, im, a, b, c, d) \ +#endif +#define cplxMpy32_32_16_2(re, im, a, b, c, d) \ do \ { \ re = L_sub(L_shr_pos(Mpy_32_16_lc3plus(a, c), 1), L_shr_pos(Mpy_32_16_lc3plus(b, d), 1)); \ diff --git a/lib_lc3plus/constants.c b/lib_lc3plus/constants.c index c02cf5c69..3b94d6a76 100644 --- a/lib_lc3plus/constants.c +++ b/lib_lc3plus/constants.c @@ -760,17 +760,17 @@ RAM_ALIGN const Word32 *const LowDelayShapes_n960_HRA_5ms[2] = { LowDelayShapes_ RAM_ALIGN const Word32 *const LowDelayShapes_n960_HRA[2] = { LowDelayShapes_n960_N480_HRA_IP, LowDelayShapes_n960_N960_HRA_IP }; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS RAM_ALIGN const Word32 *const LowDelayShapes_n960_HRA_7_5ms[2] = { LowDelayShapes_n960_N480_HRA_7_5ms_IP, LowDelayShapes_n960_N960_HRA_7_5ms_IP }; -# endif +#endif #endif /* ENABLE_HR_MODE */ RAM_ALIGN const Word16 pitch_max[5] = {MAX_PITCH_8K, MAX_PITCH_16K, MAX_PITCH_24K, MAX_PITCH_32K, MAX_PITCH_48K}; RAM_ALIGN const Word16 plc_preemph_fac[NUM_SAMP_FREQ] = {20316, 23592, 26869, 30146, 30146 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 30146 -# endif +#endif }; /* high pass filter Q15 */ RAM_ALIGN const Word16 TDC_high_16[11] = {(Word16)0x0000, (Word16)0xfd60, (Word16)0xf7ab, (Word16)0xefec, @@ -1199,13 +1199,13 @@ RAM_ALIGN const Word32 lag_win_48k[16] = {0x7ffefd47, 0x7ffbf529, 0x7ff6e7cb, 0x #define lag_win_48k NULL #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word32 lag_win_96k[16] = {0x7fffbf52, 0x7ffefd47, 0x7ffdb9e3, 0x7ffbf529, 0x7ff9af1f, 0x7ff6e7cb, 0x7ff39f35, 0x7fefd569, 0x7feb8a70, 0x7fe6be59, 0x7fe17132, 0x7fdba30b, 0x7fd553f5, 0x7fce8403, 0x7fc7334b, 0x7fbf61e2}; -# else -# define lag_win_96k NULL -# endif +#else +#define lag_win_96k NULL +#endif RAM_ALIGN const Word32 *const lag_win[NUM_SAMP_FREQ] = {lag_win_8k, lag_win_16k, lag_win_24k, lag_win_32k, lag_win_48k, lag_win_96k}; @@ -1829,26 +1829,26 @@ RAM_ALIGN const Word16 hamm_len2Tab[5] = {24, 48, 72, 96, 144}; /* 3 m #ifdef CR10_A_ATTENUATION_CURVE_SELECTOR RAM_ALIGN const Word16 PLC_FADEOUT_TYPE_2_SELECTOR = 10; /* can take values from 0 to 10, default is 10 for longer fadeout*/ #else -# ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH RAM_ALIGN const Word16 FADE_OUT_TYPE_2_ALPHA_5MS[30] = { /* 0.5^(nbLostFramesInRow + LC3_ROUND(100.0/frame_dms) - 1) * frame_dms/100.0)*/ 16384,11585,8192,5792,4096,2896,2048,1448,1024,724,512,362,256,181,128,91,64,45,32,23,16,11,8,6,4,3,2,1,1,1}; RAM_ALIGN const Word16 FADE_OUT_TYPE_2_ALPHA_2_5MS[60] = { /* 0.5^(nbLostFramesInRow + LC3_ROUND(100.0/frame_dms) - 1) * frame_dms/100.0)*/ 16384,13777,11585,9742,8192,6889,5793,4871,4096,3444,2896,2435,2048,1722,1448,1218,1024,861,724,609,512,431,362,304,256,215,181,152,128,108,91,76,64,54,45,38,32,27,23,19,16,13,11,10,8,7,6,5,4,3,3,2,2,2,1,1,1,1,1,1}; -# endif +#endif #endif RAM_ALIGN const Word16 NN_thresh = 0x7800; /* 30*2^10 */ RAM_ALIGN const Word16 NN_thresh_exp = -10; /* Tone detector */ #ifdef CR8_E_TONE_DETECTOR -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word32 TD_HR_thresh_10ms = 83402; -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE RAM_ALIGN const Word32 TD_HR_thresh_7_5ms = 743496; -# endif +#endif RAM_ALIGN const Word32 TD_HR_thresh_5ms = 382564; RAM_ALIGN const Word32 TD_HR_thresh_2_5ms = 301695; -# endif /* ENABLE_HR_MODE */ +#endif /* ENABLE_HR_MODE */ #endif /* CR8_E_TONE_DETECTOR */ RAM_ALIGN const Word32 BW_thresh_quiet[4] = {0x14000000, 0xA000000, 0xA000000, 0xA000000}; /* [20,10,10,10]*2^24 */ RAM_ALIGN const Word16 BW_thresh_quiet_exp = 31 - 24; @@ -1900,7 +1900,7 @@ RAM_ALIGN const Word16 *const BW_warp_idx_start_all_2_5ms[MAX_BW_BANDS_NUMBER - RAM_ALIGN const Word16 *const BW_warp_idx_stop_all_2_5ms[MAX_BW_BANDS_NUMBER - 1] = { BW_warp_idx_stop_16k_2_5ms, BW_warp_idx_stop_24k_2_5ms, BW_warp_idx_stop_32k_2_5ms, BW_warp_idx_stop_48k_2_5ms}; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS RAM_ALIGN const Word16 BW_brickwall_dist_7_5ms[4] = {4, 4, 3, 2}; RAM_ALIGN const Word16 BW_warp_idx_start_16k_7_5ms[4] = {51, 0, 0, 0}; RAM_ALIGN const Word16 BW_warp_idx_stop_16k_7_5ms[4] = {63, 0, 0, 0}; @@ -1914,7 +1914,7 @@ RAM_ALIGN const Word16 *const BW_warp_idx_start_all_7_5ms[] = { BW_warp_idx_start_16k_7_5ms, BW_warp_idx_start_24k_7_5ms, BW_warp_idx_start_32k_7_5ms, BW_warp_idx_start_48k_7_5ms}; RAM_ALIGN const Word16 *const BW_warp_idx_stop_all_7_5ms[] = { BW_warp_idx_stop_16k_7_5ms, BW_warp_idx_stop_24k_7_5ms, BW_warp_idx_stop_32k_7_5ms, BW_warp_idx_stop_48k_7_5ms}; -# endif +#endif #ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 BW_cutoff_bin_all[] = {80, 160, 240, 320, 400, 400}; @@ -1941,18 +1941,18 @@ RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes[NUM_SAMP_FREQ] = {30, }; #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word16 LowDelayShapes_n960_len_7_5ms[6] = {106, 212, 318, 424, 636, 1272}; -# else +#else const Word16 LowDelayShapes_n960_len_7_5ms[5] = {106, 212, 318, 424, 636}; -# endif +#endif const Word16 LowDelayShapes_n960_la_zeroes_7_5ms[NUM_SAMP_FREQ] = {14, 28, 42, 56, 84 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 168 -# endif +#endif }; -# ifdef ENABLE_HR_MODE -# ifdef SUBSET_NB +#ifdef ENABLE_HR_MODE +#ifdef SUBSET_NB const Word32 MDCT_WINDOW_FS_8000_frame_ms_75[106] = { 4627440, 11253200, 21594770, 36220454, 55523513, 79715027, 108949241, 143324500, 182870991, 227518888, 277136190, 331449220, 390143896, 452770029, 518831181, 587821768, 659169189, 732247130, @@ -1966,10 +1966,10 @@ const Word32 MDCT_WINDOW_FS_8000_frame_ms_75[106] = { -1337198324, -1290524957, -1238912889, -1182546000, -1121735805, -1056935470, -988679598, -917579357, -844370566, -769774729, -694577976, -619621377, -545775321, -473935196, -404978161, -339758802, -279035319, -223452287, -173535871, -129697804, -92268521, -61482210, -37424210, -19913685, -8400842}; -# else -# define MDCT_WINDOW_FS_8000_frame_ms_75 NULL -# endif -# ifdef SUBSET_WB +#else +#define MDCT_WINDOW_FS_8000_frame_ms_75 NULL +#endif +#ifdef SUBSET_WB const Word32 MDCT_WINDOW_FS_16000_frame_ms_75[212] = { 2448850, 4225281, 6560055, 9518849, 13169928, 17558685, 22724572, 28709046, 35532706, 43206772, 51759643, 61197652, 71531905, 82773688, 94926633, 107995294, 121978042, 136866522, @@ -1995,10 +1995,10 @@ const Word32 MDCT_WINDOW_FS_16000_frame_ms_75[212] = { -322717851, -298330826, -274560095, -251498346, -229196510, -207718889, -187124805, -167466055, -148790641, -131139192, -114544857, -99042767, -84660988, -71425324, -59356162, -48470733, -38776535, -30272788, -22943830, -16759108, -11669404, -7602417, -4461896 }; -# else -# define MDCT_WINDOW_FS_16000_frame_ms_75 NULL -# endif -# ifdef SUBSET_SSWB +#else +#define MDCT_WINDOW_FS_16000_frame_ms_75 NULL +#endif +#ifdef SUBSET_SSWB const Word32 MDCT_WINDOW_FS_24000_frame_ms_75[318] = { 3569045, 5343308, 7469087, 10008734, 12994076, 16456850, 20430606, 24935492, 29988837, 35611849, 41823777, 48643571, 56071893, 64113030, 72783590, 82094564, 92046985, 102645585, @@ -2036,10 +2036,10 @@ const Word32 MDCT_WINDOW_FS_24000_frame_ms_75[318] = { -218834457, -200381964, -182706579, -165829103, -149762124, -134517743, -120107705, -106542511, -93830987, -81979923, -70993541, -60872925, -51615362, -43213756, -35655914, -28924065, -22994343, -17836407, -13413907, -9700456, -6939916 }; -# else -# define MDCT_WINDOW_FS_24000_frame_ms_75 NULL -# endif -# ifdef SUBSET_SWB +#else +#define MDCT_WINDOW_FS_24000_frame_ms_75 NULL +#endif +#ifdef SUBSET_SWB const Word32 MDCT_WINDOW_FS_32000_frame_ms_75[424] = { 2898737, 4022405, 5281441, 6723878, 8372060, 10235970, 12328606, 14657777, 17238266, 20075996, 23180406, 26552429, 30204258, 34141418, 38374110, 42901881, 47726394, 52848657, @@ -2089,10 +2089,10 @@ const Word32 MDCT_WINDOW_FS_32000_frame_ms_75[424] = { -96587551, -88053476, -79936384, -72238586, -64962154, -58107752, -51674659, -45661585, -40066372, -34884913, -30111469, -25739290, -21759792, -18161914, -14933570, -12062384, -9522842, -7254663, -5656627 }; -# else -# define MDCT_WINDOW_FS_32000_frame_ms_75 NULL -# endif -# ifdef SUBSET_FB +#else +#define MDCT_WINDOW_FS_32000_frame_ms_75 NULL +#endif +#ifdef SUBSET_FB const Word32 MDCT_WINDOW_FS_48000_frame_ms_75[636] = { 2204435, 2827689, 3443319, 4131102, 4878935, 5703040, 6599364, 7574899, 8628974, 9768536, 10991420, 12304931, 13709256, 15207323, 16799052, 18489324, 20275023, 22160933, @@ -2165,13 +2165,13 @@ const Word32 MDCT_WINDOW_FS_48000_frame_ms_75[636] = { -60006167, -55969182, -52084610, -48353698, -44775286, -41350196, -38077002, -34956005, -31985545, -29165263, -26493253, -23968386, -21588587, -19351751, -17255806, -15297341, -13474667, -11782386, -10220076, -8778515, -7460996, -6246830, -5152154, -4038973 }; -# else -# define MDCT_WINDOW_FS_48000_frame_ms_75 NULL -# endif +#else +#define MDCT_WINDOW_FS_48000_frame_ms_75 NULL +#endif const Word32 *const LowDelayShapes_n960_7_5ms[5] = { MDCT_WINDOW_FS_8000_frame_ms_75, MDCT_WINDOW_FS_16000_frame_ms_75, MDCT_WINDOW_FS_24000_frame_ms_75, MDCT_WINDOW_FS_32000_frame_ms_75, MDCT_WINDOW_FS_48000_frame_ms_75 }; -# else +#else RAM_ALIGN const Word16 LowDelayShapes_n960_N60_7_5ms[106] = { 71, 172, 330, 553, 847, 1216, 1662, 2187, 2790, 3472, 4229, 5058, 5953, 6909, @@ -2310,11 +2310,11 @@ RAM_ALIGN const Word16 LowDelayShapes_n960_N360_7_5ms[636] = { const Word16 *const LowDelayShapes_n960_7_5ms[5] = { LowDelayShapes_n960_N60_7_5ms, LowDelayShapes_n960_N120_7_5ms, LowDelayShapes_n960_N180_7_5ms, LowDelayShapes_n960_N240_7_5ms, LowDelayShapes_n960_N360_7_5ms}; -# endif +#endif #endif -# ifdef ENABLE_HR_MODE -# ifdef SUBSET_NB +#ifdef ENABLE_HR_MODE +#ifdef SUBSET_NB RAM_ALIGN const Word32 MDCT_WINDOW_FS_8000_frame_ms_100[130] = { -961400, -2849747, -6146069, -11183287, -18168658, -27159976, -38041614, -50544991, -64266305, -78702302, -93275005, -107359966, -120331449, -131585369, -140567185, -146788394, -149841031, -149374845, @@ -2331,10 +2331,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_8000_frame_ms_100[130] = { -1353439826, -1345583929, -1334252006, -1318640435, -1296625734, -1266042179, -1224814360, -1171299094, -1104589425, -1024691930, -932610693, -830326556, -720679178, -607287900, -494260157, -385949065, -286606097, -199964372, -128792415, -74461791, -36690922, -13577456 }; -# else -# define MDCT_WINDOW_FS_8000_frame_ms_100 NULL -# endif -# ifdef SUBSET_WB +#else +#define MDCT_WINDOW_FS_8000_frame_ms_100 NULL +#endif +#ifdef SUBSET_WB Word32 MDCT_WINDOW_FS_16000_frame_ms_100[260] = { -887375, -1872204, -3197066, -4988439, -7310990, -10227337, -13783209, -18021567, -22958367, -28610377, -34970773, -42018157, -49718535, -58023758, -66873408, -76198163, -85910142, -95927481, @@ -2365,10 +2365,10 @@ Word32 MDCT_WINDOW_FS_16000_frame_ms_100[260] = { -1479074019, -1418108336, -1352953154, -1283959587, -1211573312, -1136287716, -1058670176, -979383239, -899114678, -818587615, -738568308, -659827651, -583145988, -509279027, -438949979, -372825231, -311497711, -255465040, -205107348, -160673323, -122260482, -89825442, -63156242, -41931466, -25668784, -12980788 }; -# else -# define MDCT_WINDOW_FS_16000_frame_ms_100 NULL -# endif -# ifdef SUBSET_SSWB +#else +#define MDCT_WINDOW_FS_16000_frame_ms_100 NULL +#endif +#ifdef SUBSET_SSWB Word32 MDCT_WINDOW_FS_24000_frame_ms_100[390] = { -566705, -1110129, -1685050, -2404955, -3290604, -4357398, -5620992, -7096870, -8797110, -10732247, -12913348, -15346312, -18033576, -20979359, -24186040, -27648819, -31361639, -35319387, @@ -2414,10 +2414,10 @@ Word32 MDCT_WINDOW_FS_24000_frame_ms_100[390] = { -486428392, -445655594, -406038238, -367747699, -330944214, -295781070, -262392452, -230898968, -201404745, -173990773, -148716671, -125619512, -104711740, -85981071, -69390841, -54880490, -42367028, -31748204, -22909680, -15677896, -8320202 }; -# else -# define MDCT_WINDOW_FS_24000_frame_ms_100 NULL -# endif -# ifdef SUBSET_SWB +#else +#define MDCT_WINDOW_FS_24000_frame_ms_100 NULL +#endif +#ifdef SUBSET_SWB Word32 MDCT_WINDOW_FS_32000_frame_ms_100[520] = { -410329, -796949, -1136328, -1530183, -1997206, -2544529, -3177199, -3900727, -4721409, -5644580, -6674901, -7816606, -9073542, -10449649, -11947654, -13568981, -15314575, -17185616, @@ -2477,10 +2477,10 @@ Word32 MDCT_WINDOW_FS_32000_frame_ms_100[520] = { -347428629, -322556345, -298398778, -275013415, -252453167, -230765335, -209993816, -190178661, -171354066, -153547820, -136781064, -121069202, -106422336, -92843298, -80326106, -68858674, -58425411, -49003701, -40559788, -33054527, -26453090, -20722011, -15806421, -11453718, -6043487 }; -# else -# define MDCT_WINDOW_FS_32000_frame_ms_100 NULL -# endif -# ifdef SUBSET_FB +#else +#define MDCT_WINDOW_FS_32000_frame_ms_100 NULL +#endif +#ifdef SUBSET_FB Word32 MDCT_WINDOW_FS_48000_frame_ms_100[780] = { -260941, -512326, -694531, -879311, -1080918, -1308853, -1562751, -1845827, -2158684, -2503004, -2880077, -3290946, -3737685, -4221002, -4742864, -5303548, -5904756, -6546614, @@ -2569,17 +2569,17 @@ Word32 MDCT_WINDOW_FS_48000_frame_ms_100[780] = { -127735992, -118418783, -109483185, -100930269, -92764786, -84984919, -77594007, -70587122, -63966522, -57723857, -51860743, -46364893, -41238076, -36463273, -32043815, -27956560, -24209143, -20769591, -17655994, -14819879, -12293428, -9917917, -7494462, -3886267 }; -# else -# define MDCT_WINDOW_FS_48000_frame_ms_100 NULL -# endif +#else +#define MDCT_WINDOW_FS_48000_frame_ms_100 NULL +#endif -# ifdef PACK_MDCT_WINDOWS +#ifdef PACK_MDCT_WINDOWS RAM_ALIGN const Word16 * LowDelayShapes_n960[6]; -# else +#else RAM_ALIGN const Word32 *const LowDelayShapes_n960[6] = { MDCT_WINDOW_FS_8000_frame_ms_100, MDCT_WINDOW_FS_16000_frame_ms_100, MDCT_WINDOW_FS_24000_frame_ms_100, MDCT_WINDOW_FS_32000_frame_ms_100, MDCT_WINDOW_FS_48000_frame_ms_100, NULL }; -# endif +#endif #else RAM_ALIGN const Word16 *const LowDelayShapes_n960[6] = {LowDelayShapes_n960_N80, LowDelayShapes_n960_N160, @@ -2587,34 +2587,34 @@ RAM_ALIGN const Word16 *const LowDelayShapes_n960[6] = {LowDelayShapes_n960_N80, LowDelayShapes_n960_N480, NULL}; #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 LowDelayShapes_n960_len_5ms[6] = {70, 140, 210, 280, 420, 840}; -# else +#else RAM_ALIGN const Word16 LowDelayShapes_n960_len_5ms[5] = {70, 140, 210, 280, 420}; -# endif +#endif RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes_5ms[NUM_SAMP_FREQ] = {10, 20, 30, 40, 60 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 120 -# endif +#endif }; -# ifdef ENABLE_HR_MODE -# ifdef SUBSET_NB +#ifdef ENABLE_HR_MODE +#ifdef SUBSET_NB RAM_ALIGN const Word32 MDCT_WINDOW_FS_8000_frame_ms_25[40] = { 9151354, 37109627, 83712740, 151998210, 242715442, 354150912, 482126354, 620379048, 761296862, 896901837, 1019922302, 1124767307, 1208223590, 1269735636, 1311202326, 1336324669, 1349655864, 1355605615, 1357680847, 1358157082, -1358157082, -1357680847, -1355605615, -1349655864, -1336324669, -1311202326, -1269735636, -1208223590, -1124767307, -1019922302, -896901837, -761296862, -620379048, -482126354, -354150912, -242715442, -151998210, -83712740, -37109627, -9151354}; -# else -# define MDCT_WINDOW_FS_8000_frame_ms_25 NULL -# endif -# ifdef SUBSET_WB +#else +#define MDCT_WINDOW_FS_8000_frame_ms_25 NULL +#endif +#ifdef SUBSET_WB RAM_ALIGN const Word32 MDCT_WINDOW_FS_16000_frame_ms_25[80] = { 9151337, 23138265, 42763907, 68767772, 101782534, 142300433, 190643613, 246939893, 311105303, 382834448, 461599452, 546657840, 637069348, 731721202, 829361019, 928636120, 1028137675, 1126447891, @@ -2625,10 +2625,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_16000_frame_ms_25[80] = { -1732486397, -1681363664, -1622430811, -1555784035, -1481757333, -1400920509, -1314066414, -1222188210, -1126447891, -1028137675, -928636120, -829361019, -731721202, -637069348, -546657840, -461599452, -382834448, -311105303, -246939893, -190643613, -142300433, -101782534, -68767772, -42763907, -23138265, -9151337 }; -# else -# define MDCT_WINDOW_FS_16000_frame_ms_25 NULL -# endif -# ifdef SUBSET_SSWB +#else +#define MDCT_WINDOW_FS_16000_frame_ms_25 NULL +#endif +#ifdef SUBSET_SSWB RAM_ALIGN const Word32 MDCT_WINDOW_FS_24000_frame_ms_25[120] = { 6100899, 12864132, 21489409, 32196712, 45171875, 60580072, 78565098, 99246695, 122717635, 149041013, 178247915, 210335558, 245265970, 282965259, 323323502, 366195270, 411400805, 458727828, @@ -2644,10 +2644,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_24000_frame_ms_25[120] = { -610882290, -558749783, -507933969, -458727828, -411400805, -366195270, -323323502, -282965259, -245265970, -210335558, -178247915, -149041013, -122717635, -99246695, -78565098, -60580072, -45171875, -32196712, -21489409, -12864132, -6100899 }; -# else -# define MDCT_WINDOW_FS_24000_frame_ms_25 NULL -# endif -# ifdef SUBSET_SWB +#else +#define MDCT_WINDOW_FS_24000_frame_ms_25 NULL +#endif +#ifdef SUBSET_SWB RAM_ALIGN const Word32 MDCT_WINDOW_FS_32000_frame_ms_25[160] = { 4575679, 8767860, 13776210, 19722611, 26689435, 34747238, 43959497, 54383445, 66069923, 79062931, 93399091, 109107106, 126207257, 144710958, 164620379, 185928150, 208617151, 232660396, @@ -2667,10 +2667,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_32000_frame_ms_25[160] = { -434578316, -402619617, -371560541, -341492250, -312497943, -284652300, -258021008, -232660396, -208617151, -185928150, -164620379, -144710958, -126207257, -109107106, -93399091, -79062931, -66069923, -54383445, -43959497, -34747238, -26689435, -19722611, -13776210, -8767860, -4575679 }; -# else -# define MDCT_WINDOW_FS_32000_frame_ms_25 NULL -# endif -# ifdef SUBSET_FB +#else +#define MDCT_WINDOW_FS_32000_frame_ms_25 NULL +#endif +#ifdef SUBSET_FB RAM_ALIGN const Word32 MDCT_WINDOW_FS_48000_frame_ms_25[240] = { 3050456, 5295536, 7753004, 10501942, 13578229, 17006497, 20806969, 24997575, 29594719, 34613583, 40068237, 45971662, 52335732, 59171174, 66487516, 74293042, 82594732, 91398213, @@ -2699,13 +2699,13 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_48000_frame_ms_25[240] = { -154890033, -143038956, -131692624, -120854381, -110526001, -100707709, -91398213, -82594732, -74293042, -66487516, -59171174, -52335732, -45971662, -40068237, -34613583, -29594719, -24997575, -20806969, -17006497, -13578229, -10501942, -7753004, -5295536, -3050456 }; -# else -# define MDCT_WINDOW_FS_48000_frame_ms_25 NULL -# endif +#else +#define MDCT_WINDOW_FS_48000_frame_ms_25 NULL +#endif #endif -# ifdef ENABLE_HR_MODE -# ifdef SUBSET_NB +#ifdef ENABLE_HR_MODE +#ifdef SUBSET_NB RAM_ALIGN const Word32 MDCT_WINDOW_FS_8000_frame_ms_50[70] = { 1912909, 7335521, 18325724, 36910622, 64974178, 104198418, 155981280, 221305462, 300589079, 393635120, 499623692, 617106989, 744004208, 877694270, 1015162828, 1153137249, 1288239038, 1417150998, @@ -2715,10 +2715,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_8000_frame_ms_50[70] = { -1944164165, -1941697923, -1936063536, -1926966575, -1914246866, -1895468226, -1869147188, -1832534703, -1783214725, -1719263259, -1639330989, -1542778136, -1429960741, -1302431717, -1162827131, -1014564422, -861762630, -709123640, -561741289, -424627691, -302165309, -197940066, -114914393, -55161222, -18600494 }; -# else -# define MDCT_WINDOW_FS_8000_frame_ms_50 NULL -# endif -# ifdef SUBSET_WB +#else +#define MDCT_WINDOW_FS_8000_frame_ms_50 NULL +#endif +#ifdef SUBSET_WB RAM_ALIGN const Word32 MDCT_WINDOW_FS_16000_frame_ms_50[140] = { 834388, 2023133, 3917156, 6701705, 10565521, 15685856, 22235650, 30384241, 40286022, 52095516, 65948322, 81967398, 100265346, 120927126, 144016301, 169574495, 197607091, 228098907, @@ -2736,10 +2736,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_16000_frame_ms_50[140] = { -896992664, -847599093, -796504062, -744037160, -690570612, -636495945, -582226621, -528203723, -474881089, -422717084, -372160937, -323635430, -277529378, -234193138, -193941056, -157058932, -123809989, -94431397, -69117849, -47990622, -31057417, -18172622, -9019056 }; -# else -# define MDCT_WINDOW_FS_16000_frame_ms_50 NULL -# endif -# ifdef SUBSET_SSWB +#else +#define MDCT_WINDOW_FS_16000_frame_ms_50 NULL +#endif +#ifdef SUBSET_SSWB RAM_ALIGN const Word32 MDCT_WINDOW_FS_24000_frame_ms_50[210] = { 564151, 1104419, 1865494, 2894039, 4235165, 5932159, 8033172, 10580362, 13613959, 17177173, 21310358, 26053470, 31441110, 37512859, 44302113, 51841191, 60158985, 69285016, @@ -2765,10 +2765,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_24000_frame_ms_50[210] = { -352163661, -324321484, -297140687, -270721761, -245158912, -220540161, -196946958, -174455223, -153136078, -133056674, -114280750, -96868231, -80874056, -66345855, -53320577, -41820223, -31847346, -23380692, -16371397, -10739000, -6256916 }; -# else -# define MDCT_WINDOW_FS_24000_frame_ms_50 NULL -# endif -# ifdef SUBSET_SWB +#else +#define MDCT_WINDOW_FS_24000_frame_ms_50 NULL +#endif +#ifdef SUBSET_SWB RAM_ALIGN const Word32 MDCT_WINDOW_FS_32000_frame_ms_50[280] = { 882763, 1521118, 2358563, 3425984, 4762639, 6395771, 8362131, 10689006, 13418692, 16576000, 20193865, 24299300, 28928500, 34104984, 39865074, 46229302, 53228467, 60887056, @@ -2802,10 +2802,10 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_32000_frame_ms_50[280] = { -316541929, -288074358, -260771792, -234687576, -209863469, -186348825, -164181088, -143404068, -124048067, -106147028, -89718620, -74780184, -61329654, -49360094, -38842904, -29739589, -21991349, -15513048, -10180154 }; -# else -# define MDCT_WINDOW_FS_32000_frame_ms_50 NULL -# endif -# ifdef SUBSET_FB +#else +#define MDCT_WINDOW_FS_32000_frame_ms_50 NULL +#endif +#ifdef SUBSET_FB RAM_ALIGN const Word32 MDCT_WINDOW_FS_48000_frame_ms_50[420] = { 641452, 963468, 1344309, 1798864, 2336113, 2963727, 3690212, 4523143, 5470567, 6539876, 7738462, 9075874, 10560639, 12200013, 14000287, 15968479, 18112467, 20440430, @@ -2854,9 +2854,9 @@ RAM_ALIGN const Word32 MDCT_WINDOW_FS_48000_frame_ms_50[420] = { -195100311, -181356034, -168078124, -155277193, -142963461, -131146681, -119836028, -109039985, -98766166, -89021184, -79810417, -71137840, -63005796, -55414797, -48363340, -41847826, -35862016, -30397367, -25442735, -20983937, -17003804, -13482292, -10414308, -8112352 }; -# else -# define MDCT_WINDOW_FS_48000_frame_ms_50 NULL -# endif +#else +#define MDCT_WINDOW_FS_48000_frame_ms_50 NULL +#endif #endif #ifdef ENABLE_HR_MODE @@ -2868,11 +2868,11 @@ RAM_ALIGN const Word16 *const LowDelayShapes_n960_5ms[6] = {LowDelayShapes_n960_ LowDelayShapes_n960_N240_5ms, NULL}; #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 LowDelayShapes_n960_len_2_5ms[6] = {40, 80, 120, 160, 240, 480}; -# else +#else RAM_ALIGN const Word16 LowDelayShapes_n960_len_2_5ms[5] = {40, 80, 120, 160, 240}; -# endif +#endif RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes_2_5ms[NUM_SAMP_FREQ] = {0, 0, @@ -2890,7 +2890,7 @@ RAM_ALIGN const Word16 *const LowDelayShapes_n960_2_5ms[6] = { LowDelayShapes_n960_N160_2_5ms, LowDelayShapes_n960_N240_2_5ms, NULL}; #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 tns_subdiv_startfreq_48k_HR[6] = {12, 74, 137, 200, 266, 333}; RAM_ALIGN const Word16 tns_subdiv_stopfreq_48k_HR[6] = {74, 137, 200, 266, 333, 400}; RAM_ALIGN const Word16 tns_subdiv_startfreq_96k_HR[6] = {12, 74, 137, 200, 266, 333}; @@ -2917,7 +2917,7 @@ RAM_ALIGN const Word16 *const tns_subdiv_startfreq_2_5ms_HR[2] = {tns_subdiv_sta tns_subdiv_startfreq_96k_2_5ms_HR}; RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_2_5ms_HR[2] = {tns_subdiv_stopfreq_48k_2_5ms_HR, tns_subdiv_stopfreq_96k_2_5ms_HR}; -# endif +#endif RAM_ALIGN const Word16 tns_subdiv_startfreq_8k[6] = {12, 34, 57, 0, 0, 0}; @@ -2989,26 +2989,26 @@ RAM_ALIGN const Word16 tns_subdiv_stopfreq_32k_7_5ms[6] = RAM_ALIGN const Word16 tns_subdiv_startfreq_48k_7_5ms[6] = {9, 56, 103, 150, 200, 250}; RAM_ALIGN const Word16 tns_subdiv_stopfreq_48k_7_5ms[6] = {56, 103, 150, 200, 250, 300}; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 tns_subdiv_startfreq_96k_7_5ms[6] = {9, 56, 103, 150, 200, 250}; RAM_ALIGN const Word16 tns_subdiv_stopfreq_96k_7_5ms[6] = {56, 103, 150, 200, 250, 300}; -# endif +#endif RAM_ALIGN const Word16 *const tns_subdiv_startfreq_7_5ms[] = { tns_subdiv_startfreq_8k_7_5ms, tns_subdiv_startfreq_16k_7_5ms, tns_subdiv_startfreq_24k_7_5ms, tns_subdiv_startfreq_32k_7_5ms, tns_subdiv_startfreq_48k_7_5ms -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , tns_subdiv_startfreq_96k_7_5ms -# endif +#endif }; RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_7_5ms[] = { tns_subdiv_stopfreq_8k_7_5ms, tns_subdiv_stopfreq_16k_7_5ms, tns_subdiv_stopfreq_24k_7_5ms, tns_subdiv_stopfreq_32k_7_5ms, tns_subdiv_stopfreq_48k_7_5ms -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , tns_subdiv_stopfreq_96k_7_5ms -# endif +#endif }; -# endif +#endif RAM_ALIGN const Word16 Tab_esc_nb[4] = {0 << (NBITS_CONTEXT + NBITS_RATEQ), 1 << (NBITS_CONTEXT + NBITS_RATEQ), 2 << (NBITS_CONTEXT + NBITS_RATEQ), 3 << (NBITS_CONTEXT + NBITS_RATEQ)}; @@ -3589,8 +3589,8 @@ RAM_ALIGN const Word16 lpc_warp_pre_emphasis_64_e_96000[64] = { 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c}; #else -# define lpc_warp_pre_emphasis_64_96000 NULL -# define lpc_warp_pre_emphasis_64_e_96000 NULL +#define lpc_warp_pre_emphasis_64_96000 NULL +#define lpc_warp_pre_emphasis_64_e_96000 NULL #endif RAM_ALIGN const Word16 *const lpc_pre_emphasis[NUM_SAMP_FREQ] = {lpc_warp_pre_emphasis_64_8000, @@ -3828,7 +3828,7 @@ RAM_ALIGN const Word16 lpc_lin_pre_emphasis_80_e_48000[80] = { #define lpc_lin_pre_emphasis_80_e_48000 NULL #endif -# if defined(SUBSET_SWB) || defined(SUBSET_FB) +#if defined(SUBSET_SWB) || defined(SUBSET_FB) RAM_ALIGN const Word16 lpc_lin_pre_emphasis_80_0_92[80] = { 0x6eab, 0x4e92, 0x7d03, 0x614a, 0x47cb, 0x64a9, 0x439a, 0x57af, 0x6e8c, 0x4414, 0x523c, 0x61b9, 0x7284, 0x424c, 0x4bf6, 0x563d, 0x611c, 0x6c8f, 0x7892, 0x4290, 0x491a, 0x4fe5, 0x56ed, 0x5e31, 0x65ac, 0x6d5d, 0x753f, 0x7d51, @@ -3849,10 +3849,10 @@ RAM_ALIGN const Word16 lpc_lin_pre_emphasis_80_e_0_92[80] = { (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002, (Word16)0x0002}; -# else -# define lpc_lin_pre_emphasis_80_0_92 NULL -# define lpc_lin_pre_emphasis_80_e_0_92 NULL -# endif +#else +#define lpc_lin_pre_emphasis_80_0_92 NULL +#define lpc_lin_pre_emphasis_80_e_0_92 NULL +#endif RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis[NUM_SAMP_FREQ] = {lpc_lin_pre_emphasis_80_8000, lpc_lin_pre_emphasis_80_16000, lpc_lin_pre_emphasis_80_24000, lpc_lin_pre_emphasis_80_32000, @@ -3897,13 +3897,13 @@ RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis_2_5ms[NUM_SAMP_FREQ] = { RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis_e_2_5ms[NUM_SAMP_FREQ] = { lpc_lin_pre_emphasis_20_e_8000, lpc_lin_pre_emphasis_40_e_16000, lpc_lin_pre_emphasis_60_e_24000, lpc_lin_pre_emphasis_80_e_32000, lpc_lin_pre_emphasis_60_e_48000 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , lpc_lin_pre_emphasis_80_e_0_92 #endif }; -# ifdef ENABLE_075_DMS_MODE -# ifdef CR8_G_ADD_75MS +#ifdef ENABLE_075_DMS_MODE +#ifdef CR8_G_ADD_75MS RAM_ALIGN const Word16 lpc_lin_pre_emphasis_60_0_62[60] = { 0x4a26, 0x4be4, 0x4f5d, 0x5490, 0x5b79, 0x6414, 0x6e59, 0x7a43, 0x43e4, 0x4b6f, 0x53bf, 0x5ccc, 0x6690, 0x7106, 0x7c25, 0x43f3, 0x4a1f, 0x5095, 0x574e, 0x5e46, 0x6578, 0x6cdf, 0x7477, 0x7c39, 0x4210, 0x4613, 0x4a24, 0x4e3e, @@ -3975,19 +3975,19 @@ RAM_ALIGN const Word16 lpc_lin_pre_emphasis_60_e_0_92[60] = { RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis_7_5ms[NUM_SAMP_FREQ] = { lpc_lin_pre_emphasis_60_0_62, lpc_lin_pre_emphasis_60_0_72, lpc_lin_pre_emphasis_60_0_82, lpc_lin_pre_emphasis_80_0_92, lpc_lin_pre_emphasis_60_0_92 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , lpc_lin_pre_emphasis_80_0_92 -# endif +#endif }; RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis_e_7_5ms[NUM_SAMP_FREQ] = { lpc_lin_pre_emphasis_60_e_0_62, lpc_lin_pre_emphasis_60_e_0_72, lpc_lin_pre_emphasis_60_e_0_82, lpc_lin_pre_emphasis_80_e_0_92, lpc_lin_pre_emphasis_60_e_0_92 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , lpc_lin_pre_emphasis_80_e_0_92 -# endif +#endif }; -# endif -# endif +#endif +#endif #ifdef SUBSET_NB RAM_ALIGN const Word16 lpc_warp_dee_emphasis_16_8000[16] = {0x4000, 0x673f, 0x5348, 0x432d, 0x6c5f, 0x576a, @@ -4059,7 +4059,7 @@ RAM_ALIGN const Word16 lpc_warp_dee_emphasis_16_e_48000[16] = { #define lpc_warp_dee_emphasis_16_e_48000 NULL #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 lpc_warp_dee_emphasis_16_96000[16] = {0x4000, 0x4bf4, 0x5a23, 0x6af9, 0x7ef3, 0x4b54, 0x5966, 0x6a18, 0x7de9, 0x4ab6, 0x58aa, 0x6939, 0x7ce0, 0x4a19, 0x57f0, 0x685d}; @@ -4068,10 +4068,10 @@ RAM_ALIGN const Word16 lpc_warp_dee_emphasis_16_e_96000[16] = { (Word16)0x0001, (Word16)0x0000, (Word16)0xffff, (Word16)0xfffe, (Word16)0xfffd, (Word16)0xfffd, (Word16)0xfffc, (Word16)0xfffb, (Word16)0xfffa, (Word16)0xfffa, (Word16)0xfff9, (Word16)0xfff8, (Word16)0xfff7, (Word16)0xfff7, (Word16)0xfff6, (Word16)0xfff5}; -# else -# define lpc_warp_dee_emphasis_16_96000 NULL -# define lpc_warp_dee_emphasis_16_e_96000 NULL -# endif +#else +#define lpc_warp_dee_emphasis_16_96000 NULL +#define lpc_warp_dee_emphasis_16_e_96000 NULL +#endif RAM_ALIGN const Word16 *const lpc_warp_dee_emphasis[NUM_SAMP_FREQ] = { lpc_warp_dee_emphasis_16_8000, lpc_warp_dee_emphasis_16_16000, lpc_warp_dee_emphasis_16_24000, @@ -4127,7 +4127,7 @@ RAM_ALIGN const Word16 bands_offset_96000_7_5ms_HR[65] = { 180, 195, 210, 227, 245, 265, 286, 309, 334, 360, 389, 420, 454, 490, 529, 572, 617, 667, 720}; RAM_ALIGN const Word16 *const bands_offset_7_5ms_HR[2] = {bands_offset_48000_7_5ms_HR, bands_offset_96000_7_5ms_HR}; -# endif +#endif #endif /* ENABLE_HR_MODE */ #ifdef SUBSET_NB @@ -4342,48 +4342,48 @@ RAM_ALIGN const Word16 *const bands_offset[6] = {bands_offset_8000_lpc_warp, ban #ifdef CR8_G_ADD_75MS RAM_ALIGN const Word16 bands_offset_with_one_max_7_5ms[NUM_OFFSETS] = {60, 34, 27, 24, 22 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 20, 16 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_7_5ms[NUM_OFFSETS] = {0, 48, 38, 33, 31 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 29, 24 -# endif +#endif }; -# endif +#endif RAM_ALIGN const Word16 bands_offset_with_one_max[NUM_OFFSETS] = {49, 28, 23, 20, 18 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 17, 12 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max[NUM_OFFSETS] = {63, 40, 33, 29, 27 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 25, 21 -# endif +#endif }; RAM_ALIGN const Word16 *const bands_offset_5ms[6] = {bands_offset_8000_lpc_warp_5ms, bands_offset_16000_lpc_warp_5ms, bands_offset_24000_lpc_warp_5ms, bands_offset_32000_lpc_warp_5ms, bands_offset_48000_lpc_warp_5ms, NULL}; RAM_ALIGN const Word16 bands_offset_with_one_max_5ms[NUM_OFFSETS] = {38, 30, 24, 22, 21 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 19, 17 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_5ms[NUM_OFFSETS] = {39, 42, 34, 32, 29 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 27, 24 -# endif +#endif }; #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 bands_number_7_5ms [] = {60, 64, 64, 64, 64, 64}; -# else +#else RAM_ALIGN const Word16 bands_number_7_5ms [] = {60, 64, 64, 64, 64}; -# endif +#endif #endif #ifdef ENABLE_HR_MODE @@ -4397,24 +4397,24 @@ RAM_ALIGN const Word16 *const bands_offset_2_5ms[6] = { bands_offset_32000_lpc_warp_2_5ms, bands_offset_48000_lpc_warp_2_5ms, NULL}; RAM_ALIGN const Word16 bands_offset_with_one_max_2_5ms[NUM_OFFSETS] = {20, 30, 26, 24, 21 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 19, 16 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_2_5ms[NUM_OFFSETS] = {20, 35, 35, 32, 29 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 28, 24 -# endif +#endif }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 bands_number_2_5ms_HR[] = {20, 35, 40, 43, 45, 49}; RAM_ALIGN const Word16 bands_number_2_5ms [] = {20, 35, 40, 43, 44, 49}; -# else +#else RAM_ALIGN const Word16 bands_number_2_5ms [] = {20, 35, 40, 43, 44}; -# endif +#endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 bands_offset_96000_lpc_lin[81] = { 0x0000, 0x000c, 0x0018, 0x0024, 0x0030, 0x003c, 0x0048, 0x0054, 0x0060, 0x006c, 0x0078, 0x0084, 0x0090, 0x009c, @@ -4425,7 +4425,7 @@ RAM_ALIGN const Word16 bands_offset_96000_lpc_lin[81] = 0x0348, 0x0354, 0x0360, 0x036c, 0x0378, 0x0384, 0x0390, 0x039c, 0x03a8, 0x03b4, 0x03c0 }; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS RAM_ALIGN const Word16 bands_offset_96000_lpc_lin_7_5ms[81] = { 0x0000, 0x0009, 0x0012, 0x001b, 0x0024, 0x002d, 0x0036, 0x003f, 0x0048, 0x0051, 0x005a, 0x0063, 0x006c, 0x0075, @@ -4435,138 +4435,138 @@ RAM_ALIGN const Word16 bands_offset_96000_lpc_lin_7_5ms[81] = 0x01f8, 0x0201, 0x020a, 0x0213, 0x021c, 0x0225, 0x022e, 0x0237, 0x0240, 0x0249, 0x0252, 0x025b, 0x0264, 0x026d, 0x0276, 0x027f, 0x0288, 0x0291, 0x029a, 0x02a3, 0x02ac, 0x02b5, 0x02be, 0x02c7, 0x02d0 }; -# endif -# endif +#endif +#endif RAM_ALIGN const Word16 *const bands_offset_lin[NUM_SAMP_FREQ] = {bands_offset_8000_lpc_lin, bands_offset_16000_lpc_lin, bands_offset_24000_lpc_lin, bands_offset_32000_lpc_lin, bands_offset_48000_lpc_lin -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , bands_offset_96000_lpc_lin -# endif +#endif }; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS RAM_ALIGN const Word16 *const bands_offset_lin_7_5ms[NUM_SAMP_FREQ] = {bands_offset_8000_lpc_lin, bands_offset_16000_lpc_lin, bands_offset_24000_lpc_lin, bands_offset_24000_lpc_lin, bands_offset_48000_lpc_lin -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , bands_offset_96000_lpc_lin_7_5ms -# endif +#endif }; -# endif +#endif RAM_ALIGN const Word16 *const bands_offset_lin_5ms[NUM_SAMP_FREQ] = {bands_offset_8000_lpc_lin, bands_offset_8000_lpc_lin, bands_offset_24000_lpc_lin, bands_offset_16000_lpc_lin, bands_offset_24000_lpc_lin -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , bands_offset_48000_lpc_lin -# endif +#endif }; RAM_ALIGN const Word16 *const bands_offset_lin_2_5ms[NUM_SAMP_FREQ] = {bands_offset_8000_lpc_lin, bands_offset_8000_lpc_lin, bands_offset_8000_lpc_lin, bands_offset_8000_lpc_lin, bands_offset_16000_lpc_lin -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , bands_offset_24000_lpc_lin -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_one_max_lin[NUM_SAMP_FREQ] = {80, 0, 0, 0, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_lin[NUM_SAMP_FREQ] = {0, 80, 0, 0, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS RAM_ALIGN const Word16 bands_offset_with_one_max_lin_7_5ms[NUM_SAMP_FREQ] = {60, 0, 0, 0, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_lin_7_5ms[NUM_SAMP_FREQ] = {0, 60, 0, 0, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; #endif RAM_ALIGN const Word16 bands_offset_with_one_max_lin_5ms[NUM_SAMP_FREQ] = {40, 80, 0, 0, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_lin_5ms[NUM_SAMP_FREQ] = {0, 0, 0, 80, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_one_max_lin_2_5ms[NUM_SAMP_FREQ] = {20, 40, 60, 80, 0 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; RAM_ALIGN const Word16 bands_offset_with_two_max_lin_2_5ms[NUM_SAMP_FREQ] = {0, 0, 0, 0, 60 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , 0 -# endif +#endif }; #ifdef CR8_G_ADD_75MS -# ifdef SUBSET_NB +#ifdef SUBSET_NB RAM_ALIGN const Word16 bands_offset_8000_lpc_warp_7_5ms[61] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60}; -# else -# define bands_offset_8000_lpc_warp_7_5ms NULL -# endif +#else +#define bands_offset_8000_lpc_warp_7_5ms NULL +#endif -# ifdef SUBSET_WB +#ifdef SUBSET_WB RAM_ALIGN const Word16 bands_offset_16000_lpc_warp_7_5ms[65] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 65, 68, 71, 74, 77, 80, 83, 86, 90, 94, 98, 102, 106, 110, 115, 120}; -# else -# define bands_offset_16000_lpc_warp_7_5ms NULL -# endif +#else +#define bands_offset_16000_lpc_warp_7_5ms NULL +#endif -# ifdef SUBSET_SSWB +#ifdef SUBSET_SSWB RAM_ALIGN const Word16 bands_offset_24000_lpc_warp_7_5ms[65] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 52, 55, 58, 61, 64, 67, 70, 74, 78, 82, 86, 90, 95, 100, 105, 110, 115, 121, 127, 134, 141, 148, 155, 163, 171, 180}; -# else -# define bands_offset_24000_lpc_warp_7_5ms NULL -# endif +#else +#define bands_offset_24000_lpc_warp_7_5ms NULL +#endif -# ifdef SUBSET_SWB +#ifdef SUBSET_SWB RAM_ALIGN const Word16 bands_offset_32000_lpc_warp_7_5ms[65] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 45, 48, 51, 54, 57, 60, 63, 67, 71, 75, 79, 84, 89, 94, 99, 105, 111, 117, 124, 131, 138, 146, 154, 163, 172, 182, 192, 203, 215, 227, 240}; -# else -# define bands_offset_32000_lpc_warp_7_5ms NULL -# endif +#else +#define bands_offset_32000_lpc_warp_7_5ms NULL +#endif -# ifdef SUBSET_FB +#ifdef SUBSET_FB RAM_ALIGN const Word16 bands_offset_48000_lpc_warp_7_5ms[65] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 43, 46, 49, 52, 55, 59, 63, 67, 71, 75, 80, 85, 90, 96, 102, 108, 115, 122, 129, 137, 146, 155, 165, 175, 186, 197, 209, 222, 236, 251, 266, 283, 300}; -# else -# define bands_offset_48000_lpc_warp_7_5ms NULL -# endif +#else +#define bands_offset_48000_lpc_warp_7_5ms NULL +#endif RAM_ALIGN const Word16 *const bands_offset_7_5ms[5] = { bands_offset_8000_lpc_warp_7_5ms, bands_offset_16000_lpc_warp_7_5ms, bands_offset_24000_lpc_warp_7_5ms, bands_offset_32000_lpc_warp_7_5ms, bands_offset_48000_lpc_warp_7_5ms}; -# endif /* ifdef CR8_G_ADD_75MS */ +#endif /* ifdef CR8_G_ADD_75MS */ RAM_ALIGN const Word32 inv_odft_twiddle_80_re[M] = { 0x7ff9af04, 0x7fe6bcb0, 0x7fc72ae2, 0x7f9afcb9, 0x7f62368f, 0x7f1cde01, 0x7ecaf9e5, 0x7e6c9251, @@ -4700,7 +4700,7 @@ RAM_ALIGN const Word16 resamp_filt_96k[240] = { -41, 38, 100, 136, 144, 127, 92, 46, 0, -39, -65, -76, -73, -58, -35, -11, 10, 26, 34, 35, 30, 21, 10, 0, -8, -12, -13, -12, -8, -5, -1}; #else -# define resamp_filt_96k NULL +#define resamp_filt_96k NULL #endif #ifdef SUBSET_FB @@ -5026,19 +5026,19 @@ RAM_ALIGN const Word32 isqrt_Q31tab[1 + 64] = {/* 2^31 / sqrt(idx) */ 277238946, 274957105, 272730696, 270557508, 268435456 }; #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE RAM_ALIGN const Word16 adjust_global_gain_tables[5][NUM_SAMP_FREQ] = {{80, 230, 380, 530, 680, 830}, {500, 1025, 1550, 2075, 2600, 3125}, {850, 1700, 2550, 3400, 4250, 5100}, {189, 164, 155, 151, 148, 146}, {1310, 3241, 5268, 7326, 9400, 11482}}; -# else +#else RAM_ALIGN const Word16 adjust_global_gain_tables[5][NUM_SAMP_FREQ] = {{80, 230, 380, 530, 680}, {500, 1025, 1550, 2075, 2600}, {850, 1700, 2550, 3400, 4250}, {189, 164, 155, 151, 148}, {1310, 3241, 5268, 7326, 9400}}; -# endif +#endif #if defined(CR8_A_PLC_FADEOUT_TUNING) const Word16 plc_fadeout_param_maxlen[4] = {800, 400, 266, 200}; diff --git a/lib_lc3plus/constants.h b/lib_lc3plus/constants.h index 8dee7e6eb..e8f98f606 100644 --- a/lib_lc3plus/constants.h +++ b/lib_lc3plus/constants.h @@ -24,67 +24,67 @@ extern RAM_ALIGN const Word32 *const LowDelayShapes_n960_HRA_7_5ms[2]; extern RAM_ALIGN const Word32 *const LowDelayShapes_n960_HRA[2]; #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 LowDelayShapes_n960_len[6]; -# else +#else extern RAM_ALIGN const Word16 LowDelayShapes_n960_len[5]; -# endif +#endif extern RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes[NUM_SAMP_FREQ]; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word32 *const LowDelayShapes_n960[6]; -# else +#else extern RAM_ALIGN const Word16 *const LowDelayShapes_n960[6]; -# endif +#endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 LowDelayShapes_n960_len_5ms[6]; -# else +#else extern RAM_ALIGN const Word16 LowDelayShapes_n960_len_5ms[5]; -# endif +#endif extern RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes_5ms[NUM_SAMP_FREQ]; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word32 *const LowDelayShapes_n960_5ms[6]; -# else +#else extern RAM_ALIGN const Word16 *const LowDelayShapes_n960_5ms[6]; -# endif +#endif #ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 LowDelayShapes_n960_len_2_5ms[6]; #else extern RAM_ALIGN const Word16 LowDelayShapes_n960_len_2_5ms[5]; #endif extern RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes_2_5ms[NUM_SAMP_FREQ]; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word32 *const LowDelayShapes_n960_2_5ms[6]; -# else +#else extern RAM_ALIGN const Word16 *const LowDelayShapes_n960_2_5ms[6]; -# endif +#endif -# ifdef CR8_G_ADD_75MS -# ifdef ENABLE_HR_MODE +#ifdef CR8_G_ADD_75MS +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word32 *const LowDelayShapes_n960_7_5ms[5]; -# else +#else extern RAM_ALIGN const Word16 *const LowDelayShapes_n960_7_5ms[5]; -# endif +#endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 LowDelayShapes_n960_len_7_5ms[6]; -# else +#else extern RAM_ALIGN const Word16 LowDelayShapes_n960_len_7_5ms[5]; -# endif +#endif extern RAM_ALIGN const Word16 LowDelayShapes_n960_la_zeroes_7_5ms[NUM_SAMP_FREQ]; -# endif +#endif extern RAM_ALIGN const Word16 NN_thresh; extern RAM_ALIGN const Word16 NN_thresh_exp; #ifdef CR8_E_TONE_DETECTOR -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word32 TD_HR_thresh_10ms; -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE extern RAM_ALIGN const Word32 TD_HR_thresh_7_5ms; -# endif +#endif extern RAM_ALIGN const Word32 TD_HR_thresh_5ms; extern RAM_ALIGN const Word32 TD_HR_thresh_2_5ms; -# endif /* ENABLE_HR_MODE */ +#endif /* ENABLE_HR_MODE */ #endif /* CR8_E_TONE_DETECTOR */ extern RAM_ALIGN const Word32 BW_thresh_quiet[4]; extern RAM_ALIGN const Word16 BW_thresh_quiet_exp; @@ -109,17 +109,17 @@ extern RAM_ALIGN const Word16 *const BW_warp_idx_start_all_2_5ms[MAX_BW_BANDS_NU extern RAM_ALIGN const Word16 *const BW_warp_idx_stop_all_2_5ms[MAX_BW_BANDS_NUMBER - 1]; #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE extern RAM_ALIGN const Word16 BW_brickwall_dist_7_5ms[4]; extern RAM_ALIGN const Word16 *const BW_warp_idx_start_all_7_5ms[]; extern RAM_ALIGN const Word16 *const BW_warp_idx_stop_all_7_5ms[]; -# endif +#endif #endif extern RAM_ALIGN const Word16 *const tns_subdiv_startfreq[MAX_BW_BANDS_NUMBER]; extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq[MAX_BW_BANDS_NUMBER]; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 *const tns_subdiv_startfreq_HR[2]; extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_HR[2]; @@ -128,7 +128,7 @@ extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_5ms_HR[2]; extern RAM_ALIGN const Word16 *const tns_subdiv_startfreq_2_5ms_HR[2]; extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_2_5ms_HR[2]; -# endif +#endif extern RAM_ALIGN const Word16 *const tns_subdiv_startfreq_5ms[MAX_BW_BANDS_NUMBER]; extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_5ms[MAX_BW_BANDS_NUMBER]; @@ -138,10 +138,10 @@ extern RAM_ALIGN const Word16 *const tns_subdiv_startfreq_2_5ms[MAX_BW_BANDS_NUM extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_2_5ms[MAX_BW_BANDS_NUMBER]; #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE extern RAM_ALIGN const Word16 *const tns_subdiv_startfreq_7_5ms[]; extern RAM_ALIGN const Word16 *const tns_subdiv_stopfreq_7_5ms[]; -# endif +#endif #endif extern RAM_ALIGN const Word16 Tab_esc_nb[4]; @@ -175,19 +175,19 @@ extern RAM_ALIGN const Word16 *const lpc_warp_dee_emphasis[NUM_SAMP_FREQ]; extern RAM_ALIGN const Word16 *const lpc_warp_dee_emphasis_e[NUM_SAMP_FREQ]; #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE extern RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis_7_5ms[NUM_SAMP_FREQ]; extern RAM_ALIGN const Word16 *const lpc_lin_pre_emphasis_e_7_5ms[NUM_SAMP_FREQ]; -# endif +#endif #endif extern RAM_ALIGN const Word16 bands_nrg_scale[32]; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 *const bands_offset_2_5ms_HR[2]; extern RAM_ALIGN const Word16 *const bands_offset_5ms_HR[2]; extern RAM_ALIGN const Word16 *const bands_offset_HR[2]; -# endif +#endif extern RAM_ALIGN const Word16 *const bands_offset[6]; extern RAM_ALIGN const Word16 bands_offset_with_one_max[NUM_OFFSETS]; @@ -205,15 +205,15 @@ extern RAM_ALIGN const Word16 bands_offset_with_two_max_2_5ms[NUM_OFFSETS]; #ifdef CR8_G_ADD_75MS #ifdef ENABLE_075_DMS_MODE extern RAM_ALIGN const Word16 bands_number_7_5ms[]; -# ifndef GENERATE_BAND_TABLES +#ifndef GENERATE_BAND_TABLES extern RAM_ALIGN const Word16 *const bands_offset_7_5ms[5]; -# endif -# ifdef ENABLE_HR_MODE +#endif +#ifdef ENABLE_HR_MODE extern RAM_ALIGN const Word16 bands_number_7_5ms_HR[]; -# ifndef GENERATE_BAND_TABLES +#ifndef GENERATE_BAND_TABLES extern RAM_ALIGN const Word16 *const bands_offset_7_5ms_HR[2]; -# endif -# endif +#endif +#endif #endif #endif @@ -238,13 +238,13 @@ extern RAM_ALIGN const Word16 bands_offset_with_one_max_lin_2_5ms[NUM_SAMP_FREQ] extern RAM_ALIGN const Word16 bands_offset_with_two_max_lin_2_5ms[NUM_SAMP_FREQ]; #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE extern RAM_ALIGN const Word16 bands_offset_with_one_max_7_5ms[NUM_OFFSETS]; extern RAM_ALIGN const Word16 bands_offset_with_two_max_7_5ms[NUM_OFFSETS]; extern RAM_ALIGN const Word16 *const bands_offset_lin_7_5ms[NUM_SAMP_FREQ]; extern RAM_ALIGN const Word16 bands_offset_with_one_max_lin_7_5ms[NUM_SAMP_FREQ]; extern RAM_ALIGN const Word16 bands_offset_with_two_max_lin_7_5ms[NUM_SAMP_FREQ]; -# endif +#endif #endif extern RAM_ALIGN const Word32 inv_odft_twiddle_80_re[M]; diff --git a/lib_lc3plus/dct4_fx.c b/lib_lc3plus/dct4_fx.c index dca4e382c..9199f3e66 100644 --- a/lib_lc3plus/dct4_fx.c +++ b/lib_lc3plus/dct4_fx.c @@ -15,9 +15,9 @@ void dct_IV(Word32 *pDat, /* i/o: pointer to data buffer */ Word16 *pDat_e, /* i/o: pointer to data exponent */ Word16 L, /* i : length of block */ #ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word16 hrmode, /* indicate high precision usage */ -# endif +#endif #endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ Word32 *workBuffer) /* : size of L */ @@ -103,7 +103,7 @@ void dct_IV(Word32 *pDat, /* i/o: pointer to data buffer */ FOR (i = 0; i < M2; i += 2) { #ifdef ENABLE_HR_MODE -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION if (hrmode) { cplxMpy32_32_32_2(accu1, accu2, pDat_1[1], pDat_0[0], twiddle[i].v.re, twiddle[i].v.im); cplxMpy32_32_32_2(accu3, accu4, pDat_1[0], pDat_0[1], twiddle[i + 1].v.re, twiddle[i + 1].v.im); @@ -111,10 +111,10 @@ void dct_IV(Word32 *pDat, /* i/o: pointer to data buffer */ cplxMpy32_32_16_2(accu1, accu2, pDat_1[1], pDat_0[0], round_fx_sat(twiddle[i].v.re), round_fx_sat(twiddle[i].v.im)); cplxMpy32_32_16_2(accu3, accu4, pDat_1[0], pDat_0[1], round_fx_sat(twiddle[i + 1].v.re), round_fx_sat(twiddle[i + 1].v.im)); } -# else /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ +#else /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ cplxMpy32_32_32_2(accu1, accu2, pDat_1[1], pDat_0[0], twiddle[i].v.re, twiddle[i].v.im); cplxMpy32_32_32_2(accu3, accu4, pDat_1[0], pDat_0[1], twiddle[i + 1].v.re, twiddle[i + 1].v.im); -# endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ +#endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ #else cplxMpy32_32_16_2(accu1, accu2, pDat_1[1], pDat_0[0], twiddle[i].v.re, twiddle[i].v.im); @@ -131,9 +131,9 @@ void dct_IV(Word32 *pDat, /* i/o: pointer to data buffer */ } #ifdef ENABLE_DCTIV_RESCALE -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION if (hrmode) -# endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ +#endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ { scale = s_max(getScaleFactor32_lc3plus(pDat, L), 0); move16(); diff --git a/lib_lc3plus/defines.h b/lib_lc3plus/defines.h index 2d280620f..64eb894dd 100644 --- a/lib_lc3plus/defines.h +++ b/lib_lc3plus/defines.h @@ -11,17 +11,17 @@ #define DEFINES_H #ifndef DISABLE_HR_MODE -# define ENABLE_HR_MODE +#define ENABLE_HR_MODE #endif #ifdef ENABLE_HR_MODE -# define MAX_BW_HR 960 +#define MAX_BW_HR 960 #endif #ifdef ENABLE_HR_MODE -# define extractW16(a) extract_h(a) +#define extractW16(a) extract_h(a) #else -# define extractW16(a) (a) +#define extractW16(a) (a) #endif #define MAX_BR 320000 /* 400 * 800 */ @@ -32,9 +32,9 @@ #define FRAME2FS_IDX(x) (x / 100) /* 80 -> 0, 160 -> 1, 240 -> 2, 320 -> 3, 480 -> 4 */ #ifdef ENABLE_HR_MODE -# define FS2FS_IDX(x) ((x) == 96000 ? 5 : (x) / 10000) /* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4, 96000 -> 5 */ +#define FS2FS_IDX(x) ((x) == 96000 ? 5 : (x) / 10000) /* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4, 96000 -> 5 */ #else -# define FS2FS_IDX(x) (x / 10000) /* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4 */ +#define FS2FS_IDX(x) (x / 10000) /* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4 */ #endif #define UNUSED(x) (void)(x) /* silence unused parameter warning */ @@ -66,9 +66,9 @@ ((M + 1) + MAX_PITCH_FS(fs) + (DYN_MAX_LEN(fs) / 2)) /* TDC filtering PCM memory requirement */ #ifdef ENABLE_HR_MODE -# define DYN_MAX_LEN_PCM_PLC(fs) (MAX_PITCH_FS(fs) + DYN_MAX_LEN(fs)) +#define DYN_MAX_LEN_PCM_PLC(fs) (MAX_PITCH_FS(fs) + DYN_MAX_LEN(fs)) #else -# define DYN_MAX_LEN_PCM_PLC(fs) MAX(DYN_MAX_LEN_PCM_PLC_CLASSIFIER(fs), DYN_MAX_LEN_PCM_PLC_TDCAPPLYFILTER(fs)) +#define DYN_MAX_LEN_PCM_PLC(fs) MAX(DYN_MAX_LEN_PCM_PLC_CLASSIFIER(fs), DYN_MAX_LEN_PCM_PLC_TDCAPPLYFILTER(fs)) #endif #define FRAME_MS_BLOCK 25 @@ -104,16 +104,16 @@ #define CR9_F_PITCH_WIN_LEN_FIX /* Increase window length for pitch calculation */ #define CR9_G_IMPROVE_TDC /* summarize G,H,J,L,N */ #ifdef CR9_G_IMPROVE_TDC -# define CR9_G_PLC_NS_TDC_FIX /* Always use TDC if pitch > 0 */ -# define CR9_H_REMOVE_SWITCH_TO_PLC_NS -# define CR9_J_SLOW_TDC_FADEOUT -# define CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER -# ifdef ENABLE_HR_MODE -# define CR10_A_ATTENUATION_CURVE_SELECTOR -# ifdef CR10_A_ATTENUATION_CURVE_SELECTOR -# define CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH -# endif -# endif +#define CR9_G_PLC_NS_TDC_FIX /* Always use TDC if pitch > 0 */ +#define CR9_H_REMOVE_SWITCH_TO_PLC_NS +#define CR9_J_SLOW_TDC_FADEOUT +#define CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +#ifdef ENABLE_HR_MODE +#define CR10_A_ATTENUATION_CURVE_SELECTOR +#ifdef CR10_A_ATTENUATION_CURVE_SELECTOR +#define CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH +#endif +#endif #endif /* CR9_G_IMPROVE_TDC */ #define CR9_I_INC_TDC_FADEOUT_LEN #define CR9_K_REDUCE_NORM_CORR_TH @@ -127,58 +127,58 @@ #endif /* NO_POST_REL_CHANGES Post-release changes */ #ifdef CR8_A_PLC_FADEOUT_TUNING -# ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER -# ifdef CR9_K_REDUCE_NORM_CORR_TH -# define THRESH_100_DMS_TDC_CNT 9 -# define THRESH_100_DMS_NS_CNT 7 -# define THRESH_100_DMS_TDC_NS_CNT 73 -# define THRESH_075_DMS_TDC_CNT 7 -# define THRESH_075_DMS_NS_CNT 7 -# define THRESH_075_DMS_TDC_NS_CNT 87 -# define THRESH_050_DMS_TDC_CNT 22 -# define THRESH_050_DMS_NS_CNT 15 -# define THRESH_050_DMS_TDC_NS_CNT 141 -# define THRESH_025_DMS_TDC_CNT 20 -# define THRESH_025_DMS_NS_CNT 21 -# define THRESH_025_DMS_TDC_NS_CNT 278 -# else -# define THRESH_100_DMS_TDC_CNT 3 -# define THRESH_100_DMS_NS_CNT 35 -# define THRESH_100_DMS_TDC_NS_CNT 114 -# define THRESH_075_DMS_TDC_CNT 6 -# define THRESH_075_DMS_NS_CNT 37 -# define THRESH_075_DMS_TDC_NS_CNT 130 -# define THRESH_050_DMS_TDC_CNT 12 -# define THRESH_050_DMS_NS_CNT 55 -# define THRESH_050_DMS_TDC_NS_CNT 227 -# define THRESH_025_DMS_TDC_CNT 10 -# define THRESH_025_DMS_NS_CNT 138 -# define THRESH_025_DMS_TDC_NS_CNT 431 -# endif -# else -# define FAC1_FADEOUT 6710886 /* 0.2 * 2^25 */ -# define SHIFT1_FADEOUT 25-15 /* 25 - 16 */ -# define FAC2_FADEOUT 50331648 /* 1.5 * 2^25 */ -# define SHIFT2_FADEOUT 25-15 /* 25 - 16 */ -# define FAC3_FADEOUT 58720256 /* 1.75 * 2^25 */ -# define SHIFT3_FADEOUT 25-15 /* 25 - 16 */ -# endif -# define PLC_LONGTERM_ANALYSIS_MS 200 /* Nominal analysis window 2000 ms */ -# define PLC_LONGTERM_ANALYSIS_STARTUP_FILL (Word16)(0.5*32768.0) /* 16384/32768 == 0.5 required buffer fill amount, set to 0.0 to not require any fill at all */ +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +#ifdef CR9_K_REDUCE_NORM_CORR_TH +#define THRESH_100_DMS_TDC_CNT 9 +#define THRESH_100_DMS_NS_CNT 7 +#define THRESH_100_DMS_TDC_NS_CNT 73 +#define THRESH_075_DMS_TDC_CNT 7 +#define THRESH_075_DMS_NS_CNT 7 +#define THRESH_075_DMS_TDC_NS_CNT 87 +#define THRESH_050_DMS_TDC_CNT 22 +#define THRESH_050_DMS_NS_CNT 15 +#define THRESH_050_DMS_TDC_NS_CNT 141 +#define THRESH_025_DMS_TDC_CNT 20 +#define THRESH_025_DMS_NS_CNT 21 +#define THRESH_025_DMS_TDC_NS_CNT 278 +#else +#define THRESH_100_DMS_TDC_CNT 3 +#define THRESH_100_DMS_NS_CNT 35 +#define THRESH_100_DMS_TDC_NS_CNT 114 +#define THRESH_075_DMS_TDC_CNT 6 +#define THRESH_075_DMS_NS_CNT 37 +#define THRESH_075_DMS_TDC_NS_CNT 130 +#define THRESH_050_DMS_TDC_CNT 12 +#define THRESH_050_DMS_NS_CNT 55 +#define THRESH_050_DMS_TDC_NS_CNT 227 +#define THRESH_025_DMS_TDC_CNT 10 +#define THRESH_025_DMS_NS_CNT 138 +#define THRESH_025_DMS_TDC_NS_CNT 431 +#endif +#else +#define FAC1_FADEOUT 6710886 /* 0.2 * 2^25 */ +#define SHIFT1_FADEOUT 25-15 /* 25 - 16 */ +#define FAC2_FADEOUT 50331648 /* 1.5 * 2^25 */ +#define SHIFT2_FADEOUT 25-15 /* 25 - 16 */ +#define FAC3_FADEOUT 58720256 /* 1.75 * 2^25 */ +#define SHIFT3_FADEOUT 25-15 /* 25 - 16 */ +#endif +#define PLC_LONGTERM_ANALYSIS_MS 200 /* Nominal analysis window 2000 ms */ +#define PLC_LONGTERM_ANALYSIS_STARTUP_FILL (Word16)(0.5*32768.0) /* 16384/32768 == 0.5 required buffer fill amount, set to 0.0 to not require any fill at all */ #endif /* CR8_A_PLC_FADEOUT_TUNING */ #define REL_PITCH_THRESH 11796 -# define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ -# ifdef SUBSET_NB -# define MAX_BR_100DMS_NB 114400 /* for 100ms at 8kHz */ -# endif -# ifdef SUBSET_WB -# define MAX_BR_100DMS_WB 221600 /* for 100ms at 16kHz */ -# endif -# ifdef SUBSET_SSWB -# define MAX_BR_100DMS_SSWB 314400 /* for 100ms at 24kHz */ -# endif +#define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ +#ifdef SUBSET_NB +#define MAX_BR_100DMS_NB 114400 /* for 100ms at 8kHz */ +#endif +#ifdef SUBSET_WB +#define MAX_BR_100DMS_WB 221600 /* for 100ms at 16kHz */ +#endif +#ifdef SUBSET_SSWB +#define MAX_BR_100DMS_SSWB 314400 /* for 100ms at 24kHz */ +#endif /* G192 bitstream writing/reading */ #define G192_GOOD_FRAME 0x6B21 @@ -190,7 +190,7 @@ #ifdef DEBUG #ifdef READ_G192FER -# define READ_G192_FER_BYTE /* Allow C executable to also read G192 byte formatted FER files 0x20=BAD , 0x21=Good */ +#define READ_G192_FER_BYTE /* Allow C executable to also read G192 byte formatted FER files 0x20=BAD , 0x21=Good */ #endif #endif @@ -204,9 +204,9 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger gcc630 supported by MATLAB 2018b, via Mingw "app" */ #ifdef __GNUC__ -# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #else -# define GCC_VERSION 0 +#define GCC_VERSION 0 #endif /* Define __forceinline as empty if ARM not activated to avoid any errors */ @@ -216,84 +216,84 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger /* SUBSETS */ #if !(defined(SUBSET_NB) || defined(SUBSET_WB) || defined(SUBSET_SSWB) || defined(SUBSET_SWB) || defined(SUBSET_FB) || defined(SUBSET_UB)) -# define SUBSET_NB -# define SUBSET_WB -# define SUBSET_SSWB -# define SUBSET_SWB -# define SUBSET_FB -# ifdef ENABLE_HR_MODE -# define SUBSET_UB -# endif -#endif - -# define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ -# define MIN_BR_025DMS 64000 /* 20 * 800 * 100/ 25 */ -# define MIN_BR_050DMS 32000 /* 20 * 800 * 100/ 50 */ -# define MAX_BR_050DMS_NB 260800 /* 163 * 800 * 100/ 50 */ -# ifdef SUBSET_NB -# define MAX_BR_100DMS_NB 114400 /* for 100ms at 8kHz */ -# endif -# ifdef SUBSET_WB -# define MAX_BR_100DMS_WB 221600 /* for 100ms at 16kHz */ -# endif -# ifdef SUBSET_SSWB -# define MAX_BR_100DMS_SSWB 314400 /* for 100ms at 24kHz */ -# endif +#define SUBSET_NB +#define SUBSET_WB +#define SUBSET_SSWB +#define SUBSET_SWB +#define SUBSET_FB +#ifdef ENABLE_HR_MODE +#define SUBSET_UB +#endif +#endif -#ifdef CR8_G_ADD_75MS -# define MIN_BR_075DMS_48KHZ_HR ((int)124800/ 800/2)* 800 -# define MIN_BR_075DMS_96KHZ_HR ((int)149600/ 800/2)* 800 -# define MIN_BR_075DMS 21334 /* ceil( 20 * 800 * 100/ 75) */ -# define MAX_BR_075DMS 426667 /* ceil(400 * 800 * 100/ 75) */ -# define MAX_BR_075DMS_NB 152534 /* ceil(143 * 800 * 100/ 75) */ -# define MAX_BR_075DMS_WB 295467 /* ceil(277 * 800 * 100/ 75) */ -# define MAX_BR_075DMS_SSWB 419200 /* ceil(393 * 800 * 100/ 75) */ +#define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ +#define MIN_BR_025DMS 64000 /* 20 * 800 * 100/ 25 */ +#define MIN_BR_050DMS 32000 /* 20 * 800 * 100/ 50 */ +#define MAX_BR_050DMS_NB 260800 /* 163 * 800 * 100/ 50 */ +#ifdef SUBSET_NB +#define MAX_BR_100DMS_NB 114400 /* for 100ms at 8kHz */ +#endif +#ifdef SUBSET_WB +#define MAX_BR_100DMS_WB 221600 /* for 100ms at 16kHz */ +#endif +#ifdef SUBSET_SSWB +#define MAX_BR_100DMS_SSWB 314400 /* for 100ms at 24kHz */ +#endif -# define NOISEFILLWIDTH_7_5MS 2 -# define NOISEFILLSTART_7_5MS 18 +#ifdef CR8_G_ADD_75MS +#define MIN_BR_075DMS_48KHZ_HR ((int)124800/ 800/2)* 800 +#define MIN_BR_075DMS_96KHZ_HR ((int)149600/ 800/2)* 800 +#define MIN_BR_075DMS 21334 /* ceil( 20 * 800 * 100/ 75) */ +#define MAX_BR_075DMS 426667 /* ceil(400 * 800 * 100/ 75) */ +#define MAX_BR_075DMS_NB 152534 /* ceil(143 * 800 * 100/ 75) */ +#define MAX_BR_075DMS_WB 295467 /* ceil(277 * 800 * 100/ 75) */ +#define MAX_BR_075DMS_SSWB 419200 /* ceil(393 * 800 * 100/ 75) */ + +#define NOISEFILLWIDTH_7_5MS 2 +#define NOISEFILLSTART_7_5MS 18 #endif #define PACK_RESBITS /* FRAME/BUFFER */ #ifdef SUBSET_UB -# define MAX_LEN 960 /* = 10ms at 96kHz */ +#define MAX_LEN 960 /* = 10ms at 96kHz */ #elif defined SUBSET_FB -# define MAX_LEN 480 /* = 10ms at 48kHz */ +#define MAX_LEN 480 /* = 10ms at 48kHz */ #elif defined(SUBSET_SWB) -# define MAX_LEN 320 /* = 10ms at 32kHz */ +#define MAX_LEN 320 /* = 10ms at 32kHz */ #elif defined(SUBSET_SSWB) -# define MAX_LEN 240 /* = 10ms at 24kHz */ +#define MAX_LEN 240 /* = 10ms at 24kHz */ #elif defined(SUBSET_WB) -# define MAX_LEN 160 /* = 10ms at 16kHz */ +#define MAX_LEN 160 /* = 10ms at 16kHz */ #elif defined(SUBSET_NB) -# define MAX_LEN 80 /* = 10ms at 8kHz */ +#define MAX_LEN 80 /* = 10ms at 8kHz */ #endif #ifdef ENABLE_HR_MODE -# define ENABLE_FFT_RESCALE -# define ENABLE_FFT_30X16 -# define ENABLE_DCTIV_RESCALE +#define ENABLE_FFT_RESCALE +#define ENABLE_FFT_30X16 +#define ENABLE_DCTIV_RESCALE -# define EXT_RES_ITER_MAX 20 -# define MAX_RESBITS 5000 -# define HR_MODE_SCRATCH_SIZE 60 +#define EXT_RES_ITER_MAX 20 +#define MAX_RESBITS 5000 +#define HR_MODE_SCRATCH_SIZE 60 #else /* ENABLE_HR_MODE */ -# define MAX_RESBITS MAX_LEN +#define MAX_RESBITS MAX_LEN #endif /* ENABLE_HR_MODE */ /* BW Cutoff-Detection */ #define MAX_BW_BANDS_NUMBER 5 #ifdef ENABLE_HR_MODE -# define RESBITS_PACK_SHIFT 3 -# define RESBITS_PACK_N (1<<(RESBITS_PACK_SHIFT)) -# define RESBITS_PACK_MASK (RESBITS_PACK_N - 1) -# define MAX_RESBITS_LEN ((MAX_RESBITS + RESBITS_PACK_MASK) >> RESBITS_PACK_SHIFT) -# define MAX_RESBITS_LEN_32BIT_ALIGN (((MAX_RESBITS_LEN + 3)/4)*4) +#define RESBITS_PACK_SHIFT 3 +#define RESBITS_PACK_N (1<<(RESBITS_PACK_SHIFT)) +#define RESBITS_PACK_MASK (RESBITS_PACK_N - 1) +#define MAX_RESBITS_LEN ((MAX_RESBITS + RESBITS_PACK_MASK) >> RESBITS_PACK_SHIFT) +#define MAX_RESBITS_LEN_32BIT_ALIGN (((MAX_RESBITS_LEN + 3)/4)*4) #else /* ENABLE_HR_MODE */ -# define MAX_RESBITS_LEN (MAX_RESBITS) -# define MAX_RESBITS_LEN_32BIT_ALIGN (((MAX_RESBITS_LEN + 3)/4)*4) +#define MAX_RESBITS_LEN (MAX_RESBITS) +#define MAX_RESBITS_LEN_32BIT_ALIGN (((MAX_RESBITS_LEN + 3)/4)*4) #endif /* ENABLE_HR_MODE */ #define MAX_CHANNELS 2 @@ -305,24 +305,24 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger #define MAX_NBYTES_075 400 /* any dms: 320 kbps at !=44.1kHz, 294 kbps at 44.1kHz */ #define MAX_NBYTES_100 400 /* any dms: 320 kbps at !=44.1kHz, 294 kbps at 44.1kHz */ #ifdef ENABLE_HR_MODE -# define MIN_BR_25MS_48KHZ_HR ((int)172800/3200/2)*3200 -# define MIN_BR_25MS_96KHZ_HR ((int)198400/3200/2)*3200 -# define MIN_BR_50MS_48KHZ_HR ((int)148800/1600/2)*1600 -# define MIN_BR_50MS_96KHZ_HR ((int)174400/1600/2)*1600 -# define MIN_BR_100MS_48KHZ_HR ((int)124800/800/2)*800 -# define MIN_BR_100MS_96KHZ_HR ((int)149600/800/2)*800 -# define MAX_NBYTES_RED_HR 625 /* From table 5.2 */ -# define BYTESBUFSIZE (MAX_NBYTES_RED_HR * LC3PLUS_MAX_CHANNELS) +#define MIN_BR_25MS_48KHZ_HR ((int)172800/3200/2)*3200 +#define MIN_BR_25MS_96KHZ_HR ((int)198400/3200/2)*3200 +#define MIN_BR_50MS_48KHZ_HR ((int)148800/1600/2)*1600 +#define MIN_BR_50MS_96KHZ_HR ((int)174400/1600/2)*1600 +#define MIN_BR_100MS_48KHZ_HR ((int)124800/800/2)*800 +#define MIN_BR_100MS_96KHZ_HR ((int)149600/800/2)*800 +#define MAX_NBYTES_RED_HR 625 /* From table 5.2 */ +#define BYTESBUFSIZE (MAX_NBYTES_RED_HR * LC3PLUS_MAX_CHANNELS) #else -# define BYTESBUFSIZE (MAX_NBYTES_100 * LC3PLUS_MAX_CHANNELS) +#define BYTESBUFSIZE (MAX_NBYTES_100 * LC3PLUS_MAX_CHANNELS) #endif #define MAX_BW_BIN 400 #define FEC_SLOT_BYTES_MIN 40 -# define FEC_SLOT_BYTES_MAX 400 +#define FEC_SLOT_BYTES_MAX 400 #if MAX_BW_BIN > MAX_LEN -# define MAX_BW MAX_LEN +#define MAX_BW MAX_LEN #else -# define MAX_BW MAX_BW_BIN +#define MAX_BW MAX_BW_BIN #endif #define NUM_OFFSETS 7 @@ -343,11 +343,11 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger #define SNS_DAMPING 27853 /* 0.85 in Q15 */ #ifdef ENABLE_HR_MODE -# define SNS_DAMPING_HRMODE 19661 /* 0.6 in Q15 */ -# define SNS_DAMPING_HRMODE_UB_10MS 6881 /* 0.21 in Q15 */ -# define SNS_DAMPING_HRMODE_UB_7_5MS 5898 /* 0.18 in Q15 */ -# define SNS_DAMPING_HRMODE_UB_5MS 4915 /* 0.15 in Q15 */ -# define SNS_DAMPING_HRMODE_UB_2_5MS 4915 /* 0.15 in Q15 */ +#define SNS_DAMPING_HRMODE 19661 /* 0.6 in Q15 */ +#define SNS_DAMPING_HRMODE_UB_10MS 6881 /* 0.21 in Q15 */ +#define SNS_DAMPING_HRMODE_UB_7_5MS 5898 /* 0.18 in Q15 */ +#define SNS_DAMPING_HRMODE_UB_5MS 4915 /* 0.15 in Q15 */ +#define SNS_DAMPING_HRMODE_UB_2_5MS 4915 /* 0.15 in Q15 */ #endif /* PVQ VQ setup */ @@ -386,9 +386,9 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger /* MDCT */ #ifdef ENABLE_HR_MODE -# define TWIDDLE ((Word32)0x5a82799a) +#define TWIDDLE ((Word32)0x5a82799a) #else -# define TWIDDLE WORD322WORD16(0x5a82799a) +#define TWIDDLE WORD322WORD16(0x5a82799a) #endif #define MDCT_MEM_LEN_MAX (MAX_LEN - ((180 * MAX_LEN) / 480)) @@ -416,25 +416,25 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger /* PLC */ #ifdef CR9_I_INC_TDC_FADEOUT_LEN -# define PLC_FADEOUT_TYPE_1_IN_MS 200 +#define PLC_FADEOUT_TYPE_1_IN_MS 200 #endif #define PLC_FADEOUT_IN_MS 60 /* fade-out to zero in ms for TD-PLC and NS, minimum value is 20 */ -# ifdef CR8_A_PLC_FADEOUT_TUNING +#ifdef CR8_A_PLC_FADEOUT_TUNING /* table settings */ -# define PLC2_FADEOUT_IN_MS_MIN 30 /* table min */ -# define PLC2_FADEOUT_IN_MS_MAX 140 /* table max */ -# define PLC2_FADEOUT_RES 10 /* 10 ms steps used in fade tables */ +#define PLC2_FADEOUT_IN_MS_MIN 30 /* table min */ +#define PLC2_FADEOUT_IN_MS_MAX 140 /* table max */ +#define PLC2_FADEOUT_RES 10 /* 10 ms steps used in fade tables */ /* current settings */ -# define PLC2_FADEOUT_LONG_IN_MS 120 -# define PLC2_FADEOUT_IN_MS 30 /* 0 uses original constants for PLC2 +#define PLC2_FADEOUT_LONG_IN_MS 120 +#define PLC2_FADEOUT_IN_MS 30 /* 0 uses original constants for PLC2 -1 uses TDC::PLC_FADEOUT_IN_MS as basis for a PLC2 macro-re-calculation 30..140 will use a separate settings for PLC2 fadeout 30: P800 short fade optimization 120: Mushra optimized fade */ #else -# define PLC2_FADEOUT_IN_MS 30 /* 0 uses original fixed values for PLC2 +#define PLC2_FADEOUT_IN_MS 30 /* 0 uses original fixed values for PLC2 -1 uses PLC_FADEOUT_IN_MS as basis for a PLC2 macro-re-calculation 30..100 uses separate setting for PLC2 */ #endif @@ -459,21 +459,21 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger #define MAX_PITCH_48K ((MAX_PITCH_12K8 * 48000) / (12800)) /* exact integer */ #ifdef ENABLE_HR_MODE -# define MAX_PITCH_96K ((MAX_PITCH_12K8 * 96000) / (12800)) /* exact integer */ +#define MAX_PITCH_96K ((MAX_PITCH_12K8 * 96000) / (12800)) /* exact integer */ #endif #ifdef ENABLE_HR_MODE -# define MAX_PITCH MAX_PITCH_96K +#define MAX_PITCH MAX_PITCH_96K #elif defined(SUBSET_FB) -# define MAX_PITCH MAX_PITCH_48K +#define MAX_PITCH MAX_PITCH_48K #elif defined(SUBSET_SWB) -# define MAX_PITCH MAX_PITCH_32K +#define MAX_PITCH MAX_PITCH_32K #elif defined(SUBSET_SSWB) -# define MAX_PITCH MAX_PITCH_24K +#define MAX_PITCH MAX_PITCH_24K #elif defined(SUBSET_WB) -# define MAX_PITCH MAX_PITCH_16K +#define MAX_PITCH MAX_PITCH_16K #elif defined(SUBSET_NB) -# define MAX_PITCH MAX_PITCH_8K +#define MAX_PITCH MAX_PITCH_8K #endif @@ -504,36 +504,36 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger #if (PHECU_XFP_LA == 0) -# define PHECU_LA_48K 0 /* 0 ms */ -# define PHECU_LA_32K 0 /* 0 ms */ -# define PHECU_LA_24K 0 /* 0 ms */ -# define PHECU_LA_16K 0 /* 0 ms */ -# define PHECU_LA_8K 0 /* 0 ms */ +#define PHECU_LA_48K 0 /* 0 ms */ +#define PHECU_LA_32K 0 /* 0 ms */ +#define PHECU_LA_24K 0 /* 0 ms */ +#define PHECU_LA_16K 0 /* 0 ms */ +#define PHECU_LA_8K 0 /* 0 ms */ -# define MAX_PHECU_LA (0) +#define MAX_PHECU_LA (0) #else -# if (PHECU_XFP_LA == 4) +#if (PHECU_XFP_LA == 4) -# define PHECU_LA_48K (48 / 4) /* 0.25 ms */ -# define PHECU_LA_32K (32 / 4) /* 0.25 ms */ -# define PHECU_LA_24K (24 / 4) /* 0.25 ms */ -# define PHECU_LA_16K (16 / 4) /* 0.25 ms */ -# define PHECU_LA_8K (8 / 4) /* 0.25 ms */ +#define PHECU_LA_48K (48 / 4) /* 0.25 ms */ +#define PHECU_LA_32K (32 / 4) /* 0.25 ms */ +#define PHECU_LA_24K (24 / 4) /* 0.25 ms */ +#define PHECU_LA_16K (16 / 4) /* 0.25 ms */ +#define PHECU_LA_8K (8 / 4) /* 0.25 ms */ -# define MAX_PHECU_LA (MAX_LEN / 10 / 4) +#define MAX_PHECU_LA (MAX_LEN / 10 / 4) -# else +#else -# define PHECU_LA_48K 48 /* 1 ms */ -# define PHECU_LA_32K 32 /* 1 ms */ -# define PHECU_LA_24K 24 /* 1 ms */ -# define PHECU_LA_16K 16 /* 1 ms */ -# define PHECU_LA_8K 8 /* 1 ms */ +#define PHECU_LA_48K 48 /* 1 ms */ +#define PHECU_LA_32K 32 /* 1 ms */ +#define PHECU_LA_24K 24 /* 1 ms */ +#define PHECU_LA_16K 16 /* 1 ms */ +#define PHECU_LA_8K 8 /* 1 ms */ -# define MAX_PHECU_LA (MAX_LEN / 10) +#define MAX_PHECU_LA (MAX_LEN / 10) -# endif +#endif #endif @@ -606,43 +606,43 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger #define L_FRAME8K (8000 * FRAME_TIME / 1000) #ifdef DISABLE_PLC -# define MAX_LTRANA 0 -# define MAX_LPROT LPROT48K -# define MAX_L_FRAME L_FRAME48K -# define MAX_LPROT_RED LPROT48K_RED +#define MAX_LTRANA 0 +#define MAX_LPROT LPROT48K +#define MAX_L_FRAME L_FRAME48K +#define MAX_LPROT_RED LPROT48K_RED #else -# ifdef SUBSET_UB -# define MAX_LPROT LPROT48K /* Max length of protype frame for buffer allocation */ -# define MAX_LPROT_RED LPROT48K_RED /* stack alloc peak searched part */ -# define MAX_LTRANA LTRANA48K -# define MAX_L_FRAME L_FRAME48K -# elif defined(SUBSET_FB) -# define MAX_LPROT LPROT48K /* Max length of protype frame for buffer allocation */ -# define MAX_LPROT_RED LPROT48K_RED /* stack alloc peak searched part */ -# define MAX_LTRANA LTRANA48K -# define MAX_L_FRAME L_FRAME48K -# elif defined(SUBSET_SWB) -# define MAX_LPROT LPROT32K -# define MAX_LPROT_RED LPROT32K_RED /* stack alloc peak searched part */ -# define MAX_LTRANA LTRANA32K -# define MAX_L_FRAME L_FRAME32K -# elif defined(SUBSET_SSWB) -# define MAX_LPROT LPROT24K -# define MAX_LPROT_RED LPROT24K_RED /* stack alloc peak searched part */ -# define MAX_LTRANA LTRANA24K -# define MAX_L_FRAME L_FRAME24K -# elif defined(SUBSET_WB) -# define MAX_LPROT LPROT16K -# define MAX_LPROT_RED LPROT16K_RED /* stack alloc peak searched part */ -# define MAX_LTRANA LTRANA16K -# define MAX_L_FRAME L_FRAME16K -# elif defined(SUBSET_NB) -# define MAX_LPROT LPROT8K -# define MAX_LPROT_RED LPROT8K_RED /* stack alloc peak searched part */ -# define MAX_LTRANA LTRANA8K -# define MAX_L_FRAME L_FRAME8K -# endif +#ifdef SUBSET_UB +#define MAX_LPROT LPROT48K /* Max length of protype frame for buffer allocation */ +#define MAX_LPROT_RED LPROT48K_RED /* stack alloc peak searched part */ +#define MAX_LTRANA LTRANA48K +#define MAX_L_FRAME L_FRAME48K +#elif defined(SUBSET_FB) +#define MAX_LPROT LPROT48K /* Max length of protype frame for buffer allocation */ +#define MAX_LPROT_RED LPROT48K_RED /* stack alloc peak searched part */ +#define MAX_LTRANA LTRANA48K +#define MAX_L_FRAME L_FRAME48K +#elif defined(SUBSET_SWB) +#define MAX_LPROT LPROT32K +#define MAX_LPROT_RED LPROT32K_RED /* stack alloc peak searched part */ +#define MAX_LTRANA LTRANA32K +#define MAX_L_FRAME L_FRAME32K +#elif defined(SUBSET_SSWB) +#define MAX_LPROT LPROT24K +#define MAX_LPROT_RED LPROT24K_RED /* stack alloc peak searched part */ +#define MAX_LTRANA LTRANA24K +#define MAX_L_FRAME L_FRAME24K +#elif defined(SUBSET_WB) +#define MAX_LPROT LPROT16K +#define MAX_LPROT_RED LPROT16K_RED /* stack alloc peak searched part */ +#define MAX_LTRANA LTRANA16K +#define MAX_L_FRAME L_FRAME16K +#elif defined(SUBSET_NB) +#define MAX_LPROT LPROT8K +#define MAX_LPROT_RED LPROT8K_RED /* stack alloc peak searched part */ +#define MAX_LTRANA LTRANA8K +#define MAX_L_FRAME L_FRAME8K +#endif #endif /* #ifdef DISABLE_PLC */ @@ -669,25 +669,25 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger /* Scratch buffer defines */ #define scratchBuffer_ACTIVE #ifdef ENABLE_HR_MODE -# define SCRATCH_BUF_LEN_ENC (4 * MAX_LEN + 32 + 32 + 4 * MAX_LEN + 3 * MAX_LEN + MAX_RESBITS_LEN_32BIT_ALIGN) -# define SCRATCH_BUF_LEN_ENC_CURRENT_SCRATCH (4 * MAX_LEN + 8 * 60 + MAX_LEN) +#define SCRATCH_BUF_LEN_ENC (4 * MAX_LEN + 32 + 32 + 4 * MAX_LEN + 3 * MAX_LEN + MAX_RESBITS_LEN_32BIT_ALIGN) +#define SCRATCH_BUF_LEN_ENC_CURRENT_SCRATCH (4 * MAX_LEN + 8 * 60 + MAX_LEN) #else -# define SCRATCH_BUF_LEN_ENC (4 * MAX_LEN + 32 + 32 + 2 * MAX_LEN + 3 * MAX_LEN + MAX_RESBITS_LEN_32BIT_ALIGN) -# define SCRATCH_BUF_LEN_ENC_CURRENT_SCRATCH (4 * MAX_LEN) +#define SCRATCH_BUF_LEN_ENC (4 * MAX_LEN + 32 + 32 + 2 * MAX_LEN + 3 * MAX_LEN + MAX_RESBITS_LEN_32BIT_ALIGN) +#define SCRATCH_BUF_LEN_ENC_CURRENT_SCRATCH (4 * MAX_LEN) #endif #define SCRATCH_BUF_LEN_ENC_TOT (SCRATCH_BUF_LEN_ENC + SCRATCH_BUF_LEN_ENC_CURRENT_SCRATCH) #ifdef ENABLE_HR_MODE -# define SCRATCH_BUF_LEN_DEC (4 * MAX_LEN + MAX_RESBITS_LEN_32BIT_ALIGN + 32 + 32 + 4 * MAX_LEN + 32 + 128 + 128) +#define SCRATCH_BUF_LEN_DEC (4 * MAX_LEN + MAX_RESBITS_LEN_32BIT_ALIGN + 32 + 32 + 4 * MAX_LEN + 32 + 128 + 128) #else -# define SCRATCH_BUF_LEN_DEC (4 * MAX_LEN + 2 * MAX_LEN + 32 + 32 + 2 * MAX_LEN + 32 + 128 + 128) +#define SCRATCH_BUF_LEN_DEC (4 * MAX_LEN + 2 * MAX_LEN + 32 + 32 + 2 * MAX_LEN + 32 + 128 + 128) #endif #define SCRATCH_BUF_LEN_DEC_CURRENT_SCRATCH (2 * MAX_LGW + 8 * MAX_LPROT + 12 * MAX_L_FRAME) #ifdef ENABLE_HR_MODE -# define SCRATCH_BUF_LEN_DEC_TOT (SCRATCH_BUF_LEN_DEC + (4 * HR_MODE_SCRATCH_SIZE) + SCRATCH_BUF_LEN_DEC_CURRENT_SCRATCH) +#define SCRATCH_BUF_LEN_DEC_TOT (SCRATCH_BUF_LEN_DEC + (4 * HR_MODE_SCRATCH_SIZE) + SCRATCH_BUF_LEN_DEC_CURRENT_SCRATCH) #else -# define SCRATCH_BUF_LEN_DEC_TOT (SCRATCH_BUF_LEN_DEC + SCRATCH_BUF_LEN_DEC_CURRENT_SCRATCH) +#define SCRATCH_BUF_LEN_DEC_TOT (SCRATCH_BUF_LEN_DEC + SCRATCH_BUF_LEN_DEC_CURRENT_SCRATCH) #endif #define ADVACED_PLC_SIZE \ @@ -703,25 +703,25 @@ do not change __forceinline for mex compilation using gcc6.3.0 or larger #if (defined(_M_ARM) || defined(__CC_ARM) || defined(__TMS470__) || defined(__arm__) || defined(__aarch64__)) && \ (defined(__TARGET_FEATURE_NEON) || defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(__ARM_AARCH64_NEON__)) -# define ALIGNMENT_DEFAULT 16 +#define ALIGNMENT_DEFAULT 16 #elif defined(__bfin__) -# define ALIGNMENT_DEFAULT 4 +#define ALIGNMENT_DEFAULT 4 #else -# define ALIGNMENT_DEFAULT 8 +#define ALIGNMENT_DEFAULT 8 #endif /* RAM_ALIGN keyword causes memory alignment of global variables. */ #if defined(__GNUC__) -# define RAM_ALIGN __attribute__((aligned(ALIGNMENT_DEFAULT))) +#define RAM_ALIGN __attribute__((aligned(ALIGNMENT_DEFAULT))) #elif defined(__CC_ARM) -# define RAM_ALIGN __align(ALIGNMENT_DEFAULT) +#define RAM_ALIGN __align(ALIGNMENT_DEFAULT) #elif defined(__ANALOG_EXTENSIONS__) -# define RAM_ALIGN -# pragma pack(ALIGNMENT_DEFAULT) +#define RAM_ALIGN +#pragma pack(ALIGNMENT_DEFAULT) #elif defined(_MSC_VER) -# define RAM_ALIGN __declspec(align(ALIGNMENT_DEFAULT)) +#define RAM_ALIGN __declspec(align(ALIGNMENT_DEFAULT)) #else -# define RAM_ALIGN +#define RAM_ALIGN #endif #define scratchAlign(ptr, offset) (void *)(((uintptr_t)(ptr) + (offset) + 0x3) & ~0x3) diff --git a/lib_lc3plus/enc_lc3.c b/lib_lc3plus/enc_lc3.c index f2276a2ed..ca0518671 100644 --- a/lib_lc3plus/enc_lc3.c +++ b/lib_lc3plus/enc_lc3.c @@ -56,9 +56,9 @@ static void Enc_LC3PLUS_Channel(LC3PLUS_Enc *encoder, int channel, int bits_per_ h_EncSetup = encoder->channel_setup[channel]; #ifdef ENABLE_HR_MODE -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION hrmode = encoder->hrmode; -# endif +#endif #endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ #ifdef WMOPS @@ -168,9 +168,9 @@ static void Enc_LC3PLUS_Channel(LC3PLUS_Enc *encoder, int channel, int bits_per_ /* currentScratch Size = 4 * MAX_LEN */ processMdct_fx(s_in_scaled, h_EncSetup->x_exp, encoder->frame_length, #ifdef ENABLE_HR_MODE -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION hrmode, -# endif +#endif #endif encoder->W_fx, encoder->W_size, h_EncSetup->stEnc_mdct_mem, encoder->stEnc_mdct_mem_len, d_fx, &d_fx_exp, currentScratch); diff --git a/lib_lc3plus/fft_lc3plus.c b/lib_lc3plus/fft_lc3plus.c index 6db6de7bb..7c192bc93 100644 --- a/lib_lc3plus/fft_lc3plus.c +++ b/lib_lc3plus/fft_lc3plus.c @@ -112,7 +112,7 @@ #if defined(ENABLE_HR_MODE) -# define cplxMpy4_16_0(re, im, a, b, c, d) \ +#define cplxMpy4_16_0(re, im, a, b, c, d) \ do \ { \ re = L_sub(Mpy_32_xx(a, c), Mpy_32_xx(b, d)); \ @@ -121,7 +121,7 @@ move32(); \ } while (0) -# define cplxMpy4_16_1(re, im, a, b) \ +#define cplxMpy4_16_1(re, im, a, b) \ do \ { \ re = a; \ @@ -130,7 +130,7 @@ move32(); \ } while (0) -# endif +#endif #define Mpy3_0(s12, s13, s14, s15, t0, t1, t2, t3) \ do \ @@ -155,7 +155,7 @@ re = L_shr_pos(L_sub(Mpy_32_xx(a, c), Mpy_32_xx(b, d)), SCALEFACTOR60 - SCALEFACTOR15); \ im = L_shr_pos(L_add(Mpy_32_xx(a, d), Mpy_32_xx(b, c)), SCALEFACTOR60 - SCALEFACTOR15); -# define cplxMpy4_4_1(re, im, a, b) \ +#define cplxMpy4_4_1(re, im, a, b) \ re = L_shr_pos(a, SCALEFACTOR60 - SCALEFACTOR15); \ im = L_shr_pos(b, SCALEFACTOR60 - SCALEFACTOR15); #else @@ -4130,7 +4130,7 @@ static void fftN2(Word32 *re, Word32 *im, } BREAK; } -# endif +#endif default: ASSERT(0); } diff --git a/lib_lc3plus/functions.h b/lib_lc3plus/functions.h index 940c58da7..718abbfff 100644 --- a/lib_lc3plus/functions.h +++ b/lib_lc3plus/functions.h @@ -119,9 +119,9 @@ void processMdct_fx( #endif Word16 x_exp, Word16 N, #ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word16 hrmode, /* i: indicate high precision */ -# endif +#endif #endif #ifdef ENABLE_HR_MODE const Word32 w[], /* i: window coefficients including normalization of sqrt(2/N) and scaled by 2^4 */ @@ -165,11 +165,11 @@ void ProcessingIMDCT(Word32 y[], Word16 *y_e, ); #ifdef ENABLE_HR_MODE -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION void dct_IV(Word32 *pDat, Word16 *pDat_e, Word16 L, Word16 hrmode, Word32 *workBuffer); -# else /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ +#else /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ void dct_IV(Word32 *pDat, Word16 *pDat_e, Word16 L, Word32 *workBuffer); -# endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ +#endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ #else void dct_IV(Word32 *pDat, Word16 *pDat_e, Word16 L, Word32 *workBuffer); #endif @@ -417,9 +417,9 @@ void processPLCUpdateAfterIMDCT_fx(Word16 x_fx[], Word16 q_fx_exp, Word16 concea void processPLCclassify_fx(Word16 plcMeth, Word16 *concealMethod, Word16 *nbLostFramesInRow, Word16 bfi, Word16 ltpf_mem_pitch_int, Word16 frame_length, Word16 frame_dms, Word16 fs_idx, Word16 yLen, Word16 q_old_d_fx[], const Word16 *band_offsets, Word16 bands_number, AplcSetup *plcAd, Word8 *scratchBuffer -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , Word16 hrmode -# endif +#endif ); void processPLCapply_fx( diff --git a/lib_lc3plus/imdct_fx.c b/lib_lc3plus/imdct_fx.c index 50ad2b257..f89c4c8da 100644 --- a/lib_lc3plus/imdct_fx.c +++ b/lib_lc3plus/imdct_fx.c @@ -113,9 +113,9 @@ void ProcessingIMDCT( *y_e = sub(*y_e, y_s); #ifdef ENABLE_HR_MODE dct_IV(y, y_e, N, -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION hrmode, -# endif +#endif workBuffer); #else dct_IV(y, y_e, N, workBuffer); diff --git a/lib_lc3plus/lc3.h b/lib_lc3plus/lc3.h index 64d8cc590..4a4af5297 100644 --- a/lib_lc3plus/lc3.h +++ b/lib_lc3plus/lc3.h @@ -74,9 +74,9 @@ typedef __int32 int32_t; /*! Maximum scratch size needed by lc3plus_enc16() or lc3plus_enc24().*/ #ifdef ENABLE_HR_MODE -# define LC3PLUS_ENC_MAX_SCRATCH_SIZE 45624 +#define LC3PLUS_ENC_MAX_SCRATCH_SIZE 45624 #else -# define LC3PLUS_ENC_MAX_SCRATCH_SIZE 6784 +#define LC3PLUS_ENC_MAX_SCRATCH_SIZE 6784 #endif /*! Maximum scratch size needed by lc3plus_dec16() or lc3plus_dec24(). */ diff --git a/lib_lc3plus/mdct_fx.c b/lib_lc3plus/mdct_fx.c index 9e9157204..f5bbebc76 100644 --- a/lib_lc3plus/mdct_fx.c +++ b/lib_lc3plus/mdct_fx.c @@ -19,9 +19,9 @@ void processMdct_fx( #endif Word16 x_exp, Word16 N, /* i: block size N */ #ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word16 hrmode, /* i: indicate high precision */ -# endif +#endif #endif #ifdef ENABLE_HR_MODE const Word32 w[], /* i: window coefficients including normalization of sqrt(2/N) and scaled by 2^4 */ @@ -85,7 +85,7 @@ void processMdct_fx( #ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (hrmode) { FOR (i = 0; i < m; i++) @@ -103,7 +103,7 @@ void processMdct_fx( y[m - 1 - i] = Mac_32_32_0(Mpy_32_32_0(w[2 * m + i], x[2 * m - memLen + i]), w[4 * m - 1 - i], x[4 * m - memLen - 1 - i]); move32(); } } else { -# ifdef CR9_B_FIX_MDCT_OVERFLOW +#ifdef CR9_B_FIX_MDCT_OVERFLOW FOR (i = 0; i < m; i++) { y[m + i] = L_msu0(L_mult0(round_fx_sat(buf[i]), round_fx(w[i])), round_fx_sat(buf[2 * m - 1 - i]), round_fx(w[2 * m - 1 - i])); move32(); @@ -119,7 +119,7 @@ void processMdct_fx( y[m - 1 - i] = L_mac0(L_mult0(round_fx_sat(x[2 * m - memLen + i]), round_fx(w[2 * m + i])), round_fx_sat(x[4 * m - memLen - 1 - i]), round_fx(w[4 * m - 1 - i])); move32(); } -# else /* CR9_B_FIX_MDCT_OVERFLOW */ +#else /* CR9_B_FIX_MDCT_OVERFLOW */ FOR (i = 0; i < m; i++) { y[m + i] = L_msu0(L_mult0(round_fx(buf[i]), round_fx(w[i])), round_fx(buf[2 * m - 1 - i]), round_fx(w[2 * m - 1 - i])); move32(); @@ -135,9 +135,9 @@ void processMdct_fx( y[m - 1 - i] = L_mac0(L_mult0(round_fx(x[2 * m - memLen + i]), round_fx(w[2 * m + i])), round_fx(x[4 * m - memLen - 1 - i]), round_fx(w[4 * m - 1 - i])); move32(); } -# endif /* CR9_B_FIX_MDCT_OVERFLOW */ +#endif /* CR9_B_FIX_MDCT_OVERFLOW */ } -# else +#else /* regular resolution only */ FOR (i = 0; i < m; i++) { @@ -154,36 +154,36 @@ void processMdct_fx( y[m - 1 - i] = L_mac0(L_mult0(x[2 * m - memLen + i], w[2 * m + i]), x[4 * m - memLen - 1 - i], w[4 * m - 1 - i]); move32(); } -# endif +#endif #else /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ FOR (i = 0; i < m; i++) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE y[m + i] = Msu_32_32_0(Mpy_32_32_0(w[i], buf[i]), w[2 * m - 1 - i], buf[2 * m - 1 - i]); move32(); -# else +#else y[m + i] = L_msu0(L_mult0(buf[i], w[i]), buf[2 * m - 1 - i], w[2 * m - 1 - i]); move32(); -# endif +#endif } FOR (i = 0; i < z; i++) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE y[m - 1 - i] = Mpy_32_32_0(w[2 * m + i], x[2 * m - memLen + i]); move32(); -# else +#else y[m - 1 - i] = L_mult0(x[2 * m - memLen + i], w[2 * m + i]); move32(); -# endif +#endif } FOR (i = i; i < m; i++) { -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE y[m - 1 - i] = Mac_32_32_0(Mpy_32_32_0(w[2 * m + i], x[2 * m - memLen + i]), w[4 * m - 1 - i], x[4 * m - memLen - 1 - i]); move32(); -# else +#else y[m - 1 - i] = L_mac0(L_mult0(x[2 * m - memLen + i], w[2 * m + i]), x[4 * m - memLen - 1 - i], w[4 * m - 1 - i]); move32(); -# endif +#endif } #endif /* CR8_F_ADAPT_MDCT_DCT_PRECISION */ @@ -208,9 +208,9 @@ void processMdct_fx( } #ifdef ENABLE_HR_MODE dct_IV(y, y_e, N, -# ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION +#ifdef CR8_F_ADAPT_MDCT_DCT_PRECISION hrmode, -# endif +#endif workBuffer); #else dct_IV(y, y_e, N, workBuffer); diff --git a/lib_lc3plus/noise_factor_fx.c b/lib_lc3plus/noise_factor_fx.c index 75ffb5fac..9b20d2f19 100644 --- a/lib_lc3plus/noise_factor_fx.c +++ b/lib_lc3plus/noise_factor_fx.c @@ -11,16 +11,16 @@ void processNoiseFactor_fx(Word16 *fac_ns_idx, Word16 x_e, Word32 x[], -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE Word32 xq[], -# else +#else Word16 xq[], -# endif +#endif Word16 gg, Word16 gg_e, Word16 BW_cutoff_idx, Word16 frame_dms, Word16 target_bytes, Word8 *scratchBuffer -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE ,Word16 hrmode -# endif +#endif ) { Dyn_Mem_Deluxe_In(Counter k; Word16 nzeros, s1, s2, s3, c, idx, fac_unq, *ind; @@ -66,7 +66,7 @@ void processNoiseFactor_fx(Word16 *fac_ns_idx, Word16 x_e, Word32 x[], noisefillwidth = NOISEFILLWIDTH_7_5MS; noisefillstart = NOISEFILLSTART_7_5MS; BREAK; -# endif +#endif case 100: noisefillwidth = NOISEFILLWIDTH; noisefillstart = NOISEFILLSTART; diff --git a/lib_lc3plus/plc_apply_fx.c b/lib_lc3plus/plc_apply_fx.c index 9430d155e..db0ba675a 100644 --- a/lib_lc3plus/plc_apply_fx.c +++ b/lib_lc3plus/plc_apply_fx.c @@ -324,22 +324,22 @@ void processPLCapply_fx( n_bands = 40; move16(); } BREAK; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: band_offsets = bands_offset_lin_7_5ms[fs_idx]; move16(); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE IF (sub(fs_idx, 5) != 0) { -# endif +#endif IF (sub(fs_idx, 3) != 0) { n_bands = 60; move16(); } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE } -# endif +#endif BREAK; -# endif +#endif case 100: band_offsets = bands_offset_lin[fs_idx]; move16(); BREAK; diff --git a/lib_lc3plus/plc_classify_fx.c b/lib_lc3plus/plc_classify_fx.c index cf455e68d..09c360a33 100644 --- a/lib_lc3plus/plc_classify_fx.c +++ b/lib_lc3plus/plc_classify_fx.c @@ -112,17 +112,17 @@ static void array_calculate(Word32 *array_tdc, Word32 *array_ns, int length, Wor static Word16 spectral_centroid_fx_lc(Word16 old_scf_q[], const Word16 *band_offsets, Word16 bands_number, Word16 frame_length, Word16 fs_idx, Word8 *scratchBuffer -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , Word16 hrmode -# endif +#endif ); void processPLCclassify_fx(Word16 plcMeth, Word16 *concealMethod, Word16 *nbLostFramesInRow, Word16 bfi, Word16 ltpf_mem_pitch_int, Word16 frame_length, Word16 frame_dms, Word16 fs_idx, Word16 yLen, Word16 q_old_d_fx[], const Word16 *band_offsets, Word16 bands_number, AplcSetup *plcAd, Word8 *scratchBuffer -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE , Word16 hrmode -# endif +#endif ) { Dyn_Mem_Deluxe_In( @@ -233,11 +233,11 @@ void processPLCclassify_fx(Word16 plcMeth, Word16 *concealMethod, Word16 *nbLost } #ifdef CR8_A_PLC_FADEOUT_TUNING -# ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER array_calculate(plcAd->plc_longterm_advc_tdc, plcAd->plc_longterm_advc_ns, plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_plcTdc, &plcAd->longterm_counter_plcNsAdv, plcAd->longterm_analysis_counter_max); -# else +#else array_calculate(plcAd->plc_longterm_advc_tdc, plcAd->plc_longterm_advc_ns, plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_plcTdc, &plcAd->longterm_counter_plcNsAdv, &plcAd->longterm_counter_plcPhaseEcu, plcAd->overall_counter, plcAd->longterm_analysis_counter_max); -# endif +#endif update_bit_and_byte_positions(plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); #endif } @@ -343,7 +343,7 @@ Word16 spectral_centroid_fx_lc(Word16 old_scf_q[], const Word16 *band_offsets, W startfreq = add(band_offsets_local[i * 4], 1); stopfreq = band_offsets_local[i * 4 + 4]; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE IF (hrmode != 0) { tmp32 = 0; move32(); @@ -359,7 +359,7 @@ Word16 spectral_centroid_fx_lc(Word16 old_scf_q[], const Word16 *band_offsets, W s = norm_l(tmp32); } ELSE -# endif +#endif { FOR (j = startfreq; j <= stopfreq; j++) { @@ -372,12 +372,12 @@ Word16 spectral_centroid_fx_lc(Word16 old_scf_q[], const Word16 *band_offsets, W tmp32 = L_mult(old_scf_q_mod[i], extract_h(L_shl(tmp32, s))); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (hrmode != 0) { s = add(s, s2); } -# endif +#endif num32 = L_add(num32, L_shl(tmp32, add(add(-15, old_scf_q_mod_exp[i]), sub(15, s)))); den32 = L_add(den32, L_shl(L_mult(old_scf_q_mod[i], stopfreq - startfreq + 1), old_scf_q_mod_exp[i])); @@ -407,12 +407,12 @@ Word16 spectral_centroid_fx_lc(Word16 old_scf_q[], const Word16 *band_offsets, W BREAK; } sc = round_fx(L_mult(sc, fac)); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (sub(fs_idx, 5) == 0) { sc = shl_pos(sc, 1); } -# endif +#endif Dyn_Mem_Deluxe_Out(); #ifdef WMOPS diff --git a/lib_lc3plus/plc_damping_scrambling_fx.c b/lib_lc3plus/plc_damping_scrambling_fx.c index 4c5641634..b9e064b15 100644 --- a/lib_lc3plus/plc_damping_scrambling_fx.c +++ b/lib_lc3plus/plc_damping_scrambling_fx.c @@ -156,7 +156,7 @@ void processPLCDampingScrambling_fx(Word32 spec[], Word16 L_spec, Word16 nbLostF } BREAK; #ifdef ENABLE_075_DMS_MODE -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: IF (sub(slow, 32767) < 0) { @@ -191,7 +191,7 @@ void processPLCDampingScrambling_fx(Word32 spec[], Word16 L_spec, Word16 nbLostF fast = shl(fast, tmp16); } BREAK; -# endif +#endif #endif } @@ -224,11 +224,11 @@ void processPLCDampingScrambling_fx(Word32 spec[], Word16 L_spec, Word16 nbLostF lost_frame_thr2 = 16; BREAK; #ifdef ENABLE_075_DMS_MODE -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: lost_frame_thr1 = 6; lost_frame_thr2 = 11; -# endif +#endif #endif } IF (sub(nbLostFramesInRow, lost_frame_thr1) < 0) @@ -268,9 +268,9 @@ void processPLCDampingScrambling_fx(Word32 spec[], Word16 L_spec, Word16 nbLostF case 25: fflcAtten = PLC34_ATTEN_FAC_025_FX; BREAK; case 50: fflcAtten = PLC34_ATTEN_FAC_050_FX; BREAK; #ifdef ENABLE_075_DMS_MODE -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: fflcAtten = PLC34_ATTEN_FAC_075_FX; BREAK; -# endif +#endif #endif case 100: fflcAtten = PLC34_ATTEN_FAC_100_FX; BREAK; } @@ -297,12 +297,12 @@ void processPLCDampingScrambling_fx(Word32 spec[], Word16 L_spec, Word16 nbLostF plc_end_inFrames = (10*PLC4_TRANSIT_END_IN_MS) / 50; move16(); BREAK; #ifdef ENABLE_075_DMS_MODE -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: plc_start_inFrames = (10*PLC4_TRANSIT_START_IN_MS) / 75; move16(); plc_end_inFrames = (10*PLC4_TRANSIT_END_IN_MS) / 75; move16(); BREAK; -# endif +#endif #endif default: plc_start_inFrames = (10*PLC4_TRANSIT_START_IN_MS) / 100; move16(); diff --git a/lib_lc3plus/plc_phecu_fec_hq_fx.c b/lib_lc3plus/plc_phecu_fec_hq_fx.c index e73a1faa8..1555ae5d5 100644 --- a/lib_lc3plus/plc_phecu_fec_hq_fx.c +++ b/lib_lc3plus/plc_phecu_fec_hq_fx.c @@ -21,9 +21,9 @@ #define MAX_INCREASE_GRPPOW_FX 0 /* max. amplification in case of transients (in dB scale) */ #ifdef CR8_A_PLC_FADEOUT_TUNING -# define ONE_SIDED_SINE_WIDTH (4) /* expected pure sine main lobe maximum width (4+1+4) bins *62.5 hz/bin => approx 560 Hz total width */ -# define SIDE_LIM 12539859L /* 10^ (4.5/20.0) = 2^(a); --> x= 0.747433821 -> Lx_Q24 = round((1L<<(24))*0.747433821)) = 12539859 */ -# define LFHF_LIM 16719812L /* 10^ (6.0/20.0) = 2^(b); --> x= 0.996578428 -> Lx_Q24 = round((1L<<(24))*0.996578428)) = 16719812 */ +#define ONE_SIDED_SINE_WIDTH (4) /* expected pure sine main lobe maximum width (4+1+4) bins *62.5 hz/bin => approx 560 Hz total width */ +#define SIDE_LIM 12539859L /* 10^ (4.5/20.0) = 2^(a); --> x= 0.747433821 -> Lx_Q24 = round((1L<<(24))*0.747433821)) = 12539859 */ +#define LFHF_LIM 16719812L /* 10^ (6.0/20.0) = 2^(b); --> x= 0.996578428 -> Lx_Q24 = round((1L<<(24))*0.996578428)) = 16719812 */ #endif #ifdef CR8_A_PLC_FADEOUT_TUNING @@ -2017,9 +2017,9 @@ static Word16 imax_fx( /* o: The location, relative to the Word16 prevsynth_man_upshift; Word16 Q_prevsynthMinus1; Word8 *buffer; -# ifdef CR8_A_PLC_FADEOUT_TUNING +#ifdef CR8_A_PLC_FADEOUT_TUNING Word32 L_Xavg[MAX_LGW]; /* i/o : Frequency group amp averages for tonal tilt analysis Max upshifted */ -# endif +#endif #ifdef DYNMEM_COUNT Dyn_Mem_In("hq_phase_ecu_fx", sizeof(struct { Counter i; diff --git a/lib_lc3plus/quantize_spec_fx.c b/lib_lc3plus/quantize_spec_fx.c index 4667cf146..f6fdf8e46 100644 --- a/lib_lc3plus/quantize_spec_fx.c +++ b/lib_lc3plus/quantize_spec_fx.c @@ -9,7 +9,7 @@ #include "functions.h" -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, Word32 xq[], Word16 nt, Word16 target, Word16 totalBits, Word16 *nBits, Word16 *nBits2, Word16 fs_idx, Word16 *lastnzout, Word16 *codingdata, Word16 *lsbMode, Word16 mode, Word16 hrmode) @@ -27,15 +27,15 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, Word16 totBits, nbits_lsb; Counter k, lev; Word16 maxlevs; -# ifndef FUNCTION_quantizeSpec_func1 +#ifndef FUNCTION_quantizeSpec_func1 Word16 tmp16; Word32 offs32; Counter i; -# else +#else Word32 ARM_params[3]; -# endif +#endif -# ifdef DYNMEM_COUNT +#ifdef DYNMEM_COUNT Dyn_Mem_In("processQuantizeSpec_fx", sizeof(struct { Word32 a1, b1, a1_i, b1_i, ab_max, c; Word16 t, lev1; @@ -51,7 +51,7 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, Word16 totBits, nbits_lsb; Word16 maxlevs; })); -# endif +#endif assert(target >= 0); @@ -63,12 +63,12 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, { s = sub(add(x_e, gain_e), 23); s = s_min(s, 31); -# ifdef FUNCTION_quantizeSpec_func1 +#ifdef FUNCTION_quantizeSpec_func1 ARM_params[0] = gain; ARM_params[1] = s; quantizeSpec_func1_hr_ip(xq, x, nt, ARM_params); -# else +#else IF(s > 4) { s = sub(s, 4); /* Use extra bits of precision for fine calculation */ @@ -93,18 +93,18 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, move32(); } } -# endif /* FUNCTION_quantizeSpec_func1 */ +#endif /* FUNCTION_quantizeSpec_func1 */ } ELSE { s = sub(add(x_e, gain_e), 15); s = s_max(s_min(s, 15), -15); -# ifdef FUNCTION_quantizeSpec_func1 +#ifdef FUNCTION_quantizeSpec_func1 ARM_params[0] = gain; ARM_params[1] = s; ARM_params[2] = -4096; quantizeSpec_func1_ip(xq, x, nt, ARM_params); -# else +#else FOR (i = 0; i < nt; i++) { offs32 = Mpy_32_32_lc3plus(L_abs(x[i]), gain); /* multiply */ @@ -124,7 +124,7 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, xq[i] = tmp16; move16(); } -# endif /* FUNCTION_quantizeSpec_func1 */ +#endif /* FUNCTION_quantizeSpec_func1 */ } /* Rate flag */ rateFlag = 0; @@ -622,12 +622,12 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word32 gain, Word16 gain_e, move16(); } -# ifdef DYNMEM_COUNT +#ifdef DYNMEM_COUNT Dyn_Mem_Out(); -# endif +#endif } -# else /* ENABLE_HR_MODE */ +#else /* ENABLE_HR_MODE */ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word16 gain, Word16 gain_e, Word16 xq[], Word16 nt, Word16 target, Word16 totalBits, Word16 *nBits, Word16 *nBits2, Word16 fs_idx, Word16 *lastnzout, @@ -1164,4 +1164,4 @@ void processQuantizeSpec_fx(Word32 x[], Word16 x_e, Word16 gain, Word16 gain_e, #endif } -# endif /* ENABLE_HR_MODE */ +#endif /* ENABLE_HR_MODE */ diff --git a/lib_lc3plus/rom_basop_util_lc3plus.c b/lib_lc3plus/rom_basop_util_lc3plus.c index 45629965d..542f5ade1 100644 --- a/lib_lc3plus/rom_basop_util_lc3plus.c +++ b/lib_lc3plus/rom_basop_util_lc3plus.c @@ -13,17 +13,17 @@ /* clang-format off */ -# ifdef ENABLE_HR_MODE -# define STC(x) (x) -# define WTC(x) (x) -# define STCP(a, b) {{STC(a), STC(b)}} -# define WTCP(a, b) {{WTC(a), WTC(b)}} -# else -# define STC(x) WORD322WORD16(x) -# define WTC(x) WORD322WORD16(x) -# define STCP(a, b) {{STC(a), STC(b)}} -# define WTCP(a, b) {{WTC(a), WTC(b)}} -# endif +#ifdef ENABLE_HR_MODE +#define STC(x) (x) +#define WTC(x) (x) +#define STCP(a, b) {{STC(a), STC(b)}} +#define WTCP(a, b) {{WTC(a), WTC(b)}} +#else +#define STC(x) WORD322WORD16(x) +#define WTC(x) WORD322WORD16(x) +#define STCP(a, b) {{STC(a), STC(b)}} +#define WTCP(a, b) {{WTC(a), WTC(b)}} +#endif /* clang-format on */ /** @@ -136,11 +136,11 @@ const Word16 InvDiffTable_lc3plus[32] = { /* Sine tables */ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineTable480[] = { -# else +#else const PWord16 SineTable480[] = { -# endif +#endif STCP(0x7fffffff, 0x00000000), STCP(0x7fffd315, 0x006b3b9b), STCP(0x7fff4c54, 0x00d676eb), STCP(0x7ffe6bbf, 0x0141b1a5), STCP(0x7ffd3154, 0x01aceb7c), STCP(0x7ffb9d15, 0x02182427), STCP(0x7ff9af04, 0x02835b5a), STCP(0x7ff76721, 0x02ee90c8), STCP(0x7ff4c56f, 0x0359c428), @@ -224,11 +224,11 @@ const PWord16 SineTable480[] = { STCP(0x5a82799a, 0x5a82799a), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineTable360[] = { -# else +#else const PWord16 SineTable360[] = { -# endif +#endif STCP(0x7fffffff, 0x00000000), STCP(0x7fffb025, 0x008efa17), STCP(0x7ffec095, 0x011df37c), STCP(0x7ffd3153, 0x01aceb7c), STCP(0x7ffb025f, 0x023be165), STCP(0x7ff833bc, 0x02cad485), STCP(0x7ff4c56e, 0x0359c428), STCP(0x7ff0b779, 0x03e8af9e), STCP(0x7fec09e2, 0x04779632), @@ -292,11 +292,11 @@ const PWord16 SineTable360[] = { STCP(0x5a827999, 0x5a827999), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineTable320[] = { -# else +#else const PWord16 SineTable320[] = { -# endif +#endif STCP(0x7fffffff, 0x00000000), STCP(0x7fff9aef, 0x00a0d951), STCP(0x7ffe6bbf, 0x0141b1a5), STCP(0x7ffc726f, 0x01e287fc), STCP(0x7ff9af04, 0x02835b5a), STCP(0x7ff62182, 0x03242abf), STCP(0x7ff1c9ef, 0x03c4f52f), STCP(0x7feca851, 0x0465b9aa), STCP(0x7fe6bcb0, 0x05067734), @@ -354,7 +354,7 @@ const PWord16 SineTable320[] = { }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE #ifdef CR8_G_ADD_75MS const PWord32 SineTable720[] = { STCP(0x7fffffff, 0x00000000), STCP(0x7fffec08, 0x00477d17), STCP(0x7fffb025, 0x008efa17), @@ -643,28 +643,28 @@ const PWord32 SineTable960[] = { STCP(0x5af3eee5, 0x5a107560), STCP(0x5ace2d0e, 0x5a36869f), STCP(0x5aa85b48, 0x5a5c8809), STCP(0x5a827999, 0x5a827999), }; -# endif +#endif /* Sine windows */ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow20[10] = { -# else +#else const PWord16 SineWindow20[10] = { -# endif +#endif WTCP(0x7fe6bcaf, 0x5067734), WTCP(0x7f1cde00, 0xf0b7727), WTCP(0x7d8a5f3f, 0x18f8b83c), WTCP(0x7b31bbb1, 0x22be8f87), WTCP(0x7816a758, 0x2c4d9050), WTCP(0x743e0917, 0x3596a46c), WTCP(0x6fadf2fb, 0x3e8b240e), WTCP(0x6a6d98a3, 0x471cece6), WTCP(0x648543e3, 0x4f3e7874), WTCP(0x5dfe47ad, 0x56e2f15d), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow40[20] = { -# else +#else const PWord16 SineWindow40[20] = { -# endif +#endif WTCP(0x7ff9af04, 0x02835b5a), WTCP(0x7fc72ae2, 0x07891418), WTCP(0x7f62368f, 0x0c8bd35e), WTCP(0x7ecaf9e5, 0x11899ed3), WTCP(0x7e01b096, 0x16807e15), WTCP(0x7d06aa16, 0x1b6e7b7a), WTCP(0x7bda497d, 0x2051a4dd), WTCP(0x7a7d055b, 0x25280c5e), WTCP(0x78ef678f, 0x29efc925), @@ -674,11 +674,11 @@ const PWord16 SineWindow40[20] = { WTCP(0x5fae5a55, 0x55063951), WTCP(0x5c44ee40, 0x58b71632), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow60[30] = { -# else +#else const PWord16 SineWindow60[30] = { -# endif +#endif WTCP(0x7ffd3153, 0x1aceb7c), WTCP(0x7fe6bcaf, 0x5067734), WTCP(0x7fb9d758, 0x85f2136), WTCP(0x7f76892e, 0xbb65336), WTCP(0x7f1cde00, 0xf0b7727), WTCP(0x7eace589, 0x125df75b), WTCP(0x7e26b370, 0x15ad3e9a), WTCP(0x7d8a5f3f, 0x18f8b83c), WTCP(0x7cd80464, 0x1c3fd045), @@ -691,11 +691,11 @@ const PWord16 SineWindow60[30] = { WTCP(0x603c496c, 0x54657194), WTCP(0x5dfe47ad, 0x56e2f15d), WTCP(0x5bafc836, 0x595132a2), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow80[40] = { -# else +#else const PWord16 SineWindow80[40] = { -# endif +#endif WTCP(0x7ffe6bbf, 0x0141b1a5), WTCP(0x7ff1c9ef, 0x03c4f52f), WTCP(0x7fd8878e, 0x0647d97c), WTCP(0x7fb2a71b, 0x08ca1f1b), WTCP(0x7f802c52, 0x0b4b86a8), WTCP(0x7f411c2f, 0x0dcbd0d5), WTCP(0x7ef57cea, 0x104abe71), WTCP(0x7e9d55fc, 0x12c8106f), WTCP(0x7e38b017, 0x154387e6), @@ -712,11 +712,11 @@ const PWord16 SineWindow80 WTCP(0x5b64d492, 0x599de2ee), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow120[60] = { -# else +#else const PWord16 SineWindow120[60] = { -# endif +#endif WTCP(0x7fff4c54, 0x00d676eb), WTCP(0x7ff9af04, 0x02835b5a), WTCP(0x7fee74a2, 0x0430238f), WTCP(0x7fdd9dad, 0x05dcbcbe), WTCP(0x7fc72ae2, 0x07891418), WTCP(0x7fab1d3d, 0x093516d4), WTCP(0x7f8975f9, 0x0ae0b22c), WTCP(0x7f62368f, 0x0c8bd35e), WTCP(0x7f3560b9, 0x0e3667ad), @@ -739,11 +739,11 @@ const PWord16 SineWindow120[60] = { WTCP(0x5d6c2f99, 0x577ff3da), WTCP(0x5c44ee40, 0x58b71632), WTCP(0x5b19a0c8, 0x59ea5454), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow160[80] = { -# else +#else const PWord16 SineWindow160[80] = { -# endif +#endif WTCP(0x7fff9aef, 0x00a0d951), WTCP(0x7ffc726f, 0x01e287fc), WTCP(0x7ff62182, 0x03242abf), WTCP(0x7feca851, 0x0465b9aa), WTCP(0x7fe00716, 0x05a72ccf), WTCP(0x7fd03e23, 0x06e87c3f), WTCP(0x7fbd4dda, 0x0829a00c), WTCP(0x7fa736b4, 0x096a9049), WTCP(0x7f8df93c, 0x0aab450d), @@ -773,11 +773,11 @@ const PWord16 SineWindow160[80] = { WTCP(0x5bd529eb, 0x592ac2f7), WTCP(0x5af3eee6, 0x5a107561), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow180[90] = { -# else +#else const PWord16 SineWindow180[90] = { -# endif +#endif WTCP(0x7fffb025, 0x008efa17), WTCP(0x7ffd3153, 0x01aceb7c), WTCP(0x7ff833bc, 0x02cad485), WTCP(0x7ff0b779, 0x03e8af9e), WTCP(0x7fe6bcaf, 0x05067734), WTCP(0x7fda4390, 0x062425b6), WTCP(0x7fcb4c5a, 0x0741b592), WTCP(0x7fb9d758, 0x085f2136), WTCP(0x7fa5e4e0, 0x097c6313), @@ -810,11 +810,11 @@ const PWord16 SineWindow180[90] = { WTCP(0x5c766c1c, 0x58837ff3), WTCP(0x5bafc836, 0x595132a2), WTCP(0x5ae75ab8, 0x5a1d278c), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow240[120] = { -# else +#else const PWord16 SineWindow240[120] = { -# endif +#endif WTCP(0x7fffd315, 0x006b3b9b), WTCP(0x7ffe6bbf, 0x0141b1a5), WTCP(0x7ffb9d15, 0x02182427), WTCP(0x7ff76721, 0x02ee90c8), WTCP(0x7ff1c9ef, 0x03c4f52f), WTCP(0x7feac58d, 0x049b4f00), WTCP(0x7fe25a0f, 0x05719be2), WTCP(0x7fd8878e, 0x0647d97c), WTCP(0x7fcd4e24, 0x071e0575), @@ -857,11 +857,11 @@ const PWord16 SineWindow240[120] = { WTCP(0x5bfa7b82, 0x590443a7), WTCP(0x5b64d492, 0x599de2ee), WTCP(0x5ace2d0f, 0x5a36869f), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow320[160] = { -# else +#else const PWord16 SineWindow320[160] = { -# endif +#endif WTCP(0x7fffe6bc, 0x00506cb9), WTCP(0x7fff1c9b, 0x00f145ab), WTCP(0x7ffd885a, 0x01921d20), WTCP(0x7ffb29fd, 0x0232f21a), WTCP(0x7ff80186, 0x02d3c39b), WTCP(0x7ff40efa, 0x037490a5), WTCP(0x7fef5260, 0x0415583b), WTCP(0x7fe9cbc0, 0x04b6195d), WTCP(0x7fe37b22, 0x0556d30f), @@ -918,11 +918,11 @@ const PWord16 SineWindow320[160] = { WTCP(0x5abb4629, 0x5a498950), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow360[180] = { -# else +#else const PWord16 SineWindow360[180] = { -# endif +#endif WTCP(0x7fffec08, 0x00477d17), WTCP(0x7fff4c53, 0x00d676eb), WTCP(0x7ffe0cea, 0x01656fb4), WTCP(0x7ffc2dcf, 0x01f466bf), WTCP(0x7ff9af03, 0x02835b59), WTCP(0x7ff6908a, 0x03124cd1), WTCP(0x7ff2d268, 0x03a13a74), WTCP(0x7fee74a1, 0x0430238f), WTCP(0x7fe9773c, 0x04bf0771), @@ -985,11 +985,11 @@ const PWord16 SineWindow360[180] = { WTCP(0x5b7dd796, 0x598459ce), WTCP(0x5b19a0c7, 0x59ea5454), WTCP(0x5ab4f84f, 0x5a4fdea9), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const PWord32 SineWindow480[240] = { -# else +#else const PWord16 SineWindow480[240] = { -# endif +#endif WTCP(0x7ffff4c5, 0x00359dd2), WTCP(0x7fff9aef, 0x00a0d951), WTCP(0x7ffee744, 0x010c1460), WTCP(0x7ffdd9c4, 0x01774eb2), WTCP(0x7ffc726f, 0x01e287fc), WTCP(0x7ffab147, 0x024dbff4), WTCP(0x7ff8964d, 0x02b8f64e), WTCP(0x7ff62182, 0x03242abf), WTCP(0x7ff352e8, 0x038f5cfb), @@ -1072,7 +1072,7 @@ const PWord16 SineWindow480[240] = { WTCP(0x5b3f42ae, 0x59c42381), WTCP(0x5af3eee6, 0x5a107561), WTCP(0x5aa85b48, 0x5a5c880a), }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE #ifdef CR8_G_ADD_75MS const PWord32 SineWindow720[360] = { WTCP(0x7ffffb01, 0x0023be8d), WTCP(0x7fffd314, 0x006b3b9b), WTCP(0x7fff833a, 0x00b2b888), @@ -1360,7 +1360,7 @@ const PWord32 SineWindow960[480] = { WTCP(0x5b520da0, 0x59b1052e), WTCP(0x5b2c73ba, 0x59d73de2), WTCP(0x5b06c9d6, 0x59fd66d3), WTCP(0x5ae10ff8, 0x5a237ff9), WTCP(0x5abb4628, 0x5a49894f), WTCP(0x5a956c6d, 0x5a6f82cd), }; -# endif +#endif // fs 48 32 24 16 8 // ms +-------------------- @@ -1468,7 +1468,7 @@ void BASOP_getTables( move16(); BREAK; #ifdef ENABLE_HR_MODE -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 720: *sin = SineTable720; move16(); @@ -1477,7 +1477,7 @@ void BASOP_getTables( *twiddle = SineWindow720; move16(); break; -# endif +#endif case 960: *sin = SineTable960; move16(); @@ -1620,11 +1620,11 @@ const Word32 RotVector_40_32[2 * 28] = { 0x3a1c5c57, 0x720c8075, 0xb4c373ee, 0x678dde6e, 0x81936daf, 0xebf9f498, 0xd8722192, 0x8643c7b3, }; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_480[2 * (480 - 30)] = { -# else +#else const Word16 RotVector_480[2 * (480 - 30)] = { -# endif +#endif SHC(0x7fffffff), SHC(0x00000000), SHC(0x7ff4c56f), SHC(0xfca63bd8), SHC(0x7fd317b4), SHC(0xf94d0e2e), SHC(0x7f9afcb9), SHC(0xf5f50d67), SHC(0x7f4c7e54), SHC(0xf29ecfb2), SHC(0x7ee7aa4c), SHC(0xef4aeaf1), SHC(0x7e6c9251), SHC(0xebf9f498), SHC(0x7ddb4bfc), SHC(0xe8ac819d), SHC(0x7d33f0ca), SHC(0xe5632654), @@ -1776,7 +1776,7 @@ const Word16 RotVector_480[2 * (480 - 30)] = { SHC(0x00000000), SHC(0x7fffffff), SHC(0x18f8b83c), SHC(0x7d8a5f40), SHC(0x30fbc54d), SHC(0x7641af3d), SHC(0x471cece7), SHC(0x6a6d98a4), SHC(0x5a82799a), SHC(0x5a82799a), SHC(0x6a6d98a4), SHC(0x471cece7)}; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE #ifdef CR8_G_ADD_75MS const Word32 RotVector_720[2 * (720 - 30)] = { SHC(0x7fffffff), SHC(0x00000000), SHC(0x7ffb0260), SHC(0xfdc41e9b), SHC(0x7fec09e3), SHC(0xfb8869ce), @@ -2152,11 +2152,11 @@ const Word32 RotVector_960[2 * (480 - 60)] = { SHC(0xfaf988cc), SHC(0x7fe6bcb0), SHC(0x06b2f1d2), SHC(0x7fd317b4), SHC(0x125df75b), SHC(0x7eace58a), SHC(0x1de189a6), SHC(0x7c769e18), SHC(0x2924edac), SHC(0x793501a9), SHC(0x340ff242), SHC(0x74ef0ebc), SHC(0x3e8b240e), SHC(0x6fadf2fc), SHC(0x487fffe4), SHC(0x697cf78a), SHC(0x51d92321), SHC(0x626968be)}; -# endif +#endif #ifdef ENABLE_FFT_30X16 /* Twiddle coefficients for 30x16 FFTs, generated by fft_tables.py */ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_30_16[2 * (480 - 30)] = { SHC(0x7fffffff), SHC(0x00000000), SHC(0x7ffd3154), SHC(0xfe531484), SHC(0x7ff4c56f), SHC(0xfca63bd8), @@ -2309,14 +2309,14 @@ const Word32 RotVector_30_16[2 * (480 - 30)] = { SHC(0xb8e31319), SHC(0x6a6d98a4), SHC(0xcf043ab3), SHC(0x7641af3d), SHC(0xe70747c4), SHC(0x7d8a5f40), SHC(0x00000000), SHC(0x7fffffff), SHC(0x18f8b83c), SHC(0x7d8a5f40), SHC(0x30fbc54d), SHC(0x7641af3d), SHC(0x471cece7), SHC(0x6a6d98a4), SHC(0x5a82799a), SHC(0x5a82799a), SHC(0x6a6d98a4), SHC(0x471cece7)}; -# endif +#endif #endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_360[2 * (360 - 30)] = { -# else +#else const Word16 RotVector_360[2 * (360 - 30)] = { -# endif +#endif SHC(0x7fffffff), SHC(0x00000000), SHC(0x7ffb0260), SHC(0xfdc41e9b), SHC(0x7fec09e3), SHC(0xfb8869ce), SHC(0x7fd317b4), SHC(0xf94d0e2e), SHC(0x7fb02dc6), SHC(0xf7123849), SHC(0x7f834ed0), SHC(0xf4d814a4), SHC(0x7f4c7e54), SHC(0xf29ecfb2), SHC(0x7f0bc097), SHC(0xf06695da), SHC(0x7ec11aa5), SHC(0xee2f9369), @@ -2428,11 +2428,11 @@ const Word16 RotVector_360[2 * (360 - 30)] = { SHC(0xf29ecfb2), SHC(0x7f4c7e54), SHC(0x0b27eb5c), SHC(0x7f834ed0), SHC(0x234815ba), SHC(0x7b0a9f8d), SHC(0x3a1c5c57), SHC(0x720c8075), SHC(0x4ecdfec7), SHC(0x64dd8950), SHC(0x609a52d3), SHC(0x53f9be05)}; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_320[2 * (320 - 20)] = { -# else +#else const Word16 RotVector_320[2 * (320 - 20)] = { -# endif +#endif SHC(0x7fffffff), SHC(0x00000000), SHC(0x7fe6bcb0), SHC(0xfaf988cc), SHC(0x7f9afcb9), SHC(0xf5f50d67), SHC(0x7f1cde01), SHC(0xf0f488d9), SHC(0x7e6c9251), SHC(0xebf9f498), SHC(0x7d8a5f40), SHC(0xe70747c4), SHC(0x7c769e18), SHC(0xe21e765a), SHC(0x7b31bbb2), SHC(0xdd417079), SHC(0x79bc384d), SHC(0xd8722192), @@ -2536,11 +2536,11 @@ const Word16 RotVector_320[2 * (320 - 20)] = { /* Twiddle coefficients for 32x8 FFTs, generated by fft_tables.py */ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_32_8[2 * (256 - 32)] = { -# else +#else const Word16 RotVector_32_8[2 * (256 - 32)] = { -# endif +#endif SHC(0x7fffffff), SHC(0x00000000), SHC(0x7ff62182), SHC(0xfcdbd541), SHC(0x7fd8878e), SHC(0xf9b82684), SHC(0x7fa736b4), SHC(0xf6956fb7), SHC(0x7f62368f), SHC(0xf3742ca2), SHC(0x7f0991c4), SHC(0xf054d8d5), SHC(0x7e9d55fc), SHC(0xed37ef91), SHC(0x7e1d93ea), SHC(0xea1debbb), SHC(0x7d8a5f40), SHC(0xe70747c4), @@ -2618,11 +2618,11 @@ const Word16 RotVector_32_8[2 * (256 - 32)] = { SHC(0x36ba2014), SHC(0x73b5ebd1), SHC(0x49b41533), SHC(0x68a69e81)}; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_15_6[2 * (90 - 15)] = { -# else +#else const Word16 RotVector_15_6[2 * (90 - 15)] = { -# endif +#endif SHC(0x7fffffff), SHC(0x00000000), SHC(0x7fb02dc6), SHC(0xf7123849), SHC(0x7ec11aa5), SHC(0xee2f9369), SHC(0x7d33f0ca), SHC(0xe5632654), SHC(0x7b0a9f8d), SHC(0xdcb7ea46), SHC(0x7847d909), SHC(0xd438af17), SHC(0x74ef0ebc), SHC(0xcbf00dbe), SHC(0x71046d3e), SHC(0xc3e85b18), SHC(0x6c8cd70b), SHC(0xbc2b9b05), @@ -2651,11 +2651,11 @@ const Word16 RotVector_15_6[2 * (90 - 15)] = { #if defined(SUBSET_SSWB) || defined(SUBSET_SWB) || defined(SUBSET_FB) /* Twiddle coefficients for 32x12 FFTs, generated by fft_tables.py */ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE const Word32 RotVector_32_12[2 * (384 - 32)] = { -# else +#else const Word16 RotVector_32_12[2 * (384 - 32)] = { -# endif +#endif SHC(0x7fffffff), SHC(0x00000000), SHC(0x7ffb9d15), SHC(0xfde7dbd9), SHC(0x7fee74a2), SHC(0xfbcfdc71), SHC(0x7fd8878e), SHC(0xf9b82684), SHC(0x7fb9d759), SHC(0xf7a0dec9), SHC(0x7f92661d), SHC(0xf58a29f2), SHC(0x7f62368f), SHC(0xf3742ca2), SHC(0x7f294bfd), SHC(0xf15f0b74), SHC(0x7ee7aa4c), SHC(0xef4aeaf1), @@ -2776,7 +2776,7 @@ const Word16 RotVector_32_12[2 * (384 - 32)] = { SHC(0x619a7dce), SHC(0x52cf758f)}; -# endif /* !defined(__XTENSA__) */ +#endif /* !defined(__XTENSA__) */ /* Inverse square root table for operands running from 0.5 to ~1.0 diff --git a/lib_lc3plus/setup_dec_lc3.c b/lib_lc3plus/setup_dec_lc3.c index 1d2849f56..211de78ec 100644 --- a/lib_lc3plus/setup_dec_lc3.c +++ b/lib_lc3plus/setup_dec_lc3.c @@ -184,11 +184,11 @@ LC3PLUS_Error FillDecSetup(LC3PLUS_Dec *decoder, int samplerate, int channels, L #if (PHECU_XFP_LA == 0) Word16 oneMsTab_LA[5] = {0, 0, 0, 0, 0}; #else -# if (PHECU_XFP_LA == 4) +#if (PHECU_XFP_LA == 4) Word16 oneMsTab_LA[7] = {0 /*unused*/, 2, 4, 6, 8, 10 /*unused*/, 12}; -# else +#else Word16 oneMsTab_LA[7] = {0 /*unused*/, 8, 16, 24, 32, 40 /*unused*/, 48}; -# endif +#endif #endif Word16 oneMsTab[5] = {8, 16, 24, 32, 48}; @@ -256,9 +256,9 @@ LC3PLUS_Error FillDecSetup(LC3PLUS_Dec *decoder, int samplerate, int channels, L /* set frame config params */ void set_dec_frame_params(LC3PLUS_Dec *decoder) { -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS Word16 tmp = 0; -# endif +#endif #ifdef CR10_A_ATTENUATION_CURVE_SELECTOR Word16 n; #endif @@ -342,7 +342,7 @@ void set_dec_frame_params(LC3PLUS_Dec *decoder) decoder->frame_length = add(tmp, add(tmp, tmp)); decoder->la_zeroes = LowDelayShapes_n960_la_zeroes_7_5ms[decoder->fs_idx]; decoder->stDec_ola_mem_fx_len = sub(decoder->frame_length, decoder->la_zeroes); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (decoder->hrmode) { decoder->bands_offset = bands_offset_7_5ms_HR[decoder->fs_idx - 4]; @@ -352,7 +352,7 @@ void set_dec_frame_params(LC3PLUS_Dec *decoder) decoder->bands_number = bands_number_7_5ms[decoder->fs_idx]; } else -# endif +#endif { decoder->bands_offset = bands_offset_7_5ms[decoder->fs_idx]; decoder->W_fx = LowDelayShapes_n960_7_5ms[decoder->fs_idx]; @@ -361,7 +361,7 @@ void set_dec_frame_params(LC3PLUS_Dec *decoder) decoder->bands_number = bands_number_7_5ms[decoder->fs_idx]; } BREAK; -# endif +#endif case 100: decoder->la_zeroes = LowDelayShapes_n960_la_zeroes[decoder->fs_idx]; @@ -493,7 +493,7 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec *decoder, int ch, Word16 nBytes) setup->enable_lpc_weighting = setup->total_bits < 360; totalBits = L_shr(L_mult0(10923, setup->total_bits), 13); BREAK; -# endif +#endif case 100: BREAK; } diff --git a/lib_lc3plus/setup_dec_lc3.h b/lib_lc3plus/setup_dec_lc3.h index 3145cd21c..6577d4d52 100644 --- a/lib_lc3plus/setup_dec_lc3.h +++ b/lib_lc3plus/setup_dec_lc3.h @@ -78,9 +78,9 @@ typedef struct #ifdef CR8_A_PLC_FADEOUT_TUNING Word16 longterm_counter_plcTdc; -# ifndef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +#ifndef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER Word16 longterm_counter_plcPhaseEcu; -# endif +#endif Word16 longterm_counter_plcNsAdv; Word16 longterm_analysis_counter_max; /* Maximum longterm frames number */ Word16 longterm_analysis_counter_max_bytebuffer; /* Same as above but reduced for circular bit-buffer */ diff --git a/lib_lc3plus/setup_enc_lc3.c b/lib_lc3plus/setup_enc_lc3.c index 7e20912bb..aa404996d 100644 --- a/lib_lc3plus/setup_enc_lc3.c +++ b/lib_lc3plus/setup_enc_lc3.c @@ -49,13 +49,13 @@ LC3PLUS_Error FillEncSetup(LC3PLUS_Enc *encoder, int samplerate, int channels encoder->fs_in = samplerate; encoder->fs_idx = FS2FS_IDX(encoder->fs); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->fs_idx > 4) { encoder->fs_idx = 5; } encoder->hrmode = hrmode != 0; -# endif +#endif encoder->channels = channels; encoder->frame_dms = 100; @@ -90,20 +90,20 @@ LC3PLUS_Error FillEncSetup(LC3PLUS_Enc *encoder, int samplerate, int channels void set_enc_frame_params(LC3PLUS_Enc *encoder) { #ifdef CR8_G_ADD_75MS -# ifdef ENABLE_075_DMS_MODE +#ifdef ENABLE_075_DMS_MODE Word16 tmp; -# endif +#endif #endif encoder->frame_length = extract_l(L_shr_pos(Mpy_32_16_lc3plus(encoder->fs, 20972), 6)); /* fs * 0.01*2^6 */ -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { encoder->BW_cutoff_bits = 0; } else -# endif +#endif { encoder->BW_cutoff_bits = BW_cutoff_bits_all[encoder->fs_idx]; } @@ -117,7 +117,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->nSubdivisions = 2; encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (LEN_12K8 >> 2); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { encoder->bands_number = bands_number_2_5ms_HR[encoder->fs_idx]; @@ -127,7 +127,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->yLen = encoder->frame_length; } else -# endif +#endif { encoder->yLen = s_min(MAX_BW >> 2, encoder->frame_length); encoder->W_fx = LowDelayShapes_n960_2_5ms[encoder->fs_idx]; @@ -146,7 +146,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->nSubdivisions = 2; encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (LEN_12K8 >> 1); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { encoder->bands_offset = bands_offset_5ms_HR[encoder->fs_idx - 4]; @@ -156,7 +156,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->bands_number = bands_number_5ms[encoder->fs_idx]; } else -# endif +#endif { encoder->yLen = s_min(MAX_BW >> 1, encoder->frame_length); encoder->W_fx = LowDelayShapes_n960_5ms[encoder->fs_idx]; @@ -184,7 +184,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->r12k8_mem_out_len = 44; encoder->near_nyquist_index = encoder->bands_number - 4; encoder->near_nyquist_flag = 0; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { encoder->yLen = encoder->frame_length; @@ -194,7 +194,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->bands_offset = bands_offset_7_5ms_HR[encoder->fs_idx - 4]; } else -# endif +#endif { encoder->yLen = s_min((MAX_BW >> 2) * 3, encoder->frame_length); encoder->W_fx = LowDelayShapes_n960_7_5ms[encoder->fs_idx]; @@ -203,7 +203,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->bands_offset = bands_offset_7_5ms[encoder->fs_idx]; } BREAK; -# endif +#endif case 100: encoder->la_zeroes = LowDelayShapes_n960_la_zeroes[encoder->fs_idx]; @@ -217,7 +217,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->near_nyquist_index = encoder->bands_number - 2; encoder->near_nyquist_flag = 0; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { encoder->bands_offset = bands_offset_HR[encoder->fs_idx - 4]; @@ -226,7 +226,7 @@ void set_enc_frame_params(LC3PLUS_Enc *encoder) encoder->yLen = encoder->frame_length; } else -# endif +#endif { encoder->yLen = s_min(MAX_BW, encoder->frame_length); encoder->W_fx = LowDelayShapes_n960[encoder->fs_idx]; @@ -244,7 +244,7 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) int totalBytes = 0, maxBR = 0, minBR = 0, max_bytes = 0; int channel_bytes = 0; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { switch (encoder->frame_dms) @@ -279,14 +279,14 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) return LC3PLUS_HRMODE_ERROR; } break; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: maxBR = 500000; if (encoder->fs == 48000) {minBR = MIN_BR_075DMS_48KHZ_HR;} else if (encoder->fs == 96000) {minBR = MIN_BR_075DMS_96KHZ_HR;} else {return LC3PLUS_HRMODE_ERROR;} BREAK; -# endif +#endif case 100: maxBR = 500000; if (encoder->fs == 48000) @@ -322,47 +322,47 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) /* have additional limitations for 5.0ms */ SWITCH (encoder->fs_in) { -# ifdef SUBSET_NB +#ifdef SUBSET_NB case 8000: maxBR = MAX_BR_050DMS_NB; BREAK; -# endif +#endif default: BREAK; } BREAK; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: minBR = MIN_BR_075DMS; maxBR = MAX_BR_075DMS; // special value for maxBR @ 7.5ms /* have additional limitations for 7.5ms */ SWITCH (encoder->fs_in) { -# ifdef SUBSET_NB +#ifdef SUBSET_NB case 8000: maxBR = MAX_BR_075DMS_NB ; BREAK; -# endif -# ifdef SUBSET_WB +#endif +#ifdef SUBSET_WB case 16000: maxBR = MAX_BR_075DMS_WB ; BREAK; -# endif -# ifdef SUBSET_SSWB +#endif +#ifdef SUBSET_SSWB case 24000: maxBR = MAX_BR_075DMS_SSWB; BREAK; -# endif +#endif default: BREAK; } BREAK; -# endif +#endif case 100: /* have additional limitations for 10ms */ minBR = MIN_BR_100DMS; maxBR = MAX_BR; SWITCH (encoder->fs_in) { -# ifdef SUBSET_NB +#ifdef SUBSET_NB case 8000: maxBR = MAX_BR_100DMS_NB ; BREAK; -# endif -# ifdef SUBSET_WB +#endif +#ifdef SUBSET_WB case 16000: maxBR = MAX_BR_100DMS_WB ; BREAK; -# endif -# ifdef SUBSET_SSWB +#endif +#ifdef SUBSET_SSWB case 24000: maxBR = MAX_BR_100DMS_SSWB; BREAK; -# endif +#endif default: maxBR = MAX_BR; BREAK; } BREAK; @@ -392,47 +392,47 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) /* have additional limitations for 5.0ms */ SWITCH (encoder->fs_in) { -# ifdef SUBSET_NB +#ifdef SUBSET_NB case 8000: maxBR = MAX_BR_050DMS_NB; BREAK; -# endif +#endif default: BREAK; } BREAK; -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: minBR = MIN_BR_075DMS; maxBR = MAX_BR_075DMS; // special value for maxBR @ 7.5ms /* have additional limitations for 7.5ms */ SWITCH (encoder->fs_in) { -# ifdef SUBSET_NB +#ifdef SUBSET_NB case 8000: maxBR = MAX_BR_075DMS_NB ; BREAK; -# endif -# ifdef SUBSET_WB +#endif +#ifdef SUBSET_WB case 16000: maxBR = MAX_BR_075DMS_WB ; BREAK; -# endif -# ifdef SUBSET_SSWB +#endif +#ifdef SUBSET_SSWB case 24000: maxBR = MAX_BR_075DMS_SSWB; BREAK; -# endif +#endif default: BREAK; } BREAK; -# endif +#endif case 100: /* have additional limitations for 10ms */ minBR = MIN_BR_100DMS; maxBR = MAX_BR; SWITCH (encoder->fs_in) { -# ifdef SUBSET_NB +#ifdef SUBSET_NB case 8000: maxBR = MAX_BR_100DMS_NB ; BREAK; -# endif -# ifdef SUBSET_WB +#endif +#ifdef SUBSET_WB case 16000: maxBR = MAX_BR_100DMS_WB ; BREAK; -# endif -# ifdef SUBSET_SSWB +#endif +#ifdef SUBSET_SSWB case 24000: maxBR = MAX_BR_100DMS_SSWB; BREAK; -# endif +#endif default: maxBR = MAX_BR; BREAK; } BREAK; @@ -545,9 +545,9 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) case 25: max_bytes = MAX_NBYTES_025; break; case 50: max_bytes = MAX_NBYTES_050; break; #ifdef ENABLE_075_DMS_MODE -# ifdef CR8_G_ADD_75MS +#ifdef CR8_G_ADD_75MS case 75: max_bytes = MAX_NBYTES_075; BREAK; -# endif +#endif #endif case 100: max_bytes = MAX_NBYTES_100; break; } @@ -577,12 +577,12 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) setup->targetBitsInit = sub(setup->targetBitsInit, 1); } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { setup->targetBitsInit -= 1; } -# endif +#endif setup->targetBitsAri = setup->total_bits; @@ -603,7 +603,7 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) setup->ltpf_enable = sub(L_shr(L_mult0(10923, setup->total_bits), 13), add(560, DEPR_i_mult(80, encoder->fs_idx))) < 0; setup->enable_lpc_weighting = setup->total_bits < 360; BREAK; -# endif +#endif case 100: setup->enable_lpc_weighting = setup->total_bits < 480; setup->ltpf_enable = sub(setup->total_bits, add(560, DEPR_i_mult(80, encoder->fs_idx))) < 0; @@ -613,34 +613,34 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) setup->quantizedGainOff = -(s_min(115, setup->total_bits / (10 * (encoder->fs_idx + 1))) + 105 + 5 * (encoder->fs_idx + 1)); -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode && encoder->fs_idx == 5) { setup->quantizedGainOff = MAX(setup->quantizedGainOff, -181); } -# endif +#endif -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->frame_dms == 100 && ((encoder->fs_in >= 44100 && setup->targetBytes >= 100) || (encoder->fs_in == 32000 && setup->targetBytes >= 81)) && setup->targetBytes < 340 && (encoder->hrmode == 0)) -# else +#else if (encoder->frame_dms == 100 && ((encoder->fs_in >= 44100 && setup->targetBytes >= 100) || (encoder->fs_in == 32000 && setup->targetBytes >= 81)) && setup->targetBytes < 340 ) -# endif +#endif { setup->attack_handling = 1; } else if (encoder->frame_dms == 75 && ((encoder->fs_in >= 44100 && setup->targetBytes >= 75) || (encoder->fs_in == 32000 && setup->targetBytes >= 61)) && setup->targetBytes < 150 -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE && encoder->hrmode == 0 -# endif +#endif ) { setup->attack_handling = 1; @@ -657,15 +657,15 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) setup->attdec_scaling = 0; } -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE if (encoder->hrmode) { setup->ltpf_enable = 0; } -# endif +#endif encoder->sns_damping = SNS_DAMPING; -# ifdef ENABLE_HR_MODE +#ifdef ENABLE_HR_MODE IF (encoder->hrmode) { encoder->sns_damping = SNS_DAMPING_HRMODE; @@ -750,7 +750,7 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc *encoder, int bitrate) { setup->regBits = -1; } -# endif +#endif } encoder->bitrate = bitrate; -- GitLab From a1ebae49cc917de14f5e64af8f5afc6a849e7864 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 6 Aug 2025 10:56:04 +0200 Subject: [PATCH 3/6] update header include guard --- lib_isar/isar_rom_lcld_tables.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_isar/isar_rom_lcld_tables.h b/lib_isar/isar_rom_lcld_tables.h index 19d40751f..01147b724 100644 --- a/lib_isar/isar_rom_lcld_tables.h +++ b/lib_isar/isar_rom_lcld_tables.h @@ -30,8 +30,8 @@ *******************************************************************************************************/ -#ifndef _ISAR_LCLD_ROM_TABLES_H_ -#define _ISAR_LCLD_ROM_TABLES_H_ +#ifndef ISAR_ROM_LCLD_TABLES_H +#define ISAR_ROM_LCLD_TABLES_H #include #include "options.h" @@ -242,4 +242,4 @@ extern const Word32 c_pfP2RImagLUT[32]; /* Q31 */ extern const Word32 c_pfWindowLUT[LCLD_PRED_WIN_LEN]; /* Q31 */ -#endif /* _TABLES_H_ */ +#endif /* ISAR_ROM_LCLD_TABLES_H_ */ -- GitLab From 998e5aefa2822e04170b03b0dc24f89f6e4bd320 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 6 Aug 2025 10:56:15 +0200 Subject: [PATCH 4/6] rename file in include as well --- lib_isar/isar_rom_lcld_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_isar/isar_rom_lcld_tables.c b/lib_isar/isar_rom_lcld_tables.c index 42554611f..df4bd4a0b 100644 --- a/lib_isar/isar_rom_lcld_tables.c +++ b/lib_isar/isar_rom_lcld_tables.c @@ -30,7 +30,7 @@ *******************************************************************************************************/ -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "options.h" #include "wmc_auto.h" #include "prot_fx.h" -- GitLab From 0e2723c8176b00b4f547837bb5f6525e72105e81 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 6 Aug 2025 11:08:01 +0200 Subject: [PATCH 5/6] rename includes in other files --- Workspace_msvc/lib_isar.vcxproj | 4 ++-- lib_isar/isar_MSPred.c | 2 +- lib_isar/isar_PerceptualModel.c | 2 +- lib_isar/isar_PredDecoder.c | 2 +- lib_isar/isar_PredEncoder.c | 2 +- lib_isar/isar_RMSEnvGrouping.c | 2 +- lib_isar/isar_lcld_decoder.c | 2 +- lib_isar/isar_lcld_encoder.c | 2 +- lib_isar/isar_lcld_prot.h | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Workspace_msvc/lib_isar.vcxproj b/Workspace_msvc/lib_isar.vcxproj index 23d803730..cdc0979a0 100644 --- a/Workspace_msvc/lib_isar.vcxproj +++ b/Workspace_msvc/lib_isar.vcxproj @@ -124,7 +124,7 @@ - + @@ -150,7 +150,7 @@ - + diff --git a/lib_isar/isar_MSPred.c b/lib_isar/isar_MSPred.c index 040fcc3a9..69ffc3756 100644 --- a/lib_isar/isar_MSPred.c +++ b/lib_isar/isar_MSPred.c @@ -32,7 +32,7 @@ #include "options.h" #include -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "isar_lcld_prot.h" #include "isar_prot.h" #include "wmc_auto.h" diff --git a/lib_isar/isar_PerceptualModel.c b/lib_isar/isar_PerceptualModel.c index b9a5b1b33..a37bfe9e7 100644 --- a/lib_isar/isar_PerceptualModel.c +++ b/lib_isar/isar_PerceptualModel.c @@ -34,7 +34,7 @@ #include "options.h" #include "isar_lcld_prot.h" #include "prot_fx.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include #include "wmc_auto.h" diff --git a/lib_isar/isar_PredDecoder.c b/lib_isar/isar_PredDecoder.c index a202aaa1c..4ad52ec21 100644 --- a/lib_isar/isar_PredDecoder.c +++ b/lib_isar/isar_PredDecoder.c @@ -36,7 +36,7 @@ #include "prot_fx.h" #include "isar_prot.h" #include "isar_lcld_prot.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_isar/isar_PredEncoder.c b/lib_isar/isar_PredEncoder.c index 8eed33ca6..3ab671fd6 100644 --- a/lib_isar/isar_PredEncoder.c +++ b/lib_isar/isar_PredEncoder.c @@ -34,7 +34,7 @@ #include "options.h" #include #include "isar_lcld_prot.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "prot_fx.h" #include "isar_prot.h" #include "wmc_auto.h" diff --git a/lib_isar/isar_RMSEnvGrouping.c b/lib_isar/isar_RMSEnvGrouping.c index 9a7b2ba54..5d01b0da1 100644 --- a/lib_isar/isar_RMSEnvGrouping.c +++ b/lib_isar/isar_RMSEnvGrouping.c @@ -37,7 +37,7 @@ #include #include "prot_fx.h" #include "isar_lcld_prot.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "wmc_auto.h" #include "prot_fx.h" #include "basop_util.h" diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index ce517a492..ace25cf2f 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -33,7 +33,7 @@ #include #include "options.h" #include "isar_lcld_prot.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "prot_fx.h" #include #include "isar_prot.h" diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index 327edb6ad..2c2de5cb6 100644 --- a/lib_isar/isar_lcld_encoder.c +++ b/lib_isar/isar_lcld_encoder.c @@ -35,7 +35,7 @@ #include #include #include "isar_lcld_prot.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" #include "prot_fx.h" #include "prot_fx.h" #include "isar_prot.h" diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index 3f79a2c12..6f50173b9 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -36,7 +36,7 @@ #include "options.h" #include "typedef.h" #include "common_api_types.h" -#include "isar_lcld_rom_tables.h" +#include "isar_rom_lcld_tables.h" /* clang-format off */ typedef struct LCLD_ENCODER LCLDEncoder; -- GitLab From d810c7f78c6d8535c04e549f09eb84f62bb95c14 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 6 Aug 2025 12:06:05 +0200 Subject: [PATCH 6/6] dummy commit -- GitLab