History

lavc/aarch64: new optimization for 8-bit hevc_qpel_bi_hv

put_hevc_qpel_bi_hv4_8_c: 433.7 put_hevc_qpel_bi_hv4_8_i8mm: 117.9 put_hevc_qpel_bi_hv6_8_c: 803.9 put_hevc_qpel_bi_hv6_8_i8mm: 252.7 put_hevc_qpel_bi_hv8_8_c: 1296.4 put_hevc_qpel_bi_hv8_8_i8mm: 316.2 put_hevc_qpel_bi_hv12_8_c: 2867.4 put_hevc_qpel_bi_hv12_8_i8mm: 669.2 put_hevc_qpel_bi_hv16_8_c: 4709.4 put_hevc_qpel_bi_hv16_8_i8mm: 929.9 put_hevc_qpel_bi_hv24_8_c: 9639.7 put_hevc_qpel_bi_hv24_8_i8mm: 2072.4 put_hevc_qpel_bi_hv32_8_c: 16663.7 put_hevc_qpel_bi_hv32_8_i8mm: 3391.4 put_hevc_qpel_bi_hv48_8_c: 36972.9 put_hevc_qpel_bi_hv48_8_i8mm: 7505.7 put_hevc_qpel_bi_hv64_8_c: 64106.4 put_hevc_qpel_bi_hv64_8_i8mm: 13145.2

Logan Lyu committed 3 years ago

Commit fa047031 parent 595f9702 files · +304 −0Browse files

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

Unified · Split

2 files
  1. libavcodec/aarch64/hevcdsp_init_aarch64.c +5 −0
  2. libavcodec/aarch64/hevcdsp_qpel_neon.S +299 −0
