00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdint.h>
00022
00023 #include "libavutil/arm/cpu.h"
00024 #include "libavutil/attributes.h"
00025 #include "libavcodec/ac3dsp.h"
00026 #include "config.h"
00027
00028 void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
00029 int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
00030 void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
00031 void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
00032 void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
00033 void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
00034 void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
00035 const int32_t *coef0,
00036 const int32_t *coef1,
00037 int len);
00038 void ff_ac3_sum_square_butterfly_float_neon(float sum[4],
00039 const float *coef0,
00040 const float *coef1,
00041 int len);
00042
00043 void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
00044 int start, int end,
00045 int snr_offset, int floor,
00046 const uint8_t *bap_tab, uint8_t *bap);
00047
00048 void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
00049
00050 av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
00051 {
00052 int cpu_flags = av_get_cpu_flags();
00053
00054 c->update_bap_counts = ff_ac3_update_bap_counts_arm;
00055
00056 if (have_armv6(cpu_flags)) {
00057 c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6;
00058 }
00059
00060 if (have_neon(cpu_flags)) {
00061 c->ac3_exponent_min = ff_ac3_exponent_min_neon;
00062 c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
00063 c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon;
00064 c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon;
00065 c->float_to_fixed24 = ff_float_to_fixed24_neon;
00066 c->extract_exponents = ff_ac3_extract_exponents_neon;
00067 c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon;
00068 c->sum_square_butterfly_float = ff_ac3_sum_square_butterfly_float_neon;
00069 }
00070 }