10 #define JPEG_INTERNALS 19 #ifdef ENTROPY_OPT_SUPPORTED 20 #define FULL_COEF_BUFFER_SUPPORTED 22 #ifdef C_MULTISCAN_FILES_SUPPORTED 23 #define FULL_COEF_BUFFER_SUPPORTED 59 #ifdef FULL_COEF_BUFFER_SUPPORTED 76 if (cinfo->comps_in_scan > 1)
84 cinfo->cur_comp_info[0]->v_samp_factor;
87 cinfo->cur_comp_info[0]->last_row_height;
110 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
113 #ifdef FULL_COEF_BUFFER_SUPPORTED 116 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
121 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
126 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
146 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
147 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
148 int blkn, bi, ci, yindex,
yoffset, blockcnt;
156 for (MCU_col_num = coef->
mcu_ctr; MCU_col_num <= last_MCU_col;
175 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
177 compptr = cinfo->cur_comp_info[ci];
178 blockcnt = (MCU_col_num < last_MCU_col)
187 yoffset + yindex < compptr->last_row_height)
189 (*cinfo->fdct->forward_DCT)(
193 if (blockcnt < compptr->MCU_width)
228 if (!(*cinfo->entropy->encode_mcu)(cinfo, coef->
MCU_buffer))
245 #ifdef FULL_COEF_BUFFER_SUPPORTED 272 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
273 JDIMENSION blocks_across, MCUs_across, MCUindex;
274 int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
280 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
284 buffer = (*cinfo->mem->access_virt_barray)(
301 ndummy = (int)(blocks_across % h_samp_factor);
302 if (ndummy > 0) ndummy = h_samp_factor - ndummy;
306 for (block_row = 0; block_row < block_rows; block_row++)
308 thisblockrow =
buffer[block_row];
309 (*cinfo->fdct->forward_DCT)(
310 cinfo,
compptr, input_buf[ci], thisblockrow,
316 thisblockrow += blocks_across;
318 lastDC = thisblockrow[-1][0];
319 for (bi = 0; bi < ndummy; bi++)
321 thisblockrow[bi][0] = lastDC;
332 blocks_across += ndummy;
333 MCUs_across = blocks_across / h_samp_factor;
337 thisblockrow =
buffer[block_row];
338 lastblockrow =
buffer[block_row - 1];
340 (
void FAR*)thisblockrow,
342 for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++)
344 lastDC = lastblockrow[h_samp_factor - 1][0];
345 for (bi = 0; bi < h_samp_factor; bi++)
347 thisblockrow[bi][0] = lastDC;
351 lastblockrow += h_samp_factor;
379 int blkn, ci, xindex, yindex,
yoffset;
389 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
391 compptr = cinfo->cur_comp_info[ci];
392 buffer[ci] = (*cinfo->mem->access_virt_barray)(
402 for (MCU_col_num = coef->
mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
407 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
409 compptr = cinfo->cur_comp_info[ci];
421 if (!(*cinfo->entropy->encode_mcu)(cinfo, coef->
MCU_buffer))
455 if (need_full_buffer)
457 #ifdef FULL_COEF_BUFFER_SUPPORTED 463 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
466 coef->
whole_image[ci] = (*cinfo->mem->request_virt_barray)(
477 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
jzero_far(void FAR *target, size_t bytestozero)
compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
#define MAX_COMPS_IN_SCAN
jround_up(long a, long b)
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
for(ctr=DCTSIZE;ctr > 0;ctr--)
compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
JDIMENSION width_in_blocks
struct jpeg_c_coef_controller pub
JDIMENSION height_in_blocks
GLint GLint GLint yoffset
#define C_MAX_BLOCKS_IN_MCU
compress_output(j_compress_ptr cinfo, JSAMPIMAGE)
start_iMCU_row(j_compress_ptr cinfo)
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
compress_data JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf))
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]
jpeg_component_info * compptr
int MCU_rows_per_iMCU_row
jvirt_barray_ptr whole_image[MAX_COMPONENTS]
my_coef_controller * my_coef_ptr