13 #define JPEG_INTERNALS
23 #ifdef ENTROPY_OPT_SUPPORTED
24 #define FULL_COEF_BUFFER_SUPPORTED
26 #ifdef C_MULTISCAN_FILES_SUPPORTED
27 #define FULL_COEF_BUFFER_SUPPORTED
63 #ifdef FULL_COEF_BUFFER_SUPPORTED
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);
149 int blkn, bi, ci, yindex,
yoffset, blockcnt;
156 for (MCU_col_num = coef->
mcu_ctr; MCU_col_num <= last_MCU_col;
170 blockcnt = (MCU_col_num < last_MCU_col) ? compptr->
MCU_width
171 : compptr->last_col_width;
172 xpos = MCU_col_num * compptr->MCU_sample_width;
174 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
176 yoffset+yindex < compptr->last_row_height) {
177 (*cinfo->
fdct->forward_DCT) (cinfo, compptr,
180 if (blockcnt < compptr->MCU_width) {
184 for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
192 for (bi = 0; bi < compptr->MCU_width; bi++) {
196 blkn += compptr->MCU_width;
220 #ifdef FULL_COEF_BUFFER_SUPPORTED
248 JDIMENSION blocks_across, MCUs_across, MCUindex;
249 int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
255 for (ci = 0, compptr = cinfo->
comp_info; ci < cinfo->num_components;
258 buffer = (*cinfo->mem->access_virt_barray)
267 block_rows = (
int) (compptr->height_in_blocks % compptr->v_samp_factor);
268 if (block_rows == 0) block_rows = compptr->v_samp_factor;
270 blocks_across = compptr->width_in_blocks;
271 h_samp_factor = compptr->h_samp_factor;
273 ndummy = (
int) (blocks_across % h_samp_factor);
275 ndummy = h_samp_factor - ndummy;
279 for (block_row = 0; block_row < block_rows; block_row++) {
280 thisblockrow =
buffer[block_row];
281 (*cinfo->
fdct->forward_DCT) (cinfo, compptr,
282 input_buf[ci], thisblockrow,
287 thisblockrow += blocks_across;
289 lastDC = thisblockrow[-1][0];
290 for (bi = 0; bi < ndummy; bi++) {
291 thisblockrow[bi][0] = lastDC;
301 blocks_across += ndummy;
302 MCUs_across = blocks_across / h_samp_factor;
303 for (block_row = block_rows; block_row < compptr->v_samp_factor;
305 thisblockrow =
buffer[block_row];
306 lastblockrow =
buffer[block_row-1];
309 for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
310 lastDC = lastblockrow[h_samp_factor-1][0];
311 for (bi = 0; bi < h_samp_factor; bi++) {
312 thisblockrow[bi][0] = lastDC;
314 thisblockrow += h_samp_factor;
315 lastblockrow += h_samp_factor;
344 int blkn, ci, xindex, yindex,
yoffset;
356 buffer[ci] = (*cinfo->mem->access_virt_barray)
365 for (MCU_col_num = coef->
mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
371 start_col = MCU_col_num * compptr->
MCU_width;
372 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
374 for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
415 if (need_full_buffer) {
416 #ifdef FULL_COEF_BUFFER_SUPPORTED
422 for (ci = 0, compptr = cinfo->
comp_info; ci < cinfo->num_components;
424 coef->
whole_image[ci] = (*cinfo->mem->request_virt_barray)
433 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
METHODDEF boolean compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
struct jpeg_forward_dct * fdct
struct jpeg_common_struct * j_common_ptr
METHODDEF boolean compress_data JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf))
#define ERREXIT(cinfo, code)
struct jpeg_entropy_encoder * entropy
JDIMENSION width_in_blocks
struct jpeg_c_coef_controller pub
JDIMENSION height_in_blocks
METHODDEF boolean compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
struct jpeg_c_coef_controller * coef
my_coef_controller * my_coef_ptr
JDIMENSION total_iMCU_rows
#define C_MAX_BLOCKS_IN_MCU
GLint GLint GLint yoffset
METHODDEF boolean compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
GLOBAL void jzero_far(void FAR *target, size_t bytestozero)
METHODDEF void start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
LOCAL void start_iMCU_row(j_compress_ptr cinfo)
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]
jvirt_barray_ptr whole_image[MAX_COMPONENTS]
if(!ValidDisplayID(prefInfo.prefDisplayID)) prefInfo.prefDisplayID
GLOBAL void jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
#define MAX_COMPS_IN_SCAN
jpeg_component_info * comp_info
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]
GLOBAL long jround_up(long a, long b)
int MCU_rows_per_iMCU_row