Lines Matching refs:counts
67 especially when population counts are longer than 2**tree_limit, but
244 void BrotliOptimizeHuffmanCountsForRle(size_t length, uint32_t* counts,
254 if (counts[i]) {
261 while (length != 0 && counts[length - 1] == 0) {
267 /* Now counts[0..length - 1] does not have trailing zeros. */
272 if (counts[i] != 0) {
274 if (smallest_nonzero > counts[i]) {
275 smallest_nonzero = counts[i];
287 if (counts[i - 1] != 0 && counts[i] == 0 && counts[i + 1] != 0) {
288 counts[i] = 1;
297 /* 2) Let's mark all population counts that already can be encoded
304 uint32_t symbol = counts[0];
307 if (i == length || counts[i] != symbol) {
317 symbol = counts[i];
324 /* 3) Let's replace those population counts that lead to more RLE codes.
327 limit = 256 * (counts[0] + counts[1] + counts[2]) / 3 + 420;
332 (256 * counts[i] - limit + streak_limit) >= 2 * streak_limit) {
345 /* We don't want to change value at counts[i],
347 counts[i - k - 1] = (uint32_t)count;
355 limit = 256 * (counts[i] + counts[i + 1] + counts[i + 2]) / 3 + 420;
357 limit = 256 * counts[i];
364 sum += counts[i];