Coverage Report

Created: 2026-03-12 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libjpeg-turbo.dev/src/jidctint.c
Line
Count
Source
1
/*
2
 * jidctint.c
3
 *
4
 * This file was part of the Independent JPEG Group's software:
5
 * Copyright (C) 1991-1998, Thomas G. Lane.
6
 * Modification developed 2002-2018 by Guido Vollbeding.
7
 * libjpeg-turbo Modifications:
8
 * Copyright (C) 2015, 2020, 2022, 2026, D. R. Commander.
9
 * For conditions of distribution and use, see the accompanying README.ijg
10
 * file.
11
 *
12
 * This file contains a slower but more accurate integer implementation of the
13
 * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
14
 * must also perform dequantization of the input coefficients.
15
 *
16
 * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
17
 * on each row (or vice versa, but it's more convenient to emit a row at
18
 * a time).  Direct algorithms are also available, but they are much more
19
 * complex and seem not to be any faster when reduced to code.
20
 *
21
 * This implementation is based on an algorithm described in
22
 *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
23
 *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
24
 *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
25
 * The primary algorithm described there uses 11 multiplies and 29 adds.
26
 * We use their alternate method with 12 multiplies and 32 adds.
27
 * The advantage of this method is that no data path contains more than one
28
 * multiplication; this allows a very simple and accurate implementation in
29
 * scaled fixed-point arithmetic, with a minimal number of shifts.
30
 *
31
 * We also provide IDCT routines with various output sample block sizes for
32
 * direct resolution reduction or enlargement without additional resampling:
33
 * NxN (N=1...16) samples for one 8x8 input DCT block.
34
 *
35
 * For N<8 we simply take the corresponding low-frequency coefficients of
36
 * the 8x8 input DCT block and apply an NxN point IDCT on the sub-block
37
 * to yield the downscaled outputs.
38
 * This can be seen as direct low-pass downsampling from the DCT domain
39
 * point of view rather than the usual spatial domain point of view,
40
 * yielding significant computational savings and results at least
41
 * as good as common bilinear (averaging) spatial downsampling.
42
 *
43
 * For N>8 we apply a partial NxN IDCT on the 8 input coefficients as
44
 * lower frequencies and higher frequencies assumed to be zero.
45
 * It turns out that the computational effort is similar to the 8x8 IDCT
46
 * regarding the output size.
47
 * Furthermore, the scaling and descaling is the same for all IDCT sizes.
48
 *
49
 * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases
50
 * since there would be too many additional constants to pre-calculate.
51
 */
52
53
#define JPEG_INTERNALS
54
#include "jinclude.h"
55
#include "jpeglib.h"
56
#include "jdct.h"               /* Private declarations for DCT subsystem */
57
58
#ifdef DCT_ISLOW_SUPPORTED
59
60
61
/*
62
 * This module is specialized to the case DCTSIZE = 8.
63
 */
64
65
#if DCTSIZE != 8
66
  Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
67
#endif
68
69
70
/*
71
 * The poop on this scaling stuff is as follows:
72
 *
73
 * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
74
 * larger than the true IDCT outputs.  The final outputs are therefore
75
 * a factor of N larger than desired; since N=8 this can be cured by
76
 * a simple right shift at the end of the algorithm.  The advantage of
77
 * this arrangement is that we save two multiplications per 1-D IDCT,
78
 * because the y0 and y4 inputs need not be divided by sqrt(N).
79
 *
80
 * We have to do addition and subtraction of the integer inputs, which
81
 * is no problem, and multiplication by fractional constants, which is
82
 * a problem to do in integer arithmetic.  We multiply all the constants
83
 * by CONST_SCALE and convert them to integer constants (thus retaining
84
 * CONST_BITS bits of precision in the constants).  After doing a
85
 * multiplication we have to divide the product by CONST_SCALE, with proper
86
 * rounding, to produce the correct output.  This division can be done
87
 * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
88
 * as long as possible so that partial sums can be added together with
89
 * full fractional precision.
90
 *
91
 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
92
 * they are represented to better-than-integral precision.  These outputs
93
 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
94
 * with the recommended scaling.  (To scale up 12-bit sample data further, an
95
 * intermediate JLONG array would be needed.)
96
 *
97
 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
98
 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
99
 * shows that the values given below are the most effective.
100
 */
101
102
#if BITS_IN_JSAMPLE == 8
103
0
#define CONST_BITS  13
104
0
#define PASS1_BITS  2
105
#else
106
0
#define CONST_BITS  13
107
0
#define PASS1_BITS  1           /* lose a little precision to avoid overflow */
108
#endif
109
110
/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
111
 * causing a lot of useless floating-point operations at run time.
112
 * To get around this we use the following pre-calculated constants.
113
 * If you change CONST_BITS you may want to add appropriate values.
114
 * (With a reasonable C compiler, you can just rely on the FIX() macro...)
115
 */
116
117
#if CONST_BITS == 13
118
#define FIX_0_298631336  ((JLONG)2446)          /* FIX(0.298631336) */
119
#define FIX_0_390180644  ((JLONG)3196)          /* FIX(0.390180644) */
120
#define FIX_0_541196100  ((JLONG)4433)          /* FIX(0.541196100) */
121
#define FIX_0_765366865  ((JLONG)6270)          /* FIX(0.765366865) */
122
#define FIX_0_899976223  ((JLONG)7373)          /* FIX(0.899976223) */
123
#define FIX_1_175875602  ((JLONG)9633)          /* FIX(1.175875602) */
124
#define FIX_1_501321110  ((JLONG)12299)         /* FIX(1.501321110) */
125
#define FIX_1_847759065  ((JLONG)15137)         /* FIX(1.847759065) */
126
#define FIX_1_961570560  ((JLONG)16069)         /* FIX(1.961570560) */
127
#define FIX_2_053119869  ((JLONG)16819)         /* FIX(2.053119869) */
128
#define FIX_2_562915447  ((JLONG)20995)         /* FIX(2.562915447) */
129
#define FIX_3_072711026  ((JLONG)25172)         /* FIX(3.072711026) */
130
#else
131
#define FIX_0_298631336  FIX(0.298631336)
132
#define FIX_0_390180644  FIX(0.390180644)
133
#define FIX_0_541196100  FIX(0.541196100)
134
#define FIX_0_765366865  FIX(0.765366865)
135
#define FIX_0_899976223  FIX(0.899976223)
136
#define FIX_1_175875602  FIX(1.175875602)
137
#define FIX_1_501321110  FIX(1.501321110)
138
#define FIX_1_847759065  FIX(1.847759065)
139
#define FIX_1_961570560  FIX(1.961570560)
140
#define FIX_2_053119869  FIX(2.053119869)
141
#define FIX_2_562915447  FIX(2.562915447)
142
#define FIX_3_072711026  FIX(3.072711026)
143
#endif
144
145
146
/* Multiply an JLONG variable by an JLONG constant to yield an JLONG result.
147
 * For 8-bit samples with the recommended scaling, all the variable
148
 * and constant values involved are no more than 16 bits wide, so a
149
 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
150
 * For 12-bit samples, a full 32-bit multiplication will be needed.
151
 */
152
153
#if BITS_IN_JSAMPLE == 8
154
0
#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
155
#else
156
0
#define MULTIPLY(var, const)  ((var) * (const))
157
#endif
158
159
160
/* When decompressing an 8-bit-per-sample lossy JPEG image, we allow the caller
161
 * to request 12-bit-per-sample output in order to facilitate shadow recovery
162
 * in underexposed images.  This is accomplished by using the 12-bit-per-sample
163
 * decompression pipeline and multiplying the DCT coefficients from the
164
 * 8-bit-per-sample JPEG image by 16 (the equivalent of left shifting by 4
165
 * bits.)
166
 */
167
168
#if BITS_IN_JSAMPLE == 12
169
#define SCALING_FACTOR \
170
0
  JLONG scaling_factor = (cinfo->master->jpeg_data_precision == 8 && \
171
0
                          cinfo->data_precision == 12 ? 16 : 1);
172
#else
173
#define SCALING_FACTOR
174
#endif
175
176
177
/* Dequantize a coefficient by multiplying it by the multiplier-table
178
 * entry; produce an int result.  In this module, both inputs and result
179
 * are 16 bits or less, so either int or short multiply will work.
180
 */
181
182
#if BITS_IN_JSAMPLE == 8
183
0
#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
184
#else
185
#define DEQUANTIZE(coef, quantval) \
186
0
  (((ISLOW_MULT_TYPE)(coef)) * (quantval) * scaling_factor)
187
#endif
188
189
190
/*
191
 * Perform dequantization and inverse DCT on one block of coefficients.
192
 */
193
194
GLOBAL(void)
195
_jpeg_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
196
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
197
                 JDIMENSION output_col)
198
0
{
199
0
  JLONG tmp0, tmp1, tmp2, tmp3;
200
0
  JLONG tmp10, tmp11, tmp12, tmp13;
201
0
  JLONG z1, z2, z3, z4, z5;
202
0
  JCOEFPTR inptr;
203
0
  ISLOW_MULT_TYPE *quantptr;
204
0
  int *wsptr;
205
0
  _JSAMPROW outptr;
206
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
207
0
  int ctr;
208
0
  int workspace[DCTSIZE2];      /* buffers data between passes */
209
  SHIFT_TEMPS
210
0
  SCALING_FACTOR
211
212
  /* Pass 1: process columns from input, store into work array. */
213
  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
214
  /* furthermore, we scale the results by 2**PASS1_BITS. */
215
216
0
  inptr = coef_block;
217
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
218
0
  wsptr = workspace;
219
0
  for (ctr = DCTSIZE; ctr > 0; ctr--) {
220
    /* Due to quantization, we will usually find that many of the input
221
     * coefficients are zero, especially the AC terms.  We can exploit this
222
     * by short-circuiting the IDCT calculation for any column in which all
223
     * the AC terms are zero.  In that case each output is equal to the
224
     * DC coefficient (with scale factor as needed).
225
     * With typical images and quantization tables, half or more of the
226
     * column DCT calculations can be simplified this way.
227
     */
228
229
0
    if (inptr[DCTSIZE * 1] == 0 && inptr[DCTSIZE * 2] == 0 &&
230
0
        inptr[DCTSIZE * 3] == 0 && inptr[DCTSIZE * 4] == 0 &&
231
0
        inptr[DCTSIZE * 5] == 0 && inptr[DCTSIZE * 6] == 0 &&
232
0
        inptr[DCTSIZE * 7] == 0) {
233
      /* AC terms all zero */
234
0
      int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE * 0],
235
0
                             quantptr[DCTSIZE * 0]), PASS1_BITS);
236
237
0
      wsptr[DCTSIZE * 0] = dcval;
238
0
      wsptr[DCTSIZE * 1] = dcval;
239
0
      wsptr[DCTSIZE * 2] = dcval;
240
0
      wsptr[DCTSIZE * 3] = dcval;
241
0
      wsptr[DCTSIZE * 4] = dcval;
242
0
      wsptr[DCTSIZE * 5] = dcval;
243
0
      wsptr[DCTSIZE * 6] = dcval;
244
0
      wsptr[DCTSIZE * 7] = dcval;
245
246
0
      inptr++;                  /* advance pointers to next column */
247
0
      quantptr++;
248
0
      wsptr++;
249
0
      continue;
250
0
    }
251
252
    /* Even part: reverse the even part of the forward DCT. */
253
    /* The rotator is sqrt(2)*c(-6). */
254
255
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
256
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
257
258
0
    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
259
0
    tmp2 = z1 + MULTIPLY(z3, -FIX_1_847759065);
260
0
    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
261
262
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
263
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
264
265
0
    tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS);
266
0
    tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS);
267
268
0
    tmp10 = tmp0 + tmp3;
269
0
    tmp13 = tmp0 - tmp3;
270
0
    tmp11 = tmp1 + tmp2;
271
0
    tmp12 = tmp1 - tmp2;
272
273
    /* Odd part per figure 8; the matrix is unitary and hence its
274
     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
275
     */
276
277
0
    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
278
0
    tmp1 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
279
0
    tmp2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
280
0
    tmp3 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
281
282
0
    z1 = tmp0 + tmp3;
283
0
    z2 = tmp1 + tmp2;
284
0
    z3 = tmp0 + tmp2;
285
0
    z4 = tmp1 + tmp3;
286
0
    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
287
288
0
    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
289
0
    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
290
0
    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
291
0
    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
292
0
    z1 = MULTIPLY(z1, -FIX_0_899976223); /* sqrt(2) * ( c7-c3) */
