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.
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
)
21 for (i
= 0; i
< 4; i
++)
24 vp8_dequant_dc_idct_add_mmx (q
, dq
, pre
, dst
, 16, stride
, dc
[0]);
26 vp8_dc_only_idct_add_mmx (dc
[0], pre
, dst
, 16, stride
);
29 vp8_dequant_dc_idct_add_mmx (q
+16, dq
, pre
+4, dst
+4, 16, stride
, dc
[1]);
31 vp8_dc_only_idct_add_mmx (dc
[1], pre
+4, dst
+4, 16, stride
);
34 vp8_dequant_dc_idct_add_mmx (q
+32, dq
, pre
+8, dst
+8, 16, stride
, dc
[2]);
36 vp8_dc_only_idct_add_mmx (dc
[2], pre
+8, dst
+8, 16, stride
);
39 vp8_dequant_dc_idct_add_mmx (q
+48, dq
, pre
+12, dst
+12, 16, stride
, dc
[3]);
41 vp8_dc_only_idct_add_mmx (dc
[3], pre
+12, dst
+12, 16, stride
);
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
)
57 for (i
= 0; i
< 4; i
++)
60 vp8_dequant_idct_add_mmx (q
, dq
, pre
, dst
, 16, stride
);
63 vp8_dc_only_idct_add_mmx (q
[0]*dq
[0], pre
, dst
, 16, stride
);
68 vp8_dequant_idct_add_mmx (q
+16, dq
, pre
+4, dst
+4, 16, stride
);
71 vp8_dc_only_idct_add_mmx (q
[16]*dq
[0], pre
+4, dst
+4, 16, stride
);
72 ((int *)(q
+16))[0] = 0;
76 vp8_dequant_idct_add_mmx (q
+32, dq
, pre
+8, dst
+8, 16, stride
);
79 vp8_dc_only_idct_add_mmx (q
[32]*dq
[0], pre
+8, dst
+8, 16, stride
);
80 ((int *)(q
+32))[0] = 0;
84 vp8_dequant_idct_add_mmx (q
+48, dq
, pre
+12, dst
+12, 16, stride
);
87 vp8_dc_only_idct_add_mmx (q
[48]*dq
[0], pre
+12, dst
+12, 16, stride
);
88 ((int *)(q
+48))[0] = 0;
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
)
104 for (i
= 0; i
< 2; i
++)
107 vp8_dequant_idct_add_mmx (q
, dq
, pre
, dstu
, 8, stride
);
110 vp8_dc_only_idct_add_mmx (q
[0]*dq
[0], pre
, dstu
, 8, stride
);
115 vp8_dequant_idct_add_mmx (q
+16, dq
, pre
+4, dstu
+4, 8, stride
);
118 vp8_dc_only_idct_add_mmx (q
[16]*dq
[0], pre
+4, dstu
+4, 8, stride
);
119 ((int *)(q
+16))[0] = 0;
128 for (i
= 0; i
< 2; i
++)
131 vp8_dequant_idct_add_mmx (q
, dq
, pre
, dstv
, 8, stride
);
134 vp8_dc_only_idct_add_mmx (q
[0]*dq
[0], pre
, dstv
, 8, stride
);
139 vp8_dequant_idct_add_mmx (q
+16, dq
, pre
+4, dstv
+4, 8, stride
);
142 vp8_dc_only_idct_add_mmx (q
[16]*dq
[0], pre
+4, dstv
+4, 8, stride
);
143 ((int *)(q
+16))[0] = 0;