/src/libvpx/vp8/common/x86/idct_blk_sse2.c
Line | Count | Source |
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 | | void vp8_idct_dequant_0_2x_sse2(short *q, short *dq, unsigned char *dst, |
15 | | int dst_stride); |
16 | | void vp8_idct_dequant_full_2x_sse2(short *q, short *dq, unsigned char *dst, |
17 | | int dst_stride); |
18 | | |
19 | | void vp8_dequant_idct_add_y_block_sse2(short *q, short *dq, unsigned char *dst, |
20 | 8.74M | int stride, char *eobs) { |
21 | 8.74M | int i; |
22 | | |
23 | 43.7M | for (i = 0; i < 4; ++i) { |
24 | 34.9M | if (((short *)(eobs))[0]) { |
25 | 30.5M | if (((short *)(eobs))[0] & 0xfefe) { |
26 | 6.79M | vp8_idct_dequant_full_2x_sse2(q, dq, dst, stride); |
27 | 23.7M | } else { |
28 | 23.7M | vp8_idct_dequant_0_2x_sse2(q, dq, dst, stride); |
29 | 23.7M | } |
30 | 30.5M | } |
31 | 34.9M | if (((short *)(eobs))[1]) { |
32 | 30.8M | if (((short *)(eobs))[1] & 0xfefe) { |
33 | 8.67M | vp8_idct_dequant_full_2x_sse2(q + 32, dq, dst + 8, stride); |
34 | 22.1M | } else { |
35 | 22.1M | vp8_idct_dequant_0_2x_sse2(q + 32, dq, dst + 8, stride); |
36 | 22.1M | } |
37 | 30.8M | } |
38 | 34.9M | q += 64; |
39 | 34.9M | dst += stride * 4; |
40 | 34.9M | eobs += 4; |
41 | 34.9M | } |
42 | 8.74M | } |
43 | | |
44 | | void vp8_dequant_idct_add_uv_block_sse2(short *q, short *dq, |
45 | | unsigned char *dst_u, |
46 | | unsigned char *dst_v, int stride, |
47 | 179M | char *eobs) { |
48 | 179M | if (((short *)(eobs))[0]) { |
49 | 13.6M | if (((short *)(eobs))[0] & 0xfefe) { |
50 | 4.95M | vp8_idct_dequant_full_2x_sse2(q, dq, dst_u, stride); |
51 | 8.66M | } else { |
52 | 8.66M | vp8_idct_dequant_0_2x_sse2(q, dq, dst_u, stride); |
53 | 8.66M | } |
54 | 13.6M | } |
55 | 179M | q += 32; |
56 | 179M | dst_u += stride * 4; |
57 | | |
58 | 179M | if (((short *)(eobs))[1]) { |
59 | 14.8M | if (((short *)(eobs))[1] & 0xfefe) { |
60 | 6.77M | vp8_idct_dequant_full_2x_sse2(q, dq, dst_u, stride); |
61 | 8.09M | } else { |
62 | 8.09M | vp8_idct_dequant_0_2x_sse2(q, dq, dst_u, stride); |
63 | 8.09M | } |
64 | 14.8M | } |
65 | 179M | q += 32; |
66 | | |
67 | 179M | if (((short *)(eobs))[2]) { |
68 | 13.1M | if (((short *)(eobs))[2] & 0xfefe) { |
69 | 6.17M | vp8_idct_dequant_full_2x_sse2(q, dq, dst_v, stride); |
70 | 6.95M | } else { |
71 | 6.95M | vp8_idct_dequant_0_2x_sse2(q, dq, dst_v, stride); |
72 | 6.95M | } |
73 | 13.1M | } |
74 | 179M | q += 32; |
75 | 179M | dst_v += stride * 4; |
76 | | |
77 | 179M | if (((short *)(eobs))[3]) { |
78 | 11.5M | if (((short *)(eobs))[3] & 0xfefe) { |
79 | 6.93M | vp8_idct_dequant_full_2x_sse2(q, dq, dst_v, stride); |
80 | 6.93M | } else { |
81 | 4.65M | vp8_idct_dequant_0_2x_sse2(q, dq, dst_v, stride); |
82 | 4.65M | } |
83 | 11.5M | } |
84 | 179M | } |