14 #define JPEG_INTERNALS 26 forward_DCT_method_ptr do_dct;
34 #ifdef DCT_FLOAT_SUPPORTED 36 float_DCT_method_ptr do_float_dct;
62 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
67 cinfo->quant_tbl_ptrs[qtblno] ==
NULL)
68 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
69 qtbl = cinfo->quant_tbl_ptrs[qtblno];
72 switch (cinfo->dct_method) {
73 #ifdef DCT_ISLOW_SUPPORTED 78 if (fdct->divisors[qtblno] ==
NULL) {
79 fdct->divisors[qtblno] = (
DCTELEM *)
83 dtbl = fdct->divisors[qtblno];
85 dtbl[
i] = ((
DCTELEM) qtbl->quantval[
i]) << 3;
89 #ifdef DCT_IFAST_SUPPORTED 101 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
102 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
103 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
104 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
105 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
106 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
107 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
108 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
112 if (fdct->divisors[qtblno] ==
NULL) {
113 fdct->divisors[qtblno] = (
DCTELEM *)
117 dtbl = fdct->divisors[qtblno];
127 #ifdef DCT_FLOAT_SUPPORTED 140 static const double aanscalefactor[
DCTSIZE] = {
141 1.0, 1.387039845, 1.306562965, 1.175875602,
142 1.0, 0.785694958, 0.541196100, 0.275899379
145 if (fdct->float_divisors[qtblno] ==
NULL) {
146 fdct->float_divisors[qtblno] = (FAST_FLOAT *)
148 DCTSIZE2 *
SIZEOF(FAST_FLOAT));
150 fdtbl = fdct->float_divisors[qtblno];
152 for (row = 0; row <
DCTSIZE; row++) {
153 for (col = 0; col <
DCTSIZE; col++) {
154 fdtbl[
i] = (FAST_FLOAT)
155 (1.0 / (((
double) qtbl->quantval[
i] *
156 aanscalefactor[
row] * aanscalefactor[col] * 8.0)));
164 ERREXIT(cinfo, JERR_NOT_COMPILED);
188 forward_DCT_method_ptr do_dct = fdct->do_dct;
193 sample_data += start_row;
197 {
register DCTELEM *workspaceptr;
201 workspaceptr = workspace;
202 for (elemr = 0; elemr <
DCTSIZE; elemr++) {
203 elemptr = sample_data[elemr] + start_col;
214 {
register int elemc;
215 for (elemc = DCTSIZE; elemc > 0; elemc--) {
224 (*do_dct) (workspace);
229 register JCOEFPTR output_ptr = coef_blocks[bi];
247 #define DIVIDE_BY(a,b) a /= b 249 #define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 260 output_ptr[
i] = (
JCOEF) temp;
267 #ifdef DCT_FLOAT_SUPPORTED 278 float_DCT_method_ptr do_dct = fdct->do_float_dct;
283 sample_data += start_row;
287 {
register FAST_FLOAT *workspaceptr;
291 workspaceptr = workspace;
292 for (elemr = 0; elemr <
DCTSIZE; elemr++) {
293 elemptr = sample_data[elemr] + start_col;
304 {
register int elemc;
305 for (elemc = DCTSIZE; elemc > 0; elemc--) {
306 *workspaceptr++ = (FAST_FLOAT)
315 (*do_dct) (workspace);
318 {
register FAST_FLOAT temp;
320 register JCOEFPTR output_ptr = coef_blocks[bi];
324 temp = workspace[
i] * divisors[
i];
331 output_ptr[
i] = (
JCOEF) ((
int) (temp + (FAST_FLOAT) 16384.5) - 16384);
352 SIZEOF(my_fdct_controller));
356 switch (cinfo->dct_method) {
357 #ifdef DCT_ISLOW_SUPPORTED 363 #ifdef DCT_IFAST_SUPPORTED 369 #ifdef DCT_FLOAT_SUPPORTED 376 ERREXIT(cinfo, JERR_NOT_COMPILED);
382 fdct->divisors[
i] =
NULL;
383 #ifdef DCT_FLOAT_SUPPORTED 384 fdct->float_divisors[
i] =
NULL;
for(n=1;n< outline->n_points;n++)
my_fdct_controller * my_fdct_ptr
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)
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)
jinit_forward_dct(j_compress_ptr cinfo)
jpeg_component_info * compptr
GLenum GLenum GLvoid * row
JBLOCKROW JDIMENSION num_blocks
jpeg_fdct_float(FAST_FLOAT *data)
#define ERREXIT1(cinfo, code, p1)
jpeg_fdct_islow(DCTELEM *data)
start_pass_fdctmgr(j_compress_ptr cinfo)
jpeg_fdct_ifast(DCTELEM *data)
#define MULTIPLY16V16(var1, var2)