Removed unused VideoCaptureCapability parameters.
[chromium-blink-merge.git] / media / base / simd / vector_math_sse.cc
blob39bcaa0c195fd0dd2570b37065f0df7fdd3a9b7d
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/base/vector_math_testing.h"
7 #include <xmmintrin.h> // NOLINT
9 namespace media {
10 namespace vector_math {
12 void FMUL_SSE(const float src[], float scale, int len, float dest[]) {
13 const int rem = len % 4;
14 const int last_index = len - rem;
15 __m128 m_scale = _mm_set_ps1(scale);
16 for (int i = 0; i < last_index; i += 4)
17 _mm_store_ps(dest + i, _mm_mul_ps(_mm_load_ps(src + i), m_scale));
19 // Handle any remaining values that wouldn't fit in an SSE pass.
20 for (int i = last_index; i < len; ++i)
21 dest[i] = src[i] * scale;
24 void FMAC_SSE(const float src[], float scale, int len, float dest[]) {
25 const int rem = len % 4;
26 const int last_index = len - rem;
27 __m128 m_scale = _mm_set_ps1(scale);
28 for (int i = 0; i < last_index; i += 4) {
29 _mm_store_ps(dest + i, _mm_add_ps(_mm_load_ps(dest + i),
30 _mm_mul_ps(_mm_load_ps(src + i), m_scale)));
33 // Handle any remaining values that wouldn't fit in an SSE pass.
34 for (int i = last_index; i < len; ++i)
35 dest[i] += src[i] * scale;
38 } // namespace vector_math
39 } // namespace media