aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/obmc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dsp/obmc.cc')
-rw-r--r--src/dsp/obmc.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/dsp/obmc.cc b/src/dsp/obmc.cc
index 46d1b5b..6b5c6e3 100644
--- a/src/dsp/obmc.cc
+++ b/src/dsp/obmc.cc
@@ -30,15 +30,18 @@ namespace {
// 7.11.3.10 (from top samples).
template <typename Pixel>
-void OverlapBlendVertical_C(void* const prediction,
+void OverlapBlendVertical_C(void* LIBGAV1_RESTRICT const prediction,
const ptrdiff_t prediction_stride, const int width,
- const int height, const void* const obmc_prediction,
+ const int height,
+ const void* LIBGAV1_RESTRICT const obmc_prediction,
const ptrdiff_t obmc_prediction_stride) {
auto* pred = static_cast<Pixel*>(prediction);
const ptrdiff_t pred_stride = prediction_stride / sizeof(Pixel);
const auto* obmc_pred = static_cast<const Pixel*>(obmc_prediction);
const ptrdiff_t obmc_pred_stride = obmc_prediction_stride / sizeof(Pixel);
const uint8_t* const mask = kObmcMask + height - 2;
+ assert(width >= 4);
+ assert(height >= 2);
for (int y = 0; y < height; ++y) {
const uint8_t mask_value = mask[y];
@@ -53,16 +56,19 @@ void OverlapBlendVertical_C(void* const prediction,
// 7.11.3.10 (from left samples).
template <typename Pixel>
-void OverlapBlendHorizontal_C(void* const prediction,
- const ptrdiff_t prediction_stride,
- const int width, const int height,
- const void* const obmc_prediction,
- const ptrdiff_t obmc_prediction_stride) {
+void OverlapBlendHorizontal_C(
+ void* LIBGAV1_RESTRICT const prediction, const ptrdiff_t prediction_stride,
+ const int width, const int height,
+ const void* LIBGAV1_RESTRICT const obmc_prediction,
+ const ptrdiff_t obmc_prediction_stride) {
auto* pred = static_cast<Pixel*>(prediction);
const ptrdiff_t pred_stride = prediction_stride / sizeof(Pixel);
const auto* obmc_pred = static_cast<const Pixel*>(obmc_prediction);
const ptrdiff_t obmc_pred_stride = obmc_prediction_stride / sizeof(Pixel);
const uint8_t* const mask = kObmcMask + width - 2;
+ assert(width >= 2);
+ assert(height >= 4);
+
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
const uint8_t mask_value = mask[x];