| OLD | NEW |
| 1 /* | 1 /* |
| 2 * jddctmgr.c | 2 * jddctmgr.c |
| 3 * | 3 * |
| 4 * Copyright (C) 1994-1996, Thomas G. Lane. | 4 * Copyright (C) 1994-1996, Thomas G. Lane. |
| 5 * Modified 2002-2010 by Guido Vollbeding. |
| 5 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB | 6 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
| 6 * Copyright (C) 2010, D. R. Commander. | 7 * Copyright (C) 2010, D. R. Commander. |
| 7 * This file is part of the Independent JPEG Group's software. | 8 * This file is part of the Independent JPEG Group's software. |
| 8 * For conditions of distribution and use, see the accompanying README file. | 9 * For conditions of distribution and use, see the accompanying README file. |
| 9 * | 10 * |
| 10 * This file contains the inverse-DCT management logic. | 11 * This file contains the inverse-DCT management logic. |
| 11 * This code selects a particular IDCT implementation to be used, | 12 * This code selects a particular IDCT implementation to be used, |
| 12 * and it performs related housekeeping chores. No code in this file | 13 * and it performs related housekeeping chores. No code in this file |
| 13 * is executed per IDCT step, only during output pass setup. | 14 * is executed per IDCT step, only during output pass setup. |
| 14 * | 15 * |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 method_ptr = jpeg_idct_1x1; | 109 method_ptr = jpeg_idct_1x1; |
| 109 method = JDCT_ISLOW; /* jidctred uses islow-style table */ | 110 method = JDCT_ISLOW; /* jidctred uses islow-style table */ |
| 110 break; | 111 break; |
| 111 case 2: | 112 case 2: |
| 112 if (jsimd_can_idct_2x2()) | 113 if (jsimd_can_idct_2x2()) |
| 113 method_ptr = jsimd_idct_2x2; | 114 method_ptr = jsimd_idct_2x2; |
| 114 else | 115 else |
| 115 method_ptr = jpeg_idct_2x2; | 116 method_ptr = jpeg_idct_2x2; |
| 116 method = JDCT_ISLOW; /* jidctred uses islow-style table */ | 117 method = JDCT_ISLOW; /* jidctred uses islow-style table */ |
| 117 break; | 118 break; |
| 119 case 3: |
| 120 method_ptr = jpeg_idct_3x3; |
| 121 method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 122 break; |
| 118 case 4: | 123 case 4: |
| 119 if (jsimd_can_idct_4x4()) | 124 if (jsimd_can_idct_4x4()) |
| 120 method_ptr = jsimd_idct_4x4; | 125 method_ptr = jsimd_idct_4x4; |
| 121 else | 126 else |
| 122 method_ptr = jpeg_idct_4x4; | 127 method_ptr = jpeg_idct_4x4; |
| 123 method = JDCT_ISLOW; /* jidctred uses islow-style table */ | 128 method = JDCT_ISLOW; /* jidctred uses islow-style table */ |
| 124 break; | 129 break; |
| 130 case 5: |
| 131 method_ptr = jpeg_idct_5x5; |
| 132 method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 133 break; |
| 134 case 6: |
| 135 method_ptr = jpeg_idct_6x6; |
| 136 method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 137 break; |
| 138 case 7: |
| 139 method_ptr = jpeg_idct_7x7; |
| 140 method = JDCT_ISLOW; /* jidctint uses islow-style table */ |
| 141 break; |
| 125 #endif | 142 #endif |
| 126 case DCTSIZE: | 143 case DCTSIZE: |
| 127 switch (cinfo->dct_method) { | 144 switch (cinfo->dct_method) { |
| 128 #ifdef DCT_ISLOW_SUPPORTED | 145 #ifdef DCT_ISLOW_SUPPORTED |
| 129 case JDCT_ISLOW: | 146 case JDCT_ISLOW: |
| 130 if (jsimd_can_idct_islow()) | 147 if (jsimd_can_idct_islow()) |
| 131 method_ptr = jsimd_idct_islow; | 148 method_ptr = jsimd_idct_islow; |
| 132 else | 149 else |
| 133 method_ptr = jpeg_idct_islow; | 150 method_ptr = jpeg_idct_islow; |
| 134 method = JDCT_ISLOW; | 151 method = JDCT_ISLOW; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 150 else | 167 else |
| 151 method_ptr = jpeg_idct_float; | 168 method_ptr = jpeg_idct_float; |
| 152 method = JDCT_FLOAT; | 169 method = JDCT_FLOAT; |
| 153 break; | 170 break; |
| 154 #endif | 171 #endif |
| 155 default: | 172 default: |
| 156 ERREXIT(cinfo, JERR_NOT_COMPILED); | 173 ERREXIT(cinfo, JERR_NOT_COMPILED); |
| 157 break; | 174 break; |
| 158 } | 175 } |
| 159 break; | 176 break; |
| 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; |
| 160 default: | 209 default: |
| 161 ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->_DCT_scaled_size); | 210 ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->_DCT_scaled_size); |
| 162 break; | 211 break; |
| 163 } | 212 } |
| 164 idct->pub.inverse_DCT[ci] = method_ptr; | 213 idct->pub.inverse_DCT[ci] = method_ptr; |
| 165 /* Create multiplier table from quant table. | 214 /* Create multiplier table from quant table. |
| 166 * However, we can skip this if the component is uninteresting | 215 * However, we can skip this if the component is uninteresting |
| 167 * or if we already built the table. Also, if no quant table | 216 * or if we already built the table. Also, if no quant table |
| 168 * has yet been saved for the component, we leave the | 217 * has yet been saved for the component, we leave the |
| 169 * multiplier table all-zero; we'll be reading zeroes from the | 218 * multiplier table all-zero; we'll be reading zeroes from the |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 ci++, compptr++) { | 328 ci++, compptr++) { |
| 280 /* Allocate and pre-zero a multiplier table for each component */ | 329 /* Allocate and pre-zero a multiplier table for each component */ |
| 281 compptr->dct_table = | 330 compptr->dct_table = |
| 282 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, | 331 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
| 283 SIZEOF(multiplier_table)); | 332 SIZEOF(multiplier_table)); |
| 284 MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); | 333 MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); |
| 285 /* Mark multiplier table not yet set up for any method */ | 334 /* Mark multiplier table not yet set up for any method */ |
| 286 idct->cur_method[ci] = -1; | 335 idct->cur_method[ci] = -1; |
| 287 } | 336 } |
| 288 } | 337 } |
| OLD | NEW |