vp9_sad_c.c 26.7 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/common/vp9_sadmxn.h"
14
#include "./vpx_config.h"
15
#include "vpx/vpx_integer.h"
Jim Bankoski's avatar
Jim Bankoski committed
16
#include "./vp9_rtcd.h"
John Koleszar's avatar
John Koleszar committed
17

Ronald S. Bultje's avatar
Ronald S. Bultje committed
18 19 20 21
unsigned int vp9_sad64x64_c(const uint8_t *src_ptr,
                            int  src_stride,
                            const uint8_t *ref_ptr,
                            int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
22
                            unsigned int max_sad) {
Ronald S. Bultje's avatar
Ronald S. Bultje committed
23 24 25
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 64, 64);
}

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
unsigned int vp9_sad64x32_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, 64, 32);
}

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);
}

unsigned int vp9_sad32x64_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, 32, 64);
}

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);
}

72
unsigned int vp9_sad32x32_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
73
                            int  src_stride,
74
                            const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
75
                            int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
76
                            unsigned int max_sad) {
Ronald S. Bultje's avatar
Ronald S. Bultje committed
77 78 79
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 32, 32);
}

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
unsigned int vp9_sad32x16_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, 32, 16);
}

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);
}

unsigned int vp9_sad16x32_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, 16, 32);
}

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);
}

126
unsigned int vp9_sad16x16_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
127
                            int  src_stride,
128
                            const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
129
                            int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
130
                            unsigned int max_sad) {
Ronald S. Bultje's avatar
Ronald S. Bultje committed
131 132
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 16);
}
John Koleszar's avatar
John Koleszar committed
133

134
unsigned int vp9_sad8x8_c(const uint8_t *src_ptr,
135
                          int  src_stride,
136
                          const uint8_t *ref_ptr,
137
                          int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
138
                          unsigned int max_sad) {
John Koleszar's avatar
John Koleszar committed
139
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 8);
John Koleszar's avatar
John Koleszar committed
140 141 142
}


143
unsigned int vp9_sad16x8_c(const uint8_t *src_ptr,
144
                           int  src_stride,
145
                           const uint8_t *ref_ptr,
146
                           int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
147
                           unsigned int max_sad) {
John Koleszar's avatar
John Koleszar committed
148
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 8);
John Koleszar's avatar
John Koleszar committed
149 150
}

151
unsigned int vp9_sad8x16_c(const uint8_t *src_ptr,
152
                           int  src_stride,
153
                           const uint8_t *ref_ptr,
154
                           int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
155
                           unsigned int max_sad) {
John Koleszar's avatar
John Koleszar committed
156
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 16);
John Koleszar's avatar
John Koleszar committed
157 158
}

159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
unsigned int vp9_sad8x4_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, 8, 4);
}

unsigned int vp9_sad4x8_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, 4, 8);
}
John Koleszar's avatar
John Koleszar committed
174

175
unsigned int vp9_sad4x4_c(const uint8_t *src_ptr,
176
                          int  src_stride,
177
                          const uint8_t *ref_ptr,
178
                          int  ref_stride,
Jim Bankoski's avatar
Jim Bankoski committed
179
                          unsigned int max_sad) {
John Koleszar's avatar
John Koleszar committed
180
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 4, 4);
John Koleszar's avatar
John Koleszar committed
181
}
Ronald S. Bultje's avatar
Ronald S. Bultje committed
182

Ronald S. Bultje's avatar
Ronald S. Bultje committed
183 184 185 186 187
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
188 189 190 191 192 193
  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
194 195
}

196
void vp9_sad32x32x3_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
197
                      int  src_stride,
198
                      const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
199
                      int  ref_stride,
200
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
201 202 203 204 205 206
  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
207 208
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
209 210 211 212
void vp9_sad64x64x8_c(const uint8_t *src_ptr,
                      int  src_stride,
                      const uint8_t *ref_ptr,
                      int  ref_stride,
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
                      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
238 239
}

240
void vp9_sad32x32x8_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
241
                      int  src_stride,
242
                      const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
243
                      int  ref_stride,
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
                      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
269 270
}

271
void vp9_sad16x16x3_c(const uint8_t *src_ptr,
272
                      int  src_stride,
273
                      const uint8_t *ref_ptr,
274 275
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
276 277 278 279 280 281
  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
282 283
}