293
0
    z2 = MULTIPLY(z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
294
0
    z3 = MULTIPLY(z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
295
0
    z4 = MULTIPLY(z4, -FIX_0_390180644); /* sqrt(2) * ( c5-c3) */
296
297
0
    z3 += z5;
298
0
    z4 += z5;
299
300
0
    tmp0 += z1 + z3;
301
0
    tmp1 += z2 + z4;
302
0
    tmp2 += z2 + z3;
303
0
    tmp3 += z1 + z4;
304
305
    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
306
307
0
    wsptr[DCTSIZE * 0] = (int)DESCALE(tmp10 + tmp3, CONST_BITS - PASS1_BITS);
308
0
    wsptr[DCTSIZE * 7] = (int)DESCALE(tmp10 - tmp3, CONST_BITS - PASS1_BITS);
309
0
    wsptr[DCTSIZE * 1] = (int)DESCALE(tmp11 + tmp2, CONST_BITS - PASS1_BITS);
310
0
    wsptr[DCTSIZE * 6] = (int)DESCALE(tmp11 - tmp2, CONST_BITS - PASS1_BITS);
311
0
    wsptr[DCTSIZE * 2] = (int)DESCALE(tmp12 + tmp1, CONST_BITS - PASS1_BITS);
312
0
    wsptr[DCTSIZE * 5] = (int)DESCALE(tmp12 - tmp1, CONST_BITS - PASS1_BITS);
313
0
    wsptr[DCTSIZE * 3] = (int)DESCALE(tmp13 + tmp0, CONST_BITS - PASS1_BITS);
314
0
    wsptr[DCTSIZE * 4] = (int)DESCALE(tmp13 - tmp0, CONST_BITS - PASS1_BITS);
315
316
0
    inptr++;                    /* advance pointers to next column */
317
0
    quantptr++;
318
0
    wsptr++;
319
0
  }
320
321
  /* Pass 2: process rows from work array, store into output array. */
322
  /* Note that we must descale the results by a factor of 8 == 2**3, */
323
  /* and also undo the PASS1_BITS scaling. */
324
325
0
  wsptr = workspace;
326
0
  for (ctr = 0; ctr < DCTSIZE; ctr++) {
327
0
    outptr = output_buf[ctr] + output_col;
328
    /* Rows of zeroes can be exploited in the same way as we did with columns.
329
     * However, the column calculation has created many nonzero AC terms, so
330
     * the simplification applies less often (typically 5% to 10% of the time).
331
     * On machines with very fast multiplication, it's possible that the
332
     * test takes more time than it's worth.  In that case this section
333
     * may be commented out.
334
     */
335
336
0
#ifndef NO_ZERO_ROW_TEST
337
0
    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
338
0
        wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
339
      /* AC terms all zero */
340
0
      _JSAMPLE dcval = range_limit[(int)DESCALE((JLONG)wsptr[0],
341
0
                                                PASS1_BITS + 3) & RANGE_MASK];
342
343
0
      outptr[0] = dcval;
344
0
      outptr[1] = dcval;
345
0
      outptr[2] = dcval;
346
0
      outptr[3] = dcval;
347
0
      outptr[4] = dcval;
348
0
      outptr[5] = dcval;
349
0
      outptr[6] = dcval;
350
0
      outptr[7] = dcval;
351
352
0
      wsptr += DCTSIZE;         /* advance pointer to next row */
353
0
      continue;
354
0
    }
355
0
#endif
356
357
    /* Even part: reverse the even part of the forward DCT. */
358
    /* The rotator is sqrt(2)*c(-6). */
359
360
0
    z2 = (JLONG)wsptr[2];
361
0
    z3 = (JLONG)wsptr[6];
362
363
0
    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
364
0
    tmp2 = z1 + MULTIPLY(z3, -FIX_1_847759065);
365
0
    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
366
367
0
    tmp0 = LEFT_SHIFT((JLONG)wsptr[0] + (JLONG)wsptr[4], CONST_BITS);
368
0
    tmp1 = LEFT_SHIFT((JLONG)wsptr[0] - (JLONG)wsptr[4], CONST_BITS);
369
370
0
    tmp10 = tmp0 + tmp3;
371
0
    tmp13 = tmp0 - tmp3;
372
0
    tmp11 = tmp1 + tmp2;
373
0
    tmp12 = tmp1 - tmp2;
374
375
    /* Odd part per figure 8; the matrix is unitary and hence its
376
     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
377
     */
378
379
0
    tmp0 = (JLONG)wsptr[7];
380
0
    tmp1 = (JLONG)wsptr[5];
381
0
    tmp2 = (JLONG)wsptr[3];
382
0
    tmp3 = (JLONG)wsptr[1];
383
384
0
    z1 = tmp0 + tmp3;
385
0
    z2 = tmp1 + tmp2;
386
0
    z3 = tmp0 + tmp2;
387
0
    z4 = tmp1 + tmp3;
388
0
    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
389
390
0
    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
391
0
    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
392
0
    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
393
0
    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
394
0
    z1 = MULTIPLY(z1, -FIX_0_899976223); /* sqrt(2) * ( c7-c3) */
395
0
    z2 = MULTIPLY(z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
396
0
    z3 = MULTIPLY(z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
397
0
    z4 = MULTIPLY(z4, -FIX_0_390180644); /* sqrt(2) * ( c5-c3) */
398
399
0
    z3 += z5;
400
0
    z4 += z5;
401
402
0
    tmp0 += z1 + z3;
403
0
    tmp1 += z2 + z4;
404
0
    tmp2 += z2 + z3;
405
0
    tmp3 += z1 + z4;
406
407
    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
408
409
0
    outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp3,
410
0
                                         CONST_BITS + PASS1_BITS + 3) &
411
0
                            RANGE_MASK];
412
0
    outptr[7] = range_limit[(int)DESCALE(tmp10 - tmp3,
413
0
                                         CONST_BITS + PASS1_BITS + 3) &
414
0
                            RANGE_MASK];
415
0
    outptr[1] = range_limit[(int)DESCALE(tmp11 + tmp2,
416
0
                                         CONST_BITS + PASS1_BITS + 3) &
417
0
                            RANGE_MASK];
418
0
    outptr[6] = range_limit[(int)DESCALE(tmp11 - tmp2,
419
0
                                         CONST_BITS + PASS1_BITS + 3) &
420
0
                            RANGE_MASK];
421
0
    outptr[2] = range_limit[(int)DESCALE(tmp12 + tmp1,
422
0
                                         CONST_BITS + PASS1_BITS + 3) &
423
0
                            RANGE_MASK];
424
0
    outptr[5] = range_limit[(int)DESCALE(tmp12 - tmp1,
425
0
                                         CONST_BITS + PASS1_BITS + 3) &
426
0
                            RANGE_MASK];
427
0
    outptr[3] = range_limit[(int)DESCALE(tmp13 + tmp0,
428
0
                                         CONST_BITS + PASS1_BITS + 3) &
429
0
                            RANGE_MASK];
430
0
    outptr[4] = range_limit[(int)DESCALE(tmp13 - tmp0,
431
0
                                         CONST_BITS + PASS1_BITS + 3) &
432
0
                            RANGE_MASK];
433
434
0
    wsptr += DCTSIZE;           /* advance pointer to next row */
435
0
  }
436
0
}
Unexecuted instantiation: jpeg_idct_islow
Unexecuted instantiation: jpeg12_idct_islow
437
438
#ifdef IDCT_SCALING_SUPPORTED
439
440
441
/*
442
 * Perform dequantization and inverse DCT on one block of coefficients,
443
 * producing a reduced-size 7x7 output block.
444
 *
445
 * Optimized algorithm with 12 multiplications in the 1-D kernel.
446
 * cK represents sqrt(2) * cos(K*pi/14).
447
 */
448
449
GLOBAL(void)
450
_jpeg_idct_7x7(j_decompress_ptr cinfo, jpeg_component_info *compptr,
451
               JCOEFPTR coef_block, _JSAMPARRAY output_buf,
452
               JDIMENSION output_col)
453
0
{
454
0
  JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;
455
0
  JLONG z1, z2, z3;
456
0
  JCOEFPTR inptr;
457
0
  ISLOW_MULT_TYPE *quantptr;
458
0
  int *wsptr;
459
0
  _JSAMPROW outptr;
460
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
461
0
  int ctr;
462
0
  int workspace[7 * 7];         /* buffers data between passes */
463
  SHIFT_TEMPS
464
0
  SCALING_FACTOR
465
466
  /* Pass 1: process columns from input, store into work array. */
467
468
0
  inptr = coef_block;
469
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
470
0
  wsptr = workspace;
471
0
  for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {
472
    /* Even part */
473
474
0
    tmp13 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
475
0
    tmp13 = LEFT_SHIFT(tmp13, CONST_BITS);
476
    /* Add fudge factor here for final descale. */
477
0
    tmp13 += ONE << (CONST_BITS - PASS1_BITS - 1);
478
479
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
480
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
481
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
482
483
0
    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */
484
0
    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */
485
0
    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */
486
0
    tmp0 = z1 + z3;
487
0
    z2 -= tmp0;
488
0
    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */
489
0
    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */
490
0
    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */
491
0
    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */
492
493
    /* Odd part */
494
495
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
496
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
497
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
498
499
0
    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */
500
0
    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */
501
0
    tmp0 = tmp1 - tmp2;
502
0
    tmp1 += tmp2;
503
0
    tmp2 = MULTIPLY(z2 + z3, -FIX(1.378756276));     /* -c1 */
504
0
    tmp1 += tmp2;
505
0
    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */
506
0
    tmp0 += z2;
507
0
    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */
508
509
    /* Final output stage */
510
511
0
    wsptr[7 * 0] = (int)RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS - PASS1_BITS);
512
0
    wsptr[7 * 6] = (int)RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS - PASS1_BITS);
513
0
    wsptr[7 * 1] = (int)RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS - PASS1_BITS);
514
0
    wsptr[7 * 5] = (int)RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS - PASS1_BITS);
515
0
    wsptr[7 * 2] = (int)RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS - PASS1_BITS);
516
0
    wsptr[7 * 4] = (int)RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS - PASS1_BITS);
517
0
    wsptr[7 * 3] = (int)RIGHT_SHIFT(tmp13, CONST_BITS - PASS1_BITS);
518
0
  }
519
520
  /* Pass 2: process 7 rows from work array, store into output array. */
521
522
0
  wsptr = workspace;
523
0
  for (ctr = 0; ctr < 7; ctr++) {
524
0
    outptr = output_buf[ctr] + output_col;
525
526
    /* Even part */
527
528
    /* Add fudge factor here for final descale. */
529
0
    tmp13 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
530
0
    tmp13 = LEFT_SHIFT(tmp13, CONST_BITS);
531
532
0
    z1 = (JLONG)wsptr[2];
533
0
    z2 = (JLONG)wsptr[4];
534
0
    z3 = (JLONG)wsptr[6];
535
536
0
    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */
537
0
    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */
538
0
    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */
539
0
    tmp0 = z1 + z3;
540
0
    z2 -= tmp0;
541
0
    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */
542
0
    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */
543
0
    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */
544
0
    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */
545
546
    /* Odd part */
547
548
0
    z1 = (JLONG)wsptr[1];
549
0
    z2 = (JLONG)wsptr[3];
550
0
    z3 = (JLONG)wsptr[5];
551
552
0
    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */
553
0
    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */
554
0
    tmp0 = tmp1 - tmp2;
555
0
    tmp1 += tmp2;
556
0
    tmp2 = MULTIPLY(z2 + z3, -FIX(1.378756276));     /* -c1 */
557
0
    tmp1 += tmp2;
558
0
    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */
559
0
    tmp0 += z2;
560
0
    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */
561
562
    /* Final output stage */
563
564
0
    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
565
0
                                             CONST_BITS + PASS1_BITS + 3) &
566
0
                            RANGE_MASK];
567
0
    outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
568
0
                                             CONST_BITS + PASS1_BITS + 3) &
569
0
                            RANGE_MASK];
570
0
    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
571
0
                                             CONST_BITS + PASS1_BITS + 3) &
572
0
                            RANGE_MASK];
573
0
    outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
574
0
                                             CONST_BITS + PASS1_BITS + 3) &
575
0
                            RANGE_MASK];
576
0
    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
577
0
                                             CONST_BITS + PASS1_BITS + 3) &
578
0
                            RANGE_MASK];
579
0
    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
580
0
                                             CONST_BITS + PASS1_BITS + 3) &
581
0
                            RANGE_MASK];
582
0
    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp13,
583
0
                                             CONST_BITS + PASS1_BITS + 3) &
584
0
                            RANGE_MASK];
585
586
0
    wsptr += 7;         /* advance pointer to next row */
587
0
  }
588
0
}
Unexecuted instantiation: jpeg_idct_7x7
Unexecuted instantiation: jpeg12_idct_7x7
589
590
591
/*
592
 * Perform dequantization and inverse DCT on one block of coefficients,
593
 * producing a reduced-size 6x6 output block.
594
 *
595
 * Optimized algorithm with 3 multiplications in the 1-D kernel.
596
 * cK represents sqrt(2) * cos(K*pi/12).
597
 */
598
599
GLOBAL(void)
600
_jpeg_idct_6x6(j_decompress_ptr cinfo, jpeg_component_info *compptr,
601
               JCOEFPTR coef_block, _JSAMPARRAY output_buf,
602
               JDIMENSION output_col)
603
0
{
604
0
  JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
605
0
  JLONG z1, z2, z3;
606
0
  JCOEFPTR inptr;
607
0
  ISLOW_MULT_TYPE *quantptr;
608
0
  int *wsptr;
609
0
  _JSAMPROW outptr;
610
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
611
0
  int ctr;
612
0
  int workspace[6 * 6];         /* buffers data between passes */
613
  SHIFT_TEMPS
614
0
  SCALING_FACTOR
615
616
  /* Pass 1: process columns from input, store into work array. */
617
618
0
  inptr = coef_block;
619
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
620
0
  wsptr = workspace;
621
0
  for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
622
    /* Even part */
623
624
0
    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
625
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
626
    /* Add fudge factor here for final descale. */
627
0
    tmp0 += ONE << (CONST_BITS - PASS1_BITS - 1);
628
0
    tmp2 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
629
0
    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */
630
0
    tmp1 = tmp0 + tmp10;
631
0
    tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS - PASS1_BITS);
632
0
    tmp10 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
633
0
    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */
634
0
    tmp10 = tmp1 + tmp0;
635
0
    tmp12 = tmp1 - tmp0;
636
637
    /* Odd part */
638
639
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
640
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
641
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
642
0
    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
643
0
    tmp0 = tmp1 + LEFT_SHIFT(z1 + z2, CONST_BITS);
