Line data Source code
1 : /*
2 : * Copyright (c) 2016, Alliance for Open Media. All rights reserved
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 www.aomedia.org/license/software. If the Alliance for Open
8 : * Media Patent License 1.0 was not distributed with this source code in the
9 : * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10 : */
11 :
12 : #ifndef AOM_DSP_X86_FWD_TXFM_AVX2_H
13 : #define AOM_DSP_X86_FWD_TXFM_AVX2_H
14 :
15 : #include "./aom_config.h"
16 :
17 0 : static INLINE void storeu_output_avx2(const __m256i *coeff, tran_low_t *out) {
18 : #if CONFIG_HIGHBITDEPTH
19 0 : const __m256i zero = _mm256_setzero_si256();
20 0 : const __m256i sign = _mm256_cmpgt_epi16(zero, *coeff);
21 :
22 0 : __m256i x0 = _mm256_unpacklo_epi16(*coeff, sign);
23 0 : __m256i x1 = _mm256_unpackhi_epi16(*coeff, sign);
24 :
25 0 : __m256i y0 = _mm256_permute2x128_si256(x0, x1, 0x20);
26 0 : __m256i y1 = _mm256_permute2x128_si256(x0, x1, 0x31);
27 :
28 : _mm256_storeu_si256((__m256i *)out, y0);
29 0 : _mm256_storeu_si256((__m256i *)(out + 8), y1);
30 : #else
31 : _mm256_storeu_si256((__m256i *)out, *coeff);
32 : #endif
33 0 : }
34 :
35 : #endif // AOM_DSP_X86_FWD_TXFM_AVX2_H
|