History

swscale/aarch64/range_convert: update neon range_convert functions to new API

aarch64 A55: chrRangeFromJpeg8_1920_c: 28835.2 (1.00x) chrRangeFromJpeg8_1920_neon: 5313.9 (5.43x) 5308.4 (5.43x) chrRangeToJpeg8_1920_c: 23074.7 (1.00x) chrRangeToJpeg8_1920_neon: 5551.3 (4.16x) 5549.2 (4.16x) lumRangeFromJpeg8_1920_c: 15389.7 (1.00x) lumRangeFromJpeg8_1920_neon: 3152.3 (4.88x) 3147.7 (4.89x) lumRangeToJpeg8_1920_c: 19227.8 (1.00x) lumRangeToJpeg8_1920_neon: 3628.7 (5.30x) 3630.2 (5.30x) aarch64 A76: chrRangeFromJpeg8_1920_c: 6324.4 (1.00x) chrRangeFromJpeg8_1920_neon: 2344.5 (2.70x) 2304.2 (2.74x) chrRangeToJpeg8_1920_c: 9656.0 (1.00x) chrRangeToJpeg8_1920_neon: 2824.2 (3.42x) 2794.2 (3.46x) lumRangeFromJpeg8_1920_c: 4422.0 (1.00x) lumRangeFromJpeg8_1920_neon: 1104.5 (4.00x) 1106.2 (4.00x) lumRangeToJpeg8_1920_c: 5949.1 (1.00x) lumRangeToJpeg8_1920_neon: 1329.8 (4.47x) 1328.2 (4.48x)

Ramiro Polla committed 2 years ago

Commit 6fe4a4f1 parent be108eb2 files · +39 −37Browse files

Unified · Split

2 files
  1. libswscale/aarch64/range_convert_neon.S +31 −28
  2. libswscale/aarch64/swscale.c +8 −9