644
0
    tmp2 = tmp1 + LEFT_SHIFT(z3 - z2, CONST_BITS);
645
0
    tmp1 = LEFT_SHIFT(z1 - z2 - z3, PASS1_BITS);
646
647
    /* Final output stage */
648
649
0
    wsptr[6 * 0] = (int)RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS - PASS1_BITS);
650
0
    wsptr[6 * 5] = (int)RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS - PASS1_BITS);
651
0
    wsptr[6 * 1] = (int)(tmp11 + tmp1);
652
0
    wsptr[6 * 4] = (int)(tmp11 - tmp1);
653
0
    wsptr[6 * 2] = (int)RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS - PASS1_BITS);
654
0
    wsptr[6 * 3] = (int)RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS - PASS1_BITS);
655
0
  }
656
657
  /* Pass 2: process 6 rows from work array, store into output array. */
658
659
0
  wsptr = workspace;
660
0
  for (ctr = 0; ctr < 6; ctr++) {
661
0
    outptr = output_buf[ctr] + output_col;
662
663
    /* Even part */
664
665
    /* Add fudge factor here for final descale. */
666
0
    tmp0 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
667
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
668
0
    tmp2 = (JLONG)wsptr[4];
669
0
    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */
670
0
    tmp1 = tmp0 + tmp10;
671
0
    tmp11 = tmp0 - tmp10 - tmp10;
672
0
    tmp10 = (JLONG)wsptr[2];
673
0
    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */
674
0
    tmp10 = tmp1 + tmp0;
675
0
    tmp12 = tmp1 - tmp0;
676
677
    /* Odd part */
678
679
0
    z1 = (JLONG)wsptr[1];
680
0
    z2 = (JLONG)wsptr[3];
681
0
    z3 = (JLONG)wsptr[5];
682
0
    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
683
0
    tmp0 = tmp1 + LEFT_SHIFT(z1 + z2, CONST_BITS);
684
0
    tmp2 = tmp1 + LEFT_SHIFT(z3 - z2, CONST_BITS);
685
0
    tmp1 = LEFT_SHIFT(z1 - z2 - z3, CONST_BITS);
686
687
    /* Final output stage */
688
689
0
    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
690
0
                                             CONST_BITS + PASS1_BITS + 3) &
691
0
                            RANGE_MASK];
692
0
    outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
693
0
                                             CONST_BITS + PASS1_BITS + 3) &
694
0
                            RANGE_MASK];
695
0
    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
696
0
                                             CONST_BITS + PASS1_BITS + 3) &
697
0
                            RANGE_MASK];
698
0
    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
699
0
                                             CONST_BITS + PASS1_BITS + 3) &
700
0
                            RANGE_MASK];
701
0
    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
702
0
                                             CONST_BITS + PASS1_BITS + 3) &
703
0
                            RANGE_MASK];
704
0
    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
705
0
                                             CONST_BITS + PASS1_BITS + 3) &
706
0
                            RANGE_MASK];
707
708
0
    wsptr += 6;         /* advance pointer to next row */
709
0
  }
710
0
}
Unexecuted instantiation: jpeg_idct_6x6
Unexecuted instantiation: jpeg12_idct_6x6
711
712
713
/*
714
 * Perform dequantization and inverse DCT on one block of coefficients,
715
 * producing a reduced-size 5x5 output block.
716
 *
717
 * Optimized algorithm with 5 multiplications in the 1-D kernel.
718
 * cK represents sqrt(2) * cos(K*pi/10).
719
 */
720
721
GLOBAL(void)
722
_jpeg_idct_5x5(j_decompress_ptr cinfo, jpeg_component_info *compptr,
723
               JCOEFPTR coef_block, _JSAMPARRAY output_buf,
724
               JDIMENSION output_col)
725
0
{
726
0
  JLONG tmp0, tmp1, tmp10, tmp11, tmp12;
727
0
  JLONG z1, z2, z3;
728
0
  JCOEFPTR inptr;
729
0
  ISLOW_MULT_TYPE *quantptr;
730
0
  int *wsptr;
731
0
  _JSAMPROW outptr;
732
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
733
0
  int ctr;
734
0
  int workspace[5 * 5];         /* buffers data between passes */
735
  SHIFT_TEMPS
736
0
  SCALING_FACTOR
737
738
  /* Pass 1: process columns from input, store into work array. */
739
740
0
  inptr = coef_block;
741
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
742
0
  wsptr = workspace;
743
0
  for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {
744
    /* Even part */
745
746
0
    tmp12 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
747
0
    tmp12 = LEFT_SHIFT(tmp12, CONST_BITS);
748
    /* Add fudge factor here for final descale. */
749
0
    tmp12 += ONE << (CONST_BITS - PASS1_BITS - 1);
750
0
    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
751
0
    tmp1 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
752
0
    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */
753
0
    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */
754
0
    z3 = tmp12 + z2;
755
0
    tmp10 = z3 + z1;
756
0
    tmp11 = z3 - z1;
757
0
    tmp12 -= LEFT_SHIFT(z2, 2);
758
759
    /* Odd part */
760
761
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
762
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
763
764
0
    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */
765
0
    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */
766
0
    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */
767
768
    /* Final output stage */
769
770
0
    wsptr[5 * 0] = (int)RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS - PASS1_BITS);
771
0
    wsptr[5 * 4] = (int)RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS - PASS1_BITS);
772
0
    wsptr[5 * 1] = (int)RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS - PASS1_BITS);
773
0
    wsptr[5 * 3] = (int)RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS - PASS1_BITS);
774
0
    wsptr[5 * 2] = (int)RIGHT_SHIFT(tmp12, CONST_BITS - PASS1_BITS);
775
0
  }
776
777
  /* Pass 2: process 5 rows from work array, store into output array. */
778
779
0
  wsptr = workspace;
780
0
  for (ctr = 0; ctr < 5; ctr++) {
781
0
    outptr = output_buf[ctr] + output_col;
782
783
    /* Even part */
784
785
    /* Add fudge factor here for final descale. */
786
0
    tmp12 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
787
0
    tmp12 = LEFT_SHIFT(tmp12, CONST_BITS);
788
0
    tmp0 = (JLONG)wsptr[2];
789
0
    tmp1 = (JLONG)wsptr[4];
790
0
    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */
791
0
    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */
792
0
    z3 = tmp12 + z2;
793
0
    tmp10 = z3 + z1;
794
0
    tmp11 = z3 - z1;
795
0
    tmp12 -= LEFT_SHIFT(z2, 2);
796
797
    /* Odd part */
798
799
0
    z2 = (JLONG)wsptr[1];
800
0
    z3 = (JLONG)wsptr[3];
801
802
0
    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */
803
0
    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */
804
0
    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */
805
806
    /* Final output stage */
807
808
0
    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
809
0
                                             CONST_BITS + PASS1_BITS + 3) &
810
0
                            RANGE_MASK];
811
0
    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
812
0
                                             CONST_BITS + PASS1_BITS + 3) &
813
0
                            RANGE_MASK];
814
0
    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
815
0
                                             CONST_BITS + PASS1_BITS + 3) &
816
0
                            RANGE_MASK];
817
0
    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
818
0
                                             CONST_BITS + PASS1_BITS + 3) &
819
0
                            RANGE_MASK];
820
0
    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12,
821
0
                                             CONST_BITS + PASS1_BITS + 3) &
822
0
                            RANGE_MASK];
823
824
0
    wsptr += 5;         /* advance pointer to next row */
825
0
  }
826
0
}
Unexecuted instantiation: jpeg_idct_5x5
Unexecuted instantiation: jpeg12_idct_5x5
827
828
829
/*
830
 * Perform dequantization and inverse DCT on one block of coefficients,
831
 * producing a reduced-size 3x3 output block.
832
 *
833
 * Optimized algorithm with 2 multiplications in the 1-D kernel.
834
 * cK represents sqrt(2) * cos(K*pi/6).
835
 */
836
837
GLOBAL(void)
838
_jpeg_idct_3x3(j_decompress_ptr cinfo, jpeg_component_info *compptr,
839
               JCOEFPTR coef_block, _JSAMPARRAY output_buf,
840
               JDIMENSION output_col)
841
0
{
842
0
  JLONG tmp0, tmp2, tmp10, tmp12;
843
0
  JCOEFPTR inptr;
844
0
  ISLOW_MULT_TYPE *quantptr;
845
0
  int *wsptr;
846
0
  _JSAMPROW outptr;
847
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
848
0
  int ctr;
849
0
  int workspace[3 * 3];         /* buffers data between passes */
850
  SHIFT_TEMPS
851
0
  SCALING_FACTOR
852
853
  /* Pass 1: process columns from input, store into work array. */
854
855
0
  inptr = coef_block;
856
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
857
0
  wsptr = workspace;
858
0
  for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {
859
    /* Even part */
860
861
0
    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
862
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
863
    /* Add fudge factor here for final descale. */
864
0
    tmp0 += ONE << (CONST_BITS - PASS1_BITS - 1);
865
0
    tmp2 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
866
0
    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
867
0
    tmp10 = tmp0 + tmp12;
868
0
    tmp2 = tmp0 - tmp12 - tmp12;
869
870
    /* Odd part */
871
872
0
    tmp12 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
873
0
    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */
874
875
    /* Final output stage */
876
877
0
    wsptr[3 * 0] = (int)RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS - PASS1_BITS);
878
0
    wsptr[3 * 2] = (int)RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS - PASS1_BITS);
879
0
    wsptr[3 * 1] = (int)RIGHT_SHIFT(tmp2, CONST_BITS - PASS1_BITS);
880
0
  }
881
882
  /* Pass 2: process 3 rows from work array, store into output array. */
883
884
0
  wsptr = workspace;
885
0
  for (ctr = 0; ctr < 3; ctr++) {
886
0
    outptr = output_buf[ctr] + output_col;
887
888
    /* Even part */
889
890
    /* Add fudge factor here for final descale. */
891
0
    tmp0 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
892
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
893
0
    tmp2 = (JLONG)wsptr[2];
894
0
    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
895
0
    tmp10 = tmp0 + tmp12;
896
0
    tmp2 = tmp0 - tmp12 - tmp12;
897
898
    /* Odd part */
899
900
0
    tmp12 = (JLONG)wsptr[1];
901
0
    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */
902
903
    /* Final output stage */
904
905
0
    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
906
0
                                             CONST_BITS + PASS1_BITS + 3) &
907
0
                            RANGE_MASK];
908
0
    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
909
0
                                             CONST_BITS + PASS1_BITS + 3) &
910
0
                            RANGE_MASK];
911
0
    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp2,
912
0
                                             CONST_BITS + PASS1_BITS + 3) &
913
0
                            RANGE_MASK];
914
915
0
    wsptr += 3;         /* advance pointer to next row */
916
0
  }
917
0
}
Unexecuted instantiation: jpeg_idct_3x3
Unexecuted instantiation: jpeg12_idct_3x3
918
919
920
/*
921
 * Perform dequantization and inverse DCT on one block of coefficients,
922
 * producing a 9x9 output block.
923
 *
924
 * Optimized algorithm with 10 multiplications in the 1-D kernel.
925
 * cK represents sqrt(2) * cos(K*pi/18).
926
 */
927
928
GLOBAL(void)
929
_jpeg_idct_9x9(j_decompress_ptr cinfo, jpeg_component_info *compptr,
930
               JCOEFPTR coef_block, _JSAMPARRAY output_buf,
931
               JDIMENSION output_col)
932
0
{
933
0
  JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;
934
0
  JLONG z1, z2, z3, z4;
935
0
  JCOEFPTR inptr;
936
0
  ISLOW_MULT_TYPE *quantptr;
937
0
  int *wsptr;
938
0
  _JSAMPROW outptr;
939
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
940
0
  int ctr;
941
0
  int workspace[8 * 9];         /* buffers data between passes */
942
  SHIFT_TEMPS
943
0
  SCALING_FACTOR
944
945
  /* Pass 1: process columns from input, store into work array. */
946
947
0
  inptr = coef_block;
948
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
949
0
  wsptr = workspace;
950
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
951
    /* Even part */
952
953
0
    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
954
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
955
    /* Add fudge factor here for final descale. */
956
0
    tmp0 += ONE << (CONST_BITS - PASS1_BITS - 1);
957
958
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
959
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
960
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
961
962
0
    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */
963
0
    tmp1 = tmp0 + tmp3;
964
0
    tmp2 = tmp0 - tmp3 - tmp3;
965
966
0
    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */
967
0
    tmp11 = tmp2 + tmp0;
968
0
    tmp14 = tmp2 - tmp0 - tmp0;
969
970
0
    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */
971
0
    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */
972
0
    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */
973
974
0
    tmp10 = tmp1 + tmp0 - tmp3;
975
0
    tmp12 = tmp1 - tmp0 + tmp2;
976
0
    tmp13 = tmp1 - tmp2 + tmp3;
977
978
    /* Odd part */
979
980
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
981
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
982
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
983
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
984
985
0
    z2 = MULTIPLY(z2, -FIX(1.224744871));            /* -c3 */
986
987
0
    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */
988
0
    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */
989
0
    tmp0 = tmp2 + tmp3 - z2;
990
0
    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */
991
0
    tmp2 += z2 - tmp1;
992
0
    tmp3 += z2 + tmp1;
993
0
    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */
994
995
    /* Final output stage */
996
997
0
    wsptr[8 * 0] = (int)RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS - PASS1_BITS);
998
0
    wsptr[8 * 8] = (int)RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS - PASS1_BITS);
999
0
    wsptr[8 * 1] = (int)RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS - PASS1_BITS);
