Lines Matching refs:cinfo
347 prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
350 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
358 JDIMENSION width = cinfo->output_width;
470 update_box (j_decompress_ptr cinfo, boxptr boxp)
474 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
600 median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, argument
696 update_box (cinfo, b1);
697 update_box (cinfo, b2);
714 compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
719 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
758 cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total >> 1)) / total);
759 cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total >> 1)) / total);
760 cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total >> 1)) / total);
782 select_colors (j_decompress_ptr cinfo, int desired_colors) argument
794 boxlist = (boxptr) (*cinfo->mem->alloc_small)
795 ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF (box));
809 update_box (cinfo, &boxlist[0]);
811 numboxes = median_cut (cinfo, boxlist, numboxes, desired_colors);
814 compute_color (cinfo, &boxlist[i], i);
815 cinfo->actual_number_of_colors = numboxes;
816 TRACEMS1 (cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
925 j_decompress_ptr cinfo, argument
940 int numcolors = cinfo->actual_number_of_colors;
977 x = GETJSAMPLE (cinfo->colormap[0][i]);
1012 x = GETJSAMPLE (cinfo->colormap[1][i]);
1046 x = GETJSAMPLE (cinfo->colormap[2][i]);
1100 j_decompress_ptr cinfo, argument
1147 r = GETJSAMPLE (cinfo->colormap[0][icolor]);
1148 g = GETJSAMPLE (cinfo->colormap[1][icolor]);
1149 b = GETJSAMPLE (cinfo->colormap[2][icolor]);
1205 j_decompress_ptr cinfo, argument
1215 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1245 numcolors = find_nearby_colors (cinfo, minc0, minc1, minc2, colorlist);
1248 find_best_colors (cinfo, minc0, minc1, minc2, numcolors, colorlist,
1293 pass2_no_dither (j_decompress_ptr cinfo,
1297 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1299 JDIMENSION width = cinfo->output_width;
1348 fill_inverse_cmap (cinfo, c0, c1, c2);
1368 pass2_fs_dither (j_decompress_ptr cinfo,
1372 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1387 JDIMENSION width = cinfo->output_width;
1388 JSAMPLE *range_limit = cinfo->sample_range_limit;
1389 JSAMPROW colormap0 = cinfo->colormap[0];
1390 JSAMPROW colormap1 = cinfo->colormap[1];
1391 JSAMPROW colormap2 = cinfo->colormap[2];
1498 fill_inverse_cmap (cinfo, cur0 >> C0_SHIFT, cur1 >> C1_SHIFT,
1589 init_error_limit (j_decompress_ptr cinfo) argument
1598 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1599 table = (int *) (*cinfo->mem->alloc_small)
1600 ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE * 2 + 1) * SIZEOF (int));
1644 finish_pass1 (j_decompress_ptr cinfo) argument
1646 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1649 cinfo->colormap = cquantize->sv_colormap;
1650 select_colors (cinfo, cquantize->desired);
1657 finish_pass2 (j_decompress_ptr cinfo) argument
1667 start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) argument
1669 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1675 if (cinfo->dither_mode != JDITHER_NONE)
1676 cinfo->dither_mode = JDITHER_FS;
1688 if (cinfo->dither_mode == JDITHER_FS)
1695 i = cinfo->actual_number_of_colors;
1697 ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS, 1);
1699 ERREXIT1 (cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
1701 if (cinfo->dither_mode == JDITHER_FS)
1703 size_t arraysize = (size_t) ((cinfo->output_width + 2) *
1707 cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
1708 ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
1713 init_error_limit (cinfo);
1736 new_color_map_2_quant (j_decompress_ptr cinfo) argument
1738 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1777 jinit_2pass_quantizer (j_decompress_ptr cinfo) argument
1839 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1841 cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
1845 if (cinfo->out_color_components != 3)
1846 ERREXIT (cinfo, JERR_NOTIMPL);
1861 cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
1862 ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF (hist2d));
1865 cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
1866 ((j_common_ptr) cinfo, JPOOL_IMAGE,
1888 if (cinfo->enable_2pass_quant)
1891 int desired = cinfo->desired_number_of_colors;
1894 ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS, 8);
1897 ERREXIT1 (cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
1898 cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)
1899 ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) desired,
1908 if (cinfo->dither_mode != JDITHER_NONE)
1909 cinfo->dither_mode = JDITHER_FS;
1916 if (cinfo->dither_mode == JDITHER_FS)
1918 cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
1919 ((j_common_ptr) cinfo, JPOOL_IMAGE,
1920 (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF (FSERROR))));
1922 init_error_limit (cinfo);