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;
221 } my_coef_controller;
236 if (cinfo->comps_in_scan > 1) {
237 coef->MCU_rows_per_iMCU_row = 1;
239 if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
240 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
242 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
246 coef->MCU_vert_offset = 0;
260 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
262 coef->iMCU_row_num = 0;
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)
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];
313 if (coef->iMCU_row_num < last_iMCU_row ||
317 for (xindex = 0; xindex < blockcnt; xindex++)
318 MCU_buffer[blkn++] = buffer_ptr++;
330 MCU_buffer[blkn] = coef->dummy_buffer[blkn];
331 MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
337 if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
339 coef->MCU_vert_offset =
yoffset;
340 coef->mcu_ctr = MCU_col_num;
348 coef->iMCU_row_num++;
372 SIZEOF(my_coef_controller));
386 coef->dummy_buffer[
i] = buffer +
i;
for(n=1;n< outline->n_points;n++)
UINT16 quantval[DCTSIZE2]
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
#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)
compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
#define MEMCOPY(dest, src, size)
my_coef_controller * my_coef_ptr
#define C_MAX_BLOCKS_IN_MCU
struct jpeg_destination_mgr * dest
GLint GLint GLint yoffset
jinit_phuff_encoder(j_compress_ptr cinfo)
jzero_far(void FAR *target, size_t bytestozero)
jinit_huff_encoder(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
struct jvirt_barray_control * jvirt_barray_ptr
jpeg_alloc_quant_table(j_common_ptr cinfo)
if(!abbox) return FT_THROW(Invalid_Argument)
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
start_iMCU_row(j_compress_ptr cinfo)
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