diff options
author | Geoff Hill <geoff@geoffhill.org> | 2024-04-06 07:26:01 -0700 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2024-04-08 13:36:40 +0300 |
commit | 69cb34f8859ed62fd1c46d3612912a334542fe28 (patch) | |
tree | 18c68304f42d58cd17d400c7ce94326ef1d958d9 /libavcodec | |
parent | 6f6bd10531e439de67d1354c5fc6f78cc031c66b (diff) | |
download | ffmpeg-69cb34f8859ed62fd1c46d3612912a334542fe28.tar.gz |
avcodec/ac3: Implement ac3_extract_exponents for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aarch64/ac3dsp_init_aarch64.c | 2 | ||||
-rw-r--r-- | libavcodec/aarch64/ac3dsp_neon.S | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/aarch64/ac3dsp_init_aarch64.c b/libavcodec/aarch64/ac3dsp_init_aarch64.c index 8874b41393..1bdc215b51 100644 --- a/libavcodec/aarch64/ac3dsp_init_aarch64.c +++ b/libavcodec/aarch64/ac3dsp_init_aarch64.c @@ -26,6 +26,7 @@ #include "config.h" void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs); +void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs); void ff_float_to_fixed24_neon(int32_t *dst, const float *src, size_t len); av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) @@ -34,5 +35,6 @@ av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) if (!have_neon(cpu_flags)) return; c->ac3_exponent_min = ff_ac3_exponent_min_neon; + c->extract_exponents = ff_ac3_extract_exponents_neon; c->float_to_fixed24 = ff_float_to_fixed24_neon; } diff --git a/libavcodec/aarch64/ac3dsp_neon.S b/libavcodec/aarch64/ac3dsp_neon.S index f916c32538..c350c1f173 100644 --- a/libavcodec/aarch64/ac3dsp_neon.S +++ b/libavcodec/aarch64/ac3dsp_neon.S @@ -37,6 +37,20 @@ function ff_ac3_exponent_min_neon, export=1 3: ret endfunc +function ff_ac3_extract_exponents_neon, export=1 + movi v1.4s, #8 +1: ld1 {v0.4s}, [x1], #16 + abs v0.4s, v0.4s + clz v0.4s, v0.4s + sub v0.4s, v0.4s, v1.4s + xtn v0.4h, v0.4s + xtn v0.8b, v0.8h + st1 {v0.s}[0], [x0], #4 + subs w2, w2, #4 + b.gt 1b + ret +endfunc + function ff_float_to_fixed24_neon, export=1 1: ld1 {v0.4s, v1.4s}, [x1], #32 fcvtzs v0.4s, v0.4s, #24 |