annotate jrevdct.c @ 12530:63edd10ad4bc libavcodec tip

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