1000
0
    wsptr[8 * 7] = (int)RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS - PASS1_BITS);
1001
0
    wsptr[8 * 2] = (int)RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS - PASS1_BITS);
1002
0
    wsptr[8 * 6] = (int)RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS - PASS1_BITS);
1003
0
    wsptr[8 * 3] = (int)RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS - PASS1_BITS);
1004
0
    wsptr[8 * 5] = (int)RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS - PASS1_BITS);
1005
0
    wsptr[8 * 4] = (int)RIGHT_SHIFT(tmp14, CONST_BITS - PASS1_BITS);
1006
0
  }
1007
1008
  /* Pass 2: process 9 rows from work array, store into output array. */
1009
1010
0
  wsptr = workspace;
1011
0
  for (ctr = 0; ctr < 9; ctr++) {
1012
0
    outptr = output_buf[ctr] + output_col;
1013
1014
    /* Even part */
1015
1016
    /* Add fudge factor here for final descale. */
1017
0
    tmp0 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
1018
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
1019
1020
0
    z1 = (JLONG)wsptr[2];
1021
0
    z2 = (JLONG)wsptr[4];
1022
0
    z3 = (JLONG)wsptr[6];
1023
1024
0
    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */
1025
0
    tmp1 = tmp0 + tmp3;
1026
0
    tmp2 = tmp0 - tmp3 - tmp3;
1027
1028
0
    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */
1029
0
    tmp11 = tmp2 + tmp0;
1030
0
    tmp14 = tmp2 - tmp0 - tmp0;
1031
1032
0
    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */
1033
0
    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */
1034
0
    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */
1035
1036
0
    tmp10 = tmp1 + tmp0 - tmp3;
1037
0
    tmp12 = tmp1 - tmp0 + tmp2;
1038
0
    tmp13 = tmp1 - tmp2 + tmp3;
1039
1040
    /* Odd part */
1041
1042
0
    z1 = (JLONG)wsptr[1];
1043
0
    z2 = (JLONG)wsptr[3];
1044
0
    z3 = (JLONG)wsptr[5];
1045
0
    z4 = (JLONG)wsptr[7];
1046
1047
0
    z2 = MULTIPLY(z2, -FIX(1.224744871));            /* -c3 */
1048
1049
0
    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */
1050
0
    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */
1051
0
    tmp0 = tmp2 + tmp3 - z2;
1052
0
    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */
1053
0
    tmp2 += z2 - tmp1;
1054
0
    tmp3 += z2 + tmp1;
1055
0
    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */
1056
1057
    /* Final output stage */
1058
1059
0
    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
1060
0
                                             CONST_BITS + PASS1_BITS + 3) &
1061
0
                            RANGE_MASK];
1062
0
    outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
1063
0
                                             CONST_BITS + PASS1_BITS + 3) &
1064
0
                            RANGE_MASK];
1065
0
    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
1066
0
                                             CONST_BITS + PASS1_BITS + 3) &
1067
0
                            RANGE_MASK];
1068
0
    outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
1069
0
                                             CONST_BITS + PASS1_BITS + 3) &
1070
0
                            RANGE_MASK];
1071
0
    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
1072
0
                                             CONST_BITS + PASS1_BITS + 3) &
1073
0
                            RANGE_MASK];
1074
0
    outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
1075
0
                                             CONST_BITS + PASS1_BITS + 3) &
1076
0
                            RANGE_MASK];
1077
0
    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp13 + tmp3,
1078
0
                                             CONST_BITS + PASS1_BITS + 3) &
1079
0
                            RANGE_MASK];
1080
0
    outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp13 - tmp3,
1081
0
                                             CONST_BITS + PASS1_BITS + 3) &
1082
0
                            RANGE_MASK];
1083
0
    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp14,
1084
0
                                             CONST_BITS + PASS1_BITS + 3) &
1085
0
                            RANGE_MASK];
1086
1087
0
    wsptr += 8;         /* advance pointer to next row */
1088
0
  }
1089
0
}
Unexecuted instantiation: jpeg_idct_9x9
Unexecuted instantiation: jpeg12_idct_9x9
1090
1091
1092
/*
1093
 * Perform dequantization and inverse DCT on one block of coefficients,
1094
 * producing a 10x10 output block.
1095
 *
1096
 * Optimized algorithm with 12 multiplications in the 1-D kernel.
1097
 * cK represents sqrt(2) * cos(K*pi/20).
1098
 */
1099
1100
GLOBAL(void)
1101
_jpeg_idct_10x10(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1102
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
1103
                 JDIMENSION output_col)
1104
0
{
1105
0
  JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
1106
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24;
1107
0
  JLONG z1, z2, z3, z4, z5;
1108
0
  JCOEFPTR inptr;
1109
0
  ISLOW_MULT_TYPE *quantptr;
1110
0
  int *wsptr;
1111
0
  _JSAMPROW outptr;
1112
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1113
0
  int ctr;
1114
0
  int workspace[8 * 10];        /* buffers data between passes */
1115
  SHIFT_TEMPS
1116
0
  SCALING_FACTOR
1117
1118
  /* Pass 1: process columns from input, store into work array. */
1119
1120
0
  inptr = coef_block;
1121
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
1122
0
  wsptr = workspace;
1123
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1124
    /* Even part */
1125
1126
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
1127
0
    z3 = LEFT_SHIFT(z3, CONST_BITS);
1128
    /* Add fudge factor here for final descale. */
1129
0
    z3 += ONE << (CONST_BITS - PASS1_BITS - 1);
1130
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
1131
0
    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */
1132
0
    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */
1133
0
    tmp10 = z3 + z1;
1134
0
    tmp11 = z3 - z2;
1135
1136
0
    tmp22 = RIGHT_SHIFT(z3 - LEFT_SHIFT(z1 - z2, 1),
1137
0
                        CONST_BITS - PASS1_BITS); /* c0 = (c4-c8)*2 */
1138
1139
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
1140
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
1141
1142
0
    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */
1143
0
    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
1144
0
    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
1145
1146
0
    tmp20 = tmp10 + tmp12;
1147
0
    tmp24 = tmp10 - tmp12;
1148
0
    tmp21 = tmp11 + tmp13;
1149
0
    tmp23 = tmp11 - tmp13;
1150
1151
    /* Odd part */
1152
1153
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
1154
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
1155
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
1156
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
1157
1158
0
    tmp11 = z2 + z4;
1159
0
    tmp13 = z2 - z4;
1160
1161
0
    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */
1162
0
    z5 = LEFT_SHIFT(z3, CONST_BITS);
1163
1164
0
    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */
1165
0
    z4 = z5 + tmp12;
1166
1167
0
    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
1168
0
    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
1169
1170
0
    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */
1171
0
    z4 = z5 - tmp12 - LEFT_SHIFT(tmp13, CONST_BITS - 1);
1172
1173
0
    tmp12 = LEFT_SHIFT(z1 - tmp13 - z3, PASS1_BITS);
1174
1175
0
    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
1176
0
    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
1177
1178
    /* Final output stage */
1179
1180
0
    wsptr[8 * 0] = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
1181
0
    wsptr[8 * 9] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
1182
0
    wsptr[8 * 1] = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
1183
0
    wsptr[8 * 8] = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
1184
0
    wsptr[8 * 2] = (int)(tmp22 + tmp12);
1185
0
    wsptr[8 * 7] = (int)(tmp22 - tmp12);
1186
0
    wsptr[8 * 3] = (int)RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS - PASS1_BITS);
1187
0
    wsptr[8 * 6] = (int)RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS - PASS1_BITS);
1188
0
    wsptr[8 * 4] = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
1189
0
    wsptr[8 * 5] = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
1190
0
  }
1191
1192
  /* Pass 2: process 10 rows from work array, store into output array. */
1193
1194
0
  wsptr = workspace;
1195
0
  for (ctr = 0; ctr < 10; ctr++) {
1196
0
    outptr = output_buf[ctr] + output_col;
1197
1198
    /* Even part */
1199
1200
    /* Add fudge factor here for final descale. */
1201
0
    z3 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
1202
0
    z3 = LEFT_SHIFT(z3, CONST_BITS);
1203
0
    z4 = (JLONG)wsptr[4];
1204
0
    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */
1205
0
    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */
1206
0
    tmp10 = z3 + z1;
1207
0
    tmp11 = z3 - z2;
1208
1209
0
    tmp22 = z3 - LEFT_SHIFT(z1 - z2, 1);         /* c0 = (c4-c8)*2 */
1210
1211
0
    z2 = (JLONG)wsptr[2];
1212
0
    z3 = (JLONG)wsptr[6];
1213
1214
0
    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */
1215
0
    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
1216
0
    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
1217
1218
0
    tmp20 = tmp10 + tmp12;
1219
0
    tmp24 = tmp10 - tmp12;
1220
0
    tmp21 = tmp11 + tmp13;
1221
0
    tmp23 = tmp11 - tmp13;
1222
1223
    /* Odd part */
1224
1225
0
    z1 = (JLONG)wsptr[1];
1226
0
    z2 = (JLONG)wsptr[3];
1227
0
    z3 = (JLONG)wsptr[5];
1228
0
    z3 = LEFT_SHIFT(z3, CONST_BITS);
1229
0
    z4 = (JLONG)wsptr[7];
1230
1231
0
    tmp11 = z2 + z4;
1232
0
    tmp13 = z2 - z4;
1233
1234
0
    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */
1235
1236
0
    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */
1237
0
    z4 = z3 + tmp12;
1238
1239
0
    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
1240
0
    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
1241
1242
0
    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */
1243
0
    z4 = z3 - tmp12 - LEFT_SHIFT(tmp13, CONST_BITS - 1);
1244
1245
0
    tmp12 = LEFT_SHIFT(z1 - tmp13, CONST_BITS) - z3;
1246
1247
0
    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
1248
0
    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
1249
1250
    /* Final output stage */
1251
1252
0
    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
1253
0
                                             CONST_BITS + PASS1_BITS + 3) &
1254
0
                            RANGE_MASK];
1255
0
    outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
1256
0
                                             CONST_BITS + PASS1_BITS + 3) &
1257
0
                            RANGE_MASK];
1258
0
    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
1259
0
                                             CONST_BITS + PASS1_BITS + 3) &
1260
0
                            RANGE_MASK];
1261
0
    outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
1262
0
                                             CONST_BITS + PASS1_BITS + 3) &
1263
0
                            RANGE_MASK];
1264
0
    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
1265
0
                                             CONST_BITS + PASS1_BITS + 3) &
1266
0
                            RANGE_MASK];
1267
0
    outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
1268
0
                                             CONST_BITS + PASS1_BITS + 3) &
1269
0
                            RANGE_MASK];
1270
0
    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
1271
0
                                             CONST_BITS + PASS1_BITS + 3) &
1272
0
                            RANGE_MASK];
1273
0
    outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
1274
0
                                             CONST_BITS + PASS1_BITS + 3) &
1275
0
                            RANGE_MASK];
1276
0
    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
1277
0
                                             CONST_BITS + PASS1_BITS + 3) &
1278
0
                            RANGE_MASK];
1279
0
    outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
1280
0
                                             CONST_BITS + PASS1_BITS + 3) &
1281
0
                            RANGE_MASK];
1282
1283
0
    wsptr += 8;         /* advance pointer to next row */
1284
0
  }
1285
0
}
Unexecuted instantiation: jpeg_idct_10x10
Unexecuted instantiation: jpeg12_idct_10x10
1286
1287
1288
/*
1289
 * Perform dequantization and inverse DCT on one block of coefficients,
1290
 * producing an 11x11 output block.
1291
 *
1292
 * Optimized algorithm with 24 multiplications in the 1-D kernel.
1293
 * cK represents sqrt(2) * cos(K*pi/22).
1294
 */
1295
1296
GLOBAL(void)
1297
_jpeg_idct_11x11(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1298
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
1299
                 JDIMENSION output_col)
1300
0
{
1301
0
  JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
1302
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
1303
0
  JLONG z1, z2, z3, z4;
1304
0
  JCOEFPTR inptr;
1305
0
  ISLOW_MULT_TYPE *quantptr;
1306
0
  int *wsptr;
1307
0
  _JSAMPROW outptr;
1308
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1309
0
  int ctr;
1310
0
  int workspace[8 * 11];        /* buffers data between passes */
1311
  SHIFT_TEMPS
1312
0
  SCALING_FACTOR
1313
1314
  /* Pass 1: process columns from input, store into work array. */
1315
1316
0
  inptr = coef_block;
1317
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
1318
0
  wsptr = workspace;
1319
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1320
    /* Even part */
1321
1322
0
    tmp10 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
1323
0
    tmp10 = LEFT_SHIFT(tmp10, CONST_BITS);
1324
    /* Add fudge factor here for final descale. */
1325
0
    tmp10 += ONE << (CONST_BITS - PASS1_BITS - 1);
1326
1327
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
1328
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
1329
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
1330
1331
0
    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */
1332
0
    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */
1333
0
    z4 = z1 + z3;
1334
0
    tmp24 = MULTIPLY(z4, -FIX(1.155664402));         /* -(c2-c10) */
1335
0
    z4 -= z2;
1336
0
    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */
1337
0
    tmp21 = tmp20 + tmp23 + tmp25 -
1338
0
            MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */
1339
0
    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */
1340
0
    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */
1341
0
    tmp24 += tmp25;
1342
0
    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */
1343
0
    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */
1344
0
             MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */
1345
0
    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */
1346
1347
    /* Odd part */
1348
1349
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
1350
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
1351
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
1352
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
1353
1354
0
    tmp11 = z1 + z2;
1355
0
    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */
1356
0
    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */
1357
0
    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */
1358
0
    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */
1359
0
    tmp10 = tmp11 + tmp12 + tmp13 -
1360
0
            MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */
1361
0
    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */
1362
0
    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */
1363
0
    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */
1364
0
    z1    = MULTIPLY(z2 + z4, -FIX(1.798248910));        /* -(c1+c9) */
1365
0
    tmp11 += z1;
1366
0
    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */
1367
0
    tmp14 += MULTIPLY(z2, -FIX(1.467221301)) +           /* -(c5+c9) */
1368
0
             MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */
1369
0
             MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */
1370
1371
    /* Final output stage */
1372
1373
0
    wsptr[8 * 0]  = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
1374
0
    wsptr[8 * 10] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
1375
0
    wsptr[8 * 1]  = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
1376
0
    wsptr[8 * 9]  = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
1377
0
    wsptr[8 * 2]  = (int)RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS - PASS1_BITS);
