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
3636 .ifc \type, avg
3737 saddl v4.4s, v0.4h, v2.4h
3838 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)
4040 .else
4141 mov v4.16b, v16.16b
4242 smlal v4.4s, v0.4h, v19.4h
4343 smlal v4.4s, v2.4h, v20.4h
4444 sqshl v4.4s, v4.4s, v22.4s
45− sqxtn v4.4h, v4.4s
45+ sqxtun v4.4h, v4.4s
4646 .endif
4747
4848 .if \bit_depth == 8
@@ -54,8 +54,7 @@ · 5 unmodified lines
5454 .endif
5555
5656 .else // bit_depth > 8
57− smin v4.4h, v4.4h, v17.4h
58− smax v4.4h, v4.4h, v18.4h
57+ umin v4.4h, v4.4h, v17.4h
5958 .if \tap == 2
6059 str s4, [dst]
6160 .else
@@ -95,7 +94,6 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 33 unmodified lines
9594 .if \bit_depth >= 10
9695 // clip pixel
9796 mov w6, #((1 << \bit_depth) - 1)
98− movi v18.8h, #0
9997 dup v17.8h, w6
10098 .endif
10199
@@ -121,8 +119,8 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 19 unmodified lines
121119 saddl2 v5.4s, v0.8h, v2.8h
122120 add v4.4s, v4.4s, v16.4s
123121 add v5.4s, v5.4s, v16.4s
124− sqshrn v4.4h, v4.4s, #(15 - \bit_depth)
125− sqshrn2 v4.8h, v5.4s, #(15 - \bit_depth)
122+ sqshrun v4.4h, v4.4s, #(15 - \bit_depth)
123+ sqshrun2 v4.8h, v5.4s, #(15 - \bit_depth)
126124 .else
127125 mov v4.16b, v16.16b
128126 mov v5.16b, v16.16b
@@ -132,16 +130,15 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 3 unmodified lines
132130 smlal2 v5.4s, v2.8h, v20.8h
133131 sqshl v4.4s, v4.4s, v22.4s
134132 sqshl v5.4s, v5.4s, v22.4s
135− sqxtn v4.4h, v4.4s
136− sqxtn2 v4.8h, v5.4s
133+ sqxtun v4.4h, v4.4s
134+ sqxtun2 v4.8h, v5.4s
137135 .endif
138136 subs height, height, #1
139137 .if \bit_depth == 8
140138 sqxtun v4.8b, v4.8h
141139 st1 {v4.8b}, [dst], dst_stride
142140 .else
143− smin v4.8h, v4.8h, v17.8h
144− smax v4.8h, v4.8h, v18.8h
141+ umin v4.8h, v4.8h, v17.8h
145142 st1 {v4.8h}, [dst], dst_stride
146143 .endif
147144 b.ne 8b
@@ -163,10 +160,10 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 15 unmodified lines
163160 add v5.4s, v5.4s, v16.4s
164161 add v6.4s, v6.4s, v16.4s
165162 add v7.4s, v7.4s, v16.4s
166− sqshrn v4.4h, v4.4s, #(15 - \bit_depth)
167− sqshrn2 v4.8h, v5.4s, #(15 - \bit_depth)
168− sqshrn v6.4h, v6.4s, #(15 - \bit_depth)
169− sqshrn2 v6.8h, v7.4s, #(15 - \bit_depth)
163+ sqshrun v4.4h, v4.4s, #(15 - \bit_depth)
164+ sqshrun2 v4.8h, v5.4s, #(15 - \bit_depth)
165+ sqshrun v6.4h, v6.4s, #(15 - \bit_depth)
166+ sqshrun2 v6.8h, v7.4s, #(15 - \bit_depth)
170167 .else // avg
171168 mov v4.16b, v16.16b
172169 mov v5.16b, v16.16b
@@ -184,10 +181,10 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 11 unmodified lines
184181 sqshl v5.4s, v5.4s, v22.4s
185182 sqshl v6.4s, v6.4s, v22.4s
186183 sqshl v7.4s, v7.4s, v22.4s
187− sqxtn v4.4h, v4.4s
188− sqxtn v6.4h, v6.4s
189− sqxtn2 v4.8h, v5.4s
190− sqxtn2 v6.8h, v7.4s
184+ sqxtun v4.4h, v4.4s
185+ sqxtun v6.4h, v6.4s
186+ sqxtun2 v4.8h, v5.4s
187+ sqxtun2 v6.8h, v7.4s
191188 .endif // w_avg
192189 subs w6, w6, #16
193190 .if \bit_depth == 8
@@ -195,10 +192,8 @@ function ff_vvc_\type\()_\bit_depth\()_neon, export=1 · 1 unmodified line
195192 sqxtun2 v4.16b, v6.8h
196193 str q4, [x9], #16
197194 .else
198− smin v4.8h, v4.8h, v17.8h
199− smin v6.8h, v6.8h, v17.8h
200− smax v4.8h, v4.8h, v18.8h
201− smax v6.8h, v6.8h, v18.8h
195+ umin v4.8h, v4.8h, v17.8h
196+ umin v6.8h, v6.8h, v17.8h
202197 stp q4, q6, [x9], #32
203198 .endif
204199 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