History

aarch64/vvc: Add put_qpel_hx i8mm

Benchmark on Android pixel 8 with -fno-vectorize put_luma_h_8_4x4_c: 0.2 ( 1.00x) put_luma_h_8_4x4_neon: 0.2 ( 1.00x) put_luma_h_8_4x4_i8mm: 0.0 ( 0.00x) put_luma_h_8_8x8_c: 1.5 ( 1.00x) put_luma_h_8_8x8_neon: 0.5 ( 3.00x) put_luma_h_8_8x8_i8mm: 0.5 ( 3.00x) put_luma_h_8_16x16_c: 6.2 ( 1.00x) put_luma_h_8_16x16_neon: 2.0 ( 3.12x) put_luma_h_8_16x16_i8mm: 1.5 ( 4.17x) put_luma_h_8_32x32_c: 25.5 ( 1.00x) put_luma_h_8_32x32_neon: 9.0 ( 2.83x) put_luma_h_8_32x32_i8mm: 6.8 ( 3.78x) put_luma_h_8_64x64_c: 99.8 ( 1.00x) put_luma_h_8_64x64_neon: 35.2 ( 2.83x) put_luma_h_8_64x64_i8mm: 27.2 ( 3.66x) put_luma_h_8_128x128_c: 422.0 ( 1.00x) put_luma_h_8_128x128_neon: 138.5 ( 3.05x) put_luma_h_8_128x128_i8mm: 109.2 ( 3.86x)

Zhao Zhili committed 2 years ago

Commit 9f6c8eb1 parent 25448d13 files · +76 −5Browse files

Unified · Split

3 files
  1. libavcodec/aarch64/h26x/dsp.h +4 −0
  2. libavcodec/aarch64/h26x/qpel_neon.S +63 −5
  3. libavcodec/aarch64/vvc/dsp_init.c +9 −0
