18 #define JPEG_INTERNALS
25 #if TRANSFORMS_SUPPORTED
89 buffer = (*srcinfo->mem->access_virt_barray)
93 for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
120 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
141 dst_buffer = (*srcinfo->mem->access_virt_barray)
142 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
144 if (dst_blk_y < comp_height) {
146 src_buffer = (*srcinfo->mem->access_virt_barray)
152 src_buffer = (*srcinfo->mem->access_virt_barray)
153 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
157 if (dst_blk_y < comp_height) {
163 dst_ptr = dst_row_ptr[dst_blk_x];
164 src_ptr = src_row_ptr[dst_blk_x];
168 *dst_ptr++ = *src_ptr++;
171 *dst_ptr++ = - *src_ptr++;
206 dst_buffer = (*srcinfo->mem->access_virt_barray)
207 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
212 src_buffer = (*srcinfo->mem->access_virt_barray)
213 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
239 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
256 dst_buffer = (*srcinfo->mem->access_virt_barray)
257 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
262 src_buffer = (*srcinfo->mem->access_virt_barray)
263 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
267 if (dst_blk_x < comp_width) {
270 [comp_width - dst_blk_x -
offset_x - 1];
303 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
320 dst_buffer = (*srcinfo->mem->access_virt_barray)
321 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
326 src_buffer = (*srcinfo->mem->access_virt_barray)
327 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
331 if (dst_blk_y < comp_height) {
334 [comp_height - dst_blk_y -
offset_y - 1];
336 for (j = 0; j <
DCTSIZE; j++) {
367 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
383 dst_buffer = (*srcinfo->mem->access_virt_barray)
384 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
386 if (dst_blk_y < comp_height) {
388 src_buffer = (*srcinfo->mem->access_virt_barray)
394 src_buffer = (*srcinfo->mem->access_virt_barray)
395 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
399 if (dst_blk_y < comp_height) {
404 for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
405 dst_ptr = dst_row_ptr[dst_blk_x];
406 src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
409 for (j = 0; j <
DCTSIZE; j += 2) {
410 *dst_ptr++ = *src_ptr++;
411 *dst_ptr++ = - *src_ptr++;
414 for (j = 0; j <
DCTSIZE; j += 2) {
415 *dst_ptr++ = - *src_ptr++;
416 *dst_ptr++ = *src_ptr++;
422 dst_ptr = dst_row_ptr[dst_blk_x];
423 src_ptr = src_row_ptr[dst_blk_x];
426 *dst_ptr++ = *src_ptr++;
428 *dst_ptr++ = - *src_ptr++;
436 for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
437 dst_ptr = dst_row_ptr[dst_blk_x];
438 src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
440 *dst_ptr++ = *src_ptr++;
441 *dst_ptr++ = - *src_ptr++;
446 dst_ptr = dst_row_ptr[dst_blk_x];
447 src_ptr = src_row_ptr[dst_blk_x];
449 *dst_ptr++ = *src_ptr++;
472 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
487 dst_buffer = (*srcinfo->mem->access_virt_barray)
488 ((
j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
493 src_buffer = (*srcinfo->mem->access_virt_barray)
494 ((
j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
497 if (dst_blk_y < comp_height) {
499 [comp_height - dst_blk_y -
offset_y - 1];
500 if (dst_blk_x < comp_width) {
503 [comp_width - dst_blk_x -
offset_x - 1];
505 for (j = 0; j <
DCTSIZE; j++) {
511 for (j = 0; j <
DCTSIZE; j++) {
521 for (j = 0; j <
DCTSIZE; j++) {
530 if (dst_blk_x < comp_width) {
533 [comp_width - dst_blk_x -
offset_x - 1];
575 if (
info->force_grayscale &&
579 info->num_components = 1;
585 switch (
info->transform) {
599 for (ci = 0; ci <
info->num_components; ci++) {
601 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
621 for (ci = 0; ci <
info->num_components; ci++) {
623 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
642 int tblno,
i, j, ci, itemp;
664 if (qtblptr != NULL) {
666 for (j = 0; j <
i; j++) {
682 int ci, max_h_samp_factor;
689 max_h_samp_factor = 1;
692 max_h_samp_factor =
MAX(max_h_samp_factor, h_samp_factor);
702 int ci, max_v_samp_factor;
709 max_v_samp_factor = 1;
712 max_v_samp_factor =
MAX(max_v_samp_factor, v_samp_factor);
738 if (
info->force_grayscale) {
761 switch (
info->transform) {
774 transpose_critical_parameters(
dstinfo);
778 transpose_critical_parameters(
dstinfo);
785 transpose_critical_parameters(
dstinfo);
796 transpose_critical_parameters(
dstinfo);
803 if (
info->workspace_coef_arrays != NULL)
804 return info->workspace_coef_arrays;
805 return src_coef_arrays;
826 switch (
info->transform) {
830 do_flip_h(srcinfo,
dstinfo, src_coef_arrays);
833 do_flip_v(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
836 do_transpose(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
839 do_transverse(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
842 do_rot_90(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
845 do_rot_180(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
848 do_rot_270(srcinfo,
dstinfo, src_coef_arrays, dst_coef_arrays);
863 #ifdef SAVE_MARKERS_SUPPORTED
872 for (m = 0; m < 16; m++)
899 marker->data_length >= 5 &&
908 marker->data_length >= 5 &&
915 #ifdef NEED_FAR_POINTERS
920 for (
i = 0;
i <
marker->data_length;
i++)