24#ifndef D_PROGRESSIVE_SUPPORTED
25#undef BLOCK_SMOOTHING_SUPPORTED
38 int MCU_rows_per_iMCU_row;
50#ifdef D_MULTISCAN_FILES_SUPPORTED
55#ifdef BLOCK_SMOOTHING_SUPPORTED
57 int * coef_bits_latch;
71#ifdef D_MULTISCAN_FILES_SUPPORTED
75#ifdef BLOCK_SMOOTHING_SUPPORTED
113 cinfo->input_iMCU_row = 0;
125#ifdef BLOCK_SMOOTHING_SUPPORTED
130 if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
131 coef->
pub.decompress_data = decompress_smooth_data;
133 coef->
pub.decompress_data = decompress_data;
136 cinfo->output_iMCU_row = 0;
155 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
156 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
157 int ci, xindex, yindex,
yoffset, useful_width;
162 inverse_DCT_method_ptr inverse_DCT;
167 for (MCU_col_num = coef->
MCU_ctr; MCU_col_num <= last_MCU_col;
173 if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->
MCU_buffer)) {
183 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
184 compptr = cinfo->cur_comp_info[ci];
197 if (cinfo->input_iMCU_row < last_iMCU_row ||
198 yoffset + yindex < compptr->last_row_height) {
200 for (xindex = 0; xindex < useful_width; xindex++) {
215 cinfo->output_iMCU_row++;
216 if (++(cinfo->input_iMCU_row) <= last_iMCU_row) {
221 (*cinfo->inputctl->finish_input_pass) (cinfo);
237#ifdef D_MULTISCAN_FILES_SUPPORTED
251 int ci, xindex, yindex,
yoffset;
261 buffer[ci] = (*cinfo->mem->access_virt_barray)
274 for (MCU_col_num = coef->
MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
285 *blkp++ = buffer_ptr++;
306 (*cinfo->
inputctl->finish_input_pass) (cinfo);
325 int ci, block_row, block_rows;
331 inverse_DCT_method_ptr inverse_DCT;
348 buffer = (*cinfo->mem->access_virt_barray)
360 inverse_DCT = cinfo->
idct->inverse_DCT[ci];
363 for (block_row = 0; block_row < block_rows; block_row++) {
364 buffer_ptr =
buffer[block_row];
384#ifdef BLOCK_SMOOTHING_SUPPORTED
413 boolean smoothing_useful =
FALSE;
418 int * coef_bits_latch;
424 if (coef->coef_bits_latch ==
NULL)
425 coef->coef_bits_latch = (
int *) (*cinfo->mem->alloc_small)
428 coef_bits_latch = coef->coef_bits_latch;
436 if (qtable->quantval[0] == 0 ||
437 qtable->quantval[Q01_POS] == 0 ||
438 qtable->quantval[Q10_POS] == 0 ||
439 qtable->quantval[Q20_POS] == 0 ||
440 qtable->quantval[Q11_POS] == 0 ||
441 qtable->quantval[Q02_POS] == 0)
445 if (coef_bits[0] < 0)
448 for (coefi = 1; coefi <= 5; coefi++) {
449 coef_bits_latch[coefi] = coef_bits[coefi];
450 if (coef_bits[coefi] != 0)
451 smoothing_useful =
TRUE;
453 coef_bits_latch += SAVED_COEFS;
456 return smoothing_useful;
470 int ci, block_row, block_rows, access_rows;
472 JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
476 inverse_DCT_method_ptr inverse_DCT;
477 boolean first_row, last_row;
482 int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
511 access_rows = block_rows * 2;
517 access_rows = block_rows;
523 buffer = (*cinfo->mem->access_virt_barray)
530 buffer = (*cinfo->mem->access_virt_barray)
536 coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
539 Q01 = quanttbl->quantval[Q01_POS];
540 Q10 = quanttbl->quantval[Q10_POS];
541 Q20 = quanttbl->quantval[Q20_POS];
542 Q11 = quanttbl->quantval[Q11_POS];
543 Q02 = quanttbl->quantval[Q02_POS];
544 inverse_DCT = cinfo->
idct->inverse_DCT[ci];
547 for (block_row = 0; block_row < block_rows; block_row++) {
548 buffer_ptr =
buffer[block_row];
549 if (first_row && block_row == 0)
550 prev_block_row = buffer_ptr;
552 prev_block_row =
buffer[block_row-1];
553 if (last_row && block_row == block_rows-1)
554 next_block_row = buffer_ptr;
556 next_block_row =
buffer[block_row+1];
560 DC1 = DC2 = DC3 = (
int) prev_block_row[0][0];
561 DC4 = DC5 = DC6 = (
int) buffer_ptr[0][0];
562 DC7 = DC8 = DC9 = (
int) next_block_row[0][0];
565 for (block_num = 0; block_num <= last_block_column; block_num++) {
569 if (block_num < last_block_column) {
570 DC3 = (
int) prev_block_row[1][0];
571 DC6 = (
int) buffer_ptr[1][0];
572 DC9 = (
int) next_block_row[1][0];
579 if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
580 num = 36 * Q00 * (DC4 - DC6);
582 pred = (
int) (((Q01<<7) +
num) / (Q01<<8));
583 if (Al > 0 && pred >= (1<<Al))
586 pred = (
int) (((Q01<<7) -
num) / (Q01<<8));
587 if (Al > 0 && pred >= (1<<Al))
591 workspace[1] = (
JCOEF) pred;
594 if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
595 num = 36 * Q00 * (DC2 - DC8);
597 pred = (
int) (((Q10<<7) +
num) / (Q10<<8));
598 if (Al > 0 && pred >= (1<<Al))
601 pred = (
int) (((Q10<<7) -
num) / (Q10<<8));
602 if (Al > 0 && pred >= (1<<Al))
606 workspace[8] = (
JCOEF) pred;
609 if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
610 num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
612 pred = (
int) (((Q20<<7) +
num) / (Q20<<8));
613 if (Al > 0 && pred >= (1<<Al))
616 pred = (
int) (((Q20<<7) -
num) / (Q20<<8));
617 if (Al > 0 && pred >= (1<<Al))
621 workspace[16] = (
JCOEF) pred;
624 if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
625 num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
627 pred = (
int) (((Q11<<7) +
num) / (Q11<<8));
628 if (Al > 0 && pred >= (1<<Al))
631 pred = (
int) (((Q11<<7) -
num) / (Q11<<8));
632 if (Al > 0 && pred >= (1<<Al))
636 workspace[9] = (
JCOEF) pred;
639 if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
640 num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
642 pred = (
int) (((Q02<<7) +
num) / (Q02<<8));
643 if (Al > 0 && pred >= (1<<Al))
646 pred = (
int) (((Q02<<7) -
num) / (Q02<<8));
647 if (Al > 0 && pred >= (1<<Al))
651 workspace[2] = (
JCOEF) pred;
657 DC1 = DC2; DC2 = DC3;
658 DC4 = DC5; DC5 = DC6;
659 DC7 = DC8; DC8 = DC9;
660 buffer_ptr++, prev_block_row++, next_block_row++;
685#ifdef D_MULTISCAN_FILES_SUPPORTED
695 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
698#ifdef BLOCK_SMOOTHING_SUPPORTED
700 if (cinfo->progressive_mode)
703 coef->
whole_image[ci] = (*cinfo->mem->request_virt_barray)
711 coef->
pub.consume_data = consume_data;
712 coef->
pub.decompress_data = decompress_data;
715 ERREXIT(cinfo, JERR_NOT_COMPILED);
726 if (cinfo->lim_Se == 0)
731 *blkp++ = buffer_ptr++;
740#ifdef BLOCK_SMOOTHING_SUPPORTED
741 coef->coef_bits_latch =
NULL;
743 cinfo->coef = &coef->
pub;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
for(i=0;i< ARRAY_SIZE(offsets);i++)
GLint GLint GLint yoffset
start_iMCU_row(j_compress_ptr cinfo)
dummy_consume_data(j_decompress_ptr cinfo)
jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
my_coef_controller * my_coef_ptr
start_input_pass(j_decompress_ptr cinfo)
decompress_onepass(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
start_output_pass(j_decompress_ptr cinfo)
jpeg_component_info JCOEFPTR JSAMPARRAY JDIMENSION output_col
JSAMPARRAY JDIMENSION start_col
jpeg_component_info * compptr
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
struct jpeg_common_struct * j_common_ptr
#define JPEG_SCAN_COMPLETED
#define JPEG_ROW_COMPLETED
#define MAX_COMPS_IN_SCAN
#define D_MAX_BLOCKS_IN_MCU
jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks)
jround_up(long a, long b)
UINT16 quantval[DCTSIZE2]
JDIMENSION width_in_blocks
JDIMENSION height_in_blocks
struct jpeg_d_coef_controller * coef
struct jpeg_inverse_dct * idct
int(* coef_bits)[DCTSIZE2]
JDIMENSION input_iMCU_row
JDIMENSION output_iMCU_row
JDIMENSION total_iMCU_rows
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]
struct jpeg_input_controller * inputctl
struct jpeg_entropy_decoder * entropy
jpeg_component_info * comp_info
int MCU_rows_per_iMCU_row
struct jpeg_c_coef_controller pub
jvirt_barray_ptr whole_image[MAX_COMPONENTS]
JBLOCK blk_buffer[C_MAX_BLOCKS_IN_MCU]
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]
#define MEMZERO(addr, type, size)