1378
0
    wsptr[8 * 8]  = (int)RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS - PASS1_BITS);
1379
0
    wsptr[8 * 3]  = (int)RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS - PASS1_BITS);
1380
0
    wsptr[8 * 7]  = (int)RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS - PASS1_BITS);
1381
0
    wsptr[8 * 4]  = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
1382
0
    wsptr[8 * 6]  = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
1383
0
    wsptr[8 * 5]  = (int)RIGHT_SHIFT(tmp25, CONST_BITS - PASS1_BITS);
1384
0
  }
1385
1386
  /* Pass 2: process 11 rows from work array, store into output array. */
1387
1388
0
  wsptr = workspace;
1389
0
  for (ctr = 0; ctr < 11; ctr++) {
1390
0
    outptr = output_buf[ctr] + output_col;
1391
1392
    /* Even part */
1393
1394
    /* Add fudge factor here for final descale. */
1395
0
    tmp10 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
1396
0
    tmp10 = LEFT_SHIFT(tmp10, CONST_BITS);
1397
1398
0
    z1 = (JLONG)wsptr[2];
1399
0
    z2 = (JLONG)wsptr[4];
1400
0
    z3 = (JLONG)wsptr[6];
1401
1402
0
    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */
1403
0
    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */
1404
0
    z4 = z1 + z3;
1405
0
    tmp24 = MULTIPLY(z4, -FIX(1.155664402));         /* -(c2-c10) */
1406
0
    z4 -= z2;
1407
0
    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */
1408
0
    tmp21 = tmp20 + tmp23 + tmp25 -
1409
0
            MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */
1410
0
    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */
1411
0
    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */
1412
0
    tmp24 += tmp25;
1413
0
    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */
1414
0
    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */
1415
0
             MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */
1416
0
    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */
1417
1418
    /* Odd part */
1419
1420
0
    z1 = (JLONG)wsptr[1];
1421
0
    z2 = (JLONG)wsptr[3];
1422
0
    z3 = (JLONG)wsptr[5];
1423
0
    z4 = (JLONG)wsptr[7];
1424
1425
0
    tmp11 = z1 + z2;
1426
0
    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */
1427
0
    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */
1428
0
    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */
1429
0
    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */
1430
0
    tmp10 = tmp11 + tmp12 + tmp13 -
1431
0
            MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */
1432
0
    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */
1433
0
    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */
1434
0
    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */
1435
0
    z1    = MULTIPLY(z2 + z4, -FIX(1.798248910));        /* -(c1+c9) */
1436
0
    tmp11 += z1;
1437
0
    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */
1438
0
    tmp14 += MULTIPLY(z2, -FIX(1.467221301)) +           /* -(c5+c9) */
1439
0
             MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */
1440
0
             MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */
1441
1442
    /* Final output stage */
1443
1444
0
    outptr[0]  = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
1445
0
                                              CONST_BITS + PASS1_BITS + 3) &
1446
0
                             RANGE_MASK];
1447
0
    outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
1448
0
                                              CONST_BITS + PASS1_BITS + 3) &
1449
0
                             RANGE_MASK];
1450
0
    outptr[1]  = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
1451
0
                                              CONST_BITS + PASS1_BITS + 3) &
1452
0
                             RANGE_MASK];
1453
0
    outptr[9]  = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
1454
0
                                              CONST_BITS + PASS1_BITS + 3) &
1455
0
                             RANGE_MASK];
1456
0
    outptr[2]  = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
1457
0
                                              CONST_BITS + PASS1_BITS + 3) &
1458
0
                             RANGE_MASK];
1459
0
    outptr[8]  = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
1460
0
                                              CONST_BITS + PASS1_BITS + 3) &
1461
0
                             RANGE_MASK];
1462
0
    outptr[3]  = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
1463
0
                                              CONST_BITS + PASS1_BITS + 3) &
1464
0
                             RANGE_MASK];
1465
0
    outptr[7]  = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
1466
0
                                              CONST_BITS + PASS1_BITS + 3) &
1467
0
                             RANGE_MASK];
1468
0
    outptr[4]  = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
1469
0
                                              CONST_BITS + PASS1_BITS + 3) &
1470
0
                             RANGE_MASK];
1471
0
    outptr[6]  = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
1472
0
                                              CONST_BITS + PASS1_BITS + 3) &
1473
0
                             RANGE_MASK];
1474
0
    outptr[5]  = range_limit[(int)RIGHT_SHIFT(tmp25,
1475
0
                                              CONST_BITS + PASS1_BITS + 3) &
1476
0
                             RANGE_MASK];
1477
1478
0
    wsptr += 8;         /* advance pointer to next row */
1479
0
  }
1480
0
}
Unexecuted instantiation: jpeg_idct_11x11
Unexecuted instantiation: jpeg12_idct_11x11
1481
1482
1483
/*
1484
 * Perform dequantization and inverse DCT on one block of coefficients,
1485
 * producing a 12x12 output block.
1486
 *
1487
 * Optimized algorithm with 15 multiplications in the 1-D kernel.
1488
 * cK represents sqrt(2) * cos(K*pi/24).
1489
 */
1490
1491
GLOBAL(void)
1492
_jpeg_idct_12x12(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1493
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
1494
                 JDIMENSION output_col)
1495
0
{
1496
0
  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1497
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
1498
0
  JLONG z1, z2, z3, z4;
1499
0
  JCOEFPTR inptr;
1500
0
  ISLOW_MULT_TYPE *quantptr;
1501
0
  int *wsptr;
1502
0
  _JSAMPROW outptr;
1503
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1504
0
  int ctr;
1505
0
  int workspace[8 * 12];        /* buffers data between passes */
1506
  SHIFT_TEMPS
1507
0
  SCALING_FACTOR
1508
1509
  /* Pass 1: process columns from input, store into work array. */
1510
1511
0
  inptr = coef_block;
1512
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
1513
0
  wsptr = workspace;
1514
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1515
    /* Even part */
1516
1517
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
1518
0
    z3 = LEFT_SHIFT(z3, CONST_BITS);
1519
    /* Add fudge factor here for final descale. */
1520
0
    z3 += ONE << (CONST_BITS - PASS1_BITS - 1);
1521
1522
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
1523
0
    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */
1524
1525
0
    tmp10 = z3 + z4;
1526
0
    tmp11 = z3 - z4;
1527
1528
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
1529
0
    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */
1530
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
1531
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
1532
0
    z2 = LEFT_SHIFT(z2, CONST_BITS);
1533
1534
0
    tmp12 = z1 - z2;
1535
1536
0
    tmp21 = z3 + tmp12;
1537
0
    tmp24 = z3 - tmp12;
1538
1539
0
    tmp12 = z4 + z2;
1540
1541
0
    tmp20 = tmp10 + tmp12;
1542
0
    tmp25 = tmp10 - tmp12;
1543
1544
0
    tmp12 = z4 - z1 - z2;
1545
1546
0
    tmp22 = tmp11 + tmp12;
1547
0
    tmp23 = tmp11 - tmp12;
1548
1549
    /* Odd part */
1550
1551
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
1552
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
1553
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
1554
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
1555
1556
0
    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */
1557
0
    tmp14 = MULTIPLY(z2, -FIX_0_541196100);                  /* -c9 */
1558
1559
0
    tmp10 = z1 + z3;
1560
0
    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */
1561
0
    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */
1562
0
    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */
1563
0
    tmp13 = MULTIPLY(z3 + z4, -FIX(1.045510580));            /* -(c7+c11) */
1564
0
    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */
1565
0
    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */
1566
0
    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */
1567
0
             MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */
1568
1569
0
    z1 -= z4;
1570
0
    z2 -= z3;
1571
0
    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */
1572
0
    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */
1573
0
    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */
1574
1575
    /* Final output stage */
1576
1577
0
    wsptr[8 * 0]  = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
1578
0
    wsptr[8 * 11] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
1579
0
    wsptr[8 * 1]  = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
1580
0
    wsptr[8 * 10] = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
1581
0
    wsptr[8 * 2]  = (int)RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS - PASS1_BITS);
1582
0
    wsptr[8 * 9]  = (int)RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS - PASS1_BITS);
1583
0
    wsptr[8 * 3]  = (int)RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS - PASS1_BITS);
1584
0
    wsptr[8 * 8]  = (int)RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS - PASS1_BITS);
1585
0
    wsptr[8 * 4]  = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
1586
0
    wsptr[8 * 7]  = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
1587
0
    wsptr[8 * 5]  = (int)RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS - PASS1_BITS);
1588
0
    wsptr[8 * 6]  = (int)RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS - PASS1_BITS);
1589
0
  }
1590
1591
  /* Pass 2: process 12 rows from work array, store into output array. */
1592
1593
0
  wsptr = workspace;
1594
0
  for (ctr = 0; ctr < 12; ctr++) {
1595
0
    outptr = output_buf[ctr] + output_col;
1596
1597
    /* Even part */
1598
1599
    /* Add fudge factor here for final descale. */
1600
0
    z3 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
1601
0
    z3 = LEFT_SHIFT(z3, CONST_BITS);
1602
1603
0
    z4 = (JLONG)wsptr[4];
1604
0
    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */
1605
1606
0
    tmp10 = z3 + z4;
1607
0
    tmp11 = z3 - z4;
1608
1609
0
    z1 = (JLONG)wsptr[2];
1610
0
    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */
1611
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
1612
0
    z2 = (JLONG)wsptr[6];
1613
0
    z2 = LEFT_SHIFT(z2, CONST_BITS);
1614
1615
0
    tmp12 = z1 - z2;
1616
1617
0
    tmp21 = z3 + tmp12;
1618
0
    tmp24 = z3 - tmp12;
1619
1620
0
    tmp12 = z4 + z2;
1621
1622
0
    tmp20 = tmp10 + tmp12;
1623
0
    tmp25 = tmp10 - tmp12;
1624
1625
0
    tmp12 = z4 - z1 - z2;
1626
1627
0
    tmp22 = tmp11 + tmp12;
1628
0
    tmp23 = tmp11 - tmp12;
1629
1630
    /* Odd part */
1631
1632
0
    z1 = (JLONG)wsptr[1];
1633
0
    z2 = (JLONG)wsptr[3];
1634
0
    z3 = (JLONG)wsptr[5];
1635
0
    z4 = (JLONG)wsptr[7];
1636
1637
0
    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */
1638
0
    tmp14 = MULTIPLY(z2, -FIX_0_541196100);                  /* -c9 */
1639
1640
0
    tmp10 = z1 + z3;
1641
0
    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */
1642
0
    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */
1643
0
    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */
1644
0
    tmp13 = MULTIPLY(z3 + z4, -FIX(1.045510580));            /* -(c7+c11) */
1645
0
    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */
1646
0
    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */
1647
0
    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */
1648
0
             MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */
1649
1650
0
    z1 -= z4;
1651
0
    z2 -= z3;
1652
0
    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */
1653
0
    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */
1654
0
    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */
1655
1656
    /* Final output stage */
1657
1658
0
    outptr[0]  = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
1659
0
                                              CONST_BITS + PASS1_BITS + 3) &
1660
0
                             RANGE_MASK];
1661
0
    outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
1662
0
                                              CONST_BITS + PASS1_BITS + 3) &
1663
0
                             RANGE_MASK];
1664
0
    outptr[1]  = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
1665
0
                                              CONST_BITS + PASS1_BITS + 3) &
1666
0
                             RANGE_MASK];
1667
0
    outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
1668
0
                                              CONST_BITS + PASS1_BITS + 3) &
1669
0
                             RANGE_MASK];
1670
0
    outptr[2]  = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
1671
0
                                              CONST_BITS + PASS1_BITS + 3) &
1672
0
                             RANGE_MASK];
1673
0
    outptr[9]  = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
1674
0
                                              CONST_BITS + PASS1_BITS + 3) &
1675
0
                             RANGE_MASK];
1676
0
    outptr[3]  = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
1677
0
                                              CONST_BITS + PASS1_BITS + 3) &
1678
0
                             RANGE_MASK];
1679
0
    outptr[8]  = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
1680
0
                                              CONST_BITS + PASS1_BITS + 3) &
1681
0
                             RANGE_MASK];
1682
0
    outptr[4]  = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
1683
0
                                              CONST_BITS + PASS1_BITS + 3) &
1684
0
                             RANGE_MASK];
1685
0
    outptr[7]  = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
1686
0
                                              CONST_BITS + PASS1_BITS + 3) &
1687
0
                             RANGE_MASK];
1688
0
    outptr[5]  = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
1689
0
                                              CONST_BITS + PASS1_BITS + 3) &
1690
0
                             RANGE_MASK];
