28#if TRANSFORMS_SUPPORTED
85#ifndef DROP_REQUEST_FROM_SRC
86#define DROP_REQUEST_FROM_SRC 1
90#if DROP_REQUEST_FROM_SRC
96drop_request_virt_barray (
j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
102 return (*srcinfo->mem->request_virt_barray)
103 (srcinfo, pool_id, pre_zero,
104 blocksperrow, numrows, maxaccess);
122 cinfo->
inputctl->consume_input = drop_consume_input;
129 void *save_client_data;
136 save_client_data = dropinfo->client_data;
137 dropinfo->client_data = (
void *) srcinfo;
138 save_request_virt_barray = dropinfo->mem->request_virt_barray;
139 dropinfo->mem->request_virt_barray = drop_request_virt_barray;
140 save_start_input_pass = dropinfo->
inputctl->start_input_pass;
141 dropinfo->
inputctl->start_input_pass = drop_start_input_pass;
149 (
void) jpeg_read_coefficients(dropinfo);
152 dropinfo->client_data = save_client_data;
153 dropinfo->mem->request_virt_barray = save_request_virt_barray;
154 dropinfo->
inputctl->start_input_pass = save_start_input_pass;
158 (*save_start_input_pass)(dropinfo);
177 buffer = (*cinfo->mem->access_virt_barray)
208 buffer = (*cinfo->mem->access_virt_barray)
222#define DIVIDE_BY(a,b) a /= b
224#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
279 requant_comp(dropinfo, compptr2, drop_coef_arrays[ci], qtblptr1);
284 qtblptr3->
quantval[
k] = largest_common_denominator
286 dequant_comp(srcinfo, compptr1, src_coef_arrays[ci], qtblptr3);
287 dequant_comp(dropinfo, compptr2, drop_coef_arrays[ci], qtblptr3);
308 JDIMENSION blk_y, x_drop_blocks, y_drop_blocks;
320 dst_buffer = (*srcinfo->mem->access_virt_barray)
321 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y + y_drop_blocks,
323 if (ci < dropinfo->num_components) {
324#if DROP_REQUEST_FROM_SRC
325 src_buffer = (*srcinfo->mem->access_virt_barray)
328 src_buffer = (*dropinfo->mem->access_virt_barray)
334 dst_buffer[offset_y] + x_drop_blocks,
339 FMEMZERO(dst_buffer[offset_y] + x_drop_blocks,
355 JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;
369 dst_buffer = (*srcinfo->mem->access_virt_barray)
370 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
372 src_buffer = (*srcinfo->mem->access_virt_barray)
374 dst_blk_y + y_crop_blocks,
378 dst_buffer[offset_y],
397 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height;
398 JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;
416 dst_buffer = (*srcinfo->mem->access_virt_barray)
417 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
420 if (dst_blk_y < y_crop_blocks ||
421 dst_blk_y >= y_crop_blocks + comp_height) {
428 src_buffer = (*srcinfo->mem->access_virt_barray)
430 dst_blk_y - y_crop_blocks,
433 src_buffer = (*srcinfo->mem->access_virt_barray)
435 dst_blk_y + y_crop_blocks,
440 if (x_crop_blocks > 0) {
445 dst_buffer[offset_y] + x_crop_blocks,
449 x_crop_blocks + comp_width,
455 dst_buffer[offset_y],
476 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height;
477 JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;
496 dst_buffer = (*srcinfo->mem->access_virt_barray)
497 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
500 if (dst_blk_y < y_crop_blocks ||
501 dst_blk_y >= y_crop_blocks + comp_height) {
508 src_buffer = (*srcinfo->mem->access_virt_barray)
510 dst_blk_y - y_crop_blocks,
513 src_buffer = (*srcinfo->mem->access_virt_barray)
515 dst_blk_y + y_crop_blocks,
519 if (x_crop_blocks > 0) {
522 dc = src_buffer[offset_y][0][0];
523 for (dst_blk_x = 0; dst_blk_x < x_crop_blocks; dst_blk_x++) {
524 dst_buffer[offset_y][dst_blk_x][0] =
dc;
528 dst_buffer[offset_y] + x_crop_blocks,
532 x_crop_blocks + comp_width,
535 dc = src_buffer[offset_y][comp_width - 1][0];
536 for (dst_blk_x = x_crop_blocks + comp_width;
538 dst_buffer[offset_y][dst_blk_x][0] =
dc;
559 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, src_blk_x;
560 JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;
580 dst_buffer = (*srcinfo->mem->access_virt_barray)
581 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
584 if (dst_blk_y < y_crop_blocks ||
585 dst_blk_y >= y_crop_blocks + comp_height) {
592 src_buffer = (*srcinfo->mem->access_virt_barray)
594 dst_blk_y - y_crop_blocks,
597 src_buffer = (*srcinfo->mem->access_virt_barray)
599 dst_blk_y + y_crop_blocks,
605 dst_buffer[offset_y] + x_crop_blocks,
607 if (x_crop_blocks > 0) {
609 dst_row_ptr = dst_buffer[offset_y] + x_crop_blocks;
610 for (dst_blk_x = x_crop_blocks; dst_blk_x > 0;) {
611 src_row_ptr = dst_row_ptr;
612 for (src_blk_x = comp_width; src_blk_x > 0 && dst_blk_x > 0;
613 src_blk_x--, dst_blk_x--) {
614 dst_ptr = *--dst_row_ptr;
615 src_ptr = *src_row_ptr++;
618 *dst_ptr++ = *src_ptr++;
619 *dst_ptr++ = - *src_ptr++;
626 dst_row_ptr = dst_buffer[offset_y] + x_crop_blocks + comp_width;
629 src_row_ptr = dst_row_ptr;
630 for (src_blk_x = comp_width; src_blk_x > 0 && dst_blk_x > 0;
631 src_blk_x--, dst_blk_x--) {
632 dst_ptr = *dst_row_ptr++;
633 src_ptr = *--src_row_ptr;
636 *dst_ptr++ = *src_ptr++;
637 *dst_ptr++ = - *src_ptr++;
667 for (; y_wipe_blocks < wipe_bottom;
669 buffer = (*srcinfo->mem->access_virt_barray)
670 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], y_wipe_blocks,
690 JDIMENSION x_wipe_blocks, wipe_width, wipe_right;
692 int ci, offset_y, dc_left_value, dc_right_value, average;
700 wipe_right = wipe_width + x_wipe_blocks;
703 for (; y_wipe_blocks < wipe_bottom;
705 buffer = (*srcinfo->mem->access_virt_barray)
706 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], y_wipe_blocks,
711 if (x_wipe_blocks > 0) {
712 dc_left_value =
buffer[offset_y][x_wipe_blocks - 1][0];
713 if (wipe_right < compptr->width_in_blocks) {
714 dc_right_value =
buffer[offset_y][wipe_right][0];
715 average = (dc_left_value + dc_right_value) >> 1;
717 average = dc_left_value;
719 }
else if (wipe_right < compptr->width_in_blocks) {
720 average =
buffer[offset_y][wipe_right][0];
722 for (blk_x = x_wipe_blocks; blk_x < wipe_right; blk_x++) {
755 for (y_wipe_blocks = 0; y_wipe_blocks < wipe_bottom;
757 buffer = (*srcinfo->mem->access_virt_barray)
758 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], y_wipe_blocks,
761 if (x_wipe_blocks > 0) {
763 dst_row_ptr =
buffer[offset_y] + x_wipe_blocks;
764 for (dst_blk_x = wipe_width; dst_blk_x > 0;) {
765 src_row_ptr = dst_row_ptr;
766 for (src_blk_x = x_wipe_blocks;
767 src_blk_x > 0 && dst_blk_x > 0; src_blk_x--, dst_blk_x--) {
768 dst_ptr = *dst_row_ptr++;
769 src_ptr = *--src_row_ptr;
772 *dst_ptr++ = *src_ptr++;
773 *dst_ptr++ = - *src_ptr++;
779 dst_row_ptr =
buffer[offset_y] + x_wipe_blocks + wipe_width;
780 for (dst_blk_x = wipe_width; dst_blk_x > 0;) {
781 src_row_ptr = dst_row_ptr;
783 for (; src_blk_x > 0 && dst_blk_x > 0; src_blk_x--, dst_blk_x--) {
784 dst_ptr = *--dst_row_ptr;
785 src_ptr = *src_row_ptr++;
788 *dst_ptr++ = *src_ptr++;
789 *dst_ptr++ = - *src_ptr++;
811 JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;
832 buffer = (*srcinfo->mem->access_virt_barray)
837 for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
838 ptr1 =
buffer[offset_y][blk_x];
839 ptr2 =
buffer[offset_y][comp_width - blk_x - 1];
852 if (x_crop_blocks > 0) {
877 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
899 dst_buffer = (*srcinfo->mem->access_virt_barray)
900 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
902 src_buffer = (*srcinfo->mem->access_virt_barray)
904 dst_blk_y + y_crop_blocks,
907 dst_row_ptr = dst_buffer[offset_y];
908 src_row_ptr = src_buffer[offset_y];
910 if (x_crop_blocks + dst_blk_x < comp_width) {
912 dst_ptr = dst_row_ptr[dst_blk_x];
913 src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
916 *dst_ptr++ = *src_ptr++;
917 *dst_ptr++ = - *src_ptr++;
922 dst_row_ptr + dst_blk_x,
939 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
941 int ci,
i,
j, offset_y;
964 dst_buffer = (*srcinfo->mem->access_virt_barray)
965 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
967 if (y_crop_blocks + dst_blk_y < comp_height) {
969 src_buffer = (*srcinfo->mem->access_virt_barray)
971 comp_height - y_crop_blocks - dst_blk_y -
976 src_buffer = (*srcinfo->mem->access_virt_barray)
978 dst_blk_y + y_crop_blocks,
982 if (y_crop_blocks + dst_blk_y < comp_height) {
984 dst_row_ptr = dst_buffer[offset_y];
986 src_row_ptr += x_crop_blocks;
989 dst_ptr = dst_row_ptr[dst_blk_x];
990 src_ptr = src_row_ptr[dst_blk_x];
994 *dst_ptr++ = *src_ptr++;
997 *dst_ptr++ = - *src_ptr++;
1003 dst_buffer[offset_y],
1019 JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;
1020 int ci,
i,
j, offset_x, offset_y;
1036 dst_buffer = (*srcinfo->mem->access_virt_barray)
1037 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
1042 src_buffer = (*srcinfo->mem->access_virt_barray)
1044 dst_blk_x + x_crop_blocks,
1047 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
1048 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];
1071 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
1073 int ci,
i,
j, offset_x, offset_y;
1092 dst_buffer = (*srcinfo->mem->access_virt_barray)
1093 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
1098 if (x_crop_blocks + dst_blk_x < comp_width) {
1100 src_buffer = (*srcinfo->mem->access_virt_barray)
1102 comp_width - x_crop_blocks - dst_blk_x -
1107 src_buffer = (*srcinfo->mem->access_virt_barray)
1109 dst_blk_x + x_crop_blocks,
1113 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
1114 if (x_crop_blocks + dst_blk_x < comp_width) {
1117 [dst_blk_y + offset_y + y_crop_blocks];
1127 src_ptr = src_buffer[offset_x]
1128 [dst_blk_y + offset_y + y_crop_blocks];
1152 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
1154 int ci,
i,
j, offset_x, offset_y;
1173 dst_buffer = (*srcinfo->mem->access_virt_barray)
1174 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
1179 src_buffer = (*srcinfo->mem->access_virt_barray)
1181 dst_blk_x + x_crop_blocks,
1184 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
1185 if (y_crop_blocks + dst_blk_y < comp_height) {
1187 src_ptr = src_buffer[offset_x]
1188 [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
1198 src_ptr = src_buffer[offset_x]
1199 [dst_blk_y + offset_y + y_crop_blocks];
1223 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
1225 int ci,
i,
j, offset_y;
1244 dst_buffer = (*srcinfo->mem->access_virt_barray)
1245 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
1247 if (y_crop_blocks + dst_blk_y < comp_height) {
1249 src_buffer = (*srcinfo->mem->access_virt_barray)
1251 comp_height - y_crop_blocks - dst_blk_y -
1256 src_buffer = (*srcinfo->mem->access_virt_barray)
1258 dst_blk_y + y_crop_blocks,
1262 dst_row_ptr = dst_buffer[offset_y];
1263 if (y_crop_blocks + dst_blk_y < comp_height) {
1267 dst_ptr = dst_row_ptr[dst_blk_x];
1268 if (x_crop_blocks + dst_blk_x < comp_width) {
1270 src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
1274 *dst_ptr++ = *src_ptr++;
1275 *dst_ptr++ = - *src_ptr++;
1279 *dst_ptr++ = - *src_ptr++;
1280 *dst_ptr++ = *src_ptr++;
1285 src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];
1288 *dst_ptr++ = *src_ptr++;
1290 *dst_ptr++ = - *src_ptr++;
1296 src_row_ptr = src_buffer[offset_y];
1298 if (x_crop_blocks + dst_blk_x < comp_width) {
1300 dst_ptr = dst_row_ptr[dst_blk_x];
1301 src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
1303 *dst_ptr++ = *src_ptr++;
1304 *dst_ptr++ = - *src_ptr++;
1309 dst_row_ptr + dst_blk_x,
1335 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
1337 int ci,
i,
j, offset_x, offset_y;
1355 dst_buffer = (*srcinfo->mem->access_virt_barray)
1356 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
1361 if (x_crop_blocks + dst_blk_x < comp_width) {
1363 src_buffer = (*srcinfo->mem->access_virt_barray)
1365 comp_width - x_crop_blocks - dst_blk_x -
1369 src_buffer = (*srcinfo->mem->access_virt_barray)
1371 dst_blk_x + x_crop_blocks,
1375 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
1376 if (y_crop_blocks + dst_blk_y < comp_height) {
1377 if (x_crop_blocks + dst_blk_x < comp_width) {
1380 [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
1396 src_ptr = src_buffer[offset_x]
1397 [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
1407 if (x_crop_blocks + dst_blk_x < comp_width) {
1410 [dst_blk_y + offset_y + y_crop_blocks];
1420 src_ptr = src_buffer[offset_x]
1421 [dst_blk_y + offset_y + y_crop_blocks];
1443 const char *
ptr = *strptr;
1481 if (! jt_read_integer(&spec, &
info->crop_width))
1483 if (*spec ==
'f' || *spec ==
'F') {
1486 }
else if (*spec ==
'r' || *spec ==
'R') {
1492 if (*spec ==
'x' || *spec ==
'X') {
1495 if (! jt_read_integer(&spec, &
info->crop_height))
1497 if (*spec ==
'f' || *spec ==
'F') {
1500 }
else if (*spec ==
'r' || *spec ==
'R') {
1506 if (*spec ==
'+' || *spec ==
'-') {
1510 if (! jt_read_integer(&spec, &
info->crop_xoffset))
1513 if (*spec ==
'+' || *spec ==
'-') {
1517 if (! jt_read_integer(&spec, &
info->crop_yoffset))
1535 MCU_cols =
info->output_width /
info->iMCU_sample_width;
1536 if (MCU_cols > 0 &&
info->x_crop_offset + MCU_cols ==
1537 full_width /
info->iMCU_sample_width)
1538 info->output_width = MCU_cols *
info->iMCU_sample_width;
1546 MCU_rows =
info->output_height /
info->iMCU_sample_height;
1547 if (MCU_rows > 0 &&
info->y_crop_offset + MCU_rows ==
1548 full_height /
info->iMCU_sample_height)
1549 info->output_height = MCU_rows *
info->iMCU_sample_height;
1575 boolean need_workspace, transpose_it;
1579 JDIMENSION width_in_blocks, height_in_blocks;
1580 int itemp, ci, h_samp_factor, v_samp_factor;
1583 if (
info->force_grayscale &&
1588 info->num_components = 1;
1594 jpeg_core_output_dimensions(srcinfo);
1598 if (
info->perfect) {
1599 if (
info->num_components == 1) {
1600 if (!jtransform_perfect_transform(srcinfo->
output_width,
1607 if (!jtransform_perfect_transform(srcinfo->
output_width,
1621 switch (
info->transform) {
1628 if (
info->num_components == 1) {
1632 info->iMCU_sample_width =
1634 info->iMCU_sample_height =
1641 if (
info->num_components == 1) {
1645 info->iMCU_sample_width =
1647 info->iMCU_sample_height =
1658 info->crop_xoffset = 0;
1660 info->crop_yoffset = 0;
1662 if (
info->crop_xoffset >=
info->output_width)
1663 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
1664 info->crop_width =
info->output_width -
info->crop_xoffset;
1667 if (
info->crop_width >
info->output_width) {
1670 info->crop_xoffset >=
info->crop_width ||
1671 info->crop_xoffset >
info->crop_width -
info->output_width)
1672 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
1674 if (
info->crop_xoffset >=
info->output_width ||
1675 info->crop_width <= 0 ||
1676 info->crop_xoffset >
info->output_width -
info->crop_width)
1677 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
1681 if (
info->crop_yoffset >=
info->output_height)
1682 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
1683 info->crop_height =
info->output_height -
info->crop_yoffset;
1686 if (
info->crop_height >
info->output_height) {
1689 info->crop_yoffset >=
info->crop_height ||
1690 info->crop_yoffset >
info->crop_height -
info->output_height)
1691 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
1693 if (
info->crop_yoffset >=
info->output_height ||
1694 info->crop_height <= 0 ||
1695 info->crop_yoffset >
info->output_height -
info->crop_height)
1696 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
1702 else if (
info->crop_width >
info->output_width)
1708 else if (
info->crop_height >
info->output_height)
1713 switch (
info->transform) {
1716 itemp =
info->iMCU_sample_width;
1717 dtemp = itemp - 1 - ((
xoffset + itemp - 1) % itemp);
1719 if (
info->crop_width <= dtemp)
1720 info->drop_width = 0;
1723 info->drop_width = (
info->crop_width - dtemp + itemp - 1) / itemp;
1725 info->drop_width = (
info->crop_width - dtemp) / itemp;
1726 itemp =
info->iMCU_sample_height;
1727 dtemp = itemp - 1 - ((
yoffset + itemp - 1) % itemp);
1729 if (
info->crop_height <= dtemp)
1730 info->drop_height = 0;
1733 info->drop_height = (
info->crop_height - dtemp + itemp - 1) / itemp;
1735 info->drop_height = (
info->crop_height - dtemp) / itemp;
1737 if (
info->drop_width != 0 &&
info->drop_height != 0)
1738 for (ci = 0; ci <
info->num_components &&
1739 ci <
info->drop_ptr->num_components; ci++) {
1740 if (
info->drop_ptr->comp_info[ci].h_samp_factor *
1743 info->drop_ptr->max_h_samp_factor)
1744 ERREXIT6(srcinfo, JERR_BAD_DROP_SAMPLING, ci,
1745 info->drop_ptr->comp_info[ci].h_samp_factor,
1746 info->drop_ptr->max_h_samp_factor,
1749 if (
info->drop_ptr->comp_info[ci].v_samp_factor *
1752 info->drop_ptr->max_v_samp_factor)
1753 ERREXIT6(srcinfo, JERR_BAD_DROP_SAMPLING, ci,
1754 info->drop_ptr->comp_info[ci].v_samp_factor,
1755 info->drop_ptr->max_v_samp_factor,
1772 info->crop_width >
info->output_width)
1773 info->output_width =
info->crop_width;
1775 info->output_width =
1778 info->crop_height >
info->output_height)
1779 info->output_height =
info->crop_height;
1781 info->output_height =
1788 info->x_crop_offset = 0;
1789 info->y_crop_offset = 0;
1795 need_workspace =
FALSE;
1796 transpose_it =
FALSE;
1797 switch (
info->transform) {
1799 if (
info->x_crop_offset != 0 ||
info->y_crop_offset != 0 ||
1802 need_workspace =
TRUE;
1808 if (
info->y_crop_offset != 0)
1809 need_workspace =
TRUE;
1816 need_workspace =
TRUE;
1821 need_workspace =
TRUE;
1822 transpose_it =
TRUE;
1830 need_workspace =
TRUE;
1831 transpose_it =
TRUE;
1837 need_workspace =
TRUE;
1838 transpose_it =
TRUE;
1846 need_workspace =
TRUE;
1852 need_workspace =
TRUE;
1853 transpose_it =
TRUE;
1858#if DROP_REQUEST_FROM_SRC
1859 drop_request_from_src(
info->drop_ptr, srcinfo);
1868 if (need_workspace) {
1873 ((
long)
info->output_width, (
long)
info->iMCU_sample_width);
1875 ((
long)
info->output_height, (
long)
info->iMCU_sample_height);
1876 for (ci = 0; ci <
info->num_components; ci++) {
1878 if (
info->num_components == 1) {
1880 h_samp_factor = v_samp_factor = 1;
1881 }
else if (transpose_it) {
1888 width_in_blocks = width_in_iMCUs * h_samp_factor;
1889 height_in_blocks = height_in_iMCUs * v_samp_factor;
1890 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
1892 width_in_blocks, height_in_blocks, (
JDIMENSION) v_samp_factor);
1896 info->workspace_coef_arrays =
NULL;
1932 if (qtblptr !=
NULL) {
1934 for (
j = 0;
j <
i;
j++) {
1954 boolean is_motorola;
1955 unsigned int number_of_tags, tagnum;
1956 unsigned int firstoffset,
offset;
1963 is_motorola =
FALSE;
1992 if (firstoffset >
length - 2)
return;
1997 number_of_tags <<= 8;
2001 number_of_tags <<= 8;
2004 if (number_of_tags == 0)
return;
2009 if (firstoffset >
length - 12)
return;
2020 if (tagnum == 0x8769)
break;
2021 if (--number_of_tags == 0)
return;
2044 number_of_tags <<= 8;
2048 number_of_tags <<= 8;
2051 if (number_of_tags < 2)
return;
2067 if (tagnum == 0xA002 || tagnum == 0xA003) {
2068 if (tagnum == 0xA002)
2069 new_value = new_width;
2071 new_value = new_height;
2097 }
while (--number_of_tags);
2119 if (
info->force_grayscale) {
2144 }
else if (
info->num_components == 1) {
2160 switch (
info->transform) {
2165 transpose_critical_parameters(
dstinfo);
2168 if (
info->drop_width != 0 &&
info->drop_height != 0)
2169 adjust_quant(srcinfo, src_coef_arrays,
2170 info->drop_ptr,
info->drop_coef_arrays,
2193 adjust_exif_parameters(srcinfo->
marker_list->data + 6,
2199 if (
info->workspace_coef_arrays !=
NULL)
2200 return info->workspace_coef_arrays;
2201 return src_coef_arrays;
2225 switch (
info->transform) {
2231 do_crop_ext_reflect(srcinfo,
dstinfo,
2232 info->x_crop_offset,
info->y_crop_offset,
2233 src_coef_arrays, dst_coef_arrays);
2236 do_crop_ext_flat(srcinfo,
dstinfo,
2237 info->x_crop_offset,
info->y_crop_offset,
2238 src_coef_arrays, dst_coef_arrays);
2240 do_crop_ext_zero(srcinfo,
dstinfo,
2241 info->x_crop_offset,
info->y_crop_offset,
2242 src_coef_arrays, dst_coef_arrays);
2243 }
else if (
info->x_crop_offset != 0 ||
info->y_crop_offset != 0)
2245 src_coef_arrays, dst_coef_arrays);
2248 if (
info->y_crop_offset != 0)
2250 src_coef_arrays, dst_coef_arrays);
2252 do_flip_h_no_crop(srcinfo,
dstinfo,
info->x_crop_offset,
2257 src_coef_arrays, dst_coef_arrays);
2260 do_transpose(srcinfo,
dstinfo,
info->x_crop_offset,
info->y_crop_offset,
2261 src_coef_arrays, dst_coef_arrays);
2264 do_transverse(srcinfo,
dstinfo,
info->x_crop_offset,
info->y_crop_offset,
2265 src_coef_arrays, dst_coef_arrays);
2269 src_coef_arrays, dst_coef_arrays);
2272 do_rot_180(srcinfo,
dstinfo,
info->x_crop_offset,
info->y_crop_offset,
2273 src_coef_arrays, dst_coef_arrays);
2276 do_rot_270(srcinfo,
dstinfo,
info->x_crop_offset,
info->y_crop_offset,
2277 src_coef_arrays, dst_coef_arrays);
2281 info->y_crop_offset == 0 &&
info->drop_height ==
2283 ((
long)
info->output_height, (
long)
info->iMCU_sample_height) &&
2284 (
info->x_crop_offset == 0 ||
2285 info->x_crop_offset +
info->drop_width ==
2287 ((
long)
info->output_width, (
long)
info->iMCU_sample_width)))
2289 src_coef_arrays,
info->drop_width,
info->drop_height);
2291 do_flatten(srcinfo,
dstinfo,
info->x_crop_offset,
info->y_crop_offset,
2292 src_coef_arrays,
info->drop_width,
info->drop_height);
2295 src_coef_arrays,
info->drop_width,
info->drop_height);
2298 if (
info->drop_width != 0 &&
info->drop_height != 0)
2300 src_coef_arrays,
info->drop_ptr,
info->drop_coef_arrays,
2301 info->drop_width,
info->drop_height);
2329 int MCU_width,
int MCU_height,
2369#ifdef SAVE_MARKERS_SUPPORTED
2374 jpeg_save_markers(srcinfo,
JPEG_COM, 0xFFFF);
2378 for (
m = 0;
m < 16;
m++)
2379 jpeg_save_markers(srcinfo,
JPEG_APP0 +
m, 0xFFFF);
2405 marker->data_length >= 5 &&
2414 marker->data_length >= 5 &&
2421#ifdef NEED_FAR_POINTERS
2426 for (
i = 0;
i <
marker->data_length;
i++)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLint yoffset
GLuint GLenum GLenum transform
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
char * trim(char *str, char **last_chr, BOOL strip_quotes)
jpeg_write_m_byte(j_compress_ptr cinfo, int val)
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_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
jpeg_component_info * compptr
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6)
#define JMETHOD(type, methodname, arglist)
#define FMEMZERO(target, size)
struct jpeg_common_struct * j_common_ptr
struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr
jvirt_barray_ptr * coef_arrays
jdiv_round_up(long a, long b)
jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks)
UINT16 quantval[DCTSIZE2]
JDIMENSION width_in_blocks
JDIMENSION height_in_blocks
boolean write_JFIF_header
boolean write_Adobe_marker
jpeg_component_info * comp_info
int min_DCT_v_scaled_size
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
J_COLOR_SPACE jpeg_color_space
int min_DCT_h_scaled_size
jpeg_saved_marker_ptr marker_list
int min_DCT_h_scaled_size
int min_DCT_v_scaled_size
J_COLOR_SPACE jpeg_color_space
struct jpeg_input_controller * inputctl
jpeg_component_info * comp_info
jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, JCOPY_OPTION option)
static unsigned int block