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

Side by Side Diff: source/libvpx/vp9/decoder/vp9_idct_blk.c

Issue 11974002: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 11 months 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
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_detokenize.c ('k') | source/libvpx/vp9/decoder/vp9_onyxd.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "vp9_rtcd.h" 11 #include "vp9_rtcd.h"
12 #include "vp9/common/vp9_blockd.h" 12 #include "vp9/common/vp9_blockd.h"
13 #if CONFIG_LOSSLESS 13 #if CONFIG_LOSSLESS
14 #include "vp9/decoder/vp9_dequantize.h" 14 #include "vp9/decoder/vp9_dequantize.h"
15 #endif 15 #endif
16 16
17 void vp9_dequant_dc_idct_add_y_block_c(short *q, const short *dq, 17 void vp9_dequant_dc_idct_add_y_block_c(int16_t *q, const int16_t *dq,
18 unsigned char *pre, 18 uint8_t *pre,
19 unsigned char *dst, 19 uint8_t *dst,
20 int stride, unsigned short *eobs, 20 int stride, uint16_t *eobs,
21 const short *dc) { 21 const int16_t *dc) {
22 int i, j; 22 int i, j;
23 23
24 for (i = 0; i < 4; i++) { 24 for (i = 0; i < 4; i++) {
25 for (j = 0; j < 4; j++) { 25 for (j = 0; j < 4; j++) {
26 if (*eobs++ > 1) 26 if (*eobs++ > 1)
27 vp9_dequant_dc_idct_add_c(q, dq, pre, dst, 16, stride, dc[0]); 27 vp9_dequant_dc_idct_add_c(q, dq, pre, dst, 16, stride, dc[0]);
28 else 28 else
29 vp9_dc_only_idct_add_c(dc[0], pre, dst, 16, stride); 29 vp9_dc_only_idct_add_c(dc[0], pre, dst, 16, stride);
30 30
31 q += 16; 31 q += 16;
32 pre += 4; 32 pre += 4;
33 dst += 4; 33 dst += 4;
34 dc++; 34 dc++;
35 } 35 }
36 36
37 pre += 64 - 16; 37 pre += 64 - 16;
38 dst += 4 * stride - 16; 38 dst += 4 * stride - 16;
39 } 39 }
40 } 40 }
41 41
42 #if CONFIG_SUPERBLOCKS 42 void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(int16_t *q,
43 void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, const short *dq, 43 const int16_t *dq,
44 unsigned char *dst, 44 uint8_t *dst,
45 int stride, 45 int stride,
46 unsigned short *eobs, 46 uint16_t *eobs,
47 const short *dc, 47 const int16_t *dc,
48 MACROBLOCKD *xd) { 48 MACROBLOCKD *xd) {
49 int i, j; 49 int i, j;
50 50
51 for (i = 0; i < 4; i++) { 51 for (i = 0; i < 4; i++) {
52 for (j = 0; j < 4; j++) { 52 for (j = 0; j < 4; j++) {
53 if (*eobs++ > 1) 53 if (*eobs++ > 1)
54 vp9_dequant_dc_idct_add_c(q, dq, dst, dst, stride, stride, dc[0]); 54 vp9_dequant_dc_idct_add_c(q, dq, dst, dst, stride, stride, dc[0]);
55 else 55 else
56 vp9_dc_only_idct_add_c(dc[0], dst, dst, stride, stride); 56 vp9_dc_only_idct_add_c(dc[0], dst, dst, stride, stride);
57 57
58 q += 16; 58 q += 16;
59 dst += 4; 59 dst += 4;
60 dc++; 60 dc++;
61 } 61 }
62 62
63 dst += 4 * stride - 16; 63 dst += 4 * stride - 16;
64 } 64 }
65 } 65 }
66 #endif
67 66
68 void vp9_dequant_idct_add_y_block_c(short *q, const short *dq, 67 void vp9_dequant_idct_add_y_block_c(int16_t *q, const int16_t *dq,
69 unsigned char *pre, 68 uint8_t *pre,
70 unsigned char *dst, 69 uint8_t *dst,
71 int stride, unsigned short *eobs) { 70 int stride, uint16_t *eobs) {
72 int i, j; 71 int i, j;
73 72
74 for (i = 0; i < 4; i++) { 73 for (i = 0; i < 4; i++) {
75 for (j = 0; j < 4; j++) { 74 for (j = 0; j < 4; j++) {
76 if (*eobs++ > 1) 75 if (*eobs++ > 1)
77 vp9_dequant_idct_add_c(q, dq, pre, dst, 16, stride); 76 vp9_dequant_idct_add_c(q, dq, pre, dst, 16, stride);
78 else { 77 else {
79 vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dst, 16, stride); 78 vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dst, 16, stride);
80 ((int *)q)[0] = 0; 79 ((int *)q)[0] = 0;
81 } 80 }
82 81
83 q += 16; 82 q += 16;
84 pre += 4; 83 pre += 4;
85 dst += 4; 84 dst += 4;
86 } 85 }
87 86
88 pre += 64 - 16; 87 pre += 64 - 16;
89 dst += 4 * stride - 16; 88 dst += 4 * stride - 16;
90 } 89 }
91 } 90 }
92 91
93 void vp9_dequant_idct_add_uv_block_c(short *q, const short *dq, 92 void vp9_dequant_idct_add_uv_block_c(int16_t *q, const int16_t *dq,
94 unsigned char *pre, unsigned char *dstu, 93 uint8_t *pre, uint8_t *dstu,
95 unsigned char *dstv, int stride, 94 uint8_t *dstv, int stride,
96 unsigned short *eobs) { 95 uint16_t *eobs) {
97 int i, j; 96 int i, j;
98 97
99 for (i = 0; i < 2; i++) { 98 for (i = 0; i < 2; i++) {
100 for (j = 0; j < 2; j++) { 99 for (j = 0; j < 2; j++) {
101 if (*eobs++ > 1) 100 if (*eobs++ > 1)
102 vp9_dequant_idct_add_c(q, dq, pre, dstu, 8, stride); 101 vp9_dequant_idct_add_c(q, dq, pre, dstu, 8, stride);
103 else { 102 else {
104 vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dstu, 8, stride); 103 vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dstu, 8, stride);
105 ((int *)q)[0] = 0; 104 ((int *)q)[0] = 0;
106 } 105 }
(...skipping 19 matching lines...) Expand all
126 q += 16; 125 q += 16;
127 pre += 4; 126 pre += 4;
128 dstv += 4; 127 dstv += 4;
129 } 128 }
130 129
131 pre += 32 - 8; 130 pre += 32 - 8;
132 dstv += 4 * stride - 8; 131 dstv += 4 * stride - 8;
133 } 132 }
134 } 133 }
135 134
136 #if CONFIG_SUPERBLOCKS 135 void vp9_dequant_idct_add_uv_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
137 void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, const short *dq, 136 uint8_t *dstu,
138 unsigned char *dstu, 137 uint8_t *dstv,
139 unsigned char *dstv,
140 int stride, 138 int stride,
141 unsigned short *eobs, 139 uint16_t *eobs,
142 MACROBLOCKD *xd) { 140 MACROBLOCKD *xd) {
143 int i, j; 141 int i, j;
144 142
145 for (i = 0; i < 2; i++) { 143 for (i = 0; i < 2; i++) {
146 for (j = 0; j < 2; j++) { 144 for (j = 0; j < 2; j++) {
147 if (*eobs++ > 1) { 145 if (*eobs++ > 1) {
148 vp9_dequant_idct_add_c(q, dq, dstu, dstu, stride, stride); 146 vp9_dequant_idct_add_c(q, dq, dstu, dstu, stride, stride);
149 } else { 147 } else {
150 vp9_dc_only_idct_add_c(q[0]*dq[0], dstu, dstu, stride, stride); 148 vp9_dc_only_idct_add_c(q[0]*dq[0], dstu, dstu, stride, stride);
151 ((int *)q)[0] = 0; 149 ((int *)q)[0] = 0;
(...skipping 15 matching lines...) Expand all
167 ((int *)q)[0] = 0; 165 ((int *)q)[0] = 0;
168 } 166 }
169 167
170 q += 16; 168 q += 16;
171 dstv += 4; 169 dstv += 4;
172 } 170 }
173 171
174 dstv += 4 * stride - 8; 172 dstv += 4 * stride - 8;
175 } 173 }
176 } 174 }
177 #endif
178 175
179 void vp9_dequant_dc_idct_add_y_block_8x8_c(short *q, const short *dq, 176 void vp9_dequant_dc_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
180 unsigned char *pre, 177 uint8_t *pre,
181 unsigned char *dst, 178 uint8_t *dst,
182 int stride, unsigned short *eobs, 179 int stride, uint16_t *eobs,
183 const short *dc, 180 const int16_t *dc,
184 MACROBLOCKD *xd) { 181 MACROBLOCKD *xd) {
185 q[0] = dc[0]; 182 q[0] = dc[0];
186 vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, 1, xd->eobs[0]); 183 vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, 1, xd->eobs[0]);
187 184
188 q[64] = dc[1]; 185 q[64] = dc[1];
189 vp9_dequant_idct_add_8x8_c(&q[64], dq, pre + 8, dst + 8, 16, stride, 1, 186 vp9_dequant_idct_add_8x8_c(&q[64], dq, pre + 8, dst + 8, 16, stride, 1,
190 xd->eobs[4]); 187 xd->eobs[4]);
191 188
192 q[128] = dc[4]; 189 q[128] = dc[4];
193 vp9_dequant_idct_add_8x8_c(&q[128], dq, pre + 8 * 16, 190 vp9_dequant_idct_add_8x8_c(&q[128], dq, pre + 8 * 16,
194 dst + 8 * stride, 16, stride, 1, xd->eobs[8]); 191 dst + 8 * stride, 16, stride, 1, xd->eobs[8]);
195 192
196 q[192] = dc[8]; 193 q[192] = dc[8];
197 vp9_dequant_idct_add_8x8_c(&q[192], dq, pre + 8 * 16 + 8, 194 vp9_dequant_idct_add_8x8_c(&q[192], dq, pre + 8 * 16 + 8,
198 dst + 8 * stride + 8, 16, stride, 1, 195 dst + 8 * stride + 8, 16, stride, 1,
199 xd->eobs[12]); 196 xd->eobs[12]);
200 } 197 }
201 198
202 #if CONFIG_SUPERBLOCKS 199 void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(int16_t *q,
203 void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, const short *dq, 200 const int16_t *dq,
204 unsigned char *dst, 201 uint8_t *dst,
205 int stride, 202 int stride,
206 unsigned short *eobs, 203 uint16_t *eobs,
207 const short *dc, 204 const int16_t *dc,
208 MACROBLOCKD *xd) { 205 MACROBLOCKD *xd) {
209 q[0] = dc[0]; 206 q[0] = dc[0];
210 vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, 1, xd->eobs[0]); 207 vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, 1, xd->eobs[0]);
211 208
212 q[64] = dc[1]; 209 q[64] = dc[1];
213 vp9_dequant_idct_add_8x8_c(&q[64], dq, dst + 8, 210 vp9_dequant_idct_add_8x8_c(&q[64], dq, dst + 8,
214 dst + 8, stride, stride, 1, xd->eobs[4]); 211 dst + 8, stride, stride, 1, xd->eobs[4]);
215 212
216 q[128] = dc[4]; 213 q[128] = dc[4];
217 vp9_dequant_idct_add_8x8_c(&q[128], dq, dst + 8 * stride, 214 vp9_dequant_idct_add_8x8_c(&q[128], dq, dst + 8 * stride,
218 dst + 8 * stride, stride, stride, 1, 215 dst + 8 * stride, stride, stride, 1,
219 xd->eobs[8]); 216 xd->eobs[8]);
220 217
221 q[192] = dc[8]; 218 q[192] = dc[8];
222 vp9_dequant_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8, 219 vp9_dequant_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8,
223 dst + 8 * stride + 8, stride, stride, 1, 220 dst + 8 * stride + 8, stride, stride, 1,
224 xd->eobs[12]); 221 xd->eobs[12]);
225 } 222 }
226 #endif
227 223
228 void vp9_dequant_idct_add_y_block_8x8_c(short *q, const short *dq, 224 void vp9_dequant_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
229 unsigned char *pre, 225 uint8_t *pre,
230 unsigned char *dst, 226 uint8_t *dst,
231 int stride, unsigned short *eobs, 227 int stride, uint16_t *eobs,
232 MACROBLOCKD *xd) { 228 MACROBLOCKD *xd) {
233 unsigned char *origdest = dst; 229 uint8_t *origdest = dst;
234 unsigned char *origpred = pre; 230 uint8_t *origpred = pre;
235 231
236 vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, 0, xd->eobs[0]); 232 vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, 0, xd->eobs[0]);
237 vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8, 233 vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8,
238 origdest + 8, 16, stride, 0, xd->eobs[4]); 234 origdest + 8, 16, stride, 0, xd->eobs[4]);
239 vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16, 235 vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16,
240 origdest + 8 * stride, 16, stride, 0, xd->eobs[8]); 236 origdest + 8 * stride, 16, stride, 0, xd->eobs[8]);
241 vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8, 237 vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8,
242 origdest + 8 * stride + 8, 16, stride, 0, 238 origdest + 8 * stride + 8, 16, stride, 0,
243 xd->eobs[12]); 239 xd->eobs[12]);
244 } 240 }
245 241
246 void vp9_dequant_idct_add_uv_block_8x8_c(short *q, const short *dq, 242 void vp9_dequant_idct_add_uv_block_8x8_c(int16_t *q, const int16_t *dq,
247 unsigned char *pre, 243 uint8_t *pre,
248 unsigned char *dstu, 244 uint8_t *dstu,
249 unsigned char *dstv, 245 uint8_t *dstv,
250 int stride, unsigned short *eobs, 246 int stride, uint16_t *eobs,
251 MACROBLOCKD *xd) { 247 MACROBLOCKD *xd) {
252 vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, 0, xd->eobs[16]); 248 vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, 0, xd->eobs[16]);
253 249
254 q += 64; 250 q += 64;
255 pre += 64; 251 pre += 64;
256 252
257 vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, 0, xd->eobs[20]); 253 vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, 0, xd->eobs[20]);
258 } 254 }
259 255
260 #if CONFIG_SUPERBLOCKS 256 void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
261 void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, const short *dq, 257 uint8_t *dstu,
262 unsigned char *dstu, 258 uint8_t *dstv,
263 unsigned char *dstv,
264 int stride, 259 int stride,
265 unsigned short *eobs, 260 uint16_t *eobs,
266 MACROBLOCKD *xd) { 261 MACROBLOCKD *xd) {
267 vp9_dequant_idct_add_8x8_c(q, dq, dstu, dstu, stride, stride, 0, 262 vp9_dequant_idct_add_8x8_c(q, dq, dstu, dstu, stride, stride, 0,
268 xd->eobs[16]); 263 xd->eobs[16]);
269 264
270 q += 64; 265 q += 64;
271 vp9_dequant_idct_add_8x8_c(q, dq, dstv, dstv, stride, stride, 0, 266 vp9_dequant_idct_add_8x8_c(q, dq, dstv, dstv, stride, stride, 0,
272 xd->eobs[20]); 267 xd->eobs[20]);
273 } 268 }
274 #endif
275 269
276 #if CONFIG_LOSSLESS 270 #if CONFIG_LOSSLESS
277 void vp9_dequant_dc_idct_add_y_block_lossless_c(short *q, const short *dq, 271 void vp9_dequant_dc_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
278 unsigned char *pre, 272 uint8_t *pre,
279 unsigned char *dst, 273 uint8_t *dst,
280 int stride, 274 int stride,
281 unsigned short *eobs, 275 uint16_t *eobs,
282 const short *dc) { 276 const int16_t *dc) {
283 int i, j; 277 int i, j;
284 278
285 for (i = 0; i < 4; i++) { 279 for (i = 0; i < 4; i++) {
286 for (j = 0; j < 4; j++) { 280 for (j = 0; j < 4; j++) {
287 if (*eobs++ > 1) 281 if (*eobs++ > 1)
288 vp9_dequant_dc_idct_add_lossless_c(q, dq, pre, dst, 16, stride, dc[0]); 282 vp9_dequant_dc_idct_add_lossless_c(q, dq, pre, dst, 16, stride, dc[0]);
289 else 283 else
290 vp9_dc_only_inv_walsh_add_c(dc[0], pre, dst, 16, stride); 284 vp9_dc_only_inv_walsh_add_c(dc[0], pre, dst, 16, stride);
291 285
292 q += 16; 286 q += 16;
293 pre += 4; 287 pre += 4;
294 dst += 4; 288 dst += 4;
295 dc++; 289 dc++;
296 } 290 }
297 291
298 pre += 64 - 16; 292 pre += 64 - 16;
299 dst += 4 * stride - 16; 293 dst += 4 * stride - 16;
300 } 294 }
301 } 295 }
302 296
303 void vp9_dequant_idct_add_y_block_lossless_c(short *q, const short *dq, 297 void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
304 unsigned char *pre, 298 uint8_t *pre,
305 unsigned char *dst, 299 uint8_t *dst,
306 int stride, unsigned short *eobs) { 300 int stride, uint16_t *eobs) {
307 int i, j; 301 int i, j;
308 302
309 for (i = 0; i < 4; i++) { 303 for (i = 0; i < 4; i++) {
310 for (j = 0; j < 4; j++) { 304 for (j = 0; j < 4; j++) {
311 if (*eobs++ > 1) 305 if (*eobs++ > 1)
312 vp9_dequant_idct_add_lossless_c(q, dq, pre, dst, 16, stride); 306 vp9_dequant_idct_add_lossless_c(q, dq, pre, dst, 16, stride);
313 else { 307 else {
314 vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dst, 16, stride); 308 vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dst, 16, stride);
315 ((int *)q)[0] = 0; 309 ((int *)q)[0] = 0;
316 } 310 }
317 311
318 q += 16; 312 q += 16;
319 pre += 4; 313 pre += 4;
320 dst += 4; 314 dst += 4;
321 } 315 }
322 316
323 pre += 64 - 16; 317 pre += 64 - 16;
324 dst += 4 * stride - 16; 318 dst += 4 * stride - 16;
325 } 319 }
326 } 320 }
327 321
328 void vp9_dequant_idct_add_uv_block_lossless_c(short *q, const short *dq, 322 void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
329 unsigned char *pre, 323 uint8_t *pre,
330 unsigned char *dstu, 324 uint8_t *dstu,
331 unsigned char *dstv, 325 uint8_t *dstv,
332 int stride, 326 int stride,
333 unsigned short *eobs) { 327 uint16_t *eobs) {
334 int i, j; 328 int i, j;
335 329
336 for (i = 0; i < 2; i++) { 330 for (i = 0; i < 2; i++) {
337 for (j = 0; j < 2; j++) { 331 for (j = 0; j < 2; j++) {
338 if (*eobs++ > 1) 332 if (*eobs++ > 1)
339 vp9_dequant_idct_add_lossless_c(q, dq, pre, dstu, 8, stride); 333 vp9_dequant_idct_add_lossless_c(q, dq, pre, dstu, 8, stride);
340 else { 334 else {
341 vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dstu, 8, stride); 335 vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dstu, 8, stride);
342 ((int *)q)[0] = 0; 336 ((int *)q)[0] = 0;
343 } 337 }
(...skipping 20 matching lines...) Expand all
364 pre += 4; 358 pre += 4;
365 dstv += 4; 359 dstv += 4;
366 } 360 }
367 361
368 pre += 32 - 8; 362 pre += 32 - 8;
369 dstv += 4 * stride - 8; 363 dstv += 4 * stride - 8;
370 } 364 }
371 } 365 }
372 #endif 366 #endif
373 367
OLDNEW
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_detokenize.c ('k') | source/libvpx/vp9/decoder/vp9_onyxd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698