From 66d8a651298343cd2e3e6ff07e3eecc73ebb25e5 Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Wed, 9 May 2018 13:29:14 -0700 Subject: [PATCH] libxaac multi-arch cleanup Fold in changes so libxaac will compile appropriately for all target architectures, mostly driven by earlier inclusion of NEON instructions even if target was not NEON-enabled. Bug: 77287124 Test: builds for non-arm Change-Id: Ibcefa14f439e75f48a54955c9abf1a06c418e41e --- Android.bp- => Android.bp | 184 ++++++------- decoder/armv8/ixheaacd_basic_op.h | 99 ------- .../ixheaacd_function_selector_generic.c | 248 ++++++++++++++++++ decoder/{armv7 => }/ixheaacd_basic_op.h | 0 decoder/ixheaacd_qmf_dec.c | 22 +- decoder/x86/ixheaacd_basic_op.h | 28 -- decoder/x86_64/ixheaacd_basic_op.h | 28 -- test/{Android.bp- => Android.bp} | 15 +- 8 files changed, 347 insertions(+), 277 deletions(-) rename Android.bp- => Android.bp (59%) delete mode 100644 decoder/armv8/ixheaacd_basic_op.h create mode 100644 decoder/generic/ixheaacd_function_selector_generic.c rename decoder/{armv7 => }/ixheaacd_basic_op.h (100%) delete mode 100644 decoder/x86/ixheaacd_basic_op.h delete mode 100644 decoder/x86_64/ixheaacd_basic_op.h rename test/{Android.bp- => Android.bp} (65%) diff --git a/Android.bp- b/Android.bp similarity index 59% rename from Android.bp- rename to Android.bp index 1a61a69..48b0ccc 100644 --- a/Android.bp- +++ b/Android.bp @@ -128,6 +128,8 @@ cc_library_static { "decoder/drc_src/impd_drc_selection_process_init.c", "decoder/drc_src/impd_drc_shape_filter.c", "decoder/drc_src/impd_drc_static_payload.c", + + "decoder/ixheaacd_qmf_dec.c", ], sanitize: { @@ -141,101 +143,93 @@ cc_library_static { arch: { arm: { local_include_dirs: [ - "decoder/armv7", - "decoder" ], srcs: [ - "decoder/armv7/ixheaacd_qmf_dec.c", - "decoder/armv7/ixheaacd_fft_armv7.c", - "decoder/armv7/ixheaacd_function_selector_armv7.c", - "decoder/armv7/ixheaacd_overlap_add1.s", - "decoder/armv7/ixheaacd_overlap_add2.s", - "decoder/armv7/ixheaacd_lap1.s", - "decoder/armv7/ixheaacd_dec_DCT2_64_asm.s", - "decoder/armv7/ixheaacd_apply_rot.s", - "decoder/armv7/ixheaacd_autocorr_st2.s", - "decoder/armv7/ixheaacd_auto_corr.s", - "decoder/armv7/ixheaacd_calcmaxspectralline.s", - "decoder/armv7/ixheaacd_conv_ergtoamplitude.s", - "decoder/armv7/ixheaacd_conv_ergtoamplitudelp.s", - "decoder/armv7/ixheaacd_cos_sin_mod.s", - "decoder/armv7/ixheaacd_dct3_32.s", - "decoder/armv7/ixheaacd_decorr_filter2.s", - "decoder/armv7/ixheaacd_enery_calc_per_subband.s", - "decoder/armv7/ixheaacd_expsubbandsamples.s", - "decoder/armv7/ixheaacd_ffr_divide16.s", - "decoder/armv7/ixheaacd_fwd_modulation.s", - "decoder/armv7/ixheaacd_harm_idx_zerotwolp.s", - "decoder/armv7/ixheaacd_imdct_using_fft.s", - "decoder/armv7/ixheaacd_inv_dit_fft_8pt.s", - "decoder/armv7/ixheaacd_no_lap1.s", - "decoder/armv7/ixheaacd_post_radix_compute2.s", - "decoder/armv7/ixheaacd_post_radix_compute4.s", - "decoder/armv7/ixheaacd_post_twiddle.s", - "decoder/armv7/ixheaacd_pre_twiddle_compute.s", - "decoder/armv7/ixheaacd_post_twiddle_overlap.s", - "decoder/armv7/ixheaacd_radix4_bfly.s", - "decoder/armv7/ixheaacd_rescale_subbandsamples.s", - "decoder/armv7/ixheaacd_sbr_imdct_using_fft.s", - "decoder/armv7/ixheaacd_sbr_qmfanal32_winadds.s", - "decoder/armv7/ixheaacd_sbr_qmfsyn64_winadd.s", - "decoder/armv7/ixheaacd_shiftrountine.s", - "decoder/armv7/ixheaacd_shiftrountine_with_round.s", - "decoder/armv7/ixheaacd_tns_ar_filter_fixed_32x16.s", - "decoder/armv7/ixheaacd_tns_parcor2lpc_32x16.s", - "decoder/armv7/ixheaacd_esbr_radix4bfly.s", - "decoder/armv7/ixheaacd_esbr_cos_sin_mod_loop1.s", - "decoder/armv7/ixheaacd_esbr_qmfsyn64_winadd.s", - "decoder/armv7/ixheaacd_complex_ifft_p2.s", - "decoder/armv7/ixheaacd_complex_fft_p2.s", - "decoder/armv7/ixheaacd_esbr_cos_sin_mod_loop2.s", - "decoder/armv7/ixheaacd_shiftrountine_with_round_hq.s", - "decoder/armv7/ixheaacd_mps_complex_fft_64_asm.s", - "decoder/armv7/ixheaacd_esbr_fwd_modulation.s", - "decoder/armv7/ixheaacd_mps_synt_pre_twiddle.s", - "decoder/armv7/ixheaacd_mps_synt_post_twiddle.s", - "decoder/armv7/ixheaacd_calc_pre_twid.s", - "decoder/armv7/ixheaacd_calc_post_twid.s", - "decoder/armv7/ixheaacd_mps_synt_out_calc.s", - "decoder/armv7/ixheaacd_mps_synt_post_fft_twiddle.s", - "decoder/armv7/ixheaacd_sbr_qmfanal32_winadds_eld.s", - "decoder/armv7/ixheaacd_shiftrountine_with_rnd_eld.s", - "decoder/armv7/ixheaacd_eld_decoder_sbr_pre_twiddle.s", - "decoder/armv7/ixheaacd_fft_15_ld.s", - "decoder/armv7/ixheaacd_aac_ld_dec_rearrange.s", - "decoder/armv7/ixheaacd_fft32x32_ld2_armv7.s", - "decoder/armv7/ixheaacd_apply_scale_fac.s" + "decoder/generic/ixheaacd_function_selector_generic.c", ], - - cflags: [ - "-mfloat-abi=softfp", - "-mfpu=neon", - "-mcpu=cortex-a8", - ], - - armv7_a_neon: { - srcs: [ - ], + neon: { cflags: [ ], - }, + + local_include_dirs: [ + "decoder/armv7", + ], + + srcs: [ + "decoder/armv7/ixheaacd_fft_armv7.c", + "decoder/armv7/ixheaacd_function_selector_armv7.c", + "decoder/armv7/ixheaacd_overlap_add1.s", + "decoder/armv7/ixheaacd_overlap_add2.s", + "decoder/armv7/ixheaacd_lap1.s", + "decoder/armv7/ixheaacd_dec_DCT2_64_asm.s", + "decoder/armv7/ixheaacd_apply_rot.s", + "decoder/armv7/ixheaacd_autocorr_st2.s", + "decoder/armv7/ixheaacd_auto_corr.s", + "decoder/armv7/ixheaacd_calcmaxspectralline.s", + "decoder/armv7/ixheaacd_conv_ergtoamplitude.s", + "decoder/armv7/ixheaacd_conv_ergtoamplitudelp.s", + "decoder/armv7/ixheaacd_cos_sin_mod.s", + "decoder/armv7/ixheaacd_dct3_32.s", + "decoder/armv7/ixheaacd_decorr_filter2.s", + "decoder/armv7/ixheaacd_enery_calc_per_subband.s", + "decoder/armv7/ixheaacd_expsubbandsamples.s", + "decoder/armv7/ixheaacd_ffr_divide16.s", + "decoder/armv7/ixheaacd_fwd_modulation.s", + "decoder/armv7/ixheaacd_harm_idx_zerotwolp.s", + "decoder/armv7/ixheaacd_imdct_using_fft.s", + "decoder/armv7/ixheaacd_inv_dit_fft_8pt.s", + "decoder/armv7/ixheaacd_no_lap1.s", + "decoder/armv7/ixheaacd_post_radix_compute2.s", + "decoder/armv7/ixheaacd_post_radix_compute4.s", + "decoder/armv7/ixheaacd_post_twiddle.s", + "decoder/armv7/ixheaacd_pre_twiddle_compute.s", + "decoder/armv7/ixheaacd_post_twiddle_overlap.s", + "decoder/armv7/ixheaacd_radix4_bfly.s", + "decoder/armv7/ixheaacd_rescale_subbandsamples.s", + "decoder/armv7/ixheaacd_sbr_imdct_using_fft.s", + "decoder/armv7/ixheaacd_sbr_qmfanal32_winadds.s", + "decoder/armv7/ixheaacd_sbr_qmfsyn64_winadd.s", + "decoder/armv7/ixheaacd_shiftrountine.s", + "decoder/armv7/ixheaacd_shiftrountine_with_round.s", + "decoder/armv7/ixheaacd_tns_ar_filter_fixed_32x16.s", + "decoder/armv7/ixheaacd_tns_parcor2lpc_32x16.s", + "decoder/armv7/ixheaacd_esbr_radix4bfly.s", + "decoder/armv7/ixheaacd_esbr_cos_sin_mod_loop1.s", + "decoder/armv7/ixheaacd_esbr_qmfsyn64_winadd.s", + "decoder/armv7/ixheaacd_complex_ifft_p2.s", + "decoder/armv7/ixheaacd_complex_fft_p2.s", + "decoder/armv7/ixheaacd_esbr_cos_sin_mod_loop2.s", + "decoder/armv7/ixheaacd_shiftrountine_with_round_hq.s", + "decoder/armv7/ixheaacd_mps_complex_fft_64_asm.s", + "decoder/armv7/ixheaacd_esbr_fwd_modulation.s", + "decoder/armv7/ixheaacd_mps_synt_pre_twiddle.s", + "decoder/armv7/ixheaacd_mps_synt_post_twiddle.s", + "decoder/armv7/ixheaacd_calc_pre_twid.s", + "decoder/armv7/ixheaacd_calc_post_twid.s", + "decoder/armv7/ixheaacd_mps_synt_out_calc.s", + "decoder/armv7/ixheaacd_mps_synt_post_fft_twiddle.s", + "decoder/armv7/ixheaacd_sbr_qmfanal32_winadds_eld.s", + "decoder/armv7/ixheaacd_shiftrountine_with_rnd_eld.s", + "decoder/armv7/ixheaacd_eld_decoder_sbr_pre_twiddle.s", + "decoder/armv7/ixheaacd_fft_15_ld.s", + "decoder/armv7/ixheaacd_aac_ld_dec_rearrange.s", + "decoder/armv7/ixheaacd_fft32x32_ld2_armv7.s", + "decoder/armv7/ixheaacd_apply_scale_fac.s" + ], + } }, arm64: { cflags: [ - "-march=armv8-a", ], + local_include_dirs: [ "decoder/armv8", - "decoder" ], srcs: [ - - "decoder/armv8/ixheaacd_qmf_dec.c", "decoder/armv8/ixheaacd_function_selector_armv8.c", - "decoder/armv8/ixheaacd_calcmaxspectralline.s", "decoder/armv8/ixheaacd_sbr_imdct_using_fft.s", "decoder/armv8/ixheaacd_imdct_using_fft.s", @@ -245,44 +239,40 @@ cc_library_static { "decoder/armv8/ixheaacd_sbr_qmfsyn64_winadd.s", "decoder/armv8/ixheaacd_overlap_add1.s", "decoder/armv8/ixheaacd_overlap_add2.s", - "decoder/armv8/ixheaacd_shiftrountine_with_round_eld.s", - "decoder/armv8/ixheaacd_fft32x32_ld2_armv8.s", - "decoder/armv8/ixheaacd_inv_dit_fft_8pt.s", - "decoder/armv8/ixheaacd_shiftrountine_with_round.s", - "decoder/armv8/ixheaacd_sbr_qmf_analysis32_neon.s", - "decoder/armv8/ixheaacd_postradixcompute4.s", - "decoder/armv8/ixheaacd_apply_scale_factors.s", - "decoder/armv8/ixheaacd_cos_sin_mod_loop1.s", - "decoder/armv8/ixheaacd_cos_sin_mod_loop2.s", + "decoder/armv8/ixheaacd_shiftrountine_with_round_eld.s", + "decoder/armv8/ixheaacd_fft32x32_ld2_armv8.s", + "decoder/armv8/ixheaacd_inv_dit_fft_8pt.s", + "decoder/armv8/ixheaacd_shiftrountine_with_round.s", + "decoder/armv8/ixheaacd_sbr_qmf_analysis32_neon.s", + "decoder/armv8/ixheaacd_postradixcompute4.s", + "decoder/armv8/ixheaacd_apply_scale_factors.s", + "decoder/armv8/ixheaacd_cos_sin_mod_loop1.s", + "decoder/armv8/ixheaacd_cos_sin_mod_loop2.s", ], }, x86: { + cflags: [ + ], + local_include_dirs: [ - "decoder" ], srcs: [ - "decoder/ixheaacd_qmf_dec.c", "decoder/x86/ixheaacd_function_selector_x86.c", ], - - cflags: [ - ], }, x86_64: { + cflags: [ + ], + local_include_dirs: [ - "decoder" ], srcs: [ - "decoder/ixheaacd_qmf_dec.c", "decoder/x86_64/ixheaacd_function_selector_x86_64.c", ], - - cflags: [ - ], }, }, } diff --git a/decoder/armv8/ixheaacd_basic_op.h b/decoder/armv8/ixheaacd_basic_op.h deleted file mode 100644 index c39b2ca..0000000 --- a/decoder/armv8/ixheaacd_basic_op.h +++ /dev/null @@ -1,99 +0,0 @@ -/****************************************************************************** - * * - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ***************************************************************************** - * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore -*/ -#ifndef IXHEAACD_BASIC_OP_H -#define IXHEAACD_BASIC_OP_H - -#define add_d(a, b) ((a) + (b)) -#define sub_d(a, b) ((a) - (b)) -#define ixheaacd_cbrt_calc(a) cbrt(1.0f / a) - -/* -static PLATFORM_INLINE WORD32 mult32x16in32_dual(WORD32 a , WORD16 b) -{ - WORD32 result; - WORD32 msb; - UWORD32 lsb; - - lsb=a&0x0000FFFF ; - msb=(a>>16); - - result=(UWORD32)(lsb*(UWORD32)b); - result= msb*(WORD32)b+(result>>16); - return(result); -} -*/ - -static PLATFORM_INLINE WORD32 msu32x16in32_dual(WORD32 a, WORD16 c1, WORD32 b, - WORD16 c2) { - WORD32 result; - WORD32 temp_result; - UWORD32 a_lsb; - WORD32 a_msb; - UWORD32 b_lsb; - WORD32 b_msb; - - a_lsb = a & 65535; - a_msb = a >> 16; - - b_lsb = b & 65535; - b_msb = b >> 16; - temp_result = ((UWORD32)a_lsb * (UWORD32)c1); - temp_result = temp_result - (WORD32)((UWORD32)b_lsb * (UWORD32)c2); - temp_result = ((WORD32)temp_result) >> 16; - result = temp_result + ((a_msb * (WORD32)c1) - (b_msb * (WORD32)c2)); - - return (result); -} - -static PLATFORM_INLINE WORD32 mac32x16in32_dual(WORD32 a, WORD16 c1, WORD32 b, - WORD16 c2) { - WORD32 result; - WORD32 temp_result; - UWORD32 a_lsb; - WORD32 a_msb; - UWORD32 b_lsb; - WORD32 b_msb; - - a_lsb = a & 65535; - a_msb = a >> 16; - - b_lsb = b & 65535; - b_msb = b >> 16; - temp_result = (UWORD32)a_lsb * (UWORD32)c1; - temp_result = temp_result + (UWORD32)b_lsb * (UWORD32)c2; - temp_result = ((UWORD32)temp_result) >> 16; - result = temp_result + ((a_msb * (WORD32)c1)) + ((b_msb * (WORD32)c2)); - return (result); -} - -/* -static PLATFORM_INLINE WORD64 mac32x32in64_dual(WORD32 a, WORD32 b,WORD64 c, -WORD32 d) -{ - WORD64 result; - WORD64 temp_result; - - temp_result = (WORD64)a * (WORD64)b; - result = c + (temp_result); - return (result); -} -*/ - -#endif diff --git a/decoder/generic/ixheaacd_function_selector_generic.c b/decoder/generic/ixheaacd_function_selector_generic.c new file mode 100644 index 0000000..1501ae2 --- /dev/null +++ b/decoder/generic/ixheaacd_function_selector_generic.c @@ -0,0 +1,248 @@ +/****************************************************************************** + * * + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ***************************************************************************** + * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore +*/ +#include +#include +#include "ixheaacd_sbr_common.h" +#include + +#include "ixheaacd_constants.h" +#include +#include +#include +#include "ixheaacd_basic_ops.h" + +#include +#include "ixheaacd_intrinsics.h" +#include "ixheaacd_common_rom.h" +#include "ixheaacd_sbrdecsettings.h" +#include "ixheaacd_bitbuffer.h" +#include "ixheaacd_defines.h" + +#include "ixheaacd_pns.h" + +#include +#include "ixheaacd_aac_imdct.h" +#include "ixheaacd_pulsedata.h" + +#include "ixheaacd_drc_data_struct.h" + +#include "ixheaacd_lt_predict.h" + +#include "ixheaacd_channelinfo.h" +#include "ixheaacd_drc_dec.h" + +#include "ixheaacd_sbrdecoder.h" +#include "ixheaacd_tns.h" +#include "ixheaacd_sbr_scale.h" +#include "ixheaacd_lpp_tran.h" +#include "ixheaacd_env_extr_part.h" +#include +#include "ixheaacd_block.h" +#include "ixheaacd_hybrid.h" +#include "ixheaacd_ps_dec.h" +#include "ixheaacd_env_extr.h" +#include "ixheaacd_basic_funcs.h" +#include "ixheaacd_env_calc.h" +#include "ixheaacd_interface.h" +#include "ixheaacd_dsp_fft32x32s.h" + +WORD32 (*ixheaacd_fix_div)(WORD32, WORD32) = &ixheaacd_fix_div_dec; + +VOID(*ixheaacd_covariance_matrix_calc) +(WORD32 *, ixheaacd_lpp_trans_cov_matrix *, + WORD32) = &ixheaacd_covariance_matrix_calc_dec; + +VOID(*ixheaacd_covariance_matrix_calc_2) +(ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32, + WORD16) = &ixheaacd_covariance_matrix_calc_2_dec; + +VOID(*ixheaacd_over_lap_add1) +(WORD32 *, WORD32 *, WORD16 *, const WORD16 *, WORD16, WORD16, + WORD16) = &ixheaacd_over_lap_add1_dec; + +VOID(*ixheaacd_over_lap_add2) +(WORD32 *, WORD32 *, WORD32 *, const WORD16 *, WORD16, WORD16, + WORD16) = &ixheaacd_over_lap_add2_dec; + +VOID(*ixheaacd_decorr_filter2) +(ia_ps_dec_struct *ptr_ps_dec, WORD32 *p_buf_left_real, WORD32 *p_buf_left_imag, + WORD32 *p_buf_right_real, WORD32 *p_buf_right_imag, + ia_ps_tables_struct *ps_tables_ptr, + WORD16 *transient_ratio) = &ixheaacd_decorr_filter2_dec; + +VOID(*ixheaacd_decorr_filter1) +(ia_ps_dec_struct *ptr_ps_dec, ia_ps_tables_struct *ps_tables_ptr, + WORD16 *transient_ratio) = &ixheaacd_decorr_filter1_dec; + +WORD32(*ixheaacd_divide16_pos) +(WORD32 op1, WORD32 op2) = &ixheaacd_divide16_pos_dec; + +VOID(*ixheaacd_decorrelation) +(ia_ps_dec_struct *ptr_ps_dec, WORD32 *p_buf_left_real, WORD32 *p_buf_left_imag, + WORD32 *p_buf_right_real, WORD32 *p_buf_right_imag, + ia_ps_tables_struct *ps_tables_ptr) = &ixheaacd_decorrelation_dec; + +VOID(*ixheaacd_apply_rot) +(ia_ps_dec_struct *ptr_ps_dec, WORD32 *p_qmf_left_re, WORD32 *p_qmf_left_im, + WORD32 *p_qmf_right_re, WORD32 *p_qmf_right_im, + ia_sbr_tables_struct *sbr_tables_ptr, + const WORD16 *ptr_res) = &ixheaacd_apply_rot_dec; + +VOID(*ixheaacd_conv_ergtoamplitudelp) +(WORD32 bands, WORD16 noise_e, WORD16 *nrg_sine, WORD16 *nrg_gain, + WORD16 *noise_level_mant, + WORD16 *sqrt_table) = &ixheaacd_conv_ergtoamplitudelp_dec; + +VOID(*ixheaacd_conv_ergtoamplitude) +(WORD32 bands, WORD16 noise_e, WORD16 *nrg_sine, WORD16 *nrg_gain, + WORD16 *noise_level_mant, + WORD16 *sqrt_table) = &ixheaacd_conv_ergtoamplitude_dec; + +VOID(*ixheaacd_adjust_scale) +(WORD32 **re, WORD32 **im, WORD32 sub_band_start, WORD32 sub_band_end, + WORD32 start_pos, WORD32 next_pos, WORD32 shift, + FLAG low_pow_flag) = &ixheaacd_adjust_scale_dec; + +WORD16(*ixheaacd_ixheaacd_expsubbandsamples) +(WORD32 **re, WORD32 **im, WORD32 sub_band_start, WORD32 sub_band_end, + WORD32 start_pos, WORD32 next_pos, + FLAG low_pow_flag) = &ixheaacd_expsubbandsamples_dec; + +VOID(*ixheaacd_enery_calc_per_subband) +(WORD32 start_pos, WORD32 next_pos, WORD32 sub_band_start, WORD32 sub_band_end, + WORD32 frame_exp, WORD16 *nrg_est_mant, FLAG low_pow_flag, + ia_sbr_tables_struct *ptr_sbr_tables, + WORD32 *ptr_qmf_matrix) = &ixheaacd_enery_calc_per_subband_dec; + +VOID(*ixheaacd_harm_idx_zerotwolp) +(WORD32 *ptr_real_buf, WORD16 *ptr_gain_buf, WORD32 scale_change, + WORD16 *ptr_sine_level_buf, const WORD32 *ptr_rand_ph, + WORD16 *noise_level_mant, WORD32 num_sub_bands, FLAG noise_absc_flag, + WORD32 harm_index) = &ixheaacd_harm_idx_zerotwolp_dec; + +VOID(*ixheaacd_tns_ar_filter_fixed) +(WORD32 *spectrum, WORD32 size, WORD32 inc, WORD32 *lpc, WORD32 order, + WORD32 shift_value, WORD scale_spec) = &ixheaacd_tns_ar_filter_fixed_dec; + +VOID(*ixheaacd_tns_ar_filter) +(WORD32 *spectrum, WORD32 size, WORD32 inc, WORD16 *lpc, WORD32 order, + WORD32 shift_value, WORD scale_spec, + WORD32 *ptr_filter_state) = &ixheaacd_tns_ar_filter_dec; + +VOID(*ixheaacd_tns_parcor_lpc_convert) +(WORD16 *parcor, WORD16 *lpc, WORD16 *scale, + WORD order) = &ixheaacd_tns_parcor_lpc_convert_dec; + +WORD32(*ixheaacd_calc_max_spectral_line) +(WORD32 *ptr_tmp, WORD32 size) = &ixheaacd_calc_max_spectral_line_dec; + +VOID(*ixheaacd_post_twiddle) +(WORD32 out_ptr[], WORD32 spec_data[], + ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, + WORD npoints) = &ixheaacd_post_twiddle_dec; + +VOID(*ixheaacd_post_twid_overlap_add) +(WORD16 pcm_out[], WORD32 spec_data[], + ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints, + WORD32 *ptr_overlap_buf, WORD16 q_shift, const WORD16 *window, + WORD16 ch_fac) = &ixheaacd_post_twid_overlap_add_dec; + +VOID(*ixheaacd_neg_shift_spec) +(WORD32 *coef, WORD16 *out, WORD16 q_shift, + WORD16 ch_fac) = &ixheaacd_neg_shift_spec_dec; + +VOID(*ixheaacd_spec_to_overlapbuf) +(WORD32 *ptr_overlap_buf, WORD32 *ptr_spec_coeff, WORD32 q_shift, + WORD32 size) = &ixheaacd_spec_to_overlapbuf_dec; + +VOID(*ixheaacd_overlap_buf_out) +(WORD16 *out_samples, WORD32 *ptr_overlap_buf, WORD32 size, + const WORD16 ch_fac) = &ixheaacd_overlap_buf_out_dec; + +VOID(*ixheaacd_overlap_out_copy) +(WORD16 *out_samples, WORD32 *ptr_overlap_buf, WORD32 *ptr_overlap_buf1, + const WORD16 ch_fac) = &ixheaacd_overlap_out_copy_dec; + +VOID(*ixheaacd_pretwiddle_compute) +(WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr, + ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4, + WORD32 neg_expo) = &ixheaacd_pretwiddle_compute_dec; + +VOID(*ixheaacd_imdct_using_fft) +(ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 npoints, + WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_imdct_using_fft_dec; + +VOID(*ixheaacd_complex_fft_p2) +(WORD32 *xr, WORD32 *xi, WORD32 nlength, WORD32 fft_mode, + WORD32 *preshift) = &ixheaacd_complex_fft_p2_dec; + +VOID(*ixheaacd_mps_complex_fft_64) +(WORD32 *ptr_x, WORD32 *fin_re, WORD32 *fin_im, + WORD32 nlength) = &ixheaacd_mps_complex_fft_64_dec; + +VOID(*ixheaacd_mps_synt_pre_twiddle) +(WORD32 *ptr_in, WORD32 *table_re, 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 resolution) = &ixheaacd_mps_synt_post_twiddle_dec; + +VOID(*ixheaacd_calc_pre_twid) +(WORD32 *ptr_x, WORD32 *r_ptr, WORD32 *i_ptr, WORD32 nlength, + const WORD32 *cos_ptr, const WORD32 *sin_ptr) = &ixheaacd_calc_pre_twid_dec; + +VOID(*ixheaacd_calc_post_twid) +(WORD32 *ptr_x, WORD32 *r_ptr, WORD32 *i_ptr, WORD32 nlength, + 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; + +VOID(*ixheaacd_mps_synt_out_calc) +(WORD32 resolution, WORD32 *out, WORD32 *state, + const WORD32 *filter_coeff) = &ixheaacd_mps_synt_out_calc_dec; + +VOID(*ixheaacd_fft_15_ld) +(WORD32 *inp, WORD32 *op, WORD32 *fft3out, + UWORD8 *re_arr_tab_sml_240_ptr) = &ixheaacd_fft_15_ld_dec; + +VOID(*ixheaacd_aac_ld_dec_rearrange) +(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2, + UWORD8 *re_arr_tab) = &ixheaacd_rearrange_dec; + +VOID (*ixheaacd_fft32x32_ld) +(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints, + WORD32 *ptr_x, WORD32 *ptr_y) = ixheaacd_fft32x32_ld_dec; + +VOID (*ixheaacd_fft32x32_ld2) +(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints, + WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld_dec; + +WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_dec; + +VOID (*ixheaacd_inv_dit_fft_8pt) +(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_dec; + +VOID (*ixheaacd_scale_factor_process) +(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width, + WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type, + WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_dec; \ No newline at end of file diff --git a/decoder/armv7/ixheaacd_basic_op.h b/decoder/ixheaacd_basic_op.h similarity index 100% rename from decoder/armv7/ixheaacd_basic_op.h rename to decoder/ixheaacd_basic_op.h diff --git a/decoder/ixheaacd_qmf_dec.c b/decoder/ixheaacd_qmf_dec.c index 582278d..fbfa4b2 100644 --- a/decoder/ixheaacd_qmf_dec.c +++ b/decoder/ixheaacd_qmf_dec.c @@ -325,7 +325,6 @@ VOID ixheaacd_posttwdct2(WORD32 *inp, WORD16 *out_fwd, WORD16 twid_re, twid_im; const WORD16 *twidle_fwd; WORD16 re1, im1, im2; - WORD32 dummy1 = 0, dummy2 = 0x80000000; out_rev = out_fwd + DCT2_LEN - 1; out_rev2 = out_fwd - 1; @@ -464,17 +463,6 @@ static PLATFORM_INLINE VOID ixheaacd_fftposttw_32( return; } -static PLATFORM_INLINE WORD32 mult32x16in32t(WORD32 a, WORD16 b) { - WORD32 result; - WORD64 temp_result; - - temp_result = (WORD64)a * (WORD64)b; - temp_result += 32768; - - result = (WORD32)(temp_result >> 16); - - return (result); -} static PLATFORM_INLINE VOID ixheaacd_posttwdct2_32(WORD32 *inp, WORD16 *out_fwd, @@ -1398,7 +1386,7 @@ VOID ixheaacd_esbr_radix4bfly(const WORD32 *w, WORD32 *x, WORD32 index1, VOID ixheaacd_esbr_postradixcompute2(WORD32 *ptr_y, WORD32 *ptr_x, const WORD32 *pdig_rev_tbl, WORD32 npoints) { - WORD32 i, j = 0, k; + WORD32 i, k; WORD32 h2; WORD32 x_0, x_1, x_2, x_3; WORD32 x_4, x_5, x_6, x_7; @@ -1485,7 +1473,7 @@ VOID ixheaacd_esbr_postradixcompute2(WORD32 *ptr_y, WORD32 *ptr_x, VOID ixheaacd_esbr_postradixcompute4(WORD32 *ptr_y, WORD32 *ptr_x, const WORD32 *p_dig_rev_tbl, WORD32 npoints) { - WORD32 i, j = 0, k; + WORD32 i, k; WORD32 h2; WORD32 xh0_0, xh1_0, xl0_0, xl1_0; WORD32 xh0_1, xh1_1, xl0_1, xl1_1; @@ -2397,7 +2385,7 @@ VOID ixheaacd_cplx_synt_qmffilt( t_qmf_imag = qmf_imag[i]; if (active) { - if ((i == ptr_ps_dec->border_position[env])) { + if (i == ptr_ps_dec->border_position[env]) { ixheaacd_init_rot_env(ptr_ps_dec, (WORD16)env, qmf_bank->usb, sbr_tables_ptr, pstr_common_tables->trig_data); env++; @@ -2611,7 +2599,7 @@ VOID ixheaacd_radix4bfly(const WORD16 *w, WORD32 *x, WORD32 index1, VOID ixheaacd_postradixcompute4(WORD32 *ptr_y, WORD32 *ptr_x, const WORD32 *p_dig_rev_tbl, WORD32 npoints) { - WORD32 i, j = 0, k; + WORD32 i, k; WORD32 h2; WORD32 xh0_0, xh1_0, xl0_0, xl1_0; WORD32 xh0_1, xh1_1, xl0_1, xl1_1; @@ -2718,7 +2706,7 @@ VOID ixheaacd_postradixcompute4(WORD32 *ptr_y, WORD32 *ptr_x, VOID ixheaacd_postradixcompute2(WORD32 *ptr_y, WORD32 *ptr_x, const WORD32 *pdig_rev_tbl, WORD32 npoints) { - WORD32 i, j = 0, k; + WORD32 i, k; WORD32 h2; WORD32 x_0, x_1, x_2, x_3; WORD32 x_4, x_5, x_6, x_7; diff --git a/decoder/x86/ixheaacd_basic_op.h b/decoder/x86/ixheaacd_basic_op.h deleted file mode 100644 index 0c3873d..0000000 --- a/decoder/x86/ixheaacd_basic_op.h +++ /dev/null @@ -1,28 +0,0 @@ -/****************************************************************************** - * * - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ***************************************************************************** - * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore -*/ -#ifndef IXHEAACD_BASIC_OP_H -#define IXHEAACD_BASIC_OP_H - -#define add_d(a, b) ((a) + (b)) -#define sub_d(a, b) ((a) - (b)) - -#define ixheaacd_cbrt_calc(a) cbrt(1.0f / a) - -#endif diff --git a/decoder/x86_64/ixheaacd_basic_op.h b/decoder/x86_64/ixheaacd_basic_op.h deleted file mode 100644 index 0c3873d..0000000 --- a/decoder/x86_64/ixheaacd_basic_op.h +++ /dev/null @@ -1,28 +0,0 @@ -/****************************************************************************** - * * - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ***************************************************************************** - * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore -*/ -#ifndef IXHEAACD_BASIC_OP_H -#define IXHEAACD_BASIC_OP_H - -#define add_d(a, b) ((a) + (b)) -#define sub_d(a, b) ((a) - (b)) - -#define ixheaacd_cbrt_calc(a) cbrt(1.0f / a) - -#endif diff --git a/test/Android.bp- b/test/Android.bp similarity index 65% rename from test/Android.bp- rename to test/Android.bp index 358c88f..18f17ce 100644 --- a/test/Android.bp- +++ b/test/Android.bp @@ -2,28 +2,27 @@ cc_test { name: "xaacdec", vendor_available: true, - vndk: { - enabled: true, - }, - gtest: false, cflags: [ "-O3", - "-fPIC", - "-mfloat-abi=softfp", "-UARM_PROFILE_HW", "-UARM_PROFILE_BOARD", "-DECLIPSE", "-DDRC_ENABLE", "-DMULTICHANNEL_ENABLE" ], - + include_dirs: [ "external/libxaac/decoder/", ], - srcs: ["ixheaacd_error.c", "ixheaacd_fileifc.c", "ixheaacd_main.c", "ixheaacd_metadata_read.c" ], + srcs: [ + "ixheaacd_error.c", + "ixheaacd_fileifc.c", + "ixheaacd_main.c", + "ixheaacd_metadata_read.c" + ], static_libs: ["libxaacdec"],