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/tile_scratch_buffer.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/tile_scratch_buffer.h')
-rw-r--r-- | src/tile_scratch_buffer.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tile_scratch_buffer.h b/src/tile_scratch_buffer.h index 3eaf8b8..828f550 100644 --- a/src/tile_scratch_buffer.h +++ b/src/tile_scratch_buffer.h @@ -17,8 +17,13 @@ #ifndef LIBGAV1_SRC_TILE_SCRATCH_BUFFER_H_ #define LIBGAV1_SRC_TILE_SCRATCH_BUFFER_H_ +#include <cstddef> #include <cstdint> +#include <cstring> +#include <memory> #include <mutex> // NOLINT (unapproved c++11 header) +#include <new> +#include <utility> #include "src/dsp/constants.h" #include "src/utils/common.h" @@ -42,9 +47,10 @@ struct TileScratchBuffer : public MaxAlignedAllocable { const int pixel_size = 1; #endif + static_assert(kConvolveScaleBorderRight >= kConvolveBorderRight, ""); constexpr int unaligned_convolve_buffer_stride = kMaxScaledSuperBlockSizeInPixels + kConvolveBorderLeftTop + - kConvolveBorderRight; + kConvolveScaleBorderRight; convolve_block_buffer_stride = Align<ptrdiff_t>( unaligned_convolve_buffer_stride * pixel_size, kMaxAlignment); constexpr int convolve_buffer_height = kMaxScaledSuperBlockSizeInPixels + @@ -53,6 +59,13 @@ struct TileScratchBuffer : public MaxAlignedAllocable { convolve_block_buffer = MakeAlignedUniquePtr<uint8_t>( kMaxAlignment, convolve_buffer_height * convolve_block_buffer_stride); +#if LIBGAV1_MSAN + // Quiet msan warnings in ConvolveScale2D_NEON(). Set with random non-zero + // value to aid in future debugging. + memset(convolve_block_buffer.get(), 0x66, + convolve_buffer_height * convolve_block_buffer_stride); +#endif + return convolve_block_buffer != nullptr; } |