Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: source/libvpx/vp9/decoder/x86/vp9_idct_blk_mmx.c

Issue 11555023: libvpx: Add VP9 decoder. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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 "vp9/common/vp9_blockd.h"
13 #include "vp9/decoder/vp9_dequantize.h"
14 #include "vp9/decoder/x86/vp9_idct_mmx.h"
15
16 void vp9_dequant_dc_idct_add_y_block_mmx(short *q, const short *dq,
17 unsigned char *pre,
18 unsigned char *dst,
19 int stride, unsigned short *eobs,
20 const short *dc) {
21 int i;
22
23 for (i = 0; i < 4; i++) {
24 if (eobs[0] > 1)
25 vp9_dequant_dc_idct_add_mmx(q, dq, pre, dst, 16, stride, dc[0]);
26 else
27 vp9_dc_only_idct_add_mmx(dc[0], pre, dst, 16, stride);
28
29 if (eobs[1] > 1)
30 vp9_dequant_dc_idct_add_mmx(q + 16, dq, pre + 4,
31 dst + 4, 16, stride, dc[1]);
32 else
33 vp9_dc_only_idct_add_mmx(dc[1], pre + 4, dst + 4, 16, stride);
34
35 if (eobs[2] > 1)
36 vp9_dequant_dc_idct_add_mmx(q + 32, dq, pre + 8,
37 dst + 8, 16, stride, dc[2]);
38 else
39 vp9_dc_only_idct_add_mmx(dc[2], pre + 8, dst + 8, 16, stride);
40
41 if (eobs[3] > 1)
42 vp9_dequant_dc_idct_add_mmx(q + 48, dq, pre + 12,
43 dst + 12, 16, stride, dc[3]);
44 else
45 vp9_dc_only_idct_add_mmx(dc[3], pre + 12, dst + 12, 16, stride);
46
47 q += 64;
48 dc += 4;
49 pre += 64;
50 dst += 4 * stride;
51 eobs += 4;
52 }
53 }
54
55 void vp9_dequant_idct_add_y_block_mmx(short *q, const short *dq,
56 unsigned char *pre,
57 unsigned char *dst,
58 int stride, unsigned short *eobs) {
59 int i;
60
61 for (i = 0; i < 4; i++) {
62 if (eobs[0] > 1)
63 vp9_dequant_idct_add_mmx(q, dq, pre, dst, 16, stride);
64 else {
65 vp9_dc_only_idct_add_mmx(q[0]*dq[0], pre, dst, 16, stride);
66 ((int *)q)[0] = 0;
67 }
68
69 if (eobs[1] > 1)
70 vp9_dequant_idct_add_mmx(q + 16, dq, pre + 4, dst + 4, 16, stride);
71 else {
72 vp9_dc_only_idct_add_mmx(q[16]*dq[0], pre + 4, dst + 4, 16, stride);
73 ((int *)(q + 16))[0] = 0;
74 }
75
76 if (eobs[2] > 1)
77 vp9_dequant_idct_add_mmx(q + 32, dq, pre + 8, dst + 8, 16, stride);
78 else {
79 vp9_dc_only_idct_add_mmx(q[32]*dq[0], pre + 8, dst + 8, 16, stride);
80 ((int *)(q + 32))[0] = 0;
81 }
82
83 if (eobs[3] > 1)
84 vp9_dequant_idct_add_mmx(q + 48, dq, pre + 12, dst + 12, 16, stride);
85 else {
86 vp9_dc_only_idct_add_mmx(q[48]*dq[0], pre + 12, dst + 12, 16, stride);
87 ((int *)(q + 48))[0] = 0;
88 }
89
90 q += 64;
91 pre += 64;
92 dst += 4 * stride;
93 eobs += 4;
94 }
95 }
96
97 void vp9_dequant_idct_add_uv_block_mmx(short *q, const short *dq,
98 unsigned char *pre,
99 unsigned char *dstu,
100 unsigned char *dstv,
101 int stride, unsigned short *eobs) {
102 int i;
103
104 for (i = 0; i < 2; i++) {
105 if (eobs[0] > 1)
106 vp9_dequant_idct_add_mmx(q, dq, pre, dstu, 8, stride);
107 else {
108 vp9_dc_only_idct_add_mmx(q[0]*dq[0], pre, dstu, 8, stride);
109 ((int *)q)[0] = 0;
110 }
111
112 if (eobs[1] > 1)
113 vp9_dequant_idct_add_mmx(q + 16, dq, pre + 4, dstu + 4, 8, stride);
114 else {
115 vp9_dc_only_idct_add_mmx(q[16]*dq[0], pre + 4, dstu + 4, 8, stride);
116 ((int *)(q + 16))[0] = 0;
117 }
118
119 q += 32;
120 pre += 32;
121 dstu += 4 * stride;
122 eobs += 2;
123 }
124
125 for (i = 0; i < 2; i++) {
126 if (eobs[0] > 1)
127 vp9_dequant_idct_add_mmx(q, dq, pre, dstv, 8, stride);
128 else {
129 vp9_dc_only_idct_add_mmx(q[0]*dq[0], pre, dstv, 8, stride);
130 ((int *)q)[0] = 0;
131 }
132
133 if (eobs[1] > 1)
134 vp9_dequant_idct_add_mmx(q + 16, dq, pre + 4, dstv + 4, 8, stride);
135 else {
136 vp9_dc_only_idct_add_mmx(q[16]*dq[0], pre + 4, dstv + 4, 8, stride);
137 ((int *)(q + 16))[0] = 0;
138 }
139
140 q += 32;
141 pre += 32;
142 dstv += 4 * stride;
143 eobs += 2;
144 }
145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698