1 /*
2 * Copyright(c) 2019 Intel Corporation
3 *
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at https://www.aomedia.org/license/software-license. If the
8 * Alliance for Open Media Patent License 1.0 was not distributed with this
9 * source code in the PATENTS file, you can obtain it at
10 * https://www.aomedia.org/license/patent-license.
11 */
12
13 #ifndef AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_
14 #define AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_
15
16 #include <smmintrin.h>
17
18 #include "config/aom_config.h"
19
20 #include "aom/aom_integer.h"
21
load8bit_4x2_sse4_1(const void * const src,const ptrdiff_t strideInByte)22 static INLINE __m128i load8bit_4x2_sse4_1(const void *const src,
23 const ptrdiff_t strideInByte) {
24 const __m128i s = _mm_cvtsi32_si128(*(int32_t *)((uint8_t *)src));
25 return _mm_insert_epi32(s, *(int32_t *)((uint8_t *)src + strideInByte), 1);
26 }
27
load_u8_4x2_sse4_1(const uint8_t * const src,const ptrdiff_t stride)28 static INLINE __m128i load_u8_4x2_sse4_1(const uint8_t *const src,
29 const ptrdiff_t stride) {
30 return load8bit_4x2_sse4_1(src, sizeof(*src) * stride);
31 }
32
load_u16_2x2_sse4_1(const uint16_t * const src,const ptrdiff_t stride)33 static INLINE __m128i load_u16_2x2_sse4_1(const uint16_t *const src,
34 const ptrdiff_t stride) {
35 return load8bit_4x2_sse4_1(src, sizeof(*src) * stride);
36 }
37
38 #endif // AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_
39