comparison vp3dsp.c @ 3504:40d83cd39561 libavcodec

remove 166 useless underscores, and make this file valid c code as a result
author michael
date Wed, 19 Jul 2006 23:21:20 +0000
parents 074c9f3d8e62
children d8dabe4ca9be
comparison
equal deleted inserted replaced
3503:074c9f3d8e62 3504:40d83cd39561
40 static always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type) 40 static always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type)
41 { 41 {
42 int16_t *ip = input; 42 int16_t *ip = input;
43 uint8_t *cm = cropTbl + MAX_NEG_CROP; 43 uint8_t *cm = cropTbl + MAX_NEG_CROP;
44 44
45 int A_, B_, C_, D_, _Ad, _Bd, _Cd, _Dd, E_, F_, G_, H_; 45 int A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;
46 int _Ed, _Gd, _Add, _Bdd, _Fd, _Hd; 46 int Ed, Gd, Add, Bdd, Fd, Hd;
47 47
48 int i; 48 int i;
49 49
50 /* Inverse DCT on the rows now */ 50 /* Inverse DCT on the rows now */
51 for (i = 0; i < 8; i++) { 51 for (i = 0; i < 8; i++) {
52 /* Check for non-zero values */ 52 /* Check for non-zero values */
53 if ( ip[0] | ip[1] | ip[2] | ip[3] | ip[4] | ip[5] | ip[6] | ip[7] ) { 53 if ( ip[0] | ip[1] | ip[2] | ip[3] | ip[4] | ip[5] | ip[6] | ip[7] ) {
54 A_ = M(xC1S7, ip[1]) + M(xC7S1, ip[7]); 54 A = M(xC1S7, ip[1]) + M(xC7S1, ip[7]);
55 B_ = M(xC7S1, ip[1]) - M(xC1S7, ip[7]); 55 B = M(xC7S1, ip[1]) - M(xC1S7, ip[7]);
56 C_ = M(xC3S5, ip[3]) + M(xC5S3, ip[5]); 56 C = M(xC3S5, ip[3]) + M(xC5S3, ip[5]);
57 D_ = M(xC3S5, ip[5]) - M(xC5S3, ip[3]); 57 D = M(xC3S5, ip[5]) - M(xC5S3, ip[3]);
58 58
59 _Ad = M(xC4S4, (A_ - C_)); 59 Ad = M(xC4S4, (A - C));
60 _Bd = M(xC4S4, (B_ - D_)); 60 Bd = M(xC4S4, (B - D));
61 61
62 _Cd = A_ + C_; 62 Cd = A + C;
63 _Dd = B_ + D_; 63 Dd = B + D;
64 64
65 E_ = M(xC4S4, (ip[0] + ip[4])); 65 E = M(xC4S4, (ip[0] + ip[4]));
66 F_ = M(xC4S4, (ip[0] - ip[4])); 66 F = M(xC4S4, (ip[0] - ip[4]));
67 67
68 G_ = M(xC2S6, ip[2]) + M(xC6S2, ip[6]); 68 G = M(xC2S6, ip[2]) + M(xC6S2, ip[6]);
69 H_ = M(xC6S2, ip[2]) - M(xC2S6, ip[6]); 69 H = M(xC6S2, ip[2]) - M(xC2S6, ip[6]);
70 70
71 _Ed = E_ - G_; 71 Ed = E - G;
72 _Gd = E_ + G_; 72 Gd = E + G;
73 73
74 _Add = F_ + _Ad; 74 Add = F + Ad;
75 _Bdd = _Bd - H_; 75 Bdd = Bd - H;
76 76
77 _Fd = F_ - _Ad; 77 Fd = F - Ad;
78 _Hd = _Bd + H_; 78 Hd = Bd + H;
79 79
80 /* Final sequence of operations over-write original inputs. */ 80 /* Final sequence of operations over-write original inputs. */
81 ip[0] = _Gd + _Cd ; 81 ip[0] = Gd + Cd ;
82 ip[7] = _Gd - _Cd ; 82 ip[7] = Gd - Cd ;
83 83
84 ip[1] = _Add + _Hd; 84 ip[1] = Add + Hd;
85 ip[2] = _Add - _Hd; 85 ip[2] = Add - Hd;
86 86
87 ip[3] = _Ed + _Dd ; 87 ip[3] = Ed + Dd ;
88 ip[4] = _Ed - _Dd ; 88 ip[4] = Ed - Dd ;
89 89
90 ip[5] = _Fd + _Bdd; 90 ip[5] = Fd + Bdd;
91 ip[6] = _Fd - _Bdd; 91 ip[6] = Fd - Bdd;
92 } 92 }
93 93
94 ip += 8; /* next row */ 94 ip += 8; /* next row */
95 } 95 }
96 96
99 for ( i = 0; i < 8; i++) { 99 for ( i = 0; i < 8; i++) {
100 /* Check for non-zero values (bitwise or faster than ||) */ 100 /* Check for non-zero values (bitwise or faster than ||) */
101 if ( ip[1 * 8] | ip[2 * 8] | ip[3 * 8] | 101 if ( ip[1 * 8] | ip[2 * 8] | ip[3 * 8] |
102 ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) { 102 ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) {
103 103
104 A_ = M(xC1S7, ip[1*8]) + M(xC7S1, ip[7*8]); 104 A = M(xC1S7, ip[1*8]) + M(xC7S1, ip[7*8]);
105 B_ = M(xC7S1, ip[1*8]) - M(xC1S7, ip[7*8]); 105 B = M(xC7S1, ip[1*8]) - M(xC1S7, ip[7*8]);
106 C_ = M(xC3S5, ip[3*8]) + M(xC5S3, ip[5*8]); 106 C = M(xC3S5, ip[3*8]) + M(xC5S3, ip[5*8]);
107 D_ = M(xC3S5, ip[5*8]) - M(xC5S3, ip[3*8]); 107 D = M(xC3S5, ip[5*8]) - M(xC5S3, ip[3*8]);
108 108
109 _Ad = M(xC4S4, (A_ - C_)); 109 Ad = M(xC4S4, (A - C));
110 _Bd = M(xC4S4, (B_ - D_)); 110 Bd = M(xC4S4, (B - D));
111 111
112 _Cd = A_ + C_; 112 Cd = A + C;
113 _Dd = B_ + D_; 113 Dd = B + D;
114 114
115 E_ = M(xC4S4, (ip[0*8] + ip[4*8])); 115 E = M(xC4S4, (ip[0*8] + ip[4*8]));
116 F_ = M(xC4S4, (ip[0*8] - ip[4*8])); 116 F = M(xC4S4, (ip[0*8] - ip[4*8]));
117 117
118 G_ = M(xC2S6, ip[2*8]) + M(xC6S2, ip[6*8]); 118 G = M(xC2S6, ip[2*8]) + M(xC6S2, ip[6*8]);
119 H_ = M(xC6S2, ip[2*8]) - M(xC2S6, ip[6*8]); 119 H = M(xC6S2, ip[2*8]) - M(xC2S6, ip[6*8]);
120 120
121 _Ed = E_ - G_; 121 Ed = E - G;
122 _Gd = E_ + G_; 122 Gd = E + G;
123 123
124 _Add = F_ + _Ad; 124 Add = F + Ad;
125 _Bdd = _Bd - H_; 125 Bdd = Bd - H;
126 126
127 _Fd = F_ - _Ad; 127 Fd = F - Ad;
128 _Hd = _Bd + H_; 128 Hd = Bd + H;
129 129
130 if(type==1){ //HACK 130 if(type==1){ //HACK
131 _Gd += 16*128; 131 Gd += 16*128;
132 _Add+= 16*128; 132 Add+= 16*128;
133 _Ed += 16*128; 133 Ed += 16*128;
134 _Fd += 16*128; 134 Fd += 16*128;
135 } 135 }
136 _Gd += IdctAdjustBeforeShift; 136 Gd += IdctAdjustBeforeShift;
137 _Add += IdctAdjustBeforeShift; 137 Add += IdctAdjustBeforeShift;
138 _Ed += IdctAdjustBeforeShift; 138 Ed += IdctAdjustBeforeShift;
139 _Fd += IdctAdjustBeforeShift; 139 Fd += IdctAdjustBeforeShift;
140 140
141 /* Final sequence of operations over-write original inputs. */ 141 /* Final sequence of operations over-write original inputs. */
142 if(type==0){ 142 if(type==0){
143 ip[0*8] = (_Gd + _Cd ) >> 4; 143 ip[0*8] = (Gd + Cd ) >> 4;
144 ip[7*8] = (_Gd - _Cd ) >> 4; 144 ip[7*8] = (Gd - Cd ) >> 4;
145 145
146 ip[1*8] = (_Add + _Hd ) >> 4; 146 ip[1*8] = (Add + Hd ) >> 4;
147 ip[2*8] = (_Add - _Hd ) >> 4; 147 ip[2*8] = (Add - Hd ) >> 4;
148 148
149 ip[3*8] = (_Ed + _Dd ) >> 4; 149 ip[3*8] = (Ed + Dd ) >> 4;
150 ip[4*8] = (_Ed - _Dd ) >> 4; 150 ip[4*8] = (Ed - Dd ) >> 4;
151 151
152 ip[5*8] = (_Fd + _Bdd ) >> 4; 152 ip[5*8] = (Fd + Bdd ) >> 4;
153 ip[6*8] = (_Fd - _Bdd ) >> 4; 153 ip[6*8] = (Fd - Bdd ) >> 4;
154 }else if(type==1){ 154 }else if(type==1){
155 dst[0*stride] = cm[(_Gd + _Cd ) >> 4]; 155 dst[0*stride] = cm[(Gd + Cd ) >> 4];
156 dst[7*stride] = cm[(_Gd - _Cd ) >> 4]; 156 dst[7*stride] = cm[(Gd - Cd ) >> 4];
157 157
158 dst[1*stride] = cm[(_Add + _Hd ) >> 4]; 158 dst[1*stride] = cm[(Add + Hd ) >> 4];
159 dst[2*stride] = cm[(_Add - _Hd ) >> 4]; 159 dst[2*stride] = cm[(Add - Hd ) >> 4];
160 160
161 dst[3*stride] = cm[(_Ed + _Dd ) >> 4]; 161 dst[3*stride] = cm[(Ed + Dd ) >> 4];
162 dst[4*stride] = cm[(_Ed - _Dd ) >> 4]; 162 dst[4*stride] = cm[(Ed - Dd ) >> 4];
163 163
164 dst[5*stride] = cm[(_Fd + _Bdd ) >> 4]; 164 dst[5*stride] = cm[(Fd + Bdd ) >> 4];
165 dst[6*stride] = cm[(_Fd - _Bdd ) >> 4]; 165 dst[6*stride] = cm[(Fd - Bdd ) >> 4];
166 }else{ 166 }else{
167 dst[0*stride] = cm[dst[0*stride] + ((_Gd + _Cd ) >> 4)]; 167 dst[0*stride] = cm[dst[0*stride] + ((Gd + Cd ) >> 4)];
168 dst[7*stride] = cm[dst[7*stride] + ((_Gd - _Cd ) >> 4)]; 168 dst[7*stride] = cm[dst[7*stride] + ((Gd - Cd ) >> 4)];
169 169
170 dst[1*stride] = cm[dst[1*stride] + ((_Add + _Hd ) >> 4)]; 170 dst[1*stride] = cm[dst[1*stride] + ((Add + Hd ) >> 4)];
171 dst[2*stride] = cm[dst[2*stride] + ((_Add - _Hd ) >> 4)]; 171 dst[2*stride] = cm[dst[2*stride] + ((Add - Hd ) >> 4)];
172 172
173 dst[3*stride] = cm[dst[3*stride] + ((_Ed + _Dd ) >> 4)]; 173 dst[3*stride] = cm[dst[3*stride] + ((Ed + Dd ) >> 4)];
174 dst[4*stride] = cm[dst[4*stride] + ((_Ed - _Dd ) >> 4)]; 174 dst[4*stride] = cm[dst[4*stride] + ((Ed - Dd ) >> 4)];
175 175
176 dst[5*stride] = cm[dst[5*stride] + ((_Fd + _Bdd ) >> 4)]; 176 dst[5*stride] = cm[dst[5*stride] + ((Fd + Bdd ) >> 4)];
177 dst[6*stride] = cm[dst[6*stride] + ((_Fd - _Bdd ) >> 4)]; 177 dst[6*stride] = cm[dst[6*stride] + ((Fd - Bdd ) >> 4)];
178 } 178 }
179 179
180 } else { 180 } else {
181 if(type==0){ 181 if(type==0){
182 ip[0*8] = 182 ip[0*8] =