1
|
1 /*
|
|
2 * new DCT12
|
|
3 */
|
|
4 static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,register real *ts)
|
|
5 {
|
|
6 #define DCT12_PART1 \
|
|
7 in5 = in[5*3]; \
|
|
8 in5 += (in4 = in[4*3]); \
|
|
9 in4 += (in3 = in[3*3]); \
|
|
10 in3 += (in2 = in[2*3]); \
|
|
11 in2 += (in1 = in[1*3]); \
|
|
12 in1 += (in0 = in[0*3]); \
|
|
13 \
|
|
14 in5 += in3; in3 += in1; \
|
|
15 \
|
|
16 in2 *= COS6_1; \
|
|
17 in3 *= COS6_1; \
|
|
18
|
|
19 #define DCT12_PART2 \
|
|
20 in0 += in4 * COS6_2; \
|
|
21 \
|
|
22 in4 = in0 + in2; \
|
|
23 in0 -= in2; \
|
|
24 \
|
|
25 in1 += in5 * COS6_2; \
|
|
26 \
|
|
27 in5 = (in1 + in3) * tfcos12[0]; \
|
|
28 in1 = (in1 - in3) * tfcos12[2]; \
|
|
29 \
|
|
30 in3 = in4 + in5; \
|
|
31 in4 -= in5; \
|
|
32 \
|
|
33 in2 = in0 + in1; \
|
|
34 in0 -= in1;
|
|
35
|
|
36
|
|
37 {
|
|
38 real in0,in1,in2,in3,in4,in5;
|
|
39 register real *out1 = rawout1;
|
|
40 ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2];
|
|
41 ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5];
|
29263
|
42
|
1
|
43 DCT12_PART1
|
|
44
|
|
45 {
|
|
46 real tmp0,tmp1 = (in0 - in4);
|
|
47 {
|
|
48 real tmp2 = (in1 - in5) * tfcos12[1];
|
|
49 tmp0 = tmp1 + tmp2;
|
|
50 tmp1 -= tmp2;
|
|
51 }
|
|
52 ts[(17-1)*SBLIMIT] = out1[17-1] + tmp0 * wi[11-1];
|
|
53 ts[(12+1)*SBLIMIT] = out1[12+1] + tmp0 * wi[6+1];
|
|
54 ts[(6 +1)*SBLIMIT] = out1[6 +1] + tmp1 * wi[1];
|
|
55 ts[(11-1)*SBLIMIT] = out1[11-1] + tmp1 * wi[5-1];
|
|
56 }
|
|
57
|
|
58 DCT12_PART2
|
|
59
|
|
60 ts[(17-0)*SBLIMIT] = out1[17-0] + in2 * wi[11-0];
|
|
61 ts[(12+0)*SBLIMIT] = out1[12+0] + in2 * wi[6+0];
|
|
62 ts[(12+2)*SBLIMIT] = out1[12+2] + in3 * wi[6+2];
|
|
63 ts[(17-2)*SBLIMIT] = out1[17-2] + in3 * wi[11-2];
|
|
64
|
|
65 ts[(6+0)*SBLIMIT] = out1[6+0] + in0 * wi[0];
|
|
66 ts[(11-0)*SBLIMIT] = out1[11-0] + in0 * wi[5-0];
|
|
67 ts[(6+2)*SBLIMIT] = out1[6+2] + in4 * wi[2];
|
|
68 ts[(11-2)*SBLIMIT] = out1[11-2] + in4 * wi[5-2];
|
|
69 }
|
|
70
|
|
71 in++;
|
|
72
|
|
73 {
|
|
74 real in0,in1,in2,in3,in4,in5;
|
|
75 register real *out2 = rawout2;
|
29263
|
76
|
1
|
77 DCT12_PART1
|
|
78
|
|
79 {
|
|
80 real tmp0,tmp1 = (in0 - in4);
|
|
81 {
|
|
82 real tmp2 = (in1 - in5) * tfcos12[1];
|
|
83 tmp0 = tmp1 + tmp2;
|
|
84 tmp1 -= tmp2;
|
|
85 }
|
|
86 out2[5-1] = tmp0 * wi[11-1];
|
|
87 out2[0+1] = tmp0 * wi[6+1];
|
|
88 ts[(12+1)*SBLIMIT] += tmp1 * wi[1];
|
|
89 ts[(17-1)*SBLIMIT] += tmp1 * wi[5-1];
|
|
90 }
|
|
91
|
|
92 DCT12_PART2
|
|
93
|
|
94 out2[5-0] = in2 * wi[11-0];
|
|
95 out2[0+0] = in2 * wi[6+0];
|
|
96 out2[0+2] = in3 * wi[6+2];
|
|
97 out2[5-2] = in3 * wi[11-2];
|
|
98
|
|
99 ts[(12+0)*SBLIMIT] += in0 * wi[0];
|
|
100 ts[(17-0)*SBLIMIT] += in0 * wi[5-0];
|
|
101 ts[(12+2)*SBLIMIT] += in4 * wi[2];
|
|
102 ts[(17-2)*SBLIMIT] += in4 * wi[5-2];
|
|
103 }
|
|
104
|
29263
|
105 in++;
|
1
|
106
|
|
107 {
|
|
108 real in0,in1,in2,in3,in4,in5;
|
|
109 register real *out2 = rawout2;
|
|
110 out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0;
|
|
111
|
|
112 DCT12_PART1
|
|
113
|
|
114 {
|
|
115 real tmp0,tmp1 = (in0 - in4);
|
|
116 {
|
|
117 real tmp2 = (in1 - in5) * tfcos12[1];
|
|
118 tmp0 = tmp1 + tmp2;
|
|
119 tmp1 -= tmp2;
|
|
120 }
|
|
121 out2[11-1] = tmp0 * wi[11-1];
|
|
122 out2[6 +1] = tmp0 * wi[6+1];
|
|
123 out2[0+1] += tmp1 * wi[1];
|
|
124 out2[5-1] += tmp1 * wi[5-1];
|
|
125 }
|
|
126
|
|
127 DCT12_PART2
|
|
128
|
|
129 out2[11-0] = in2 * wi[11-0];
|
|
130 out2[6 +0] = in2 * wi[6+0];
|
|
131 out2[6 +2] = in3 * wi[6+2];
|
|
132 out2[11-2] = in3 * wi[11-2];
|
|
133
|
|
134 out2[0+0] += in0 * wi[0];
|
|
135 out2[5-0] += in0 * wi[5-0];
|
|
136 out2[0+2] += in4 * wi[2];
|
|
137 out2[5-2] += in4 * wi[5-2];
|
|
138 }
|
|
139 }
|