16 #define JPEG_INTERNALS 132 } my_main_controller;
137 #define CTX_PREPARE_FOR_IMCU 0 138 #define CTX_PROCESS_IMCU 1 139 #define CTX_POSTPONED_ROW 2 149 #ifdef QUANT_2PASS_SUPPORTED 187 main->xbuffer[0][ci] = xbuf;
188 xbuf += rgroup * (M + 4);
189 main->xbuffer[1][ci] = xbuf;
205 int M = cinfo->min_DCT_scaled_size;
209 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
212 cinfo->min_DCT_scaled_size;
213 xbuf0 = main->xbuffer[0][ci];
214 xbuf1 = main->xbuffer[1][ci];
216 buf = main->buffer[ci];
217 for (
i = 0;
i < rgroup * (M + 2);
i++) {
218 xbuf0[
i] = xbuf1[
i] = buf[
i];
221 for (
i = 0;
i < rgroup * 2;
i++) {
222 xbuf1[rgroup*(M-2) +
i] = buf[rgroup*M +
i];
223 xbuf1[rgroup*M +
i] = buf[rgroup*(M-2) +
i];
230 for (
i = 0;
i < rgroup;
i++) {
231 xbuf0[
i - rgroup] = xbuf0[0];
245 int M = cinfo->min_DCT_scaled_size;
249 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
252 cinfo->min_DCT_scaled_size;
253 xbuf0 = main->xbuffer[0][ci];
254 xbuf1 = main->xbuffer[1][ci];
255 for (
i = 0;
i < rgroup;
i++) {
256 xbuf0[
i - rgroup] = xbuf0[rgroup*(M+1) +
i];
257 xbuf1[
i - rgroup] = xbuf1[rgroup*(M+1) +
i];
258 xbuf0[rgroup*(M+2) +
i] = xbuf0[
i];
259 xbuf1[rgroup*(M+2) +
i] = xbuf1[
i];
273 int ci,
i, rgroup, iMCUheight, rows_left;
277 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
281 rgroup = iMCUheight / cinfo->min_DCT_scaled_size;
284 if (rows_left == 0) rows_left = iMCUheight;
289 main->rowgroups_avail = (
JDIMENSION) ((rows_left-1) / rgroup + 1);
294 xbuf = main->xbuffer[main->whichptr][ci];
295 for (
i = 0;
i < rgroup * 2;
i++) {
296 xbuf[rows_left +
i] = xbuf[rows_left-1];
313 if (cinfo->upsample->need_context_rows) {
318 main->iMCU_row_ctr = 0;
323 main->buffer_full =
FALSE;
324 main->rowgroup_ctr = 0;
326 #ifdef QUANT_2PASS_SUPPORTED 333 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
353 if (! main->buffer_full) {
354 if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
356 main->buffer_full =
TRUE;
360 rowgroups_avail = (
JDIMENSION) cinfo->min_DCT_scaled_size;
367 (*cinfo->post->post_process_data) (cinfo, main->buffer,
368 &main->rowgroup_ctr, rowgroups_avail,
372 if (main->rowgroup_ctr >= rowgroups_avail) {
373 main->buffer_full =
FALSE;
374 main->rowgroup_ctr = 0;
392 if (! main->buffer_full) {
393 if (! (*cinfo->coef->decompress_data) (cinfo,
394 main->xbuffer[main->whichptr]))
396 main->buffer_full =
TRUE;
397 main->iMCU_row_ctr++;
405 switch (main->context_state) {
408 (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
409 &main->rowgroup_ctr, main->rowgroups_avail,
410 output_buf, out_row_ctr, out_rows_avail);
411 if (main->rowgroup_ctr < main->rowgroups_avail)
414 if (*out_row_ctr >= out_rows_avail)
419 main->rowgroup_ctr = 0;
420 main->rowgroups_avail = (
JDIMENSION) (cinfo->min_DCT_scaled_size - 1);
424 if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
430 (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
431 &main->rowgroup_ctr, main->rowgroups_avail,
432 output_buf, out_row_ctr, out_rows_avail);
433 if (main->rowgroup_ctr < main->rowgroups_avail)
436 if (main->iMCU_row_ctr == 1)
440 main->buffer_full =
FALSE;
443 main->rowgroup_ctr = (
JDIMENSION) (cinfo->min_DCT_scaled_size + 1);
444 main->rowgroups_avail = (
JDIMENSION) (cinfo->min_DCT_scaled_size + 2);
456 #ifdef QUANT_2PASS_SUPPORTED 479 int ci, rgroup, ngroups;
484 SIZEOF(my_main_controller));
488 if (need_full_buffer)
489 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
494 if (cinfo->upsample->need_context_rows) {
495 if (cinfo->min_DCT_scaled_size < 2)
497 alloc_funny_pointers(cinfo);
498 ngroups = cinfo->min_DCT_scaled_size + 2;
500 ngroups = cinfo->min_DCT_scaled_size;
503 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
506 cinfo->min_DCT_scaled_size;
507 main->buffer[ci] = (*cinfo->mem->alloc_sarray)
for(n=1;n< outline->n_points;n++)
jinit_d_main_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
set_bottom_pointers(j_decompress_ptr cinfo)
jpeg_component_info * comp_info
struct jpeg_d_main_controller * main
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
start_pass_main(j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
jpeg_component_info * compptr
JDIMENSION width_in_blocks
GLenum GLuint GLenum GLsizei const GLchar * buf
my_main_controller * my_main_ptr
#define CTX_PREPARE_FOR_IMCU
#define CTX_POSTPONED_ROW
process_data_simple_main(j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
process_data_context_main(j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
make_funny_pointers(j_decompress_ptr cinfo)
if(!abbox) return FT_THROW(Invalid_Argument)
set_wraparound_pointers(j_decompress_ptr cinfo)
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
process_data_crank_post(j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
my_main_controller * my_main_ptr
JDIMENSION downsampled_height