1691
0
    outptr[6]  = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
1692
0
                                              CONST_BITS + PASS1_BITS + 3) &
1693
0
                             RANGE_MASK];
1694
1695
0
    wsptr += 8;         /* advance pointer to next row */
1696
0
  }
1697
0
}
Unexecuted instantiation: jpeg_idct_12x12
Unexecuted instantiation: jpeg12_idct_12x12
1698
1699
1700
/*
1701
 * Perform dequantization and inverse DCT on one block of coefficients,
1702
 * producing a 13x13 output block.
1703
 *
1704
 * Optimized algorithm with 29 multiplications in the 1-D kernel.
1705
 * cK represents sqrt(2) * cos(K*pi/26).
1706
 */
1707
1708
GLOBAL(void)
1709
_jpeg_idct_13x13(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1710
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
1711
                 JDIMENSION output_col)
1712
0
{
1713
0
  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1714
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
1715
0
  JLONG z1, z2, z3, z4;
1716
0
  JCOEFPTR inptr;
1717
0
  ISLOW_MULT_TYPE *quantptr;
1718
0
  int *wsptr;
1719
0
  _JSAMPROW outptr;
1720
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1721
0
  int ctr;
1722
0
  int workspace[8 * 13];        /* buffers data between passes */
1723
  SHIFT_TEMPS
1724
0
  SCALING_FACTOR
1725
1726
  /* Pass 1: process columns from input, store into work array. */
1727
1728
0
  inptr = coef_block;
1729
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
1730
0
  wsptr = workspace;
1731
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1732
    /* Even part */
1733
1734
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
1735
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
1736
    /* Add fudge factor here for final descale. */
1737
0
    z1 += ONE << (CONST_BITS - PASS1_BITS - 1);
1738
1739
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
1740
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
1741
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
1742
1743
0
    tmp10 = z3 + z4;
1744
0
    tmp11 = z3 - z4;
1745
1746
0
    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */
1747
0
    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */
1748
1749
0
    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */
1750
0
    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */
1751
1752
0
    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */
1753
0
    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */
1754
1755
0
    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */
1756
0
    tmp25 = MULTIPLY(z2, -FIX(1.252223920)) + tmp12 + tmp13;  /* c4 */
1757
1758
0
    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */
1759
0
    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */
1760
1761
0
    tmp23 = MULTIPLY(z2, -FIX(0.170464608)) - tmp12 - tmp13;  /* c12 */
1762
0
    tmp24 = MULTIPLY(z2, -FIX(0.803364869)) + tmp12 - tmp13;  /* c8 */
1763
1764
0
    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */
1765
1766
    /* Odd part */
1767
1768
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
1769
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
1770
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
1771
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
1772
1773
0
    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */
1774
0
    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */
1775
0
    tmp15 = z1 + z4;
1776
0
    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */
1777
0
    tmp10 = tmp11 + tmp12 + tmp13 -
1778
0
            MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */
1779
0
    tmp14 = MULTIPLY(z2 + z3, -FIX(0.338443458));    /* -c11 */
1780
0
    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */
1781
0
    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */
1782
0
    tmp14 = MULTIPLY(z2 + z4, -FIX(1.163874945));    /* -c5 */
1783
0
    tmp11 += tmp14;
1784
0
    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */
1785
0
    tmp14 = MULTIPLY(z3 + z4, -FIX(0.657217813));    /* -c9 */
1786
0
    tmp12 += tmp14;
1787
0
    tmp13 += tmp14;
1788
0
    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */
1789
0
    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */
1790
0
            MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */
1791
0
    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */
1792
0
    tmp14 += z1;
1793
0
    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */
1794
0
             MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */
1795
1796
    /* Final output stage */
1797
1798
0
    wsptr[8 * 0]  = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
1799
0
    wsptr[8 * 12] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
1800
0
    wsptr[8 * 1]  = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
1801
0
    wsptr[8 * 11] = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
1802
0
    wsptr[8 * 2]  = (int)RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS - PASS1_BITS);
1803
0
    wsptr[8 * 10] = (int)RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS - PASS1_BITS);
1804
0
    wsptr[8 * 3]  = (int)RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS - PASS1_BITS);
1805
0
    wsptr[8 * 9]  = (int)RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS - PASS1_BITS);
1806
0
    wsptr[8 * 4]  = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
1807
0
    wsptr[8 * 8]  = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
1808
0
    wsptr[8 * 5]  = (int)RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS - PASS1_BITS);
1809
0
    wsptr[8 * 7]  = (int)RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS - PASS1_BITS);
1810
0
    wsptr[8 * 6]  = (int)RIGHT_SHIFT(tmp26, CONST_BITS - PASS1_BITS);
1811
0
  }
1812
1813
  /* Pass 2: process 13 rows from work array, store into output array. */
1814
1815
0
  wsptr = workspace;
1816
0
  for (ctr = 0; ctr < 13; ctr++) {
1817
0
    outptr = output_buf[ctr] + output_col;
1818
1819
    /* Even part */
1820
1821
    /* Add fudge factor here for final descale. */
1822
0
    z1 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
1823
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
1824
1825
0
    z2 = (JLONG)wsptr[2];
1826
0
    z3 = (JLONG)wsptr[4];
1827
0
    z4 = (JLONG)wsptr[6];
1828
1829
0
    tmp10 = z3 + z4;
1830
0
    tmp11 = z3 - z4;
1831
1832
0
    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */
1833
0
    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */
1834
1835
0
    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */
1836
0
    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */
1837
1838
0
    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */
1839
0
    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */
1840
1841
0
    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */
1842
0
    tmp25 = MULTIPLY(z2, -FIX(1.252223920)) + tmp12 + tmp13;  /* c4 */
1843
1844
0
    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */
1845
0
    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */
1846
1847
0
    tmp23 = MULTIPLY(z2, -FIX(0.170464608)) - tmp12 - tmp13;  /* c12 */
1848
0
    tmp24 = MULTIPLY(z2, -FIX(0.803364869)) + tmp12 - tmp13;  /* c8 */
1849
1850
0
    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */
1851
1852
    /* Odd part */
1853
1854
0
    z1 = (JLONG)wsptr[1];
1855
0
    z2 = (JLONG)wsptr[3];
1856
0
    z3 = (JLONG)wsptr[5];
1857
0
    z4 = (JLONG)wsptr[7];
1858
1859
0
    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */
1860
0
    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */
1861
0
    tmp15 = z1 + z4;
1862
0
    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */
1863
0
    tmp10 = tmp11 + tmp12 + tmp13 -
1864
0
            MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */
1865
0
    tmp14 = MULTIPLY(z2 + z3, -FIX(0.338443458));    /* -c11 */
1866
0
    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */
1867
0
    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */
1868
0
    tmp14 = MULTIPLY(z2 + z4, -FIX(1.163874945));    /* -c5 */
1869
0
    tmp11 += tmp14;
1870
0
    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */
1871
0
    tmp14 = MULTIPLY(z3 + z4, -FIX(0.657217813));    /* -c9 */
1872
0
    tmp12 += tmp14;
1873
0
    tmp13 += tmp14;
1874
0
    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */
1875
0
    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */
1876
0
            MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */
1877
0
    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */
1878
0
    tmp14 += z1;
1879
0
    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */
1880
0
             MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */
1881
1882
    /* Final output stage */
1883
1884
0
    outptr[0]  = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
1885
0
                                              CONST_BITS + PASS1_BITS + 3) &
1886
0
                             RANGE_MASK];
1887
0
    outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
1888
0
                                              CONST_BITS + PASS1_BITS + 3) &
1889
0
                             RANGE_MASK];
1890
0
    outptr[1]  = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
1891
0
                                              CONST_BITS + PASS1_BITS + 3) &
1892
0
                             RANGE_MASK];
1893
0
    outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
1894
0
                                              CONST_BITS + PASS1_BITS + 3) &
1895
0
                             RANGE_MASK];
1896
0
    outptr[2]  = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
1897
0
                                              CONST_BITS + PASS1_BITS + 3) &
1898
0
                             RANGE_MASK];
1899
0
    outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
1900
0
                                              CONST_BITS + PASS1_BITS + 3) &
1901
0
                             RANGE_MASK];
1902
0
    outptr[3]  = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
1903
0
                                              CONST_BITS + PASS1_BITS + 3) &
1904
0
                             RANGE_MASK];
1905
0
    outptr[9]  = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
1906
0
                                              CONST_BITS + PASS1_BITS + 3) &
1907
0
                             RANGE_MASK];
1908
0
    outptr[4]  = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
1909
0
                                              CONST_BITS + PASS1_BITS + 3) &
1910
0
                             RANGE_MASK];
1911
0
    outptr[8]  = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
1912
0
                                              CONST_BITS + PASS1_BITS + 3) &
1913
0
                             RANGE_MASK];
1914
0
    outptr[5]  = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
1915
0
                                              CONST_BITS + PASS1_BITS + 3) &
1916
0
                             RANGE_MASK];
1917
0
    outptr[7]  = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
1918
0
                                              CONST_BITS + PASS1_BITS + 3) &
1919
0
                             RANGE_MASK];
1920
0
    outptr[6]  = range_limit[(int)RIGHT_SHIFT(tmp26,
1921
0
                                              CONST_BITS + PASS1_BITS + 3) &
1922
0
                             RANGE_MASK];
1923
1924
0
    wsptr += 8;         /* advance pointer to next row */
1925
0
  }
1926
0
}
Unexecuted instantiation: jpeg_idct_13x13
Unexecuted instantiation: jpeg12_idct_13x13
1927
1928
1929
/*
1930
 * Perform dequantization and inverse DCT on one block of coefficients,
1931
 * producing a 14x14 output block.
1932
 *
1933
 * Optimized algorithm with 20 multiplications in the 1-D kernel.
1934
 * cK represents sqrt(2) * cos(K*pi/28).
1935
 */
1936
1937
GLOBAL(void)
1938
_jpeg_idct_14x14(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1939
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
1940
                 JDIMENSION output_col)
1941
0
{
1942
0
  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
1943
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
1944
0
  JLONG z1, z2, z3, z4;
1945
0
  JCOEFPTR inptr;
1946
0
  ISLOW_MULT_TYPE *quantptr;
1947
0
  int *wsptr;
1948
0
  _JSAMPROW outptr;
1949
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1950
0
  int ctr;
1951
0
  int workspace[8 * 14];        /* buffers data between passes */
1952
  SHIFT_TEMPS
1953
0
  SCALING_FACTOR
1954
1955
  /* Pass 1: process columns from input, store into work array. */
1956
1957
0
  inptr = coef_block;
1958
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
1959
0
  wsptr = workspace;
1960
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1961
    /* Even part */
1962
1963
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
1964
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
1965
    /* Add fudge factor here for final descale. */
1966
0
    z1 += ONE << (CONST_BITS - PASS1_BITS - 1);
1967
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
1968
0
    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */
1969
0
    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */
1970
0
    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */
1971
1972
0
    tmp10 = z1 + z2;
1973
0
    tmp11 = z1 + z3;
1974
0
    tmp12 = z1 - z4;
1975
1976
0
    tmp23 = RIGHT_SHIFT(z1 - LEFT_SHIFT(z2 + z3 - z4, 1),
1977
0
                        CONST_BITS - PASS1_BITS); /* c0 = (c4+c12-c8)*2 */
1978
1979
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
1980
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
1981
1982
0
    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */
1983
1984
0
    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */
1985
0
    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */
1986
0
    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */
1987
0
            MULTIPLY(z2, FIX(1.378756276));      /* c2 */
1988
1989
0
    tmp20 = tmp10 + tmp13;
1990
0
    tmp26 = tmp10 - tmp13;
1991
0
    tmp21 = tmp11 + tmp14;
1992
0
    tmp25 = tmp11 - tmp14;
1993
0
    tmp22 = tmp12 + tmp15;
1994
0
    tmp24 = tmp12 - tmp15;
1995
1996
    /* Odd part */
1997
1998
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
1999
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
2000
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
2001
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
2002
0
    tmp13 = LEFT_SHIFT(z4, CONST_BITS);
2003
2004
0
    tmp14 = z1 + z3;
2005
0
    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */
2006
0
    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */
2007
0
    tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */
2008
0
    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */
2009
0
    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */
2010
0
    z1    -= z2;
2011
0
    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13;        /* c11 */
2012
0
    tmp16 += tmp15;
2013
0
    z1    += z4;
2014
0
    z4    = MULTIPLY(z2 + z3, -FIX(0.158341681)) - tmp13;  /* -c13 */
2015
0
    tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948));          /* c3-c9-c13 */
2016
0
    tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773));          /* c3+c5-c13 */
2017
0
    z4    = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */
2018
0
    tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */
2019
0
    tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567));          /* c1+c11-c5 */
2020
2021
0
    tmp13 = LEFT_SHIFT(z1 - z3, PASS1_BITS);
2022
2023
    /* Final output stage */
2024
2025
0
    wsptr[8 * 0]  = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
2026
0
    wsptr[8 * 13] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
2027
0
    wsptr[8 * 1]  = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
2028
0
    wsptr[8 * 12] = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
2029
0
    wsptr[8 * 2]  = (int)RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS - PASS1_BITS);
2030
0
    wsptr[8 * 11] = (int)RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS - PASS1_BITS);
2031
0
    wsptr[8 * 3]  = (int)(tmp23 + tmp13);
2032
0
    wsptr[8 * 10] = (int)(tmp23 - tmp13);
2033
0
    wsptr[8 * 4]  = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
