13 #define JPEG_INTERNALS 41 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
46 (*cinfo->
dest->init_destination) (cinfo);
73 ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
75 dstinfo->image_width = srcinfo->image_width;
76 dstinfo->image_height = srcinfo->image_height;
77 dstinfo->input_components = srcinfo->num_components;
78 dstinfo->in_color_space = srcinfo->jpeg_color_space;
85 dstinfo->data_precision = srcinfo->data_precision;
86 dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
89 if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
90 qtblptr = & dstinfo->quant_tbl_ptrs[
tblno];
94 srcinfo->quant_tbl_ptrs[tblno]->quantval,
95 SIZEOF((*qtblptr)->quantval));
96 (*qtblptr)->sent_table =
FALSE;
102 dstinfo->num_components = srcinfo->num_components;
103 if (dstinfo->num_components < 1 || dstinfo->num_components >
MAX_COMPONENTS)
104 ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
106 for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
107 ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
117 if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
118 srcinfo->quant_tbl_ptrs[tblno] == NULL)
119 ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
120 slot_quant = srcinfo->quant_tbl_ptrs[
tblno];
122 if (c_quant != NULL) {
123 for (coefi = 0; coefi <
DCTSIZE2; coefi++) {
125 ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
140 if (srcinfo->saw_JFIF_marker) {
141 if (srcinfo->JFIF_major_version == 1) {
142 dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
143 dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
145 dstinfo->density_unit = srcinfo->density_unit;
146 dstinfo->X_density = srcinfo->X_density;
147 dstinfo->Y_density = srcinfo->Y_density;
164 cinfo->input_components = 1;
169 if (cinfo->arith_code) {
170 ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
172 if (cinfo->progressive_mode) {
173 #ifdef C_PROGRESSIVE_SUPPORTED 176 ERREXIT(cinfo, JERR_NOT_COMPILED);
188 (*cinfo->mem->realize_virt_arrays) ((
j_common_ptr) cinfo);
194 (*cinfo->marker->write_file_header) (cinfo);
214 int MCU_rows_per_iMCU_row;
236 if (cinfo->comps_in_scan > 1) {
260 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
282 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
283 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
284 int blkn, ci, xindex, yindex, yoffset, blockcnt;
292 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
293 compptr = cinfo->cur_comp_info[ci];
294 buffer[ci] = (*cinfo->mem->access_virt_barray)
301 for (yoffset = coef->
MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
303 for (MCU_col_num = coef->
mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
307 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
308 compptr = cinfo->cur_comp_info[ci];
314 yindex+yoffset < compptr->last_row_height) {
316 buffer_ptr =
buffer[ci][yindex+yoffset] + start_col;
317 for (xindex = 0; xindex < blockcnt; xindex++)
318 MCU_buffer[blkn++] = buffer_ptr++;
331 MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
337 if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
my_coef_controller * my_coef_ptr
transencode_coef_controller(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
transencode_master_selection(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
struct jpeg_common_struct * j_common_ptr
UINT16 quantval[DCTSIZE2]
#define ERREXIT(cinfo, code)
jvirt_barray_ptr * coef_arrays
jpeg_component_info * compptr
jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
struct jpeg_c_coef_controller pub
compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
#define MEMCOPY(dest, src, size)
jvirt_barray_ptr * whole_image
#define C_MAX_BLOCKS_IN_MCU
struct jpeg_destination_mgr * dest
jinit_phuff_encoder(j_compress_ptr cinfo)
jzero_far(void FAR *target, size_t bytestozero)
JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU]
jinit_huff_encoder(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
jpeg_alloc_quant_table(j_common_ptr cinfo)
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
start_iMCU_row(j_compress_ptr cinfo)
png_infop png_bytep buffer
jinit_marker_writer(j_compress_ptr cinfo)
jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only)
jpeg_set_defaults(j_compress_ptr cinfo)
#define ERREXIT2(cinfo, code, p1, p2)
#define MAX_COMPS_IN_SCAN
int MCU_rows_per_iMCU_row
jvirt_barray_ptr whole_image[MAX_COMPONENTS]