From 93ade1f683b597b0eb49633cc6102318a382e595 Mon Sep 17 00:00:00 2001 From: Rajat Kumar Date: Wed, 20 Mar 2019 08:57:35 +0530 Subject: [PATCH] Fix to define all tables as const in libxaac libxaac had few tables which were not declared as constants. Added const and did corresponding changes to build and execute. Bug:128433649 Test: Manual Review Change-Id: I1babf22a45fbd595c5a9c67804ecdc0317ebb96c --- .../armv7/ixheaacd_function_selector_armv7.c | 9 +- .../armv8/ixheaacd_function_selector_armv8.c | 9 +- decoder/drc_src/impd_drc_gain_dec.c | 2 +- decoder/drc_src/impd_drc_loudness_control.c | 2 +- decoder/drc_src/impd_drc_parametric_dec.c | 4 +- decoder/drc_src/impd_drc_rom.c | 1323 +++++++++-------- decoder/drc_src/impd_drc_rom.h | 32 +- ...d_drc_selection_process_drcset_selection.c | 6 +- .../ixheaacd_function_selector_generic.c | 10 +- decoder/ixheaacd_acelp_bitparse.c | 4 +- decoder/ixheaacd_acelp_com.h | 2 +- decoder/ixheaacd_acelp_decode.c | 5 +- decoder/ixheaacd_acelp_tools.c | 2 +- decoder/ixheaacd_arith_dec.c | 14 +- decoder/ixheaacd_avq_rom.c | 2 +- decoder/ixheaacd_create.c | 10 +- decoder/ixheaacd_drc_freq_dec.c | 6 +- decoder/ixheaacd_env_dec.c | 8 +- decoder/ixheaacd_env_extr.c | 2 +- decoder/ixheaacd_esbr_fft.c | 2 +- decoder/ixheaacd_esbr_rom.c | 26 +- decoder/ixheaacd_esbr_rom.h | 32 +- decoder/ixheaacd_ext_ch_ele.c | 14 +- decoder/ixheaacd_freq_sca.c | 12 +- decoder/ixheaacd_function_selector.h | 14 +- decoder/ixheaacd_huff_tools.c | 28 +- decoder/ixheaacd_hufftables.c | 69 +- decoder/ixheaacd_info.h | 17 +- decoder/ixheaacd_init_config.c | 24 +- decoder/ixheaacd_interface.h | 33 +- decoder/ixheaacd_lpc.c | 2 +- decoder/ixheaacd_lpc_dec.c | 8 +- decoder/ixheaacd_mps_dec.c | 18 +- decoder/ixheaacd_mps_dec.h | 6 +- decoder/ixheaacd_mps_decorr.c | 62 +- decoder/ixheaacd_mps_hybrid_filt.c | 14 +- decoder/ixheaacd_mps_parse.c | 68 +- decoder/ixheaacd_mps_poly_filt.c | 24 +- decoder/ixheaacd_mps_pre_mix.c | 4 +- decoder/ixheaacd_mps_rom.c | 32 +- decoder/ixheaacd_mps_temp_process.c | 4 +- decoder/ixheaacd_mps_temp_reshape.c | 2 +- decoder/ixheaacd_rom.c | 6 +- decoder/ixheaacd_sbrdec_lpfuncs.c | 15 +- decoder/ixheaacd_spectrum_dec.c | 5 +- decoder/x86/ixheaacd_function_selector_x86.c | 9 +- .../ixheaacd_function_selector_x86_64.c | 9 +- 47 files changed, 1013 insertions(+), 998 deletions(-) diff --git a/decoder/armv7/ixheaacd_function_selector_armv7.c b/decoder/armv7/ixheaacd_function_selector_armv7.c index cde6269..77d3ba5 100644 --- a/decoder/armv7/ixheaacd_function_selector_armv7.c +++ b/decoder/armv7/ixheaacd_function_selector_armv7.c @@ -199,11 +199,11 @@ VOID(*ixheaacd_mps_complex_fft_64) WORD32 nlength) = &ixheaacd_mps_complex_fft_64_armv7; VOID(*ixheaacd_mps_synt_pre_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_pre_twiddle_armv7; VOID(*ixheaacd_mps_synt_post_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_post_twiddle_armv7; VOID(*ixheaacd_calc_pre_twid) @@ -215,8 +215,9 @@ VOID(*ixheaacd_calc_post_twid) const WORD32 *cos_ptr, const WORD32 *sin_ptr) = &ixheaacd_calc_post_twid_armv7; VOID(*ixheaacd_mps_synt_post_fft_twiddle) -(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_armv7; +(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_armv7; VOID(*ixheaacd_mps_synt_out_calc) (WORD32 resolution, WORD32 *out, WORD32 *state, diff --git a/decoder/armv8/ixheaacd_function_selector_armv8.c b/decoder/armv8/ixheaacd_function_selector_armv8.c index bf28a30..e5a30ce 100644 --- a/decoder/armv8/ixheaacd_function_selector_armv8.c +++ b/decoder/armv8/ixheaacd_function_selector_armv8.c @@ -198,11 +198,11 @@ VOID(*ixheaacd_mps_complex_fft_64) WORD32 nlength) = &ixheaacd_mps_complex_fft_64_dec; VOID(*ixheaacd_mps_synt_pre_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_pre_twiddle_dec; VOID(*ixheaacd_mps_synt_post_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_post_twiddle_dec; VOID(*ixheaacd_calc_pre_twid) @@ -214,8 +214,9 @@ VOID(*ixheaacd_calc_post_twid) const WORD32 *cos_ptr, const WORD32 *sin_ptr) = &ixheaacd_calc_post_twid_dec; VOID(*ixheaacd_mps_synt_post_fft_twiddle) -(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; +(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; VOID(*ixheaacd_mps_synt_out_calc) (WORD32 resolution, WORD32 *out, WORD32 *state, diff --git a/decoder/drc_src/impd_drc_gain_dec.c b/decoder/drc_src/impd_drc_gain_dec.c index 8565d37..f3486fe 100644 --- a/decoder/drc_src/impd_drc_gain_dec.c +++ b/decoder/drc_src/impd_drc_gain_dec.c @@ -34,7 +34,7 @@ #include "impd_drc_eq.h" #include "impd_drc_gain_decoder.h" -extern ia_cicp_sigmoid_characteristic_param_struct +extern const ia_cicp_sigmoid_characteristic_param_struct pstr_cicp_sigmoid_characteristic_param[]; WORD32 impd_gain_db_to_lin(ia_interp_params_struct* interp_params_str, diff --git a/decoder/drc_src/impd_drc_loudness_control.c b/decoder/drc_src/impd_drc_loudness_control.c index 687fc6f..01329d9 100644 --- a/decoder/drc_src/impd_drc_loudness_control.c +++ b/decoder/drc_src/impd_drc_loudness_control.c @@ -741,7 +741,7 @@ WORD32 impd_init_loudness_control( WORD32 requested_measurement_system = MEASUREMENT_SYSTEM_BS_1770_4; WORD32 requested_preprocessing = 0; - WORD32* system_bonus = measurement_system_default_tbl; + const WORD32* system_bonus = measurement_system_default_tbl; WORD32 match_measure; FLOAT32 method_val = 0; diff --git a/decoder/drc_src/impd_drc_parametric_dec.c b/decoder/drc_src/impd_drc_parametric_dec.c index e4b3b4a..3b2063c 100644 --- a/decoder/drc_src/impd_drc_parametric_dec.c +++ b/decoder/drc_src/impd_drc_parametric_dec.c @@ -41,7 +41,7 @@ WORD32 impd_init_parametric_drc( WORD32 drc_frame_size, WORD32 sampling_rate, WORD32 sub_band_domain_mode, ia_parametric_drc_params_struct* p_parametricdrc_params) { - WORD32 sub_band_count_tbl[4] = {0, 64, 71, 256}; + static const WORD32 sub_band_count_tbl[4] = {0, 64, 71, 256}; p_parametricdrc_params->drc_frame_size = drc_frame_size; p_parametricdrc_params->sampling_rate = sampling_rate; p_parametricdrc_params->sub_band_domain_mode = sub_band_domain_mode; @@ -568,7 +568,7 @@ WORD32 impd_init_lvl_est_filt_subband( FLOAT32 w0, alpha, sinw0, cosw0; FLOAT32 b0, b1, b2, a0, a1, a2; FLOAT32 num_real, num_imag, den_real, den_imag; - FLOAT32* f_bands_nrm; + const FLOAT32* f_bands_nrm; WORD32 b; WORD32 i; const FLOAT32* ptr_samp_tbl; diff --git a/decoder/drc_src/impd_drc_rom.c b/decoder/drc_src/impd_drc_rom.c index ad264bb..6925ae2 100644 --- a/decoder/drc_src/impd_drc_rom.c +++ b/decoder/drc_src/impd_drc_rom.c @@ -250,24 +250,33 @@ const FLOAT32 dwnmix_coeff_lfe[] = { 10.0f, 6.0f, 4.5f, 3.0f, 1.5f, 0.0f, -1.5f, -3.0f, -4.5f, -6.0f, -10.0f, -15.0f, -20.0f, -30.0f, -40.0f, -1000.0f}; -WORD32 drc_characteristic_order_default[][3] = { +const WORD32 drc_characteristic_order_default[][3] = { {1, 2, -1}, {2, 3, 1}, {3, 4, 2}, {4, 5, 3}, {5, 6, 4}, {6, 5, -1}, {7, 9, -1}, {8, 10, -1}, {9, 7, -1}, {10, 8, -1}, {11, 10, 9}}; -WORD32 measurement_system_default_tbl[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -WORD32 measurement_system_bs1770_3_tbl[] = {0, 0, 8, 0, 1, 3, 0, 5, 6, 7, 4, 2}; -WORD32 measurement_system_user_tbl[] = {0, 0, 1, 0, 8, 5, 0, 2, 3, 4, 6, 7}; -WORD32 measurement_system_expert_tbl[] = {0, 0, 3, 0, 1, 8, 0, 4, 5, 6, 7, 2}; -WORD32 measurement_system_rms_a_tbl[] = {0, 0, 5, 0, 1, 3, 0, 8, 6, 7, 4, 2}; -WORD32 measurement_system_rms_b_tbl[] = {0, 0, 5, 0, 1, 3, 0, 6, 8, 7, 4, 2}; -WORD32 measurement_system_rms_c_tbl[] = {0, 0, 5, 0, 1, 3, 0, 6, 7, 8, 4, 2}; -WORD32 measurement_system_rms_d_tbl[] = {0, 0, 3, 0, 1, 7, 0, 4, 5, 6, 8, 2}; -WORD32 measurement_system_rms_e_tbl[] = {0, 0, 1, 0, 7, 5, 0, 2, 3, 4, 6, 8}; +const WORD32 measurement_system_default_tbl[] = {0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0}; +const WORD32 measurement_system_bs1770_3_tbl[] = {0, 0, 8, 0, 1, 3, + 0, 5, 6, 7, 4, 2}; +const WORD32 measurement_system_user_tbl[] = {0, 0, 1, 0, 8, 5, + 0, 2, 3, 4, 6, 7}; +const WORD32 measurement_system_expert_tbl[] = {0, 0, 3, 0, 1, 8, + 0, 4, 5, 6, 7, 2}; +const WORD32 measurement_system_rms_a_tbl[] = {0, 0, 5, 0, 1, 3, + 0, 8, 6, 7, 4, 2}; +const WORD32 measurement_system_rms_b_tbl[] = {0, 0, 5, 0, 1, 3, + 0, 6, 8, 7, 4, 2}; +const WORD32 measurement_system_rms_c_tbl[] = {0, 0, 5, 0, 1, 3, + 0, 6, 7, 8, 4, 2}; +const WORD32 measurement_system_rms_d_tbl[] = {0, 0, 3, 0, 1, 7, + 0, 4, 5, 6, 8, 2}; +const WORD32 measurement_system_rms_e_tbl[] = {0, 0, 1, 0, 7, 5, + 0, 2, 3, 4, 6, 8}; -WORD32 measurement_method_prog_loudness_tbl[] = {0, 0, 1, 0, 0, 0, - 0, 2, 3, 4, 0, 0}; -WORD32 measurement_method_peak_loudness_tbl[] = {0, 7, 0, 0, 0, 0, - 6, 5, 4, 3, 2, 1}; +const WORD32 measurement_method_prog_loudness_tbl[] = {0, 0, 1, 0, 0, 0, + 0, 2, 3, 4, 0, 0}; +const WORD32 measurement_method_peak_loudness_tbl[] = {0, 7, 0, 0, 0, 0, + 6, 5, 4, 3, 2, 1}; const ia_loc_sys_interface_struct loc_sys_interface[] = { {0, 1, {0, 0, 0}, 0, 0}, {0, 1, {2, 0, 0}, 0, 0}, @@ -335,7 +344,7 @@ const ia_loc_drc_parameter_interface_struct loc_drc_parameter_interface[] = { {1.0f, 1.0f, 0}, {1.0f, 1.0f, 0}, }; -FLOAT32 f_bands_nrm_QMF71[71] = { +const FLOAT32 f_bands_nrm_QMF71[71] = { 0.004583300000000f, 0.000833330000000f, 0.002083300000000f, 0.005875000000000f, 0.009791700000000f, 0.014292000000000f, 0.019792000000000f, 0.027000000000000f, 0.035417000000000f, @@ -361,7 +370,7 @@ FLOAT32 f_bands_nrm_QMF71[71] = { 0.931750000000000f, 0.947370000000000f, 0.963000000000000f, 0.974540000000000f, 0.999040000000000f}; -FLOAT32 f_bands_nrm_QMF64[64] = { +const FLOAT32 f_bands_nrm_QMF64[64] = { 0.0078125000000000f, 0.0234380000000000f, 0.0390620000000000f, 0.0546880000000000f, 0.0703120000000000f, 0.0859380000000000f, 0.1015600000000000f, 0.1171900000000000f, 0.1328100000000000f, @@ -385,7 +394,7 @@ FLOAT32 f_bands_nrm_QMF64[64] = { 0.9453100000000000f, 0.9609400000000000f, 0.9765600000000000f, 0.9921900000000000f}; -FLOAT32 f_bands_nrm_STFT256[257] = { +const FLOAT32 f_bands_nrm_STFT256[257] = { 0.000000000000000f, 0.003906250000000f, 0.007812500000000f, 0.011718750000000f, 0.015625000000000f, 0.019531250000000f, 0.023437500000000f, 0.027343750000000f, 0.031250000000000f, @@ -473,646 +482,646 @@ FLOAT32 f_bands_nrm_STFT256[257] = { 0.984375000000000f, 0.988281250000000f, 0.992187500000000f, 0.996093750000000f, 1.000000000000000f}; -FLOAT64 qmf_filter_coeff[640] = {0, - -0.00055252865047, - -0.00056176925738, - -0.00049475180896, - -0.00048752279712, - -0.00048937912498, - -0.00050407143497, - -0.00052265642972, - -0.00054665656337, - -0.00056778025613, - -0.00058709304852, - -0.00061327473938, - -0.00063124935319, - -0.00065403333621, - -0.00067776907764, - -0.00069416146273, - -0.00071577364744, - -0.00072550431222, - -0.00074409418541, - -0.00074905980532, - -0.00076813719270, - -0.00077248485949, - -0.00078343322877, - -0.00077798694927, - -0.00078036647100, - -0.00078014496257, - -0.00077579773310, - -0.00076307935757, - -0.00075300014201, - -0.00073193571525, - -0.00072153919876, - -0.00069179375372, - -0.00066504150893, - -0.00063415949025, - -0.00059461189330, - -0.00055645763906, - -0.00051455722108, - -0.00046063254803, - -0.00040951214522, - -0.00035011758756, - -0.00028969811748, - -0.00020983373440, - -0.00014463809349, - -0.00006173344072, - 0.00001349497418, - 0.00010943831274, - 0.00020430170688, - 0.00029495311041, - 0.00040265402160, - 0.00051073884952, - 0.00062393761391, - 0.00074580258865, - 0.00086084433262, - 0.00098859883015, - 0.00112501551307, - 0.00125778846475, - 0.00139024948272, - 0.00154432198471, - 0.00168680832531, - 0.00183482654224, - 0.00198411407369, - 0.00214615835557, - 0.00230172547746, - 0.00246256169126, - 0.00262017586902, - 0.00278704643465, - 0.00294694477165, - 0.00311254206525, - 0.00327396134847, - 0.00344188741828, - 0.00360082681231, - 0.00376039229104, - 0.00392074323703, - 0.00408197531935, - 0.00422642692270, - 0.00437307196781, - 0.00452098527825, - 0.00466064606118, - 0.00479325608498, - 0.00491376035745, - 0.00503930226013, - 0.00514073539032, - 0.00524611661324, - 0.00534716811982, - 0.00541967759307, - 0.00548760401507, - 0.00554757145088, - 0.00559380230045, - 0.00562206432097, - 0.00564551969164, - 0.00563891995151, - 0.00562661141932, - 0.00559171286630, - 0.00554043639400, - 0.00547537830770, - 0.00538389758970, - 0.00527157587272, - 0.00513822754514, - 0.00498396877629, - 0.00481094690600, - 0.00460395301471, - 0.00438018617447, - 0.00412516423270, - 0.00384564081246, - 0.00354012465507, - 0.00320918858098, - 0.00284467578623, - 0.00245085400321, - 0.00202741761850, - 0.00157846825768, - 0.00109023290512, - 0.00058322642480, - 0.00002760451905, - -0.00054642808664, - -0.00115681355227, - -0.00180394725893, - -0.00248267236449, - -0.00319337783900, - -0.00394011240522, - -0.00472225962400, - -0.00553372111088, - -0.00637922932685, - -0.00726158168517, - -0.00817982333726, - -0.00913253296085, - -0.01011502154986, - -0.01113155480321, - -0.01218499959508, - 0.01327182200351, - 0.01439046660792, - 0.01554055533423, - 0.01673247129989, - 0.01794333813443, - 0.01918724313698, - 0.02045317933555, - 0.02174675502535, - 0.02306801692862, - 0.02441609920285, - 0.02578758475467, - 0.02718594296329, - 0.02860721736385, - 0.03005026574279, - 0.03150176087389, - 0.03297540810337, - 0.03446209487686, - 0.03596975605542, - 0.03748128504252, - 0.03900536794745, - 0.04053491705584, - 0.04206490946367, - 0.04360975421304, - 0.04514884056413, - 0.04668430272642, - 0.04821657200672, - 0.04973857556014, - 0.05125561555216, - 0.05276307465207, - 0.05424527683589, - 0.05571736482138, - 0.05716164501299, - 0.05859156836260, - 0.05998374801761, - 0.06134551717207, - 0.06268578081172, - 0.06397158980681, - 0.06522471064380, - 0.06643675122104, - 0.06760759851228, - 0.06870438283512, - 0.06976302447127, - 0.07076287107266, - 0.07170026731102, - 0.07256825833083, - 0.07336202550803, - 0.07410036424342, - 0.07474525581194, - 0.07531373362019, - 0.07580083586584, - 0.07619924793396, - 0.07649921704119, - 0.07670934904245, - 0.07681739756964, - 0.07682300113923, - 0.07672049241746, - 0.07650507183194, - 0.07617483218536, - 0.07573057565061, - 0.07515762552870, - 0.07446643947564, - 0.07364060057620, - 0.07267746427299, - 0.07158263647903, - 0.07035330735093, - 0.06896640131951, - 0.06745250215166, - 0.06576906686508, - 0.06394448059633, - 0.06196027790387, - 0.05981665708090, - 0.05751526919867, - 0.05504600343009, - 0.05240938217366, - 0.04959786763445, - 0.04663033051701, - 0.04347687821958, - 0.04014582784127, - 0.03664181168133, - 0.03295839306691, - 0.02908240060125, - 0.02503075618909, - 0.02079970728622, - 0.01637012582228, - 0.01176238327857, - 0.00696368621617, - 0.00197656014503, - -0.00320868968304, - -0.00857117491366, - -0.01412888273558, - -0.01988341292573, - -0.02582272888064, - -0.03195312745332, - -0.03827765720822, - -0.04478068215856, - -0.05148041767934, - -0.05837053268336, - -0.06544098531359, - -0.07269433008129, - -0.08013729344279, - -0.08775475365593, - -0.09555333528914, - -0.10353295311463, - -0.11168269317730, - -0.12000779846800, - -0.12850028503878, - -0.13715517611934, - -0.14597664911870, - -0.15496070710605, - -0.16409588556669, - -0.17338081721706, - -0.18281725485142, - -0.19239667457267, - -0.20212501768103, - -0.21197358538056, - -0.22196526964149, - -0.23206908706791, - -0.24230168845974, - -0.25264803095722, - -0.26310532994603, - -0.27366340405625, - -0.28432141891085, - -0.29507167170646, - -0.30590985751916, - -0.31682789136456, - -0.32781137272105, - -0.33887226938665, - -0.34999141229310, - 0.36115899031355, - 0.37237955463061, - 0.38363500139043, - 0.39492117615675, - 0.40623176767625, - 0.41756968968409, - 0.42891199207373, - 0.44025537543665, - 0.45159965356824, - 0.46293080852757, - 0.47424532146115, - 0.48552530911099, - 0.49677082545707, - 0.50798175000434, - 0.51912349702391, - 0.53022408956855, - 0.54125534487322, - 0.55220512585061, - 0.56307891401370, - 0.57385241316923, - 0.58454032354679, - 0.59511230862496, - 0.60557835389180, - 0.61591099320291, - 0.62612426956055, - 0.63619801077286, - 0.64612696959461, - 0.65590163024671, - 0.66551398801627, - 0.67496631901712, - 0.68423532934598, - 0.69332823767032, - 0.70223887193539, - 0.71094104263095, - 0.71944626349561, - 0.72774489002994, - 0.73582117582769, - 0.74368278636488, - 0.75131374561237, - 0.75870807608242, - 0.76586748650939, - 0.77277808813327, - 0.77942875190216, - 0.78583531203920, - 0.79197358416424, - 0.79784664137700, - 0.80344857518505, - 0.80876950044491, - 0.81381912706217, - 0.81857760046468, - 0.82304198905409, - 0.82722753473360, - 0.83110384571520, - 0.83469373618402, - 0.83797173378865, - 0.84095413924722, - 0.84362382812005, - 0.84598184698206, - 0.84803157770763, - 0.84978051984268, - 0.85119715249343, - 0.85230470352147, - 0.85310209497017, - 0.85357205739107, - 0.85373856005937, - 0.85357205739107, - 0.85310209497017, - 0.85230470352147, - 0.85119715249343, - 0.84978051984268, - 0.84803157770763, - 0.84598184698206, - 0.84362382812005, - 0.84095413924722, - 0.83797173378865, - 0.83469373618402, - 0.83110384571520, - 0.82722753473360, - 0.82304198905409, - 0.81857760046468, - 0.81381912706217, - 0.80876950044491, - 0.80344857518505, - 0.79784664137700, - 0.79197358416424, - 0.78583531203920, - 0.77942875190216, - 0.77277808813327, - 0.76586748650939, - 0.75870807608242, - 0.75131374561237, - 0.74368278636488, - 0.73582117582769, - 0.72774489002994, - 0.71944626349561, - 0.71094104263095, - 0.70223887193539, - 0.69332823767032, - 0.68423532934598, - 0.67496631901712, - 0.66551398801627, - 0.65590163024671, - 0.64612696959461, - 0.63619801077286, - 0.62612426956055, - 0.61591099320291, - 0.60557835389180, - 0.59511230862496, - 0.58454032354679, - 0.57385241316923, - 0.56307891401370, - 0.55220512585061, - 0.54125534487322, - 0.53022408956855, - 0.51912349702391, - 0.50798175000434, - 0.49677082545707, - 0.48552530911099, - 0.47424532146115, - 0.46293080852757, - 0.45159965356824, - 0.44025537543665, - 0.42891199207373, - 0.41756968968409, - 0.40623176767625, - 0.39492117615675, - 0.38363500139043, - 0.37237955463061, - -0.36115899031355, - -0.34999141229310, - -0.33887226938665, - -0.32781137272105, - -0.31682789136456, - -0.30590985751916, - -0.29507167170646, - -0.28432141891085, - -0.27366340405625, - -0.26310532994603, - -0.25264803095722, - -0.24230168845974, - -0.23206908706791, - -0.22196526964149, - -0.21197358538056, - -0.20212501768103, - -0.19239667457267, - -0.18281725485142, - -0.17338081721706, - -0.16409588556669, - -0.15496070710605, - -0.14597664911870, - -0.13715517611934, - -0.12850028503878, - -0.12000779846800, - -0.11168269317730, - -0.10353295311463, - -0.09555333528914, - -0.08775475365593, - -0.08013729344279, - -0.07269433008129, - -0.06544098531359, - -0.05837053268336, - -0.05148041767934, - -0.04478068215856, - -0.03827765720822, - -0.03195312745332, - -0.02582272888064, - -0.01988341292573, - -0.01412888273558, - -0.00857117491366, - -0.00320868968304, - 0.00197656014503, - 0.00696368621617, - 0.01176238327857, - 0.01637012582228, - 0.02079970728622, - 0.02503075618909, - 0.02908240060125, - 0.03295839306691, - 0.03664181168133, - 0.04014582784127, - 0.04347687821958, - 0.04663033051701, - 0.04959786763445, - 0.05240938217366, - 0.05504600343009, - 0.05751526919867, - 0.05981665708090, - 0.06196027790387, - 0.06394448059633, - 0.06576906686508, - 0.06745250215166, - 0.06896640131951, - 0.07035330735093, - 0.07158263647903, - 0.07267746427299, - 0.07364060057620, - 0.07446643947564, - 0.07515762552870, - 0.07573057565061, - 0.07617483218536, - 0.07650507183194, - 0.07672049241746, - 0.07682300113923, - 0.07681739756964, - 0.07670934904245, - 0.07649921704119, - 0.07619924793396, - 0.07580083586584, - 0.07531373362019, - 0.07474525581194, - 0.07410036424342, - 0.07336202550803, - 0.07256825833083, - 0.07170026731102, - 0.07076287107266, - 0.06976302447127, - 0.06870438283512, - 0.06760759851228, - 0.06643675122104, - 0.06522471064380, - 0.06397158980681, - 0.06268578081172, - 0.06134551717207, - 0.05998374801761, - 0.05859156836260, - 0.05716164501299, - 0.05571736482138, - 0.05424527683589, - 0.05276307465207, - 0.05125561555216, - 0.04973857556014, - 0.04821657200672, - 0.04668430272642, - 0.04514884056413, - 0.04360975421304, - 0.04206490946367, - 0.04053491705584, - 0.03900536794745, - 0.03748128504252, - 0.03596975605542, - 0.03446209487686, - 0.03297540810337, - 0.03150176087389, - 0.03005026574279, - 0.02860721736385, - 0.02718594296329, - 0.02578758475467, - 0.02441609920285, - 0.02306801692862, - 0.02174675502535, - 0.02045317933555, - 0.01918724313698, - 0.01794333813443, - 0.01673247129989, - 0.01554055533423, - 0.01439046660792, - -0.01327182200351, - -0.01218499959508, - -0.01113155480321, - -0.01011502154986, - -0.00913253296085, - -0.00817982333726, - -0.00726158168517, - -0.00637922932685, - -0.00553372111088, - -0.00472225962400, - -0.00394011240522, - -0.00319337783900, - -0.00248267236449, - -0.00180394725893, - -0.00115681355227, - -0.00054642808664, - 0.00002760451905, - 0.00058322642480, - 0.00109023290512, - 0.00157846825768, - 0.00202741761850, - 0.00245085400321, - 0.00284467578623, - 0.00320918858098, - 0.00354012465507, - 0.00384564081246, - 0.00412516423270, - 0.00438018617447, - 0.00460395301471, - 0.00481094690600, - 0.00498396877629, - 0.00513822754514, - 0.00527157587272, - 0.00538389758970, - 0.00547537830770, - 0.00554043639400, - 0.00559171286630, - 0.00562661141932, - 0.00563891995151, - 0.00564551969164, - 0.00562206432097, - 0.00559380230045, - 0.00554757145088, - 0.00548760401507, - 0.00541967759307, - 0.00534716811982, - 0.00524611661324, - 0.00514073539032, - 0.00503930226013, - 0.00491376035745, - 0.00479325608498, - 0.00466064606118, - 0.00452098527825, - 0.00437307196781, - 0.00422642692270, - 0.00408197531935, - 0.00392074323703, - 0.00376039229104, - 0.00360082681231, - 0.00344188741828, - 0.00327396134847, - 0.00311254206525, - 0.00294694477165, - 0.00278704643465, - 0.00262017586902, - 0.00246256169126, - 0.00230172547746, - 0.00214615835557, - 0.00198411407369, - 0.00183482654224, - 0.00168680832531, - 0.00154432198471, - 0.00139024948272, - 0.00125778846475, - 0.00112501551307, - 0.00098859883015, - 0.00086084433262, - 0.00074580258865, - 0.00062393761391, - 0.00051073884952, - 0.00040265402160, - 0.00029495311041, - 0.00020430170688, - 0.00010943831274, - 0.00001349497418, - -0.00006173344072, - -0.00014463809349, - -0.00020983373440, - -0.00028969811748, - -0.00035011758756, - -0.00040951214522, - -0.00046063254803, - -0.00051455722108, - -0.00055645763906, - -0.00059461189330, - -0.00063415949025, - -0.00066504150893, - -0.00069179375372, - -0.00072153919876, - -0.00073193571525, - -0.00075300014201, - -0.00076307935757, - -0.00077579773310, - -0.00078014496257, - -0.00078036647100, - -0.00077798694927, - -0.00078343322877, - -0.00077248485949, - -0.00076813719270, - -0.00074905980532, - -0.00074409418541, - -0.00072550431222, - -0.00071577364744, - -0.00069416146273, - -0.00067776907764, - -0.00065403333621, - -0.00063124935319, - -0.00061327473938, - -0.00058709304852, - -0.00056778025613, - -0.00054665656337, - -0.00052265642972, - -0.00050407143497, - -0.00048937912498, - -0.00048752279712, - -0.00049475180896, - -0.00056176925738, - -0.00055252865047}; +const FLOAT64 qmf_filter_coeff[640] = {0, + -0.00055252865047, + -0.00056176925738, + -0.00049475180896, + -0.00048752279712, + -0.00048937912498, + -0.00050407143497, + -0.00052265642972, + -0.00054665656337, + -0.00056778025613, + -0.00058709304852, + -0.00061327473938, + -0.00063124935319, + -0.00065403333621, + -0.00067776907764, + -0.00069416146273, + -0.00071577364744, + -0.00072550431222, + -0.00074409418541, + -0.00074905980532, + -0.00076813719270, + -0.00077248485949, + -0.00078343322877, + -0.00077798694927, + -0.00078036647100, + -0.00078014496257, + -0.00077579773310, + -0.00076307935757, + -0.00075300014201, + -0.00073193571525, + -0.00072153919876, + -0.00069179375372, + -0.00066504150893, + -0.00063415949025, + -0.00059461189330, + -0.00055645763906, + -0.00051455722108, + -0.00046063254803, + -0.00040951214522, + -0.00035011758756, + -0.00028969811748, + -0.00020983373440, + -0.00014463809349, + -0.00006173344072, + 0.00001349497418, + 0.00010943831274, + 0.00020430170688, + 0.00029495311041, + 0.00040265402160, + 0.00051073884952, + 0.00062393761391, + 0.00074580258865, + 0.00086084433262, + 0.00098859883015, + 0.00112501551307, + 0.00125778846475, + 0.00139024948272, + 0.00154432198471, + 0.00168680832531, + 0.00183482654224, + 0.00198411407369, + 0.00214615835557, + 0.00230172547746, + 0.00246256169126, + 0.00262017586902, + 0.00278704643465, + 0.00294694477165, + 0.00311254206525, + 0.00327396134847, + 0.00344188741828, + 0.00360082681231, + 0.00376039229104, + 0.00392074323703, + 0.00408197531935, + 0.00422642692270, + 0.00437307196781, + 0.00452098527825, + 0.00466064606118, + 0.00479325608498, + 0.00491376035745, + 0.00503930226013, + 0.00514073539032, + 0.00524611661324, + 0.00534716811982, + 0.00541967759307, + 0.00548760401507, + 0.00554757145088, + 0.00559380230045, + 0.00562206432097, + 0.00564551969164, + 0.00563891995151, + 0.00562661141932, + 0.00559171286630, + 0.00554043639400, + 0.00547537830770, + 0.00538389758970, + 0.00527157587272, + 0.00513822754514, + 0.00498396877629, + 0.00481094690600, + 0.00460395301471, + 0.00438018617447, + 0.00412516423270, + 0.00384564081246, + 0.00354012465507, + 0.00320918858098, + 0.00284467578623, + 0.00245085400321, + 0.00202741761850, + 0.00157846825768, + 0.00109023290512, + 0.00058322642480, + 0.00002760451905, + -0.00054642808664, + -0.00115681355227, + -0.00180394725893, + -0.00248267236449, + -0.00319337783900, + -0.00394011240522, + -0.00472225962400, + -0.00553372111088, + -0.00637922932685, + -0.00726158168517, + -0.00817982333726, + -0.00913253296085, + -0.01011502154986, + -0.01113155480321, + -0.01218499959508, + 0.01327182200351, + 0.01439046660792, + 0.01554055533423, + 0.01673247129989, + 0.01794333813443, + 0.01918724313698, + 0.02045317933555, + 0.02174675502535, + 0.02306801692862, + 0.02441609920285, + 0.02578758475467, + 0.02718594296329, + 0.02860721736385, + 0.03005026574279, + 0.03150176087389, + 0.03297540810337, + 0.03446209487686, + 0.03596975605542, + 0.03748128504252, + 0.03900536794745, + 0.04053491705584, + 0.04206490946367, + 0.04360975421304, + 0.04514884056413, + 0.04668430272642, + 0.04821657200672, + 0.04973857556014, + 0.05125561555216, + 0.05276307465207, + 0.05424527683589, + 0.05571736482138, + 0.05716164501299, + 0.05859156836260, + 0.05998374801761, + 0.06134551717207, + 0.06268578081172, + 0.06397158980681, + 0.06522471064380, + 0.06643675122104, + 0.06760759851228, + 0.06870438283512, + 0.06976302447127, + 0.07076287107266, + 0.07170026731102, + 0.07256825833083, + 0.07336202550803, + 0.07410036424342, + 0.07474525581194, + 0.07531373362019, + 0.07580083586584, + 0.07619924793396, + 0.07649921704119, + 0.07670934904245, + 0.07681739756964, + 0.07682300113923, + 0.07672049241746, + 0.07650507183194, + 0.07617483218536, + 0.07573057565061, + 0.07515762552870, + 0.07446643947564, + 0.07364060057620, + 0.07267746427299, + 0.07158263647903, + 0.07035330735093, + 0.06896640131951, + 0.06745250215166, + 0.06576906686508, + 0.06394448059633, + 0.06196027790387, + 0.05981665708090, + 0.05751526919867, + 0.05504600343009, + 0.05240938217366, + 0.04959786763445, + 0.04663033051701, + 0.04347687821958, + 0.04014582784127, + 0.03664181168133, + 0.03295839306691, + 0.02908240060125, + 0.02503075618909, + 0.02079970728622, + 0.01637012582228, + 0.01176238327857, + 0.00696368621617, + 0.00197656014503, + -0.00320868968304, + -0.00857117491366, + -0.01412888273558, + -0.01988341292573, + -0.02582272888064, + -0.03195312745332, + -0.03827765720822, + -0.04478068215856, + -0.05148041767934, + -0.05837053268336, + -0.06544098531359, + -0.07269433008129, + -0.08013729344279, + -0.08775475365593, + -0.09555333528914, + -0.10353295311463, + -0.11168269317730, + -0.12000779846800, + -0.12850028503878, + -0.13715517611934, + -0.14597664911870, + -0.15496070710605, + -0.16409588556669, + -0.17338081721706, + -0.18281725485142, + -0.19239667457267, + -0.20212501768103, + -0.21197358538056, + -0.22196526964149, + -0.23206908706791, + -0.24230168845974, + -0.25264803095722, + -0.26310532994603, + -0.27366340405625, + -0.28432141891085, + -0.29507167170646, + -0.30590985751916, + -0.31682789136456, + -0.32781137272105, + -0.33887226938665, + -0.34999141229310, + 0.36115899031355, + 0.37237955463061, + 0.38363500139043, + 0.39492117615675, + 0.40623176767625, + 0.41756968968409, + 0.42891199207373, + 0.44025537543665, + 0.45159965356824, + 0.46293080852757, + 0.47424532146115, + 0.48552530911099, + 0.49677082545707, + 0.50798175000434, + 0.51912349702391, + 0.53022408956855, + 0.54125534487322, + 0.55220512585061, + 0.56307891401370, + 0.57385241316923, + 0.58454032354679, + 0.59511230862496, + 0.60557835389180, + 0.61591099320291, + 0.62612426956055, + 0.63619801077286, + 0.64612696959461, + 0.65590163024671, + 0.66551398801627, + 0.67496631901712, + 0.68423532934598, + 0.69332823767032, + 0.70223887193539, + 0.71094104263095, + 0.71944626349561, + 0.72774489002994, + 0.73582117582769, + 0.74368278636488, + 0.75131374561237, + 0.75870807608242, + 0.76586748650939, + 0.77277808813327, + 0.77942875190216, + 0.78583531203920, + 0.79197358416424, + 0.79784664137700, + 0.80344857518505, + 0.80876950044491, + 0.81381912706217, + 0.81857760046468, + 0.82304198905409, + 0.82722753473360, + 0.83110384571520, + 0.83469373618402, + 0.83797173378865, + 0.84095413924722, + 0.84362382812005, + 0.84598184698206, + 0.84803157770763, + 0.84978051984268, + 0.85119715249343, + 0.85230470352147, + 0.85310209497017, + 0.85357205739107, + 0.85373856005937, + 0.85357205739107, + 0.85310209497017, + 0.85230470352147, + 0.85119715249343, + 0.84978051984268, + 0.84803157770763, + 0.84598184698206, + 0.84362382812005, + 0.84095413924722, + 0.83797173378865, + 0.83469373618402, + 0.83110384571520, + 0.82722753473360, + 0.82304198905409, + 0.81857760046468, + 0.81381912706217, + 0.80876950044491, + 0.80344857518505, + 0.79784664137700, + 0.79197358416424, + 0.78583531203920, + 0.77942875190216, + 0.77277808813327, + 0.76586748650939, + 0.75870807608242, + 0.75131374561237, + 0.74368278636488, + 0.73582117582769, + 0.72774489002994, + 0.71944626349561, + 0.71094104263095, + 0.70223887193539, + 0.69332823767032, + 0.68423532934598, + 0.67496631901712, + 0.66551398801627, + 0.65590163024671, + 0.64612696959461, + 0.63619801077286, + 0.62612426956055, + 0.61591099320291, + 0.60557835389180, + 0.59511230862496, + 0.58454032354679, + 0.57385241316923, + 0.56307891401370, + 0.55220512585061, + 0.54125534487322, + 0.53022408956855, + 0.51912349702391, + 0.50798175000434, + 0.49677082545707, + 0.48552530911099, + 0.47424532146115, + 0.46293080852757, + 0.45159965356824, + 0.44025537543665, + 0.42891199207373, + 0.41756968968409, + 0.40623176767625, + 0.39492117615675, + 0.38363500139043, + 0.37237955463061, + -0.36115899031355, + -0.34999141229310, + -0.33887226938665, + -0.32781137272105, + -0.31682789136456, + -0.30590985751916, + -0.29507167170646, + -0.28432141891085, + -0.27366340405625, + -0.26310532994603, + -0.25264803095722, + -0.24230168845974, + -0.23206908706791, + -0.22196526964149, + -0.21197358538056, + -0.20212501768103, + -0.19239667457267, + -0.18281725485142, + -0.17338081721706, + -0.16409588556669, + -0.15496070710605, + -0.14597664911870, + -0.13715517611934, + -0.12850028503878, + -0.12000779846800, + -0.11168269317730, + -0.10353295311463, + -0.09555333528914, + -0.08775475365593, + -0.08013729344279, + -0.07269433008129, + -0.06544098531359, + -0.05837053268336, + -0.05148041767934, + -0.04478068215856, + -0.03827765720822, + -0.03195312745332, + -0.02582272888064, + -0.01988341292573, + -0.01412888273558, + -0.00857117491366, + -0.00320868968304, + 0.00197656014503, + 0.00696368621617, + 0.01176238327857, + 0.01637012582228, + 0.02079970728622, + 0.02503075618909, + 0.02908240060125, + 0.03295839306691, + 0.03664181168133, + 0.04014582784127, + 0.04347687821958, + 0.04663033051701, + 0.04959786763445, + 0.05240938217366, + 0.05504600343009, + 0.05751526919867, + 0.05981665708090, + 0.06196027790387, + 0.06394448059633, + 0.06576906686508, + 0.06745250215166, + 0.06896640131951, + 0.07035330735093, + 0.07158263647903, + 0.07267746427299, + 0.07364060057620, + 0.07446643947564, + 0.07515762552870, + 0.07573057565061, + 0.07617483218536, + 0.07650507183194, + 0.07672049241746, + 0.07682300113923, + 0.07681739756964, + 0.07670934904245, + 0.07649921704119, + 0.07619924793396, + 0.07580083586584, + 0.07531373362019, + 0.07474525581194, + 0.07410036424342, + 0.07336202550803, + 0.07256825833083, + 0.07170026731102, + 0.07076287107266, + 0.06976302447127, + 0.06870438283512, + 0.06760759851228, + 0.06643675122104, + 0.06522471064380, + 0.06397158980681, + 0.06268578081172, + 0.06134551717207, + 0.05998374801761, + 0.05859156836260, + 0.05716164501299, + 0.05571736482138, + 0.05424527683589, + 0.05276307465207, + 0.05125561555216, + 0.04973857556014, + 0.04821657200672, + 0.04668430272642, + 0.04514884056413, + 0.04360975421304, + 0.04206490946367, + 0.04053491705584, + 0.03900536794745, + 0.03748128504252, + 0.03596975605542, + 0.03446209487686, + 0.03297540810337, + 0.03150176087389, + 0.03005026574279, + 0.02860721736385, + 0.02718594296329, + 0.02578758475467, + 0.02441609920285, + 0.02306801692862, + 0.02174675502535, + 0.02045317933555, + 0.01918724313698, + 0.01794333813443, + 0.01673247129989, + 0.01554055533423, + 0.01439046660792, + -0.01327182200351, + -0.01218499959508, + -0.01113155480321, + -0.01011502154986, + -0.00913253296085, + -0.00817982333726, + -0.00726158168517, + -0.00637922932685, + -0.00553372111088, + -0.00472225962400, + -0.00394011240522, + -0.00319337783900, + -0.00248267236449, + -0.00180394725893, + -0.00115681355227, + -0.00054642808664, + 0.00002760451905, + 0.00058322642480, + 0.00109023290512, + 0.00157846825768, + 0.00202741761850, + 0.00245085400321, + 0.00284467578623, + 0.00320918858098, + 0.00354012465507, + 0.00384564081246, + 0.00412516423270, + 0.00438018617447, + 0.00460395301471, + 0.00481094690600, + 0.00498396877629, + 0.00513822754514, + 0.00527157587272, + 0.00538389758970, + 0.00547537830770, + 0.00554043639400, + 0.00559171286630, + 0.00562661141932, + 0.00563891995151, + 0.00564551969164, + 0.00562206432097, + 0.00559380230045, + 0.00554757145088, + 0.00548760401507, + 0.00541967759307, + 0.00534716811982, + 0.00524611661324, + 0.00514073539032, + 0.00503930226013, + 0.00491376035745, + 0.00479325608498, + 0.00466064606118, + 0.00452098527825, + 0.00437307196781, + 0.00422642692270, + 0.00408197531935, + 0.00392074323703, + 0.00376039229104, + 0.00360082681231, + 0.00344188741828, + 0.00327396134847, + 0.00311254206525, + 0.00294694477165, + 0.00278704643465, + 0.00262017586902, + 0.00246256169126, + 0.00230172547746, + 0.00214615835557, + 0.00198411407369, + 0.00183482654224, + 0.00168680832531, + 0.00154432198471, + 0.00139024948272, + 0.00125778846475, + 0.00112501551307, + 0.00098859883015, + 0.00086084433262, + 0.00074580258865, + 0.00062393761391, + 0.00051073884952, + 0.00040265402160, + 0.00029495311041, + 0.00020430170688, + 0.00010943831274, + 0.00001349497418, + -0.00006173344072, + -0.00014463809349, + -0.00020983373440, + -0.00028969811748, + -0.00035011758756, + -0.00040951214522, + -0.00046063254803, + -0.00051455722108, + -0.00055645763906, + -0.00059461189330, + -0.00063415949025, + -0.00066504150893, + -0.00069179375372, + -0.00072153919876, + -0.00073193571525, + -0.00075300014201, + -0.00076307935757, + -0.00077579773310, + -0.00078014496257, + -0.00078036647100, + -0.00077798694927, + -0.00078343322877, + -0.00077248485949, + -0.00076813719270, + -0.00074905980532, + -0.00074409418541, + -0.00072550431222, + -0.00071577364744, + -0.00069416146273, + -0.00067776907764, + -0.00065403333621, + -0.00063124935319, + -0.00061327473938, + -0.00058709304852, + -0.00056778025613, + -0.00054665656337, + -0.00052265642972, + -0.00050407143497, + -0.00048937912498, + -0.00048752279712, + -0.00049475180896, + -0.00056176925738, + -0.00055252865047}; const ia_filter_bank_params_struct normal_cross_freq[FILTER_BANK_PARAMETER_COUNT] = { diff --git a/decoder/drc_src/impd_drc_rom.h b/decoder/drc_src/impd_drc_rom.h index 9add85d..d9432fd 100644 --- a/decoder/drc_src/impd_drc_rom.h +++ b/decoder/drc_src/impd_drc_rom.h @@ -66,20 +66,20 @@ extern const FLOAT32 dwnmix_coeff[]; extern const FLOAT32 dwnmix_coeff_lfe[]; -extern WORD32 drc_characteristic_order_default[][3]; +extern const WORD32 drc_characteristic_order_default[][3]; -extern WORD32 measurement_system_default_tbl[]; +extern const WORD32 measurement_system_default_tbl[]; -extern WORD32 measurement_system_bs1770_3_tbl[]; -extern WORD32 measurement_system_user_tbl[]; -extern WORD32 measurement_system_expert_tbl[]; -extern WORD32 measurement_system_rms_a_tbl[]; -extern WORD32 measurement_system_rms_b_tbl[]; -extern WORD32 measurement_system_rms_c_tbl[]; -extern WORD32 measurement_system_rms_d_tbl[]; -extern WORD32 measurement_system_rms_e_tbl[]; -extern WORD32 measurement_method_prog_loudness_tbl[]; -extern WORD32 measurement_method_peak_loudness_tbl[]; +extern const WORD32 measurement_system_bs1770_3_tbl[]; +extern const WORD32 measurement_system_user_tbl[]; +extern const WORD32 measurement_system_expert_tbl[]; +extern const WORD32 measurement_system_rms_a_tbl[]; +extern const WORD32 measurement_system_rms_b_tbl[]; +extern const WORD32 measurement_system_rms_c_tbl[]; +extern const WORD32 measurement_system_rms_d_tbl[]; +extern const WORD32 measurement_system_rms_e_tbl[]; +extern const WORD32 measurement_method_prog_loudness_tbl[]; +extern const WORD32 measurement_method_peak_loudness_tbl[]; #define MAX_NUM_DOWNMIX_ID_REQUESTS_LOCAL 3 @@ -151,11 +151,11 @@ typedef struct { extern const ia_loc_drc_parameter_interface_struct loc_drc_parameter_interface[]; -extern FLOAT32 f_bands_nrm_QMF71[71]; -extern FLOAT32 f_bands_nrm_QMF64[64]; -extern FLOAT32 f_bands_nrm_STFT256[257]; +extern const FLOAT32 f_bands_nrm_QMF71[71]; +extern const FLOAT32 f_bands_nrm_QMF64[64]; +extern const FLOAT32 f_bands_nrm_STFT256[257]; -FLOAT64 qmf_filter_coeff[640]; +extern const FLOAT64 qmf_filter_coeff[640]; extern const ia_filter_bank_params_struct normal_cross_freq[FILTER_BANK_PARAMETER_COUNT]; diff --git a/decoder/drc_src/impd_drc_selection_process_drcset_selection.c b/decoder/drc_src/impd_drc_selection_process_drcset_selection.c index 7e2bb62..494809d 100644 --- a/decoder/drc_src/impd_drc_selection_process_drcset_selection.c +++ b/decoder/drc_src/impd_drc_selection_process_drcset_selection.c @@ -31,7 +31,7 @@ #include "impd_drc_filter_bank.h" #include "impd_drc_rom.h" -static WORD32 effect_types_request_table[] = { +static const WORD32 effect_types_request_table[] = { EFFECT_BIT_NIGHT, EFFECT_BIT_NOISY, EFFECT_BIT_LIMITED, EFFECT_BIT_LOWLEVEL, EFFECT_BIT_DIALOG, EFFECT_BIT_GENERAL_COMPR, EFFECT_BIT_EXPAND, EFFECT_BIT_ARTISTIC}; @@ -673,9 +673,9 @@ WORD32 impd_match_drc_characteristic( WORD32 k, err; WORD32 match_found_flag = 0; - WORD32* drc_characteristic_order = + const WORD32* drc_characteristic_order = drc_characteristic_order_default[requested_drc_characteristic - 1]; - WORD32 drc_characteristic_order_count = + const WORD32 drc_characteristic_order_count = sizeof(drc_characteristic_order_default[requested_drc_characteristic]) / sizeof(WORD32); k = 0; diff --git a/decoder/generic/ixheaacd_function_selector_generic.c b/decoder/generic/ixheaacd_function_selector_generic.c index 08aac1b..086da7c 100644 --- a/decoder/generic/ixheaacd_function_selector_generic.c +++ b/decoder/generic/ixheaacd_function_selector_generic.c @@ -199,11 +199,11 @@ VOID(*ixheaacd_mps_complex_fft_64) WORD32 nlength) = &ixheaacd_mps_complex_fft_64_dec; VOID(*ixheaacd_mps_synt_pre_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_pre_twiddle_dec; VOID(*ixheaacd_mps_synt_post_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_post_twiddle_dec; VOID(*ixheaacd_calc_pre_twid) @@ -215,8 +215,9 @@ VOID(*ixheaacd_calc_post_twid) const WORD32 *cos_ptr, const WORD32 *sin_ptr) = &ixheaacd_calc_post_twid_dec; VOID(*ixheaacd_mps_synt_post_fft_twiddle) -(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; +(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; VOID(*ixheaacd_mps_synt_out_calc) (WORD32 resolution, WORD32 *out, WORD32 *state, @@ -249,4 +250,3 @@ VOID(*ixheaacd_scale_factor_process) WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_dec; #endif - diff --git a/decoder/ixheaacd_acelp_bitparse.c b/decoder/ixheaacd_acelp_bitparse.c index 17f669b..46d0ee6 100644 --- a/decoder/ixheaacd_acelp_bitparse.c +++ b/decoder/ixheaacd_acelp_bitparse.c @@ -264,7 +264,7 @@ VOID ixheaacd_fac_decoding(WORD32 fac_length, WORD32 k, WORD32 *fac_prm, } } -UWORD8 ixheaacd_num_bites_celp_coding[8][4] = { +const UWORD8 ixheaacd_num_bites_celp_coding[8][4] = { {5, 5, 5, 5}, {9, 9, 5, 5}, {9, 9, 9, 9}, {13, 13, 9, 9}, {13, 13, 13, 13}, {16, 16, 16, 16}, {1, 5, 1, 5}, {1, 5, 5, 5}}; @@ -273,7 +273,7 @@ VOID ixheaacd_acelp_decoding(WORD32 k, ia_usac_data_struct *usac_data, ia_bit_buf_struct *it_bit_buff, WORD32 chan) { WORD32 sfr, kk; WORD32 nb_subfr = usac_data->num_subfrm; - UWORD8 *ptr_num_bits = + const UWORD8 *ptr_num_bits = &ixheaacd_num_bites_celp_coding[pstr_td_frame_data->acelp_core_mode][0]; chan = 0; diff --git a/decoder/ixheaacd_acelp_com.h b/decoder/ixheaacd_acelp_com.h index 363f25f..6b12afe 100644 --- a/decoder/ixheaacd_acelp_com.h +++ b/decoder/ixheaacd_acelp_com.h @@ -62,7 +62,7 @@ VOID ixheaacd_lpc_coeff_wt_apply(FLOAT32 *a, FLOAT32 *ap); VOID ixheaacd_acelp_pitch_sharpening(FLOAT32 *x, WORD32 pit_lag); -VOID ixheaacd_acelp_decode_pulses_per_track(WORD32 index[], WORD16 nbbits, +VOID ixheaacd_acelp_decode_pulses_per_track(WORD32 index[], const WORD16 nbbits, FLOAT32 code[]); #endif diff --git a/decoder/ixheaacd_acelp_decode.c b/decoder/ixheaacd_acelp_decode.c index 73a7c9f..b9f5c45 100644 --- a/decoder/ixheaacd_acelp_decode.c +++ b/decoder/ixheaacd_acelp_decode.c @@ -218,7 +218,8 @@ static VOID ixheaacd_d_acelp_decode_1p_n1(WORD32 index, WORD32 N, return; } -VOID ixheaacd_acelp_decode_pulses_per_track(WORD32 cb_index[], WORD16 code_bits, +VOID ixheaacd_acelp_decode_pulses_per_track(WORD32 cb_index[], + const WORD16 code_bits, FLOAT32 code_vec[]) { WORD32 track_idx, index, ixheaacd_drc_offset, pos[6], i; memset(code_vec, 0, 64 * sizeof(FLOAT32)); @@ -358,7 +359,7 @@ WORD32 ixheaacd_acelp_alias_cnx(ia_usac_data_struct *usac_data, WORD32 pitch_fr1; WORD32 pitch_max; WORD32 subfr_nb = 0; - WORD16 num_codebits_table[8] = {20, 28, 36, 44, 52, 64, 12, 16}; + static const WORD16 num_codebits_table[8] = {20, 28, 36, 44, 52, 64, 12, 16}; FLOAT32 x[FAC_LENGTH], xn2[2 * FAC_LENGTH + 16]; WORD32 int_x[FAC_LENGTH]; WORD32 TTT; diff --git a/decoder/ixheaacd_acelp_tools.c b/decoder/ixheaacd_acelp_tools.c index 430b6f4..793d92c 100644 --- a/decoder/ixheaacd_acelp_tools.c +++ b/decoder/ixheaacd_acelp_tools.c @@ -26,7 +26,7 @@ #include #include -static FLOAT32 ixheaacd_gamma_table[17] = { +static const FLOAT32 ixheaacd_gamma_table[17] = { 1.0f, 0.92f, 0.8464f, 0.778688f, 0.716393f, 0.659082f, 0.606355f, 0.557847f, 0.513219f, 0.472161f, 0.434389f, 0.399637f, 0.367666f, 0.338253f, 0.311193f, 0.286298f, 0.263394f}; diff --git a/decoder/ixheaacd_arith_dec.c b/decoder/ixheaacd_arith_dec.c index f2951ed..d789879 100644 --- a/decoder/ixheaacd_arith_dec.c +++ b/decoder/ixheaacd_arith_dec.c @@ -49,10 +49,10 @@ #define ARITH_ESCAPE 16 -UWORD16 ixheaacd_ari_cf_r[3][4] = { +static const UWORD16 ixheaacd_ari_cf_r[3][4] = { {12571, 10569, 3696, 0}, {12661, 5700, 3751, 0}, {10827, 6884, 2929, 0}}; -static UWORD16 ixheaacd_ari_lookup_m[742] = { +static const UWORD16 ixheaacd_ari_lookup_m[742] = { 0x01, 0x34, 0x0D, 0x13, 0x12, 0x25, 0x00, 0x3A, 0x05, 0x00, 0x21, 0x13, 0x1F, 0x1A, 0x1D, 0x36, 0x24, 0x2B, 0x1B, 0x33, 0x37, 0x29, 0x1D, 0x33, 0x37, 0x33, 0x37, 0x33, 0x37, 0x33, 0x2C, 0x00, 0x21, 0x13, 0x25, 0x2A, @@ -116,7 +116,7 @@ static UWORD16 ixheaacd_ari_lookup_m[742] = { 0x27, 0x17, 0x27, 0x17, 0x27, 0x17, 0x27, 0x17, 0x27, 0x17, 0x27, 0x17, 0x27, 0x17, 0x27, 0x17, 0x27, 0x15, 0x27, 0x27, 0x15, 0x27}; -static UWORD32 ixheaacd_ari_hash_m[742] = { +static const UWORD32 ixheaacd_ari_hash_m[742] = { 0x00000104UL >> 8, 0x0000030AUL >> 8, 0x00000510UL >> 8, 0x00000716UL >> 8, 0x00000A1FUL >> 8, 0x00000F2EUL >> 8, 0x00011100UL >> 8, 0x00111103UL >> 8, 0x00111306UL >> 8, 0x00111436UL >> 8, 0x00111623UL >> 8, 0x00111929UL >> 8, @@ -304,7 +304,7 @@ static UWORD32 ixheaacd_ari_hash_m[742] = { 0x06000F27UL >> 8, 0x069FFF17UL >> 8, 0x06FFFF17UL >> 8, 0x08110017UL >> 8, 0x08EFFF15UL >> 8, 0xFFFFFF00UL >> 8}; -static UWORD8 ixheaacd_ari_hash_m_1[742] = { +static const UWORD8 ixheaacd_ari_hash_m_1[742] = { (UWORD8)0x04, (UWORD8)0x0A, (UWORD8)0x10, (UWORD8)0x16, (UWORD8)0x1F, (UWORD8)0x2E, (UWORD8)0x00, (UWORD8)0x03, (UWORD8)0x06, (UWORD8)0x36, (UWORD8)0x23, (UWORD8)0x29, (UWORD8)0x2E, (UWORD8)0x1B, (UWORD8)0x35, @@ -455,7 +455,7 @@ static UWORD8 ixheaacd_ari_hash_m_1[742] = { (UWORD8)0x2F, (UWORD8)0x27, (UWORD8)0x17, (UWORD8)0x17, (UWORD8)0x17, (UWORD8)0x15, (UWORD8)0x00}; -UWORD16 ixheaacd_ari_cf_m[64][17] = { +static const UWORD16 ixheaacd_ari_cf_m[64][17] = { {708, 706, 579, 569, 568, 567, 479, 469, 297, 138, 97, 91, 72, 52, 38, 34, 0}, {7619, 6917, 6519, 6412, 5514, 5003, 4683, 4563, 3907, 3297, 3125, 3060, @@ -1625,8 +1625,8 @@ const WORD32 ixheaacd_pow_table_Q13[1025] = {0, 84441795, 84551870}; -static WORD32 ixheaacd_esc_nb_offset[8] = {0, 131072, 262144, 393216, - 524288, 655360, 786432, 917504}; +static const WORD32 ixheaacd_esc_nb_offset[8] = { + 0, 131072, 262144, 393216, 524288, 655360, 786432, 917504}; static void ixheaacd_arith_map_context(WORD32 pres_n, WORD32 prev_n, WORD8 *c_prev, WORD8 *c, diff --git a/decoder/ixheaacd_avq_rom.c b/decoder/ixheaacd_avq_rom.c index af2b803..ab81ea1 100644 --- a/decoder/ixheaacd_avq_rom.c +++ b/decoder/ixheaacd_avq_rom.c @@ -402,7 +402,7 @@ const FLOAT32 ixheaacd_interpol_filt[INTER_LP_FIL_LEN] = { 0.001151f, 0.000259f, -0.000417f, -0.000618f, -0.000434f, -0.000133f, 0.000063f, 0.000098f, 0.000048f, 0.000007f, 0.000000f}; -FLOAT32 ixheaacd_weight_table_avq[16 * 256] = { +const FLOAT32 ixheaacd_weight_table_avq[16 * 256] = { 51.35722351f, 56.66270447f, 56.93847275f, 47.94641876f, 51.14369583f, 55.13227081f, 55.94912338f, 55.60356140f, 55.40005112f, 55.63003922f, 56.32114792f, 58.34404755f, 58.28456116f, 57.81193161f, 57.67873764f, diff --git a/decoder/ixheaacd_create.c b/decoder/ixheaacd_create.c index fad1d05..f652ab2 100644 --- a/decoder/ixheaacd_create.c +++ b/decoder/ixheaacd_create.c @@ -99,19 +99,19 @@ #include "ixheaacd_func_def.h" #include "ixheaacd_interface.h" -extern ia_huff_code_word_struct ixheaacd_huff_book_scl[]; +extern const ia_huff_code_word_struct ixheaacd_huff_book_scl[]; -extern WORD32 ixheaacd_book_scl_index[]; -extern WORD16 ixheaacd_book_scl_code_book[]; +extern const WORD32 ixheaacd_book_scl_index[]; +extern const WORD16 ixheaacd_book_scl_code_book[]; -extern ia_usac_samp_rate_info ixheaacd_samp_rate_info[]; +extern const ia_usac_samp_rate_info ixheaacd_samp_rate_info[]; extern const WORD32 ixheaacd_sampling_boundaries[(1 << LEN_SAMP_IDX)]; const WORD32 ixheaacd_sampl_freq_idx_table[17] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, -1, -1, -1, -1}; -static VOID ixheaacd_info_init(ia_usac_samp_rate_info *ptr_samp_info, +static VOID ixheaacd_info_init(const ia_usac_samp_rate_info *ptr_samp_info, WORD32 block_size_samples, ia_sfb_info_struct *pstr_sfb_info_long, ia_sfb_info_struct *pstr_sfb_info_short, diff --git a/decoder/ixheaacd_drc_freq_dec.c b/decoder/ixheaacd_drc_freq_dec.c index 48a83e3..e534470 100644 --- a/decoder/ixheaacd_drc_freq_dec.c +++ b/decoder/ixheaacd_drc_freq_dec.c @@ -115,7 +115,7 @@ static PLATFORM_INLINE WORD32 ixheaacd_mult32x16in32_shift25(WORD32 a, return (result); } -static WORD32 ixheaacd_drc_pow_tbl_2_q29[] = { +static const WORD32 ixheaacd_drc_pow_tbl_2_q29[] = { 536870912, 537242967, 537615991, 537988562, 538361391, 538734479, 539108539, 539482144, 539856009, 540230847, 540605230, 540979873, 541354776, 541730654, 542106077, 542481760, 542858421, 543234626, @@ -284,7 +284,7 @@ static WORD32 ixheaacd_drc_pow_tbl_2_q29[] = { 1066324778, 1067063748, 1067804642, 1068544637, 1069285146, 1070027582, 1070769118, 1071511168, 1072253732, 1072998229}; -static WORD32 ixheaacd_drc_pow_tbl_1_2_q29[] = { +static const WORD32 ixheaacd_drc_pow_tbl_1_2_q29[] = { 536870912, 536499115, 536126866, 535755584, 535384559, 535013791, 534642573, 534272319, 533902321, 533531874, 533162389, 532793160, 532424187, 532054765, 531686303, 531318096, 530949443, 530581746, 530214304, 529847117, 529479484, @@ -878,7 +878,7 @@ VOID ixheaacd_drc_apply(ia_drc_dec_struct *pstr_drc_dec, WORD32 drc_band, spec_pos, start_pos, end_pos; WORD32 low_hi, drc_norm, drc_freq_fac; WORD32 drc_fac, div_val, mod_val, ret_val, offset_value; - WORD32 *table; + const WORD32 *table; ixheaac_drc_data_struct *pstr_drc_data; WORD32 num_qmf_sub_sample = (frame_size >> 5); WORD32 num_qmf_sub_sample_by_2 = (frame_size >> 6); diff --git a/decoder/ixheaacd_env_dec.c b/decoder/ixheaacd_env_dec.c index 6a729a2..c021739 100644 --- a/decoder/ixheaacd_env_dec.c +++ b/decoder/ixheaacd_env_dec.c @@ -58,7 +58,7 @@ static VOID ixheaacd_dequant_esbr_env_data(FLOAT32 *ptr_env_sf, WORD32 num_noise_fac, WORD32 amp_res, FLOAT32 *ptr_noise_floor) { WORD32 i; - FLOAT32 array[2] = {0.5f, 1.0f}; + static const FLOAT32 array[2] = {0.5f, 1.0f}; FLOAT32 a_flt = array[amp_res]; for (i = 0; i < num_env_sf; i++) { @@ -328,7 +328,7 @@ VOID ixheaacd_dequant_env_data(ia_sbr_frame_info_data_struct *ptr_sbr_data, WORD32 exponent; WORD32 exp_add = (7 + NRG_EXP_OFFSET); WORD16 *ptr_env_sf = ptr_sbr_data->int_env_sf_arr; - WORD32 mant_arr[2] = {0x4000, 0x5a80}; + static const WORD32 mant_arr[2] = {0x4000, 0x5a80}; amp_res_1 = (1 - amp_res); @@ -552,8 +552,8 @@ VOID ixheaacd_sbr_env_dequant_coup( WORD32 i; FLOAT32 temp_l, temp_r; - FLOAT32 pan_offset[2] = {24.0f, 12.0f}; - FLOAT32 a_arr[2] = {0.5f, 1.0f}; + static const FLOAT32 pan_offset[2] = {24.0f, 12.0f}; + static const FLOAT32 a_arr[2] = {0.5f, 1.0f}; FLOAT32 a = a_arr[amp_res]; diff --git a/decoder/ixheaacd_env_extr.c b/decoder/ixheaacd_env_extr.c index 728d8a1..41f29e3 100644 --- a/decoder/ixheaacd_env_extr.c +++ b/decoder/ixheaacd_env_extr.c @@ -1551,7 +1551,7 @@ WORD16 ixheaacd_sbr_time_freq_grid_info( bs_var_bord = 0, temp = 0; WORD32 freq_res_0 = 0, frame_class; WORD32 abs_bord_lead, abs_bord_trail, num_rel_trail, num_rel_lead; - WORD32 pointer_bits_array[7] = {1, 2, 2, 3, 3, 3, 3}; + static const WORD32 pointer_bits_array[7] = {1, 2, 2, 3, 3, 3, 3}; ia_frame_info_struct *p_fixfix_tab; ia_frame_info_struct *p_frame_info = &ptr_frame_data->str_frame_info_details; diff --git a/decoder/ixheaacd_esbr_fft.c b/decoder/ixheaacd_esbr_fft.c index 24916ae..07d2430 100644 --- a/decoder/ixheaacd_esbr_fft.c +++ b/decoder/ixheaacd_esbr_fft.c @@ -35,7 +35,7 @@ (j) = _ >> (m); \ } while (0) -extern FLOAT32 ixheaacd_twiddle_table_fft_float[514]; +extern const FLOAT32 ixheaacd_twiddle_table_fft_float[514]; const FLOAT32 ixheaacd_twidle_tbl_48[64]; const FLOAT32 ixheaacd_twidle_tbl_24[32]; diff --git a/decoder/ixheaacd_esbr_rom.c b/decoder/ixheaacd_esbr_rom.c index 095e180..3c1db63 100644 --- a/decoder/ixheaacd_esbr_rom.c +++ b/decoder/ixheaacd_esbr_rom.c @@ -19,6 +19,7 @@ */ #include #include "ixheaacd_sbr_const.h" +#include "ixheaacd_esbr_rom.h" const FLOAT32 ixheaacd_sub_samp_qmf_window_coeff[40 + 80 + 120 + 160 + 200 + 240 + 320 + 400] = { @@ -941,19 +942,18 @@ const FLOAT32 ixheaacd_hphase_tbl[2][8] = {{1.0f, 0.0f, -1.0f, 0.0f}, const FLOAT32 ixheaacd_g_lim_gains[4] = {0.70795f, 1.0f, 1.41254f, 1e10f}; -typedef const FLOAT32 FIR_FILTER[5]; -FIR_FILTER ixheaacd_fir_0 = {1.0f}; -FIR_FILTER ixheaacd_fir_1 = {0.33333333333333f, 0.66666666666666f}; -FIR_FILTER ixheaacd_fir_2 = {0.12500000000000f, 0.37500000000000f, - 0.50000000000000f}; -FIR_FILTER ixheaacd_fir_3 = {0.05857864376269f, 0.20000000000000f, - 0.34142135623731f, 0.40000000000000f}; -FIR_FILTER ixheaacd_fir_4 = {0.03183050093751f, 0.11516383427084f, - 0.21816949906249f, 0.30150283239582f, - 0.33333333333333f}; -FIR_FILTER *ixheaacd_fir_table[5] = {&ixheaacd_fir_0, &ixheaacd_fir_1, - &ixheaacd_fir_2, &ixheaacd_fir_3, - &ixheaacd_fir_4}; +const FIR_FILTER ixheaacd_fir_0 = {1.0f}; +const FIR_FILTER ixheaacd_fir_1 = {0.33333333333333f, 0.66666666666666f}; +const FIR_FILTER ixheaacd_fir_2 = {0.12500000000000f, 0.37500000000000f, + 0.50000000000000f}; +const FIR_FILTER ixheaacd_fir_3 = {0.05857864376269f, 0.20000000000000f, + 0.34142135623731f, 0.40000000000000f}; +const FIR_FILTER ixheaacd_fir_4 = {0.03183050093751f, 0.11516383427084f, + 0.21816949906249f, 0.30150283239582f, + 0.33333333333333f}; +const FIR_FILTER* const ixheaacd_fir_table[5] = { + &ixheaacd_fir_0, &ixheaacd_fir_1, &ixheaacd_fir_2, &ixheaacd_fir_3, + &ixheaacd_fir_4}; const FLOAT32 ixheaacd_q_gamma_table[4] = {0.0f, 1.0f, 2.0f, 4.0f}; const WORD32 ixheaacd_start_subband2kL_tbl[33] = { diff --git a/decoder/ixheaacd_esbr_rom.h b/decoder/ixheaacd_esbr_rom.h index 253f8c3..34eef98 100644 --- a/decoder/ixheaacd_esbr_rom.h +++ b/decoder/ixheaacd_esbr_rom.h @@ -27,13 +27,13 @@ extern const FLOAT32 ixheaacd_hphase_tbl[2][8]; extern const FLOAT32 ixheaacd_g_lim_gains[4]; -typedef const FLOAT32 FIR_FILTER[5]; -extern FIR_FILTER ixheaacd_fir_0; -extern FIR_FILTER ixheaacd_fir_1; -extern FIR_FILTER ixheaacd_fir_2; -extern FIR_FILTER ixheaacd_fir_3; -extern FIR_FILTER ixheaacd_fir_4; -extern FIR_FILTER *ixheaacd_fir_table[5]; +typedef FLOAT32 FIR_FILTER[5]; +extern const FIR_FILTER ixheaacd_fir_0; +extern const FIR_FILTER ixheaacd_fir_1; +extern const FIR_FILTER ixheaacd_fir_2; +extern const FIR_FILTER ixheaacd_fir_3; +extern const FIR_FILTER ixheaacd_fir_4; +extern const FIR_FILTER* const ixheaacd_fir_table[5]; extern const FLOAT32 ixheaacd_q_gamma_table[4]; extern const WORD32 ixheaacd_start_subband2kL_tbl[33]; extern const FLOAT32 ixheaacd_cos_table_trans_qmf[7][32 * 2]; @@ -47,15 +47,15 @@ extern const FLOAT32 ixheaacd_hbe_x_prod_cos_table_trans_3[2 * (128 + 128)]; extern const FLOAT32 ixheaacd_hbe_x_prod_cos_table_trans_4[2 * (128 + 128)]; extern const FLOAT32 ixheaacd_hbe_x_prod_cos_table_trans_4_1[2 * (128 + 128)]; -extern const FLOAT32 ixheaacd_synth_cos_table_kl_4[8 * 4]; -extern const FLOAT32 ixheaacd_synth_cos_table_kl_8[16 * 8]; -extern const FLOAT32 ixheaacd_synth_cos_table_kl_12[24 * 12]; -extern const FLOAT32 ixheaacd_synth_cos_table_kl_16[32 * 16]; +extern const FLOAT32 ixheaacd_synth_cos_table_kl_4[16]; +extern const FLOAT32 ixheaacd_synth_cos_table_kl_8[32]; +extern const FLOAT32 ixheaacd_synth_cos_table_kl_12[48]; +extern const FLOAT32 ixheaacd_synth_cos_table_kl_16[64]; extern const FLOAT32 ixheaacd_synth_cos_table_kl_20[40 * 20]; -extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_8[8 * 8 * 2]; -extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_16[16 * 16 * 2]; -extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_24[24 * 24 * 2]; -extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_32[32 * 32 * 2]; -extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_40[40 * 80 * 2]; +extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_8[32]; +extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_16[64]; +extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_24[96]; +extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_32[128]; +extern const FLOAT32 ixheaacd_analy_cos_sin_table_kl_40[40 * 40 * 2]; extern const FLOAT32 ixheaacd_sel_case[5][8]; #endif diff --git a/decoder/ixheaacd_ext_ch_ele.c b/decoder/ixheaacd_ext_ch_ele.c index 01506e7..22c6d30 100644 --- a/decoder/ixheaacd_ext_ch_ele.c +++ b/decoder/ixheaacd_ext_ch_ele.c @@ -70,7 +70,7 @@ const WORD16 ixheaacd_mdst_fcoeff_long_sin_kbd[] = {-1499, -1876, -17718, 0, const WORD16 ixheaacd_mdst_fcoeff_long_kbd_sin[] = {-1499, 1876, -17718, 0, 17718, -1876, 1499}; -const WORD16 *ixheaacd_mdst_fcoeff_longshort_curr[2][2] = { +const WORD16 *const ixheaacd_mdst_fcoeff_longshort_curr[2][2] = { {ixheaacd_mdst_fcoeff_long_sin, ixheaacd_mdst_fcoeff_long_sin_kbd}, {ixheaacd_mdst_fcoeff_long_kbd_sin, ixheaacd_mdst_fcoeff_long_kbd}}; @@ -83,7 +83,7 @@ const WORD16 ixheaacd_mdst_fcoeff_start_sin_kbd[] = {-3433, -3447, -18608, 0, const WORD16 ixheaacd_mdst_fcoeff_start_kbd_sin[] = {-4863, -1525, -19918, 0, 19918, 1525, 4863}; -const WORD16 *ixheaacd_mdst_fcoeff_start_curr[2][2] = { +const WORD16 *const ixheaacd_mdst_fcoeff_start_curr[2][2] = { {ixheaacd_mdst_fcoeff_start_sin, ixheaacd_mdst_fcoeff_start_sin_kbd}, {ixheaacd_mdst_fcoeff_start_kbd_sin, ixheaacd_mdst_fcoeff_start_kbd}}; @@ -96,7 +96,7 @@ const WORD16 ixheaacd_mdst_fcoeff_stop_sin_kbd[] = {-4863, 1525, -19918, 0, const WORD16 ixheaacd_mdst_fcoeff_stop_kbd_sin[] = {-3433, 3447, -18608, 0, 18608, -3447, 3433}; -const WORD16 *ixheaacd_mdst_fcoeff_stop_cur[2][2] = { +const WORD16 *const ixheaacd_mdst_fcoeff_stop_cur[2][2] = { {ixheaacd_mdst_fcoeff_stop_sin, ixheaacd_mdst_fcoeff_stop_sin_kbd}, {ixheaacd_mdst_fcoeff_stop_kbd_sin, ixheaacd_mdst_fcoeff_stop_kbd}}; @@ -109,7 +109,7 @@ const WORD16 ixheaacd_mdst_fcoeff_stopstart_sin_kbd[] = {-6797, -46, -20808, 0, const WORD16 ixheaacd_mdst_fcoeff_stopstart_kbd_sin[] = {-6797, 46, -20808, 0, 20808, 46, 6797}; -const WORD16 *ixheaacd_mdst_fcoeff_stopstart_cur[2][2] = { +const WORD16 *const ixheaacd_mdst_fcoeff_stopstart_cur[2][2] = { {ixheaacd_mdst_fcoeff_stopstart_sin, ixheaacd_mdst_fcoeff_stopstart_sin_kbd}, {ixheaacd_mdst_fcoeff_stopstart_kbd_sin, @@ -125,10 +125,10 @@ const WORD16 ixheaacd_mdst_fcoeff_stop_stopstart_left_sin[] = { const WORD16 ixheaacd_mdst_fcoeff_stop_stopstart_left_kbd[] = { 857, 866, 871, 873, 871, 866, 857}; -const WORD16 *ixheaacd_mdst_fcoeff_l_s_start_left_prev[2] = { +const WORD16 *const ixheaacd_mdst_fcoeff_l_s_start_left_prev[2] = { ixheaacd_mdst_fcoeff_l_s_start_left_sin, ixheaacd_mdst_fcoeff_l_s_start_left_kbd}; -const WORD16 *ixheaacd_mdst_fcoeff_stop_stopstart_left_prev[2] = { +const WORD16 *const ixheaacd_mdst_fcoeff_stop_stopstart_left_prev[2] = { ixheaacd_mdst_fcoeff_stop_stopstart_left_sin, ixheaacd_mdst_fcoeff_stop_stopstart_left_kbd}; @@ -153,7 +153,7 @@ static WORD32 ixheaacd_cplx_pred_data( ia_usac_tmp_core_coder_struct *pstr_core_coder, WORD32 num_window_groups, ia_bit_buf_struct *it_bit_buff) { ia_huff_code_book_struct *ptr_huff_code_book = &ixheaacd_book; - ia_huff_code_word_struct *ptr_huff_code_word = + const ia_huff_code_word_struct *ptr_huff_code_word = ptr_huff_code_book->pstr_huff_code_word; WORD32 cplx_pred_all; WORD32 delta_code_time; diff --git a/decoder/ixheaacd_freq_sca.c b/decoder/ixheaacd_freq_sca.c index f1b6549..91ec487 100644 --- a/decoder/ixheaacd_freq_sca.c +++ b/decoder/ixheaacd_freq_sca.c @@ -49,13 +49,13 @@ #include "ixheaacd_freq_sca.h" #include "ixheaacd_intrinsics.h" -WORD32 ixheaacd_samp_rate_table[12] = {92017, 75132, 55426, 46009, - 37566, 27713, 23004, 18783, - 13856, 11502, 9391, 16428320}; +const WORD32 ixheaacd_samp_rate_table[12] = {92017, 75132, 55426, 46009, + 37566, 27713, 23004, 18783, + 13856, 11502, 9391, 16428320}; -WORD32 ixheaacd_v_offset_40[16] = {3 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, - 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, - 2 + 1, 2 + 1, 1 + 1, 0}; +const WORD32 ixheaacd_v_offset_40[16] = { + 3 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, + 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 1 + 1, 0}; static WORD32 ixheaacd_int_div(WORD32 num, WORD32 den) { if (den != 0) { diff --git a/decoder/ixheaacd_function_selector.h b/decoder/ixheaacd_function_selector.h index 99fc367..0719a59 100644 --- a/decoder/ixheaacd_function_selector.h +++ b/decoder/ixheaacd_function_selector.h @@ -147,12 +147,14 @@ extern VOID (*ixheaacd_complex_fft_p2)(WORD32 *xr, WORD32 *xi, WORD32 nlength, extern VOID (*ixheaacd_mps_complex_fft_64)(WORD32 *ptr_x, WORD32 *fin_re, WORD32 *fin_im, WORD32 nlength); -extern VOID (*ixheaacd_mps_synt_pre_twiddle)(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, +extern VOID (*ixheaacd_mps_synt_pre_twiddle)(WORD32 *ptr_in, + const WORD32 *table_re, + const WORD32 *table_im, WORD32 resolution); -extern VOID (*ixheaacd_mps_synt_post_twiddle)(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, +extern VOID (*ixheaacd_mps_synt_post_twiddle)(WORD32 *ptr_in, + const WORD32 *table_re, + const WORD32 *table_im, WORD32 resolution); extern VOID (*ixheaacd_calc_pre_twid)(WORD32 *ptr_x, WORD32 *r_ptr, @@ -166,8 +168,8 @@ extern VOID (*ixheaacd_calc_post_twid)(WORD32 *ptr_x, WORD32 *r_ptr, const WORD32 *sin_ptr); extern VOID (*ixheaacd_mps_synt_post_fft_twiddle)( - WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state); + WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, const WORD32 *table_re, + const WORD32 *table_im, WORD32 *state); extern VOID (*ixheaacd_mps_synt_out_calc)(WORD32 resolution, WORD32 *out, WORD32 *state, const WORD32 *filter_coeff); diff --git a/decoder/ixheaacd_huff_tools.c b/decoder/ixheaacd_huff_tools.c index 5b0d39b..c90bfa9 100644 --- a/decoder/ixheaacd_huff_tools.c +++ b/decoder/ixheaacd_huff_tools.c @@ -27,22 +27,11 @@ #include "ixheaacd_info.h" #include "ixheaacd_bitbuffer.h" -WORD32 ixheaacd_qsort_cmp(const VOID *va, const VOID *vb) { - const ia_huff_code_word_struct *huff1, *huff2; - - huff1 = (ia_huff_code_word_struct *)va; - huff2 = (ia_huff_code_word_struct *)vb; - if (huff1->len < huff2->len) return -1; - if ((huff1->len == huff2->len) && (huff1->code_word < huff2->code_word)) - return -1; - return 1; -} - VOID ixheaacd_hufftab(ia_huff_code_book_struct *ptr_huff_code_book, - ia_huff_code_word_struct *ptr_huff_code_word, - WORD16 *code_book_tbl, WORD32 *index, WORD32 dim, - WORD32 lav, WORD32 lav_incr_esc, WORD32 sign_code_book, - UWORD8 max_code_word_len) { + const ia_huff_code_word_struct *ptr_huff_code_word, + const WORD16 *code_book_tbl, const WORD32 *index, + WORD32 dim, WORD32 lav, WORD32 lav_incr_esc, + WORD32 sign_code_book, UWORD8 max_code_word_len) { WORD32 i, num; if (!sign_code_book) { @@ -64,14 +53,11 @@ VOID ixheaacd_hufftab(ia_huff_code_book_struct *ptr_huff_code_book, ptr_huff_code_book->code_book_tbl = code_book_tbl; ptr_huff_code_book->idx_tbl = index; ptr_huff_code_book->max_code_word_len = max_code_word_len; - - qsort(ptr_huff_code_word, num, sizeof(ia_huff_code_word_struct), - ixheaacd_qsort_cmp); } -WORD32 ixheaacd_huff_codeword(ia_huff_code_word_struct *ptr_huff_code_word, - UWORD16 data_present, - ia_bit_buf_struct *it_bit_buff) +WORD32 ixheaacd_huff_codeword( + const ia_huff_code_word_struct *ptr_huff_code_word, UWORD16 data_present, + ia_bit_buf_struct *it_bit_buff) { WORD32 i, j; diff --git a/decoder/ixheaacd_hufftables.c b/decoder/ixheaacd_hufftables.c index c9c9232..2b61cc7 100644 --- a/decoder/ixheaacd_hufftables.c +++ b/decoder/ixheaacd_hufftables.c @@ -24,47 +24,46 @@ #include "ixheaacd_bitbuffer.h" #include "ixheaacd_info.h" -ia_huff_code_word_struct ixheaacd_huff_book_scl[] = { - - {0, 18, 262120}, {1, 18, 262118}, {2, 18, 262119}, {3, 18, 262117}, - {4, 19, 524277}, {5, 19, 524273}, {6, 19, 524269}, {7, 19, 524278}, - {8, 19, 524270}, {9, 19, 524271}, {10, 19, 524272}, {11, 19, 524284}, - {12, 19, 524285}, {13, 19, 524287}, {14, 19, 524286}, {15, 19, 524279}, - {16, 19, 524280}, {17, 19, 524283}, {18, 19, 524281}, {19, 18, 262116}, - {20, 19, 524282}, {21, 18, 262115}, {22, 17, 131055}, {23, 17, 131056}, - {24, 16, 65525}, {25, 17, 131054}, {26, 16, 65522}, {27, 16, 65523}, - {28, 16, 65524}, {29, 16, 65521}, {30, 15, 32758}, {31, 15, 32759}, - {32, 14, 16377}, {33, 14, 16373}, {34, 14, 16375}, {35, 14, 16371}, - {36, 14, 16374}, {37, 14, 16370}, {38, 13, 8183}, {39, 13, 8181}, - {40, 12, 4089}, {41, 12, 4087}, {42, 12, 4086}, {43, 11, 2041}, - {44, 12, 4084}, {45, 11, 2040}, {46, 10, 1017}, {47, 10, 1015}, - {48, 10, 1013}, {49, 9, 504}, {50, 9, 503}, {51, 8, 250}, - {52, 8, 248}, {53, 8, 246}, {54, 7, 121}, {55, 6, 58}, - {56, 6, 56}, {57, 5, 26}, {58, 4, 11}, {59, 3, 4}, - {60, 1, 0}, {61, 4, 10}, {62, 4, 12}, {63, 5, 27}, - {64, 6, 57}, {65, 6, 59}, {66, 7, 120}, {67, 7, 122}, - {68, 8, 247}, {69, 8, 249}, {70, 9, 502}, {71, 9, 505}, - {72, 10, 1012}, {73, 10, 1014}, {74, 10, 1016}, {75, 11, 2037}, - {76, 11, 2036}, {77, 11, 2038}, {78, 11, 2039}, {79, 12, 4085}, - {80, 12, 4088}, {81, 13, 8180}, {82, 13, 8182}, {83, 13, 8184}, - {84, 14, 16376}, {85, 14, 16372}, {86, 16, 65520}, {87, 15, 32756}, - {88, 16, 65526}, {89, 15, 32757}, {90, 18, 262114}, {91, 19, 524249}, - {92, 19, 524250}, {93, 19, 524251}, {94, 19, 524252}, {95, 19, 524253}, - {96, 19, 524254}, {97, 19, 524248}, {98, 19, 524242}, {99, 19, 524243}, - {100, 19, 524244}, {101, 19, 524245}, {102, 19, 524246}, {103, 19, 524274}, - {104, 19, 524255}, {105, 19, 524263}, {106, 19, 524264}, {107, 19, 524265}, - {108, 19, 524266}, {109, 19, 524267}, {110, 19, 524262}, {111, 19, 524256}, - {112, 19, 524257}, {113, 19, 524258}, {114, 19, 524259}, {115, 19, 524260}, - {116, 19, 524261}, {117, 19, 524247}, {118, 19, 524268}, {119, 19, 524276}, - {120, 19, 524275}}; -WORD32 ixheaacd_book_scl_index[33] = { +const ia_huff_code_word_struct ixheaacd_huff_book_scl[] = { + {60, 1, 0}, {59, 3, 4}, {61, 4, 10}, {58, 4, 11}, + {62, 4, 12}, {57, 5, 26}, {63, 5, 27}, {56, 6, 56}, + {64, 6, 57}, {55, 6, 58}, {65, 6, 59}, {66, 7, 120}, + {54, 7, 121}, {67, 7, 122}, {53, 8, 246}, {68, 8, 247}, + {52, 8, 248}, {69, 8, 249}, {51, 8, 250}, {70, 9, 502}, + {50, 9, 503}, {49, 9, 504}, {71, 9, 505}, {72, 10, 1012}, + {48, 10, 1013}, {73, 10, 1014}, {47, 10, 1015}, {74, 10, 1016}, + {46, 10, 1017}, {76, 11, 2036}, {75, 11, 2037}, {77, 11, 2038}, + {78, 11, 2039}, {45, 11, 2040}, {43, 11, 2041}, {44, 12, 4084}, + {79, 12, 4085}, {42, 12, 4086}, {41, 12, 4087}, {80, 12, 4088}, + {40, 12, 4089}, {81, 13, 8180}, {39, 13, 8181}, {82, 13, 8182}, + {38, 13, 8183}, {83, 13, 8184}, {37, 14, 16370}, {35, 14, 16371}, + {85, 14, 16372}, {33, 14, 16373}, {36, 14, 16374}, {34, 14, 16375}, + {84, 14, 16376}, {32, 14, 16377}, {87, 15, 32756}, {89, 15, 32757}, + {30, 15, 32758}, {31, 15, 32759}, {86, 16, 65520}, {29, 16, 65521}, + {26, 16, 65522}, {27, 16, 65523}, {28, 16, 65524}, {24, 16, 65525}, + {88, 16, 65526}, {25, 17, 131054}, {22, 17, 131055}, {23, 17, 131056}, + {90, 18, 262114}, {21, 18, 262115}, {19, 18, 262116}, {3, 18, 262117}, + {1, 18, 262118}, {2, 18, 262119}, {0, 18, 262120}, {98, 19, 524242}, + {99, 19, 524243}, {100, 19, 524244}, {101, 19, 524245}, {102, 19, 524246}, + {117, 19, 524247}, {97, 19, 524248}, {91, 19, 524249}, {92, 19, 524250}, + {93, 19, 524251}, {94, 19, 524252}, {95, 19, 524253}, {96, 19, 524254}, + {104, 19, 524255}, {111, 19, 524256}, {112, 19, 524257}, {113, 19, 524258}, + {114, 19, 524259}, {115, 19, 524260}, {116, 19, 524261}, {110, 19, 524262}, + {105, 19, 524263}, {106, 19, 524264}, {107, 19, 524265}, {108, 19, 524266}, + {109, 19, 524267}, {118, 19, 524268}, {6, 19, 524269}, {8, 19, 524270}, + {9, 19, 524271}, {10, 19, 524272}, {5, 19, 524273}, {103, 19, 524274}, + {120, 19, 524275}, {119, 19, 524276}, {4, 19, 524277}, {7, 19, 524278}, + {15, 19, 524279}, {16, 19, 524280}, {18, 19, 524281}, {20, 19, 524282}, + {17, 19, 524283}, {11, 19, 524284}, {12, 19, 524285}, {14, 19, 524286}, + {13, 19, 524287}}; +const WORD32 ixheaacd_book_scl_index[33] = { 0x00000000, 0x10100004, 0x2040000c, 0x00a0003b, 0x30d0007a, 0x412000fa, 0x516001f9, 0x61c003f9, 0x722007f9, 0x82800ff9, 0x92d01ff8, 0xa3503ff9, 0xb400fff6, 0xc431fff0, 0x0687ffef, 0x0707fff7, 0x0747fffb, 0x0767fffd, 0x0777fffe, 0x0787ffff, 0x0030000b, 0x0060001b, 0x00f000f7, 0x014001f7, 0x01a003f7, 0x020007f7, 0x02600ff7, 0x02c01ff7, 0x03303ff7, 0x03907ff7, 0x0421ffef, 0x14a3ffe8, 0x0587ffdf}; -WORD16 ixheaacd_book_scl_code_book[122] = { +const WORD16 ixheaacd_book_scl_code_book[122] = { 0x0013, 0x0781, 0x0763, 0x07a4, 0x0744, 0x07c4, 0x0725, 0x07e5, 0x0706, 0x0806, 0x06e6, 0x0826, 0x0847, 0x06c7, 0x0867, 0x06a8, 0x0888, 0x0688, 0x08a8, 0x0668, 0x08c9, 0x0649, 0x0629, 0x08e9, 0x090a, 0x060a, 0x092a, diff --git a/decoder/ixheaacd_info.h b/decoder/ixheaacd_info.h index d6de7eb..3f4d485 100644 --- a/decoder/ixheaacd_info.h +++ b/decoder/ixheaacd_info.h @@ -61,9 +61,9 @@ typedef struct { WORD32 off; WORD32 sign_code_book; UWORD16 max_code_word_len; - ia_huff_code_word_struct *pstr_huff_code_word; - WORD16 *code_book_tbl; - WORD32 *idx_tbl; + const ia_huff_code_word_struct *pstr_huff_code_word; + const WORD16 *code_book_tbl; + const WORD32 *idx_tbl; } ia_huff_code_book_struct; typedef struct { @@ -98,12 +98,13 @@ typedef struct { extern ia_huff_code_book_struct ixheaacd_book; VOID ixheaacd_hufftab(ia_huff_code_book_struct *ptr_huff_code_book, - ia_huff_code_word_struct *ptr_huff_code_word, - WORD16 *code_book_tbl, WORD32 *index, WORD32 dim, - WORD32 lav, WORD32 lav_incr_esc, WORD32 sign_code_book, - UWORD8 max_code_word_len); + const ia_huff_code_word_struct *ptr_huff_code_word, + const WORD16 *code_book_tbl, const WORD32 *index, + WORD32 dim, WORD32 lav, WORD32 lav_incr_esc, + WORD32 sign_code_book, UWORD8 max_code_word_len); -WORD32 ixheaacd_huff_codeword(ia_huff_code_word_struct *h, UWORD16 data_present, +WORD32 ixheaacd_huff_codeword(const ia_huff_code_word_struct *h, + UWORD16 data_present, ia_bit_buf_struct *it_bit_buff); #endif /* IXHEAACD_INFO_H */ diff --git a/decoder/ixheaacd_init_config.c b/decoder/ixheaacd_init_config.c index 9efd983..aa1c1bf 100644 --- a/decoder/ixheaacd_init_config.c +++ b/decoder/ixheaacd_init_config.c @@ -66,6 +66,11 @@ #include "ixheaacd_error_codes.h" +static const WORD32 sampling_rate_tbl[] = { + 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, + 8000, 7350, 0, 0, 57600, 51200, 40000, 38400, 34150, 28800, 25600, + 20000, 19200, 17075, 14400, 12800, 9600, 0, 0, 0}; + UWORD32 ixheaacd_sbr_ratio(UWORD32 core_sbr_framelength_idx) { UWORD32 sbr_ratio_index = 0x0FF; @@ -88,22 +93,13 @@ UWORD32 ixheaacd_sbr_ratio(UWORD32 core_sbr_framelength_idx) { return sbr_ratio_index; } -WORD32 ixheaacd_get_sample_freq_indx(WORD32 sampling_freq) { - WORD32 sampling_rate_tbl[] = {96000, 88200, 64000, 48000, 44100, 32000, - 24000, 22050, 16000, 12000, 11025, 8000, - 7350, 0, 0, 0}; - +static WORD32 ixheaacd_get_sample_freq_indx(WORD32 sampling_freq) { WORD32 index; - WORD32 tbl_size = sizeof(sampling_rate_tbl) / sizeof(WORD32) - 1; + const WORD32 tbl_size = sizeof(sampling_rate_tbl) / sizeof(WORD32) - 1; for (index = 0; index < tbl_size; index++) { if (sampling_rate_tbl[index] == sampling_freq) break; } - - if (index > tbl_size) { - return tbl_size - 1; - } - return index; } UWORD32 ixheaacd_sbr_params(UWORD32 core_sbr_framelength_idx, @@ -509,12 +505,6 @@ WORD32 ixheaacd_config(ia_bit_buf_struct *it_bit_buff, } } else { - static const WORD32 sampling_rate_tbl[] = { - 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, - 16000, 12000, 11025, 8000, 7350, 0, 0, 57600, - 51200, 40000, 38400, 34150, 28800, 25600, 20000, 19200, - 17075, 14400, 12800, 9600, 0, 0, 0}; - pstr_usac_conf->usac_sampling_frequency = sampling_rate_tbl[pstr_usac_conf->usac_sampling_frequency_index]; } diff --git a/decoder/ixheaacd_interface.h b/decoder/ixheaacd_interface.h index 07f7963..4a9c263 100644 --- a/decoder/ixheaacd_interface.h +++ b/decoder/ixheaacd_interface.h @@ -71,17 +71,22 @@ VOID ixheaacd_complex_ifft_p2_asm(const WORD32 *table, WORD32 nlength, VOID ixheaacd_complex_fft_p2_asm(const WORD32 *table, WORD32 nlength, WORD32 *ptr_x, WORD32 *ptr_y); -VOID ixheaacd_mps_synt_pre_twiddle_dec(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, WORD32 resolution); +VOID ixheaacd_mps_synt_pre_twiddle_dec(WORD32 *ptr_in, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 resolution); -VOID ixheaacd_mps_synt_pre_twiddle_armv7(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, WORD32 resolution); +VOID ixheaacd_mps_synt_pre_twiddle_armv7(WORD32 *ptr_in, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 resolution); -VOID ixheaacd_mps_synt_post_twiddle_dec(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, WORD32 resolution); +VOID ixheaacd_mps_synt_post_twiddle_dec(WORD32 *ptr_in, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 resolution); -VOID ixheaacd_mps_synt_post_twiddle_armv7(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, WORD32 resolution); +VOID ixheaacd_mps_synt_post_twiddle_armv7(WORD32 *ptr_in, + const WORD32 *table_re, + const WORD32 *table_im, + WORD32 resolution); VOID ixheaacd_calc_pre_twid_dec(WORD32 *ptr_x, WORD32 *r_ptr, WORD32 *i_ptr, WORD32 nlength, const WORD32 *cos_ptr, @@ -100,12 +105,16 @@ VOID ixheaacd_calc_post_twid_armv7(WORD32 *ptr_x, WORD32 *r_ptr, WORD32 *i_ptr, const WORD32 *sin_ptr); VOID ixheaacd_mps_synt_post_fft_twiddle_dec(WORD32 resolution, WORD32 *fin_re, - WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state); + WORD32 *fin_im, + const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state); VOID ixheaacd_mps_synt_post_fft_twiddle_armv7(WORD32 resolution, WORD32 *fin_re, - WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state); + WORD32 *fin_im, + const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state); VOID ixheaacd_mps_synt_out_calc_dec(WORD32 resolution, WORD32 *out, WORD32 *state, const WORD32 *filter_coeff); diff --git a/decoder/ixheaacd_lpc.c b/decoder/ixheaacd_lpc.c index c7b87d4..3d8af2b 100644 --- a/decoder/ixheaacd_lpc.c +++ b/decoder/ixheaacd_lpc.c @@ -57,7 +57,7 @@ extern const FLOAT32 lsf_init[ORDER]; extern const FLOAT32 ixheaacd_fir_lp_filt[1 + FILTER_DELAY]; -WORD32 ixheaacd_pow_10_i_by_128[128] = { +const WORD32 ixheaacd_pow_10_i_by_128[128] = { 16384, 17788, 19312, 20968, 22765, 24716, 26835, 29135, 31632, 34343, 37287, 40483, 43953, 47720, 51810, 56251, 61072, 66307, 71990, 78161, 84860, diff --git a/decoder/ixheaacd_lpc_dec.c b/decoder/ixheaacd_lpc_dec.c index f7c8892..160a177 100644 --- a/decoder/ixheaacd_lpc_dec.c +++ b/decoder/ixheaacd_lpc_dec.c @@ -47,7 +47,7 @@ #define FREQ_MAX 6400.0f #define FREQ_DIV 400.0f -static FLOAT32 factor_table[4] = {60.0f, 65.0f, 64.0f, 63.0f}; +static const FLOAT32 factor_table[4] = {60.0f, 65.0f, 64.0f, 63.0f}; VOID ixheaacd_lsf_weight_2st_flt(FLOAT32 *lsfq, FLOAT32 *w, WORD32 mode) { WORD32 i; @@ -102,12 +102,12 @@ static WORD32 ixheaacd_decoding_avq_tool(WORD32 *read_arr, WORD32 *nvecq) { static WORD32 ixheaacd_avq_first_approx_abs(FLOAT32 *lsf, WORD32 *indx) { WORD32 i; - extern FLOAT32 ixheaacd_dico_lsf_abs_8b_flt[]; - extern FLOAT32 ixheaacd_weight_table_avq[]; + extern const FLOAT32 ixheaacd_dico_lsf_abs_8b_flt[]; + extern const FLOAT32 ixheaacd_weight_table_avq[]; WORD32 position = 0; WORD32 avq[ORDER]; FLOAT32 d[ORDER + 1], lsf_min; - FLOAT32 *ptr_w; + const FLOAT32 *ptr_w; ptr_w = &ixheaacd_weight_table_avq[(indx[0] * ORDER)]; diff --git a/decoder/ixheaacd_mps_dec.c b/decoder/ixheaacd_mps_dec.c index 3540e55..ff806ed 100644 --- a/decoder/ixheaacd_mps_dec.c +++ b/decoder/ixheaacd_mps_dec.c @@ -71,13 +71,13 @@ #include #include -extern ia_huff_pt0_nodes_struct ixheaacd_huff_part0_nodes; -extern ia_huff_ipd_nodes_struct ixheaacd_huff_ipd_nodes; -extern ia_huff_lav_nodes_struct ixheaacd_huff_lav_idx_nodes; -extern ia_huff_pt0_nodes_struct ixheaacd_huff_pilot_nodes; -extern ia_huff_cld_nodes_struct ixheaacd_huff_cld_nodes; -extern ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes; -extern ia_huff_res_nodes_struct ixheaacd_huff_reshape_nodes; +extern const ia_huff_pt0_nodes_struct ixheaacd_huff_part0_nodes; +extern const ia_huff_ipd_nodes_struct ixheaacd_huff_ipd_nodes; +extern const ia_huff_lav_nodes_struct ixheaacd_huff_lav_idx_nodes; +extern const ia_huff_pt0_nodes_struct ixheaacd_huff_pilot_nodes; +extern const ia_huff_cld_nodes_struct ixheaacd_huff_cld_nodes; +extern const ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes; +extern const ia_huff_res_nodes_struct ixheaacd_huff_reshape_nodes; WORD32 ixheaacd_mps_create(ia_mps_dec_state_struct* self, WORD32 bs_frame_len, WORD32 residual_coding, @@ -152,11 +152,11 @@ WORD32 ixheaacd_mps_create(ia_mps_dec_state_struct* self, WORD32 bs_frame_len, return 0; } -static FLOAT32 ixheaacd_tsd_mul_re[] = { +static const FLOAT32 ixheaacd_tsd_mul_re[] = { 1.0f, 0.707106781186548f, 0.0f, -0.707106781186548f, -1.0f, -0.707106781186548f, 0.0f, 0.707106781186548f}; -static FLOAT32 ixheaacd_tsd_mul_im[] = { +static const FLOAT32 ixheaacd_tsd_mul_im[] = { 0.0f, 0.707106781186548f, 1.0f, 0.707106781186548f, 0.0f, -0.707106781186548f, -1.0f, -0.707106781186548f}; diff --git a/decoder/ixheaacd_mps_dec.h b/decoder/ixheaacd_mps_dec.h index 527cb2e..845b723 100644 --- a/decoder/ixheaacd_mps_dec.h +++ b/decoder/ixheaacd_mps_dec.h @@ -60,8 +60,8 @@ typedef struct ia_mps_decor_filt_struct { WORD32 den_len; ia_cmplx_flt_struct state[MAX_DECORR_FIL_ORDER + 1]; - FLOAT32 *num; - FLOAT32 *den; + const FLOAT32 *num; + const FLOAT32 *den; } ia_mps_decor_filt_struct; @@ -200,7 +200,7 @@ typedef struct ia_mps_dec_state_struct { WORD32 qmf_band_count; WORD32 hyb_band_count; - WORD32 *hyb_band_to_processing_band_table; + const WORD32 *hyb_band_to_processing_band_table; WORD32 res_ch_count; diff --git a/decoder/ixheaacd_mps_decorr.c b/decoder/ixheaacd_mps_decorr.c index 0d2622f..1bec35a 100644 --- a/decoder/ixheaacd_mps_decorr.c +++ b/decoder/ixheaacd_mps_decorr.c @@ -38,40 +38,48 @@ #include "ixheaacd_constants.h" -static WORD32 ixheaacd_decorr_delay[] = {11, 10, 5, 2}; +static const WORD32 ixheaacd_decorr_delay[] = {11, 10, 5, 2}; -static WORD32 ixheaacd_qmf_split_freq_0[] = {3, 15, 24, 65}; -static WORD32 ixheaacd_qmf_split_freq_1[] = {3, 50, 65, 65}; -static WORD32 ixheaacd_qmf_split_freq_2[] = {0, 15, 65, 65}; +static const WORD32 ixheaacd_qmf_split_freq_0[] = {3, 15, 24, 65}; +static const WORD32 ixheaacd_qmf_split_freq_1[] = {3, 50, 65, 65}; +static const WORD32 ixheaacd_qmf_split_freq_2[] = {0, 15, 65, 65}; -static FLOAT32 ixheaacd_lattice_coeff_0_filt_den_coeff[DECORR_FILT_0_ORD + 1] = - {1.000000f, -0.314818f, -0.256828f, -0.173641f, -0.115077f, 0.000599f, - 0.033343f, 0.122672f, -0.356362f, 0.128058f, 0.089800f}; -static FLOAT32 ixheaacd_lattice_coeff_0_filt_num_coeff[DECORR_FILT_0_ORD + 1] = - {0.089800f, 0.128058f, -0.356362f, 0.122672f, 0.033343f, 0.000599f, - -0.115077f, -0.173641f, -0.256828f, -0.314818f, 1.000000f}; +static const FLOAT32 + ixheaacd_lattice_coeff_0_filt_den_coeff[DECORR_FILT_0_ORD + 1] = { + 1.000000f, -0.314818f, -0.256828f, -0.173641f, -0.115077f, 0.000599f, + 0.033343f, 0.122672f, -0.356362f, 0.128058f, 0.089800f}; +static const FLOAT32 + ixheaacd_lattice_coeff_0_filt_num_coeff[DECORR_FILT_0_ORD + 1] = { + 0.089800f, 0.128058f, -0.356362f, 0.122672f, 0.033343f, 0.000599f, + -0.115077f, -0.173641f, -0.256828f, -0.314818f, 1.000000f}; -static FLOAT32 ixheaacd_lattice_coeff_1_filt_den_coeff[DECORR_FILT_1_ORD + 1] = - {1.000000f, -0.287137f, -0.088940f, 0.123204f, -0.126111f, - 0.064218f, 0.045768f, -0.016264f, -0.122100f}; -static FLOAT32 ixheaacd_lattice_coeff_1_filt_num_coeff[DECORR_FILT_1_ORD + 1] = - {-0.122100f, -0.016264f, 0.045768f, 0.064218f, -0.126111f, - 0.123204f, -0.088940f, -0.287137f, 1.000000f}; +static const FLOAT32 + ixheaacd_lattice_coeff_1_filt_den_coeff[DECORR_FILT_1_ORD + 1] = { + 1.000000f, -0.287137f, -0.088940f, 0.123204f, -0.126111f, + 0.064218f, 0.045768f, -0.016264f, -0.122100f}; +static const FLOAT32 + ixheaacd_lattice_coeff_1_filt_num_coeff[DECORR_FILT_1_ORD + 1] = { + -0.122100f, -0.016264f, 0.045768f, 0.064218f, -0.126111f, + 0.123204f, -0.088940f, -0.287137f, 1.000000f}; -static FLOAT32 ixheaacd_lattice_coeff_2_filt_den_coeff[DECORR_FILT_2_ORD + 1] = - {1.000000f, 0.129403f, -0.032633f, 0.035700f}; -static FLOAT32 ixheaacd_lattice_coeff_2_filt_num_coeff[DECORR_FILT_2_ORD + 1] = - {0.035700f, -0.032633f, 0.129403f, 1.000000f}; +static const FLOAT32 + ixheaacd_lattice_coeff_2_filt_den_coeff[DECORR_FILT_2_ORD + 1] = { + 1.000000f, 0.129403f, -0.032633f, 0.035700f}; +static const FLOAT32 + ixheaacd_lattice_coeff_2_filt_num_coeff[DECORR_FILT_2_ORD + 1] = { + 0.035700f, -0.032633f, 0.129403f, 1.000000f}; -static FLOAT32 ixheaacd_lattice_coeff_3_filt_den_coeff[DECORR_FILT_3_ORD + 1] = - {1.000000f, 0.034742f, -0.013000f}; -static FLOAT32 ixheaacd_lattice_coeff_3_filt_num_coeff[DECORR_FILT_3_ORD + 1] = - {-0.013000f, 0.034742f, 1.000000f}; +static const FLOAT32 + ixheaacd_lattice_coeff_3_filt_den_coeff[DECORR_FILT_3_ORD + 1] = { + 1.000000f, 0.034742f, -0.013000f}; +static const FLOAT32 + ixheaacd_lattice_coeff_3_filt_num_coeff[DECORR_FILT_3_ORD + 1] = { + -0.013000f, 0.034742f, 1.000000f}; -extern WORD32 +extern const WORD32 ixheaacd_hybrid_band_71_to_processing_band_28_map[MAX_HYBRID_BANDS_MPS]; -static WORD32 ixheaacd_hybrid_to_qmf_map[MAX_HYBRID_BANDS_MPS] = { +static const WORD32 ixheaacd_hybrid_to_qmf_map[MAX_HYBRID_BANDS_MPS] = { 0, 0, 0, 0, 0, 0, 1, 1, 2, 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, @@ -188,7 +196,7 @@ static VOID ixheaacd_mps_decor_energy_adjustment( void ixheaacd_mps_decor_init(ia_mps_decor_struct_handle self, WORD32 subbands, WORD32 decor_config) { WORD32 i, reverb_band; - WORD32 *splitfreq; + const WORD32 *splitfreq; switch (decor_config) { case 0: diff --git a/decoder/ixheaacd_mps_hybrid_filt.c b/decoder/ixheaacd_mps_hybrid_filt.c index be53625..9bfb9fb 100644 --- a/decoder/ixheaacd_mps_hybrid_filt.c +++ b/decoder/ixheaacd_mps_hybrid_filt.c @@ -31,11 +31,11 @@ #include "ixheaacd_mps_hybfilter.h" -extern WORD32 ixheaacd_ia_mps_hyb_filter_coeff_8[QMF_HYBRID_FILT_ORDER]; -extern WORD32 ixheaacd_mps_hyb_filter_coeff_2[QMF_HYBRID_FILT_ORDER]; -extern WORD32 ixheaacd_cosine[8][13]; -extern WORD32 ixheaacd_sine[8][13]; -extern WORD32 ixheaacd_cosine2[2][13]; +extern const WORD32 ixheaacd_ia_mps_hyb_filter_coeff_8[QMF_HYBRID_FILT_ORDER]; +extern const WORD32 ixheaacd_mps_hyb_filter_coeff_2[QMF_HYBRID_FILT_ORDER]; +extern const WORD32 ixheaacd_cosine[8][13]; +extern const WORD32 ixheaacd_sine[8][13]; +extern const WORD32 ixheaacd_cosine2[2][13]; static WORD32 ixheaacd_mps_mult32_local(WORD32 a, WORD32 b, WORD16 shift) { WORD64 temp; @@ -47,7 +47,7 @@ static WORD32 ixheaacd_mps_mult32_local(WORD32 a, WORD32 b, WORD16 shift) { static VOID ixheaacd_mps_hyb_filt_type1( ia_cmplx_w32_struct *input, ia_cmplx_w32_struct output[8][MAX_TIME_SLOTS], - WORD32 num_samples, WORD32 *filt_coeff) + WORD32 num_samples, const WORD32 *filt_coeff) { WORD32 i, n, q; @@ -107,7 +107,7 @@ static VOID ixheaacd_mps_hyb_filt_type1( static VOID ixheaacd_mps_hyb_filt_type2( ia_cmplx_w32_struct *input, ia_cmplx_w32_struct output[2][MAX_TIME_SLOTS], - WORD32 num_samples, WORD32 *filt_coeff) + WORD32 num_samples, const WORD32 *filt_coeff) { WORD32 i, n, q; diff --git a/decoder/ixheaacd_mps_parse.c b/decoder/ixheaacd_mps_parse.c index 7f45d3f..e202955 100644 --- a/decoder/ixheaacd_mps_parse.c +++ b/decoder/ixheaacd_mps_parse.c @@ -36,79 +36,81 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) -static int ixheaacd_freq_res_table[] = {0, 28, 20, 14, 10, 7, 5, 4}; +static const int ixheaacd_freq_res_table[] = {0, 28, 20, 14, 10, 7, 5, 4}; -static int +static const int ixheaacd_hybrid_band_71_to_processing_band_4_map[MAX_HYBRID_BANDS_MPS] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; -static int +static const int ixheaacd_hybrid_band_71_to_processing_band_5_map[MAX_HYBRID_BANDS_MPS] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; -static int +static const int ixheaacd_hybrid_band_71_to_processing_band_7_map[MAX_HYBRID_BANDS_MPS] = { 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}; -static int +static const int ixheaacd_hybrid_band_71_to_processing_band_10_map[MAX_HYBRID_BANDS_MPS] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}; -static int +static const int ixheaacd_hybrid_band_71_to_processing_band_14_map[MAX_HYBRID_BANDS_MPS] = { 0, 0, 0, 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13}; -int ixheaacd_hybrid_band_71_to_processing_band_20_map[MAX_HYBRID_BANDS_MPS] = { - 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, - 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19}; +const int + ixheaacd_hybrid_band_71_to_processing_band_20_map[MAX_HYBRID_BANDS_MPS] = { + 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, + 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19}; -int ixheaacd_hybrid_band_71_to_processing_band_28_map[MAX_HYBRID_BANDS_MPS] = { - 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, - 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, - 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27}; +const int + ixheaacd_hybrid_band_71_to_processing_band_28_map[MAX_HYBRID_BANDS_MPS] = { + 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, + 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, + 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27}; -static float ixheaacd_mps_clip_gain_table[] = {1.000000f, 1.189207f, 1.414213f, - 1.681792f, 2.000000f, 2.378414f, - 2.828427f, 4.000000f}; +static const float ixheaacd_mps_clip_gain_table[] = { + 1.000000f, 1.189207f, 1.414213f, 1.681792f, + 2.000000f, 2.378414f, 2.828427f, 4.000000f}; -static int ixheaacd_mps_stride_table[] = {1, 2, 5, 28}; +static const int ixheaacd_mps_stride_table[] = {1, 2, 5, 28}; -static float ixheaacd_cld_de_quant_table[] = { +static const float ixheaacd_cld_de_quant_table[] = { -150.0, -45.0, -40.0, -35.0, -30.0, -25.0, -22.0, -19.0, -16.0, -13.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 13.0, 16.0, 19.0, 22.0, 25.0, 30.0, 35.0, 40.0, 45.0, 150.0}; -static float ixheaacd_icc_de_quant_table[] = { +static const float ixheaacd_icc_de_quant_table[] = { 1.0000f, 0.9370f, 0.84118f, 0.60092f, 0.36764f, 0.0f, -0.5890f, -0.9900f}; -float ixheaacd_ipd_de_quant_table[] = { +const float ixheaacd_ipd_de_quant_table[] = { 0.f, 0.392699082f, 0.785398163f, 1.178097245f, 1.570796327f, 1.963495408f, 2.35619449f, 2.748893572f, 3.141592654f, 3.534291735f, 3.926990817f, 4.319689899f, 4.71238898f, 5.105088062f, 5.497787144f, 5.890486225f}; -int ixheaacd_ipd_de_quant_table_q28[] = { +const int ixheaacd_ipd_de_quant_table_q28[] = { 0, 105414360, 210828720, 316243072, 421657440, 527071776, 632486144, 737900480, 843314880, 948729216, 1054143552, 1159557888, 1264972288, 1370386688, 1475800960, 1581215360}; -static int ixheaacd_smoothing_time_table[] = {64, 128, 256, 512}; +static const int ixheaacd_smoothing_time_table[] = {64, 128, 256, 512}; -static int ixheaacd_inverse_smoothing_time_table_q30[] = {16777216, 8388608, - 4194304, 2097152}; +static const int ixheaacd_inverse_smoothing_time_table_q30[] = { + 16777216, 8388608, 4194304, 2097152}; static WORD32 bound_check(WORD32 var, WORD32 lower_bound, WORD32 upper_bound) { var = min(var, upper_bound); @@ -499,12 +501,12 @@ VOID ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct *self, UWORD64 c_64; unsigned short b; unsigned short r[1]; - unsigned short table_64[] = {6, 11, 16, 20, 23, 27, 30, 33, 35, 38, 40, - 42, 44, 46, 48, 49, 51, 52, 53, 55, 56, 57, - 58, 58, 59, 60, 60, 60, 61, 61, 61, 61}; - unsigned short table_32[] = {5, 9, 13, 16, 18, 20, 22, 24, - 25, 26, 27, 28, 29, 29, 30, 30}; - unsigned short *tab = NULL; + static const unsigned short table_64[] = { + 6, 11, 16, 20, 23, 27, 30, 33, 35, 38, 40, 42, 44, 46, 48, 49, + 51, 52, 53, 55, 56, 57, 58, 58, 59, 60, 60, 60, 61, 61, 61, 61}; + static const unsigned short table_32[] = {5, 9, 13, 16, 18, 20, 22, 24, + 25, 26, 27, 28, 29, 29, 30, 30}; + unsigned const short *tab = NULL; int k; unsigned short h; WORD32 nbits_tr_slots = 0; diff --git a/decoder/ixheaacd_mps_poly_filt.c b/decoder/ixheaacd_mps_poly_filt.c index 2cc7814..44eac4d 100644 --- a/decoder/ixheaacd_mps_poly_filt.c +++ b/decoder/ixheaacd_mps_poly_filt.c @@ -35,10 +35,10 @@ extern const WORD32 ixheaacd_mps_polyphase_filter_coeff_fix[10 * MAX_NUM_QMF_BANDS_SAC / 2]; -extern WORD32 ixheaacd_mps_pre_re[64]; -extern WORD32 ixheaacd_mps_pre_im[64]; -extern WORD32 ixheaacd_mps_post_re[128]; -extern WORD32 ixheaacd_mps_post_im[128]; +extern const WORD32 ixheaacd_mps_pre_re[64]; +extern const WORD32 ixheaacd_mps_pre_im[64]; +extern const WORD32 ixheaacd_mps_post_re[128]; +extern const WORD32 ixheaacd_mps_post_im[128]; static PLATFORM_INLINE WORD32 ixheaacd_mult32(WORD32 a, WORD32 b) { WORD32 result; @@ -67,8 +67,9 @@ static VOID ixheaacd_float_to_int32(FLOAT32 *in, WORD32 *out, WORD32 q_factor, for (loop = 0; loop < sample; loop++) out[loop] = (WORD32)(in[loop] * temp); } -VOID ixheaacd_mps_synt_pre_twiddle_dec(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, WORD32 resolution) { +VOID ixheaacd_mps_synt_pre_twiddle_dec(WORD32 *ptr_in, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 resolution) { WORD32 tmp, k; for (k = 0; k < 2 * resolution; k += 2) { tmp = ixheaacd_add32_sat(ixheaacd_mult32(ptr_in[k], table_re[k >> 1]), @@ -81,8 +82,9 @@ VOID ixheaacd_mps_synt_pre_twiddle_dec(WORD32 *ptr_in, WORD32 *table_re, } } -VOID ixheaacd_mps_synt_post_twiddle_dec(WORD32 *ptr_in, WORD32 *table_re, - WORD32 *table_im, WORD32 resolution) { +VOID ixheaacd_mps_synt_post_twiddle_dec(WORD32 *ptr_in, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 resolution) { WORD32 tmp, k; for (k = 0; k < 2 * resolution; k += 2) { tmp = ixheaacd_add32_sat(ixheaacd_mult32(ptr_in[k], table_re[k]), @@ -97,8 +99,10 @@ VOID ixheaacd_mps_synt_post_twiddle_dec(WORD32 *ptr_in, WORD32 *table_re, } VOID ixheaacd_mps_synt_post_fft_twiddle_dec(WORD32 resolution, WORD32 *fin_re, - WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state) { + WORD32 *fin_im, + const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state) { WORD32 l; for (l = 0; l < 2 * resolution; l++) { state[2 * resolution - l - 1] = diff --git a/decoder/ixheaacd_mps_pre_mix.c b/decoder/ixheaacd_mps_pre_mix.c index 36426cf..7741325 100644 --- a/decoder/ixheaacd_mps_pre_mix.c +++ b/decoder/ixheaacd_mps_pre_mix.c @@ -58,13 +58,11 @@ extern const WORD32 ixheaacd_c_l_table_Q31[31]; extern const WORD32 ixheaacd_sin_table_Q31[8][31]; extern const WORD32 ixheaacd_cos_table_Q31[8][31]; extern const WORD32 ixheaacd_atan_table_Q28[16][8][31]; -extern WORD32 ixheaacd_ipd_de_quant_table_q28[16]; +extern const WORD32 ixheaacd_ipd_de_quant_table_q28[16]; #define P_PI 3.1415926535897932 #define PI_IN_Q28 843314880 -extern WORD32 ixheaacd_ipd_de_quant_table_q28[16]; - #define P_PI 3.1415926535897932 #define PI_IN_Q28 843314880 diff --git a/decoder/ixheaacd_mps_rom.c b/decoder/ixheaacd_mps_rom.c index 858f7f3..7bfdbb6 100644 --- a/decoder/ixheaacd_mps_rom.c +++ b/decoder/ixheaacd_mps_rom.c @@ -34,7 +34,7 @@ #include "ixheaacd_mps_nlc_dec.h" #include "ixheaacd_mps_huff_tab.h" -ia_huff_cld_nodes_struct ixheaacd_huff_cld_nodes = { +const ia_huff_cld_nodes_struct ixheaacd_huff_cld_nodes = { {{{{-1, 1}, {-2, 2}, {-3, 3}, {-4, 4}, {-5, 5}, {-6, 6}, {-7, 7}, {-8, 8}, {-9, 9}, {-10, 10}, {-11, 11}, {-12, 12}, {-13, 13}, {15, 14}, {-14, 16}, {-15, 17}, {-16, 18}, {-17, 19}, @@ -375,7 +375,7 @@ ia_huff_cld_nodes_struct ixheaacd_huff_cld_nodes = { {-23, 93}, {-7, 94}, {-147, -148}, {-116, -131}, {-25, 95}, {-40, 0}, {0, 0}, {0, 0}, {0, 0}}}}}}; -ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes = { +const ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes = { {{{{-1, 1}, {-2, 2}, {-3, 3}, {-4, 4}, {-5, 5}, {-6, 6}, {-7, -8}}}, {{{-1, 1}, {-2, 2}, {-3, 3}, {-4, 4}, {-5, 5}, {-6, 6}, {-7, -8}}}, {{{-1, 1}, {-2, 2}, {-3, 3}, {-4, 4}, {-5, 5}, {-6, 6}, {-7, -8}}}}, @@ -586,7 +586,7 @@ ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}}}}}; -ia_huff_ipd_nodes_struct ixheaacd_huff_ipd_nodes = { +const ia_huff_ipd_nodes_struct ixheaacd_huff_ipd_nodes = { {{{-1, 1}, {-8, 2}, {-2, 3}, {5, 4}, {-7, 6}, {-3, -5}, {-4, -6}}}, {{{{-1, 1}, {-8, 2}, {-2, 3}, {5, 4}, {-3, -7}, {-6, 6}, {-4, -5}}}, {{{-1, 1}, {-2, 2}, {-8, 3}, {-3, 4}, {-7, 5}, {-4, 6}, {-5, -6}}}, @@ -790,7 +790,7 @@ ia_huff_ipd_nodes_struct ixheaacd_huff_ipd_nodes = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}}}}}; -ia_huff_pt0_nodes_struct ixheaacd_huff_part0_nodes = { +const ia_huff_pt0_nodes_struct ixheaacd_huff_part0_nodes = { {{2, 1}, {4, 3}, {6, 5}, {8, 7}, {10, 9}, {12, 11}, {14, 13}, {-8, 15}, {-9, 16}, {-10, 17}, {-18, 18}, {-17, -19}, {-16, 19}, {-11, -20}, {-15, -21}, {-7, 20}, {-22, 21}, {-12, -14}, @@ -803,7 +803,7 @@ ia_huff_pt0_nodes_struct ixheaacd_huff_part0_nodes = { {-5, 18}, {-4, -19}, {-3, 19}, {-1, 20}, {-2, -20}, {22, 21}, {-21, 23}, {-22, -26}, {-23, 24}, {-24, -25}}}; -ia_huff_pt0_nodes_struct ixheaacd_huff_pilot_nodes = { +const ia_huff_pt0_nodes_struct ixheaacd_huff_pilot_nodes = { {{2, 1}, {4, 3}, {6, 5}, {8, 7}, {10, 9}, {12, 11}, {14, 13}, {-8, 15}, {-9, 16}, {-10, 17}, {-18, 18}, {-17, -19}, {-16, 19}, {-11, -20}, {-15, -21}, {-7, 20}, {-22, 21}, {-12, -14}, @@ -816,10 +816,10 @@ ia_huff_pt0_nodes_struct ixheaacd_huff_pilot_nodes = { {-5, 18}, {-4, -19}, {-3, 19}, {-1, 20}, {-2, -20}, {22, 21}, {-21, 23}, {-22, -26}, {-23, 24}, {-24, -25}}}; -ia_huff_lav_nodes_struct ixheaacd_huff_lav_idx_nodes = { +const ia_huff_lav_nodes_struct ixheaacd_huff_lav_idx_nodes = { {{-1, 1}, {-2, 2}, {-3, -4}}}; -ia_huff_res_nodes_struct ixheaacd_huff_reshape_nodes = { +const ia_huff_res_nodes_struct ixheaacd_huff_reshape_nodes = { {{2, 1}, {4, 3}, {6, 5}, {-33, 7}, {-17, 8}, {-49, 9}, {-34, 10}, {12, 11}, {-18, -35}, {-50, 13}, {15, 14}, {-40, 16}, {-36, 17}, {-19, 18}, {-1, -37}, {-51, 19}, {21, 20}, {-38, -65}, @@ -4762,7 +4762,7 @@ const WORD32 0x0070c8a4, 0xffeff6cb, 0x006b47fa, 0xfff0065d, 0x0065fde5, 0xffefc9b9, 0x006090c3, 0xffed978a, 0x005b5370, 0xffede50e}; -WORD32 ixheaacd_mps_pre_re[64] = { +const WORD32 ixheaacd_mps_pre_re[64] = { 0x01fff621, 0x01ffa72e, 0x01ff0956, 0x01fe1caf, 0x01fce15f, 0x01fb5797, 0x01f97f92, 0x01f7599a, 0x01f4e603, 0x01f2252f, 0x01ef178a, 0x01ebbd8c, 0x01e817ba, 0x01e426a4, 0x01dfeae6, 0x01db6526, 0x01d69617, 0x01d17e77, @@ -4775,7 +4775,7 @@ WORD32 ixheaacd_mps_pre_re[64] = { 0x00764d3e, 0x006a0a7f, 0x005db766, 0x005155d9, 0x0044e7c1, 0x00386f0a, 0x002bed9e, 0x001f656d, 0x0012d864, 0x00064873}; -WORD32 ixheaacd_mps_pre_im[64] = { +const WORD32 ixheaacd_mps_pre_im[64] = { 0x00064874, 0x0012d865, 0x001f656e, 0x002beda0, 0x00386f0b, 0x0044e7c3, 0x005155da, 0x005db767, 0x006a0a80, 0x00764d3f, 0x00827dc0, 0x008e9a22, 0x009aa086, 0x00a68f12, 0x00b263ef, 0x00be1d49, 0x00c9b953, 0x00d53641, @@ -4788,7 +4788,7 @@ WORD32 ixheaacd_mps_pre_im[64] = { 0x01f2252f, 0x01f4e603, 0x01f7599a, 0x01f97f92, 0x01fb5797, 0x01fce15f, 0x01fe1caf, 0x01ff0956, 0x01ffa72f, 0x01fff621}; -WORD32 ixheaacd_mps_post_re[128] = { +const WORD32 ixheaacd_mps_post_re[128] = { 0x7fffffff, 0x7ff62182, 0x7fd8878d, 0x7fa736b3, 0x7f62368e, 0x7f0991c2, 0x7e9d55fa, 0x7e1d93e8, 0x7d8a5f3d, 0x7ce3ceae, 0x7c29fbea, 0x7b5d0399, 0x7a7d0555, 0x798a23ab, 0x7884840c, 0x776c4ed3, 0x7641af33, 0x7504d33b, @@ -4812,7 +4812,7 @@ WORD32 ixheaacd_mps_post_re[128] = { 0x8275a09e, 0x81e26bf8, 0x8162a9ea, 0x80f66e27, 0x809dc95f, 0x8058c93f, 0x8027786a, 0x8009de7a}; -WORD32 ixheaacd_mps_post_im[128] = { +const WORD32 ixheaacd_mps_post_im[128] = { 0x00000000, 0x03242ac0, 0x0647d97f, 0x096a904d, 0x0c8bd363, 0x0fab2732, 0x12c81077, 0x15e2144e, 0x18f8b847, 0x1c0b8277, 0x1f19f989, 0x2223a4d4, 0x25280c6e, 0x2826b93a, 0x2b1f34fe, 0x2e110a76, 0x30fbc563, 0x33def29e, @@ -4836,15 +4836,15 @@ WORD32 ixheaacd_mps_post_im[128] = { 0x18f8b78f, 0x15e21395, 0x12c80fbd, 0x0fab2678, 0x0c8bd2a9, 0x096a8f92, 0x0647d8c3, 0x03242a04}; -WORD32 ixheaacd_ia_mps_hyb_filter_coeff_8[QMF_HYBRID_FILT_ORDER] = { +const WORD32 ixheaacd_ia_mps_hyb_filter_coeff_8[QMF_HYBRID_FILT_ORDER] = { 8011005, 24378459, 48821601, 78019304, 106140545, 126634002, 134217728, 126634002, 106140545, 78019304, 48821601, 24378459, 8011805}; -WORD32 ixheaacd_mps_hyb_filter_coeff_2[QMF_HYBRID_FILT_ORDER] = { +const WORD32 ixheaacd_mps_hyb_filter_coeff_2[QMF_HYBRID_FILT_ORDER] = { 0, 20395592, 0, -78309485, 0, 328528819, 536870911, 328528819, 0, -78309485, 0, 20395592, 0}; -WORD32 ixheaacd_cosine[8][13] = { +const WORD32 ixheaacd_cosine[8][13] = { { -759250175, -410903263, -46, 410903167, 759250111, 992008063, 1073741823, 992008063, 759250111, 410903167, -46, -410903263, @@ -4883,7 +4883,7 @@ WORD32 ixheaacd_cosine[8][13] = { {-759249407, -410902399, 704, 410903679, 759250367, 992008191, 1073741823, 992008191, 759250367, 410903679, 704, -410902399, -759249407}}; -WORD32 ixheaacd_sine[8][13] = { +const WORD32 ixheaacd_sine[8][13] = { { 759250047, 992008063, 1073741823, 992008127, 759250111, 410903231, 0, -410903231, -759250111, -992008127, -1073741823, -992008063, -759250047, @@ -4915,7 +4915,7 @@ WORD32 ixheaacd_sine[8][13] = { {-759250879, -992008447, -1073741823, -992007871, -759249855, -410903039, 0, 410903039, 759249855, 992007871, 1073741823, 992008447, 759250879}}; -WORD32 ixheaacd_cosine2[2][13] = { +const WORD32 ixheaacd_cosine2[2][13] = { { 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, 1073741823, diff --git a/decoder/ixheaacd_mps_temp_process.c b/decoder/ixheaacd_mps_temp_process.c index 43e5781..9348b4c 100644 --- a/decoder/ixheaacd_mps_temp_process.c +++ b/decoder/ixheaacd_mps_temp_process.c @@ -67,13 +67,13 @@ #define max(a, b) ((a > b) ? (a) : (b)) #define min(a, b) ((a < b) ? (a) : (b)) -static FLOAT32 ixheaacd_bp[BP_SIZE] = { +static const FLOAT32 ixheaacd_bp[BP_SIZE] = { 0.0000f, 0.0005f, 0.0092f, 0.0587f, 0.2580f, 0.7392f, 0.9791f, 0.9993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9984f, 0.9908f, 0.9639f, 0.8952f, 0.7711f, 0.6127f, 0.4609f, 0.3391f, 0.2493f, 0.1848f, 0.1387f, 0.1053f}; -static FLOAT32 ixheaacd_gf[BP_SIZE] = { +static const FLOAT32 ixheaacd_gf[BP_SIZE] = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 1e-008f, 8.1e-007f, 3.61e-006f, 8.41e-006f, 1.6e-005f, 2.704e-005f, 3.969e-005f, 5.625e-005f, 7.396e-005f, diff --git a/decoder/ixheaacd_mps_temp_reshape.c b/decoder/ixheaacd_mps_temp_reshape.c index 428fabd..2dfed07 100644 --- a/decoder/ixheaacd_mps_temp_reshape.c +++ b/decoder/ixheaacd_mps_temp_reshape.c @@ -38,7 +38,7 @@ #define GES_ALPHA (0.99637864f) #define GES_BETA (0.9643691f) -extern WORD32 +extern const WORD32 ixheaacd_hybrid_band_71_to_processing_band_20_map[MAX_HYBRID_BANDS_MPS]; VOID ixheaacd_mps_env_init(ia_mps_dec_state_struct *self) { diff --git a/decoder/ixheaacd_rom.c b/decoder/ixheaacd_rom.c index 9467156..eacc741 100644 --- a/decoder/ixheaacd_rom.c +++ b/decoder/ixheaacd_rom.c @@ -224,11 +224,11 @@ const WORD16 ixheaacd_sfb_8_960[] = { const WORD16 ixheaacd_sfb_8_120[] = {4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 60, 72, 88, 108, 120}; -WORD32 ixheaacd_sampling_boundaries[(1 << LEN_SAMP_IDX)] = { +const WORD32 ixheaacd_sampling_boundaries[(1 << LEN_SAMP_IDX)] = { 92017, 75132, 55426, 46009, 37566, 27713, 23004, 18783, 13856, 11502, 9391, 0, 0, 0, 0, 0}; -ia_usac_samp_rate_info ixheaacd_samp_rate_info[(1 << LEN_SAMP_IDX)] = { +const ia_usac_samp_rate_info ixheaacd_samp_rate_info[(1 << LEN_SAMP_IDX)] = { {96000, 41, ixheaacd_sfb_96_1024, 12, ixheaacd_sfb_96_128, 40, ixheaacd_sfb_96_960, 12, ixheaacd_sfb_96_120, 37, ixheaacd_sfb_96_768, 12, @@ -3606,7 +3606,7 @@ const FLOAT64 ixheaacd_power_10_table[28] = { 5.179474679231, 5.623413251903, 6.105402296585, 6.628703161826, 7.196856730012, 7.813707376518, 8.483428982441, 9.210553176895}; -float ixheaacd_dico_lsf_abs_8b_flt[16 * 256] = { +const FLOAT32 ixheaacd_dico_lsf_abs_8b_flt[16 * 256] = { 377.3749f, 688.0079f, 1147.3799f, 1461.0438f, 1786.7794f, 2143.6711f, 2522.1946f, 2889.7402f, 3263.6023f, 3628.4624f, 4005.4351f, 4379.4170f, 4783.9556f, 5157.1753f, 5555.1797f, 5926.6816f, 601.5123f, 1066.8242f, diff --git a/decoder/ixheaacd_sbrdec_lpfuncs.c b/decoder/ixheaacd_sbrdec_lpfuncs.c index 33213ec..4b36a47 100644 --- a/decoder/ixheaacd_sbrdec_lpfuncs.c +++ b/decoder/ixheaacd_sbrdec_lpfuncs.c @@ -73,11 +73,12 @@ #define ALIGN_SIZE64(x) ((((x) + 7) >> 3) << 3) -static FLOAT32 ixheaacd_new_bw_table[4][4] = {{0.00f, 0.60f, 0.90f, 0.98f}, - {0.60f, 0.75f, 0.90f, 0.98f}, - {0.00f, 0.75f, 0.90f, 0.98f}, - {0.00f, 0.75f, 0.90f, 0.98f}}; -static WORD32 ixheaacd_inew_bw_table[4][4] = { +static const FLOAT32 ixheaacd_new_bw_table[4][4] = { + {0.00f, 0.60f, 0.90f, 0.98f}, + {0.60f, 0.75f, 0.90f, 0.98f}, + {0.00f, 0.75f, 0.90f, 0.98f}, + {0.00f, 0.75f, 0.90f, 0.98f}}; +static const WORD32 ixheaacd_inew_bw_table[4][4] = { {0x00000000, 0x4ccccccd, 0x73333333, 0x7d70a3d7}, {0x4ccccccd, 0x60000000, 0x73333333, 0x7d70a3d7}, {0x00000000, 0x60000000, 0x73333333, 0x7d70a3d7}, @@ -110,8 +111,8 @@ WORD32 ixheaacd_derive_lim_band_tbl( WORD16 sub_band_start = f_low_tbl[0]; WORD16 sub_band_end = f_low_tbl[num_low_bnd]; - WORD16 limbnd_per_oct[4] = {(WORD16)0x2000, (WORD16)0x2666, (WORD16)0x4000, - (WORD16)0x6000}; + static const WORD16 limbnd_per_oct[4] = {(WORD16)0x2000, (WORD16)0x2666, + (WORD16)0x4000, (WORD16)0x6000}; if (limiter_bands == 0) { f_lim_tbl[0] = 0; diff --git a/decoder/ixheaacd_spectrum_dec.c b/decoder/ixheaacd_spectrum_dec.c index c827a02..cb16aa1 100644 --- a/decoder/ixheaacd_spectrum_dec.c +++ b/decoder/ixheaacd_spectrum_dec.c @@ -91,8 +91,9 @@ VOID ixheaacd_read_tns_u(ia_sfb_info_struct *ptr_sfb_info, WORD16 *sp, tmp, s_mask, n_mask; ia_tns_filter_struct *tns_filt; ia_tns_info_struct *pstr_tns_info; - static WORD16 sgn_mask[] = {0x2, 0x4, 0x8}; - static WORD16 neg_mask[] = {(WORD16)0xfffc, (WORD16)0xfff8, (WORD16)0xfff0}; + static const WORD16 sgn_mask[] = {0x2, 0x4, 0x8}; + static const WORD16 neg_mask[] = {(WORD16)0xfffc, (WORD16)0xfff8, + (WORD16)0xfff0}; WORD16 n_filt_bits; WORD16 start_band_bits; diff --git a/decoder/x86/ixheaacd_function_selector_x86.c b/decoder/x86/ixheaacd_function_selector_x86.c index e70ab9a..d7aaf09 100644 --- a/decoder/x86/ixheaacd_function_selector_x86.c +++ b/decoder/x86/ixheaacd_function_selector_x86.c @@ -198,11 +198,11 @@ VOID(*ixheaacd_mps_complex_fft_64) WORD32 nlength) = &ixheaacd_mps_complex_fft_64_dec; VOID(*ixheaacd_mps_synt_pre_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_pre_twiddle_dec; VOID(*ixheaacd_mps_synt_post_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_post_twiddle_dec; VOID(*ixheaacd_calc_pre_twid) @@ -214,8 +214,9 @@ VOID(*ixheaacd_calc_post_twid) const WORD32 *cos_ptr, const WORD32 *sin_ptr) = &ixheaacd_calc_post_twid_dec; VOID(*ixheaacd_mps_synt_post_fft_twiddle) -(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; +(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; VOID(*ixheaacd_mps_synt_out_calc) (WORD32 resolution, WORD32 *out, WORD32 *state, diff --git a/decoder/x86_64/ixheaacd_function_selector_x86_64.c b/decoder/x86_64/ixheaacd_function_selector_x86_64.c index e70ab9a..d7aaf09 100644 --- a/decoder/x86_64/ixheaacd_function_selector_x86_64.c +++ b/decoder/x86_64/ixheaacd_function_selector_x86_64.c @@ -198,11 +198,11 @@ VOID(*ixheaacd_mps_complex_fft_64) WORD32 nlength) = &ixheaacd_mps_complex_fft_64_dec; VOID(*ixheaacd_mps_synt_pre_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_pre_twiddle_dec; VOID(*ixheaacd_mps_synt_post_twiddle) -(WORD32 *ptr_in, WORD32 *table_re, WORD32 *table_im, +(WORD32 *ptr_in, const WORD32 *table_re, const WORD32 *table_im, WORD32 resolution) = &ixheaacd_mps_synt_post_twiddle_dec; VOID(*ixheaacd_calc_pre_twid) @@ -214,8 +214,9 @@ VOID(*ixheaacd_calc_post_twid) const WORD32 *cos_ptr, const WORD32 *sin_ptr) = &ixheaacd_calc_post_twid_dec; VOID(*ixheaacd_mps_synt_post_fft_twiddle) -(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, - WORD32 *table_im, WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; +(WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, const WORD32 *table_re, + const WORD32 *table_im, + WORD32 *state) = &ixheaacd_mps_synt_post_fft_twiddle_dec; VOID(*ixheaacd_mps_synt_out_calc) (WORD32 resolution, WORD32 *out, WORD32 *state,