libswscale/aarch64/range_convert_neon.S+31−28
@@ -20,12 +20,13 @@ · 19 unmodified lines
20 20
21#include "libavutil/aarch64/asm.S"21#include "libavutil/aarch64/asm.S"
22 22
23.macro lumConvertRange name, fromto, mult, offset, shift23.macro lumConvertRange fromto
24function ff_\name, export=124function ff_lumRange\fromto\()Jpeg_neon, export=1
25 mov w3, #\mult25// x0 int16_t *dst
26 dup v25.4s, w326// w1 int width
27 movz w3, #(\offset & 0xffff)27// w2 uint32_t coeff
28 movk w3, #((\offset >> 16) & 0xffff), lsl #1628// x3 int64_t offset
29 dup v25.4s, w2
29 dup v26.4s, w330 dup v26.4s, w3
301:311:
31 ld1 {v0.8h}, [x0]32 ld1 {v0.8h}, [x0]
@@ -36,11 +37,11 @@ function ff_\name, export=1 · 4 unmodified lines
36 mla v16.4s, v20.4s, v25.4s37 mla v16.4s, v20.4s, v25.4s
37 mla v18.4s, v22.4s, v25.4s38 mla v18.4s, v22.4s, v25.4s
38.ifc \fromto, To39.ifc \fromto, To
39 sqshrn v0.4h, v16.4s, #\shift40 sqshrn v0.4h, v16.4s, 14
40 sqshrn2 v0.8h, v18.4s, #\shift41 sqshrn2 v0.8h, v18.4s, 14
41.else42.else
42 shrn v0.4h, v16.4s, #\shift43 shrn v0.4h, v16.4s, 14
43 shrn2 v0.8h, v18.4s, #\shift44 shrn2 v0.8h, v18.4s, 14
44.endif45.endif
45 subs w1, w1, #846 subs w1, w1, #8
46 st1 {v0.8h}, [x0], #1647 st1 {v0.8h}, [x0], #16
@@ -49,13 +50,15 @@ function ff_\name, export=1 · 2 unmodified lines
49endfunc50endfunc
50.endm51.endm
51 52
52.macro chrConvertRange name, fromto, mult, offset, shift53.macro chrConvertRange fromto
53function ff_\name, export=154function ff_chrRange\fromto\()Jpeg_neon, export=1
54 mov w3, #\mult55// x0 int16_t *dstU
56// x1 int16_t *dstV
57// w2 int width
58// w3 uint32_t coeff
59// x4 int64_t offset
55 dup v25.4s, w360 dup v25.4s, w3
56 movz w3, #(\offset & 0xffff)61 dup v26.4s, w4
57 movk w3, #((\offset >> 16) & 0xffff), lsl #16
58 dup v26.4s, w3
591:621:
60 ld1 {v0.8h}, [x0]63 ld1 {v0.8h}, [x0]
61 ld1 {v1.8h}, [x1]64 ld1 {v1.8h}, [x1]
@@ -72,15 +75,15 @@ function ff_\name, export=1 · 10 unmodified lines
72 mla v18.4s, v22.4s, v25.4s75 mla v18.4s, v22.4s, v25.4s
73 mla v19.4s, v23.4s, v25.4s76 mla v19.4s, v23.4s, v25.4s
74.ifc \fromto, To77.ifc \fromto, To
75 sqshrn v0.4h, v16.4s, #\shift78 sqshrn v0.4h, v16.4s, 14
76 sqshrn v1.4h, v17.4s, #\shift79 sqshrn v1.4h, v17.4s, 14
77 sqshrn2 v0.8h, v18.4s, #\shift80 sqshrn2 v0.8h, v18.4s, 14
78 sqshrn2 v1.8h, v19.4s, #\shift81 sqshrn2 v1.8h, v19.4s, 14
79.else82.else
80 shrn v0.4h, v16.4s, #\shift83 shrn v0.4h, v16.4s, 14
81 shrn v1.4h, v17.4s, #\shift84 shrn v1.4h, v17.4s, 14
82 shrn2 v0.8h, v18.4s, #\shift85 shrn2 v0.8h, v18.4s, 14
83 shrn2 v1.8h, v19.4s, #\shift86 shrn2 v1.8h, v19.4s, 14
84.endif87.endif
85 subs w2, w2, #888 subs w2, w2, #8
86 st1 {v0.8h}, [x0], #1689 st1 {v0.8h}, [x0], #16
@@ -90,7 +93,7 @@ function ff_\name, export=1 · 3 unmodified lines
90endfunc93endfunc
91.endm94.endm
92 95
93lumConvertRange lumRangeToJpeg_neon, To, 19077, -39057361, 1496lumConvertRange To
94chrConvertRange chrRangeToJpeg_neon, To, 4663, -9289992, 1297chrConvertRange To
95lumConvertRange lumRangeFromJpeg_neon, From, 14071, 33561947, 1498lumConvertRange From
96chrConvertRange chrRangeFromJpeg_neon, From, 1799, 4081085, 1199chrConvertRange From
libswscale/aarch64/swscale.c+8−9
@@ -218,17 +218,17 @@ NEON_INPUT(bgra32); · 217 unmodified lines
218NEON_INPUT(rgb24);218NEON_INPUT(rgb24);
219NEON_INPUT(rgba32);219NEON_INPUT(rgba32);
220 220
221void ff_lumRangeFromJpeg_neon(int16_t *dst, int width);221void ff_lumRangeFromJpeg_neon(int16_t *dst, int width,
222void ff_chrRangeFromJpeg_neon(int16_t *dstU, int16_t *dstV, int width);222 uint32_t coeff, int64_t offset);
223void ff_lumRangeToJpeg_neon(int16_t *dst, int width);223void ff_chrRangeFromJpeg_neon(int16_t *dstU, int16_t *dstV, int width,
224void ff_chrRangeToJpeg_neon(int16_t *dstU, int16_t *dstV, int width);224 uint32_t coeff, int64_t offset);
225void ff_lumRangeToJpeg_neon(int16_t *dst, int width,
226 uint32_t coeff, int64_t offset);
227void ff_chrRangeToJpeg_neon(int16_t *dstU, int16_t *dstV, int width,
228 uint32_t coeff, int64_t offset);
225 229
226av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)230av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)
227{231{
228 /* This code is currently disabled because of changes in the base
229 * implementation of these functions. This code should be enabled
230 * again once those changes are ported to this architecture. */
231#if 0
232 int cpu_flags = av_get_cpu_flags();232 int cpu_flags = av_get_cpu_flags();
233 233
234 if (have_neon(cpu_flags)) {234 if (have_neon(cpu_flags)) {
@@ -242,7 +242,6 @@ av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c) · 7 unmodified lines
242 }242 }
243 }243 }
244 }244 }
245#endif
246}245}
247 246
248av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)247av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)

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