1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

ac3enc: NEON optimised extract_exponents

Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
Mans Rullgard 2011-03-12 22:17:14 +00:00
parent 2310ee4b1c
commit 5f2e6c0fd1
2 changed files with 22 additions and 0 deletions

View File

@ -28,6 +28,7 @@ int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift); void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift); void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len); void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd, void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
int start, int end, int start, int end,
@ -50,5 +51,6 @@ av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon; c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon;
c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon; c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon;
c->float_to_fixed24 = ff_float_to_fixed24_neon; c->float_to_fixed24 = ff_float_to_fixed24_neon;
c->extract_exponents = ff_ac3_extract_exponents_neon;
} }
} }

View File

@ -92,3 +92,23 @@ function ff_float_to_fixed24_neon, export=1
bgt 1b bgt 1b
bx lr bx lr
endfunc endfunc
function ff_ac3_extract_exponents_neon, export=1
vmov.i32 q14, #24
vmov.i32 q15, #8
1:
vld1.32 {q0}, [r1,:128]
vabs.s32 q1, q0
vclz.i32 q3, q1
vsub.i32 q3, q3, q15
vcge.s32 q2, q3, q14
vbit q3, q14, q2
vbic q0, q0, q2
vmovn.i32 d6, q3
vmovn.i16 d6, q3
vst1.32 {q0}, [r1,:128]!
vst1.32 {d6[0]}, [r0,:32]!
subs r2, r2, #4
bgt 1b
bx lr
endfunc