42 const int z0= block[i + 4*0] + block[i + 4*2];
43 const int z1= block[i + 4*0] - block[i + 4*2];
44 const int z2= (block[i + 4*1]>>1) - block[i + 4*3];
45 const int z3= block[i + 4*1] + (block[i + 4*3]>>1);
47 block[i + 4*0]= z0 + z3;
48 block[i + 4*1]= z1 + z2;
49 block[i + 4*2]= z1 - z2;
50 block[i + 4*3]= z0 - z3;
54 const int z0= block[0 + 4*i] + block[2 + 4*i];
55 const int z1= block[0 + 4*i] - block[2 + 4*i];
56 const int z2= (block[1 + 4*i]>>1) - block[3 + 4*i];
57 const int z3= block[1 + 4*i] + (block[3 + 4*i]>>1);
65 memset(block, 0, 16 *
sizeof(
dctcoef));
76 for( i = 0; i < 8; i++ )
78 const int a0 = block[i+0*8] + block[i+4*8];
79 const int a2 = block[i+0*8] - block[i+4*8];
80 const int a4 = (block[i+2*8]>>1) - block[i+6*8];
81 const int a6 = (block[i+6*8]>>1) + block[i+2*8];
83 const int b0 = a0 + a6;
84 const int b2 = a2 +
a4;
85 const int b4 = a2 -
a4;
86 const int b6 = a0 - a6;
88 const int a1 = -block[i+3*8] + block[i+5*8] - block[i+7*8] - (block[i+7*8]>>1);
89 const int a3 = block[i+1*8] + block[i+7*8] - block[i+3*8] - (block[i+3*8]>>1);
90 const int a5 = -block[i+1*8] + block[i+7*8] + block[i+5*8] + (block[i+5*8]>>1);
91 const int a7 = block[i+3*8] + block[i+5*8] + block[i+1*8] + (block[i+1*8]>>1);
93 const int b1 = (a7>>2) + a1;
94 const int b3 = a3 + (a5>>2);
95 const int b5 = (a3>>2) - a5;
96 const int b7 = a7 - (a1>>2);
98 block[i+0*8] = b0 + b7;
99 block[i+7*8] = b0 - b7;
100 block[i+1*8] = b2 + b5;
101 block[i+6*8] = b2 - b5;
102 block[i+2*8] = b4 + b3;
103 block[i+5*8] = b4 - b3;
104 block[i+3*8] = b6 + b1;
105 block[i+4*8] = b6 - b1;
107 for( i = 0; i < 8; i++ )
109 const int a0 = block[0+i*8] + block[4+i*8];
110 const int a2 = block[0+i*8] - block[4+i*8];
111 const int a4 = (block[2+i*8]>>1) - block[6+i*8];
112 const int a6 = (block[6+i*8]>>1) + block[2+i*8];
114 const int b0 = a0 + a6;
115 const int b2 = a2 +
a4;
116 const int b4 = a2 -
a4;
117 const int b6 = a0 - a6;
119 const int a1 = -block[3+i*8] + block[5+i*8] - block[7+i*8] - (block[7+i*8]>>1);
120 const int a3 = block[1+i*8] + block[7+i*8] - block[3+i*8] - (block[3+i*8]>>1);
121 const int a5 = -block[1+i*8] + block[7+i*8] + block[5+i*8] + (block[5+i*8]>>1);
122 const int a7 = block[3+i*8] + block[5+i*8] + block[1+i*8] + (block[1+i*8]>>1);
124 const int b1 = (a7>>2) + a1;
125 const int b3 = a3 + (a5>>2);
126 const int b5 = (a3>>2) - a5;
127 const int b7 = a7 - (a1>>2);
139 memset(block, 0, 64 *
sizeof(
dctcoef));
147 int dc = (block[0] + 32) >> 6;
150 for( j = 0; j < 4; j++ )
152 for( i = 0; i < 4; i++ )
162 int dc = (block[0] + 32) >> 6;
165 for( j = 0; j < 8; j++ )
167 for( i = 0; i < 8; i++ )
176 int nnz = nnzc[
scan8[i] ];
194 for(i=0; i<16; i+=4){
195 int nnz = nnzc[
scan8[i] ];
206 for(i=j*16; i<j*16+4; i++){
219 for(i=j*16; i<j*16+4; i++){
228 for(i=j*16+4; i<j*16+8; i++){
229 if(nnzc[
scan8[i+4] ])
250 const int z0= input[4*i+0] + input[4*i+1];
251 const int z1= input[4*i+0] - input[4*i+1];
252 const int z2= input[4*i+2] - input[4*i+3];
253 const int z3= input[4*i+2] + input[4*i+3];
262 const int offset= x_offset[i];
263 const int z0= temp[4*0+i] + temp[4*2+i];
264 const int z1= temp[4*0+i] - temp[4*2+i];
265 const int z2= temp[4*1+i] - temp[4*3+i];
266 const int z3= temp[4*1+i] + temp[4*3+i];
268 output[
stride* 0+
offset]= ((((z0 + z3)*qmul + 128 ) >> 8));
269 output[
stride* 1+
offset]= ((((z1 + z2)*qmul + 128 ) >> 8));
270 output[
stride* 4+
offset]= ((((z1 - z2)*qmul + 128 ) >> 8));
271 output[
stride* 5+
offset]= ((((z0 - z3)*qmul + 128 ) >> 8));
278 const int xStride= 16;
281 static const uint8_t x_offset[2]={0, 16};
285 temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1];
286 temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1];
290 const int offset= x_offset[i];
291 const int z0= temp[2*0+i] + temp[2*2+i];
292 const int z1= temp[2*0+i] - temp[2*2+i];
293 const int z2= temp[2*1+i] - temp[2*3+i];
294 const int z3= temp[2*1+i] + temp[2*3+i];
296 block[stride*0+
offset]= ((z0 + z3)*qmul + 128) >> 8;
297 block[stride*1+
offset]= ((z1 + z2)*qmul + 128) >> 8;
298 block[stride*2+
offset]= ((z1 - z2)*qmul + 128) >> 8;
299 block[stride*3+
offset]= ((z0 - z3)*qmul + 128) >> 8;
305 const int xStride= 16;
309 a= block[stride*0 + xStride*0];
310 b= block[stride*0 + xStride*1];
311 c= block[stride*1 + xStride*0];
312 d= block[stride*1 + xStride*1];
319 block[stride*0 + xStride*0]= ((a+
c)*qmul) >> 7;
320 block[stride*0 + xStride*1]= ((e+
b)*qmul) >> 7;
321 block[stride*1 + xStride*0]= ((a-
c)*qmul) >> 7;
322 block[stride*1 + xStride*1]= ((e-
b)*qmul) >> 7;