13 #define JPEG_INTERNALS 20 #if TRANSFORMS_SUPPORTED 84 buffer = (*srcinfo->mem->access_virt_barray)
88 for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
89 ptr1 =
buffer[offset_y][blk_x];
90 ptr2 =
buffer[offset_y][comp_width - blk_x - 1];
115 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
116 int ci, i, j, offset_y;
136 dst_buffer = (*srcinfo->mem->access_virt_barray)
137 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
139 if (dst_blk_y < comp_height) {
141 src_buffer = (*srcinfo->mem->access_virt_barray)
147 src_buffer = (*srcinfo->mem->access_virt_barray)
148 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
152 if (dst_blk_y < comp_height) {
154 dst_row_ptr = dst_buffer[offset_y];
158 dst_ptr = dst_row_ptr[dst_blk_x];
159 src_ptr = src_row_ptr[dst_blk_x];
160 for (i = 0; i <
DCTSIZE; i += 2) {
163 *dst_ptr++ = *src_ptr++;
166 *dst_ptr++ = - *src_ptr++;
187 int ci, i, j, offset_x, offset_y;
201 dst_buffer = (*srcinfo->mem->access_virt_barray)
202 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
207 src_buffer = (*srcinfo->mem->access_virt_barray)
208 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
211 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
212 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
234 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
235 int ci, i, j, offset_x, offset_y;
251 dst_buffer = (*srcinfo->mem->access_virt_barray)
252 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
257 src_buffer = (*srcinfo->mem->access_virt_barray)
258 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
261 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
262 if (dst_blk_x < comp_width) {
264 dst_ptr = dst_buffer[offset_y]
265 [comp_width - dst_blk_x - offset_x - 1];
266 for (i = 0; i <
DCTSIZE; i++) {
275 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
298 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
299 int ci, i, j, offset_x, offset_y;
315 dst_buffer = (*srcinfo->mem->access_virt_barray)
316 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
321 src_buffer = (*srcinfo->mem->access_virt_barray)
322 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
325 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
326 if (dst_blk_y < comp_height) {
328 src_ptr = src_buffer[offset_x]
329 [comp_height - dst_blk_y - offset_y - 1];
330 for (i = 0; i <
DCTSIZE; i++) {
331 for (j = 0; j <
DCTSIZE; j++) {
339 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
362 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
363 int ci, i, j, offset_y;
378 dst_buffer = (*srcinfo->mem->access_virt_barray)
379 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
381 if (dst_blk_y < comp_height) {
383 src_buffer = (*srcinfo->mem->access_virt_barray)
389 src_buffer = (*srcinfo->mem->access_virt_barray)
390 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
394 if (dst_blk_y < comp_height) {
396 dst_row_ptr = dst_buffer[offset_y];
399 for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
400 dst_ptr = dst_row_ptr[dst_blk_x];
401 src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
402 for (i = 0; i <
DCTSIZE; i += 2) {
404 for (j = 0; j <
DCTSIZE; j += 2) {
405 *dst_ptr++ = *src_ptr++;
406 *dst_ptr++ = - *src_ptr++;
409 for (j = 0; j <
DCTSIZE; j += 2) {
410 *dst_ptr++ = - *src_ptr++;
411 *dst_ptr++ = *src_ptr++;
417 dst_ptr = dst_row_ptr[dst_blk_x];
418 src_ptr = src_row_ptr[dst_blk_x];
419 for (i = 0; i <
DCTSIZE; i += 2) {
421 *dst_ptr++ = *src_ptr++;
423 *dst_ptr++ = - *src_ptr++;
428 dst_row_ptr = dst_buffer[offset_y];
429 src_row_ptr = src_buffer[offset_y];
431 for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
432 dst_ptr = dst_row_ptr[dst_blk_x];
433 src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
435 *dst_ptr++ = *src_ptr++;
436 *dst_ptr++ = - *src_ptr++;
441 dst_ptr = dst_row_ptr[dst_blk_x];
442 src_ptr = src_row_ptr[dst_blk_x];
444 *dst_ptr++ = *src_ptr++;
467 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
468 int ci, i, j, offset_x, offset_y;
482 dst_buffer = (*srcinfo->mem->access_virt_barray)
483 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
488 src_buffer = (*srcinfo->mem->access_virt_barray)
489 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
492 if (dst_blk_y < comp_height) {
493 src_ptr = src_buffer[offset_x]
494 [comp_height - dst_blk_y - offset_y - 1];
495 if (dst_blk_x < comp_width) {
497 dst_ptr = dst_buffer[offset_y]
498 [comp_width - dst_blk_x - offset_x - 1];
499 for (i = 0; i <
DCTSIZE; i++) {
500 for (j = 0; j <
DCTSIZE; j++) {
506 for (j = 0; j <
DCTSIZE; j++) {
514 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
515 for (i = 0; i <
DCTSIZE; i++) {
516 for (j = 0; j <
DCTSIZE; j++) {
524 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
525 if (dst_blk_x < comp_width) {
527 dst_ptr = dst_buffer[offset_y]
528 [comp_width - dst_blk_x - offset_x - 1];
529 for (i = 0; i <
DCTSIZE; i++) {
538 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
570 if (
info->force_grayscale &&
574 info->num_components = 1;
580 switch (
info->transform) {
594 for (ci = 0; ci <
info->num_components; ci++) {
596 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
616 for (ci = 0; ci <
info->num_components; ci++) {
618 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
637 int tblno, i, j, ci, itemp;
659 if (qtblptr != NULL) {
660 for (i = 0; i <
DCTSIZE; i++) {
661 for (j = 0; j < i; j++) {
677 int ci, max_h_samp_factor;
684 max_h_samp_factor = 1;
687 max_h_samp_factor =
MAX(max_h_samp_factor, h_samp_factor);
697 int ci, max_v_samp_factor;
704 max_v_samp_factor = 1;
707 max_v_samp_factor =
MAX(max_v_samp_factor, v_samp_factor);
733 if (
info->force_grayscale) {
756 switch (
info->transform) {
769 transpose_critical_parameters(
dstinfo);
773 transpose_critical_parameters(
dstinfo);
780 transpose_critical_parameters(
dstinfo);
791 transpose_critical_parameters(
dstinfo);
798 if (
info->workspace_coef_arrays != NULL)
799 return info->workspace_coef_arrays;
800 return src_coef_arrays;
821 switch (
info->transform) {
825 do_flip_h(srcinfo,
dstinfo, src_coef_arrays);
828 do_flip_v(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
831 do_transpose(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
834 do_transverse(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
837 do_rot_90(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
840 do_rot_180(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
843 do_rot_270(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
858 #ifdef SAVE_MARKERS_SUPPORTED 867 for (m = 0; m < 16; m++)
894 marker->data_length >= 5 &&
903 marker->data_length >= 5 &&
910 #ifdef NEED_FAR_POINTERS 915 for (i = 0; i <
marker->data_length; i++)
boolean write_Adobe_marker
UINT16 quantval[DCTSIZE2]
jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks)
J_COLOR_SPACE jpeg_color_space
jpeg_component_info * comp_info
jround_up(long a, long b)
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr
boolean write_JFIF_header
jpeg_component_info * compptr
jvirt_barray_ptr * coef_arrays
JDIMENSION width_in_blocks
jpeg_write_m_byte(j_compress_ptr cinfo, int val)
JDIMENSION height_in_blocks
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
jpeg_write_m_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr, unsigned int datalen)
jpeg_save_markers(j_decompress_ptr cinfo, int marker_code, unsigned int length_limit)
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, JCOPY_OPTION)
jpeg_component_info * comp_info
J_COLOR_SPACE jpeg_color_space