00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #if BITS_IN_JSAMPLE == 8
00035 typedef int DCTELEM;
00036 #else
00037 typedef INT32 DCTELEM;
00038 #endif
00039
00040 typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data,
00041 JSAMPARRAY sample_data,
00042 JDIMENSION start_col));
00043 typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data,
00044 JSAMPARRAY sample_data,
00045 JDIMENSION start_col));
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 typedef MULTIPLIER ISLOW_MULT_TYPE;
00066 #if BITS_IN_JSAMPLE == 8
00067 typedef MULTIPLIER IFAST_MULT_TYPE;
00068 #define IFAST_SCALE_BITS 2
00069 #else
00070 typedef INT32 IFAST_MULT_TYPE;
00071 #define IFAST_SCALE_BITS 13
00072 #endif
00073 typedef FAST_FLOAT FLOAT_MULT_TYPE;
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 #define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
00086
00087 #define RANGE_MASK (MAXJSAMPLE * 4 + 3)
00088
00089
00090
00091
00092 #ifdef NEED_SHORT_EXTERNAL_NAMES
00093 #define jpeg_fdct_islow jFDislow
00094 #define jpeg_fdct_ifast jFDifast
00095 #define jpeg_fdct_float jFDfloat
00096 #define jpeg_fdct_7x7 jFD7x7
00097 #define jpeg_fdct_6x6 jFD6x6
00098 #define jpeg_fdct_5x5 jFD5x5
00099 #define jpeg_fdct_4x4 jFD4x4
00100 #define jpeg_fdct_3x3 jFD3x3
00101 #define jpeg_fdct_2x2 jFD2x2
00102 #define jpeg_fdct_1x1 jFD1x1
00103 #define jpeg_fdct_9x9 jFD9x9
00104 #define jpeg_fdct_10x10 jFD10x10
00105 #define jpeg_fdct_11x11 jFD11x11
00106 #define jpeg_fdct_12x12 jFD12x12
00107 #define jpeg_fdct_13x13 jFD13x13
00108 #define jpeg_fdct_14x14 jFD14x14
00109 #define jpeg_fdct_15x15 jFD15x15
00110 #define jpeg_fdct_16x16 jFD16x16
00111 #define jpeg_fdct_16x8 jFD16x8
00112 #define jpeg_fdct_14x7 jFD14x7
00113 #define jpeg_fdct_12x6 jFD12x6
00114 #define jpeg_fdct_10x5 jFD10x5
00115 #define jpeg_fdct_8x4 jFD8x4
00116 #define jpeg_fdct_6x3 jFD6x3
00117 #define jpeg_fdct_4x2 jFD4x2
00118 #define jpeg_fdct_2x1 jFD2x1
00119 #define jpeg_fdct_8x16 jFD8x16
00120 #define jpeg_fdct_7x14 jFD7x14
00121 #define jpeg_fdct_6x12 jFD6x12
00122 #define jpeg_fdct_5x10 jFD5x10
00123 #define jpeg_fdct_4x8 jFD4x8
00124 #define jpeg_fdct_3x6 jFD3x6
00125 #define jpeg_fdct_2x4 jFD2x4
00126 #define jpeg_fdct_1x2 jFD1x2
00127 #define jpeg_idct_islow jRDislow
00128 #define jpeg_idct_ifast jRDifast
00129 #define jpeg_idct_float jRDfloat
00130 #define jpeg_idct_7x7 jRD7x7
00131 #define jpeg_idct_6x6 jRD6x6
00132 #define jpeg_idct_5x5 jRD5x5
00133 #define jpeg_idct_4x4 jRD4x4
00134 #define jpeg_idct_3x3 jRD3x3
00135 #define jpeg_idct_2x2 jRD2x2
00136 #define jpeg_idct_1x1 jRD1x1
00137 #define jpeg_idct_9x9 jRD9x9
00138 #define jpeg_idct_10x10 jRD10x10
00139 #define jpeg_idct_11x11 jRD11x11
00140 #define jpeg_idct_12x12 jRD12x12
00141 #define jpeg_idct_13x13 jRD13x13
00142 #define jpeg_idct_14x14 jRD14x14
00143 #define jpeg_idct_15x15 jRD15x15
00144 #define jpeg_idct_16x16 jRD16x16
00145 #define jpeg_idct_16x8 jRD16x8
00146 #define jpeg_idct_14x7 jRD14x7
00147 #define jpeg_idct_12x6 jRD12x6
00148 #define jpeg_idct_10x5 jRD10x5
00149 #define jpeg_idct_8x4 jRD8x4
00150 #define jpeg_idct_6x3 jRD6x3
00151 #define jpeg_idct_4x2 jRD4x2
00152 #define jpeg_idct_2x1 jRD2x1
00153 #define jpeg_idct_8x16 jRD8x16
00154 #define jpeg_idct_7x14 jRD7x14
00155 #define jpeg_idct_6x12 jRD6x12
00156 #define jpeg_idct_5x10 jRD5x10
00157 #define jpeg_idct_4x8 jRD4x8
00158 #define jpeg_idct_3x6 jRD3x8
00159 #define jpeg_idct_2x4 jRD2x4
00160 #define jpeg_idct_1x2 jRD1x2
00161 #endif
00162
00163
00164
00165 EXTERN(void) jpeg_fdct_islow
00166 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00167 EXTERN(void) jpeg_fdct_ifast
00168 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00169 EXTERN(void) jpeg_fdct_float
00170 JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00171 EXTERN(void) jpeg_fdct_7x7
00172 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00173 EXTERN(void) jpeg_fdct_6x6
00174 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00175 EXTERN(void) jpeg_fdct_5x5
00176 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00177 EXTERN(void) jpeg_fdct_4x4
00178 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00179 EXTERN(void) jpeg_fdct_3x3
00180 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00181 EXTERN(void) jpeg_fdct_2x2
00182 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00183 EXTERN(void) jpeg_fdct_1x1
00184 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00185 EXTERN(void) jpeg_fdct_9x9
00186 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00187 EXTERN(void) jpeg_fdct_10x10
00188 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00189 EXTERN(void) jpeg_fdct_11x11
00190 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00191 EXTERN(void) jpeg_fdct_12x12
00192 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00193 EXTERN(void) jpeg_fdct_13x13
00194 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00195 EXTERN(void) jpeg_fdct_14x14
00196 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00197 EXTERN(void) jpeg_fdct_15x15
00198 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00199 EXTERN(void) jpeg_fdct_16x16
00200 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00201 EXTERN(void) jpeg_fdct_16x8
00202 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00203 EXTERN(void) jpeg_fdct_14x7
00204 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00205 EXTERN(void) jpeg_fdct_12x6
00206 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00207 EXTERN(void) jpeg_fdct_10x5
00208 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00209 EXTERN(void) jpeg_fdct_8x4
00210 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00211 EXTERN(void) jpeg_fdct_6x3
00212 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00213 EXTERN(void) jpeg_fdct_4x2
00214 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00215 EXTERN(void) jpeg_fdct_2x1
00216 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00217 EXTERN(void) jpeg_fdct_8x16
00218 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00219 EXTERN(void) jpeg_fdct_7x14
00220 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00221 EXTERN(void) jpeg_fdct_6x12
00222 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00223 EXTERN(void) jpeg_fdct_5x10
00224 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00225 EXTERN(void) jpeg_fdct_4x8
00226 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00227 EXTERN(void) jpeg_fdct_3x6
00228 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00229 EXTERN(void) jpeg_fdct_2x4
00230 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00231 EXTERN(void) jpeg_fdct_1x2
00232 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
00233
00234 EXTERN(void) jpeg_idct_islow
00235 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00236 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00237 EXTERN(void) jpeg_idct_ifast
00238 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00239 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00240 EXTERN(void) jpeg_idct_float
00241 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00242 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00243 EXTERN(void) jpeg_idct_7x7
00244 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00245 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00246 EXTERN(void) jpeg_idct_6x6
00247 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00248 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00249 EXTERN(void) jpeg_idct_5x5
00250 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00251 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00252 EXTERN(void) jpeg_idct_4x4
00253 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00254 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00255 EXTERN(void) jpeg_idct_3x3
00256 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00257 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00258 EXTERN(void) jpeg_idct_2x2
00259 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00260 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00261 EXTERN(void) jpeg_idct_1x1
00262 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00263 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00264 EXTERN(void) jpeg_idct_9x9
00265 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00266 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00267 EXTERN(void) jpeg_idct_10x10
00268 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00269 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00270 EXTERN(void) jpeg_idct_11x11
00271 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00272 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00273 EXTERN(void) jpeg_idct_12x12
00274 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00275 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00276 EXTERN(void) jpeg_idct_13x13
00277 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00278 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00279 EXTERN(void) jpeg_idct_14x14
00280 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00281 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00282 EXTERN(void) jpeg_idct_15x15
00283 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00284 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00285 EXTERN(void) jpeg_idct_16x16
00286 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00287 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00288 EXTERN(void) jpeg_idct_16x8
00289 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00290 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00291 EXTERN(void) jpeg_idct_14x7
00292 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00293 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00294 EXTERN(void) jpeg_idct_12x6
00295 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00296 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00297 EXTERN(void) jpeg_idct_10x5
00298 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00299 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00300 EXTERN(void) jpeg_idct_8x4
00301 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00302 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00303 EXTERN(void) jpeg_idct_6x3
00304 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00305 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00306 EXTERN(void) jpeg_idct_4x2
00307 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00308 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00309 EXTERN(void) jpeg_idct_2x1
00310 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00311 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00312 EXTERN(void) jpeg_idct_8x16
00313 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00314 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00315 EXTERN(void) jpeg_idct_7x14
00316 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00317 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00318 EXTERN(void) jpeg_idct_6x12
00319 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00320 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00321 EXTERN(void) jpeg_idct_5x10
00322 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00323 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00324 EXTERN(void) jpeg_idct_4x8
00325 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00326 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00327 EXTERN(void) jpeg_idct_3x6
00328 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00329 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00330 EXTERN(void) jpeg_idct_2x4
00331 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00332 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00333 EXTERN(void) jpeg_idct_1x2
00334 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
00335 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348 #define ONE ((INT32) 1)
00349 #define CONST_SCALE (ONE << CONST_BITS)
00350
00351
00352
00353
00354
00355
00356 #define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
00357
00358
00359
00360
00361
00362
00363 #define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374 #ifdef SHORTxSHORT_32
00375 #define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const)))
00376 #endif
00377 #ifdef SHORTxLCONST_32
00378 #define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const)))
00379 #endif
00380
00381 #ifndef MULTIPLY16C16
00382 #define MULTIPLY16C16(var,const) ((var) * (const))
00383 #endif
00384
00385
00386
00387 #ifdef SHORTxSHORT_32
00388 #define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2)))
00389 #endif
00390
00391 #ifndef MULTIPLY16V16
00392 #define MULTIPLY16V16(var1,var2) ((var1) * (var2))
00393 #endif