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 "vp8/common/idct.h"
13 : #include "dequantize.h"
14 :
15 : void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred,
16 : unsigned char *dest, int pitch, int stride,
17 : int Dc);
18 : void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred,
19 : unsigned char *dest, int pitch, int stride);
20 : void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr,
21 : unsigned char *dst_ptr, int pitch, int stride);
22 :
23 0 : void vp8_dequant_dc_idct_add_y_block_c
24 : (short *q, short *dq, unsigned char *pre,
25 : unsigned char *dst, int stride, char *eobs, short *dc)
26 : {
27 : int i, j;
28 :
29 0 : for (i = 0; i < 4; i++)
30 : {
31 0 : for (j = 0; j < 4; j++)
32 : {
33 0 : if (*eobs++ > 1)
34 0 : vp8_dequant_dc_idct_add_c (q, dq, pre, dst, 16, stride, dc[0]);
35 : else
36 0 : vp8_dc_only_idct_add_c (dc[0], pre, dst, 16, stride);
37 :
38 0 : q += 16;
39 0 : pre += 4;
40 0 : dst += 4;
41 0 : dc ++;
42 : }
43 :
44 0 : pre += 64 - 16;
45 0 : dst += 4*stride - 16;
46 : }
47 0 : }
48 :
49 0 : void vp8_dequant_idct_add_y_block_c
50 : (short *q, short *dq, unsigned char *pre,
51 : unsigned char *dst, int stride, char *eobs)
52 : {
53 : int i, j;
54 :
55 0 : for (i = 0; i < 4; i++)
56 : {
57 0 : for (j = 0; j < 4; j++)
58 : {
59 0 : if (*eobs++ > 1)
60 0 : vp8_dequant_idct_add_c (q, dq, pre, dst, 16, stride);
61 : else
62 : {
63 0 : vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dst, 16, stride);
64 0 : ((int *)q)[0] = 0;
65 : }
66 :
67 0 : q += 16;
68 0 : pre += 4;
69 0 : dst += 4;
70 : }
71 :
72 0 : pre += 64 - 16;
73 0 : dst += 4*stride - 16;
74 : }
75 0 : }
76 :
77 0 : void vp8_dequant_idct_add_uv_block_c
78 : (short *q, short *dq, unsigned char *pre,
79 : unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
80 : {
81 : int i, j;
82 :
83 0 : for (i = 0; i < 2; i++)
84 : {
85 0 : for (j = 0; j < 2; j++)
86 : {
87 0 : if (*eobs++ > 1)
88 0 : vp8_dequant_idct_add_c (q, dq, pre, dstu, 8, stride);
89 : else
90 : {
91 0 : vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstu, 8, stride);
92 0 : ((int *)q)[0] = 0;
93 : }
94 :
95 0 : q += 16;
96 0 : pre += 4;
97 0 : dstu += 4;
98 : }
99 :
100 0 : pre += 32 - 8;
101 0 : dstu += 4*stride - 8;
102 : }
103 :
104 0 : for (i = 0; i < 2; i++)
105 : {
106 0 : for (j = 0; j < 2; j++)
107 : {
108 0 : if (*eobs++ > 1)
109 0 : vp8_dequant_idct_add_c (q, dq, pre, dstv, 8, stride);
110 : else
111 : {
112 0 : vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstv, 8, stride);
113 0 : ((int *)q)[0] = 0;
114 : }
115 :
116 0 : q += 16;
117 0 : pre += 4;
118 0 : dstv += 4;
119 : }
120 :
121 0 : pre += 32 - 8;
122 0 : dstv += 4*stride - 8;
123 : }
124 0 : }
|