diff options
author | Boyuan Yang <byang@debian.org> | 2021-11-07 08:50:18 -0500 |
---|---|---|
committer | Boyuan Yang <byang@debian.org> | 2021-11-07 08:50:18 -0500 |
commit | 320ef65362608ee1148c299d8d5d7618af34e470 (patch) | |
tree | c47911c219d1e35b8b0771e9e0176eff0e0d08ec /src/film_grain.h | |
parent | 2381d803c76105f44717d75f089ec37f51e5cfe4 (diff) | |
download | libgav1-320ef65362608ee1148c299d8d5d7618af34e470.tar.gz libgav1-320ef65362608ee1148c299d8d5d7618af34e470.tar.bz2 libgav1-320ef65362608ee1148c299d8d5d7618af34e470.zip |
New upstream version 0.17.0
Diffstat (limited to 'src/film_grain.h')
-rw-r--r-- | src/film_grain.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/film_grain.h b/src/film_grain.h index b588f6d..f2c1e93 100644 --- a/src/film_grain.h +++ b/src/film_grain.h @@ -103,6 +103,8 @@ class FilmGrain { private: using Pixel = typename std::conditional<bitdepth == 8, uint8_t, uint16_t>::type; + static constexpr int kScalingLutLength = + (kScalingLookupTableSize + kScalingLookupTablePadding) << (bitdepth - 8); bool Init(); @@ -156,13 +158,13 @@ class FilmGrain { GrainType u_grain_[kMaxChromaHeight * kMaxChromaWidth]; GrainType v_grain_[kMaxChromaHeight * kMaxChromaWidth]; // Scaling lookup tables. - uint8_t scaling_lut_y_[kScalingLookupTableSize + kScalingLookupTablePadding]; - uint8_t* scaling_lut_u_ = nullptr; - uint8_t* scaling_lut_v_ = nullptr; - // If allocated, this buffer is 256 * 2 bytes long and scaling_lut_u_ and + int16_t scaling_lut_y_[kScalingLutLength]; + int16_t* scaling_lut_u_ = nullptr; + int16_t* scaling_lut_v_ = nullptr; + // If allocated, this buffer is 256 * 2 values long and scaling_lut_u_ and // scaling_lut_v_ point into this buffer. Otherwise, scaling_lut_u_ and // scaling_lut_v_ point to scaling_lut_y_. - std::unique_ptr<uint8_t[]> scaling_lut_chroma_buffer_; + std::unique_ptr<int16_t[]> scaling_lut_chroma_buffer_; // A two-dimensional array of noise data for each plane. Generated for each 32 // luma sample high stripe of the image. The first dimension is called |