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 "vpx_ports/config.h"
|
|
|
|
#include "vpx_ports/x86.h"
|
2012-11-27 22:59:17 +01:00
|
|
|
#include "vp9/encoder/vp9_variance.h"
|
|
|
|
#include "vp9/encoder/vp9_onyx_int.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-11-18 21:33:18 +01:00
|
|
|
// TODO(jimbankoski) Consider rewriting the c to take the same values rather
|
|
|
|
// than going through these pointer conversions
|
2010-05-18 17:58:33 +02:00
|
|
|
#if HAVE_MMX
|
2012-10-30 20:58:42 +01:00
|
|
|
void vp9_short_fdct8x4_mmx(short *input, short *output, int pitch) {
|
|
|
|
vp9_short_fdct4x4_mmx(input, output, pitch);
|
|
|
|
vp9_short_fdct4x4_mmx(input + 4, output + 16, pitch);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
int vp9_mbblock_error_mmx_impl(short *coeff_ptr, short *dcoef_ptr, int dc);
|
|
|
|
int vp9_mbblock_error_mmx(MACROBLOCK *mb, int dc) {
|
2012-07-14 00:21:29 +02:00
|
|
|
short *coeff_ptr = mb->block[0].coeff;
|
|
|
|
short *dcoef_ptr = mb->e_mbd.block[0].dqcoeff;
|
2012-10-30 20:58:42 +01:00
|
|
|
return vp9_mbblock_error_mmx_impl(coeff_ptr, dcoef_ptr, dc);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
int vp9_mbuverror_mmx_impl(short *s_ptr, short *d_ptr);
|
|
|
|
int vp9_mbuverror_mmx(MACROBLOCK *mb) {
|
2012-07-14 00:21:29 +02:00
|
|
|
short *s_ptr = &mb->coeff[256];
|
|
|
|
short *d_ptr = &mb->e_mbd.dqcoeff[256];
|
2012-10-30 20:58:42 +01:00
|
|
|
return vp9_mbuverror_mmx_impl(s_ptr, d_ptr);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
void vp9_subtract_b_mmx_impl(unsigned char *z, int src_stride,
|
2010-05-18 17:58:33 +02:00
|
|
|
short *diff, unsigned char *predictor,
|
|
|
|
int pitch);
|
2012-10-30 20:58:42 +01:00
|
|
|
void vp9_subtract_b_mmx(BLOCK *be, BLOCKD *bd, int pitch) {
|
2012-07-14 00:21:29 +02:00
|
|
|
unsigned char *z = *(be->base_src) + be->src;
|
|
|
|
unsigned int src_stride = be->src_stride;
|
|
|
|
short *diff = &be->src_diff[0];
|
|
|
|
unsigned char *predictor = &bd->predictor[0];
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_b_mmx_impl(z, src_stride, diff, predictor, pitch);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_SSE2
|
2012-10-30 20:58:42 +01:00
|
|
|
int vp9_mbblock_error_xmm_impl(short *coeff_ptr, short *dcoef_ptr, int dc);
|
|
|
|
int vp9_mbblock_error_xmm(MACROBLOCK *mb, int dc) {
|
2012-07-14 00:21:29 +02:00
|
|
|
short *coeff_ptr = mb->block[0].coeff;
|
|
|
|
short *dcoef_ptr = mb->e_mbd.block[0].dqcoeff;
|
2012-10-30 20:58:42 +01:00
|
|
|
return vp9_mbblock_error_xmm_impl(coeff_ptr, dcoef_ptr, dc);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
int vp9_mbuverror_xmm_impl(short *s_ptr, short *d_ptr);
|
|
|
|
int vp9_mbuverror_xmm(MACROBLOCK *mb) {
|
2012-07-14 00:21:29 +02:00
|
|
|
short *s_ptr = &mb->coeff[256];
|
|
|
|
short *d_ptr = &mb->e_mbd.dqcoeff[256];
|
2012-10-30 20:58:42 +01:00
|
|
|
return vp9_mbuverror_xmm_impl(s_ptr, d_ptr);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
void vp9_subtract_b_sse2_impl(unsigned char *z, int src_stride,
|
2012-07-14 00:21:29 +02:00
|
|
|
short *diff, unsigned char *predictor,
|
|
|
|
int pitch);
|
2012-10-30 20:58:42 +01:00
|
|
|
void vp9_subtract_b_sse2(BLOCK *be, BLOCKD *bd, int pitch) {
|
2012-07-14 00:21:29 +02:00
|
|
|
unsigned char *z = *(be->base_src) + be->src;
|
|
|
|
unsigned int src_stride = be->src_stride;
|
|
|
|
short *diff = &be->src_diff[0];
|
|
|
|
unsigned char *predictor = &bd->predictor[0];
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_b_sse2_impl(z, src_stride, diff, predictor, pitch);
|
2010-10-18 20:15:15 +02:00
|
|
|
}
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|