diff options
author | Sebastian Ramacher <sramacher@debian.org> | 2024-12-29 12:50:37 +0000 |
---|---|---|
committer | Sebastian Ramacher <sramacher@debian.org> | 2024-12-29 12:50:37 +0000 |
commit | 873c687c09e0a1a78a8f3601d31330ad1897e484 (patch) | |
tree | ff2fa2e2d27b55c002a6d46d50aab2c66e0bf21a /src/dsp/arm/film_grain_neon.cc | |
parent | 395b1f6877fbc2666383f3428f17400c35aa52a4 (diff) | |
parent | b9ae809f200982119d16ec9613f3db95eca923b9 (diff) | |
download | libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.tar.gz libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.tar.bz2 libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.zip |
Merge branch 'master' into 'scrub-obsolete'
# Conflicts:
# debian/changelog
Diffstat (limited to 'src/dsp/arm/film_grain_neon.cc')
-rw-r--r-- | src/dsp/arm/film_grain_neon.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/dsp/arm/film_grain_neon.cc b/src/dsp/arm/film_grain_neon.cc index 76e1151..cde887c 100644 --- a/src/dsp/arm/film_grain_neon.cc +++ b/src/dsp/arm/film_grain_neon.cc @@ -682,26 +682,14 @@ inline int16x8_t Clip3(const int16x8_t value, const int16x8_t low, template <int bitdepth, typename Pixel> inline int16x8_t GetScalingFactors(const int16_t scaling_lut[], - const Pixel* source) { + const Pixel* source, + const int valid_range = 8) { int16_t start_vals[8]; static_assert(bitdepth <= kBitdepth10, "NEON Film Grain is not yet implemented for 12bpp."); #if LIBGAV1_MSAN - memset(start_vals, 0, sizeof(start_vals)); + if (valid_range < 8) memset(start_vals, 0, sizeof(start_vals)); #endif - for (int i = 0; i < 8; ++i) { - assert(source[i] < (kScalingLookupTableSize << (bitdepth - kBitdepth8))); - start_vals[i] = scaling_lut[source[i]]; - } - return vld1q_s16(start_vals); -} - -template <int bitdepth, typename Pixel> -inline int16x8_t GetScalingFactors(const int16_t scaling_lut[], - const Pixel* source, const int valid_range) { - int16_t start_vals[8]; - static_assert(bitdepth <= kBitdepth10, - "NEON Film Grain is not yet implemented for 12bpp."); for (int i = 0; i < valid_range; ++i) { assert(source[i] < (kScalingLookupTableSize << (bitdepth - kBitdepth8))); start_vals[i] = scaling_lut[source[i]]; |