History

lavu/riscv: count bytes rather than words for bswap32

This removes the dependency on Zba at essentially zero cost.

Rémi Denis-Courmont committed 2 years ago

Commit bd0c3ed1 parent 5171baa5 files · +13 −13Browse files

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

Unified · Split

2 files
  1. libavcodec/riscv/bswapdsp_init.c +4 −4
  2. libavcodec/riscv/bswapdsp_rvb.S +2 −1
libavcodec/riscv/bswapdsp_init.c+4−4
@@ -33,15 +33,15 @@ av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c) · 32 unmodified lines
33#if HAVE_RV33#if HAVE_RV
34 int flags = av_get_cpu_flags();34 int flags = av_get_cpu_flags();
35 35
36 if (flags & AV_CPU_FLAG_RVB_ADDR) {
37#if (__riscv_xlen >= 64)36#if (__riscv_xlen >= 64)
38 if (flags & AV_CPU_FLAG_RVB_BASIC)37 if (flags & AV_CPU_FLAG_RVB_BASIC)
39 c->bswap_buf = ff_bswap32_buf_rvb;38 c->bswap_buf = ff_bswap32_buf_rvb;
40#endif39#endif
41#if HAVE_RVV40#if HAVE_RVV
41 if (flags & AV_CPU_FLAG_RVB_ADDR) {
42 if (flags & AV_CPU_FLAG_RVV_I32)42 if (flags & AV_CPU_FLAG_RVV_I32)
43 c->bswap16_buf = ff_bswap16_buf_rvv;43 c->bswap16_buf = ff_bswap16_buf_rvv;
44#endif
45 }44 }
46#endif45#endif
46#endif
47}47}
libavcodec/riscv/bswapdsp_rvb.S+2−1
@@ -23,8 +23,9 @@ · 22 unmodified lines
23#include "libavutil/riscv/bswap_rvb.S"23#include "libavutil/riscv/bswap_rvb.S"
24 24
25#if (__riscv_xlen >= 64)25#if (__riscv_xlen >= 64)
26func ff_bswap32_buf_rvb, zba, zbb26func ff_bswap32_buf_rvb, zbb
27 lpad 027 lpad 0
28 slli a2, a2, 2
28 bswap32_rvb a0, a1, a229 bswap32_rvb a0, a1, a2
29endfunc30endfunc
30#endif31#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