33 #define IdctAdjustBeforeShift 8
42 #define M(a,b) (((a) * (b))>>16)
48 int A,
B,
C,
D, Ad, Bd, Cd, Dd,
E,
F,
G,
H;
49 int Ed, Gd, Add, Bdd, Fd, Hd;
54 for (i = 0; i < 8; i++) {
56 if ( ip[0] | ip[1] | ip[2] | ip[3] | ip[4] | ip[5] | ip[6] | ip[7] ) {
68 E =
M(
xC4S4, (ip[0] + ip[4]));
69 F =
M(
xC4S4, (ip[0] - ip[4]));
102 for ( i = 0; i < 8; i++) {
104 if ( ip[1 * 8] | ip[2 * 8] | ip[3 * 8] |
105 ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) {
118 E =
M(
xC4S4, (ip[0*8] + ip[4*8])) + 8;
119 F =
M(
xC4S4, (ip[0*8] - ip[4*8])) + 8;
140 ip[0*8] = (Gd + Cd ) >> 4;
141 ip[7*8] = (Gd - Cd ) >> 4;
143 ip[1*8] = (Add + Hd ) >> 4;
144 ip[2*8] = (Add - Hd ) >> 4;
146 ip[3*8] = (Ed + Dd ) >> 4;
147 ip[4*8] = (Ed - Dd ) >> 4;
149 ip[5*8] = (Fd + Bdd ) >> 4;
150 ip[6*8] = (Fd - Bdd ) >> 4;
152 dst[0*
stride] = av_clip_uint8((Gd + Cd ) >> 4);
153 dst[7*
stride] = av_clip_uint8((Gd - Cd ) >> 4);
155 dst[1*
stride] = av_clip_uint8((Add + Hd ) >> 4);
156 dst[2*
stride] = av_clip_uint8((Add - Hd ) >> 4);
158 dst[3*
stride] = av_clip_uint8((Ed + Dd ) >> 4);
159 dst[4*
stride] = av_clip_uint8((Ed - Dd ) >> 4);
161 dst[5*
stride] = av_clip_uint8((Fd + Bdd ) >> 4);
162 dst[6*
stride] = av_clip_uint8((Fd - Bdd ) >> 4);
164 dst[0*
stride] = av_clip_uint8(dst[0*stride] + ((Gd + Cd ) >> 4));
165 dst[7*
stride] = av_clip_uint8(dst[7*stride] + ((Gd - Cd ) >> 4));
167 dst[1*
stride] = av_clip_uint8(dst[1*stride] + ((Add + Hd ) >> 4));
168 dst[2*
stride] = av_clip_uint8(dst[2*stride] + ((Add - Hd ) >> 4));
170 dst[3*
stride] = av_clip_uint8(dst[3*stride] + ((Ed + Dd ) >> 4));
171 dst[4*
stride] = av_clip_uint8(dst[4*stride] + ((Ed - Dd ) >> 4));
173 dst[5*
stride] = av_clip_uint8(dst[5*stride] + ((Fd + Bdd ) >> 4));
174 dst[6*
stride] = av_clip_uint8(dst[6*stride] + ((Fd - Bdd ) >> 4));
186 ip[7*8] = ((
xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
198 int v= ((
xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
199 dst[0*
stride] = av_clip_uint8(dst[0*stride] + v);
200 dst[1*
stride] = av_clip_uint8(dst[1*stride] + v);
201 dst[2*
stride] = av_clip_uint8(dst[2*stride] + v);
202 dst[3*
stride] = av_clip_uint8(dst[3*stride] + v);
203 dst[4*
stride] = av_clip_uint8(dst[4*stride] + v);
204 dst[5*
stride] = av_clip_uint8(dst[5*stride] + v);
205 dst[6*
stride] = av_clip_uint8(dst[6*stride] + v);
206 dst[7*
stride] = av_clip_uint8(dst[7*stride] + v);
217 idct(dest, line_size, block, 1);
221 idct(dest, line_size, block, 2);
226 int i, dc = (block[0] + 15) >> 5;
228 for(i = 0; i < 8; i++){
229 dest[0] = av_clip_uint8(dest[0] + dc);
230 dest[1] = av_clip_uint8(dest[1] + dc);
231 dest[2] = av_clip_uint8(dest[2] + dc);
232 dest[3] = av_clip_uint8(dest[3] + dc);
233 dest[4] = av_clip_uint8(dest[4] + dc);
234 dest[5] = av_clip_uint8(dest[5] + dc);
235 dest[6] = av_clip_uint8(dest[6] + dc);
236 dest[7] = av_clip_uint8(dest[7] + dc);
242 int *bounding_values)
246 const int nstride= -
stride;
248 for (end= first_pixel + 8; first_pixel <
end; first_pixel++) {
250 (first_pixel[2 * nstride] - first_pixel[
stride])
251 +3*(first_pixel[0 ] - first_pixel[nstride]);
252 filter_value = bounding_values[(filter_value + 4) >> 3];
253 first_pixel[nstride] = av_clip_uint8(first_pixel[nstride] + filter_value);
254 first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value);
259 int *bounding_values)
264 for (end= first_pixel + 8*stride; first_pixel !=
end; first_pixel +=
stride) {
266 (first_pixel[-2] - first_pixel[ 1])
267 +3*(first_pixel[ 0] - first_pixel[-1]);
268 filter_value = bounding_values[(filter_value + 4) >> 3];
269 first_pixel[-1] = av_clip_uint8(first_pixel[-1] + filter_value);
270 first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value);