11 #define JPEG_INTERNALS 115 if (! (*dest->empty_output_buffer) (cinfo))
116 ERREXIT(cinfo, JERR_CANT_SUSPEND);
191 htbl = cinfo->ac_huff_tbl_ptrs[
index];
194 htbl = cinfo->dc_huff_tbl_ptrs[
index];
204 for (
i = 1;
i <= 16;
i++)
210 for (
i = 1;
i <= 16;
i++)
227 #ifdef C_ARITH_CODING_SUPPORTED 234 dc_in_use[
i] = ac_in_use[
i] = 0;
236 for (
i = 0;
i < cinfo->comps_in_scan;
i++) {
237 compptr = cinfo->cur_comp_info[
i];
244 length += dc_in_use[
i] + ac_in_use[
i];
253 emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
285 emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1);
288 if ((
long) cinfo->image_height > 65535L ||
289 (
long) cinfo->image_width > 65535L)
290 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (
unsigned int) 65535);
298 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
316 emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3);
320 for (
i = 0;
i < cinfo->comps_in_scan;
i++) {
321 compptr = cinfo->cur_comp_info[
i];
325 if (cinfo->progressive_mode) {
331 if (cinfo->Ss == 0) {
333 if (cinfo->Ah != 0 && !cinfo->arith_code)
344 emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
366 emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1);
373 emit_byte(cinfo, cinfo->JFIF_major_version);
374 emit_byte(cinfo, cinfo->JFIF_minor_version);
415 switch (cinfo->jpeg_color_space) {
441 if (
datalen > (
unsigned int) 65533)
442 ERREXIT(cinfo, JERR_BAD_LENGTH);
478 if (cinfo->write_JFIF_header)
480 if (cinfo->write_Adobe_marker)
504 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
513 if (cinfo->arith_code || cinfo->progressive_mode ||
514 cinfo->data_precision != 8) {
518 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
523 if (prec && is_baseline) {
526 TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
531 if (cinfo->arith_code) {
534 if (cinfo->progressive_mode)
536 else if (is_baseline)
557 if (cinfo->arith_code) {
567 for (
i = 0;
i < cinfo->comps_in_scan;
i++) {
568 compptr = cinfo->cur_comp_info[
i];
569 if (cinfo->progressive_mode) {
571 if (cinfo->Ss == 0) {
623 if (cinfo->quant_tbl_ptrs[
i] != NULL)
627 if (! cinfo->arith_code) {
629 if (cinfo->dc_huff_tbl_ptrs[
i] != NULL)
631 if (cinfo->ac_huff_tbl_ptrs[
i] != NULL)
write_file_header(j_compress_ptr cinfo)
write_scan_header(j_compress_ptr cinfo)
emit_sos(j_compress_ptr cinfo)
const int jpeg_natural_order[]
struct jpeg_common_struct * j_common_ptr
UINT16 quantval[DCTSIZE2]
emit_jfif_app0(j_compress_ptr cinfo)
#define ERREXIT(cinfo, code)
int const JOCTET unsigned int datalen
emit_byte(j_compress_ptr cinfo, int val)
write_file_trailer(j_compress_ptr cinfo)
unsigned int last_restart_interval
emit_dqt(j_compress_ptr cinfo, int index)
png_bytep png_bytep png_size_t length
jpeg_component_info * compptr
write_marker_byte(j_compress_ptr cinfo, int val)
#define TRACEMS(cinfo, lvl, code)
write_marker_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
emit_sof(j_compress_ptr cinfo, JPEG_MARKER code)
my_marker_writer * my_marker_ptr
emit_dri(j_compress_ptr cinfo)
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
emit_adobe_app14(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
emit_dht(j_compress_ptr cinfo, int index, boolean is_ac)
write_tables_only(j_compress_ptr cinfo)
write_frame_header(j_compress_ptr cinfo)
jinit_marker_writer(j_compress_ptr cinfo)
struct jpeg_marker_writer pub
emit_marker(j_compress_ptr cinfo, JPEG_MARKER mark)
emit_dac(j_compress_ptr cinfo)
JOCTET * next_output_byte
emit_2bytes(j_compress_ptr cinfo, int value)