xref: /aosp_15_r20/external/libaom/third_party/SVT-AV1/EbMemory_SSE4_1.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
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 #include "aom_dsp/x86/mem_sse2.h"
22 
load8bit_4x2_sse4_1(const void * const src,const ptrdiff_t strideInByte)23 static inline __m128i load8bit_4x2_sse4_1(const void *const src,
24                                           const ptrdiff_t strideInByte) {
25   const __m128i s = _mm_cvtsi32_si128(loadu_int32(src));
26   return _mm_insert_epi32(s, loadu_int32((uint8_t *)src + strideInByte), 1);
27 }
28 
load_u8_4x2_sse4_1(const uint8_t * const src,const ptrdiff_t stride)29 static inline __m128i load_u8_4x2_sse4_1(const uint8_t *const src,
30                                          const ptrdiff_t stride) {
31   return load8bit_4x2_sse4_1(src, sizeof(*src) * stride);
32 }
33 
load_u16_2x2_sse4_1(const uint16_t * const src,const ptrdiff_t stride)34 static inline __m128i load_u16_2x2_sse4_1(const uint16_t *const src,
35                                           const ptrdiff_t stride) {
36   return load8bit_4x2_sse4_1(src, sizeof(*src) * stride);
37 }
38 
39 #endif  // AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_
40