Lines Matching refs:cinfo
23 jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
37 if (cinfo->global_state != CSTATE_START)
38 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
41 ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
43 qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
46 *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
64 jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
98 jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
100 jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
132 jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
143 jpeg_set_linear_quality(cinfo, quality, force_baseline);
152 add_huff_table (j_compress_ptr cinfo,
159 *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
172 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
182 std_huff_tables (j_compress_ptr cinfo)
246 add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
248 add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
250 add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
252 add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
268 jpeg_set_defaults (j_compress_ptr cinfo)
273 if (cinfo->global_state != CSTATE_START)
274 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
280 if (cinfo->comp_info == NULL)
281 cinfo->comp_info = (jpeg_component_info *)
282 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
287 cinfo->data_precision = BITS_IN_JSAMPLE;
289 jpeg_set_quality(cinfo, 75, TRUE);
291 std_huff_tables(cinfo);
295 cinfo->arith_dc_L[i] = 0;
296 cinfo->arith_dc_U[i] = 1;
297 cinfo->arith_ac_K[i] = 5;
301 cinfo->scan_info = NULL;
302 cinfo->num_scans = 0;
305 cinfo->raw_data_in = FALSE;
308 cinfo->arith_code = FALSE;
311 cinfo->optimize_coding = FALSE;
317 if (cinfo->data_precision > 8)
318 cinfo->optimize_coding = TRUE;
321 cinfo->CCIR601_sampling = FALSE;
324 cinfo->smoothing_factor = 0;
327 cinfo->dct_method = JDCT_DEFAULT;
330 cinfo->restart_interval = 0;
331 cinfo->restart_in_rows = 0;
342 cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
343 cinfo->JFIF_minor_version = 1;
344 cinfo->density_unit = 0; /* Pixel size is unknown by default */
345 cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
346 cinfo->Y_density = 1;
350 jpeg_default_colorspace(cinfo);
359 jpeg_default_colorspace (j_compress_ptr cinfo)
361 switch (cinfo->in_color_space) {
363 jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
366 jpeg_set_colorspace(cinfo, JCS_YCbCr);
369 jpeg_set_colorspace(cinfo, JCS_YCbCr);
372 jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
375 jpeg_set_colorspace(cinfo, JCS_YCCK);
378 jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
383 jpeg_set_colorspace(cinfo, JCS_YCbCr);
387 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
397 jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
403 (compptr = &cinfo->comp_info[index], \
412 if (cinfo->global_state != CSTATE_START)
413 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
419 cinfo->jpeg_color_space = colorspace;
421 cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
422 cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
426 cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
427 cinfo->num_components = 1;
432 cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
433 cinfo->num_components = 3;
439 cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
440 cinfo->num_components = 3;
448 cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
449 cinfo->num_components = 4;
456 cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
457 cinfo->num_components = 4;
464 cinfo->num_components = cinfo->input_components;
465 if (cinfocinfo->num_components > MAX_COMPONENTS)
466 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
468 for (ci = 0; ci < cinfo->num_components; ci++) {
473 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
539 * cinfo->num_components and cinfo->jpeg_color_space must be correct.
543 jpeg_simple_progression (j_compress_ptr cinfo)
545 int ncomps = cinfo->num_components;
550 if (cinfo->global_state != CSTATE_START)
551 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
554 if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
572 if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
573 cinfo->script_space_size = MAX(nscans, 10);
574 cinfo->script_space = (jpeg_scan_info *)
575 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
576 cinfo->script_space_size * SIZEOF(jpeg_scan_info));
578 scanptr = cinfo->script_space;
579 cinfo->scan_info = scanptr;
580 cinfo->num_scans = nscans;
582 if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {