pixel: Add neon vsad implementations for 10 bit

Provide arm64 neon implementation for vsad function for 10 bit
depth. Benchmarks are shown below.

vsad_c: 3599
vsad_neon: 392

Signed-off-by: Hubert Mazur <hum@semihalf.com>
This commit is contained in:
Hubert Mazur
2022-11-02 14:50:25 +00:00
committed by Anton Mitrofanov
parent 3afe3c82bc
commit 8a90ffa7d1
3 changed files with 54 additions and 26 deletions
+51 -25
View File
@@ -224,6 +224,30 @@ function pixel_sad_x\x\()_\w\()x\h\()_neon, export=1
endfunc
.endm
function pixel_vsad_neon, export=1
subs w2, w2, #2
ld1 {v0.16b}, [x0], x1
ld1 {v1.16b}, [x0], x1
uabdl v6.8h, v0.8b, v1.8b
uabdl2 v7.8h, v0.16b, v1.16b
b.le 2f
1:
subs w2, w2, #2
ld1 {v0.16b}, [x0], x1
uabal v6.8h, v1.8b, v0.8b
uabal2 v7.8h, v1.16b, v0.16b
ld1 {v1.16b}, [x0], x1
b.lt 2f
uabal v6.8h, v0.8b, v1.8b
uabal2 v7.8h, v0.16b, v1.16b
b.gt 1b
2:
add v5.8h, v6.8h, v7.8h
uaddlv s0, v5.8h
fmov w0, s0
ret
endfunc
#else /* BIT_DEPTH == 8 */
.macro SAD_START_4
@@ -444,6 +468,33 @@ function pixel_sad_x\x\()_\w\()x\h\()_neon, export=1
endfunc
.endm
function pixel_vsad_neon, export=1
subs w2, w2, #2
lsl x1, x1, #1
ld1 {v0.8h, v1.8h}, [x0], x1
ld1 {v2.8h, v3.8h}, [x0], x1
uabd v6.8h, v0.8h, v2.8h
uabd v7.8h, v1.8h, v3.8h
b.le 2f
1:
subs w2, w2, #2
ld1 {v0.8h, v1.8h}, [x0], x1
uaba v6.8h, v2.8h, v0.8h
uaba v7.8h, v3.8h, v1.8h
ld1 {v2.8h, v3.8h}, [x0], x1
b.lt 2f
uaba v6.8h, v0.8h, v2.8h
uaba v7.8h, v1.8h, v3.8h
b.gt 1b
2:
add v5.8h, v6.8h, v7.8h
uaddlv s0, v5.8h
fmov w0, s0
ret
endfunc
#endif /* BIT_DEPTH == 8 */
SAD_FUNC 4, 4
@@ -471,31 +522,6 @@ SAD_X_FUNC 4, 8, 16
SAD_X_FUNC 4, 16, 8
SAD_X_FUNC 4, 16, 16
function pixel_vsad_neon, export=1
subs w2, w2, #2
ld1 {v0.16b}, [x0], x1
ld1 {v1.16b}, [x0], x1
uabdl v6.8h, v0.8b, v1.8b
uabdl2 v7.8h, v0.16b, v1.16b
b.le 2f
1:
subs w2, w2, #2
ld1 {v0.16b}, [x0], x1
uabal v6.8h, v1.8b, v0.8b
uabal2 v7.8h, v1.16b, v0.16b
ld1 {v1.16b}, [x0], x1
b.lt 2f
uabal v6.8h, v0.8b, v1.8b
uabal2 v7.8h, v0.16b, v1.16b
b.gt 1b
2:
add v5.8h, v6.8h, v7.8h
uaddlv s0, v5.8h
fmov w0, s0
ret
endfunc
function pixel_asd8_neon, export=1
sub w4, w4, #2
ld1 {v0.8b}, [x0], x1
+1 -1
View File
@@ -92,7 +92,7 @@ DECL_X1( ssd, neon )
void x264_pixel_ssd_nv12_core_neon( uint8_t *, intptr_t, uint8_t *, intptr_t, int, int, uint64_t *, uint64_t * );
#define x264_pixel_vsad_neon x264_template(pixel_vsad_neon)
int x264_pixel_vsad_neon( uint8_t *, intptr_t, int );
int x264_pixel_vsad_neon( pixel *, intptr_t, int );
#define x264_pixel_sa8d_8x8_neon x264_template(pixel_sa8d_8x8_neon)
int x264_pixel_sa8d_8x8_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t );
+2
View File
@@ -1059,6 +1059,8 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf )
{
INIT8( sad, _neon );
INIT7( sad_x3, _neon);
pixf->vsad = x264_pixel_vsad_neon;
}
#endif // HAVE_AARCH64