History

lavc/aarch64: add clip N macro

J. Dekker committed 3 years ago

Commit 37cde571 parent 9413bdc2 files · +16 −14Browse files

Unified · Split

2 files
  1. libavcodec/aarch64/hevcdsp_idct_neon.S +5 −14
  2. libavcodec/aarch64/neon.S +11 −0
libavcodec/aarch64/hevcdsp_idct_neon.S+5−14
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 *5 *
6 * Ported from arm/hevcdsp_idct_neon.S by6 * Ported from arm/hevcdsp_idct_neon.S by
7 * Copyright (c) 2020 Reimar Döffinger7 * Copyright (c) 2020 Reimar Döffinger
8 * Copyright (c) 2020 J. Dekker8 * Copyright (c) 2023 J. Dekker <jdek@itanimul.li>
9 *9 *
10 * This file is part of FFmpeg.10 * This file is part of FFmpeg.
11 *11 *
@@ -38,13 +38,6 @@ const trans, align=4 · 26 unmodified lines
38 .short 31, 22, 13, 438 .short 31, 22, 13, 4
39endconst39endconst
40 40
41.macro clip2 in1, in2, min, max
42 smax \in1, \in1, \min
43 smax \in2, \in2, \min
44 smin \in1, \in1, \max
45 smin \in2, \in2, \max
46.endm
47
48function ff_hevc_add_residual_4x4_8_neon, export=141function ff_hevc_add_residual_4x4_8_neon, export=1
49 ld1 {v0.8h-v1.8h}, [x1]42 ld1 {v0.8h-v1.8h}, [x1]
50 ld1 {v2.s}[0], [x0], x243 ld1 {v2.s}[0], [x0], x2
@@ -182,7 +175,7 @@ function hevc_add_residual_4x4_16_neon, export=0 · 131 unmodified lines
182 ld1 {v3.d}[1], [x12], x2175 ld1 {v3.d}[1], [x12], x2
183 movi v4.8h, #0176 movi v4.8h, #0
184 sqadd v1.8h, v1.8h, v3.8h177 sqadd v1.8h, v1.8h, v3.8h
185 clip2 v0.8h, v1.8h, v4.8h, v21.8h178 clip v4.8h, v21.8h, v0.8h, v1.8h
186 st1 {v0.d}[0], [x0], x2179 st1 {v0.d}[0], [x0], x2
187 st1 {v0.d}[1], [x0], x2180 st1 {v0.d}[1], [x0], x2
188 st1 {v1.d}[0], [x0], x2181 st1 {v1.d}[0], [x0], x2
@@ -201,7 +194,7 @@ function hevc_add_residual_8x8_16_neon, export=0 · 12 unmodified lines
201 sqadd v0.8h, v0.8h, v2.8h194 sqadd v0.8h, v0.8h, v2.8h
202 ld1 {v3.8h}, [x12]195 ld1 {v3.8h}, [x12]
203 sqadd v1.8h, v1.8h, v3.8h196 sqadd v1.8h, v1.8h, v3.8h
204 clip2 v0.8h, v1.8h, v4.8h, v21.8h197 clip v4.8h, v21.8h, v0.8h, v1.8h
205 st1 {v0.8h}, [x0], x2198 st1 {v0.8h}, [x0], x2
206 st1 {v1.8h}, [x12], x2199 st1 {v1.8h}, [x12], x2
207 bne 1b200 bne 1b
@@ -221,8 +214,7 @@ function hevc_add_residual_16x16_16_neon, export=0 · 13 unmodified lines
221 sqadd v1.8h, v1.8h, v17.8h214 sqadd v1.8h, v1.8h, v17.8h
222 sqadd v2.8h, v2.8h, v18.8h215 sqadd v2.8h, v2.8h, v18.8h
223 sqadd v3.8h, v3.8h, v19.8h216 sqadd v3.8h, v3.8h, v19.8h
224 clip2 v0.8h, v1.8h, v20.8h, v21.8h217 clip v20.8h, v21.8h, v0.8h, v1.8h, v2.8h, v3.8h
225 clip2 v2.8h, v3.8h, v20.8h, v21.8h
226 st1 {v0.8h-v1.8h}, [x0], x2218 st1 {v0.8h-v1.8h}, [x0], x2
227 st1 {v2.8h-v3.8h}, [x12], x2219 st1 {v2.8h-v3.8h}, [x12], x2
228 bne 1b220 bne 1b
@@ -239,8 +231,7 @@ function hevc_add_residual_32x32_16_neon, export=0 · 10 unmodified lines
239 sqadd v1.8h, v1.8h, v17.8h231 sqadd v1.8h, v1.8h, v17.8h
240 sqadd v2.8h, v2.8h, v18.8h232 sqadd v2.8h, v2.8h, v18.8h
241 sqadd v3.8h, v3.8h, v19.8h233 sqadd v3.8h, v3.8h, v19.8h
242 clip2 v0.8h, v1.8h, v20.8h, v21.8h234 clip v20.8h, v21.8h, v0.8h, v1.8h, v2.8h, v3.8h
243 clip2 v2.8h, v3.8h, v20.8h, v21.8h
244 st1 {v0.8h-v3.8h}, [x0], x2235 st1 {v0.8h-v3.8h}, [x0], x2
245 bne 1b236 bne 1b
246 ret237 ret
libavcodec/aarch64/neon.S+11−0
@@ -1,6 +1,8 @@
1/*1/*
2 * This file is part of FFmpeg.2 * This file is part of FFmpeg.
3 *3 *
4 * Copyright (c) 2023 J. Dekker <jdek@itanimul.li>
5 *
4 * FFmpeg is free software; you can redistribute it and/or6 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public7 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either8 * License as published by the Free Software Foundation; either
@@ -16,6 +18,15 @@ · 9 unmodified lines
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */19 */
18 20
21.macro clip min, max, regs:vararg
22.irp x, \regs
23 smax \x, \x, \min
24.endr
25.irp x, \regs
26 smin \x, \x, \max
27.endr
28.endm
29
19.macro transpose_8x8B r0, r1, r2, r3, r4, r5, r6, r7, r8, r930.macro transpose_8x8B r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
20 trn1 \r8\().8B, \r0\().8B, \r1\().8B31 trn1 \r8\().8B, \r0\().8B, \r1\().8B
21 trn2 \r9\().8B, \r0\().8B, \r1\().8B32 trn2 \r9\().8B, \r0\().8B, \r1\().8B

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