sws/riscv: depend on RVB and simplify accordingly

This commit is contained in:
Rémi Denis-Courmont 2024-07-27 14:30:17 +03:00
parent f30e5bf1f5
commit 210877c5fd
2 changed files with 5 additions and 7 deletions

View File

@ -50,16 +50,14 @@ av_cold void rgb2rgb_init_riscv(void)
shuffle_bytes_3210 = ff_shuffle_bytes_3210_rvb; shuffle_bytes_3210 = ff_shuffle_bytes_3210_rvb;
#endif #endif
#if HAVE_RVV #if HAVE_RVV
if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB)) {
shuffle_bytes_0321 = ff_shuffle_bytes_0321_rvv; shuffle_bytes_0321 = ff_shuffle_bytes_0321_rvv;
shuffle_bytes_2103 = ff_shuffle_bytes_2103_rvv; shuffle_bytes_2103 = ff_shuffle_bytes_2103_rvv;
shuffle_bytes_1230 = ff_shuffle_bytes_1230_rvv; shuffle_bytes_1230 = ff_shuffle_bytes_1230_rvv;
shuffle_bytes_3012 = ff_shuffle_bytes_3012_rvv; shuffle_bytes_3012 = ff_shuffle_bytes_3012_rvv;
interleaveBytes = ff_interleave_bytes_rvv; interleaveBytes = ff_interleave_bytes_rvv;
if (flags & AV_CPU_FLAG_RVB_BASIC) { uyvytoyuv422 = ff_uyvytoyuv422_rvv;
uyvytoyuv422 = ff_uyvytoyuv422_rvv; yuyvtoyuv422 = ff_yuyvtoyuv422_rvv;
yuyvtoyuv422 = ff_yuyvtoyuv422_rvv;
}
} }
#endif #endif
#endif #endif

View File

@ -39,7 +39,7 @@ av_cold static void ff_sws_init_range_convert_riscv(SwsContext *c, int flags)
if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat) && if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat) &&
c->dstBpc <= 14 && c->dstBpc <= 14 &&
(flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { (flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB)) {
bool from = c->srcRange != 0; bool from = c->srcRange != 0;
c->lumConvertRange = convs[from].lum; c->lumConvertRange = convs[from].lum;
@ -70,7 +70,7 @@ av_cold void ff_sws_init_swscale_riscv(SwsContext *c)
int flags = av_get_cpu_flags(); int flags = av_get_cpu_flags();
#if HAVE_RVV #if HAVE_RVV
if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB)) {
switch (c->srcFormat) { switch (c->srcFormat) {
case AV_PIX_FMT_ABGR: case AV_PIX_FMT_ABGR:
c->lumToYV12 = ff_abgr32ToY_rvv; c->lumToYV12 = ff_abgr32ToY_rvv;