10 #define JPEG_INTERNALS 38 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
43 (*cinfo->dest->init_destination)(cinfo);
47 cinfo->next_scanline = 0;
68 ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
70 dstinfo->image_width = srcinfo->image_width;
71 dstinfo->image_height = srcinfo->image_height;
72 dstinfo->input_components = srcinfo->num_components;
73 dstinfo->in_color_space = srcinfo->jpeg_color_space;
80 dstinfo->data_precision = srcinfo->data_precision;
81 dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
85 if (srcinfo->quant_tbl_ptrs[tblno] !=
nullptr)
87 qtblptr = &dstinfo->quant_tbl_ptrs[tblno];
88 if (*qtblptr ==
nullptr)
91 (*qtblptr)->quantval, srcinfo->quant_tbl_ptrs[tblno]->quantval,
92 SIZEOF((*qtblptr)->quantval));
93 (*qtblptr)->sent_table =
FALSE;
99 dstinfo->num_components = srcinfo->num_components;
100 if (dstinfo->num_components < 1 || dstinfo->num_components >
MAX_COMPONENTS)
102 dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
104 for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
105 ci < dstinfo->num_components; ci++, incomp++, outcomp++)
117 srcinfo->quant_tbl_ptrs[tblno] ==
nullptr)
118 ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
119 slot_quant = srcinfo->quant_tbl_ptrs[tblno];
121 if (c_quant !=
nullptr)
123 for (coefi = 0; coefi <
DCTSIZE2; coefi++)
126 ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
142 if (srcinfo->saw_JFIF_marker)
144 if (srcinfo->JFIF_major_version == 1)
146 dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
147 dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
149 dstinfo->density_unit = srcinfo->density_unit;
150 dstinfo->X_density = srcinfo->X_density;
151 dstinfo->Y_density = srcinfo->Y_density;
167 cinfo->input_components = 1;
172 if (cinfo->arith_code)
174 ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
178 if (cinfo->progressive_mode)
180 #ifdef C_PROGRESSIVE_SUPPORTED 183 ERREXIT(cinfo, JERR_NOT_COMPILED);
196 (*cinfo->mem->realize_virt_arrays)((
j_common_ptr)cinfo);
202 (*cinfo->marker->write_file_header)(cinfo);
222 int MCU_rows_per_iMCU_row;
243 if (cinfo->comps_in_scan > 1)
251 cinfo->cur_comp_info[0]->v_samp_factor;
254 cinfo->cur_comp_info[0]->last_row_height;
291 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
292 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
293 int blkn, ci, xindex, yindex,
yoffset, blockcnt;
301 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
303 compptr = cinfo->cur_comp_info[ci];
304 buffer[ci] = (*cinfo->mem->access_virt_barray)(
314 for (MCU_col_num = coef->
mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
319 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
321 compptr = cinfo->cur_comp_info[ci];
323 blockcnt = (MCU_col_num < last_MCU_col)
333 for (xindex = 0; xindex < blockcnt; xindex++)
334 MCU_buffer[blkn++] = buffer_ptr++;
353 MCU_buffer[blkn][0][0] = MCU_buffer[blkn - 1][0][0];
359 if (!(*cinfo->entropy->encode_mcu)(cinfo, MCU_buffer))
jzero_far(void FAR *target, size_t bytestozero)
UINT16 quantval[DCTSIZE2]
jpeg_write_coefficients(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
#define MAX_COMPS_IN_SCAN
jpeg_set_defaults(j_compress_ptr cinfo)
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
for(ctr=DCTSIZE;ctr > 0;ctr--)
jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
start_iMCU_row(j_compress_ptr cinfo)
jinit_phuff_encoder(j_compress_ptr cinfo)
jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
struct jpeg_c_coef_controller pub
jinit_huff_encoder(j_compress_ptr cinfo)
#define MEMCOPY(dest, src, size)
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
GLint GLint GLint yoffset
jvirt_barray_ptr * whole_image
my_coef_controller * my_coef_ptr
transencode_master_selection JPP((j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays))
JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU]
jpeg_alloc_quant_table(j_common_ptr cinfo)
#define C_MAX_BLOCKS_IN_MCU
#define ERREXIT1(cinfo, code, p1)
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
transencode_coef_controller(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
transencode_master_selection(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only)
#define ERREXIT2(cinfo, code, p1, p2)
jinit_marker_writer(j_compress_ptr cinfo)
compress_output(j_compress_ptr cinfo, JSAMPIMAGE)
jpeg_component_info * compptr
int MCU_rows_per_iMCU_row
jvirt_barray_ptr whole_image[MAX_COMPONENTS]