libavcodec/aarch64/h26x/dsp.h+4−0
@@ -270,4 +270,8 @@ NEON8_FNPROTO_PARTIAL_6(pel_uni_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride, · 269 unmodified lines
270270 int height, int denom, int wx, int ox,
271271 const int8_t *hf, const int8_t *vf, int width),);
272272
273+NEON8_FNPROTO_PARTIAL_6(qpel_h, (int16_t * dst,
274+ const uint8_t *_src, ptrdiff_t _srcstride, int height,
275+ const int8_t *hf, const int8_t *vf, int width), _i8mm);
276+
273277 #endif
libavcodec/aarch64/h26x/qpel_neon.S+63−5
@@ -3516,6 +3516,17 @@ endfunc · 3515 unmodified lines
35163516 sub x1, x1, #3
35173517 .endm
35183518
3519+.macro VVC_QPEL_H_HEADER
3520+ ld1r {v31.2d}, [x4]
3521+ sub x1, x1, #3
3522+.endm
3523+
3524+function ff_vvc_put_qpel_h4_8_neon_i8mm, export=1
3525+ VVC_QPEL_H_HEADER
3526+ mov x10, #VVC_MAX_PB_SIZE * 2
3527+ b 1f
3528+endfunc
3529+
35193530 function ff_hevc_put_hevc_qpel_h4_8_neon_i8mm, export=1
35203531 QPEL_H_HEADER
35213532 mov x10, #HEVC_MAX_PB_SIZE * 2
@@ -3572,6 +3583,12 @@ function ff_hevc_put_hevc_qpel_h6_8_neon_i8mm, export=1 · 50 unmodified lines
35723583 ret
35733584 endfunc
35743585
3586+function ff_vvc_put_qpel_h8_8_neon_i8mm, export=1
3587+ VVC_QPEL_H_HEADER
3588+ mov x10, #VVC_MAX_PB_SIZE * 2
3589+ b 1f
3590+endfunc
3591+
35753592 function ff_hevc_put_hevc_qpel_h8_8_neon_i8mm, export=1
35763593 QPEL_H_HEADER
35773594 mov x10, #HEVC_MAX_PB_SIZE * 2
@@ -3656,6 +3673,12 @@ function ff_hevc_put_hevc_qpel_h12_8_neon_i8mm, export=1 · 78 unmodified lines
36563673 ret
36573674 endfunc
36583675
3676+function ff_vvc_put_qpel_h16_8_neon_i8mm, export=1
3677+ VVC_QPEL_H_HEADER
3678+ mov x10, #VVC_MAX_PB_SIZE * 2
3679+ b 1f
3680+endfunc
3681+
36593682 function ff_hevc_put_hevc_qpel_h16_8_neon_i8mm, export=1
36603683 QPEL_H_HEADER
36613684 mov x10, #HEVC_MAX_PB_SIZE * 2
@@ -3746,6 +3769,13 @@ function ff_hevc_put_hevc_qpel_h24_8_neon_i8mm, export=1 · 84 unmodified lines
37463769 ret
37473770 endfunc
37483771
3772+function ff_vvc_put_qpel_h32_8_neon_i8mm, export=1
3773+ VVC_QPEL_H_HEADER
3774+ mov x10, #VVC_MAX_PB_SIZE * 2
3775+ add x15, x0, #32
3776+ b 1f
3777+endfunc
3778+
37493779 function ff_hevc_put_hevc_qpel_h32_8_neon_i8mm, export=1
37503780 QPEL_H_HEADER
37513781 mov x10, #HEVC_MAX_PB_SIZE * 2
@@ -3881,10 +3911,7 @@ function ff_hevc_put_hevc_qpel_h48_8_neon_i8mm, export=1 · 129 unmodified lines
38813911 ret
38823912 endfunc
38833913
3884−function ff_hevc_put_hevc_qpel_h64_8_neon_i8mm, export=1
3885− QPEL_H_HEADER
3886− sub x2, x2, #64
3887−1:
3914+.macro put_qpel_h64_8_neon_i8mm
38883915 ld1 {v16.16b, v17.16b, v18.16b, v19.16b}, [x1], #64
38893916 ext v1.16b, v16.16b, v17.16b, #1
38903917 ext v2.16b, v16.16b, v17.16b, #2
@@ -3975,11 +4002,42 @@ function ff_hevc_put_hevc_qpel_h64_8_neon_i8mm, export=1 · 84 unmodified lines
39754002 sqxtn2 v20.8h, v26.4s
39764003 sqxtn v21.4h, v23.4s
39774004 sqxtn2 v21.8h, v27.4s
3978− stp q20, q21, [x0], #32
4005+ stp q20, q21, [x0]
4006+ add x0, x0, x10
4007+.endm
4008+
4009+function ff_vvc_put_qpel_h64_8_neon_i8mm, export=1
4010+ VVC_QPEL_H_HEADER
4011+ mov x10, #(VVC_MAX_PB_SIZE * 2 - 32 * 3)
4012+ sub x2, x2, #64
4013+ b 1f
4014+endfunc
4015+
4016+function ff_hevc_put_hevc_qpel_h64_8_neon_i8mm, export=1
4017+ QPEL_H_HEADER
4018+ mov x10, #32
4019+ sub x2, x2, #64
4020+1:
4021+ put_qpel_h64_8_neon_i8mm
4022+ subs w3, w3, #1
4023+ b.ne 1b
4024+ ret
4025+endfunc
4026+
4027+function ff_vvc_put_qpel_h128_8_neon_i8mm, export=1
4028+ VVC_QPEL_H_HEADER
4029+ sub x11, x2, #128
4030+ mov x10, #32
4031+ mov x2, #0
4032+1:
4033+ put_qpel_h64_8_neon_i8mm
39794034 subs w3, w3, #1
4035+ put_qpel_h64_8_neon_i8mm
4036+ add x1, x1, x11
39804037 b.ne 1b
39814038 ret
39824039 endfunc
4040+
39834041 DISABLE_I8MM
39844042 #endif
39854043
libavcodec/aarch64/vvc/dsp_init.c+9−0
@@ -88,6 +88,15 @@ void ff_vvc_dsp_init_aarch64(VVCDSPContext *const c, const int bd) · 87 unmodified lines
8888 c->sao.edge_filter[i] = ff_vvc_sao_edge_filter_16x16_8_neon;
8989 c->alf.filter[LUMA] = alf_filter_luma_8_neon;
9090 c->alf.filter[CHROMA] = alf_filter_chroma_8_neon;
91+
92+ if (have_i8mm(cpu_flags)) {
93+ c->inter.put[0][1][0][1] = ff_vvc_put_qpel_h4_8_neon_i8mm;
94+ c->inter.put[0][2][0][1] = ff_vvc_put_qpel_h8_8_neon_i8mm;
95+ c->inter.put[0][3][0][1] = ff_vvc_put_qpel_h16_8_neon_i8mm;
96+ c->inter.put[0][4][0][1] = ff_vvc_put_qpel_h32_8_neon_i8mm;
97+ c->inter.put[0][5][0][1] = ff_vvc_put_qpel_h64_8_neon_i8mm;
98+ c->inter.put[0][6][0][1] = ff_vvc_put_qpel_h128_8_neon_i8mm;
99+ }
91100 } else if (bd == 10) {
92101 c->alf.filter[LUMA] = alf_filter_luma_10_neon;
93102 c->alf.filter[CHROMA] = alf_filter_chroma_10_neon;

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