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
3333 #if HAVE_RV
3434 int flags = av_get_cpu_flags();
3535
36− if (flags & AV_CPU_FLAG_RVB_ADDR) {
3736 #if (__riscv_xlen >= 64)
38− if (flags & AV_CPU_FLAG_RVB_BASIC)
39− c->bswap_buf = ff_bswap32_buf_rvb;
37+ if (flags & AV_CPU_FLAG_RVB_BASIC)
38+ c->bswap_buf = ff_bswap32_buf_rvb;
4039 #endif
4140 #if HAVE_RVV
41+ if (flags & AV_CPU_FLAG_RVB_ADDR) {
4242 if (flags & AV_CPU_FLAG_RVV_I32)
4343 c->bswap16_buf = ff_bswap16_buf_rvv;
44−#endif
4544 }
4645 #endif
46+#endif
4747 }
libavcodec/riscv/bswapdsp_rvb.S+2−1
@@ -23,8 +23,9 @@ · 22 unmodified lines
2323 #include "libavutil/riscv/bswap_rvb.S"
2424
2525 #if (__riscv_xlen >= 64)
26−func ff_bswap32_buf_rvb, zba, zbb
26+func ff_bswap32_buf_rvb, zbb
2727 lpad 0
28+ slli a2, a2, 2
2829 bswap32_rvb a0, a1, a2
2930 endfunc
3031 #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