History

aarch64/vvc: Add put_epel_hv

On Apple M1: put_chroma_hv_8_4x4_c: 1.7 ( 1.00x) put_chroma_hv_8_4x4_neon: 0.2 ( 7.67x) put_chroma_hv_8_8x8_c: 5.5 ( 1.00x) put_chroma_hv_8_8x8_neon: 0.5 (11.53x) put_chroma_hv_8_16x16_c: 18.5 ( 1.00x) put_chroma_hv_8_16x16_neon: 1.5 (12.53x) put_chroma_hv_8_32x32_c: 72.5 ( 1.00x) put_chroma_hv_8_32x32_neon: 4.7 (15.34x) put_chroma_hv_8_64x64_c: 274.0 ( 1.00x) put_chroma_hv_8_64x64_neon: 18.5 (14.83x) put_chroma_hv_8_128x128_c: 1058.7 ( 1.00x) put_chroma_hv_8_128x128_neon: 75.2 (14.07x) On Android Pixel 8 Pro: put_chroma_hv_8_4x4_c: 1.2 ( 1.00x) put_chroma_hv_8_4x4_neon: 0.0 ( 0.00x) put_chroma_hv_8_4x4_i8mm: 0.2 ( 5.00x) put_chroma_hv_8_8x8_c: 4.0 ( 1.00x) put_chroma_hv_8_8x8_neon: 0.5 ( 8.00x) put_chroma_hv_8_8x8_i8mm: 0.5 ( 8.00x) put_chroma_hv_8_16x16_c: 15.2 ( 1.00x) put_chroma_hv_8_16x16_neon: 2.5 ( 6.10x) put_chroma_hv_8_16x16_i8mm: 2.2 ( 6.78x) put_chroma_hv_8_32x32_c: 61.0 ( 1.00x) put_chroma_hv_8_32x32_neon: 9.8 ( 6.26x) put_chroma_hv_8_32x32_i8mm: 8.5 ( 7.18x) put_chroma_hv_8_64x64_c: 229.5 ( 1.00x) put_chroma_hv_8_64x64_neon: 38.5 ( 5.96x) put_chroma_hv_8_64x64_i8mm: 34.0 ( 6.75x) put_chroma_hv_8_128x128_c: 919.8 ( 1.00x) put_chroma_hv_8_128x128_neon: 154.5 ( 5.95x) put_chroma_hv_8_128x128_i8mm: 140.0 ( 6.57x)

Zhao Zhili committed 2 years ago

Commit 1be5a231 parent 0dcf2043 files · +147 −0Browse files

Showing the changes to libavcodec (3 of 3 files). Show all

Unified · Split

3 files
  1. libavcodec/aarch64/h26x/dsp.h +8 −0
  2. libavcodec/aarch64/h26x/epel_neon.S +125 −0
  3. libavcodec/aarch64/vvc/dsp_init.c +14 −0