2034
0
    wsptr[8 * 9]  = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
2035
0
    wsptr[8 * 5]  = (int)RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS - PASS1_BITS);
2036
0
    wsptr[8 * 8]  = (int)RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS - PASS1_BITS);
2037
0
    wsptr[8 * 6]  = (int)RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS - PASS1_BITS);
2038
0
    wsptr[8 * 7]  = (int)RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS - PASS1_BITS);
2039
0
  }
2040
2041
  /* Pass 2: process 14 rows from work array, store into output array. */
2042
2043
0
  wsptr = workspace;
2044
0
  for (ctr = 0; ctr < 14; ctr++) {
2045
0
    outptr = output_buf[ctr] + output_col;
2046
2047
    /* Even part */
2048
2049
    /* Add fudge factor here for final descale. */
2050
0
    z1 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
2051
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
2052
0
    z4 = (JLONG)wsptr[4];
2053
0
    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */
2054
0
    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */
2055
0
    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */
2056
2057
0
    tmp10 = z1 + z2;
2058
0
    tmp11 = z1 + z3;
2059
0
    tmp12 = z1 - z4;
2060
2061
0
    tmp23 = z1 - LEFT_SHIFT(z2 + z3 - z4, 1);    /* c0 = (c4+c12-c8)*2 */
2062
2063
0
    z1 = (JLONG)wsptr[2];
2064
0
    z2 = (JLONG)wsptr[6];
2065
2066
0
    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */
2067
2068
0
    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */
2069
0
    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */
2070
0
    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */
2071
0
            MULTIPLY(z2, FIX(1.378756276));      /* c2 */
2072
2073
0
    tmp20 = tmp10 + tmp13;
2074
0
    tmp26 = tmp10 - tmp13;
2075
0
    tmp21 = tmp11 + tmp14;
2076
0
    tmp25 = tmp11 - tmp14;
2077
0
    tmp22 = tmp12 + tmp15;
2078
0
    tmp24 = tmp12 - tmp15;
2079
2080
    /* Odd part */
2081
2082
0
    z1 = (JLONG)wsptr[1];
2083
0
    z2 = (JLONG)wsptr[3];
2084
0
    z3 = (JLONG)wsptr[5];
2085
0
    z4 = (JLONG)wsptr[7];
2086
0
    z4 = LEFT_SHIFT(z4, CONST_BITS);
2087
2088
0
    tmp14 = z1 + z3;
2089
0
    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */
2090
0
    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */
2091
0
    tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */
2092
0
    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */
2093
0
    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */
2094
0
    z1    -= z2;
2095
0
    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4;           /* c11 */
2096
0
    tmp16 += tmp15;
2097
0
    tmp13 = MULTIPLY(z2 + z3, -FIX(0.158341681)) - z4;     /* -c13 */
2098
0
    tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948));       /* c3-c9-c13 */
2099
0
    tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773));       /* c3+c5-c13 */
2100
0
    tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */
2101
0
    tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */
2102
0
    tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567));       /* c1+c11-c5 */
2103
2104
0
    tmp13 = LEFT_SHIFT(z1 - z3, CONST_BITS) + z4;
2105
2106
    /* Final output stage */
2107
2108
0
    outptr[0]  = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
2109
0
                                              CONST_BITS + PASS1_BITS + 3) &
2110
0
                             RANGE_MASK];
2111
0
    outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
2112
0
                                              CONST_BITS + PASS1_BITS + 3) &
2113
0
                             RANGE_MASK];
2114
0
    outptr[1]  = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
2115
0
                                              CONST_BITS + PASS1_BITS + 3) &
2116
0
                             RANGE_MASK];
2117
0
    outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
2118
0
                                              CONST_BITS + PASS1_BITS + 3) &
2119
0
                             RANGE_MASK];
2120
0
    outptr[2]  = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
2121
0
                                              CONST_BITS + PASS1_BITS + 3) &
2122
0
                             RANGE_MASK];
2123
0
    outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
2124
0
                                              CONST_BITS + PASS1_BITS + 3) &
2125
0
                             RANGE_MASK];
2126
0
    outptr[3]  = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
2127
0
                                              CONST_BITS + PASS1_BITS + 3) &
2128
0
                             RANGE_MASK];
2129
0
    outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
2130
0
                                              CONST_BITS + PASS1_BITS + 3) &
2131
0
                             RANGE_MASK];
2132
0
    outptr[4]  = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
2133
0
                                              CONST_BITS + PASS1_BITS + 3) &
2134
0
                             RANGE_MASK];
2135
0
    outptr[9]  = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
2136
0
                                              CONST_BITS + PASS1_BITS + 3) &
2137
0
                             RANGE_MASK];
2138
0
    outptr[5]  = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
2139
0
                                              CONST_BITS + PASS1_BITS + 3) &
2140
0
                             RANGE_MASK];
2141
0
    outptr[8]  = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
2142
0
                                              CONST_BITS + PASS1_BITS + 3) &
2143
0
                             RANGE_MASK];
2144
0
    outptr[6]  = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp16,
2145
0
                                              CONST_BITS + PASS1_BITS + 3) &
2146
0
                             RANGE_MASK];
2147
0
    outptr[7]  = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp16,
2148
0
                                              CONST_BITS + PASS1_BITS + 3) &
2149
0
                             RANGE_MASK];
2150
2151
0
    wsptr += 8;         /* advance pointer to next row */
2152
0
  }
2153
0
}
Unexecuted instantiation: jpeg_idct_14x14
Unexecuted instantiation: jpeg12_idct_14x14
2154
2155
2156
/*
2157
 * Perform dequantization and inverse DCT on one block of coefficients,
2158
 * producing a 15x15 output block.
2159
 *
2160
 * Optimized algorithm with 22 multiplications in the 1-D kernel.
2161
 * cK represents sqrt(2) * cos(K*pi/30).
2162
 */
2163
2164
GLOBAL(void)
2165
_jpeg_idct_15x15(j_decompress_ptr cinfo, jpeg_component_info *compptr,
2166
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
2167
                 JDIMENSION output_col)
2168
0
{
2169
0
  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
2170
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2171
0
  JLONG z1, z2, z3, z4;
2172
0
  JCOEFPTR inptr;
2173
0
  ISLOW_MULT_TYPE *quantptr;
2174
0
  int *wsptr;
2175
0
  _JSAMPROW outptr;
2176
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
2177
0
  int ctr;
2178
0
  int workspace[8 * 15];        /* buffers data between passes */
2179
  SHIFT_TEMPS
2180
0
  SCALING_FACTOR
2181
2182
  /* Pass 1: process columns from input, store into work array. */
2183
2184
0
  inptr = coef_block;
2185
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
2186
0
  wsptr = workspace;
2187
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2188
    /* Even part */
2189
2190
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
2191
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
2192
    /* Add fudge factor here for final descale. */
2193
0
    z1 += ONE << (CONST_BITS - PASS1_BITS - 1);
2194
2195
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
2196
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
2197
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
2198
2199
0
    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */
2200
0
    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */
2201
2202
0
    tmp12 = z1 - tmp10;
2203
0
    tmp13 = z1 + tmp11;
2204
0
    z1 -= LEFT_SHIFT(tmp11 - tmp10, 1);     /* c0 = (c6-c12)*2 */
2205
2206
0
    z4 = z2 - z3;
2207
0
    z3 += z2;
2208
0
    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */
2209
0
    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */
2210
0
    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */
2211
2212
0
    tmp20 = tmp13 + tmp10 + tmp11;
2213
0
    tmp23 = tmp12 - tmp10 + tmp11 + z2;
2214
2215
0
    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */
2216
0
    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */
2217
2218
0
    tmp25 = tmp13 - tmp10 - tmp11;
2219
0
    tmp26 = tmp12 + tmp10 - tmp11 - z2;
2220
2221
0
    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */
2222
0
    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */
2223
2224
0
    tmp21 = tmp12 + tmp10 + tmp11;
2225
0
    tmp24 = tmp13 - tmp10 + tmp11;
2226
0
    tmp11 += tmp11;
2227
0
    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */
2228
0
    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */
2229
2230
    /* Odd part */
2231
2232
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
2233
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
2234
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
2235
0
    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */
2236
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
2237
2238
0
    tmp13 = z2 - z4;
2239
0
    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */
2240
0
    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */
2241
0
    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */
2242
2243
0
    tmp13 = MULTIPLY(z2, -FIX(0.831253876));                /* -c9 */
2244
0
    tmp15 = MULTIPLY(z2, -FIX(1.344997024));                /* -c3 */
2245
0
    z2 = z1 - z4;
2246
0
    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */
2247
2248
0
    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */
2249
0
    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */
2250
0
    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */
2251
0
    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */
2252
0
    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */
2253
0
    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */
2254
2255
    /* Final output stage */
2256
2257
0
    wsptr[8 * 0]  = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
2258
0
    wsptr[8 * 14] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
2259
0
    wsptr[8 * 1]  = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
2260
0
    wsptr[8 * 13] = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
2261
0
    wsptr[8 * 2]  = (int)RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS - PASS1_BITS);
2262
0
    wsptr[8 * 12] = (int)RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS - PASS1_BITS);
2263
0
    wsptr[8 * 3]  = (int)RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS - PASS1_BITS);
2264
0
    wsptr[8 * 11] = (int)RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS - PASS1_BITS);
2265
0
    wsptr[8 * 4]  = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
2266
0
    wsptr[8 * 10] = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
2267
0
    wsptr[8 * 5]  = (int)RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS - PASS1_BITS);
2268
0
    wsptr[8 * 9]  = (int)RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS - PASS1_BITS);
2269
0
    wsptr[8 * 6]  = (int)RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS - PASS1_BITS);
2270
0
    wsptr[8 * 8]  = (int)RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS - PASS1_BITS);
2271
0
    wsptr[8 * 7]  = (int)RIGHT_SHIFT(tmp27, CONST_BITS - PASS1_BITS);
2272
0
  }
2273
2274
  /* Pass 2: process 15 rows from work array, store into output array. */
2275
2276
0
  wsptr = workspace;
2277
0
  for (ctr = 0; ctr < 15; ctr++) {
2278
0
    outptr = output_buf[ctr] + output_col;
2279
2280
    /* Even part */
2281
2282
    /* Add fudge factor here for final descale. */
2283
0
    z1 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
2284
0
    z1 = LEFT_SHIFT(z1, CONST_BITS);
2285
2286
0
    z2 = (JLONG)wsptr[2];
2287
0
    z3 = (JLONG)wsptr[4];
2288
0
    z4 = (JLONG)wsptr[6];
2289
2290
0
    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */
2291
0
    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */
2292
2293
0
    tmp12 = z1 - tmp10;
2294
0
    tmp13 = z1 + tmp11;
2295
0
    z1 -= LEFT_SHIFT(tmp11 - tmp10, 1);     /* c0 = (c6-c12)*2 */
2296
2297
0
    z4 = z2 - z3;
2298
0
    z3 += z2;
2299
0
    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */
2300
0
    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */
2301
0
    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */
2302
2303
0
    tmp20 = tmp13 + tmp10 + tmp11;
2304
0
    tmp23 = tmp12 - tmp10 + tmp11 + z2;
2305
2306
0
    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */
2307
0
    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */
2308
2309
0
    tmp25 = tmp13 - tmp10 - tmp11;
2310
0
    tmp26 = tmp12 + tmp10 - tmp11 - z2;
2311
2312
0
    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */
2313
0
    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */
2314
2315
0
    tmp21 = tmp12 + tmp10 + tmp11;
2316
0
    tmp24 = tmp13 - tmp10 + tmp11;
2317
0
    tmp11 += tmp11;
2318
0
    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */
2319
0
    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */
2320
2321
    /* Odd part */
2322
2323
0
    z1 = (JLONG)wsptr[1];
2324
0
    z2 = (JLONG)wsptr[3];
2325
0
    z4 = (JLONG)wsptr[5];
2326
0
    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */
2327
0
    z4 = (JLONG)wsptr[7];
2328
2329
0
    tmp13 = z2 - z4;
2330
0
    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */
2331
0
    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */
2332
0
    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */
2333
2334
0
    tmp13 = MULTIPLY(z2, -FIX(0.831253876));                /* -c9 */
2335
0
    tmp15 = MULTIPLY(z2, -FIX(1.344997024));                /* -c3 */
2336
0
    z2 = z1 - z4;
2337
0
    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */
2338
2339
0
    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */
2340
0
    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */
2341
0
    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */
2342
0
    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */
2343
0
    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */
2344
0
    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */
2345
2346
    /* Final output stage */
2347
2348
0
    outptr[0]  = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
2349
0
                                              CONST_BITS + PASS1_BITS + 3) &
2350
0
                             RANGE_MASK];
2351
0
    outptr[14] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
2352
0
                                              CONST_BITS + PASS1_BITS + 3) &
2353
0
                             RANGE_MASK];
2354
0
    outptr[1]  = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
2355
0
                                              CONST_BITS + PASS1_BITS + 3) &
2356
0
                             RANGE_MASK];
2357
0
    outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
2358
0
                                              CONST_BITS + PASS1_BITS + 3) &
2359
0
                             RANGE_MASK];
2360
0
    outptr[2]  = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
2361
0
                                              CONST_BITS + PASS1_BITS + 3) &
2362
0
                             RANGE_MASK];
2363
0
    outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
2364
0
                                              CONST_BITS + PASS1_BITS + 3) &
2365
0
                             RANGE_MASK];
2366
0
    outptr[3]  = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
2367
0
                                              CONST_BITS + PASS1_BITS + 3) &
