summaryrefslogtreecommitdiff
path: root/chromium/media/base/vector_math.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/media/base/vector_math.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/base/vector_math.cc')
-rw-r--r--chromium/media/base/vector_math.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/chromium/media/base/vector_math.cc b/chromium/media/base/vector_math.cc
index fabb796d324..a0333cb6885 100644
--- a/chromium/media/base/vector_math.cc
+++ b/chromium/media/base/vector_math.cc
@@ -8,6 +8,7 @@
#include <algorithm>
#include "base/check_op.h"
+#include "base/memory/aligned_memory.h"
#include "build/build_config.h"
// NaCl does not allow intrinsics.
@@ -40,9 +41,8 @@ namespace media {
namespace vector_math {
void FMAC(const float src[], float scale, int len, float dest[]) {
- // Ensure |src| and |dest| are 16-byte aligned.
- DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(src) & (kRequiredAlignment - 1));
- DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(dest) & (kRequiredAlignment - 1));
+ DCHECK(base::IsAligned(src, kRequiredAlignment));
+ DCHECK(base::IsAligned(dest, kRequiredAlignment));
return FMAC_FUNC(src, scale, len, dest);
}
@@ -52,9 +52,8 @@ void FMAC_C(const float src[], float scale, int len, float dest[]) {
}
void FMUL(const float src[], float scale, int len, float dest[]) {
- // Ensure |src| and |dest| are 16-byte aligned.
- DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(src) & (kRequiredAlignment - 1));
- DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(dest) & (kRequiredAlignment - 1));
+ DCHECK(base::IsAligned(src, kRequiredAlignment));
+ DCHECK(base::IsAligned(dest, kRequiredAlignment));
return FMUL_FUNC(src, scale, len, dest);
}
@@ -65,8 +64,7 @@ void FMUL_C(const float src[], float scale, int len, float dest[]) {
std::pair<float, float> EWMAAndMaxPower(
float initial_value, const float src[], int len, float smoothing_factor) {
- // Ensure |src| is 16-byte aligned.
- DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(src) & (kRequiredAlignment - 1));
+ DCHECK(base::IsAligned(src, kRequiredAlignment));
return EWMAAndMaxPower_FUNC(initial_value, src, len, smoothing_factor);
}