2 ; Copyright (c) 2014 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 "third_party/x86inc/x86inc.asm"
17 %macro TRANSPOSE8X8 10
19 punpcklwd m%9, m%1, m%2
20 punpcklwd m%10, m%3, m%4
24 punpcklwd m%2, m%5, m%6
25 punpcklwd m%4, m%7, m%8
30 punpckldq m%6, m%9, m%10
31 punpckldq m%8, m%1, m%3
35 punpckldq m%10, m%2, m%4
36 punpckldq m%3, m%5, m%7
41 punpckhqdq m%4, m%9, m%2 ; out3
42 punpcklqdq m%9, m%2 ; out2
43 punpcklqdq m%7, m%1, m%5 ; out6
44 punpckhqdq m%1, m%5 ; out7
46 punpckhqdq m%2, m%6, m%10 ; out1
47 punpcklqdq m%6, m%10 ; out0
48 punpcklqdq m%5, m%8, m%3 ; out4
49 punpckhqdq m%8, m%3 ; out5
97 %if CONFIG_VP9_HIGHBITDEPTH
98 ; store %1 to outputq + %2
99 ; uses m8-m10 as scratch registers
100 %macro STORE_TRAN_LOW 2
107 mova [outputq + %2], m9
108 mova [outputq + %2 + 16], m10
113 cglobal hadamard_8x8, 3, 5, 11, input, stride, output
114 lea r3, [2 * strideq]
115 lea r4, [4 * strideq]
118 mova m1, [inputq + r3]
119 lea inputq, [inputq + r4]
121 mova m3, [inputq + r3]
122 lea inputq, [inputq + r4]
124 mova m5, [inputq + r3]
125 lea inputq, [inputq + r4]
127 mova m7, [inputq + r3]
130 TRANSPOSE8X8 0, 1, 2, 3, 4, 5, 6, 7, 9, 10
133 %if CONFIG_VP9_HIGHBITDEPTH
138 STORE_TRAN_LOW 4, 128
139 STORE_TRAN_LOW 5, 160
140 STORE_TRAN_LOW 6, 192
141 STORE_TRAN_LOW 7, 224
143 mova [outputq + 0], m0
144 mova [outputq + 16], m1
145 mova [outputq + 32], m2
146 mova [outputq + 48], m3
147 mova [outputq + 64], m4
148 mova [outputq + 80], m5
149 mova [outputq + 96], m6
150 mova [outputq + 112], m7