Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * jddctmgr.c |
| 3 | * |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 4 | * Copyright (C) 1994-1996, Thomas G. Lane. |
Guido Vollbeding | f18f81b | 2010-02-28 00:00:00 +0000 | [diff] [blame] | 5 | * Modified 2002-2010 by Guido Vollbeding. |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 6 | * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
DRC | 36a6eec | 2010-10-08 08:05:44 +0000 | [diff] [blame] | 7 | * Copyright (C) 2010, D. R. Commander. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 8 | * This file is part of the Independent JPEG Group's software. |
| 9 | * For conditions of distribution and use, see the accompanying README file. |
| 10 | * |
| 11 | * This file contains the inverse-DCT management logic. |
| 12 | * This code selects a particular IDCT implementation to be used, |
| 13 | * and it performs related housekeeping chores. No code in this file |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 14 | * is executed per IDCT step, only during output pass setup. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 15 | * |
| 16 | * Note that the IDCT routines are responsible for performing coefficient |
| 17 | * dequantization as well as the IDCT proper. This module sets up the |
| 18 | * dequantization multiplier table needed by the IDCT routine. |
| 19 | */ |
| 20 | |
| 21 | #define JPEG_INTERNALS |
| 22 | #include "jinclude.h" |
| 23 | #include "jpeglib.h" |
| 24 | #include "jdct.h" /* Private declarations for DCT subsystem */ |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 25 | #include "jsimddct.h" |
DRC | 36a6eec | 2010-10-08 08:05:44 +0000 | [diff] [blame] | 26 | #include "jpegcomp.h" |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 27 | |
| 28 | |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 29 | /* |
| 30 | * The decompressor input side (jdinput.c) saves away the appropriate |
| 31 | * quantization table for each component at the start of the first scan |
| 32 | * involving that component. (This is necessary in order to correctly |
| 33 | * decode files that reuse Q-table slots.) |
| 34 | * When we are ready to make an output pass, the saved Q-table is converted |
| 35 | * to a multiplier table that will actually be used by the IDCT routine. |
| 36 | * The multiplier table contents are IDCT-method-dependent. To support |
| 37 | * application changes in IDCT method between scans, we can remake the |
| 38 | * multiplier tables if necessary. |
| 39 | * In buffered-image mode, the first output pass may occur before any data |
| 40 | * has been seen for some components, and thus before their Q-tables have |
| 41 | * been saved away. To handle this case, multiplier tables are preset |
| 42 | * to zeroes; the result of the IDCT will be a neutral gray level. |
| 43 | */ |
| 44 | |
| 45 | |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 46 | /* Private subobject for this module */ |
| 47 | |
| 48 | typedef struct { |
| 49 | struct jpeg_inverse_dct pub; /* public fields */ |
| 50 | |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 51 | /* This array contains the IDCT method code that each multiplier table |
| 52 | * is currently set up for, or -1 if it's not yet set up. |
| 53 | * The actual multiplier tables are pointed to by dct_table in the |
| 54 | * per-component comp_info structures. |
| 55 | */ |
| 56 | int cur_method[MAX_COMPONENTS]; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 57 | } my_idct_controller; |
| 58 | |
| 59 | typedef my_idct_controller * my_idct_ptr; |
| 60 | |
| 61 | |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 62 | /* Allocated multiplier tables: big enough for any supported variant */ |
| 63 | |
| 64 | typedef union { |
| 65 | ISLOW_MULT_TYPE islow_array[DCTSIZE2]; |
| 66 | #ifdef DCT_IFAST_SUPPORTED |
| 67 | IFAST_MULT_TYPE ifast_array[DCTSIZE2]; |
| 68 | #endif |
| 69 | #ifdef DCT_FLOAT_SUPPORTED |
| 70 | FLOAT_MULT_TYPE float_array[DCTSIZE2]; |
| 71 | #endif |
| 72 | } multiplier_table; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 73 | |
| 74 | |
| 75 | /* The current scaled-IDCT routines require ISLOW-style multiplier tables, |
| 76 | * so be sure to compile that code if either ISLOW or SCALING is requested. |
| 77 | */ |
| 78 | #ifdef DCT_ISLOW_SUPPORTED |
| 79 | #define PROVIDE_ISLOW_TABLES |
| 80 | #else |
| 81 | #ifdef IDCT_SCALING_SUPPORTED |
| 82 | #define PROVIDE_ISLOW_TABLES |
| 83 | #endif |
| 84 | #endif |
| 85 | |
| 86 | |
| 87 | /* |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 88 | * Prepare for an output pass. |
| 89 | * Here we select the proper IDCT routine for each component and build |
| 90 | * a matching multiplier table. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 91 | */ |
| 92 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 93 | METHODDEF(void) |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 94 | start_pass (j_decompress_ptr cinfo) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 95 | { |
| 96 | my_idct_ptr idct = (my_idct_ptr) cinfo->idct; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 97 | int ci, i; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 98 | jpeg_component_info *compptr; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 99 | int method = 0; |
| 100 | inverse_DCT_method_ptr method_ptr = NULL; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 101 | JQUANT_TBL * qtbl; |
| 102 | |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 103 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
| 104 | ci++, compptr++) { |
| 105 | /* Select the proper IDCT routine for this component's scaling */ |
DRC | 49967cd | 2010-10-09 19:57:51 +0000 | [diff] [blame] | 106 | switch (compptr->_DCT_scaled_size) { |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 107 | #ifdef IDCT_SCALING_SUPPORTED |
| 108 | case 1: |
| 109 | method_ptr = jpeg_idct_1x1; |
| 110 | method = JDCT_ISLOW; /* jidctred uses islow-style table */ |
| 111 | break; |
| 112 | case 2: |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 113 | if (jsimd_can_idct_2x2()) |
| 114 | method_ptr = jsimd_idct_2x2; |
| 115 | else |
| 116 | method_ptr = jpeg_idct_2x2; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 117 | method = JDCT_ISLOW; /* jidctred uses islow-style table */ |
| 118 | break; |
DRC | 27fb3fc | 2012-01-28 01:48:07 +0000 | [diff] [blame^] | 119 | case 3: |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 120 | method_ptr = jpeg_idct_3x3; |
| 121 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 122 | break; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 123 | case 4: |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 124 | if (jsimd_can_idct_4x4()) |
| 125 | method_ptr = jsimd_idct_4x4; |
| 126 | else |
| 127 | method_ptr = jpeg_idct_4x4; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 128 | method = JDCT_ISLOW; /* jidctred uses islow-style table */ |
| 129 | break; |
DRC | 27fb3fc | 2012-01-28 01:48:07 +0000 | [diff] [blame^] | 130 | case 5: |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 131 | method_ptr = jpeg_idct_5x5; |
| 132 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 133 | break; |
DRC | 27fb3fc | 2012-01-28 01:48:07 +0000 | [diff] [blame^] | 134 | case 6: |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 135 | method_ptr = jpeg_idct_6x6; |
| 136 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 137 | break; |
DRC | 27fb3fc | 2012-01-28 01:48:07 +0000 | [diff] [blame^] | 138 | case 7: |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 139 | method_ptr = jpeg_idct_7x7; |
| 140 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 141 | break; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 142 | #endif |
| 143 | case DCTSIZE: |
| 144 | switch (cinfo->dct_method) { |
| 145 | #ifdef DCT_ISLOW_SUPPORTED |
| 146 | case JDCT_ISLOW: |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 147 | if (jsimd_can_idct_islow()) |
| 148 | method_ptr = jsimd_idct_islow; |
| 149 | else |
| 150 | method_ptr = jpeg_idct_islow; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 151 | method = JDCT_ISLOW; |
| 152 | break; |
| 153 | #endif |
| 154 | #ifdef DCT_IFAST_SUPPORTED |
| 155 | case JDCT_IFAST: |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 156 | if (jsimd_can_idct_ifast()) |
| 157 | method_ptr = jsimd_idct_ifast; |
| 158 | else |
| 159 | method_ptr = jpeg_idct_ifast; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 160 | method = JDCT_IFAST; |
| 161 | break; |
| 162 | #endif |
| 163 | #ifdef DCT_FLOAT_SUPPORTED |
| 164 | case JDCT_FLOAT: |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 165 | if (jsimd_can_idct_float()) |
| 166 | method_ptr = jsimd_idct_float; |
| 167 | else |
| 168 | method_ptr = jpeg_idct_float; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 169 | method = JDCT_FLOAT; |
| 170 | break; |
| 171 | #endif |
| 172 | default: |
| 173 | ERREXIT(cinfo, JERR_NOT_COMPILED); |
| 174 | break; |
| 175 | } |
| 176 | break; |
DRC | 27fb3fc | 2012-01-28 01:48:07 +0000 | [diff] [blame^] | 177 | case 9: |
| 178 | method_ptr = jpeg_idct_9x9; |
| 179 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 180 | break; |
| 181 | case 10: |
| 182 | method_ptr = jpeg_idct_10x10; |
| 183 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 184 | break; |
| 185 | case 11: |
| 186 | method_ptr = jpeg_idct_11x11; |
| 187 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 188 | break; |
| 189 | case 12: |
| 190 | method_ptr = jpeg_idct_12x12; |
| 191 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 192 | break; |
| 193 | case 13: |
| 194 | method_ptr = jpeg_idct_13x13; |
| 195 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 196 | break; |
| 197 | case 14: |
| 198 | method_ptr = jpeg_idct_14x14; |
| 199 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 200 | break; |
| 201 | case 15: |
| 202 | method_ptr = jpeg_idct_15x15; |
| 203 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 204 | break; |
| 205 | case 16: |
| 206 | method_ptr = jpeg_idct_16x16; |
| 207 | method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 208 | break; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 209 | default: |
DRC | 49967cd | 2010-10-09 19:57:51 +0000 | [diff] [blame] | 210 | ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->_DCT_scaled_size); |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 211 | break; |
| 212 | } |
| 213 | idct->pub.inverse_DCT[ci] = method_ptr; |
| 214 | /* Create multiplier table from quant table. |
| 215 | * However, we can skip this if the component is uninteresting |
| 216 | * or if we already built the table. Also, if no quant table |
| 217 | * has yet been saved for the component, we leave the |
| 218 | * multiplier table all-zero; we'll be reading zeroes from the |
| 219 | * coefficient controller's buffer anyway. |
| 220 | */ |
| 221 | if (! compptr->component_needed || idct->cur_method[ci] == method) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 222 | continue; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 223 | qtbl = compptr->quant_table; |
| 224 | if (qtbl == NULL) /* happens if no data yet for component */ |
| 225 | continue; |
| 226 | idct->cur_method[ci] = method; |
| 227 | switch (method) { |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 228 | #ifdef PROVIDE_ISLOW_TABLES |
| 229 | case JDCT_ISLOW: |
| 230 | { |
| 231 | /* For LL&M IDCT method, multipliers are equal to raw quantization |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 232 | * coefficients, but are stored as ints to ensure access efficiency. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 233 | */ |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 234 | ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 235 | for (i = 0; i < DCTSIZE2; i++) { |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 236 | ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 237 | } |
| 238 | } |
| 239 | break; |
| 240 | #endif |
| 241 | #ifdef DCT_IFAST_SUPPORTED |
| 242 | case JDCT_IFAST: |
| 243 | { |
| 244 | /* For AA&N IDCT method, multipliers are equal to quantization |
| 245 | * coefficients scaled by scalefactor[row]*scalefactor[col], where |
| 246 | * scalefactor[0] = 1 |
| 247 | * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 |
| 248 | * For integer operation, the multiplier table is to be scaled by |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 249 | * IFAST_SCALE_BITS. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 250 | */ |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 251 | IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 252 | #define CONST_BITS 14 |
| 253 | static const INT16 aanscales[DCTSIZE2] = { |
| 254 | /* precomputed values scaled up by 14 bits */ |
| 255 | 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, |
| 256 | 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, |
| 257 | 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, |
| 258 | 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, |
| 259 | 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, |
| 260 | 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, |
| 261 | 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, |
| 262 | 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 |
| 263 | }; |
| 264 | SHIFT_TEMPS |
| 265 | |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 266 | for (i = 0; i < DCTSIZE2; i++) { |
| 267 | ifmtbl[i] = (IFAST_MULT_TYPE) |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 268 | DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 269 | (INT32) aanscales[i]), |
| 270 | CONST_BITS-IFAST_SCALE_BITS); |
| 271 | } |
| 272 | } |
| 273 | break; |
| 274 | #endif |
| 275 | #ifdef DCT_FLOAT_SUPPORTED |
| 276 | case JDCT_FLOAT: |
| 277 | { |
| 278 | /* For float AA&N IDCT method, multipliers are equal to quantization |
| 279 | * coefficients scaled by scalefactor[row]*scalefactor[col], where |
| 280 | * scalefactor[0] = 1 |
| 281 | * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 282 | */ |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 283 | FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 284 | int row, col; |
| 285 | static const double aanscalefactor[DCTSIZE] = { |
| 286 | 1.0, 1.387039845, 1.306562965, 1.175875602, |
| 287 | 1.0, 0.785694958, 0.541196100, 0.275899379 |
| 288 | }; |
| 289 | |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 290 | i = 0; |
| 291 | for (row = 0; row < DCTSIZE; row++) { |
| 292 | for (col = 0; col < DCTSIZE; col++) { |
| 293 | fmtbl[i] = (FLOAT_MULT_TYPE) |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 294 | ((double) qtbl->quantval[i] * |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 295 | aanscalefactor[row] * aanscalefactor[col]); |
| 296 | i++; |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | break; |
| 301 | #endif |
| 302 | default: |
| 303 | ERREXIT(cinfo, JERR_NOT_COMPILED); |
| 304 | break; |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | |
| 310 | /* |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 311 | * Initialize IDCT manager. |
| 312 | */ |
| 313 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 314 | GLOBAL(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 315 | jinit_inverse_dct (j_decompress_ptr cinfo) |
| 316 | { |
| 317 | my_idct_ptr idct; |
| 318 | int ci; |
| 319 | jpeg_component_info *compptr; |
| 320 | |
| 321 | idct = (my_idct_ptr) |
| 322 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
| 323 | SIZEOF(my_idct_controller)); |
| 324 | cinfo->idct = (struct jpeg_inverse_dct *) idct; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 325 | idct->pub.start_pass = start_pass; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 326 | |
| 327 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
| 328 | ci++, compptr++) { |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 329 | /* Allocate and pre-zero a multiplier table for each component */ |
| 330 | compptr->dct_table = |
| 331 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
| 332 | SIZEOF(multiplier_table)); |
| 333 | MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); |
| 334 | /* Mark multiplier table not yet set up for any method */ |
| 335 | idct->cur_method[ci] = -1; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 336 | } |
| 337 | } |