summaryrefslogtreecommitdiffstats
path: root/media/libaom/src/av1/common/x86/cfl_simd.h
blob: 3b342cd4e4895e633f0db83f432b3d4c462c3971 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
 * Copyright (c) 2017, Alliance for Open Media. All rights reserved
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

#ifndef AOM_AV1_COMMON_X86_CFL_SIMD_H_
#define AOM_AV1_COMMON_X86_CFL_SIMD_H_

#include "av1/common/blockd.h"

// SSSE3 version is optimal for with == 4, we reuse them in AVX2
void subsample_lbd_420_4x4_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_420_4x8_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_420_4x16_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 8, we reuse it in AVX2
void subsample_lbd_420_8x4_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_420_8x8_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_420_8x16_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_420_8x32_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 16, we reuse it in AVX2
void subsample_lbd_420_16x4_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_420_16x8_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_420_16x16_ssse3(const uint8_t *input, int input_stride,
                                   uint16_t *output_q3);
void subsample_lbd_420_16x32_ssse3(const uint8_t *input, int input_stride,
                                   uint16_t *output_q3);

// SSSE3 version is optimal for with == 4, we reuse them in AVX2
void subsample_lbd_422_4x4_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_422_4x8_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_422_4x16_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 8, we reuse it in AVX2
void subsample_lbd_422_8x4_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_422_8x8_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_422_8x16_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_422_8x32_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 16, we reuse it in AVX2
void subsample_lbd_422_16x4_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_422_16x8_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_422_16x16_ssse3(const uint8_t *input, int input_stride,
                                   uint16_t *output_q3);
void subsample_lbd_422_16x32_ssse3(const uint8_t *input, int input_stride,
                                   uint16_t *output_q3);

// SSSE3 version is optimal for with == 4, we reuse them in AVX2
void subsample_lbd_444_4x4_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_444_4x8_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_444_4x16_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 8, we reuse it in AVX2
void subsample_lbd_444_8x4_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_444_8x8_ssse3(const uint8_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_lbd_444_8x16_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_444_8x32_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 16, we reuse it in AVX2
void subsample_lbd_444_16x4_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_444_16x8_ssse3(const uint8_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_lbd_444_16x16_ssse3(const uint8_t *input, int input_stride,
                                   uint16_t *output_q3);
void subsample_lbd_444_16x32_ssse3(const uint8_t *input, int input_stride,
                                   uint16_t *output_q3);

void subsample_hbd_420_4x4_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_420_4x8_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_420_4x16_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 8, we reuse it in AVX2
void subsample_hbd_420_8x4_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_420_8x8_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_420_8x16_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_420_8x32_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is faster for with == 16, we reuse it in AVX2
void subsample_hbd_420_16x4_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_420_16x8_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_420_16x16_ssse3(const uint16_t *input, int input_stride,
                                   uint16_t *output_q3);
void subsample_hbd_420_16x32_ssse3(const uint16_t *input, int input_stride,
                                   uint16_t *output_q3);

void subsample_hbd_422_4x4_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_422_4x8_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_422_4x16_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 8, we reuse it in AVX2
void subsample_hbd_422_8x4_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_422_8x8_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_422_8x16_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_422_8x32_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is faster for with == 16, we reuse it in AVX2
void subsample_hbd_422_16x4_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_422_16x8_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_422_16x16_ssse3(const uint16_t *input, int input_stride,
                                   uint16_t *output_q3);
void subsample_hbd_422_16x32_ssse3(const uint16_t *input, int input_stride,
                                   uint16_t *output_q3);

void subsample_hbd_444_4x4_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_444_4x8_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_444_4x16_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is optimal for with == 8, we reuse it in AVX2
void subsample_hbd_444_8x4_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_444_8x8_ssse3(const uint16_t *input, int input_stride,
                                 uint16_t *output_q3);
void subsample_hbd_444_8x16_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_444_8x32_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);

// SSSE3 version is faster for with == 16, we reuse it in AVX2
void subsample_hbd_444_16x4_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_444_16x8_ssse3(const uint16_t *input, int input_stride,
                                  uint16_t *output_q3);
void subsample_hbd_444_16x16_ssse3(const uint16_t *input, int input_stride,
                                   uint16_t *output_q3);
void subsample_hbd_444_16x32_ssse3(const uint16_t *input, int input_stride,
                                   uint16_t *output_q3);

// SSE2 version is optimal for with == 4, we reuse them in AVX2
void subtract_average_4x4_sse2(const uint16_t *src, int16_t *dst);
void subtract_average_4x8_sse2(const uint16_t *src, int16_t *dst);
void subtract_average_4x16_sse2(const uint16_t *src, int16_t *dst);

// SSE2 version is optimal for with == 8, we reuse them in AVX2
void subtract_average_8x4_sse2(const uint16_t *src, int16_t *dst);
void subtract_average_8x8_sse2(const uint16_t *src, int16_t *dst);
void subtract_average_8x16_sse2(const uint16_t *src, int16_t *dst);
void subtract_average_8x32_sse2(const uint16_t *src, int16_t *dst);

void predict_lbd_4x4_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                           int dst_stride, int alpha_q3);
void predict_lbd_4x8_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                           int dst_stride, int alpha_q3);
void predict_lbd_4x16_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                            int dst_stride, int alpha_q3);

void predict_lbd_8x4_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                           int dst_stride, int alpha_q3);
void predict_lbd_8x8_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                           int dst_stride, int alpha_q3);
void predict_lbd_8x16_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                            int dst_stride, int alpha_q3);
void predict_lbd_8x32_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                            int dst_stride, int alpha_q3);

void predict_lbd_16x4_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                            int dst_stride, int alpha_q3);
void predict_lbd_16x8_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                            int dst_stride, int alpha_q3);
void predict_lbd_16x16_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                             int dst_stride, int alpha_q3);
void predict_lbd_16x32_ssse3(const int16_t *pred_buf_q3, uint8_t *dst,
                             int dst_stride, int alpha_q3);

void predict_hbd_4x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                           int dst_stride, int alpha_q3, int bd);
void predict_hbd_4x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                           int dst_stride, int alpha_q3, int bd);
void predict_hbd_4x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                            int dst_stride, int alpha_q3, int bd);

void predict_hbd_8x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                           int dst_stride, int alpha_q3, int bd);
void predict_hbd_8x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                           int dst_stride, int alpha_q3, int bd);
void predict_hbd_8x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                            int dst_stride, int alpha_q3, int bd);
void predict_hbd_8x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                            int dst_stride, int alpha_q3, int bd);

void predict_hbd_16x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                            int dst_stride, int alpha_q3, int bd);
void predict_hbd_16x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                            int dst_stride, int alpha_q3, int bd);
void predict_hbd_16x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                             int dst_stride, int alpha_q3, int bd);
void predict_hbd_16x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
                             int dst_stride, int alpha_q3, int bd);

#endif  // AOM_AV1_COMMON_X86_CFL_SIMD_H_