vp9_sad_c.c 26.6 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  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.
John Koleszar's avatar
John Koleszar committed
9
10
11
12
 */


#include <stdlib.h>
13
#include "./vp9_rtcd.h"
14
#include "./vpx_config.h"
15
16
#include "vp9/encoder/vp9_sadmxn.h"
#include "vp9/encoder/vp9_variance.h"
17
#include "vpx/vpx_integer.h"
John Koleszar's avatar
John Koleszar committed
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
#define sad_mxn_func(m, n) \
unsigned int vp9_sad##m##x##n##_c(const uint8_t *src_ptr, \
                                  int  src_stride, \
                                  const uint8_t *ref_ptr, \
                                  int  ref_stride, \
                                  unsigned int max_sad) { \
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, m, n); \
} \
unsigned int vp9_sad##m##x##n##_avg_c(const uint8_t *src_ptr, \
                                      int  src_stride, \
                                      const uint8_t *ref_ptr, \
                                      int  ref_stride, \
                                      const uint8_t *second_pred, \
                                      unsigned int max_sad) { \
  uint8_t comp_pred[m * n]; \
  comp_avg_pred(comp_pred, second_pred, m, n, ref_ptr, ref_stride); \
  return sad_mx_n_c(src_ptr, src_stride, comp_pred, m, m, n); \
}

sad_mxn_func(64, 64)
sad_mxn_func(64, 32)
sad_mxn_func(32, 64)
sad_mxn_func(32, 32)
sad_mxn_func(32, 16)
sad_mxn_func(16, 32)
sad_mxn_func(16, 16)
sad_mxn_func(16, 8)
sad_mxn_func(8, 16)
sad_mxn_func(8, 8)
sad_mxn_func(8, 4)
sad_mxn_func(4, 8)
sad_mxn_func(4, 4)
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

void vp9_sad64x32x4d_c(const uint8_t *src_ptr,
                       int  src_stride,
                       const uint8_t* const ref_ptr[],
                       int  ref_stride,
                       unsigned int *sad_array) {
  sad_array[0] = vp9_sad64x32(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad64x32(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad64x32(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad64x32(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
}

void vp9_sad32x64x4d_c(const uint8_t *src_ptr,
                       int  src_stride,
                       const uint8_t* const ref_ptr[],
                       int  ref_stride,
                       unsigned int *sad_array) {
  sad_array[0] = vp9_sad32x64(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad32x64(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad32x64(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad32x64(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
}

void vp9_sad32x16x4d_c(const uint8_t *src_ptr,
                       int  src_stride,
                       const uint8_t* const ref_ptr[],
                       int  ref_stride,
                       unsigned int *sad_array) {
  sad_array[0] = vp9_sad32x16(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad32x16(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad32x16(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad32x16(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
}

void vp9_sad16x32x4d_c(const uint8_t *src_ptr,
                       int  src_stride,
                       const uint8_t* const ref_ptr[],
                       int  ref_stride,
                       unsigned int *sad_array) {
  sad_array[0] = vp9_sad16x32(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad16x32(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad16x32(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad16x32(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
112
113
114
115
116
void vp9_sad64x64x3_c(const uint8_t *src_ptr,
                      int  src_stride,
                      const uint8_t *ref_ptr,
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
117
118
119
120
121
122
  sad_array[0] = vp9_sad64x64(src_ptr, src_stride, ref_ptr, ref_stride,
                              0x7fffffff);
  sad_array[1] = vp9_sad64x64(src_ptr, src_stride, ref_ptr + 1, ref_stride,
                              0x7fffffff);
  sad_array[2] = vp9_sad64x64(src_ptr, src_stride, ref_ptr + 2, ref_stride,
                              0x7fffffff);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
123
124
}

125
void vp9_sad32x32x3_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
126
                      int  src_stride,
127
                      const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
128
                      int  ref_stride,
129
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
130
131
132
133
134
135
  sad_array[0] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr, ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 1, ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 2, ref_stride, 0x7fffffff);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
136
137
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
138
139
140
141
void vp9_sad64x64x8_c(const uint8_t *src_ptr,
                      int  src_stride,
                      const uint8_t *ref_ptr,
                      int  ref_stride,
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
                      unsigned int *sad_array) {
  sad_array[0] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr, ref_stride,
                              0x7fffffff);
  sad_array[1] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 1, ref_stride,
                              0x7fffffff);
  sad_array[2] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 2, ref_stride,
                              0x7fffffff);
  sad_array[3] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 3, ref_stride,
                              0x7fffffff);
  sad_array[4] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 4, ref_stride,
                              0x7fffffff);
  sad_array[5] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 5, ref_stride,
                              0x7fffffff);
  sad_array[6] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 6, ref_stride,
                              0x7fffffff);
  sad_array[7] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr + 7, ref_stride,
                              0x7fffffff);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
167
168
}

169
void vp9_sad32x32x8_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
170
                      int  src_stride,
171
                      const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
172
                      int  ref_stride,
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
                      unsigned int *sad_array) {
  sad_array[0] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr, ref_stride,
                              0x7fffffff);
  sad_array[1] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 1, ref_stride,
                              0x7fffffff);
  sad_array[2] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 2, ref_stride,
                              0x7fffffff);
  sad_array[3] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 3, ref_stride,
                              0x7fffffff);
  sad_array[4] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 4, ref_stride,
                              0x7fffffff);
  sad_array[5] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 5, ref_stride,
                              0x7fffffff);
  sad_array[6] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 6, ref_stride,
                              0x7fffffff);
  sad_array[7] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr + 7, ref_stride,
                              0x7fffffff);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
