Home | History | Annotate | Download | only in x86
      1 /*
      2  *  Copyright (c) 2017 The WebM project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 #ifndef VPX_DSP_X86_BITDEPTH_CONVERSION_AVX2_H_
     11 #define VPX_DSP_X86_BITDEPTH_CONVERSION_AVX2_H_
     12 
     13 #include <immintrin.h>
     14 
     15 #include "./vpx_config.h"
     16 #include "vpx/vpx_integer.h"
     17 #include "vpx_dsp/vpx_dsp_common.h"
     18 
     19 // Load 16 16 bit values. If the source is 32 bits then pack down with
     20 // saturation.
     21 static INLINE __m256i load_tran_low(const tran_low_t *a) {
     22 #if CONFIG_VP9_HIGHBITDEPTH
     23   const __m256i a_low = _mm256_loadu_si256((const __m256i *)a);
     24   return _mm256_packs_epi32(a_low, *(const __m256i *)(a + 8));
     25 #else
     26   return _mm256_loadu_si256((const __m256i *)a);
     27 #endif
     28 }
     29 
     30 #endif  // VPX_DSP_X86_BITDEPTH_CONVERSION_AVX2_H_
     31