2 * Copyright (c) 2015 The WebM project authors. All Rights Reserved.
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.
11 #include "./vpx_dsp_rtcd.h"
12 #include "vpx_dsp/x86/inv_txfm_sse2.h"
13 #include "vpx_dsp/x86/transpose_sse2.h"
14 #include "vpx_dsp/x86/txfm_common_sse2.h"
16 void vpx_highbd_idct32x32_1_add_sse2(const tran_low_t *input, uint16_t *dest,
19 const __m128i zero = _mm_setzero_si128();
20 const __m128i one = _mm_set1_epi16(1);
21 const __m128i max = _mm_sub_epi16(_mm_slli_epi16(one, bd), one);
25 out = HIGHBD_WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64), bd);
26 out = HIGHBD_WRAPLOW(dct_const_round_shift(out * cospi_16_64), bd);
27 a = ROUND_POWER_OF_TWO(out, 6);
29 d = _mm_set1_epi32(a);
30 dc_value = _mm_packs_epi32(d, d);
31 for (i = 0; i < 32; ++i) {
32 for (j = 0; j < 4; ++j) {
33 d = _mm_loadu_si128((const __m128i *)(&dest[j * 8]));
34 d = _mm_adds_epi16(d, dc_value);
35 d = _mm_max_epi16(d, zero);
36 d = _mm_min_epi16(d, max);
37 _mm_storeu_si128((__m128i *)(&dest[j * 8]), d);