2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2011-09-15 14:34:12 +02:00
|
|
|
#include "vpx_config.h"
|
2011-06-28 15:14:13 +02:00
|
|
|
#include "vpx/vpx_integer.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-03-21 19:11:10 +01:00
|
|
|
static
|
2012-01-27 20:44:01 +01:00
|
|
|
unsigned int sad_mx_n_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
2012-01-27 20:44:01 +01:00
|
|
|
int max_sad,
|
|
|
|
int m,
|
|
|
|
int n)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
int r, c;
|
|
|
|
unsigned int sad = 0;
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
for (r = 0; r < n; r++)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
2012-01-27 20:44:01 +01:00
|
|
|
for (c = 0; c < m; c++)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
sad += abs(src_ptr[c] - ref_ptr[c]);
|
|
|
|
}
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
if (sad > max_sad)
|
|
|
|
break;
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
src_ptr += src_stride;
|
|
|
|
ref_ptr += ref_stride;
|
|
|
|
}
|
|
|
|
|
|
|
|
return sad;
|
|
|
|
}
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
/* max_sad is provided as an optional optimization point. Alternative
|
|
|
|
* implementations of these functions are not required to check it.
|
|
|
|
*/
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
unsigned int vp8_sad16x16_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
2012-01-27 20:44:01 +01:00
|
|
|
int max_sad)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 16);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int vp8_sad8x8_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
2012-01-27 20:44:01 +01:00
|
|
|
int max_sad)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 8);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int vp8_sad16x8_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
2012-01-27 20:44:01 +01:00
|
|
|
int max_sad)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 8);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int vp8_sad8x16_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
2012-01-27 20:44:01 +01:00
|
|
|
int max_sad)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 16);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int vp8_sad4x4_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
2012-01-27 20:44:01 +01:00
|
|
|
int max_sad)
|
2010-05-18 17:58:33 +02:00
|
|
|
{
|
|
|
|
|
2012-01-27 20:44:01 +01:00
|
|
|
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 4, 4);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void vp8_sad16x16x3_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-10-27 14:45:24 +02:00
|
|
|
void vp8_sad16x16x8_c(
|
|
|
|
const unsigned char *src_ptr,
|
|
|
|
int src_stride,
|
|
|
|
const unsigned char *ref_ptr,
|
|
|
|
int ref_stride,
|
|
|
|
unsigned short *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[4] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[5] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[6] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[7] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
void vp8_sad16x8x3_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-10-27 14:45:24 +02:00
|
|
|
void vp8_sad16x8x8_c(
|
|
|
|
const unsigned char *src_ptr,
|
|
|
|
int src_stride,
|
|
|
|
const unsigned char *ref_ptr,
|
|
|
|
int ref_stride,
|
|
|
|
unsigned short *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[4] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[5] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[6] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[7] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
void vp8_sad8x8x3_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-10-27 14:45:24 +02:00
|
|
|
void vp8_sad8x8x8_c(
|
|
|
|
const unsigned char *src_ptr,
|
|
|
|
int src_stride,
|
|
|
|
const unsigned char *ref_ptr,
|
|
|
|
int ref_stride,
|
|
|
|
unsigned short *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[4] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[5] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[6] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[7] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
void vp8_sad8x16x3_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-10-27 14:45:24 +02:00
|
|
|
void vp8_sad8x16x8_c(
|
|
|
|
const unsigned char *src_ptr,
|
|
|
|
int src_stride,
|
|
|
|
const unsigned char *ref_ptr,
|
|
|
|
int ref_stride,
|
|
|
|
unsigned short *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[4] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[5] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[6] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[7] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
void vp8_sad4x4x3_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *ref_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-10-27 14:45:24 +02:00
|
|
|
void vp8_sad4x4x8_c(
|
|
|
|
const unsigned char *src_ptr,
|
|
|
|
int src_stride,
|
|
|
|
const unsigned char *ref_ptr,
|
|
|
|
int ref_stride,
|
|
|
|
unsigned short *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[4] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[5] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
|
|
|
|
sad_array[6] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
|
|
|
|
sad_array[7] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
void vp8_sad16x16x4d_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
|
|
|
unsigned char *ref_ptr[],
|
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp8_sad16x8x4d_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
|
|
|
unsigned char *ref_ptr[],
|
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp8_sad8x8x4d_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
|
|
|
unsigned char *ref_ptr[],
|
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp8_sad8x16x4d_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
|
|
|
unsigned char *ref_ptr[],
|
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp8_sad4x4x4d_c(
|
2010-10-11 23:01:23 +02:00
|
|
|
const unsigned char *src_ptr,
|
2010-05-18 17:58:33 +02:00
|
|
|
int src_stride,
|
|
|
|
unsigned char *ref_ptr[],
|
|
|
|
int ref_stride,
|
|
|
|
unsigned int *sad_array
|
|
|
|
)
|
|
|
|
{
|
|
|
|
sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
|
|
|
|
sad_array[3] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
|
|
|
|
}
|
2011-06-28 15:14:13 +02:00
|
|
|
|
|
|
|
/* Copy 2 macroblocks to a buffer */
|
|
|
|
void vp8_copy32xn_c(
|
|
|
|
unsigned char *src_ptr,
|
|
|
|
int src_stride,
|
|
|
|
unsigned char *dst_ptr,
|
|
|
|
int dst_stride,
|
|
|
|
int height)
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
|
|
|
|
for (r = 0; r < height; r++)
|
|
|
|
{
|
|
|
|
#if !(CONFIG_FAST_UNALIGNED)
|
|
|
|
dst_ptr[0] = src_ptr[0];
|
|
|
|
dst_ptr[1] = src_ptr[1];
|
|
|
|
dst_ptr[2] = src_ptr[2];
|
|
|
|
dst_ptr[3] = src_ptr[3];
|
|
|
|
dst_ptr[4] = src_ptr[4];
|
|
|
|
dst_ptr[5] = src_ptr[5];
|
|
|
|
dst_ptr[6] = src_ptr[6];
|
|
|
|
dst_ptr[7] = src_ptr[7];
|
|
|
|
dst_ptr[8] = src_ptr[8];
|
|
|
|
dst_ptr[9] = src_ptr[9];
|
|
|
|
dst_ptr[10] = src_ptr[10];
|
|
|
|
dst_ptr[11] = src_ptr[11];
|
|
|
|
dst_ptr[12] = src_ptr[12];
|
|
|
|
dst_ptr[13] = src_ptr[13];
|
|
|
|
dst_ptr[14] = src_ptr[14];
|
|
|
|
dst_ptr[15] = src_ptr[15];
|
|
|
|
dst_ptr[16] = src_ptr[16];
|
|
|
|
dst_ptr[17] = src_ptr[17];
|
|
|
|
dst_ptr[18] = src_ptr[18];
|
|
|
|
dst_ptr[19] = src_ptr[19];
|
|
|
|
dst_ptr[20] = src_ptr[20];
|
|
|
|
dst_ptr[21] = src_ptr[21];
|
|
|
|
dst_ptr[22] = src_ptr[22];
|
|
|
|
dst_ptr[23] = src_ptr[23];
|
|
|
|
dst_ptr[24] = src_ptr[24];
|
|
|
|
dst_ptr[25] = src_ptr[25];
|
|
|
|
dst_ptr[26] = src_ptr[26];
|
|
|
|
dst_ptr[27] = src_ptr[27];
|
|
|
|
dst_ptr[28] = src_ptr[28];
|
|
|
|
dst_ptr[29] = src_ptr[29];
|
|
|
|
dst_ptr[30] = src_ptr[30];
|
|
|
|
dst_ptr[31] = src_ptr[31];
|
|
|
|
#else
|
|
|
|
((uint32_t *)dst_ptr)[0] = ((uint32_t *)src_ptr)[0] ;
|
|
|
|
((uint32_t *)dst_ptr)[1] = ((uint32_t *)src_ptr)[1] ;
|
|
|
|
((uint32_t *)dst_ptr)[2] = ((uint32_t *)src_ptr)[2] ;
|
|
|
|
((uint32_t *)dst_ptr)[3] = ((uint32_t *)src_ptr)[3] ;
|
|
|
|
((uint32_t *)dst_ptr)[4] = ((uint32_t *)src_ptr)[4] ;
|
|
|
|
((uint32_t *)dst_ptr)[5] = ((uint32_t *)src_ptr)[5] ;
|
|
|
|
((uint32_t *)dst_ptr)[6] = ((uint32_t *)src_ptr)[6] ;
|
|
|
|
((uint32_t *)dst_ptr)[7] = ((uint32_t *)src_ptr)[7] ;
|
|
|
|
#endif
|
|
|
|
src_ptr += src_stride;
|
|
|
|
dst_ptr += dst_stride;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|