annotate jrevdct.c @ 611:3214d3f4519e libavcodec

error concealment needs the mbintra_table so it should allways be allocated
author michaelni
date Sat, 24 Aug 2002 13:24:43 +0000
parents 000aeeac27a2
children b32afefe7d33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
2 * jrevdct.c
986e461dc072 Initial revision
glantau
parents:
diff changeset
3 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
4 * Copyright (C) 1991, 1992, Thomas G. Lane.
986e461dc072 Initial revision
glantau
parents:
diff changeset
5 * This file is part of the Independent JPEG Group's software.
986e461dc072 Initial revision
glantau
parents:
diff changeset
6 * For conditions of distribution and use, see the accompanying README file.
986e461dc072 Initial revision
glantau
parents:
diff changeset
7 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
8 * This file contains the basic inverse-DCT transformation subroutine.
986e461dc072 Initial revision
glantau
parents:
diff changeset
9 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
10 * This implementation is based on an algorithm described in
986e461dc072 Initial revision
glantau
parents:
diff changeset
11 * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
986e461dc072 Initial revision
glantau
parents:
diff changeset
12 * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
986e461dc072 Initial revision
glantau
parents:
diff changeset
13 * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
986e461dc072 Initial revision
glantau
parents:
diff changeset
14 * The primary algorithm described there uses 11 multiplies and 29 adds.
986e461dc072 Initial revision
glantau
parents:
diff changeset
15 * We use their alternate method with 12 multiplies and 32 adds.
986e461dc072 Initial revision
glantau
parents:
diff changeset
16 * The advantage of this method is that no data path contains more than one
986e461dc072 Initial revision
glantau
parents:
diff changeset
17 * multiplication; this allows a very simple and accurate implementation in
986e461dc072 Initial revision
glantau
parents:
diff changeset
18 * scaled fixed-point arithmetic, with a minimal number of shifts.
986e461dc072 Initial revision
glantau
parents:
diff changeset
19 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
20 * I've made lots of modifications to attempt to take advantage of the
986e461dc072 Initial revision
glantau
parents:
diff changeset
21 * sparse nature of the DCT matrices we're getting. Although the logic
986e461dc072 Initial revision
glantau
parents:
diff changeset
22 * is cumbersome, it's straightforward and the resulting code is much
986e461dc072 Initial revision
glantau
parents:
diff changeset
23 * faster.
986e461dc072 Initial revision
glantau
parents:
diff changeset
24 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
25 * A better way to do this would be to pass in the DCT block as a sparse
986e461dc072 Initial revision
glantau
parents:
diff changeset
26 * matrix, perhaps with the difference cases encoded.
986e461dc072 Initial revision
glantau
parents:
diff changeset
27 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
28 #include "common.h"
986e461dc072 Initial revision
glantau
parents:
diff changeset
29 #include "dsputil.h"
986e461dc072 Initial revision
glantau
parents:
diff changeset
30
986e461dc072 Initial revision
glantau
parents:
diff changeset
31 #define EIGHT_BIT_SAMPLES
986e461dc072 Initial revision
glantau
parents:
diff changeset
32
986e461dc072 Initial revision
glantau
parents:
diff changeset
33 #define DCTSIZE 8
986e461dc072 Initial revision
glantau
parents:
diff changeset
34 #define DCTSIZE2 64
986e461dc072 Initial revision
glantau
parents:
diff changeset
35
986e461dc072 Initial revision
glantau
parents:
diff changeset
36 #define GLOBAL
986e461dc072 Initial revision
glantau
parents:
diff changeset
37
986e461dc072 Initial revision
glantau
parents:
diff changeset
38 #define RIGHT_SHIFT(x, n) ((x) >> (n))
986e461dc072 Initial revision
glantau
parents:
diff changeset
39
986e461dc072 Initial revision
glantau
parents:
diff changeset
40 typedef DCTELEM DCTBLOCK[DCTSIZE2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
41
986e461dc072 Initial revision
glantau
parents:
diff changeset
42 #define CONST_BITS 13
986e461dc072 Initial revision
glantau
parents:
diff changeset
43
986e461dc072 Initial revision
glantau
parents:
diff changeset
44 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
45 * This routine is specialized to the case DCTSIZE = 8.
986e461dc072 Initial revision
glantau
parents:
diff changeset
46 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
47
986e461dc072 Initial revision
glantau
parents:
diff changeset
48 #if DCTSIZE != 8
986e461dc072 Initial revision
glantau
parents:
diff changeset
49 Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
986e461dc072 Initial revision
glantau
parents:
diff changeset
50 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
51
986e461dc072 Initial revision
glantau
parents:
diff changeset
52
986e461dc072 Initial revision
glantau
parents:
diff changeset
53 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
54 * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT
986e461dc072 Initial revision
glantau
parents:
diff changeset
55 * on each column. Direct algorithms are also available, but they are
986e461dc072 Initial revision
glantau
parents:
diff changeset
56 * much more complex and seem not to be any faster when reduced to code.
986e461dc072 Initial revision
glantau
parents:
diff changeset
57 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
58 * The poop on this scaling stuff is as follows:
986e461dc072 Initial revision
glantau
parents:
diff changeset
59 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
60 * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
986e461dc072 Initial revision
glantau
parents:
diff changeset
61 * larger than the true IDCT outputs. The final outputs are therefore
986e461dc072 Initial revision
glantau
parents:
diff changeset
62 * a factor of N larger than desired; since N=8 this can be cured by
986e461dc072 Initial revision
glantau
parents:
diff changeset
63 * a simple right shift at the end of the algorithm. The advantage of
986e461dc072 Initial revision
glantau
parents:
diff changeset
64 * this arrangement is that we save two multiplications per 1-D IDCT,
986e461dc072 Initial revision
glantau
parents:
diff changeset
65 * because the y0 and y4 inputs need not be divided by sqrt(N).
986e461dc072 Initial revision
glantau
parents:
diff changeset
66 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
67 * We have to do addition and subtraction of the integer inputs, which
986e461dc072 Initial revision
glantau
parents:
diff changeset
68 * is no problem, and multiplication by fractional constants, which is
986e461dc072 Initial revision
glantau
parents:
diff changeset
69 * a problem to do in integer arithmetic. We multiply all the constants
986e461dc072 Initial revision
glantau
parents:
diff changeset
70 * by CONST_SCALE and convert them to integer constants (thus retaining
986e461dc072 Initial revision
glantau
parents:
diff changeset
71 * CONST_BITS bits of precision in the constants). After doing a
986e461dc072 Initial revision
glantau
parents:
diff changeset
72 * multiplication we have to divide the product by CONST_SCALE, with proper
986e461dc072 Initial revision
glantau
parents:
diff changeset
73 * rounding, to produce the correct output. This division can be done
986e461dc072 Initial revision
glantau
parents:
diff changeset
74 * cheaply as a right shift of CONST_BITS bits. We postpone shifting
986e461dc072 Initial revision
glantau
parents:
diff changeset
75 * as long as possible so that partial sums can be added together with
986e461dc072 Initial revision
glantau
parents:
diff changeset
76 * full fractional precision.
986e461dc072 Initial revision
glantau
parents:
diff changeset
77 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
78 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
986e461dc072 Initial revision
glantau
parents:
diff changeset
79 * they are represented to better-than-integral precision. These outputs
986e461dc072 Initial revision
glantau
parents:
diff changeset
80 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
986e461dc072 Initial revision
glantau
parents:
diff changeset
81 * with the recommended scaling. (To scale up 12-bit sample data further, an
986e461dc072 Initial revision
glantau
parents:
diff changeset
82 * intermediate int32 array would be needed.)
986e461dc072 Initial revision
glantau
parents:
diff changeset
83 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
84 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
986e461dc072 Initial revision
glantau
parents:
diff changeset
85 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
986e461dc072 Initial revision
glantau
parents:
diff changeset
86 * shows that the values given below are the most effective.
986e461dc072 Initial revision
glantau
parents:
diff changeset
87 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
88
986e461dc072 Initial revision
glantau
parents:
diff changeset
89 #ifdef EIGHT_BIT_SAMPLES
986e461dc072 Initial revision
glantau
parents:
diff changeset
90 #define PASS1_BITS 2
986e461dc072 Initial revision
glantau
parents:
diff changeset
91 #else
986e461dc072 Initial revision
glantau
parents:
diff changeset
92 #define PASS1_BITS 1 /* lose a little precision to avoid overflow */
986e461dc072 Initial revision
glantau
parents:
diff changeset
93 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
94
986e461dc072 Initial revision
glantau
parents:
diff changeset
95 #define ONE ((INT32) 1)
986e461dc072 Initial revision
glantau
parents:
diff changeset
96
986e461dc072 Initial revision
glantau
parents:
diff changeset
97 #define CONST_SCALE (ONE << CONST_BITS)
986e461dc072 Initial revision
glantau
parents:
diff changeset
98
986e461dc072 Initial revision
glantau
parents:
diff changeset
99 /* Convert a positive real constant to an integer scaled by CONST_SCALE.
986e461dc072 Initial revision
glantau
parents:
diff changeset
100 * IMPORTANT: if your compiler doesn't do this arithmetic at compile time,
986e461dc072 Initial revision
glantau
parents:
diff changeset
101 * you will pay a significant penalty in run time. In that case, figure
986e461dc072 Initial revision
glantau
parents:
diff changeset
102 * the correct integer constant values and insert them by hand.
986e461dc072 Initial revision
glantau
parents:
diff changeset
103 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
104
986e461dc072 Initial revision
glantau
parents:
diff changeset
105 /* Actually FIX is no longer used, we precomputed them all */
986e461dc072 Initial revision
glantau
parents:
diff changeset
106 #define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
986e461dc072 Initial revision
glantau
parents:
diff changeset
107
986e461dc072 Initial revision
glantau
parents:
diff changeset
108 /* Descale and correctly round an INT32 value that's scaled by N bits.
986e461dc072 Initial revision
glantau
parents:
diff changeset
109 * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
986e461dc072 Initial revision
glantau
parents:
diff changeset
110 * the fudge factor is correct for either sign of X.
986e461dc072 Initial revision
glantau
parents:
diff changeset
111 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
112
986e461dc072 Initial revision
glantau
parents:
diff changeset
113 #define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
986e461dc072 Initial revision
glantau
parents:
diff changeset
114
986e461dc072 Initial revision
glantau
parents:
diff changeset
115 /* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
986e461dc072 Initial revision
glantau
parents:
diff changeset
116 * For 8-bit samples with the recommended scaling, all the variable
986e461dc072 Initial revision
glantau
parents:
diff changeset
117 * and constant values involved are no more than 16 bits wide, so a
986e461dc072 Initial revision
glantau
parents:
diff changeset
118 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
986e461dc072 Initial revision
glantau
parents:
diff changeset
119 * this provides a useful speedup on many machines.
986e461dc072 Initial revision
glantau
parents:
diff changeset
120 * There is no way to specify a 16x16->32 multiply in portable C, but
986e461dc072 Initial revision
glantau
parents:
diff changeset
121 * some C compilers will do the right thing if you provide the correct
986e461dc072 Initial revision
glantau
parents:
diff changeset
122 * combination of casts.
986e461dc072 Initial revision
glantau
parents:
diff changeset
123 * NB: for 12-bit samples, a full 32-bit multiplication will be needed.
986e461dc072 Initial revision
glantau
parents:
diff changeset
124 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
125
986e461dc072 Initial revision
glantau
parents:
diff changeset
126 #ifdef EIGHT_BIT_SAMPLES
986e461dc072 Initial revision
glantau
parents:
diff changeset
127 #ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
986e461dc072 Initial revision
glantau
parents:
diff changeset
128 #define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const)))
986e461dc072 Initial revision
glantau
parents:
diff changeset
129 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
130 #ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
131 #define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const)))
986e461dc072 Initial revision
glantau
parents:
diff changeset
132 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
133 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
134
986e461dc072 Initial revision
glantau
parents:
diff changeset
135 #ifndef MULTIPLY /* default definition */
986e461dc072 Initial revision
glantau
parents:
diff changeset
136 #define MULTIPLY(var,const) ((var) * (const))
986e461dc072 Initial revision
glantau
parents:
diff changeset
137 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
138
986e461dc072 Initial revision
glantau
parents:
diff changeset
139
986e461dc072 Initial revision
glantau
parents:
diff changeset
140 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
141 Unlike our decoder where we approximate the FIXes, we need to use exact
986e461dc072 Initial revision
glantau
parents:
diff changeset
142 ones here or successive P-frames will drift too much with Reference frame coding
986e461dc072 Initial revision
glantau
parents:
diff changeset
143 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
144 #define FIX_0_211164243 1730
986e461dc072 Initial revision
glantau
parents:
diff changeset
145 #define FIX_0_275899380 2260
986e461dc072 Initial revision
glantau
parents:
diff changeset
146 #define FIX_0_298631336 2446
986e461dc072 Initial revision
glantau
parents:
diff changeset
147 #define FIX_0_390180644 3196
986e461dc072 Initial revision
glantau
parents:
diff changeset
148 #define FIX_0_509795579 4176
986e461dc072 Initial revision
glantau
parents:
diff changeset
149 #define FIX_0_541196100 4433
986e461dc072 Initial revision
glantau
parents:
diff changeset
150 #define FIX_0_601344887 4926
986e461dc072 Initial revision
glantau
parents:
diff changeset
151 #define FIX_0_765366865 6270
986e461dc072 Initial revision
glantau
parents:
diff changeset
152 #define FIX_0_785694958 6436
986e461dc072 Initial revision
glantau
parents:
diff changeset
153 #define FIX_0_899976223 7373
986e461dc072 Initial revision
glantau
parents:
diff changeset
154 #define FIX_1_061594337 8697
986e461dc072 Initial revision
glantau
parents:
diff changeset
155 #define FIX_1_111140466 9102
986e461dc072 Initial revision
glantau
parents:
diff changeset
156 #define FIX_1_175875602 9633
986e461dc072 Initial revision
glantau
parents:
diff changeset
157 #define FIX_1_306562965 10703
986e461dc072 Initial revision
glantau
parents:
diff changeset
158 #define FIX_1_387039845 11363
986e461dc072 Initial revision
glantau
parents:
diff changeset
159 #define FIX_1_451774981 11893
986e461dc072 Initial revision
glantau
parents:
diff changeset
160 #define FIX_1_501321110 12299
986e461dc072 Initial revision
glantau
parents:
diff changeset
161 #define FIX_1_662939225 13623
986e461dc072 Initial revision
glantau
parents:
diff changeset
162 #define FIX_1_847759065 15137
986e461dc072 Initial revision
glantau
parents:
diff changeset
163 #define FIX_1_961570560 16069
986e461dc072 Initial revision
glantau
parents:
diff changeset
164 #define FIX_2_053119869 16819
986e461dc072 Initial revision
glantau
parents:
diff changeset
165 #define FIX_2_172734803 17799
986e461dc072 Initial revision
glantau
parents:
diff changeset
166 #define FIX_2_562915447 20995
986e461dc072 Initial revision
glantau
parents:
diff changeset
167 #define FIX_3_072711026 25172
986e461dc072 Initial revision
glantau
parents:
diff changeset
168
986e461dc072 Initial revision
glantau
parents:
diff changeset
169 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
170 * Perform the inverse DCT on one block of coefficients.
986e461dc072 Initial revision
glantau
parents:
diff changeset
171 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
172
986e461dc072 Initial revision
glantau
parents:
diff changeset
173 void j_rev_dct(DCTBLOCK data)
986e461dc072 Initial revision
glantau
parents:
diff changeset
174 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
175 INT32 tmp0, tmp1, tmp2, tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
176 INT32 tmp10, tmp11, tmp12, tmp13;
986e461dc072 Initial revision
glantau
parents:
diff changeset
177 INT32 z1, z2, z3, z4, z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
178 INT32 d0, d1, d2, d3, d4, d5, d6, d7;
986e461dc072 Initial revision
glantau
parents:
diff changeset
179 register DCTELEM *dataptr;
986e461dc072 Initial revision
glantau
parents:
diff changeset
180 int rowctr;
986e461dc072 Initial revision
glantau
parents:
diff changeset
181
986e461dc072 Initial revision
glantau
parents:
diff changeset
182 /* Pass 1: process rows. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
183 /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
986e461dc072 Initial revision
glantau
parents:
diff changeset
184 /* furthermore, we scale the results by 2**PASS1_BITS. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
185
986e461dc072 Initial revision
glantau
parents:
diff changeset
186 dataptr = data;
986e461dc072 Initial revision
glantau
parents:
diff changeset
187
986e461dc072 Initial revision
glantau
parents:
diff changeset
188 for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
189 /* Due to quantization, we will usually find that many of the input
986e461dc072 Initial revision
glantau
parents:
diff changeset
190 * coefficients are zero, especially the AC terms. We can exploit this
986e461dc072 Initial revision
glantau
parents:
diff changeset
191 * by short-circuiting the IDCT calculation for any row in which all
986e461dc072 Initial revision
glantau
parents:
diff changeset
192 * the AC terms are zero. In that case each output is equal to the
986e461dc072 Initial revision
glantau
parents:
diff changeset
193 * DC coefficient (with scale factor as needed).
986e461dc072 Initial revision
glantau
parents:
diff changeset
194 * With typical images and quantization tables, half or more of the
986e461dc072 Initial revision
glantau
parents:
diff changeset
195 * row DCT calculations can be simplified this way.
986e461dc072 Initial revision
glantau
parents:
diff changeset
196 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
197
986e461dc072 Initial revision
glantau
parents:
diff changeset
198 register int *idataptr = (int*)dataptr;
986e461dc072 Initial revision
glantau
parents:
diff changeset
199
36
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
200 /* WARNING: we do the same permutation as MMX idct to simplify the
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
201 video core */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
202 d0 = dataptr[0];
36
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
203 d2 = dataptr[1];
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
204 d4 = dataptr[2];
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
205 d6 = dataptr[3];
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
206 d1 = dataptr[4];
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
207 d3 = dataptr[5];
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
208 d5 = dataptr[6];
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
209 d7 = dataptr[7];
986e461dc072 Initial revision
glantau
parents:
diff changeset
210
36
23723a0ebd24 permuted coefs in normal IDCT to avoid having different cases there
glantau
parents: 0
diff changeset
211 if ((d1 | d2 | d3 | d4 | d5 | d6 | d7) == 0) {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
212 /* AC terms all zero */
986e461dc072 Initial revision
glantau
parents:
diff changeset
213 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
214 /* Compute a 32 bit value to assign. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
215 DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
216 register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
986e461dc072 Initial revision
glantau
parents:
diff changeset
217
986e461dc072 Initial revision
glantau
parents:
diff changeset
218 idataptr[0] = v;
986e461dc072 Initial revision
glantau
parents:
diff changeset
219 idataptr[1] = v;
986e461dc072 Initial revision
glantau
parents:
diff changeset
220 idataptr[2] = v;
986e461dc072 Initial revision
glantau
parents:
diff changeset
221 idataptr[3] = v;
986e461dc072 Initial revision
glantau
parents:
diff changeset
222 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
223
986e461dc072 Initial revision
glantau
parents:
diff changeset
224 dataptr += DCTSIZE; /* advance pointer to next row */
986e461dc072 Initial revision
glantau
parents:
diff changeset
225 continue;
986e461dc072 Initial revision
glantau
parents:
diff changeset
226 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
227
986e461dc072 Initial revision
glantau
parents:
diff changeset
228 /* Even part: reverse the even part of the forward DCT. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
229 /* The rotator is sqrt(2)*c(-6). */
986e461dc072 Initial revision
glantau
parents:
diff changeset
230 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
231 if (d6) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
232 if (d4) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
233 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
234 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
235 /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
236 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
237 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
238 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
239
986e461dc072 Initial revision
glantau
parents:
diff changeset
240 tmp0 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
241 tmp1 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
242
986e461dc072 Initial revision
glantau
parents:
diff changeset
243 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
244 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
245 tmp11 = tmp1 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
246 tmp12 = tmp1 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
247 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
248 /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
249 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
250 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
251 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
252
986e461dc072 Initial revision
glantau
parents:
diff changeset
253 tmp0 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
254
986e461dc072 Initial revision
glantau
parents:
diff changeset
255 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
256 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
257 tmp11 = tmp2 - tmp0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
258 tmp12 = -(tmp0 + tmp2);
986e461dc072 Initial revision
glantau
parents:
diff changeset
259 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
260 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
261 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
262 /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
263 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
264 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
265
986e461dc072 Initial revision
glantau
parents:
diff changeset
266 tmp0 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
267 tmp1 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
268
986e461dc072 Initial revision
glantau
parents:
diff changeset
269 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
270 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
271 tmp11 = tmp1 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
272 tmp12 = tmp1 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
273 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
274 /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
275 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
276 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
277
986e461dc072 Initial revision
glantau
parents:
diff changeset
278 tmp0 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
279
986e461dc072 Initial revision
glantau
parents:
diff changeset
280 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
281 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
282 tmp11 = tmp2 - tmp0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
283 tmp12 = -(tmp0 + tmp2);
986e461dc072 Initial revision
glantau
parents:
diff changeset
284 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
285 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
286 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
287 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
288 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
289 /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
290 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
291 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
292 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
293
986e461dc072 Initial revision
glantau
parents:
diff changeset
294 tmp0 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
295
986e461dc072 Initial revision
glantau
parents:
diff changeset
296 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
297 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
298 tmp11 = tmp0 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
299 tmp12 = tmp0 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
300 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
301 /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
302 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
303 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
304 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
305
986e461dc072 Initial revision
glantau
parents:
diff changeset
306 tmp10 = tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
307 tmp13 = -tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
308 tmp11 = tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
309 tmp12 = -tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
310 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
311 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
312 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
313 /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
314 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
315 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
316
986e461dc072 Initial revision
glantau
parents:
diff changeset
317 tmp0 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
318
986e461dc072 Initial revision
glantau
parents:
diff changeset
319 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
320 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
321 tmp11 = tmp0 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
322 tmp12 = tmp0 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
323 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
324 /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
325 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
326 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
327
986e461dc072 Initial revision
glantau
parents:
diff changeset
328 tmp10 = tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
329 tmp13 = -tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
330 tmp11 = tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
331 tmp12 = -tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
332 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
333 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
334 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
335 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
336 if (d4) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
337 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
338 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
339 /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
340 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
341 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
342
986e461dc072 Initial revision
glantau
parents:
diff changeset
343 tmp0 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
344 tmp1 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
345
986e461dc072 Initial revision
glantau
parents:
diff changeset
346 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
347 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
348 tmp11 = tmp1 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
349 tmp12 = tmp1 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
350 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
351 /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
352 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
353 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
354
986e461dc072 Initial revision
glantau
parents:
diff changeset
355 tmp0 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
356
986e461dc072 Initial revision
glantau
parents:
diff changeset
357 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
358 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
359 tmp11 = tmp2 - tmp0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
360 tmp12 = -(tmp0 + tmp2);
986e461dc072 Initial revision
glantau
parents:
diff changeset
361 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
362 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
363 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
364 /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
365 tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
366 tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
367 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
368 /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
369 tmp10 = tmp13 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
370 tmp11 = tmp12 = -tmp10;
986e461dc072 Initial revision
glantau
parents:
diff changeset
371 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
372 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
373 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
374 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
375 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
376 /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
377 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
378 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
379
986e461dc072 Initial revision
glantau
parents:
diff changeset
380 tmp0 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
381
986e461dc072 Initial revision
glantau
parents:
diff changeset
382 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
383 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
384 tmp11 = tmp0 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
385 tmp12 = tmp0 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
386 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
387 /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
388 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
389 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
390
986e461dc072 Initial revision
glantau
parents:
diff changeset
391 tmp10 = tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
392 tmp13 = -tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
393 tmp11 = tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
394 tmp12 = -tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
395 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
396 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
397 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
398 /* d0 != 0, d2 == 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
399 tmp10 = tmp13 = tmp11 = tmp12 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
400 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
401 /* d0 == 0, d2 == 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
402 tmp10 = tmp13 = tmp11 = tmp12 = 0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
403 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
404 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
405 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
406 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
407
986e461dc072 Initial revision
glantau
parents:
diff changeset
408 /* Odd part per figure 8; the matrix is unitary and hence its
986e461dc072 Initial revision
glantau
parents:
diff changeset
409 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
986e461dc072 Initial revision
glantau
parents:
diff changeset
410 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
411
986e461dc072 Initial revision
glantau
parents:
diff changeset
412 if (d7) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
413 if (d5) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
414 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
415 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
416 /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
417 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
418 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
419 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
420 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
421 z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
422
986e461dc072 Initial revision
glantau
parents:
diff changeset
423 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
424 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
425 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
426 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
427 z1 = MULTIPLY(-z1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
428 z2 = MULTIPLY(-z2, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
429 z3 = MULTIPLY(-z3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
430 z4 = MULTIPLY(-z4, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
431
986e461dc072 Initial revision
glantau
parents:
diff changeset
432 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
433 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
434
986e461dc072 Initial revision
glantau
parents:
diff changeset
435 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
436 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
437 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
438 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
439 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
440 /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
441 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
442 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
443 z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
444
986e461dc072 Initial revision
glantau
parents:
diff changeset
445 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
446 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
447 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
448 z1 = MULTIPLY(-d7, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
449 z2 = MULTIPLY(-z2, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
450 z3 = MULTIPLY(-z3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
451 z4 = MULTIPLY(-d5, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
452
986e461dc072 Initial revision
glantau
parents:
diff changeset
453 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
454 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
455
986e461dc072 Initial revision
glantau
parents:
diff changeset
456 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
457 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
458 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
459 tmp3 = z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
460 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
461 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
462 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
463 /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
464 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
465 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
466 z5 = MULTIPLY(d7 + z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
467
986e461dc072 Initial revision
glantau
parents:
diff changeset
468 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
469 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
470 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
471 z1 = MULTIPLY(-z1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
472 z2 = MULTIPLY(-d5, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
473 z3 = MULTIPLY(-d7, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
474 z4 = MULTIPLY(-z4, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
475
986e461dc072 Initial revision
glantau
parents:
diff changeset
476 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
477 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
478
986e461dc072 Initial revision
glantau
parents:
diff changeset
479 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
480 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
481 tmp2 = z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
482 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
483 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
484 /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
485 tmp0 = MULTIPLY(-d7, FIX_0_601344887);
986e461dc072 Initial revision
glantau
parents:
diff changeset
486 z1 = MULTIPLY(-d7, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
487 z3 = MULTIPLY(-d7, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
488 tmp1 = MULTIPLY(-d5, FIX_0_509795579);
986e461dc072 Initial revision
glantau
parents:
diff changeset
489 z2 = MULTIPLY(-d5, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
490 z4 = MULTIPLY(-d5, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
491 z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
492
986e461dc072 Initial revision
glantau
parents:
diff changeset
493 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
494 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
495
986e461dc072 Initial revision
glantau
parents:
diff changeset
496 tmp0 += z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
497 tmp1 += z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
498 tmp2 = z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
499 tmp3 = z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
500 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
501 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
502 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
503 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
504 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
505 /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
506 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
507 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
508 z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
509
986e461dc072 Initial revision
glantau
parents:
diff changeset
510 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
511 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
512 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
513 z1 = MULTIPLY(-z1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
514 z2 = MULTIPLY(-d3, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
515 z3 = MULTIPLY(-z3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
516 z4 = MULTIPLY(-d1, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
517
986e461dc072 Initial revision
glantau
parents:
diff changeset
518 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
519 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
520
986e461dc072 Initial revision
glantau
parents:
diff changeset
521 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
522 tmp1 = z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
523 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
524 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
525 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
526 /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
527 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
528
986e461dc072 Initial revision
glantau
parents:
diff changeset
529 tmp0 = MULTIPLY(-d7, FIX_0_601344887);
986e461dc072 Initial revision
glantau
parents:
diff changeset
530 z1 = MULTIPLY(-d7, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
531 tmp2 = MULTIPLY(d3, FIX_0_509795579);
986e461dc072 Initial revision
glantau
parents:
diff changeset
532 z2 = MULTIPLY(-d3, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
533 z5 = MULTIPLY(z3, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
534 z3 = MULTIPLY(-z3, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
535
986e461dc072 Initial revision
glantau
parents:
diff changeset
536 tmp0 += z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
537 tmp1 = z2 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
538 tmp2 += z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
539 tmp3 = z1 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
540 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
541 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
542 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
543 /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
544 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
545 z5 = MULTIPLY(z1, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
546
986e461dc072 Initial revision
glantau
parents:
diff changeset
547 z1 = MULTIPLY(z1, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
548 z3 = MULTIPLY(-d7, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
549 tmp0 = MULTIPLY(-d7, FIX_1_662939225);
986e461dc072 Initial revision
glantau
parents:
diff changeset
550 z4 = MULTIPLY(-d1, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
551 tmp3 = MULTIPLY(d1, FIX_1_111140466);
986e461dc072 Initial revision
glantau
parents:
diff changeset
552
986e461dc072 Initial revision
glantau
parents:
diff changeset
553 tmp0 += z1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
554 tmp1 = z4 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
555 tmp2 = z3 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
556 tmp3 += z1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
557 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
558 /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
559 tmp0 = MULTIPLY(-d7, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
560 tmp1 = MULTIPLY(d7, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
561 tmp2 = MULTIPLY(-d7, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
562 tmp3 = MULTIPLY(d7, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
563 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
564 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
565 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
566 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
567 if (d5) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
568 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
569 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
570 /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
571 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
572 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
573 z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
574
986e461dc072 Initial revision
glantau
parents:
diff changeset
575 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
576 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
577 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
578 z1 = MULTIPLY(-d1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
579 z2 = MULTIPLY(-z2, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
580 z3 = MULTIPLY(-d3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
581 z4 = MULTIPLY(-z4, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
582
986e461dc072 Initial revision
glantau
parents:
diff changeset
583 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
584 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
585
986e461dc072 Initial revision
glantau
parents:
diff changeset
586 tmp0 = z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
587 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
588 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
589 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
590 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
591 /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
592 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
593
986e461dc072 Initial revision
glantau
parents:
diff changeset
594 z5 = MULTIPLY(z2, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
595 tmp1 = MULTIPLY(d5, FIX_1_662939225);
986e461dc072 Initial revision
glantau
parents:
diff changeset
596 z4 = MULTIPLY(-d5, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
597 z2 = MULTIPLY(-z2, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
598 tmp2 = MULTIPLY(d3, FIX_1_111140466);
986e461dc072 Initial revision
glantau
parents:
diff changeset
599 z3 = MULTIPLY(-d3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
600
986e461dc072 Initial revision
glantau
parents:
diff changeset
601 tmp0 = z3 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
602 tmp1 += z2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
603 tmp2 += z2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
604 tmp3 = z4 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
605 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
606 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
607 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
608 /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
609 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
610
986e461dc072 Initial revision
glantau
parents:
diff changeset
611 z5 = MULTIPLY(z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
612 z1 = MULTIPLY(-d1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
613 tmp3 = MULTIPLY(d1, FIX_0_601344887);
986e461dc072 Initial revision
glantau
parents:
diff changeset
614 tmp1 = MULTIPLY(-d5, FIX_0_509795579);
986e461dc072 Initial revision
glantau
parents:
diff changeset
615 z2 = MULTIPLY(-d5, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
616 z4 = MULTIPLY(z4, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
617
986e461dc072 Initial revision
glantau
parents:
diff changeset
618 tmp0 = z1 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
619 tmp1 += z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
620 tmp2 = z2 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
621 tmp3 += z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
622 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
623 /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
624 tmp0 = MULTIPLY(d5, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
625 tmp1 = MULTIPLY(d5, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
626 tmp2 = MULTIPLY(-d5, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
627 tmp3 = MULTIPLY(d5, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
628 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
629 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
630 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
631 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
632 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
633 /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
634 z5 = d1 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
635 tmp3 = MULTIPLY(d1, FIX_0_211164243);
986e461dc072 Initial revision
glantau
parents:
diff changeset
636 tmp2 = MULTIPLY(-d3, FIX_1_451774981);
986e461dc072 Initial revision
glantau
parents:
diff changeset
637 z1 = MULTIPLY(d1, FIX_1_061594337);
986e461dc072 Initial revision
glantau
parents:
diff changeset
638 z2 = MULTIPLY(-d3, FIX_2_172734803);
986e461dc072 Initial revision
glantau
parents:
diff changeset
639 z4 = MULTIPLY(z5, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
640 z5 = MULTIPLY(z5, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
641
986e461dc072 Initial revision
glantau
parents:
diff changeset
642 tmp0 = z1 - z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
643 tmp1 = z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
644 tmp2 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
645 tmp3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
646 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
647 /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
648 tmp0 = MULTIPLY(-d3, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
649 tmp1 = MULTIPLY(-d3, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
650 tmp2 = MULTIPLY(-d3, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
651 tmp3 = MULTIPLY(d3, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
652 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
653 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
654 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
655 /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
656 tmp0 = MULTIPLY(d1, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
657 tmp1 = MULTIPLY(d1, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
658 tmp2 = MULTIPLY(d1, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
659 tmp3 = MULTIPLY(d1, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
660 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
661 /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
662 tmp0 = tmp1 = tmp2 = tmp3 = 0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
663 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
664 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
665 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
666 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
667 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
668 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
669
986e461dc072 Initial revision
glantau
parents:
diff changeset
670 dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
671 dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
672 dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
673 dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
674 dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
675 dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
676 dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
677 dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
986e461dc072 Initial revision
glantau
parents:
diff changeset
678
986e461dc072 Initial revision
glantau
parents:
diff changeset
679 dataptr += DCTSIZE; /* advance pointer to next row */
986e461dc072 Initial revision
glantau
parents:
diff changeset
680 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
681
986e461dc072 Initial revision
glantau
parents:
diff changeset
682 /* Pass 2: process columns. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
683 /* Note that we must descale the results by a factor of 8 == 2**3, */
986e461dc072 Initial revision
glantau
parents:
diff changeset
684 /* and also undo the PASS1_BITS scaling. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
685
986e461dc072 Initial revision
glantau
parents:
diff changeset
686 dataptr = data;
986e461dc072 Initial revision
glantau
parents:
diff changeset
687 for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
688 /* Columns of zeroes can be exploited in the same way as we did with rows.
986e461dc072 Initial revision
glantau
parents:
diff changeset
689 * However, the row calculation has created many nonzero AC terms, so the
986e461dc072 Initial revision
glantau
parents:
diff changeset
690 * simplification applies less often (typically 5% to 10% of the time).
986e461dc072 Initial revision
glantau
parents:
diff changeset
691 * On machines with very fast multiplication, it's possible that the
986e461dc072 Initial revision
glantau
parents:
diff changeset
692 * test takes more time than it's worth. In that case this section
986e461dc072 Initial revision
glantau
parents:
diff changeset
693 * may be commented out.
986e461dc072 Initial revision
glantau
parents:
diff changeset
694 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
695
986e461dc072 Initial revision
glantau
parents:
diff changeset
696 d0 = dataptr[DCTSIZE*0];
986e461dc072 Initial revision
glantau
parents:
diff changeset
697 d1 = dataptr[DCTSIZE*1];
986e461dc072 Initial revision
glantau
parents:
diff changeset
698 d2 = dataptr[DCTSIZE*2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
699 d3 = dataptr[DCTSIZE*3];
986e461dc072 Initial revision
glantau
parents:
diff changeset
700 d4 = dataptr[DCTSIZE*4];
986e461dc072 Initial revision
glantau
parents:
diff changeset
701 d5 = dataptr[DCTSIZE*5];
986e461dc072 Initial revision
glantau
parents:
diff changeset
702 d6 = dataptr[DCTSIZE*6];
986e461dc072 Initial revision
glantau
parents:
diff changeset
703 d7 = dataptr[DCTSIZE*7];
986e461dc072 Initial revision
glantau
parents:
diff changeset
704
986e461dc072 Initial revision
glantau
parents:
diff changeset
705 /* Even part: reverse the even part of the forward DCT. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
706 /* The rotator is sqrt(2)*c(-6). */
986e461dc072 Initial revision
glantau
parents:
diff changeset
707 if (d6) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
708 if (d4) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
709 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
710 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
711 /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
712 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
713 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
714 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
715
986e461dc072 Initial revision
glantau
parents:
diff changeset
716 tmp0 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
717 tmp1 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
718
986e461dc072 Initial revision
glantau
parents:
diff changeset
719 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
720 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
721 tmp11 = tmp1 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
722 tmp12 = tmp1 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
723 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
724 /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
725 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
726 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
727 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
728
986e461dc072 Initial revision
glantau
parents:
diff changeset
729 tmp0 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
730
986e461dc072 Initial revision
glantau
parents:
diff changeset
731 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
732 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
733 tmp11 = tmp2 - tmp0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
734 tmp12 = -(tmp0 + tmp2);
986e461dc072 Initial revision
glantau
parents:
diff changeset
735 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
736 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
737 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
738 /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
739 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
740 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
741
986e461dc072 Initial revision
glantau
parents:
diff changeset
742 tmp0 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
743 tmp1 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
744
986e461dc072 Initial revision
glantau
parents:
diff changeset
745 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
746 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
747 tmp11 = tmp1 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
748 tmp12 = tmp1 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
749 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
750 /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
751 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
752 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
753
986e461dc072 Initial revision
glantau
parents:
diff changeset
754 tmp0 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
755
986e461dc072 Initial revision
glantau
parents:
diff changeset
756 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
757 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
758 tmp11 = tmp2 - tmp0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
759 tmp12 = -(tmp0 + tmp2);
986e461dc072 Initial revision
glantau
parents:
diff changeset
760 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
761 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
762 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
763 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
764 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
765 /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
766 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
767 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
768 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
769
986e461dc072 Initial revision
glantau
parents:
diff changeset
770 tmp0 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
771
986e461dc072 Initial revision
glantau
parents:
diff changeset
772 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
773 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
774 tmp11 = tmp0 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
775 tmp12 = tmp0 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
776 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
777 /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
778 z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
779 tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
986e461dc072 Initial revision
glantau
parents:
diff changeset
780 tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
986e461dc072 Initial revision
glantau
parents:
diff changeset
781
986e461dc072 Initial revision
glantau
parents:
diff changeset
782 tmp10 = tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
783 tmp13 = -tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
784 tmp11 = tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
785 tmp12 = -tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
786 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
787 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
788 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
789 /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
790 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
791 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
792
986e461dc072 Initial revision
glantau
parents:
diff changeset
793 tmp0 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
794
986e461dc072 Initial revision
glantau
parents:
diff changeset
795 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
796 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
797 tmp11 = tmp0 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
798 tmp12 = tmp0 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
799 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
800 /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
801 tmp2 = MULTIPLY(-d6, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
802 tmp3 = MULTIPLY(d6, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
803
986e461dc072 Initial revision
glantau
parents:
diff changeset
804 tmp10 = tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
805 tmp13 = -tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
806 tmp11 = tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
807 tmp12 = -tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
808 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
809 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
810 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
811 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
812 if (d4) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
813 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
814 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
815 /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
816 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
817 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
818
986e461dc072 Initial revision
glantau
parents:
diff changeset
819 tmp0 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
820 tmp1 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
821
986e461dc072 Initial revision
glantau
parents:
diff changeset
822 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
823 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
824 tmp11 = tmp1 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
825 tmp12 = tmp1 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
826 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
827 /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
828 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
829 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
830
986e461dc072 Initial revision
glantau
parents:
diff changeset
831 tmp0 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
832
986e461dc072 Initial revision
glantau
parents:
diff changeset
833 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
834 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
835 tmp11 = tmp2 - tmp0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
836 tmp12 = -(tmp0 + tmp2);
986e461dc072 Initial revision
glantau
parents:
diff changeset
837 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
838 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
839 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
840 /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
841 tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
842 tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
843 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
844 /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
845 tmp10 = tmp13 = d4 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
846 tmp11 = tmp12 = -tmp10;
986e461dc072 Initial revision
glantau
parents:
diff changeset
847 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
848 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
849 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
850 if (d2) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
851 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
852 /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
853 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
854 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
855
986e461dc072 Initial revision
glantau
parents:
diff changeset
856 tmp0 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
857
986e461dc072 Initial revision
glantau
parents:
diff changeset
858 tmp10 = tmp0 + tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
859 tmp13 = tmp0 - tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
860 tmp11 = tmp0 + tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
861 tmp12 = tmp0 - tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
862 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
863 /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
864 tmp2 = MULTIPLY(d2, FIX_0_541196100);
986e461dc072 Initial revision
glantau
parents:
diff changeset
865 tmp3 = MULTIPLY(d2, FIX_1_306562965);
986e461dc072 Initial revision
glantau
parents:
diff changeset
866
986e461dc072 Initial revision
glantau
parents:
diff changeset
867 tmp10 = tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
868 tmp13 = -tmp3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
869 tmp11 = tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
870 tmp12 = -tmp2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
871 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
872 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
873 if (d0) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
874 /* d0 != 0, d2 == 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
875 tmp10 = tmp13 = tmp11 = tmp12 = d0 << CONST_BITS;
986e461dc072 Initial revision
glantau
parents:
diff changeset
876 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
877 /* d0 == 0, d2 == 0, d4 == 0, d6 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
878 tmp10 = tmp13 = tmp11 = tmp12 = 0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
879 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
880 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
881 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
882 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
883
986e461dc072 Initial revision
glantau
parents:
diff changeset
884 /* Odd part per figure 8; the matrix is unitary and hence its
986e461dc072 Initial revision
glantau
parents:
diff changeset
885 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
986e461dc072 Initial revision
glantau
parents:
diff changeset
886 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
887 if (d7) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
888 if (d5) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
889 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
890 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
891 /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
892 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
893 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
894 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
895 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
896 z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
897
986e461dc072 Initial revision
glantau
parents:
diff changeset
898 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
899 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
900 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
901 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
902 z1 = MULTIPLY(-z1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
903 z2 = MULTIPLY(-z2, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
904 z3 = MULTIPLY(-z3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
905 z4 = MULTIPLY(-z4, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
906
986e461dc072 Initial revision
glantau
parents:
diff changeset
907 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
908 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
909
986e461dc072 Initial revision
glantau
parents:
diff changeset
910 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
911 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
912 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
913 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
914 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
915 /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
916 z1 = d7;
986e461dc072 Initial revision
glantau
parents:
diff changeset
917 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
918 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
919 z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
920
986e461dc072 Initial revision
glantau
parents:
diff changeset
921 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
922 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
923 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
924 z1 = MULTIPLY(-d7, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
925 z2 = MULTIPLY(-z2, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
926 z3 = MULTIPLY(-z3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
927 z4 = MULTIPLY(-d5, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
928
986e461dc072 Initial revision
glantau
parents:
diff changeset
929 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
930 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
931
986e461dc072 Initial revision
glantau
parents:
diff changeset
932 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
933 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
934 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
935 tmp3 = z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
936 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
937 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
938 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
939 /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
940 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
941 z2 = d5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
942 z3 = d7;
986e461dc072 Initial revision
glantau
parents:
diff changeset
943 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
944 z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
945
986e461dc072 Initial revision
glantau
parents:
diff changeset
946 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
947 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
948 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
949 z1 = MULTIPLY(-z1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
950 z2 = MULTIPLY(-d5, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
951 z3 = MULTIPLY(-d7, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
952 z4 = MULTIPLY(-z4, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
953
986e461dc072 Initial revision
glantau
parents:
diff changeset
954 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
955 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
956
986e461dc072 Initial revision
glantau
parents:
diff changeset
957 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
958 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
959 tmp2 = z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
960 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
961 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
962 /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
963 tmp0 = MULTIPLY(-d7, FIX_0_601344887);
986e461dc072 Initial revision
glantau
parents:
diff changeset
964 z1 = MULTIPLY(-d7, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
965 z3 = MULTIPLY(-d7, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
966 tmp1 = MULTIPLY(-d5, FIX_0_509795579);
986e461dc072 Initial revision
glantau
parents:
diff changeset
967 z2 = MULTIPLY(-d5, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
968 z4 = MULTIPLY(-d5, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
969 z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
970
986e461dc072 Initial revision
glantau
parents:
diff changeset
971 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
972 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
973
986e461dc072 Initial revision
glantau
parents:
diff changeset
974 tmp0 += z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
975 tmp1 += z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
976 tmp2 = z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
977 tmp3 = z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
978 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
979 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
980 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
981 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
982 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
983 /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
984 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
985 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
986 z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
987
986e461dc072 Initial revision
glantau
parents:
diff changeset
988 tmp0 = MULTIPLY(d7, FIX_0_298631336);
986e461dc072 Initial revision
glantau
parents:
diff changeset
989 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
990 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
991 z1 = MULTIPLY(-z1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
992 z2 = MULTIPLY(-d3, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
993 z3 = MULTIPLY(-z3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
994 z4 = MULTIPLY(-d1, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
995
986e461dc072 Initial revision
glantau
parents:
diff changeset
996 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
997 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
998
986e461dc072 Initial revision
glantau
parents:
diff changeset
999 tmp0 += z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1000 tmp1 = z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1001 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1002 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1003 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1004 /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1005 z3 = d7 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1006
986e461dc072 Initial revision
glantau
parents:
diff changeset
1007 tmp0 = MULTIPLY(-d7, FIX_0_601344887);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1008 z1 = MULTIPLY(-d7, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1009 tmp2 = MULTIPLY(d3, FIX_0_509795579);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1010 z2 = MULTIPLY(-d3, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1011 z5 = MULTIPLY(z3, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1012 z3 = MULTIPLY(-z3, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1013
986e461dc072 Initial revision
glantau
parents:
diff changeset
1014 tmp0 += z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1015 tmp1 = z2 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1016 tmp2 += z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1017 tmp3 = z1 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1018 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1019 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1020 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1021 /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1022 z1 = d7 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1023 z5 = MULTIPLY(z1, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1024
986e461dc072 Initial revision
glantau
parents:
diff changeset
1025 z1 = MULTIPLY(z1, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1026 z3 = MULTIPLY(-d7, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1027 tmp0 = MULTIPLY(-d7, FIX_1_662939225);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1028 z4 = MULTIPLY(-d1, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1029 tmp3 = MULTIPLY(d1, FIX_1_111140466);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1030
986e461dc072 Initial revision
glantau
parents:
diff changeset
1031 tmp0 += z1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1032 tmp1 = z4 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1033 tmp2 = z3 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1034 tmp3 += z1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1035 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1036 /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1037 tmp0 = MULTIPLY(-d7, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1038 tmp1 = MULTIPLY(d7, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1039 tmp2 = MULTIPLY(-d7, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1040 tmp3 = MULTIPLY(d7, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1041 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1042 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1043 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1044 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1045 if (d5) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1046 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1047 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1048 /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1049 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1050 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1051 z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1052
986e461dc072 Initial revision
glantau
parents:
diff changeset
1053 tmp1 = MULTIPLY(d5, FIX_2_053119869);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1054 tmp2 = MULTIPLY(d3, FIX_3_072711026);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1055 tmp3 = MULTIPLY(d1, FIX_1_501321110);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1056 z1 = MULTIPLY(-d1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1057 z2 = MULTIPLY(-z2, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1058 z3 = MULTIPLY(-d3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1059 z4 = MULTIPLY(-z4, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1060
986e461dc072 Initial revision
glantau
parents:
diff changeset
1061 z3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1062 z4 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1063
986e461dc072 Initial revision
glantau
parents:
diff changeset
1064 tmp0 = z1 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1065 tmp1 += z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1066 tmp2 += z2 + z3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1067 tmp3 += z1 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1068 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1069 /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1070 z2 = d5 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1071
986e461dc072 Initial revision
glantau
parents:
diff changeset
1072 z5 = MULTIPLY(z2, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1073 tmp1 = MULTIPLY(d5, FIX_1_662939225);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1074 z4 = MULTIPLY(-d5, FIX_0_390180644);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1075 z2 = MULTIPLY(-z2, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1076 tmp2 = MULTIPLY(d3, FIX_1_111140466);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1077 z3 = MULTIPLY(-d3, FIX_1_961570560);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1078
986e461dc072 Initial revision
glantau
parents:
diff changeset
1079 tmp0 = z3 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1080 tmp1 += z2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1081 tmp2 += z2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1082 tmp3 = z4 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1083 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1084 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1085 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1086 /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1087 z4 = d5 + d1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1088
986e461dc072 Initial revision
glantau
parents:
diff changeset
1089 z5 = MULTIPLY(z4, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1090 z1 = MULTIPLY(-d1, FIX_0_899976223);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1091 tmp3 = MULTIPLY(d1, FIX_0_601344887);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1092 tmp1 = MULTIPLY(-d5, FIX_0_509795579);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1093 z2 = MULTIPLY(-d5, FIX_2_562915447);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1094 z4 = MULTIPLY(z4, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1095
986e461dc072 Initial revision
glantau
parents:
diff changeset
1096 tmp0 = z1 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1097 tmp1 += z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1098 tmp2 = z2 + z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1099 tmp3 += z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1100 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1101 /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1102 tmp0 = MULTIPLY(d5, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1103 tmp1 = MULTIPLY(d5, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1104 tmp2 = MULTIPLY(-d5, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1105 tmp3 = MULTIPLY(d5, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1106 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1107 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1108 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1109 if (d3) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1110 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1111 /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1112 z5 = d1 + d3;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1113 tmp3 = MULTIPLY(d1, FIX_0_211164243);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1114 tmp2 = MULTIPLY(-d3, FIX_1_451774981);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1115 z1 = MULTIPLY(d1, FIX_1_061594337);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1116 z2 = MULTIPLY(-d3, FIX_2_172734803);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1117 z4 = MULTIPLY(z5, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1118 z5 = MULTIPLY(z5, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1119
986e461dc072 Initial revision
glantau
parents:
diff changeset
1120 tmp0 = z1 - z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1121 tmp1 = z2 + z4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1122 tmp2 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1123 tmp3 += z5;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1124 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1125 /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1126 tmp0 = MULTIPLY(-d3, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1127 tmp1 = MULTIPLY(-d3, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1128 tmp2 = MULTIPLY(-d3, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1129 tmp3 = MULTIPLY(d3, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1130 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1131 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1132 if (d1) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1133 /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1134 tmp0 = MULTIPLY(d1, FIX_0_275899380);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1135 tmp1 = MULTIPLY(d1, FIX_0_785694958);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1136 tmp2 = MULTIPLY(d1, FIX_1_175875602);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1137 tmp3 = MULTIPLY(d1, FIX_1_387039845);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1138 } else {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1139 /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1140 tmp0 = tmp1 = tmp2 = tmp3 = 0;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1141 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1142 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1143 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1144 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1145
986e461dc072 Initial revision
glantau
parents:
diff changeset
1146 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1147
986e461dc072 Initial revision
glantau
parents:
diff changeset
1148 dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1149 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1150 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1151 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1152 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1153 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1154 dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1155 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1156 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1157 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1158 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1159 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1160 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1161 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1162 dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0,
986e461dc072 Initial revision
glantau
parents:
diff changeset
1163 CONST_BITS+PASS1_BITS+3);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1164
986e461dc072 Initial revision
glantau
parents:
diff changeset
1165 dataptr++; /* advance pointer to next column */
986e461dc072 Initial revision
glantau
parents:
diff changeset
1166 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1167 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1168
440
000aeeac27a2 * started to cleanup name clashes for onetime compilation
kabi
parents: 36
diff changeset
1169 #undef FIX
000aeeac27a2 * started to cleanup name clashes for onetime compilation
kabi
parents: 36
diff changeset
1170 #undef CONST_BITS