40 if (((
long) cinfo->image_width >> 24) || ((
long) cinfo->image_height >> 24))
43#ifdef DCT_SCALING_SUPPORTED
46 if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
48 cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
49 cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
50 cinfo->min_DCT_h_scaled_size = 1;
51 cinfo->min_DCT_v_scaled_size = 1;
52 }
else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
55 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 2L);
57 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 2L);
58 cinfo->min_DCT_h_scaled_size = 2;
59 cinfo->min_DCT_v_scaled_size = 2;
60 }
else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
63 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 3L);
65 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 3L);
66 cinfo->min_DCT_h_scaled_size = 3;
67 cinfo->min_DCT_v_scaled_size = 3;
68 }
else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
71 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 4L);
73 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 4L);
74 cinfo->min_DCT_h_scaled_size = 4;
75 cinfo->min_DCT_v_scaled_size = 4;
76 }
else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
79 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 5L);
81 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 5L);
82 cinfo->min_DCT_h_scaled_size = 5;
83 cinfo->min_DCT_v_scaled_size = 5;
84 }
else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
87 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 6L);
89 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 6L);
90 cinfo->min_DCT_h_scaled_size = 6;
91 cinfo->min_DCT_v_scaled_size = 6;
92 }
else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
95 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 7L);
97 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 7L);
98 cinfo->min_DCT_h_scaled_size = 7;
99 cinfo->min_DCT_v_scaled_size = 7;
100 }
else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
103 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 8L);
105 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 8L);
106 cinfo->min_DCT_h_scaled_size = 8;
107 cinfo->min_DCT_v_scaled_size = 8;
108 }
else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
111 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 9L);
113 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 9L);
114 cinfo->min_DCT_h_scaled_size = 9;
115 cinfo->min_DCT_v_scaled_size = 9;
116 }
else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
119 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 10L);
121 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 10L);
122 cinfo->min_DCT_h_scaled_size = 10;
123 cinfo->min_DCT_v_scaled_size = 10;
124 }
else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
127 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 11L);
129 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 11L);
130 cinfo->min_DCT_h_scaled_size = 11;
131 cinfo->min_DCT_v_scaled_size = 11;
132 }
else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
135 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 12L);
137 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 12L);
138 cinfo->min_DCT_h_scaled_size = 12;
139 cinfo->min_DCT_v_scaled_size = 12;
140 }
else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
143 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 13L);
145 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 13L);
146 cinfo->min_DCT_h_scaled_size = 13;
147 cinfo->min_DCT_v_scaled_size = 13;
148 }
else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
151 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 14L);
153 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 14L);
154 cinfo->min_DCT_h_scaled_size = 14;
155 cinfo->min_DCT_v_scaled_size = 14;
156 }
else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
159 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 15L);
161 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 15L);
162 cinfo->min_DCT_h_scaled_size = 15;
163 cinfo->min_DCT_v_scaled_size = 15;
167 jdiv_round_up((
long) cinfo->image_width * cinfo->block_size, 16L);
169 jdiv_round_up((
long) cinfo->image_height * cinfo->block_size, 16L);
170 cinfo->min_DCT_h_scaled_size = 16;
171 cinfo->min_DCT_v_scaled_size = 16;
177 cinfo->jpeg_width = cinfo->image_width;
178 cinfo->jpeg_height = cinfo->image_height;
179 cinfo->min_DCT_h_scaled_size =
DCTSIZE;
180 cinfo->min_DCT_v_scaled_size =
DCTSIZE;
200 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
203 if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
204 cinfo->input_components <= 0)
205 ERREXIT(cinfo, JERR_EMPTY_IMAGE);
208 samplesperrow = (
long) cinfo->image_width * (
long) cinfo->input_components;
209 jd_samplesperrow = (
JDIMENSION) samplesperrow;
210 if ((
long) jd_samplesperrow != samplesperrow)
211 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
220 if (! cinfo->raw_data_in) {
228 if (cinfo->arith_code)
236 (
boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
242 (*cinfo->mem->realize_virt_arrays) ((
j_common_ptr) cinfo);
248 (*cinfo->marker->write_file_header) (cinfo);
jinit_arith_encoder(j_compress_ptr cinfo)
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
jinit_color_converter(j_compress_ptr cinfo)
jinit_forward_dct(j_compress_ptr cinfo)
jinit_huff_encoder(j_compress_ptr cinfo)
jinit_compress_master(j_compress_ptr cinfo)
jpeg_calc_jpeg_dimensions(j_compress_ptr cinfo)
jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer)
jinit_marker_writer(j_compress_ptr cinfo)
jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only)
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)
jinit_downsampler(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
#define JPEG_MAX_DIMENSION
jdiv_round_up(long a, long b)