Home | History | Annotate | Download | only in neon
      1 /*
      2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #include "vpx_config.h"
     12 #include "vp8_rtcd.h"
     13 
     14 /* place these declarations here because we don't want to maintain them
     15  * outside of this scope
     16  */
     17 void idct_dequant_full_2x_neon(short *q, short *dq,
     18                                unsigned char *dst, int stride);
     19 void idct_dequant_0_2x_neon(short *q, short dq,
     20                             unsigned char *dst, int stride);
     21 
     22 
     23 void vp8_dequant_idct_add_y_block_neon(short *q, short *dq,
     24                                        unsigned char *dst,
     25                                        int stride, char *eobs)
     26 {
     27     int i;
     28 
     29     for (i = 0; i < 4; i++)
     30     {
     31         if (((short *)(eobs))[0])
     32         {
     33             if (((short *)eobs)[0] & 0xfefe)
     34                 idct_dequant_full_2x_neon (q, dq, dst, stride);
     35             else
     36                 idct_dequant_0_2x_neon (q, dq[0], dst, stride);
     37         }
     38 
     39         if (((short *)(eobs))[1])
     40         {
     41             if (((short *)eobs)[1] & 0xfefe)
     42                 idct_dequant_full_2x_neon (q+32, dq, dst+8, stride);
     43             else
     44                 idct_dequant_0_2x_neon (q+32, dq[0], dst+8, stride);
     45         }
     46         q    += 64;
     47         dst  += 4*stride;
     48         eobs += 4;
     49     }
     50 }
     51 
     52 void vp8_dequant_idct_add_uv_block_neon(short *q, short *dq,
     53                                         unsigned char *dstu,
     54                                         unsigned char *dstv,
     55                                         int stride, char *eobs)
     56 {
     57     if (((short *)(eobs))[0])
     58     {
     59         if (((short *)eobs)[0] & 0xfefe)
     60             idct_dequant_full_2x_neon (q, dq, dstu, stride);
     61         else
     62             idct_dequant_0_2x_neon (q, dq[0], dstu, stride);
     63     }
     64 
     65     q    += 32;
     66     dstu += 4*stride;
     67 
     68     if (((short *)(eobs))[1])
     69     {
     70         if (((short *)eobs)[1] & 0xfefe)
     71             idct_dequant_full_2x_neon (q, dq, dstu, stride);
     72         else
     73             idct_dequant_0_2x_neon (q, dq[0], dstu, stride);
     74     }
     75 
     76     q += 32;
     77 
     78     if (((short *)(eobs))[2])
     79     {
     80         if (((short *)eobs)[2] & 0xfefe)
     81             idct_dequant_full_2x_neon (q, dq, dstv, stride);
     82         else
     83             idct_dequant_0_2x_neon (q, dq[0], dstv, stride);
     84     }
     85 
     86     q    += 32;
     87     dstv += 4*stride;
     88 
     89     if (((short *)(eobs))[3])
     90     {
     91         if (((short *)eobs)[3] & 0xfefe)
     92             idct_dequant_full_2x_neon (q, dq, dstv, stride);
     93         else
     94             idct_dequant_0_2x_neon (q, dq[0], dstv, stride);
     95     }
     96 }
     97