diff options
author | Bruce Lai <bruce.lai@sifive.com> | 2023-09-14 19:03:02 -0700 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-12-07 22:54:23 +0000 |
commit | 1dcbc3055352a7fe4eb5d35b183f7cb6d1938b98 (patch) | |
tree | e84b51014c8cb04aaabbebf965667a9ee1ebed93 | |
parent | def473f501acbd652cd4593fd2a90a067e8c9f1a (diff) | |
download | libyuv-1dcbc3055352a7fe4eb5d35b183f7cb6d1938b98.tar.gz |
Add HAS_SCALEARGBROWDOWNEVEN_RVV marco and disable it by default
HAS_SCALEARGBROWDOWNEVEN_RVV wasn't defined,
so we cannot use ScaleARGBRowDownEven_RVV & ScaleARGBRowDownEvenBox_RVV.
- Seperate to two conditional statements when selecting DownEven or DownEvenBox.
- Also, add HAS_SCALEARGBROWDOWNEVEN_RVV and disable it by default.
Bug: libyuv:965
Signed-off-by: Bruce Lai <bruce.lai@sifive.com>
Change-Id: Ic7ec40520b64131a456c6f3eea0639b3620f11ae
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4882441
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
-rw-r--r-- | include/libyuv/scale_row.h | 1 | ||||
-rw-r--r-- | source/scale_argb.cc | 10 | ||||
-rw-r--r-- | source/scale_rvv.cc | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/include/libyuv/scale_row.h b/include/libyuv/scale_row.h index c015d772..91bcbbc1 100644 --- a/include/libyuv/scale_row.h +++ b/include/libyuv/scale_row.h @@ -180,6 +180,7 @@ extern "C" { #if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) #define HAS_SCALEADDROW_RVV +// #define HAS_SCALEARGBROWDOWNEVEN_RVV #define HAS_SCALEUVROWDOWN4_RVV #define HAS_SCALEUVROWDOWNEVEN_RVV #if __riscv_v_intrinsic == 11000 diff --git a/source/scale_argb.cc b/source/scale_argb.cc index c8e0db9e..18bdeb86 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -284,10 +284,14 @@ static void ScaleARGBDownEven(int src_width, } } #endif +#if defined(HAS_SCALEARGBROWDOWNEVENBOX_RVV) + if (filtering && TestCpuFlag(kCpuHasRVV)) { + ScaleARGBRowDownEven = ScaleARGBRowDownEvenBox_RVV; + } +#endif #if defined(HAS_SCALEARGBROWDOWNEVEN_RVV) - if (TestCpuFlag(kCpuHasRVV)) { - ScaleARGBRowDownEven = - filtering ? ScaleARGBRowDownEvenBox_RVV : ScaleARGBRowDownEven_RVV; + if (!filtering && TestCpuFlag(kCpuHasRVV)) { + ScaleARGBRowDownEven = ScaleARGBRowDownEven_RVV; } #endif diff --git a/source/scale_rvv.cc b/source/scale_rvv.cc index fd14842d..de037e45 100644 --- a/source/scale_rvv.cc +++ b/source/scale_rvv.cc @@ -130,6 +130,7 @@ void ScaleARGBRowDown2Box_RVV(const uint8_t* src_argb, } #endif +#ifdef HAS_SCALEARGBROWDOWNEVEN_RVV void ScaleARGBRowDownEven_RVV(const uint8_t* src_argb, ptrdiff_t src_stride, int src_stepx, @@ -148,6 +149,7 @@ void ScaleARGBRowDownEven_RVV(const uint8_t* src_argb, dst += vl; } while (w > 0); } +#endif #ifdef HAS_SCALEARGBROWDOWNEVENBOX_RVV void ScaleARGBRowDownEvenBox_RVV(const uint8_t* src_argb, |