History

aarch64/vvc: Use faster clip operation

Replace sqxtn+smin+smax by sqxtun+umin.

Zhao Zhili committed 1 year ago

Commit 91436631 parent bfed5f61 file · +18 −23Browse files

Unified · Split

libavcodec/aarch64/vvc/inter.S+18−23
@@ -36,13 +36,13 @@ · 35 unmodified lines
36.ifc \type, avg36.ifc \type, avg
37 saddl v4.4s, v0.4h, v2.4h37 saddl v4.4s, v0.4h, v2.4h
38 add v4.4s, v4.4s, v16.4s38 add v4.4s, v4.4s, v16.4s
39 sqshrn v4.4h, v4.4s, #(15 - \bit_depth)39 sqshrun v4.4h, v4.4s, #(15 - \bit_depth)
40.else40.else
41 mov v4.16b, v16.16b41 mov v4.16b, v16.16b
42 smlal v4.4s, v0.4h, v19.4h42 smlal v4.4s, v0.4h, v19.4h
43 smlal v4.4s, v2.4h, v20.4h43 smlal v4.4s, v2.4h, v20.4h
44 sqshl v4.4s, v4.4s, v22.4s44 sqshl v4.4s, v4.4s, v22.4s
45 sqxtn v4.4h, v4.4s45 sqxtun v4.4h, v4.4s
46.endif46.endif
47 47
48.if \bit_depth == 848.if \bit_depth == 8
@@ -54,8 +54,7 @@ · 5 unmodified lines
54.endif54.endif
55 55
56.else // bit_depth > 856.else // bit_depth > 8
57 smin v4.4h, v4.4h, v17.4h57 umin v4.4h, v4.4h, v17.4h
58 smax v4.4h, v4.4h, v18.4h
59.if \tap == 258.if \tap == 2
60 str s4, [dst]59 str s4, [dst]
61.else60.else
@@ -95,7 +94,6 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 33 unmodified lines
95 .if \bit_depth >= 1094 .if \bit_depth >= 10
96 // clip pixel95 // clip pixel
97 mov w6, #((1 << \bit_depth) - 1)96 mov w6, #((1 << \bit_depth) - 1)
98 movi v18.8h, #0
99 dup v17.8h, w697 dup v17.8h, w6
100.endif98.endif
101 99
@@ -121,8 +119,8 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 19 unmodified lines
121 saddl2 v5.4s, v0.8h, v2.8h119 saddl2 v5.4s, v0.8h, v2.8h
122 add v4.4s, v4.4s, v16.4s120 add v4.4s, v4.4s, v16.4s
123 add v5.4s, v5.4s, v16.4s121 add v5.4s, v5.4s, v16.4s
124 sqshrn v4.4h, v4.4s, #(15 - \bit_depth)122 sqshrun v4.4h, v4.4s, #(15 - \bit_depth)
125 sqshrn2 v4.8h, v5.4s, #(15 - \bit_depth)123 sqshrun2 v4.8h, v5.4s, #(15 - \bit_depth)
126.else124.else
127 mov v4.16b, v16.16b125 mov v4.16b, v16.16b
128 mov v5.16b, v16.16b126 mov v5.16b, v16.16b
@@ -132,16 +130,15 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 3 unmodified lines
132 smlal2 v5.4s, v2.8h, v20.8h130 smlal2 v5.4s, v2.8h, v20.8h
133 sqshl v4.4s, v4.4s, v22.4s131 sqshl v4.4s, v4.4s, v22.4s
134 sqshl v5.4s, v5.4s, v22.4s132 sqshl v5.4s, v5.4s, v22.4s
135 sqxtn v4.4h, v4.4s133 sqxtun v4.4h, v4.4s
136 sqxtn2 v4.8h, v5.4s134 sqxtun2 v4.8h, v5.4s
137.endif135.endif
138 subs height, height, #1136 subs height, height, #1
139.if \bit_depth == 8137.if \bit_depth == 8
140 sqxtun v4.8b, v4.8h138 sqxtun v4.8b, v4.8h
141 st1 {v4.8b}, [dst], dst_stride139 st1 {v4.8b}, [dst], dst_stride
142.else140.else
143 smin v4.8h, v4.8h, v17.8h141 umin v4.8h, v4.8h, v17.8h
144 smax v4.8h, v4.8h, v18.8h
145 st1 {v4.8h}, [dst], dst_stride142 st1 {v4.8h}, [dst], dst_stride
146.endif143.endif
147 b.ne 8b144 b.ne 8b
@@ -163,10 +160,10 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 15 unmodified lines
163 add v5.4s, v5.4s, v16.4s160 add v5.4s, v5.4s, v16.4s
164 add v6.4s, v6.4s, v16.4s161 add v6.4s, v6.4s, v16.4s
165 add v7.4s, v7.4s, v16.4s162 add v7.4s, v7.4s, v16.4s
166 sqshrn v4.4h, v4.4s, #(15 - \bit_depth)163 sqshrun v4.4h, v4.4s, #(15 - \bit_depth)
167 sqshrn2 v4.8h, v5.4s, #(15 - \bit_depth)164 sqshrun2 v4.8h, v5.4s, #(15 - \bit_depth)
168 sqshrn v6.4h, v6.4s, #(15 - \bit_depth)165 sqshrun v6.4h, v6.4s, #(15 - \bit_depth)
169 sqshrn2 v6.8h, v7.4s, #(15 - \bit_depth)166 sqshrun2 v6.8h, v7.4s, #(15 - \bit_depth)
170.else // avg167.else // avg
171 mov v4.16b, v16.16b168 mov v4.16b, v16.16b
172 mov v5.16b, v16.16b169 mov v5.16b, v16.16b
@@ -184,10 +181,10 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 11 unmodified lines
184 sqshl v5.4s, v5.4s, v22.4s181 sqshl v5.4s, v5.4s, v22.4s
185 sqshl v6.4s, v6.4s, v22.4s182 sqshl v6.4s, v6.4s, v22.4s
186 sqshl v7.4s, v7.4s, v22.4s183 sqshl v7.4s, v7.4s, v22.4s
187 sqxtn v4.4h, v4.4s184 sqxtun v4.4h, v4.4s
188 sqxtn v6.4h, v6.4s185 sqxtun v6.4h, v6.4s
189 sqxtn2 v4.8h, v5.4s186 sqxtun2 v4.8h, v5.4s
190 sqxtn2 v6.8h, v7.4s187 sqxtun2 v6.8h, v7.4s
191.endif // w_avg188.endif // w_avg
192 subs w6, w6, #16189 subs w6, w6, #16
193.if \bit_depth == 8190.if \bit_depth == 8
@@ -195,10 +192,8 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 1 unmodified line
195 sqxtun2 v4.16b, v6.8h192 sqxtun2 v4.16b, v6.8h
196 str q4, [x9], #16193 str q4, [x9], #16
197.else194.else
198 smin v4.8h, v4.8h, v17.8h195 umin v4.8h, v4.8h, v17.8h
199 smin v6.8h, v6.8h, v17.8h196 umin v6.8h, v6.8h, v17.8h
200 smax v4.8h, v4.8h, v18.8h
201 smax v6.8h, v6.8h, v18.8h
202 stp q4, q6, [x9], #32197 stp q4, q6, [x9], #32
203.endif198.endif
204 b.ne 17b199 b.ne 17b

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