284
void vp9_sad16x16x8_c(const uint8_t *src_ptr,
285
                      int  src_stride,
286
                      const uint8_t *ref_ptr,
287
                      int  ref_stride,
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
                      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);
313 314
}

315
void vp9_sad16x8x3_c(const uint8_t *src_ptr,
316
                     int  src_stride,
317
                     const uint8_t *ref_ptr,
318 319
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
320 321 322 323 324 325
  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
326 327
}

328
void vp9_sad16x8x8_c(const uint8_t *src_ptr,
329
                     int  src_stride,
330
                     const uint8_t *ref_ptr,
331
                     int  ref_stride,
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
                     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);
357 358
}

359
void vp9_sad8x8x3_c(const uint8_t *src_ptr,
360
                    int  src_stride,
361
                    const uint8_t *ref_ptr,
362 363
                    int  ref_stride,
                    unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
364 365 366 367 368 369
  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
370 371
}

372
void vp9_sad8x8x8_c(const uint8_t *src_ptr,
373
                    int  src_stride,
374
                    const uint8_t *ref_ptr,
375
                    int  ref_stride,
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
                    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);
401 402
}

403
void vp9_sad8x16x3_c(const uint8_t *src_ptr,
404
                     int  src_stride,
405
                     const uint8_t *ref_ptr,
406 407
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
408 409 410 411 412 413
  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
414 415
}

416
void vp9_sad8x16x8_c(const uint8_t *src_ptr,
417
                     int  src_stride,
418
                     const uint8_t *ref_ptr,
419
                     int  ref_stride,
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
                     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);
445 446
}

447
void vp9_sad4x4x3_c(const uint8_t *src_ptr,
448
                    int  src_stride,
449
                    const uint8_t *ref_ptr,
450 451
                    int  ref_stride,
                    unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
452 453 454 455 456 457
  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
458 459
}

460
void vp9_sad4x4x8_c(const uint8_t *src_ptr,
461
                    int  src_stride,
462
                    const uint8_t *ref_ptr,
463
                    int  ref_stride,
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
                    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);
489 490
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
491 492
void vp9_sad64x64x4d_c(const uint8_t *src_ptr,
                       int  src_stride,
493
                       const uint8_t* const ref_ptr[],
Ronald S. Bultje's avatar
Ronald S. Bultje committed
494 495
                       int  ref_stride,
                       unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
496 497 498 499 500 501 502 503
  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
504 505
}

506
void vp9_sad32x32x4d_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
507
                       int  src_stride,
508
                       const uint8_t* const ref_ptr[],
Ronald S. Bultje's avatar
Ronald S. Bultje committed
509
                       int  ref_stride,
510
                       unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
511 512 513 514 515 516 517 518
  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
519 520
}

521
void vp9_sad16x16x4d_c(const uint8_t *src_ptr,
522
                       int  src_stride,
523
                       const uint8_t* const ref_ptr[],
524 525
                       int  ref_stride,
                       unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
526 527 528 529 530 531 532 533
  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
534 535
}

536
void vp9_sad16x8x4d_c(const uint8_t *src_ptr,
537
                      int  src_stride,
538
                      const uint8_t* const ref_ptr[],
539 540
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
541 542 543 544 545 546 547 548
  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
549 550
}

551
void vp9_sad8x8x4d_c(const uint8_t *src_ptr,
552
                     int  src_stride,
553
                     const uint8_t* const ref_ptr[],
554 555
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
556 557 558 559 560 561 562 563
  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
564 565
}

566
void vp9_sad8x16x4d_c(const uint8_t *src_ptr,
567
                      int  src_stride,
568
                      const uint8_t* const ref_ptr[],
569 570
                      int  ref_stride,
                      unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
571 572 573 574 575 576 577 578
  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
579 580
}

581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
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);
}

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);
}

611
void vp9_sad4x4x4d_c(const uint8_t *src_ptr,
612
                     int  src_stride,
613
                     const uint8_t* const ref_ptr[],
614 615
                     int  ref_stride,
                     unsigned int *sad_array) {
Jim Bankoski's avatar
Jim Bankoski committed
616 617 618 619 620 621 622 623
  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
624
}