198
199
}

200
void vp9_sad16x16x3_c(const uint8_t *src_ptr,
201
                      int  src_stride,
202
                      const uint8_t *ref_ptr,
203
204
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
205
206
207
208
209
210
  sad_array[0] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr, ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 1, ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 2, ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
211
212
}

213
void vp9_sad16x16x8_c(const uint8_t *src_ptr,
214
                      int  src_stride,
215
                      const uint8_t *ref_ptr,
216
                      int  ref_stride,
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
                      uint32_t *sad_array) {
  sad_array[0] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr, ref_stride,
                              0x7fffffff);
  sad_array[1] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 1, ref_stride,
                              0x7fffffff);
  sad_array[2] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 2, ref_stride,
                              0x7fffffff);
  sad_array[3] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 3, ref_stride,
                              0x7fffffff);
  sad_array[4] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 4, ref_stride,
                              0x7fffffff);
  sad_array[5] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 5, ref_stride,
                              0x7fffffff);
  sad_array[6] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 6, ref_stride,
                              0x7fffffff);
  sad_array[7] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr + 7, ref_stride,
                              0x7fffffff);
242
243
}

244
void vp9_sad16x8x3_c(const uint8_t *src_ptr,
245
                     int  src_stride,
246
                     const uint8_t *ref_ptr,
247
248
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
249
250
251
252
253
254
  sad_array[0] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr, ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 1, ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 2, ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
255
256
}

257
void vp9_sad16x8x8_c(const uint8_t *src_ptr,
258
                     int  src_stride,
259
                     const uint8_t *ref_ptr,
260
                     int  ref_stride,
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
                     uint32_t *sad_array) {
  sad_array[0] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr, ref_stride,
                             0x7fffffff);
  sad_array[1] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 1, ref_stride,
                             0x7fffffff);
  sad_array[2] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 2, ref_stride,
                             0x7fffffff);
  sad_array[3] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 3, ref_stride,
                             0x7fffffff);
  sad_array[4] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 4, ref_stride,
                             0x7fffffff);
  sad_array[5] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 5, ref_stride,
                             0x7fffffff);
  sad_array[6] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 6, ref_stride,
                             0x7fffffff);
  sad_array[7] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr + 7, ref_stride,
                             0x7fffffff);
286
287
}

288
void vp9_sad8x8x3_c(const uint8_t *src_ptr,
289
                    int  src_stride,
290
                    const uint8_t *ref_ptr,
291
292
                    int  ref_stride,
                    unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
293
294
295
296
297
298
  sad_array[0] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr, ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 1, ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 2, ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
299
300
}