2368
0
                             RANGE_MASK];
2369
0
    outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
2370
0
                                              CONST_BITS + PASS1_BITS + 3) &
2371
0
                             RANGE_MASK];
2372
0
    outptr[4]  = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
2373
0
                                              CONST_BITS + PASS1_BITS + 3) &
2374
0
                             RANGE_MASK];
2375
0
    outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
2376
0
                                              CONST_BITS + PASS1_BITS + 3) &
2377
0
                             RANGE_MASK];
2378
0
    outptr[5]  = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
2379
0
                                              CONST_BITS + PASS1_BITS + 3) &
2380
0
                             RANGE_MASK];
2381
0
    outptr[9]  = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
2382
0
                                              CONST_BITS + PASS1_BITS + 3) &
2383
0
                             RANGE_MASK];
2384
0
    outptr[6]  = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp16,
2385
0
                                              CONST_BITS + PASS1_BITS + 3) &
2386
0
                             RANGE_MASK];
2387
0
    outptr[8]  = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp16,
2388
0
                                              CONST_BITS + PASS1_BITS + 3) &
2389
0
                             RANGE_MASK];
2390
0
    outptr[7]  = range_limit[(int)RIGHT_SHIFT(tmp27,
2391
0
                                              CONST_BITS + PASS1_BITS + 3) &
2392
0
                             RANGE_MASK];
2393
2394
0
    wsptr += 8;         /* advance pointer to next row */
2395
0
  }
2396
0
}
Unexecuted instantiation: jpeg_idct_15x15
Unexecuted instantiation: jpeg12_idct_15x15
2397
2398
2399
/*
2400
 * Perform dequantization and inverse DCT on one block of coefficients,
2401
 * producing a 16x16 output block.
2402
 *
2403
 * Optimized algorithm with 28 multiplications in the 1-D kernel.
2404
 * cK represents sqrt(2) * cos(K*pi/32).
2405
 */
2406
2407
GLOBAL(void)
2408
_jpeg_idct_16x16(j_decompress_ptr cinfo, jpeg_component_info *compptr,
2409
                 JCOEFPTR coef_block, _JSAMPARRAY output_buf,
2410
                 JDIMENSION output_col)
2411
0
{
2412
0
  JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
2413
0
  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2414
0
  JLONG z1, z2, z3, z4;
2415
0
  JCOEFPTR inptr;
2416
0
  ISLOW_MULT_TYPE *quantptr;
2417
0
  int *wsptr;
2418
0
  _JSAMPROW outptr;
2419
0
  _JSAMPLE *range_limit = IDCT_range_limit(cinfo);
2420
0
  int ctr;
2421
0
  int workspace[8 * 16];        /* buffers data between passes */
2422
  SHIFT_TEMPS
2423
0
  SCALING_FACTOR
2424
2425
  /* Pass 1: process columns from input, store into work array. */
2426
2427
0
  inptr = coef_block;
2428
0
  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
2429
0
  wsptr = workspace;
2430
0
  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2431
    /* Even part */
2432
2433
0
    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
2434
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
2435
    /* Add fudge factor here for final descale. */
2436
0
    tmp0 += ONE << (CONST_BITS - PASS1_BITS - 1);
2437
2438
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
2439
0
    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */
2440
0
    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */
2441
2442
0
    tmp10 = tmp0 + tmp1;
2443
0
    tmp11 = tmp0 - tmp1;
2444
0
    tmp12 = tmp0 + tmp2;
2445
0
    tmp13 = tmp0 - tmp2;
2446
2447
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
2448
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
2449
0
    z3 = z1 - z2;
2450
0
    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */
2451
0
    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */
2452
2453
0
    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */
2454
0
    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */
2455
0
    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */
2456
0
    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */
2457
2458
0
    tmp20 = tmp10 + tmp0;
2459
0
    tmp27 = tmp10 - tmp0;
2460
0
    tmp21 = tmp12 + tmp1;
2461
0
    tmp26 = tmp12 - tmp1;
2462
0
    tmp22 = tmp13 + tmp2;
2463
0
    tmp25 = tmp13 - tmp2;
2464
0
    tmp23 = tmp11 + tmp3;
2465
0
    tmp24 = tmp11 - tmp3;
2466
2467
    /* Odd part */
2468
2469
0
    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
2470
0
    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
2471
0
    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
2472
0
    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
2473
2474
0
    tmp11 = z1 + z3;
2475
2476
0
    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */
2477
0
    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */
2478
0
    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */
2479
0
    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */
2480
0
    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */
2481
0
    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */
2482
0
    tmp0  = tmp1 + tmp2 + tmp3 -
2483
0
            MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */
2484
0
    tmp13 = tmp10 + tmp11 + tmp12 -
2485
0
            MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */
2486
0
    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */
2487
0
    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */
2488
0
    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */
2489
0
    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */
2490
0
    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */
2491
0
    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */
2492
0
    z2    += z4;
2493
0
    z1    = MULTIPLY(z2, -FIX(0.666655658));       /* -c11 */
2494
0
    tmp1  += z1;
2495
0
    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */
2496
0
    z2    = MULTIPLY(z2, -FIX(1.247225013));       /* -c5 */
2497
0
    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */
2498
0
    tmp12 += z2;
2499
0
    z2    = MULTIPLY(z3 + z4, -FIX(1.353318001));  /* -c3 */
2500
0
    tmp2  += z2;
2501
0
    tmp3  += z2;
2502
0
    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */
2503
0
    tmp10 += z2;
2504
0
    tmp11 += z2;
2505
2506
    /* Final output stage */
2507
2508
0
    wsptr[8 * 0]  = (int)RIGHT_SHIFT(tmp20 + tmp0,  CONST_BITS - PASS1_BITS);
2509
0
    wsptr[8 * 15] = (int)RIGHT_SHIFT(tmp20 - tmp0,  CONST_BITS - PASS1_BITS);
2510
0
    wsptr[8 * 1]  = (int)RIGHT_SHIFT(tmp21 + tmp1,  CONST_BITS - PASS1_BITS);
2511
0
    wsptr[8 * 14] = (int)RIGHT_SHIFT(tmp21 - tmp1,  CONST_BITS - PASS1_BITS);
2512
0
    wsptr[8 * 2]  = (int)RIGHT_SHIFT(tmp22 + tmp2,  CONST_BITS - PASS1_BITS);
2513
0
    wsptr[8 * 13] = (int)RIGHT_SHIFT(tmp22 - tmp2,  CONST_BITS - PASS1_BITS);
2514
0
    wsptr[8 * 3]  = (int)RIGHT_SHIFT(tmp23 + tmp3,  CONST_BITS - PASS1_BITS);
2515
0
    wsptr[8 * 12] = (int)RIGHT_SHIFT(tmp23 - tmp3,  CONST_BITS - PASS1_BITS);
2516
0
    wsptr[8 * 4]  = (int)RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS - PASS1_BITS);
2517
0
    wsptr[8 * 11] = (int)RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS - PASS1_BITS);
2518
0
    wsptr[8 * 5]  = (int)RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS - PASS1_BITS);
2519
0
    wsptr[8 * 10] = (int)RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS - PASS1_BITS);
2520
0
    wsptr[8 * 6]  = (int)RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS - PASS1_BITS);
2521
0
    wsptr[8 * 9]  = (int)RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS - PASS1_BITS);
2522
0
    wsptr[8 * 7]  = (int)RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS - PASS1_BITS);
2523
0
    wsptr[8 * 8]  = (int)RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS - PASS1_BITS);
2524
0
  }
2525
2526
  /* Pass 2: process 16 rows from work array, store into output array. */
2527
2528
0
  wsptr = workspace;
2529
0
  for (ctr = 0; ctr < 16; ctr++) {
2530
0
    outptr = output_buf[ctr] + output_col;
2531
2532
    /* Even part */
2533
2534
    /* Add fudge factor here for final descale. */
2535
0
    tmp0 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
2536
0
    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
2537
2538
0
    z1 = (JLONG)wsptr[4];
2539
0
    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */
2540
0
    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */
2541
2542
0
    tmp10 = tmp0 + tmp1;
2543
0
    tmp11 = tmp0 - tmp1;
2544
0
    tmp12 = tmp0 + tmp2;
2545
0
    tmp13 = tmp0 - tmp2;
2546
2547
0
    z1 = (JLONG)wsptr[2];
2548
0
    z2 = (JLONG)wsptr[6];
2549
0
    z3 = z1 - z2;
2550
0
    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */
2551
0
    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */
2552
2553
0
    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */
2554
0
    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */
2555
0
    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */
2556
0
    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */
2557
2558
0
    tmp20 = tmp10 + tmp0;
2559
0
    tmp27 = tmp10 - tmp0;
2560
0
    tmp21 = tmp12 + tmp1;
2561
0
    tmp26 = tmp12 - tmp1;
2562
0
    tmp22 = tmp13 + tmp2;
2563
0
    tmp25 = tmp13 - tmp2;
2564
0
    tmp23 = tmp11 + tmp3;
2565
0
    tmp24 = tmp11 - tmp3;
2566
2567
    /* Odd part */
2568
2569
0
    z1 = (JLONG)wsptr[1];
2570
0
    z2 = (JLONG)wsptr[3];
2571
0
    z3 = (JLONG)wsptr[5];
2572
0
    z4 = (JLONG)wsptr[7];
2573
2574
0
    tmp11 = z1 + z3;
2575
2576
0
    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */
2577
0
    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */
2578
0
    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */
2579
0
    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */
2580
0
    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */
2581
0
    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */
2582
0
    tmp0  = tmp1 + tmp2 + tmp3 -
2583
0
            MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */
2584
0
    tmp13 = tmp10 + tmp11 + tmp12 -
2585
0
            MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */
2586
0
    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */
2587
0
    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */
2588
0
    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */
2589
0
    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */
2590
0
    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */
2591
0
    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */
2592
0
    z2    += z4;
2593
0
    z1    = MULTIPLY(z2, -FIX(0.666655658));       /* -c11 */
2594
0
    tmp1  += z1;
2595
0
    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */
2596
0
    z2    = MULTIPLY(z2, -FIX(1.247225013));       /* -c5 */
2597
0
    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */
2598
0
    tmp12 += z2;
2599
0
    z2    = MULTIPLY(z3 + z4, -FIX(1.353318001));  /* -c3 */
2600
0
    tmp2  += z2;
2601
0
    tmp3  += z2;
2602
0
    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */
2603
0
    tmp10 += z2;
2604
0
    tmp11 += z2;
2605
2606
    /* Final output stage */
2607
2608
0
    outptr[0]  = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp0,
2609
0
                                              CONST_BITS + PASS1_BITS + 3) &
2610
0
                             RANGE_MASK];
2611
0
    outptr[15] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp0,
2612
0
                                              CONST_BITS + PASS1_BITS + 3) &
2613
0
                             RANGE_MASK];
2614
0
    outptr[1]  = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp1,
2615
0
                                              CONST_BITS + PASS1_BITS + 3) &
2616
0
                             RANGE_MASK];
2617
0
    outptr[14] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp1,
2618
0
                                              CONST_BITS + PASS1_BITS + 3) &
2619
0
                             RANGE_MASK];
2620
0
    outptr[2]  = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp2,
2621
0
                                              CONST_BITS + PASS1_BITS + 3) &
2622
0
                             RANGE_MASK];
2623
0
    outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp2,
2624
0
                                              CONST_BITS + PASS1_BITS + 3) &
2625
0
                             RANGE_MASK];
2626
0
    outptr[3]  = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp3,
2627
0
                                              CONST_BITS + PASS1_BITS + 3) &
2628
0
                             RANGE_MASK];
2629
0
    outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp3,
2630
0
                                              CONST_BITS + PASS1_BITS + 3) &
2631
0
                             RANGE_MASK];
2632
0
    outptr[4]  = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp10,
2633
0
                                              CONST_BITS + PASS1_BITS + 3) &
2634
0
                             RANGE_MASK];
2635
0
    outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp10,
2636
0
                                              CONST_BITS + PASS1_BITS + 3) &
2637
0
                             RANGE_MASK];
2638
0
    outptr[5]  = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp11,
2639
0
                                              CONST_BITS + PASS1_BITS + 3) &
2640
0
                             RANGE_MASK];
2641
0
    outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp11,
2642
0
                                              CONST_BITS + PASS1_BITS + 3) &
2643
0
                             RANGE_MASK];
2644
0
    outptr[6]  = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp12,
2645
0
                                              CONST_BITS + PASS1_BITS + 3) &
2646
0
                             RANGE_MASK];
2647
0
    outptr[9]  = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp12,
2648
0
                                              CONST_BITS + PASS1_BITS + 3) &
2649
0
                             RANGE_MASK];
2650
0
    outptr[7]  = range_limit[(int)RIGHT_SHIFT(tmp27 + tmp13,
2651
0
                                              CONST_BITS + PASS1_BITS + 3) &
2652
0
                             RANGE_MASK];
2653
0
    outptr[8]  = range_limit[(int)RIGHT_SHIFT(tmp27 - tmp13,
2654
0
                                              CONST_BITS + PASS1_BITS + 3) &
2655
0
                             RANGE_MASK];
2656
2657
0
    wsptr += 8;         /* advance pointer to next row */
2658
0
  }
2659
0
}
Unexecuted instantiation: jpeg_idct_16x16
Unexecuted instantiation: jpeg12_idct_16x16
2660
2661
#endif /* IDCT_SCALING_SUPPORTED */
2662
#endif /* DCT_ISLOW_SUPPORTED */