10 #define JPEG_INTERNALS 30 #ifdef DCT_FLOAT_SUPPORTED 57 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
63 cinfo->quant_tbl_ptrs[qtblno] ==
nullptr)
64 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
65 qtbl = cinfo->quant_tbl_ptrs[qtblno];
69 switch (cinfo->dct_method)
71 #ifdef DCT_ISLOW_SUPPORTED 76 if (fdct->
divisors[qtblno] ==
nullptr)
79 (
DCTELEM*)(*cinfo->mem->alloc_small)(
86 dtbl[i] = ((
DCTELEM)qtbl->quantval[i]) << 3;
90 #ifdef DCT_IFAST_SUPPORTED 102 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
103 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
104 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
105 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
106 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
107 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
108 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
109 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247};
112 if (fdct->
divisors[qtblno] ==
nullptr)
115 (
DCTELEM*)(*cinfo->mem->alloc_small)(
124 (
INT32)qtbl->quantval[i], (
INT32)aanscales[i]),
130 #ifdef DCT_FLOAT_SUPPORTED 146 static const double aanscalefactor[
DCTSIZE] = {
147 1.0, 1.387039845, 1.306562965, 1.175875602,
148 1.0, 0.785694958, 0.541196100, 0.275899379};
153 (FAST_FLOAT*)(*cinfo->mem->alloc_small)(
161 for (col = 0; col <
DCTSIZE; col++)
163 fdtbl[i] = (FAST_FLOAT)(
165 (((
double)qtbl->quantval[i] * aanscalefactor[
row] *
166 aanscalefactor[col] * 8.0)));
174 ERREXIT(cinfo, JERR_NOT_COMPILED);
197 forward_DCT_method_ptr do_dct = fdct->
do_dct;
202 sample_data += start_row;
204 for (bi = 0; bi < num_blocks; bi++, start_col +=
DCTSIZE)
213 for (elemr = 0; elemr <
DCTSIZE; elemr++)
215 elemptr = sample_data[elemr] + start_col;
228 for (elemc =
DCTSIZE; elemc > 0; elemc--)
245 JCOEFPTR output_ptr = coef_blocks[bi];
264 #define DIVIDE_BY(a, b) a /= b 266 #define DIVIDE_BY(a, b) \ 284 output_ptr[i] = (
JCOEF)temp;
290 #ifdef DCT_FLOAT_SUPPORTED 306 sample_data += start_row;
308 for (bi = 0; bi < num_blocks; bi++, start_col +=
DCTSIZE)
312 FAST_FLOAT* workspaceptr;
317 for (elemr = 0; elemr <
DCTSIZE; elemr++)
319 elemptr = sample_data[elemr] + start_col;
340 for (elemc =
DCTSIZE; elemc > 0; elemc--)
342 *workspaceptr++ = (FAST_FLOAT)(
357 JCOEFPTR output_ptr = coef_blocks[bi];
373 (
JCOEF)((
int)(temp + (FAST_FLOAT)16384.5) - 16384);
396 switch (cinfo->dct_method)
398 #ifdef DCT_ISLOW_SUPPORTED 401 fdct->
do_dct = jpeg_fdct_islow;
404 #ifdef DCT_IFAST_SUPPORTED 407 fdct->
do_dct = jpeg_fdct_ifast;
410 #ifdef DCT_FLOAT_SUPPORTED 417 ERREXIT(cinfo, JERR_NOT_COMPILED);
425 #ifdef DCT_FLOAT_SUPPORTED
forward_DCT_method_ptr do_dct
FAST_FLOAT workspace[DCTSIZE2]
my_fdct_controller * my_fdct_ptr
FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]
forward_DCT_float(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks)
struct jpeg_common_struct * j_common_ptr
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
for(ctr=DCTSIZE;ctr > 0;ctr--)
DCTELEM * divisors[NUM_QUANT_TBLS]
float_DCT_method_ptr do_float_dct
struct jpeg_forward_dct pub
forward_DCT(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks)
#define ERREXIT1(cinfo, code, p1)
jinit_forward_dct(j_compress_ptr cinfo)
GLenum GLenum GLvoid * row
start_pass_fdctmgr(j_compress_ptr cinfo)
jpeg_component_info * compptr
#define MULTIPLY16V16(var1, var2)