libavcodec/aarch64/hevcdsp_init_aarch64.c+5−0
@@ -255,6 +255,10 @@ NEON8_FNPROTO(qpel_bi_v, (uint8_t *dst, ptrdiff_t dststride, · 254 unmodified lines
255 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,255 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
256 int height, intptr_t mx, intptr_t my, int width),);256 int height, intptr_t mx, intptr_t my, int width),);
257 257
258NEON8_FNPROTO(qpel_bi_hv, (uint8_t *dst, ptrdiff_t dststride,
259 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
260 int height, intptr_t mx, intptr_t my, int width), _i8mm);
261
258#define NEON8_FNASSIGN(member, v, h, fn, ext) \262#define NEON8_FNASSIGN(member, v, h, fn, ext) \
259 member[1][v][h] = ff_hevc_put_hevc_##fn##4_8_neon##ext; \263 member[1][v][h] = ff_hevc_put_hevc_##fn##4_8_neon##ext; \
260 member[2][v][h] = ff_hevc_put_hevc_##fn##6_8_neon##ext; \264 member[2][v][h] = ff_hevc_put_hevc_##fn##6_8_neon##ext; \
@@ -370,6 +374,7 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) · 109 unmodified lines
370 NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 1, qpel_uni_w_h, _i8mm);374 NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 1, qpel_uni_w_h, _i8mm);
371 NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv, _i8mm);375 NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv, _i8mm);
372 NEON8_FNASSIGN_PARTIAL_5(c->put_hevc_qpel_uni_w, 1, 1, qpel_uni_w_hv, _i8mm);376 NEON8_FNASSIGN_PARTIAL_5(c->put_hevc_qpel_uni_w, 1, 1, qpel_uni_w_hv, _i8mm);
377 NEON8_FNASSIGN(c->put_hevc_qpel_bi, 1, 1, qpel_bi_hv, _i8mm);
373 }378 }
374 379
375 }380 }
libavcodec/aarch64/hevcdsp_qpel_neon.S+299−0
@@ -4200,5 +4200,304 @@ function ff_hevc_put_hevc_qpel_uni_w_hv64_8_neon_i8mm, export=1 · 4199 unmodified lines
4200 ret4200 ret
4201endfunc4201endfunc
4202 4202
4203function ff_hevc_put_hevc_qpel_bi_hv4_8_neon_i8mm, export=1
4204 add w10, w5, #7
4205 lsl x10, x10, #7
4206 sub sp, sp, x10 // tmp_array
4207 stp x7, x30, [sp, #-48]!
4208 stp x4, x5, [sp, #16]
4209 stp x0, x1, [sp, #32]
4210 sub x1, x2, x3, lsl #1
4211 sub x1, x1, x3
4212 add x0, sp, #48
4213 mov x2, x3
4214 add w3, w5, #7
4215 mov x4, x6
4216 bl X(ff_hevc_put_hevc_qpel_h4_8_neon_i8mm)
4217 ldp x4, x5, [sp, #16]
4218 ldp x0, x1, [sp, #32]
4219 ldp x7, x30, [sp], #48
4220 mov x9, #(MAX_PB_SIZE * 2)
4221 load_qpel_filterh x7, x6
4222 ld1 {v16.4h}, [sp], x9
4223 ld1 {v17.4h}, [sp], x9
4224 ld1 {v18.4h}, [sp], x9
4225 ld1 {v19.4h}, [sp], x9
4226 ld1 {v20.4h}, [sp], x9
4227 ld1 {v21.4h}, [sp], x9
4228 ld1 {v22.4h}, [sp], x9
4229.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7
4230 ld1 {\tmp\().4h}, [sp], x9
4231 calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4232 ld1 {v5.4h}, [x4], x9 // src2
4233 saddw v1.4s, v1.4s, v5.4h
4234 rshrn v1.4h, v1.4s, #7
4235 sqxtun v1.8b, v1.8h
4236 subs w5, w5, #1
4237 st1 {v1.s}[0], [x0], x1
4238.endm
42391: calc_all
4240.purgem calc
42412: ret
4242endfunc
4243
4244function ff_hevc_put_hevc_qpel_bi_hv6_8_neon_i8mm, export=1
4245 add w10, w5, #7
4246 lsl x10, x10, #7
4247 sub sp, sp, x10 // tmp_array
4248 stp x7, x30, [sp, #-48]!
4249 stp x4, x5, [sp, #16]
4250 stp x0, x1, [sp, #32]
4251 sub x1, x2, x3, lsl #1
4252 sub x1, x1, x3
4253 add x0, sp, #48
4254 mov x2, x3
4255 add x3, x5, #7
4256 mov x4, x6
4257 bl X(ff_hevc_put_hevc_qpel_h6_8_neon_i8mm)
4258 ldp x4, x5, [sp, #16]
4259 ldp x0, x1, [sp, #32]
4260 ldp x7, x30, [sp], #48
4261 mov x9, #(MAX_PB_SIZE * 2)
4262 load_qpel_filterh x7, x6
4263 sub x1, x1, #4
4264 ld1 {v16.8h}, [sp], x9
4265 ld1 {v17.8h}, [sp], x9
4266 ld1 {v18.8h}, [sp], x9
4267 ld1 {v19.8h}, [sp], x9
4268 ld1 {v20.8h}, [sp], x9
4269 ld1 {v21.8h}, [sp], x9
4270 ld1 {v22.8h}, [sp], x9
4271.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7
4272 ld1 {\tmp\().8h}, [sp], x9
4273 calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4274 calc_qpelh2 v2, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4275 ld1 {v5.8h}, [x4], x9 // src2
4276 saddw v1.4s, v1.4s, v5.4h
4277 saddw2 v2.4s, v2.4s, v5.8h
4278 rshrn v1.4h, v1.4s, #7
4279 rshrn2 v1.8h, v2.4s, #7
4280 sqxtun v1.8b, v1.8h
4281 st1 {v1.s}[0], [x0], #4
4282 subs w5, w5, #1
4283 st1 {v1.h}[2], [x0], x1
4284.endm
42851: calc_all
4286.purgem calc
42872: ret
4288endfunc
4289
4290function ff_hevc_put_hevc_qpel_bi_hv8_8_neon_i8mm, export=1
4291 add w10, w5, #7
4292 lsl x10, x10, #7
4293 sub sp, sp, x10 // tmp_array
4294 stp x7, x30, [sp, #-48]!
4295 stp x4, x5, [sp, #16]
4296 stp x0, x1, [sp, #32]
4297 sub x1, x2, x3, lsl #1
4298 sub x1, x1, x3
4299 add x0, sp, #48
4300 mov x2, x3
4301 add x3, x5, #7
4302 mov x4, x6
4303 bl X(ff_hevc_put_hevc_qpel_h8_8_neon_i8mm)
4304 ldp x4, x5, [sp, #16]
4305 ldp x0, x1, [sp, #32]
4306 ldp x7, x30, [sp], #48
4307 mov x9, #(MAX_PB_SIZE * 2)
4308 load_qpel_filterh x7, x6
4309 ld1 {v16.8h}, [sp], x9
4310 ld1 {v17.8h}, [sp], x9
4311 ld1 {v18.8h}, [sp], x9
4312 ld1 {v19.8h}, [sp], x9
4313 ld1 {v20.8h}, [sp], x9
4314 ld1 {v21.8h}, [sp], x9
4315 ld1 {v22.8h}, [sp], x9
4316.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7
4317 ld1 {\tmp\().8h}, [sp], x9
4318 calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4319 calc_qpelh2 v2, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4320 ld1 {v5.8h}, [x4], x9 // src2
4321 saddw v1.4s, v1.4s, v5.4h
4322 saddw2 v2.4s, v2.4s, v5.8h
4323 rshrn v1.4h, v1.4s, #7
4324 rshrn2 v1.8h, v2.4s, #7
4325 sqxtun v1.8b, v1.8h
4326 subs w5, w5, #1
4327 st1 {v1.8b}, [x0], x1
4328.endm
43291: calc_all
4330.purgem calc
43312: ret
4332endfunc
4333
4334function ff_hevc_put_hevc_qpel_bi_hv12_8_neon_i8mm, export=1
4335 stp x6, x7, [sp, #-80]!
4336 stp x4, x5, [sp, #16]
4337 stp x2, x3, [sp, #32]
4338 stp x0, x1, [sp, #48]
4339 str x30, [sp, #64]
4340 bl X(ff_hevc_put_hevc_qpel_bi_hv8_8_neon_i8mm)
4341 ldp x4, x5, [sp, #16]
4342 ldp x2, x3, [sp, #32]
4343 ldp x0, x1, [sp, #48]
4344 ldp x6, x7, [sp], #64
4345 add x4, x4, #16
4346 add x2, x2, #8
4347 add x0, x0, #8
4348 bl X(ff_hevc_put_hevc_qpel_bi_hv4_8_neon_i8mm)
4349 ldr x30, [sp], #16
4350 ret
4351endfunc
4352
4353function ff_hevc_put_hevc_qpel_bi_hv16_8_neon_i8mm, export=1
4354 add w10, w5, #7
4355 lsl x10, x10, #7
4356 sub sp, sp, x10 // tmp_array
4357 stp x7, x30, [sp, #-48]!
4358 stp x4, x5, [sp, #16]
4359 stp x0, x1, [sp, #32]
4360 add x0, sp, #48
4361 sub x1, x2, x3, lsl #1
4362 sub x1, x1, x3
4363 mov x2, x3
4364 add w3, w5, #7
4365 mov x4, x6
4366 bl X(ff_hevc_put_hevc_qpel_h16_8_neon_i8mm)
4367 ldp x4, x5, [sp, #16]
4368 ldp x0, x1, [sp, #32]
4369 ldp x7, x30, [sp], #48
4370 mov x6, #16 // width
4371.Lqpel_bi_hv16_loop:
4372 load_qpel_filterh x7, x8
4373 mov x9, #(MAX_PB_SIZE * 2)
4374 mov x10, x6
43750: mov x8, sp // src
4376 ld1 {v16.8h, v17.8h}, [x8], x9
4377 mov w11, w5 // height
4378 ld1 {v18.8h, v19.8h}, [x8], x9
4379 mov x12, x4 // src2
4380 ld1 {v20.8h, v21.8h}, [x8], x9
4381 mov x7, x0 // dst
4382 ld1 {v22.8h, v23.8h}, [x8], x9
4383 ld1 {v24.8h, v25.8h}, [x8], x9
4384 ld1 {v26.8h, v27.8h}, [x8], x9
4385 ld1 {v28.8h, v29.8h}, [x8], x9
4386.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15
4387 ld1 {\tmp0\().8h, \tmp1\().8h}, [x8], x9
4388 calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4389 calc_qpelh2 v2, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sshr
4390 calc_qpelh v3, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sshr
4391 calc_qpelh2 v4, v4, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sshr
4392 ld1 {v5.8h, v6.8h}, [x12], x9 // src2
4393 saddw v1.4s, v1.4s, v5.4h
4394 saddw2 v2.4s, v2.4s, v5.8h
4395 saddw v3.4s, v3.4s, v6.4h
4396 saddw2 v4.4s, v4.4s, v6.8h
4397 rshrn v1.4h, v1.4s, #7
4398 rshrn2 v1.8h, v2.4s, #7
4399 rshrn v2.4h, v3.4s, #7
4400 rshrn2 v2.8h, v4.4s, #7
4401 sqxtun v1.8b, v1.8h
4402 sqxtun2 v1.16b, v2.8h
4403 subs x11, x11, #1
4404 st1 {v1.16b}, [x7], x1
4405.endm
44061: calc_all2
4407.purgem calc
44082: add x0, x0, #16
4409 add sp, sp, #32
4410 subs x10, x10, #16
4411 add x4, x4, #32
4412 b.ne 0b
4413 add w10, w5, #7
4414 lsl x10, x10, #7
4415 sub x10, x10, x6, lsl #1 // part of first line
4416 add sp, sp, x10 // tmp_array without first line
4417 ret
4418endfunc
4419
4420function ff_hevc_put_hevc_qpel_bi_hv24_8_neon_i8mm, export=1
4421 stp x6, x7, [sp, #-80]!
4422 stp x4, x5, [sp, #16]
4423 stp x2, x3, [sp, #32]
4424 stp x0, x1, [sp, #48]
4425 str x30, [sp, #64]
4426 bl X(ff_hevc_put_hevc_qpel_bi_hv16_8_neon_i8mm)
4427 ldp x4, x5, [sp, #16]
4428 ldp x2, x3, [sp, #32]
4429 ldp x0, x1, [sp, #48]
4430 ldp x6, x7, [sp], #64
4431 add x4, x4, #32
4432 add x2, x2, #16
4433 add x0, x0, #16
4434 bl X(ff_hevc_put_hevc_qpel_bi_hv8_8_neon_i8mm)
4435 ldr x30, [sp], #16
4436 ret
4437endfunc
4438
4439function ff_hevc_put_hevc_qpel_bi_hv32_8_neon_i8mm, export=1
4440 add w10, w5, #7
4441 lsl x10, x10, #7
4442 sub sp, sp, x10 // tmp_array
4443 stp x7, x30, [sp, #-48]!
4444 stp x4, x5, [sp, #16]
4445 stp x0, x1, [sp, #32]
4446 add x0, sp, #48
4447 sub x1, x2, x3, lsl #1
4448 mov x2, x3
4449 sub x1, x1, x3
4450 add w3, w5, #7
4451 mov x4, x6
4452 bl X(ff_hevc_put_hevc_qpel_h32_8_neon_i8mm)
4453 ldp x4, x5, [sp, #16]
4454 ldp x0, x1, [sp, #32]
4455 ldp x7, x30, [sp], #48
4456 mov x6, #32 // width
4457 b .Lqpel_bi_hv16_loop
4458endfunc
4459
4460function ff_hevc_put_hevc_qpel_bi_hv48_8_neon_i8mm, export=1
4461 add w10, w5, #7
4462 lsl x10, x10, #7
4463 sub sp, sp, x10 // tmp_array
4464 stp x7, x30, [sp, #-48]!
4465 stp x4, x5, [sp, #16]
4466 stp x0, x1, [sp, #32]
4467 add x0, sp, #48
4468 sub x1, x2, x3, lsl #1
4469 mov x2, x3
4470 sub x1, x1, x3
4471 add w3, w5, #7
4472 mov x4, x6
4473 bl X(ff_hevc_put_hevc_qpel_h48_8_neon_i8mm)
4474 ldp x4, x5, [sp, #16]
4475 ldp x0, x1, [sp, #32]
4476 ldp x7, x30, [sp], #48
4477 mov x6, #48 // width
4478 b .Lqpel_bi_hv16_loop
4479endfunc
4480
4481function ff_hevc_put_hevc_qpel_bi_hv64_8_neon_i8mm, export=1
4482 add w10, w5, #7
4483 lsl x10, x10, #7
4484 sub sp, sp, x10 // tmp_array
4485 stp x7, x30, [sp, #-48]!
4486 stp x4, x5, [sp, #16]
4487 stp x0, x1, [sp, #32]
4488 add x0, sp, #48
4489 sub x1, x2, x3, lsl #1
4490 mov x2, x3
4491 sub x1, x1, x3
4492 add w3, w5, #7
4493 mov x4, x6
4494 bl X(ff_hevc_put_hevc_qpel_h64_8_neon_i8mm)
4495 ldp x4, x5, [sp, #16]
4496 ldp x0, x1, [sp, #32]
4497 ldp x7, x30, [sp], #48
4498 mov x6, #64 // width
4499 b .Lqpel_bi_hv16_loop
4500endfunc
4501
4203DISABLE_I8MM4502DISABLE_I8MM
4204#endif // HAVE_I8MM4503#endif // HAVE_I8MM

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