History

avcodec/ac3: Implement sum_square_butterfly_int32 for aarch64 NEON

Geoff Hill committed 2 years ago

Commit 42e88f11 parent 69cb34f3 files · +55 −0Browse files

Showing the changes to libavcodec (2 of 3 files). Show all

Unified · Split

2 files
  1. libavcodec/aarch64/ac3dsp_init_aarch64.c +5 −0
  2. libavcodec/aarch64/ac3dsp_neon.S +23 −0
libavcodec/aarch64/ac3dsp_init_aarch64.c+5−0
@@ -28,6 +28,10 @@ · 27 unmodified lines
2828 void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
2929 void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
3030 void ff_float_to_fixed24_neon(int32_t *dst, const float *src, size_t len);
31+void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
32+ const int32_t *coef0,
33+ const int32_t *coef1,
34+ int len);
3135
3236 av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c)
3337 {
@@ -37,4 +41,5 @@ av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) · 3 unmodified lines
3741 c->ac3_exponent_min = ff_ac3_exponent_min_neon;
3842 c->extract_exponents = ff_ac3_extract_exponents_neon;
3943 c->float_to_fixed24 = ff_float_to_fixed24_neon;
44+ c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon;
4045 }
libavcodec/aarch64/ac3dsp_neon.S+23−0
@@ -64,3 +64,26 @@ function ff_float_to_fixed24_neon, export=1 · 63 unmodified lines
6464 b.ne 1b
6565 ret
6666 endfunc
67+
68+function ff_ac3_sum_square_butterfly_int32_neon, export=1
69+ movi v0.2d, #0
70+ movi v1.2d, #0
71+ movi v2.2d, #0
72+ movi v3.2d, #0
73+1: ld1 {v4.2s}, [x1], #8
74+ ld1 {v5.2s}, [x2], #8
75+ add v6.2s, v4.2s, v5.2s
76+ sub v7.2s, v4.2s, v5.2s
77+ smlal v0.2d, v4.2s, v4.2s
78+ smlal v1.2d, v5.2s, v5.2s
79+ smlal v2.2d, v6.2s, v6.2s
80+ smlal v3.2d, v7.2s, v7.2s
81+ subs w3, w3, #2
82+ b.gt 1b
83+ addp d0, v0.2d
84+ addp d1, v1.2d
85+ addp d2, v2.2d
86+ addp d3, v3.2d
87+ st1 {v0.1d-v3.1d}, [x0]
88+ ret
89+endfunc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t