1 /*
2 * Copyright (c) 2012 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 #if HAVE_DSPR2
15
vp8_dequant_idct_add_y_block_dspr2(short * q,short * dq,unsigned char * dst,int stride,char * eobs)16 void vp8_dequant_idct_add_y_block_dspr2(short *q, short *dq, unsigned char *dst,
17 int stride, char *eobs) {
18 int i, j;
19
20 for (i = 0; i < 4; ++i) {
21 for (j = 0; j < 4; ++j) {
22 if (*eobs++ > 1)
23 vp8_dequant_idct_add_dspr2(q, dq, dst, stride);
24 else {
25 vp8_dc_only_idct_add_dspr2(q[0] * dq[0], dst, stride, dst, stride);
26 ((int *)q)[0] = 0;
27 }
28
29 q += 16;
30 dst += 4;
31 }
32
33 dst += 4 * stride - 16;
34 }
35 }
36
vp8_dequant_idct_add_uv_block_dspr2(short * q,short * dq,unsigned char * dst_u,unsigned char * dst_v,int stride,char * eobs)37 void vp8_dequant_idct_add_uv_block_dspr2(short *q, short *dq,
38 unsigned char *dst_u,
39 unsigned char *dst_v, int stride,
40 char *eobs) {
41 int i, j;
42
43 for (i = 0; i < 2; ++i) {
44 for (j = 0; j < 2; ++j) {
45 if (*eobs++ > 1)
46 vp8_dequant_idct_add_dspr2(q, dq, dst_u, stride);
47 else {
48 vp8_dc_only_idct_add_dspr2(q[0] * dq[0], dst_u, stride, dst_u, stride);
49 ((int *)q)[0] = 0;
50 }
51
52 q += 16;
53 dst_u += 4;
54 }
55
56 dst_u += 4 * stride - 8;
57 }
58
59 for (i = 0; i < 2; ++i) {
60 for (j = 0; j < 2; ++j) {
61 if (*eobs++ > 1)
62 vp8_dequant_idct_add_dspr2(q, dq, dst_v, stride);
63 else {
64 vp8_dc_only_idct_add_dspr2(q[0] * dq[0], dst_v, stride, dst_v, stride);
65 ((int *)q)[0] = 0;
66 }
67
68 q += 16;
69 dst_v += 4;
70 }
71
72 dst_v += 4 * stride - 8;
73 }
74 }
75
76 #endif
77