13 #define JPEG_INTERNALS 19 #if TRANSFORMS_SUPPORTED 85 buffer = (*srcinfo->mem->access_virt_barray)(
90 for (blk_x = 0; blk_x * 2 < comp_width; blk_x++)
92 ptr1 =
buffer[offset_y][blk_x];
93 ptr2 =
buffer[offset_y][comp_width - blk_x - 1];
119 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
120 int ci, i, j, offset_y;
142 dst_buffer = (*srcinfo->mem->access_virt_barray)(
145 if (dst_blk_y < comp_height)
148 src_buffer = (*srcinfo->mem->access_virt_barray)(
150 comp_height - dst_blk_y -
157 src_buffer = (*srcinfo->mem->access_virt_barray)(
163 if (dst_blk_y < comp_height)
166 dst_row_ptr = dst_buffer[offset_y];
172 dst_ptr = dst_row_ptr[dst_blk_x];
173 src_ptr = src_row_ptr[dst_blk_x];
174 for (i = 0; i <
DCTSIZE; i += 2)
178 *dst_ptr++ = *src_ptr++;
181 *dst_ptr++ = -*src_ptr++;
189 src_buffer[offset_y], dst_buffer[offset_y],
204 int ci, i, j, offset_x, offset_y;
220 dst_buffer = (*srcinfo->mem->access_virt_barray)(
228 src_buffer = (*srcinfo->mem->access_virt_barray)(
234 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
235 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
257 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
258 int ci, i, j, offset_x, offset_y;
276 dst_buffer = (*srcinfo->mem->access_virt_barray)(
284 src_buffer = (*srcinfo->mem->access_virt_barray)(
290 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
291 if (dst_blk_x < comp_width)
295 dst_buffer[offset_y][comp_width - dst_blk_x -
312 dst_buffer[offset_y][dst_blk_x + offset_x];
335 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
336 int ci, i, j, offset_x, offset_y;
354 dst_buffer = (*srcinfo->mem->access_virt_barray)(
362 src_buffer = (*srcinfo->mem->access_virt_barray)(
368 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
369 if (dst_blk_y < comp_height)
373 src_buffer[offset_x][comp_height - dst_blk_y -
391 src_buffer[offset_x][dst_blk_y + offset_y];
414 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x,
416 int ci, i, j, offset_y;
433 dst_buffer = (*srcinfo->mem->access_virt_barray)(
436 if (dst_blk_y < comp_height)
439 src_buffer = (*srcinfo->mem->access_virt_barray)(
441 comp_height - dst_blk_y -
448 src_buffer = (*srcinfo->mem->access_virt_barray)(
454 if (dst_blk_y < comp_height)
457 dst_row_ptr = dst_buffer[offset_y];
461 for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++)
463 dst_ptr = dst_row_ptr[dst_blk_x];
464 src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
465 for (i = 0; i <
DCTSIZE; i += 2)
468 for (j = 0; j <
DCTSIZE; j += 2)
470 *dst_ptr++ = *src_ptr++;
471 *dst_ptr++ = -*src_ptr++;
474 for (j = 0; j <
DCTSIZE; j += 2)
476 *dst_ptr++ = -*src_ptr++;
477 *dst_ptr++ = *src_ptr++;
485 dst_ptr = dst_row_ptr[dst_blk_x];
486 src_ptr = src_row_ptr[dst_blk_x];
487 for (i = 0; i <
DCTSIZE; i += 2)
490 *dst_ptr++ = *src_ptr++;
492 *dst_ptr++ = -*src_ptr++;
499 dst_row_ptr = dst_buffer[offset_y];
500 src_row_ptr = src_buffer[offset_y];
502 for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++)
504 dst_ptr = dst_row_ptr[dst_blk_x];
505 src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
508 *dst_ptr++ = *src_ptr++;
509 *dst_ptr++ = -*src_ptr++;
515 dst_ptr = dst_row_ptr[dst_blk_x];
516 src_ptr = src_row_ptr[dst_blk_x];
517 for (i = 0; i <
DCTSIZE2; i++) *dst_ptr++ = *src_ptr++;
539 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x,
541 int ci, i, j, offset_x, offset_y;
557 dst_buffer = (*srcinfo->mem->access_virt_barray)(
565 src_buffer = (*srcinfo->mem->access_virt_barray)(
571 if (dst_blk_y < comp_height)
574 src_buffer[offset_x][comp_height - dst_blk_y -
576 if (dst_blk_x < comp_width)
579 dst_ptr = dst_buffer[offset_y]
580 [comp_width - dst_blk_x -
607 dst_buffer[offset_y][dst_blk_x + offset_x];
624 src_buffer[offset_x][dst_blk_y + offset_y];
625 if (dst_blk_x < comp_width)
628 dst_ptr = dst_buffer[offset_y]
629 [comp_width - dst_blk_x -
647 dst_buffer[offset_y][dst_blk_x + offset_x];
672 jtransform_request_workspace(
711 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)(
738 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)(
758 int tblno, i, j, ci, itemp;
782 if (qtblptr !=
nullptr)
786 for (j = 0; j < i; j++)
803 int ci, max_h_samp_factor;
810 max_h_samp_factor = 1;
814 max_h_samp_factor =
MAX(max_h_samp_factor, h_samp_factor);
824 int ci, max_v_samp_factor;
831 max_v_samp_factor = 1;
835 max_v_samp_factor =
MAX(max_v_samp_factor, v_samp_factor);
854 jtransform_adjust_parameters(
882 ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);
893 if (info->
trim) trim_right_edge(dstinfo);
896 if (info->
trim) trim_bottom_edge(dstinfo);
899 transpose_critical_parameters(dstinfo);
903 transpose_critical_parameters(dstinfo);
906 trim_right_edge(dstinfo);
907 trim_bottom_edge(dstinfo);
911 transpose_critical_parameters(dstinfo);
912 if (info->
trim) trim_right_edge(dstinfo);
917 trim_right_edge(dstinfo);
918 trim_bottom_edge(dstinfo);
922 transpose_critical_parameters(dstinfo);
923 if (info->
trim) trim_bottom_edge(dstinfo);
930 return src_coef_arrays;
943 jtransform_execute_transformation(
954 do_flip_h(srcinfo, dstinfo, src_coef_arrays);
957 do_flip_v(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
960 do_transpose(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
963 do_transverse(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
966 do_rot_90(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
969 do_rot_180(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
972 do_rot_270(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
986 #ifdef SAVE_MARKERS_SUPPORTED 997 for (m = 0; m < 16; m++)
1021 for (marker = srcinfo->marker_list; marker !=
nullptr;
1022 marker = marker->next)
1024 if (dstinfo->write_JFIF_header && marker->marker ==
JPEG_APP0 &&
1025 marker->data_length >= 5 &&
GETJOCTET(marker->data[0]) == 0x4A &&
1031 if (dstinfo->write_Adobe_marker && marker->marker ==
JPEG_APP0 + 14 &&
1032 marker->data_length >= 5 &&
GETJOCTET(marker->data[0]) == 0x41 &&
1038 #ifdef NEED_FAR_POINTERS 1043 for (i = 0; i < marker->data_length; i++)
1048 dstinfo, marker->marker, marker->data, marker->data_length);
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
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
jpeg_component_info * compptr