301
void vp9_sad8x8x8_c(const uint8_t *src_ptr,
302
                    int  src_stride,
303
                    const uint8_t *ref_ptr,
304
                    int  ref_stride,
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
                    uint32_t *sad_array) {
  sad_array[0] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr, ref_stride,
                            0x7fffffff);
  sad_array[1] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 1, ref_stride,
                            0x7fffffff);
  sad_array[2] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 2, ref_stride,
                            0x7fffffff);
  sad_array[3] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 3, ref_stride,
                            0x7fffffff);
  sad_array[4] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 4, ref_stride,
                            0x7fffffff);
  sad_array[5] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 5, ref_stride,
                            0x7fffffff);
  sad_array[6] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 6, ref_stride,
                            0x7fffffff);
  sad_array[7] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr + 7, ref_stride,
                            0x7fffffff);
330
331
}

332
void vp9_sad8x16x3_c(const uint8_t *src_ptr,
333
                     int  src_stride,
334
                     const uint8_t *ref_ptr,
335
336
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
337
338
339
340
341
342
  sad_array[0] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr, ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 1, ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 2, ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
343
344
}

345
void vp9_sad8x16x8_c(const uint8_t *src_ptr,
346
                     int  src_stride,
347
                     const uint8_t *ref_ptr,
348
                     int  ref_stride,
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
                     uint32_t *sad_array) {
  sad_array[0] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr, ref_stride,
                             0x7fffffff);
  sad_array[1] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 1, ref_stride,
                             0x7fffffff);
  sad_array[2] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 2, ref_stride,
                             0x7fffffff);
  sad_array[3] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 3, ref_stride,
                             0x7fffffff);
  sad_array[4] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 4, ref_stride,
                             0x7fffffff);
  sad_array[5] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 5, ref_stride,
                             0x7fffffff);
  sad_array[6] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 6, ref_stride,
                             0x7fffffff);
  sad_array[7] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr + 7, ref_stride,
                             0x7fffffff);
374
375
}

376
void vp9_sad4x4x3_c(const uint8_t *src_ptr,
377
                    int  src_stride,
378
                    const uint8_t *ref_ptr,
379
380
                    int  ref_stride,
                    unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
381
382
383
384
385
386
  sad_array[0] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr, ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 1, ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 2, ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
387
388
}

389
void vp9_sad4x4x8_c(const uint8_t *src_ptr,
390
                    int  src_stride,
391
                    const uint8_t *ref_ptr,
392
                    int  ref_stride,
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
                    uint32_t *sad_array) {
  sad_array[0] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr, ref_stride,
                            0x7fffffff);
  sad_array[1] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 1, ref_stride,
                            0x7fffffff);
  sad_array[2] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 2, ref_stride,
                            0x7fffffff);
  sad_array[3] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 3, ref_stride,
                            0x7fffffff);
  sad_array[4] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 4, ref_stride,
                            0x7fffffff);
  sad_array[5] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 5, ref_stride,
                            0x7fffffff);
  sad_array[6] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 6, ref_stride,
                            0x7fffffff);
  sad_array[7] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr + 7, ref_stride,
                            0x7fffffff);
