11b362b15af34006e6a11974088a46d42b903418eJohann/*
21b362b15af34006e6a11974088a46d42b903418eJohann *  Copyright (c) 2012 The WebM project authors. All Rights Reserved.
31b362b15af34006e6a11974088a46d42b903418eJohann *
41b362b15af34006e6a11974088a46d42b903418eJohann *  Use of this source code is governed by a BSD-style license
51b362b15af34006e6a11974088a46d42b903418eJohann *  that can be found in the LICENSE file in the root of the source
61b362b15af34006e6a11974088a46d42b903418eJohann *  tree. An additional intellectual property rights grant can be found
71b362b15af34006e6a11974088a46d42b903418eJohann *  in the file PATENTS.  All contributing project authors may
81b362b15af34006e6a11974088a46d42b903418eJohann *  be found in the AUTHORS file in the root of the source tree.
91b362b15af34006e6a11974088a46d42b903418eJohann */
101b362b15af34006e6a11974088a46d42b903418eJohann
111b362b15af34006e6a11974088a46d42b903418eJohann
121b362b15af34006e6a11974088a46d42b903418eJohann#include "vpx_config.h"
13ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#include "vp8_rtcd.h"
141b362b15af34006e6a11974088a46d42b903418eJohann#include "vpx_ports/x86.h"
151b362b15af34006e6a11974088a46d42b903418eJohann#include "vp8/encoder/block.h"
161b362b15af34006e6a11974088a46d42b903418eJohann
171b362b15af34006e6a11974088a46d42b903418eJohannint vp8_mbblock_error_xmm_impl(short *coeff_ptr, short *dcoef_ptr, int dc);
181b362b15af34006e6a11974088a46d42b903418eJohannint vp8_mbblock_error_xmm(MACROBLOCK *mb, int dc)
191b362b15af34006e6a11974088a46d42b903418eJohann{
201b362b15af34006e6a11974088a46d42b903418eJohann    short *coeff_ptr =  mb->block[0].coeff;
211b362b15af34006e6a11974088a46d42b903418eJohann    short *dcoef_ptr =  mb->e_mbd.block[0].dqcoeff;
221b362b15af34006e6a11974088a46d42b903418eJohann    return vp8_mbblock_error_xmm_impl(coeff_ptr, dcoef_ptr, dc);
231b362b15af34006e6a11974088a46d42b903418eJohann}
241b362b15af34006e6a11974088a46d42b903418eJohann
251b362b15af34006e6a11974088a46d42b903418eJohannint vp8_mbuverror_xmm_impl(short *s_ptr, short *d_ptr);
261b362b15af34006e6a11974088a46d42b903418eJohannint vp8_mbuverror_xmm(MACROBLOCK *mb)
271b362b15af34006e6a11974088a46d42b903418eJohann{
281b362b15af34006e6a11974088a46d42b903418eJohann    short *s_ptr = &mb->coeff[256];
291b362b15af34006e6a11974088a46d42b903418eJohann    short *d_ptr = &mb->e_mbd.dqcoeff[256];
301b362b15af34006e6a11974088a46d42b903418eJohann    return vp8_mbuverror_xmm_impl(s_ptr, d_ptr);
311b362b15af34006e6a11974088a46d42b903418eJohann}
321b362b15af34006e6a11974088a46d42b903418eJohann
331b362b15af34006e6a11974088a46d42b903418eJohannvoid vp8_subtract_b_sse2_impl(unsigned char *z,  int src_stride,
341b362b15af34006e6a11974088a46d42b903418eJohann                             short *diff, unsigned char *predictor,
351b362b15af34006e6a11974088a46d42b903418eJohann                             int pitch);
361b362b15af34006e6a11974088a46d42b903418eJohannvoid vp8_subtract_b_sse2(BLOCK *be, BLOCKD *bd, int pitch)
371b362b15af34006e6a11974088a46d42b903418eJohann{
381b362b15af34006e6a11974088a46d42b903418eJohann    unsigned char *z = *(be->base_src) + be->src;
391b362b15af34006e6a11974088a46d42b903418eJohann    unsigned int  src_stride = be->src_stride;
401b362b15af34006e6a11974088a46d42b903418eJohann    short *diff = &be->src_diff[0];
411b362b15af34006e6a11974088a46d42b903418eJohann    unsigned char *predictor = &bd->predictor[0];
421b362b15af34006e6a11974088a46d42b903418eJohann    vp8_subtract_b_sse2_impl(z, src_stride, diff, predictor, pitch);
431b362b15af34006e6a11974088a46d42b903418eJohann}
44