11b362b15af34006e6a11974088a46d42b903418eJohann/*
21b362b15af34006e6a11974088a46d42b903418eJohann *  Copyright (c) 2010 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#include "vpx_config.h"
12ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#include "vp8_rtcd.h"
131b362b15af34006e6a11974088a46d42b903418eJohann
147bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid vp8_idct_dequant_0_2x_sse2(short *q, short *dq, unsigned char *dst,
157bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                int dst_stride);
167bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid vp8_idct_dequant_full_2x_sse2(short *q, short *dq, unsigned char *dst,
177bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                   int dst_stride);
181b362b15af34006e6a11974088a46d42b903418eJohann
197bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid vp8_dequant_idct_add_y_block_sse2(short *q, short *dq, unsigned char *dst,
207bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                       int stride, char *eobs) {
217bc9febe8749e98a3812a0dc4380ceae75c29450Johann  int i;
221b362b15af34006e6a11974088a46d42b903418eJohann
237bc9febe8749e98a3812a0dc4380ceae75c29450Johann  for (i = 0; i < 4; ++i) {
247bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[0]) {
257bc9febe8749e98a3812a0dc4380ceae75c29450Johann      if (((short *)(eobs))[0] & 0xfefe) {
267bc9febe8749e98a3812a0dc4380ceae75c29450Johann        vp8_idct_dequant_full_2x_sse2(q, dq, dst, stride);
277bc9febe8749e98a3812a0dc4380ceae75c29450Johann      } else {
287bc9febe8749e98a3812a0dc4380ceae75c29450Johann        vp8_idct_dequant_0_2x_sse2(q, dq, dst, stride);
297bc9febe8749e98a3812a0dc4380ceae75c29450Johann      }
301b362b15af34006e6a11974088a46d42b903418eJohann    }
317bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[1]) {
327bc9febe8749e98a3812a0dc4380ceae75c29450Johann      if (((short *)(eobs))[1] & 0xfefe) {
337bc9febe8749e98a3812a0dc4380ceae75c29450Johann        vp8_idct_dequant_full_2x_sse2(q + 32, dq, dst + 8, stride);
347bc9febe8749e98a3812a0dc4380ceae75c29450Johann      } else {
357bc9febe8749e98a3812a0dc4380ceae75c29450Johann        vp8_idct_dequant_0_2x_sse2(q + 32, dq, dst + 8, stride);
367bc9febe8749e98a3812a0dc4380ceae75c29450Johann      }
377bc9febe8749e98a3812a0dc4380ceae75c29450Johann    }
387bc9febe8749e98a3812a0dc4380ceae75c29450Johann    q += 64;
397bc9febe8749e98a3812a0dc4380ceae75c29450Johann    dst += stride * 4;
407bc9febe8749e98a3812a0dc4380ceae75c29450Johann    eobs += 4;
417bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
421b362b15af34006e6a11974088a46d42b903418eJohann}
431b362b15af34006e6a11974088a46d42b903418eJohann
447bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid vp8_dequant_idct_add_uv_block_sse2(short *q, short *dq,
457bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                        unsigned char *dstu,
467bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                        unsigned char *dstv, int stride,
477bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                        char *eobs) {
487bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[0]) {
497bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[0] & 0xfefe) {
507bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_full_2x_sse2(q, dq, dstu, stride);
517bc9febe8749e98a3812a0dc4380ceae75c29450Johann    } else {
527bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_0_2x_sse2(q, dq, dstu, stride);
531b362b15af34006e6a11974088a46d42b903418eJohann    }
547bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
557bc9febe8749e98a3812a0dc4380ceae75c29450Johann  q += 32;
567bc9febe8749e98a3812a0dc4380ceae75c29450Johann  dstu += stride * 4;
571b362b15af34006e6a11974088a46d42b903418eJohann
587bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[1]) {
597bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[1] & 0xfefe) {
607bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_full_2x_sse2(q, dq, dstu, stride);
617bc9febe8749e98a3812a0dc4380ceae75c29450Johann    } else {
627bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_0_2x_sse2(q, dq, dstu, stride);
631b362b15af34006e6a11974088a46d42b903418eJohann    }
647bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
657bc9febe8749e98a3812a0dc4380ceae75c29450Johann  q += 32;
661b362b15af34006e6a11974088a46d42b903418eJohann
677bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[2]) {
687bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[2] & 0xfefe) {
697bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_full_2x_sse2(q, dq, dstv, stride);
707bc9febe8749e98a3812a0dc4380ceae75c29450Johann    } else {
717bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_0_2x_sse2(q, dq, dstv, stride);
721b362b15af34006e6a11974088a46d42b903418eJohann    }
737bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
747bc9febe8749e98a3812a0dc4380ceae75c29450Johann  q += 32;
757bc9febe8749e98a3812a0dc4380ceae75c29450Johann  dstv += stride * 4;
761b362b15af34006e6a11974088a46d42b903418eJohann
777bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[3]) {
787bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[3] & 0xfefe) {
797bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_full_2x_sse2(q, dq, dstv, stride);
807bc9febe8749e98a3812a0dc4380ceae75c29450Johann    } else {
817bc9febe8749e98a3812a0dc4380ceae75c29450Johann      vp8_idct_dequant_0_2x_sse2(q, dq, dstv, stride);
821b362b15af34006e6a11974088a46d42b903418eJohann    }
837bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
841b362b15af34006e6a11974088a46d42b903418eJohann}
85