libavcodec/aarch64/h26x/dsp.h+8−0
@@ -297,4 +297,12 @@ NEON8_FNPROTO_PARTIAL_6(qpel_hv, (int16_t *dst, · 296 unmodified lines
297 const uint8_t *src, ptrdiff_t srcstride, int height,297 const uint8_t *src, ptrdiff_t srcstride, int height,
298 const int8_t *hf, const int8_t *vf, int width), _i8mm);298 const int8_t *hf, const int8_t *vf, int width), _i8mm);
299 299
300NEON8_FNPROTO_PARTIAL_6(epel_hv, (int16_t *dst,
301 const uint8_t *src, ptrdiff_t srcstride, int height,
302 const int8_t *hf, const int8_t *vf, int width),);
303
304NEON8_FNPROTO_PARTIAL_6(epel_hv, (int16_t *dst,
305 const uint8_t *src, ptrdiff_t srcstride, int height,
306 const int8_t *hf, const int8_t *vf, int width), _i8mm);
307
300#endif308#endif
libavcodec/aarch64/h26x/epel_neon.S+125−0
@@ -72,6 +72,11 @@ endconst · 71 unmodified lines
72 sxtl v0.8h, v0.8b72 sxtl v0.8h, v0.8b
73.endm73.endm
74 74
75.macro vvc_load_epel_filterh freg
76 ld1 {v0.8b}, [\freg]
77 sxtl v0.8h, v0.8b
78.endm
79
75.macro calc_epelh dst, src0, src1, src2, src380.macro calc_epelh dst, src0, src1, src2, src3
76 smull \dst\().4s, \src0\().4h, v0.h[0]81 smull \dst\().4s, \src0\().4h, v0.h[0]
77 smlal \dst\().4s, \src1\().4h, v0.h[1]82 smlal \dst\().4s, \src1\().4h, v0.h[1]
@@ -2299,10 +2304,16 @@ endfunc · 2221 unmodified lines
2299DISABLE_I8MM2304DISABLE_I8MM
2300#endif2305#endif
2301 2306
2307function vvc_put_epel_hv4_8_end_neon
2308 vvc_load_epel_filterh x5
2309 mov x10, #(VVC_MAX_PB_SIZE * 2)
2310 b 0f
2311endfunc
2302 2312
2303function hevc_put_hevc_epel_hv4_8_end_neon2313function hevc_put_hevc_epel_hv4_8_end_neon
2304 load_epel_filterh x5, x42314 load_epel_filterh x5, x4
2305 mov x10, #(HEVC_MAX_PB_SIZE * 2)2315 mov x10, #(HEVC_MAX_PB_SIZE * 2)
23160:
2306 ldr d16, [sp]2317 ldr d16, [sp]
2307 ldr d17, [sp, x10]2318 ldr d17, [sp, x10]
2308 add sp, sp, x10, lsl #12319 add sp, sp, x10, lsl #1
@@ -2339,9 +2350,16 @@ function hevc_put_hevc_epel_hv6_8_end_neon · 30 unmodified lines
23392: ret23502: ret
2340endfunc2351endfunc
2341 2352
2353function vvc_put_epel_hv8_8_end_neon
2354 vvc_load_epel_filterh x5
2355 mov x10, #(VVC_MAX_PB_SIZE * 2)
2356 b 0f
2357endfunc
2358
2342function hevc_put_hevc_epel_hv8_8_end_neon2359function hevc_put_hevc_epel_hv8_8_end_neon
2343 load_epel_filterh x5, x42360 load_epel_filterh x5, x4
2344 mov x10, #(HEVC_MAX_PB_SIZE * 2)2361 mov x10, #(HEVC_MAX_PB_SIZE * 2)
23620:
2345 ldr q16, [sp]2363 ldr q16, [sp]
2346 ldr q17, [sp, x10]2364 ldr q17, [sp, x10]
2347 add sp, sp, x10, lsl #12365 add sp, sp, x10, lsl #1
@@ -2379,9 +2397,16 @@ function hevc_put_hevc_epel_hv12_8_end_neon · 31 unmodified lines
23792: ret23972: ret
2380endfunc2398endfunc
2381 2399
2400function vvc_put_epel_hv16_8_end_neon
2401 vvc_load_epel_filterh x5
2402 mov x10, #(VVC_MAX_PB_SIZE * 2)
2403 b 0f
2404endfunc
2405
2382function hevc_put_hevc_epel_hv16_8_end_neon2406function hevc_put_hevc_epel_hv16_8_end_neon
2383 load_epel_filterh x5, x42407 load_epel_filterh x5, x4
2384 mov x10, #(HEVC_MAX_PB_SIZE * 2)2408 mov x10, #(HEVC_MAX_PB_SIZE * 2)
24090:
2385 ld1 {v16.8h, v17.8h}, [sp], x102410 ld1 {v16.8h, v17.8h}, [sp], x10
2386 ld1 {v18.8h, v19.8h}, [sp], x102411 ld1 {v18.8h, v19.8h}, [sp], x10
2387 ld1 {v20.8h, v21.8h}, [sp], x102412 ld1 {v20.8h, v21.8h}, [sp], x10
@@ -2437,6 +2462,21 @@ function ff_hevc_put_hevc_epel_hv4_8_\suffix, export=1 · 49 unmodified lines
2437 b hevc_put_hevc_epel_hv4_8_end_neon2462 b hevc_put_hevc_epel_hv4_8_end_neon
2438endfunc2463endfunc
2439 2464
2465function ff_vvc_put_epel_hv4_8_\suffix, export=1
2466 add w10, w3, #3
2467 lsl x10, x10, #8
2468 sub sp, sp, x10 // tmp_array
2469 stp x5, x30, [sp, #-32]!
2470 stp x0, x3, [sp, #16]
2471 add x0, sp, #32
2472 sub x1, x1, x2
2473 add w3, w3, #3
2474 bl X(ff_vvc_put_epel_h4_8_\suffix)
2475 ldp x0, x3, [sp, #16]
2476 ldp x5, x30, [sp], #32
2477 b vvc_put_epel_hv4_8_end_neon
2478endfunc
2479
2440function ff_hevc_put_hevc_epel_hv6_8_\suffix, export=12480function ff_hevc_put_hevc_epel_hv6_8_\suffix, export=1
2441 add w10, w3, #32481 add w10, w3, #3
2442 lsl x10, x10, #72482 lsl x10, x10, #7
@@ -2467,6 +2507,21 @@ function ff_hevc_put_hevc_epel_hv8_8_\suffix, export=1 · 24 unmodified lines
2467 b hevc_put_hevc_epel_hv8_8_end_neon2507 b hevc_put_hevc_epel_hv8_8_end_neon
2468endfunc2508endfunc
2469 2509
2510function ff_vvc_put_epel_hv8_8_\suffix, export=1
2511 add w10, w3, #3
2512 lsl x10, x10, #8
2513 sub sp, sp, x10 // tmp_array
2514 stp x5, x30, [sp, #-32]!
2515 stp x0, x3, [sp, #16]
2516 add x0, sp, #32
2517 sub x1, x1, x2
2518 add w3, w3, #3
2519 bl X(ff_vvc_put_epel_h8_8_\suffix)
2520 ldp x0, x3, [sp, #16]
2521 ldp x5, x30, [sp], #32
2522 b vvc_put_epel_hv8_8_end_neon
2523endfunc
2524
2470function ff_hevc_put_hevc_epel_hv12_8_\suffix, export=12525function ff_hevc_put_hevc_epel_hv12_8_\suffix, export=1
2471 add w10, w3, #32526 add w10, w3, #3
2472 lsl x10, x10, #72527 lsl x10, x10, #7
@@ -2497,6 +2552,21 @@ function ff_hevc_put_hevc_epel_hv16_8_\suffix, export=1 · 24 unmodified lines
2497 b hevc_put_hevc_epel_hv16_8_end_neon2552 b hevc_put_hevc_epel_hv16_8_end_neon
2498endfunc2553endfunc
2499 2554
2555function ff_vvc_put_epel_hv16_8_\suffix, export=1
2556 add w10, w3, #3
2557 lsl x10, x10, #8
2558 sub sp, sp, x10 // tmp_array
2559 stp x5, x30, [sp, #-32]!
2560 stp x0, x3, [sp, #16]
2561 add x0, sp, #32
2562 sub x1, x1, x2
2563 add w3, w3, #3
2564 bl X(ff_vvc_put_epel_h16_8_\suffix)
2565 ldp x0, x3, [sp, #16]
2566 ldp x5, x30, [sp], #32
2567 b vvc_put_epel_hv16_8_end_neon
2568endfunc
2569
2500function ff_hevc_put_hevc_epel_hv24_8_\suffix, export=12570function ff_hevc_put_hevc_epel_hv24_8_\suffix, export=1
2501 add w10, w3, #32571 add w10, w3, #3
2502 lsl x10, x10, #72572 lsl x10, x10, #7
@@ -2530,6 +2600,24 @@ function ff_hevc_put_hevc_epel_hv32_8_\suffix, export=1 · 27 unmodified lines
2530 ret2600 ret
2531endfunc2601endfunc
2532 2602
2603function ff_vvc_put_epel_hv32_8_\suffix, export=1
2604 stp x4, x5, [sp, #-64]!
2605 stp x2, x3, [sp, #16]
2606 stp x0, x1, [sp, #32]
2607 str x30, [sp, #48]
2608 mov x6, #16
2609 bl X(ff_vvc_put_epel_hv16_8_\suffix)
2610 ldp x0, x1, [sp, #32]
2611 ldp x2, x3, [sp, #16]
2612 ldp x4, x5, [sp], #48
2613 add x0, x0, #32
2614 add x1, x1, #16
2615 mov x6, #16
2616 bl X(ff_vvc_put_epel_hv16_8_\suffix)
2617 ldr x30, [sp], #16
2618 ret
2619endfunc
2620
2533function ff_hevc_put_hevc_epel_hv48_8_\suffix, export=12621function ff_hevc_put_hevc_epel_hv48_8_\suffix, export=1
2534 stp x4, x5, [sp, #-64]!2622 stp x4, x5, [sp, #-64]!
2535 stp x2, x3, [sp, #16]2623 stp x2, x3, [sp, #16]
@@ -2579,6 +2667,43 @@ function ff_hevc_put_hevc_epel_hv64_8_\suffix, export=1 · 43 unmodified lines
2579 ldr x30, [sp], #162667 ldr x30, [sp], #16
2580 ret2668 ret
2581endfunc2669endfunc
2670
2671function ff_vvc_put_epel_hv64_8_\suffix, export=1
2672 stp x4, x5, [sp, #-64]!
2673 stp x2, x3, [sp, #16]
2674 stp x0, x1, [sp, #32]
2675 str x30, [sp, #48]
2676 mov x6, #32
2677 bl X(ff_vvc_put_epel_hv32_8_\suffix)
2678 ldp x0, x1, [sp, #32]
2679 ldp x2, x3, [sp, #16]
2680 ldp x4, x5, [sp], #48
2681 add x0, x0, #64
2682 add x1, x1, #32
2683 mov x6, #32
2684 bl X(ff_vvc_put_epel_hv32_8_\suffix)
2685 ldr x30, [sp], #16
2686 ret
2687endfunc
2688
2689function ff_vvc_put_epel_hv128_8_\suffix, export=1
2690 stp x4, x5, [sp, #-64]!
2691 stp x2, x3, [sp, #16]
2692 stp x0, x1, [sp, #32]
2693 str x30, [sp, #48]
2694 mov x6, #64
2695 bl X(ff_vvc_put_epel_hv64_8_\suffix)
2696 ldp x0, x1, [sp, #32]
2697 ldp x2, x3, [sp, #16]
2698 ldp x4, x5, [sp], #48
2699 add x0, x0, #128
2700 add x1, x1, #64
2701 mov x6, #64
2702 bl X(ff_vvc_put_epel_hv64_8_\suffix)
2703 ldr x30, [sp], #16
2704 ret
2705endfunc
2706
2582.endm2707.endm
2583 2708
2584epel_hv neon2709epel_hv neon
libavcodec/aarch64/vvc/dsp_init.c+14−0
@@ -84,6 +84,13 @@ void ff_vvc_dsp_init_aarch64(VVCDSPContext *const c, const int bd) · 83 unmodified lines
84 c->inter.put[1][5][0][1] =84 c->inter.put[1][5][0][1] =
85 c->inter.put[1][6][0][1] = ff_vvc_put_epel_h32_8_neon;85 c->inter.put[1][6][0][1] = ff_vvc_put_epel_h32_8_neon;
86 86
87 c->inter.put[1][1][1][1] = ff_vvc_put_epel_hv4_8_neon;
88 c->inter.put[1][2][1][1] = ff_vvc_put_epel_hv8_8_neon;
89 c->inter.put[1][3][1][1] = ff_vvc_put_epel_hv16_8_neon;
90 c->inter.put[1][4][1][1] = ff_vvc_put_epel_hv32_8_neon;
91 c->inter.put[1][5][1][1] = ff_vvc_put_epel_hv64_8_neon;
92 c->inter.put[1][6][1][1] = ff_vvc_put_epel_hv128_8_neon;
93
87 c->inter.put_uni[0][1][0][0] = ff_vvc_put_pel_uni_pixels4_8_neon;94 c->inter.put_uni[0][1][0][0] = ff_vvc_put_pel_uni_pixels4_8_neon;
88 c->inter.put_uni[0][2][0][0] = ff_vvc_put_pel_uni_pixels8_8_neon;95 c->inter.put_uni[0][2][0][0] = ff_vvc_put_pel_uni_pixels8_8_neon;
89 c->inter.put_uni[0][3][0][0] = ff_vvc_put_pel_uni_pixels16_8_neon;96 c->inter.put_uni[0][3][0][0] = ff_vvc_put_pel_uni_pixels16_8_neon;
@@ -134,6 +141,13 @@ void ff_vvc_dsp_init_aarch64(VVCDSPContext *const c, const int bd) · 44 unmodified lines
134 c->inter.put[1][4][0][1] = ff_vvc_put_epel_h32_8_neon_i8mm;141 c->inter.put[1][4][0][1] = ff_vvc_put_epel_h32_8_neon_i8mm;
135 c->inter.put[1][5][0][1] = ff_vvc_put_epel_h64_8_neon_i8mm;142 c->inter.put[1][5][0][1] = ff_vvc_put_epel_h64_8_neon_i8mm;
136 c->inter.put[1][6][0][1] = ff_vvc_put_epel_h128_8_neon_i8mm;143 c->inter.put[1][6][0][1] = ff_vvc_put_epel_h128_8_neon_i8mm;
144
145 c->inter.put[1][1][1][1] = ff_vvc_put_epel_hv4_8_neon_i8mm;
146 c->inter.put[1][2][1][1] = ff_vvc_put_epel_hv8_8_neon_i8mm;
147 c->inter.put[1][3][1][1] = ff_vvc_put_epel_hv16_8_neon_i8mm;
148 c->inter.put[1][4][1][1] = ff_vvc_put_epel_hv32_8_neon_i8mm;
149 c->inter.put[1][5][1][1] = ff_vvc_put_epel_hv64_8_neon_i8mm;
150 c->inter.put[1][6][1][1] = ff_vvc_put_epel_hv128_8_neon_i8mm;
137 }151 }
138 } else if (bd == 10) {152 } else if (bd == 10) {
139 c->alf.filter[LUMA] = alf_filter_luma_10_neon;153 c->alf.filter[LUMA] = alf_filter_luma_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