Skip to content

Commit

Permalink
added sve
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Apr 22, 2024
1 parent 5ad3577 commit 5602fef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sampler/Window4RowSampler-inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,17 @@ class WeightedWindow4RowSampler : public ScaleRowSampler<uint8_t> {
}

void sample(const int y) override {
#if WEIGHTED_WINDOW4_HWY
const FixedTag<float32_t, 4> dfx4;
const FixedTag<int32_t, 4> dix4;
const FixedTag<uint32_t, 4> dux4;
const FixedTag<uint8_t, 4> du8x4;
using VI4 = Vec<decltype(dix4)>;
using VF4 = Vec<decltype(dfx4)>;
using VU8x4 = Vec<decltype(du8x4)>;
const VF4 vfZeros = Zero(dfx4);
const VF4 maxColorsV = Set(dfx4, maxColors);
#endif

auto dst = reinterpret_cast<uint8_t *>(reinterpret_cast<uint8_t *>(this->mDestination) + y * this->dstStride);

Expand Down Expand Up @@ -540,12 +544,15 @@ class WeightedWindow4RowSamplerF16Bit : public ScaleRowSampler<uint16_t> {
}

void sample(const int y) override {
#if WEIGHTED_WINDOW4_HWY
const FixedTag<float32_t, 4> dfx4;
const FixedTag<int32_t, 4> dix4;
const FixedTag<hwy::float16_t, 4> df16x4;
using VI4 = Vec<decltype(dix4)>;
using VF4 = Vec<decltype(dfx4)>;
using VF16x4 = Vec<decltype(df16x4)>;
const int mMaxWidth = this->inputWidth - 1;
#endif

const auto src8 = reinterpret_cast<const uint8_t *>(this->mSource);
auto dst16 = reinterpret_cast<uint16_t *>(reinterpret_cast<uint8_t *>(this->mDestination) + y * this->dstStride);
Expand Down
3 changes: 3 additions & 0 deletions src/sampler/Window6RowSampler-inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,15 @@ class WeightedWindow6RowSamplerF16Bit : public ScaleRowSampler<uint16_t> {
}

void sample(const int y) override {
#if WEIGHTED_WINDOW6_HWY
const FixedTag<hwy::float32_t, 4> dfx4;
const FixedTag<int32_t, 4> dix4;
const FixedTag<hwy::float16_t, 4> df16x4;
using VI4 = Vec<decltype(dix4)>;
using VF4 = Vec<decltype(dfx4)>;
using VF16x4 = Vec<decltype(df16x4)>;
const int mMaxWidth = this->inputWidth - 1;
#endif

const auto src8 = reinterpret_cast<const uint8_t *>(this->mSource);
auto dst16 = reinterpret_cast<uint16_t *>(reinterpret_cast<uint8_t *>(this->mDestination) + y * this->dstStride);
Expand Down

0 comments on commit 5602fef

Please sign in to comment.