History

lavc/h264dsp: R-V V high-depth idct_add{,intra}16, idct8_add4

As with 8-bit, this tends to be faster, but results are all over the place due to the variable distribution of non-zero coefficients.

Rémi Denis-Courmont committed 2 years ago

Commit 483fd731 parent 90672972 files · +161 −92Browse files

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

Unified · Split

2 files
  1. libavcodec/riscv/h264dsp_init.c +45 −61
  2. libavcodec/riscv/h264idct_rvv.S +116 −31
libavcodec/riscv/h264dsp_init.c+45−61
@@ -41,26 +41,27 @@ void ff_h264_h_loop_filter_luma_8_rvv(uint8_t *pix, ptrdiff_t stride, · 40 unmodified lines
41void ff_h264_h_loop_filter_luma_mbaff_8_rvv(uint8_t *pix, ptrdiff_t stride,41void ff_h264_h_loop_filter_luma_mbaff_8_rvv(uint8_t *pix, ptrdiff_t stride,
42 int alpha, int beta, int8_t *tc0);42 int alpha, int beta, int8_t *tc0);
43 43
44void ff_h264_idct_add_8_rvv(uint8_t *dst, int16_t *block, int stride);44#define IDCT_DEPTH(depth) \
45void ff_h264_idct8_add_8_rvv(uint8_t *dst, int16_t *block, int stride);45void ff_h264_idct_add_##depth##_rvv(uint8_t *d, int16_t *s, int stride); \
46void ff_h264_idct_add16_8_rvv(uint8_t *dst, const int *blockoffset,46void ff_h264_idct8_add_##depth##_rvv(uint8_t *d, int16_t *s, int stride); \
47 int16_t *block, int stride,47void ff_h264_idct4_dc_add_##depth##_rvv(uint8_t *, int16_t *, int); \
48 const uint8_t nnzc[5 * 8]);48void ff_h264_idct8_dc_add_##depth##_rvv(uint8_t *, int16_t *, int); \
49void ff_h264_idct_add16intra_8_rvv(uint8_t *dst, const int *blockoffset,49void ff_h264_idct_add16_##depth##_rvv(uint8_t *d, const int *soffset, \
50 int16_t *block, int stride,50 int16_t *s, int stride, \
51 const uint8_t nnzc[5 * 8]);51 const uint8_t nnzc[5 * 8]); \
52void ff_h264_idct8_add4_8_rvv(uint8_t *dst, const int *blockoffset,52void ff_h264_idct_add16intra_##depth##_rvv(uint8_t *d, const int *soffset, \
53 int16_t *block, int stride,53 int16_t *s, int stride, \
54 const uint8_t nnzc[5 * 8]);54 const uint8_t nnzc[5 * 8]); \
55 55void ff_h264_idct8_add4_##depth##_rvv(uint8_t *d, const int *soffset, \
56void ff_h264_idct_add_9_rvv(uint8_t *dst, int16_t *block, int stride);56 int16_t *s, int stride, \
57void ff_h264_idct8_add_9_rvv(uint8_t *dst, int16_t *block, int stride);57 const uint8_t nnzc[5 * 8]);
58void ff_h264_idct_add_10_rvv(uint8_t *dst, int16_t *block, int stride);58
59void ff_h264_idct8_add_10_rvv(uint8_t *dst, int16_t *block, int stride);59IDCT_DEPTH(8)
60void ff_h264_idct_add_12_rvv(uint8_t *dst, int16_t *block, int stride);60IDCT_DEPTH(9)
61void ff_h264_idct8_add_12_rvv(uint8_t *dst, int16_t *block, int stride);61IDCT_DEPTH(10)
62void ff_h264_idct_add_14_rvv(uint8_t *dst, int16_t *block, int stride);62IDCT_DEPTH(12)
63void ff_h264_idct8_add_14_rvv(uint8_t *dst, int16_t *block, int stride);63IDCT_DEPTH(14)
64#undef IDCT_DEPTH
64 65
65void ff_h264_add_pixels8_8_rvv(uint8_t *dst, int16_t *block, int stride);66void ff_h264_add_pixels8_8_rvv(uint8_t *dst, int16_t *block, int stride);
66void ff_h264_add_pixels4_8_rvv(uint8_t *dst, int16_t *block, int stride);67void ff_h264_add_pixels4_8_rvv(uint8_t *dst, int16_t *block, int stride);
@@ -69,16 +70,6 @@ void ff_h264_add_pixels4_16_rvv(uint8_t *dst, int16_t *block, int stride); · 2 unmodified lines
69 70
70extern int ff_startcode_find_candidate_rvb(const uint8_t *, int);71extern int ff_startcode_find_candidate_rvb(const uint8_t *, int);
71extern int ff_startcode_find_candidate_rvv(const uint8_t *, int);72extern int ff_startcode_find_candidate_rvv(const uint8_t *, int);
72void ff_h264_idct4_dc_add_8_rvv(uint8_t *, int16_t *, int);
73void ff_h264_idct8_dc_add_8_rvv(uint8_t *, int16_t *, int);
74void ff_h264_idct4_dc_add_9_rvv(uint8_t *, int16_t *, int);
75void ff_h264_idct8_dc_add_9_rvv(uint8_t *, int16_t *, int);
76void ff_h264_idct4_dc_add_10_rvv(uint8_t *, int16_t *, int);
77void ff_h264_idct8_dc_add_10_rvv(uint8_t *, int16_t *, int);
78void ff_h264_idct4_dc_add_12_rvv(uint8_t *, int16_t *, int);
79void ff_h264_idct8_dc_add_12_rvv(uint8_t *, int16_t *, int);
80void ff_h264_idct4_dc_add_14_rvv(uint8_t *, int16_t *, int);
81void ff_h264_idct8_dc_add_14_rvv(uint8_t *, int16_t *, int);
82 73
83av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int bit_depth,74av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int bit_depth,
84 const int chroma_format_idc)75 const int chroma_format_idc)
@@ -120,38 +111,31 @@ av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int bit_depth, · 35 unmodified lines
120 }111 }
121 dsp->h264_add_pixels4_clear = ff_h264_add_pixels4_8_rvv;112 dsp->h264_add_pixels4_clear = ff_h264_add_pixels4_8_rvv;
122 }113 }
123 if (bit_depth == 9) {114
124 if (zvl128b) {115#define IDCT_DEPTH(depth) \
125 dsp->h264_idct_dc_add = ff_h264_idct4_dc_add_9_rvv;116 if (bit_depth == depth) { \
126 dsp->h264_idct8_dc_add = ff_h264_idct8_dc_add_9_rvv;117 if (zvl128b) \
127 dsp->h264_idct_add = ff_h264_idct_add_9_rvv;118 dsp->h264_idct_add = ff_h264_idct_add_##depth##_rvv; \
128 }119 if (flags & AV_CPU_FLAG_RVB_ADDR) \
129 dsp->h264_idct8_add = ff_h264_idct8_add_9_rvv;120 dsp->h264_idct8_add = ff_h264_idct8_add_##depth##_rvv; \
130 }121 if (zvl128b && (flags & AV_CPU_FLAG_RVB_ADDR)) { \
131 if (bit_depth == 10) {122 dsp->h264_idct_dc_add = ff_h264_idct4_dc_add_##depth##_rvv; \
132 if (zvl128b) {123 dsp->h264_idct8_dc_add = ff_h264_idct8_dc_add_##depth##_rvv; \
133 dsp->h264_idct_dc_add = ff_h264_idct4_dc_add_10_rvv;124 } \
134 dsp->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_rvv;125 if (__riscv_xlen == 64 && zvl128b) { \
135 dsp->h264_idct_add = ff_h264_idct_add_10_rvv;126 dsp->h264_idct_add16 = ff_h264_idct_add16_##depth##_rvv; \
136 }127 dsp->h264_idct_add16intra = \
137 dsp->h264_idct8_add = ff_h264_idct8_add_10_rvv;128 ff_h264_idct_add16intra_##depth##_rvv; \
138 }129 } \
139 if (bit_depth == 12) {130 if (__riscv_xlen == 64 && (flags & AV_CPU_FLAG_RVB_ADDR)) \
140 if (zvl128b) {131 dsp->h264_idct8_add4 = ff_h264_idct8_add4_##depth##_rvv; \
141 dsp->h264_idct_add = ff_h264_idct_add_12_rvv;
142 dsp->h264_idct_dc_add = ff_h264_idct4_dc_add_12_rvv;
143 dsp->h264_idct8_dc_add = ff_h264_idct8_dc_add_12_rvv;
144 }
145 dsp->h264_idct8_add = ff_h264_idct8_add_12_rvv;
146 }
147 if (bit_depth == 14) {
148 if (zvl128b) {
149 dsp->h264_idct_add = ff_h264_idct_add_14_rvv;
150 dsp->h264_idct_dc_add = ff_h264_idct4_dc_add_14_rvv;
151 dsp->h264_idct8_dc_add = ff_h264_idct8_dc_add_14_rvv;
152 }
153 dsp->h264_idct8_add = ff_h264_idct8_add_14_rvv;
154 }132 }
133
134 IDCT_DEPTH(9)
135 IDCT_DEPTH(10)
136 IDCT_DEPTH(12)
137 IDCT_DEPTH(14)
138
155 if (bit_depth > 8 && zvl128b) {139 if (bit_depth > 8 && zvl128b) {
156 dsp->h264_add_pixels8_clear = ff_h264_add_pixels8_16_rvv;140 dsp->h264_add_pixels8_clear = ff_h264_add_pixels8_16_rvv;
157 if (flags & AV_CPU_FLAG_RVV_I64)141 if (flags & AV_CPU_FLAG_RVV_I64)
libavcodec/riscv/h264idct_rvv.S+116−31
@@ -107,6 +107,7 @@ endfunc · 106 unmodified lines
107 107
108func ff_h264_idct_add_16_rvv, zve32x108func ff_h264_idct_add_16_rvv, zve32x
109 csrwi vxrm, 0109 csrwi vxrm, 0
110.Lidct_add4_16_rvv:
110 vsetivli zero, 4, e32, m1, ta, ma111 vsetivli zero, 4, e32, m1, ta, ma
111 addi t1, a1, 1 * 4 * 4112 addi t1, a1, 1 * 4 * 4
112 vle32.v v0, (a1)113 vle32.v v0, (a1)
@@ -147,7 +148,7 @@ func ff_h264_idct_add_16_rvv, zve32x · 34 unmodified lines
147 vmax.vx v\n, v\n, zero148 vmax.vx v\n, v\n, zero
148 .endr149 .endr
149 .irp n,0,1,2,3150 .irp n,0,1,2,3
150 vmin.vx v\n, v\n, a3151 vmin.vx v\n, v\n, a5
151 .endr152 .endr
152 vsetvli zero, zero, e16, mf2, ta, ma153 vsetvli zero, zero, e16, mf2, ta, ma
153 vncvt.x.x.w v4, v0154 vncvt.x.x.w v4, v0
@@ -295,9 +296,10 @@ func ff_h264_idct8_add_8_rvv, zve32x · 141 unmodified lines
295endfunc296endfunc
296 297
297func ff_h264_idct8_add_16_rvv, zve32x298func ff_h264_idct8_add_16_rvv, zve32x
298 li a4, 8
299 csrwi vxrm, 0299 csrwi vxrm, 0
300 vsetivli a5, 8, e32, m1, ta, ma300.Lidct8_add_16_rvv:
301 li a4, 8
302 vsetivli a3, 8, e32, m1, ta, ma
3011:3031:
302 addi t1, a1, 1 * 8 * 4304 addi t1, a1, 1 * 8 * 4
303 vle32.v v0, (a1)305 vle32.v v0, (a1)
@@ -313,11 +315,11 @@ func ff_h264_idct8_add_16_rvv, zve32x · 9 unmodified lines
313 vle32.v v5, (t5)315 vle32.v v5, (t5)
314 addi a7, a1, 7 * 8 * 4316 addi a7, a1, 7 * 8 * 4
315 vle32.v v6, (t6)317 vle32.v v6, (t6)
316 sub a4, a4, a5318 sub a4, a4, a3
317 vle32.v v7, (a7)319 vle32.v v7, (a7)
318 jal t0, ff_h264_idct8_rvv320 jal t0, ff_h264_idct8_rvv
319 vse32.v v0, (a1)321 vse32.v v0, (a1)
320 sh2add a1, a5, a1322 sh2add a1, a3, a1
321 vse32.v v1, (t1)323 vse32.v v1, (t1)
322 vse32.v v2, (t2)324 vse32.v v2, (t2)
323 vse32.v v3, (t3)325 vse32.v v3, (t3)
@@ -329,7 +331,7 @@ func ff_h264_idct8_add_16_rvv, zve32x · 5 unmodified lines
329 331
330 addi a1, a1, -8 * 4332 addi a1, a1, -8 * 4
331 li a4, 8333 li a4, 8
332 slli a6, a5, 3 + 2334 slli a6, a3, 3 + 2
3332:3352:
334 vsetvli zero, zero, e32, m1, ta, ma336 vsetvli zero, zero, e32, m1, ta, ma
335 vlseg8e32.v v0, (a1)337 vlseg8e32.v v0, (a1)
@@ -348,7 +350,7 @@ func ff_h264_idct8_add_16_rvv, zve32x · 12 unmodified lines
348 vle16.v v21, (t5)350 vle16.v v21, (t5)
349 add a7, t6, a2351 add a7, t6, a2
350 vle16.v v22, (t6)352 vle16.v v22, (t6)
351 sub a4, a4, a5353 sub a4, a4, a3
352 vle16.v v23, (a7)354 vle16.v v23, (a7)
353 .irp n,0,1,2,3,4,5,6,7355 .irp n,0,1,2,3,4,5,6,7
354 vssra.vi v\n, v\n, 6356 vssra.vi v\n, v\n, 6
@@ -368,7 +370,7 @@ func ff_h264_idct8_add_16_rvv, zve32x · 13 unmodified lines
368 vmax.vx v\n, v\n, zero370 vmax.vx v\n, v\n, zero
369 .endr371 .endr
370 .irp n,0,1,2,3,4,5,6,7372 .irp n,0,1,2,3,4,5,6,7
371 vmin.vx v\n, v\n, a3373 vmin.vx v\n, v\n, a5
372 .endr374 .endr
373 vsetvli zero, zero, e16, mf2, ta, ma375 vsetvli zero, zero, e16, mf2, ta, ma
374 vncvt.x.x.w v16, v0376 vncvt.x.x.w v16, v0
@@ -380,7 +382,7 @@ func ff_h264_idct8_add_16_rvv, zve32x · 5 unmodified lines
380 vncvt.x.x.w v22, v6382 vncvt.x.x.w v22, v6
381 vncvt.x.x.w v23, v7383 vncvt.x.x.w v23, v7
382 vse16.v v16, (a0)384 vse16.v v16, (a0)
383 sh1add a0, a5, a0385 sh1add a0, a3, a0
384 vse16.v v17, (t1)386 vse16.v v17, (t1)
385 vse16.v v18, (t2)387 vse16.v v18, (t2)
386 vse16.v v19, (t3)388 vse16.v v19, (t3)
@@ -400,12 +402,12 @@ endfunc · 13 unmodified lines
400 402
401.irp depth, 9, 10, 12, 14403.irp depth, 9, 10, 12, 14
402func ff_h264_idct_add_\depth\()_rvv, zve32x404func ff_h264_idct_add_\depth\()_rvv, zve32x
403 li a3, (1 << \depth) - 1405 li a5, (1 << \depth) - 1
404 j ff_h264_idct_add_16_rvv406 j ff_h264_idct_add_16_rvv
405endfunc407endfunc
406 408
407func ff_h264_idct8_add_\depth\()_rvv, zve32x409func ff_h264_idct8_add_\depth\()_rvv, zve32x
408 li a3, (1 << \depth) - 1410 li a5, (1 << \depth) - 1
409 j ff_h264_idct8_add_16_rvv411 j ff_h264_idct8_add_16_rvv
410endfunc412endfunc
411.endr413.endr
@@ -416,13 +418,13 @@ const ff_h264_scan8 · 4 unmodified lines
416endconst418endconst
417 419
418#if (__riscv_xlen == 64)420#if (__riscv_xlen == 64)
419.irp depth, 8421.irp depth, 8, 16
420func ff_h264_idct_add16_\depth\()_rvv, zve32x422func ff_h264_idct_add16_\depth\()_rvv, zve32x
421 csrwi vxrm, 0423 csrwi vxrm, 0
422 addi sp, sp, -80424 addi sp, sp, -96
423 lla t0, ff_h264_scan8425 lla t0, ff_h264_scan8
424 sd s0, (sp)426 sd s0, (sp)
425 li t1, 32 << (\depth > 8)427 li t1, 32 * (\depth / 8)
426 mv s0, sp428 mv s0, sp
427 sd ra, 8(sp)429 sd ra, 8(sp)
428 sd s1, 16(sp)430 sd s1, 16(sp)
@@ -432,9 +434,19 @@ func ff_h264_idct_add16_\depth\()_rvv, zve32x · 3 unmodified lines
432 sd s5, 48(sp)434 sd s5, 48(sp)
433 sd s6, 56(sp)435 sd s6, 56(sp)
434 sd s7, 64(sp)436 sd s7, 64(sp)
437.if \depth > 8
438 sd s8, 72(sp)
439 sd s9, 80(sp)
440 mv s8, a5
441 mv s9, a6
442.endif
435 vsetivli zero, 16, e8, m1, ta, ma443 vsetivli zero, 16, e8, m1, ta, ma
436 vle8.v v8, (t0)444 vle8.v v8, (t0)
445.if \depth == 8
437 vlse16.v v16, (a2), t1446 vlse16.v v16, (a2), t1
447.else
448 vlse32.v v16, (a2), t1
449.endif
438 vluxei8.v v12, (a4), v8450 vluxei8.v v12, (a4), v8
439.if \depth == 8451.if \depth == 8
440 vsetvli zero, zero, e16, m2, ta, ma452 vsetvli zero, zero, e16, m2, ta, ma
@@ -464,17 +476,28 @@ func ff_h264_idct_add16_\depth\()_rvv, zve32x · 23 unmodified lines
464 mv a1, s6476 mv a1, s6
465 mv a2, s7477 mv a2, s7
466 add a0, s4, t2478 add a0, s4, t2
467 beqz t1, 2f # if (nnz == 1 && block[i * 16])479.if \depth > 8
468 call ff_h264_idct_dc_add_\depth\()_c480 mv a5, s8
481.endif
482 bnez t1, 2f # if (nnz == 1 && block[i * 16])
483 jal .Lidct_add4_\depth\()_rvv
469 j 3f484 j 3f
4702:4852:
471 call .Lidct_add4_\depth\()_rvv486.if \depth == 8
487 call ff_h264_idct_dc_add_\depth\()_c
488.else
489 jalr s9
490.endif
4723:4913:
473 srli s3, s3, 1492 srli s3, s3, 1
474 addi s5, s5, 4493 addi s5, s5, 4
475 addi s6, s6, 16 * 2 << (\depth > 8)494 addi s6, s6, 16 * 2 * (\depth / 8)
476 bnez s1, 1b495 bnez s1, 1b
477 496
497.if \depth > 8
498 ld s9, 80(sp)
499 ld s8, 72(sp)
500.endif
478 ld s7, 64(sp)501 ld s7, 64(sp)
479 ld s6, 56(sp)502 ld s6, 56(sp)
480 ld s5, 48(sp)503 ld s5, 48(sp)
@@ -484,16 +507,16 @@ func ff_h264_idct_add16_\depth\()_rvv, zve32x · 3 unmodified lines
484 ld s1, 16(sp)507 ld s1, 16(sp)
485 ld ra, 8(sp)508 ld ra, 8(sp)
486 ld s0, 0(sp)509 ld s0, 0(sp)
487 addi sp, sp, 80510 addi sp, sp, 96
488 ret511 ret
489endfunc512endfunc
490 513
491func ff_h264_idct_add16intra_\depth\()_rvv, zve32x514func ff_h264_idct_add16intra_\depth\()_rvv, zve32x
492 csrwi vxrm, 0515 csrwi vxrm, 0
493 addi sp, sp, -80516 addi sp, sp, -96
494 lla t0, ff_h264_scan8517 lla t0, ff_h264_scan8
495 sd s0, (sp)518 sd s0, (sp)
496 li t1, 32 << (\depth > 8)519 li t1, 32 * (\depth / 8)
497 mv s0, sp520 mv s0, sp
498 sd ra, 8(sp)521 sd ra, 8(sp)
499 sd s1, 16(sp)522 sd s1, 16(sp)
@@ -503,9 +526,19 @@ func ff_h264_idct_add16intra_\depth\()_rvv, zve32x · 3 unmodified lines
503 sd s5, 48(sp)526 sd s5, 48(sp)
504 sd s6, 56(sp)527 sd s6, 56(sp)
505 sd s7, 64(sp)528 sd s7, 64(sp)
529.if \depth > 8
530 sd s8, 72(sp)
531 sd s9, 80(sp)
532 mv s8, a5
533 mv s9, a6
534.endif
506 vsetivli zero, 16, e8, m1, ta, ma535 vsetivli zero, 16, e8, m1, ta, ma
507 vle8.v v8, (t0)536 vle8.v v8, (t0)
537.if \depth == 8
508 vlse16.v v16, (a2), t1538 vlse16.v v16, (a2), t1
539.else
540 vlse32.v v16, (a2), t1
541.endif
509 vluxei8.v v12, (a4), v8542 vluxei8.v v12, (a4), v8
510.if \depth == 8543.if \depth == 8
511 vsetvli zero, zero, e16, m2, ta, ma544 vsetvli zero, zero, e16, m2, ta, ma
@@ -532,18 +565,29 @@ func ff_h264_idct_add16intra_\depth\()_rvv, zve32x · 20 unmodified lines
532 mv a1, s6565 mv a1, s6
533 mv a2, s7566 mv a2, s7
534 add a0, s4, t2567 add a0, s4, t2
568.if \depth > 8
569 mv a5, s8
570.endif
535 beqz t0, 2f # if (nnzc[scan8[i]])571 beqz t0, 2f # if (nnzc[scan8[i]])
536 call .Lidct_add4_\depth\()_rvv572 jal .Lidct_add4_\depth\()_rvv
537 j 3f573 j 3f
5382:5742:
539 beqz t1, 3f # if (block[i * 16])575 beqz t1, 3f # if (block[i * 16])
576.if \depth == 8
540 call ff_h264_idct_dc_add_\depth\()_c577 call ff_h264_idct_dc_add_\depth\()_c
578.else
579 jalr s9
580.endif
5413:5813:
542 srli s3, s3, 1582 srli s3, s3, 1
543 addi s5, s5, 4583 addi s5, s5, 4
544 addi s6, s6, 16 * 2 << (\depth > 8)584 addi s6, s6, 16 * 2 * (\depth / 8)
545 bnez s1, 1b585 bnez s1, 1b
546 586
587.if \depth > 8
588 ld s9, 80(sp)
589 ld s8, 72(sp)
590.endif
547 ld s7, 64(sp)591 ld s7, 64(sp)
548 ld s6, 56(sp)592 ld s6, 56(sp)
549 ld s5, 48(sp)593 ld s5, 48(sp)
@@ -553,16 +597,16 @@ func ff_h264_idct_add16intra_\depth\()_rvv, zve32x · 3 unmodified lines
553 ld s1, 16(sp)597 ld s1, 16(sp)
554 ld ra, 8(sp)598 ld ra, 8(sp)
555 ld s0, 0(sp)599 ld s0, 0(sp)
556 addi sp, sp, 80600 addi sp, sp, 96
557 ret601 ret
558endfunc602endfunc
559 603
560func ff_h264_idct8_add4_\depth\()_rvv, zve32x604func ff_h264_idct8_add4_\depth\()_rvv, zve32x
561 csrwi vxrm, 0605 csrwi vxrm, 0
562 addi sp, sp, -80606 addi sp, sp, -96
563 lla t0, ff_h264_scan8607 lla t0, ff_h264_scan8
564 sd s0, (sp)608 sd s0, (sp)
565 li t1, 4 * 32 << (\depth > 8)609 li t1, 4 * 32 * (\depth / 8)
566 mv s0, sp610 mv s0, sp
567 li t2, 4611 li t2, 4
568 sd ra, 8(sp)612 sd ra, 8(sp)
@@ -573,9 +617,19 @@ func ff_h264_idct8_add4_\depth\()_rvv, zve32x · 4 unmodified lines
573 sd s5, 48(sp)617 sd s5, 48(sp)
574 sd s6, 56(sp)618 sd s6, 56(sp)
575 sd s7, 64(sp)619 sd s7, 64(sp)
620.if \depth > 8
621 sd s8, 72(sp)
622 sd s9, 80(sp)
623 mv s8, a5
624 mv s9, a6
625.endif
576 vsetivli zero, 4, e8, mf4, ta, ma626 vsetivli zero, 4, e8, mf4, ta, ma
577 vlse8.v v8, (t0), t2627 vlse8.v v8, (t0), t2
628.if \depth == 8
578 vlse16.v v16, (a2), t1629 vlse16.v v16, (a2), t1
630.else
631 vlse32.v v16, (a2), t1
632.endif
579 vluxei8.v v12, (a4), v8633 vluxei8.v v12, (a4), v8
580.if \depth == 8634.if \depth == 8
581 vsetvli zero, zero, e16, mf2, ta, ma635 vsetvli zero, zero, e16, mf2, ta, ma
@@ -604,17 +658,28 @@ func ff_h264_idct8_add4_\depth\()_rvv, zve32x · 22 unmodified lines
604 mv a1, s6658 mv a1, s6
605 mv a2, s7659 mv a2, s7
606 add a0, s4, t2660 add a0, s4, t2
607 beqz t1, 2f # if (nnz == 1 && block[i * 16])661.if \depth > 8
608 call ff_h264_idct8_dc_add_\depth\()_c662 mv a5, s8
663.endif
664 bnez t1, 2f # if (nnz == 1 && block[i * 16])
665 jal .Lidct8_add_\depth\()_rvv
609 j 3f666 j 3f
6102:6672:
611 call .Lidct8_add_\depth\()_rvv668.if \depth == 8
669 call ff_h264_idct8_dc_add_\depth\()_c
670.else
671 jalr s9
672.endif
6123:6733:
613 srli s3, s3, 1674 srli s3, s3, 1
614 addi s5, s5, 4 * 4675 addi s5, s5, 4 * 4
615 addi s6, s6, 4 * 16 * 2 << (\depth > 8)676 addi s6, s6, 4 * 16 * 2 * (\depth / 8)
616 bnez s1, 1b677 bnez s1, 1b
617 678
679.if \depth > 8
680 ld s9, 80(sp)
681 ld s8, 72(sp)
682.endif
618 ld s7, 64(sp)683 ld s7, 64(sp)
619 ld s6, 56(sp)684 ld s6, 56(sp)
620 ld s5, 48(sp)685 ld s5, 48(sp)
@@ -624,8 +689,28 @@ func ff_h264_idct8_add4_\depth\()_rvv, zve32x · 3 unmodified lines
624 ld s1, 16(sp)689 ld s1, 16(sp)
625 ld ra, 8(sp)690 ld ra, 8(sp)
626 ld s0, 0(sp)691 ld s0, 0(sp)
627 addi sp, sp, 80692 addi sp, sp, 96
628 ret693 ret
629endfunc694endfunc
630.endr695.endr
696
697.irp depth, 9, 10, 12, 14
698func ff_h264_idct_add16_\depth\()_rvv, zve32x
699 li a5, (1 << \depth) - 1
700 lla a6, ff_h264_idct_dc_add_\depth\()_c
701 j ff_h264_idct_add16_16_rvv
702endfunc
703
704func ff_h264_idct_add16intra_\depth\()_rvv, zve32x
705 li a5, (1 << \depth) - 1
706 lla a6, ff_h264_idct_dc_add_\depth\()_c
707 j ff_h264_idct_add16intra_16_rvv
708endfunc
709
710func ff_h264_idct8_add4_\depth\()_rvv, zve32x
711 li a5, (1 << \depth) - 1
712 lla a6, ff_h264_idct8_dc_add_\depth\()_c
713 j ff_h264_idct8_add4_16_rvv
714endfunc
715.endr
631#endif716#endif

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