Home | History | Annotate | Download | only in libjpeg-turbo

Lines Matching defs:histogram

36  * In the first pass over the image, we accumulate a histogram showing the
37 * usage count of each possible color. To keep the histogram to a reasonable
40 * in the same histogram cell.
85 * First we have the histogram data structure and routines for creating it.
92 * To maintain a fully accurate histogram, we'd need to allocate a "long"
96 * enough results. This reduces the recommended histogram size from 256Kb
98 * (In the second pass the histogram space is re-used for pixel mapping data;
102 * machines, we can't just allocate the histogram in one chunk. Instead
113 #define HIST_C0_BITS 5 /* bits of precision in R/B histogram */
114 #define HIST_C1_BITS 6 /* bits of precision in G histogram */
115 #define HIST_C2_BITS 5 /* bits of precision in B/R histogram */
117 /* Number of elements along histogram axes. */
122 /* These are the amounts to shift an input value to get a histogram index. */
128 typedef UINT16 histcell; /* histogram cell; prefer an unsigned type */
130 typedef histcell * histptr; /* for pointers to histogram cells */
179 hist3d histogram; /* pointer to the histogram */
181 boolean needs_zeroed; /* TRUE if next pass must zero histogram */
194 * In this module the prescan simply updates the histogram, which has been
208 register hist3d histogram = cquantize->histogram;
216 /* get pixel value and index into the histogram */
217 histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
231 * given the completed histogram.
233 * subset of the input color space (to histogram precision).
237 /* The bounds of the box (inclusive); expressed as histogram indexes */
243 /* The number of nonzero histogram cells within this box */
296 hist3d histogram = cquantize->histogram;
310 histp = & histogram[c0][c1][c2min];
321 histp = & histogram[c0][c1][c2min];
332 histp = & histogram[c0][c1][c2min];
343 histp = & histogram[c0][c1][c2min];
354 histp = & histogram[c0][c1min][c2];
365 histp = & histogram[c0][c1min][c2];
378 * Since the differences are expressed in histogram-cell units,
391 histp = & histogram[c0][c1][c2min];
484 hist3d histogram = cquantize->histogram;
500 histp = & histogram[c0][c1][c2min];
552 * We re-use the histogram space as an "inverse color map", essentially a
554 * histogram cell will be mapped to the same colormap entry, namely the one
567 * the distances from a given colormap entry to each cell of the histogram can
571 * distance from every colormap entry to every histogram cell. Unfortunately,
572 * it needs a work array to hold the best-distance-so-far for each histogram
578 * nearest colors for only the cells within a small subbox of the histogram.
590 * size seems to be about 1/512th of the histogram (1/8th in each direction).
596 * with plenty of memory, filling the whole histogram in one shot with Thomas'
602 /* log2(histogram cells in update box) for each axis; this can be adjusted */
645 * histogram cell, which are the upper bounds of the volume we care about.
836 /* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */
840 hist3d histogram = cquantize->histogram;
858 * histogram cell, which are the lower bounds of the volume we care about.
880 cachep = & histogram[c0+ic0][c1+ic1][c2];
899 hist3d histogram = cquantize->histogram;
915 cachep = & histogram[c0][c1][c2];
933 hist3d histogram = cquantize->histogram;
1006 cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];
1140 hist3d histogram = cquantize->histogram;
1152 cquantize->needs_zeroed = TRUE; /* Always zero histogram */
1184 /* Zero the histogram or inverse color map, if necessary */
1187 jzero_far((void *) histogram[i],
1232 /* Allocate the histogram/inverse colormap storage */
1233 cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
1236 cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
1240 cquantize->needs_zeroed = TRUE; /* histogram is garbage now */