Fix relative include paths
[libvpx.git] / vp8 / decoder / x86 / idct_blk_mmx.c
blob8f1a363cd7827818aeb8b6bad02505b04082bb2c
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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 */
11 #include "vpx_ports/config.h"
12 #include "vp8/common/idct.h"
13 #include "vp8/decoder/dequantize.h"
15 void vp8_dequant_dc_idct_add_y_block_mmx
16 (short *q, short *dq, unsigned char *pre,
17 unsigned char *dst, int stride, char *eobs, short *dc)
19 int i;
21 for (i = 0; i < 4; i++)
23 if (eobs[0] > 1)
24 vp8_dequant_dc_idct_add_mmx (q, dq, pre, dst, 16, stride, dc[0]);
25 else
26 vp8_dc_only_idct_add_mmx (dc[0], pre, dst, 16, stride);
28 if (eobs[1] > 1)
29 vp8_dequant_dc_idct_add_mmx (q+16, dq, pre+4, dst+4, 16, stride, dc[1]);
30 else
31 vp8_dc_only_idct_add_mmx (dc[1], pre+4, dst+4, 16, stride);
33 if (eobs[2] > 1)
34 vp8_dequant_dc_idct_add_mmx (q+32, dq, pre+8, dst+8, 16, stride, dc[2]);
35 else
36 vp8_dc_only_idct_add_mmx (dc[2], pre+8, dst+8, 16, stride);
38 if (eobs[3] > 1)
39 vp8_dequant_dc_idct_add_mmx (q+48, dq, pre+12, dst+12, 16, stride, dc[3]);
40 else
41 vp8_dc_only_idct_add_mmx (dc[3], pre+12, dst+12, 16, stride);
43 q += 64;
44 dc += 4;
45 pre += 64;
46 dst += 4*stride;
47 eobs += 4;
51 void vp8_dequant_idct_add_y_block_mmx
52 (short *q, short *dq, unsigned char *pre,
53 unsigned char *dst, int stride, char *eobs)
55 int i;
57 for (i = 0; i < 4; i++)
59 if (eobs[0] > 1)
60 vp8_dequant_idct_add_mmx (q, dq, pre, dst, 16, stride);
61 else
63 vp8_dc_only_idct_add_mmx (q[0]*dq[0], pre, dst, 16, stride);
64 ((int *)q)[0] = 0;
67 if (eobs[1] > 1)
68 vp8_dequant_idct_add_mmx (q+16, dq, pre+4, dst+4, 16, stride);
69 else
71 vp8_dc_only_idct_add_mmx (q[16]*dq[0], pre+4, dst+4, 16, stride);
72 ((int *)(q+16))[0] = 0;
75 if (eobs[2] > 1)
76 vp8_dequant_idct_add_mmx (q+32, dq, pre+8, dst+8, 16, stride);
77 else
79 vp8_dc_only_idct_add_mmx (q[32]*dq[0], pre+8, dst+8, 16, stride);
80 ((int *)(q+32))[0] = 0;
83 if (eobs[3] > 1)
84 vp8_dequant_idct_add_mmx (q+48, dq, pre+12, dst+12, 16, stride);
85 else
87 vp8_dc_only_idct_add_mmx (q[48]*dq[0], pre+12, dst+12, 16, stride);
88 ((int *)(q+48))[0] = 0;
91 q += 64;
92 pre += 64;
93 dst += 4*stride;
94 eobs += 4;
98 void vp8_dequant_idct_add_uv_block_mmx
99 (short *q, short *dq, unsigned char *pre,
100 unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
102 int i;
104 for (i = 0; i < 2; i++)
106 if (eobs[0] > 1)
107 vp8_dequant_idct_add_mmx (q, dq, pre, dstu, 8, stride);
108 else
110 vp8_dc_only_idct_add_mmx (q[0]*dq[0], pre, dstu, 8, stride);
111 ((int *)q)[0] = 0;
114 if (eobs[1] > 1)
115 vp8_dequant_idct_add_mmx (q+16, dq, pre+4, dstu+4, 8, stride);
116 else
118 vp8_dc_only_idct_add_mmx (q[16]*dq[0], pre+4, dstu+4, 8, stride);
119 ((int *)(q+16))[0] = 0;
122 q += 32;
123 pre += 32;
124 dstu += 4*stride;
125 eobs += 2;
128 for (i = 0; i < 2; i++)
130 if (eobs[0] > 1)
131 vp8_dequant_idct_add_mmx (q, dq, pre, dstv, 8, stride);
132 else
134 vp8_dc_only_idct_add_mmx (q[0]*dq[0], pre, dstv, 8, stride);
135 ((int *)q)[0] = 0;
138 if (eobs[1] > 1)
139 vp8_dequant_idct_add_mmx (q+16, dq, pre+4, dstv+4, 8, stride);
140 else
142 vp8_dc_only_idct_add_mmx (q[16]*dq[0], pre+4, dstv+4, 8, stride);
143 ((int *)(q+16))[0] = 0;
146 q += 32;
147 pre += 32;
148 dstv += 4*stride;
149 eobs += 2;