418
419
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
420
421
void vp9_sad64x64x4d_c(const uint8_t *src_ptr,
                       int  src_stride,
422
                       const uint8_t* const ref_ptr[],
Ronald S. Bultje's avatar
Ronald S. Bultje committed
423
424
                       int  ref_stride,
                       unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
425
426
427
428
429
430
431
432
  sad_array[0] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad64x64(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
433
434
}

435
void vp9_sad32x32x4d_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
436
                       int  src_stride,
437
                       const uint8_t* const ref_ptr[],
Ronald S. Bultje's avatar
Ronald S. Bultje committed
438
                       int  ref_stride,
439
                       unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
440
441
442
443
444
445
446
447
  sad_array[0] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad32x32(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
448
449
}

450
void vp9_sad16x16x4d_c(const uint8_t *src_ptr,
451
                       int  src_stride,
452
                       const uint8_t* const ref_ptr[],
453
454
                       int  ref_stride,
                       unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
455
456
457
458
459
460
461
462
  sad_array[0] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad16x16(src_ptr, src_stride,
                              ref_ptr[3], ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
463
464
}

465
void vp9_sad16x8x4d_c(const uint8_t *src_ptr,
466
                      int  src_stride,
467
                      const uint8_t* const ref_ptr[],
468
469
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
470
471
472
473
474
475
476
477
  sad_array[0] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad16x8(src_ptr, src_stride,
                             ref_ptr[3], ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
478
479
}

480
void vp9_sad8x8x4d_c(const uint8_t *src_ptr,
481
                     int  src_stride,
482
                     const uint8_t* const ref_ptr[],
483
484
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
485
486
487
488
489
490
491
492
  sad_array[0] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad8x8(src_ptr, src_stride,
                            ref_ptr[3], ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
493
494
}

495
void vp9_sad8x16x4d_c(const uint8_t *src_ptr,
496
                      int  src_stride,
497
                      const uint8_t* const ref_ptr[],
498
499
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
500
501
502
503
504
505
506
507
  sad_array[0] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad8x16(src_ptr, src_stride,
                             ref_ptr[3], ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
508
509
}

510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
void vp9_sad8x4x4d_c(const uint8_t *src_ptr,
                     int  src_stride,
                     const uint8_t* const ref_ptr[],
                     int  ref_stride,
                     unsigned int *sad_array) {
  sad_array[0] = vp9_sad8x4(src_ptr, src_stride,
                            ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad8x4(src_ptr, src_stride,
                            ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad8x4(src_ptr, src_stride,
                            ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad8x4(src_ptr, src_stride,
                            ref_ptr[3], ref_stride, 0x7fffffff);
}

525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
void vp9_sad8x4x8_c(const uint8_t *src_ptr,
                     int  src_stride,
                     const uint8_t *ref_ptr,
                     int  ref_stride,
                     uint32_t *sad_array) {
  sad_array[0] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr, ref_stride,
                             0x7fffffff);
  sad_array[1] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 1, ref_stride,
                             0x7fffffff);
  sad_array[2] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 2, ref_stride,
                             0x7fffffff);
  sad_array[3] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 3, ref_stride,
                             0x7fffffff);
  sad_array[4] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 4, ref_stride,
                             0x7fffffff);
  sad_array[5] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 5, ref_stride,
                             0x7fffffff);
  sad_array[6] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 6, ref_stride,
                             0x7fffffff);
  sad_array[7] = vp9_sad8x4(src_ptr, src_stride,
                             ref_ptr + 7, ref_stride,
                             0x7fffffff);
}

556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
void vp9_sad4x8x4d_c(const uint8_t *src_ptr,
                     int  src_stride,
                     const uint8_t* const ref_ptr[],
                     int  ref_stride,
                     unsigned int *sad_array) {
  sad_array[0] = vp9_sad4x8(src_ptr, src_stride,
                            ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad4x8(src_ptr, src_stride,
                            ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad4x8(src_ptr, src_stride,
                            ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad4x8(src_ptr, src_stride,
                            ref_ptr[3], ref_stride, 0x7fffffff);
}

571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
void vp9_sad4x8x8_c(const uint8_t *src_ptr,
                     int  src_stride,
                     const uint8_t *ref_ptr,
                     int  ref_stride,
                     uint32_t *sad_array) {
  sad_array[0] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr, ref_stride,
                             0x7fffffff);
  sad_array[1] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 1, ref_stride,
                             0x7fffffff);
  sad_array[2] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 2, ref_stride,
                             0x7fffffff);
  sad_array[3] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 3, ref_stride,
                             0x7fffffff);
  sad_array[4] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 4, ref_stride,
                             0x7fffffff);
  sad_array[5] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 5, ref_stride,
                             0x7fffffff);
  sad_array[6] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 6, ref_stride,
                             0x7fffffff);
  sad_array[7] = vp9_sad4x8(src_ptr, src_stride,
                             ref_ptr + 7, ref_stride,
                             0x7fffffff);
}

602
void vp9_sad4x4x4d_c(const uint8_t *src_ptr,
603
                     int  src_stride,
604
                     const uint8_t* const ref_ptr[],
605
606
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
607
608
609
610
611
612
613
614
  sad_array[0] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr[0], ref_stride, 0x7fffffff);
  sad_array[1] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr[1], ref_stride, 0x7fffffff);
  sad_array[2] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr[2], ref_stride, 0x7fffffff);
  sad_array[3] = vp9_sad4x4(src_ptr, src_stride,
                            ref_ptr[3], ref_stride, 0x7fffffff);
John Koleszar's avatar
John Koleszar committed
615
}