Home | History | Annotate | Download | only in jpeg

Lines Matching refs:cinfo

224 prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
227 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
233 JDIMENSION width = cinfo->output_width;
313 update_box (j_decompress_ptr cinfo, boxptr boxp)
317 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
424 median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
490 update_box(cinfo, b1);
491 update_box(cinfo, b2);
499 compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
504 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
532 cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
533 cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
534 cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
539 select_colors (j_decompress_ptr cinfo, int desired_colors)
547 boxlist = (boxptr) (*cinfo->mem->alloc_small)
548 ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));
558 update_box(cinfo, & boxlist[0]);
560 numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);
563 compute_color(cinfo, & boxlist[i], i);
564 cinfo->actual_number_of_colors = numboxes;
565 TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
646 find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
657 int numcolors = cinfo->actual_number_of_colors;
689 x = GETJSAMPLE(cinfo->colormap[0][i]);
712 x = GETJSAMPLE(cinfo->colormap[1][i]);
734 x = GETJSAMPLE(cinfo->colormap[2][i]);
775 find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
814 inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
816 inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
818 inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
855 fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
860 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
888 numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);
891 find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,
915 pass2_no_dither (j_decompress_ptr cinfo,
919 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
926 JDIMENSION width = cinfo->output_width;
940 fill_inverse_cmap(cinfo, c0,c1,c2);
949 pass2_fs_dither (j_decompress_ptr cinfo,
953 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
966 JDIMENSION width = cinfo->output_width;
967 JSAMPLE *range_limit = cinfo->sample_range_limit;
969 JSAMPROW colormap0 = cinfo->colormap[0];
970 JSAMPROW colormap1 = cinfo->colormap[1];
971 JSAMPROW colormap2 = cinfo->colormap[2];
1031 fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
1108 init_error_limit (j_decompress_ptr cinfo)
1111 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1115 table = (int *) (*cinfo->mem->alloc_small)
1116 ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));
1143 finish_pass1 (j_decompress_ptr cinfo)
1145 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1147 /* Select the representative colors and fill in cinfo->colormap */
1148 cinfo->colormap = cquantize->sv_colormap;
1149 select_colors(cinfo, cquantize->desired);
1156 finish_pass2 (j_decompress_ptr cinfo)
1167 start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
1169 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1175 if (cinfo->dither_mode != JDITHER_NONE)
1176 cinfo->dither_mode = JDITHER_FS;
1185 if (cinfo->dither_mode == JDITHER_FS)
1192 i = cinfo->actual_number_of_colors;
1194 ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);
1196 ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
1198 if (cinfo->dither_mode == JDITHER_FS) {
1199 size_t arraysize = (size_t) ((cinfo->output_width + 2) *
1203 cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
1204 ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
1209 init_error_limit(cinfo);
1230 new_color_map_2_quant (j_decompress_ptr cinfo)
1232 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1244 jinit_2pass_quantizer (j_decompress_ptr cinfo)
1250 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1252 cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
1259 if (cinfo->out_color_components != 3)
1260 ERREXIT(cinfo, JERR_NOTIMPL);
1263 cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
1264 ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d));
1266 cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
1267 ((j_common_ptr) cinfo, JPOOL_IMAGE,
1276 if (cinfo->enable_2pass_quant) {
1278 int desired = cinfo->desired_number_of_colors;
1281 ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);
1284 ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
1285 cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)
1286 ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);
1293 if (cinfo->dither_mode != JDITHER_NONE)
1294 cinfo->dither_mode = JDITHER_FS;
1301 if (cinfo->dither_mode == JDITHER_FS) {
1302 cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
1303 ((j_common_ptr) cinfo, JPOOL_IMAGE,
1304 (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));
1306 init_error_limit(cinfo);