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_ports/config.h"
12 #include "vp8/common/idct.h"
13 #include "vp8/decoder/dequantize.h"
14
15 /* place these declarations here because we don't want to maintain them
16 * outside of this scope
17 */
18 void idct_dequant_dc_full_2x_neon
19 (short *input, short *dq, unsigned char *pre, unsigned char *dst,
20 int stride, short *dc);
21 void idct_dequant_dc_0_2x_neon
22 (short *dc, unsigned char *pre, unsigned char *dst, int stride);
23 void idct_dequant_full_2x_neon
24 (short *q, short *dq, unsigned char *pre, unsigned char *dst,
25 int pitch, int stride);
26 void idct_dequant_0_2x_neon
27 (short *q, short dq, unsigned char *pre, int pitch,
28 unsigned char *dst, int stride);
29
vp8_dequant_dc_idct_add_y_block_neon(short * q,short * dq,unsigned char * pre,unsigned char * dst,int stride,char * eobs,short * dc)30 void vp8_dequant_dc_idct_add_y_block_neon
31 (short *q, short *dq, unsigned char *pre,
32 unsigned char *dst, int stride, char *eobs, short *dc)
33 {
34 int i;
35
36 for (i = 0; i < 4; i++)
37 {
38 if (((short *)eobs)[0] & 0xfefe)
39 idct_dequant_dc_full_2x_neon (q, dq, pre, dst, stride, dc);
40 else
41 idct_dequant_dc_0_2x_neon(dc, pre, dst, stride);
42
43 if (((short *)eobs)[1] & 0xfefe)
44 idct_dequant_dc_full_2x_neon (q+32, dq, pre+8, dst+8, stride, dc+2);
45 else
46 idct_dequant_dc_0_2x_neon(dc+2, pre+8, dst+8, stride);
47
48 q += 64;
49 dc += 4;
50 pre += 64;
51 dst += 4*stride;
52 eobs += 4;
53 }
54 }
55
vp8_dequant_idct_add_y_block_neon(short * q,short * dq,unsigned char * pre,unsigned char * dst,int stride,char * eobs)56 void vp8_dequant_idct_add_y_block_neon
57 (short *q, short *dq, unsigned char *pre,
58 unsigned char *dst, int stride, char *eobs)
59 {
60 int i;
61
62 for (i = 0; i < 4; i++)
63 {
64 if (((short *)eobs)[0] & 0xfefe)
65 idct_dequant_full_2x_neon (q, dq, pre, dst, 16, stride);
66 else
67 idct_dequant_0_2x_neon (q, dq[0], pre, 16, dst, stride);
68
69 if (((short *)eobs)[1] & 0xfefe)
70 idct_dequant_full_2x_neon (q+32, dq, pre+8, dst+8, 16, stride);
71 else
72 idct_dequant_0_2x_neon (q+32, dq[0], pre+8, 16, dst+8, stride);
73
74 q += 64;
75 pre += 64;
76 dst += 4*stride;
77 eobs += 4;
78 }
79 }
80
vp8_dequant_idct_add_uv_block_neon(short * q,short * dq,unsigned char * pre,unsigned char * dstu,unsigned char * dstv,int stride,char * eobs)81 void vp8_dequant_idct_add_uv_block_neon
82 (short *q, short *dq, unsigned char *pre,
83 unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
84 {
85 if (((short *)eobs)[0] & 0xfefe)
86 idct_dequant_full_2x_neon (q, dq, pre, dstu, 8, stride);
87 else
88 idct_dequant_0_2x_neon (q, dq[0], pre, 8, dstu, stride);
89
90 q += 32;
91 pre += 32;
92 dstu += 4*stride;
93
94 if (((short *)eobs)[1] & 0xfefe)
95 idct_dequant_full_2x_neon (q, dq, pre, dstu, 8, stride);
96 else
97 idct_dequant_0_2x_neon (q, dq[0], pre, 8, dstu, stride);
98
99 q += 32;
100 pre += 32;
101
102 if (((short *)eobs)[2] & 0xfefe)
103 idct_dequant_full_2x_neon (q, dq, pre, dstv, 8, stride);
104 else
105 idct_dequant_0_2x_neon (q, dq[0], pre, 8, dstv, stride);
106
107 q += 32;
108 pre += 32;
109 dstv += 4*stride;
110
111 if (((short *)eobs)[3] & 0xfefe)
112 idct_dequant_full_2x_neon (q, dq, pre, dstv, 8, stride);
113 else
114 idct_dequant_0_2x_neon (q, dq[0], pre, 8, dstv, stride);
115 }
116