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
141b362b15af34006e6a11974088a46d42b903418eJohann/* place these declarations here because we don't want to maintain them
151b362b15af34006e6a11974088a46d42b903418eJohann * outside of this scope
161b362b15af34006e6a11974088a46d42b903418eJohann */
177bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid idct_dequant_full_2x_neon(short *q, short *dq, unsigned char *dst,
187bc9febe8749e98a3812a0dc4380ceae75c29450Johann                               int stride);
197bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid idct_dequant_0_2x_neon(short *q, short dq, unsigned char *dst, int stride);
201b362b15af34006e6a11974088a46d42b903418eJohann
217bc9febe8749e98a3812a0dc4380ceae75c29450Johannvoid vp8_dequant_idct_add_y_block_neon(short *q, short *dq, unsigned char *dst,
227bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                       int stride, char *eobs) {
237bc9febe8749e98a3812a0dc4380ceae75c29450Johann  int i;
241b362b15af34006e6a11974088a46d42b903418eJohann
257bc9febe8749e98a3812a0dc4380ceae75c29450Johann  for (i = 0; i < 4; ++i) {
267bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[0]) {
277bc9febe8749e98a3812a0dc4380ceae75c29450Johann      if (((short *)eobs)[0] & 0xfefe)
287bc9febe8749e98a3812a0dc4380ceae75c29450Johann        idct_dequant_full_2x_neon(q, dq, dst, stride);
297bc9febe8749e98a3812a0dc4380ceae75c29450Johann      else
307bc9febe8749e98a3812a0dc4380ceae75c29450Johann        idct_dequant_0_2x_neon(q, dq[0], dst, stride);
317bc9febe8749e98a3812a0dc4380ceae75c29450Johann    }
321b362b15af34006e6a11974088a46d42b903418eJohann
337bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)(eobs))[1]) {
347bc9febe8749e98a3812a0dc4380ceae75c29450Johann      if (((short *)eobs)[1] & 0xfefe)
357bc9febe8749e98a3812a0dc4380ceae75c29450Johann        idct_dequant_full_2x_neon(q + 32, dq, dst + 8, stride);
367bc9febe8749e98a3812a0dc4380ceae75c29450Johann      else
377bc9febe8749e98a3812a0dc4380ceae75c29450Johann        idct_dequant_0_2x_neon(q + 32, dq[0], dst + 8, stride);
381b362b15af34006e6a11974088a46d42b903418eJohann    }
397bc9febe8749e98a3812a0dc4380ceae75c29450Johann    q += 64;
407bc9febe8749e98a3812a0dc4380ceae75c29450Johann    dst += 4 * stride;
417bc9febe8749e98a3812a0dc4380ceae75c29450Johann    eobs += 4;
427bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
431b362b15af34006e6a11974088a46d42b903418eJohann}
441b362b15af34006e6a11974088a46d42b903418eJohann
451b362b15af34006e6a11974088a46d42b903418eJohannvoid vp8_dequant_idct_add_uv_block_neon(short *q, short *dq,
461b362b15af34006e6a11974088a46d42b903418eJohann                                        unsigned char *dstu,
477bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                        unsigned char *dstv, int stride,
487bc9febe8749e98a3812a0dc4380ceae75c29450Johann                                        char *eobs) {
497bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[0]) {
507bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)eobs)[0] & 0xfefe)
517bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_full_2x_neon(q, dq, dstu, stride);
527bc9febe8749e98a3812a0dc4380ceae75c29450Johann    else
537bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_0_2x_neon(q, dq[0], dstu, stride);
547bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
551b362b15af34006e6a11974088a46d42b903418eJohann
567bc9febe8749e98a3812a0dc4380ceae75c29450Johann  q += 32;
577bc9febe8749e98a3812a0dc4380ceae75c29450Johann  dstu += 4 * stride;
581b362b15af34006e6a11974088a46d42b903418eJohann
597bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[1]) {
607bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)eobs)[1] & 0xfefe)
617bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_full_2x_neon(q, dq, dstu, stride);
627bc9febe8749e98a3812a0dc4380ceae75c29450Johann    else
637bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_0_2x_neon(q, dq[0], dstu, stride);
647bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
651b362b15af34006e6a11974088a46d42b903418eJohann
667bc9febe8749e98a3812a0dc4380ceae75c29450Johann  q += 32;
671b362b15af34006e6a11974088a46d42b903418eJohann
687bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[2]) {
697bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)eobs)[2] & 0xfefe)
707bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_full_2x_neon(q, dq, dstv, stride);
717bc9febe8749e98a3812a0dc4380ceae75c29450Johann    else
727bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_0_2x_neon(q, dq[0], dstv, stride);
737bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
741b362b15af34006e6a11974088a46d42b903418eJohann
757bc9febe8749e98a3812a0dc4380ceae75c29450Johann  q += 32;
767bc9febe8749e98a3812a0dc4380ceae75c29450Johann  dstv += 4 * stride;
771b362b15af34006e6a11974088a46d42b903418eJohann
787bc9febe8749e98a3812a0dc4380ceae75c29450Johann  if (((short *)(eobs))[3]) {
797bc9febe8749e98a3812a0dc4380ceae75c29450Johann    if (((short *)eobs)[3] & 0xfefe)
807bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_full_2x_neon(q, dq, dstv, stride);
817bc9febe8749e98a3812a0dc4380ceae75c29450Johann    else
827bc9febe8749e98a3812a0dc4380ceae75c29450Johann      idct_dequant_0_2x_neon(q, dq[0], dstv, stride);
837bc9febe8749e98a3812a0dc4380ceae75c29450Johann  }
841b362b15af34006e6a11974088a46d42b903418eJohann}
85