Lines Matching refs:pairs
13 it is below a threshold, stores the pair (idx1, idx2) in the *pairs queue. */
16 uint32_t idx2, size_t max_num_pairs, HistogramPair* pairs,
44 BROTLI_MAX(double, 0.0, pairs[0].cost_diff);
56 if (*num_pairs > 0 && HistogramPairIsLess(&pairs[0], &p)) {
59 pairs[*num_pairs] = pairs[0];
62 pairs[0] = p;
64 pairs[*num_pairs] = p;
74 HistogramPair* pairs,
84 /* We maintain a vector of histogram pairs, with the property that the pair
91 clusters[idx2], max_num_pairs, &pairs[0], &num_pairs);
100 if (pairs[0].cost_diff >= cost_diff_threshold) {
106 best_idx1 = pairs[0].idx1;
107 best_idx2 = pairs[0].idx2;
109 out[best_idx1].bit_cost_ = pairs[0].cost_combo;
125 /* Remove pairs intersecting the just combined best pair. */
128 HistogramPair* p = &pairs[i];
134 if (HistogramPairIsLess(&pairs[0], p)) {
136 HistogramPair front = pairs[0];
137 pairs[0] = *p;
138 pairs[copy_to_idx] = front;
140 pairs[copy_to_idx] = *p;
147 /* Push new pairs formed with the combined histogram to the heap. */
150 max_num_pairs, &pairs[0], &num_pairs);
258 /* For the first pass of clustering, we allow all pairs. */
259 HistogramPair* pairs = BROTLI_ALLOC(m, HistogramPair, pairs_capacity + 1);
263 BROTLI_IS_NULL(clusters) || BROTLI_IS_NULL(pairs)) {
288 &clusters[num_clusters], pairs,
295 /* For the second pass, we limit the total number of histogram pairs.
300 m, HistogramPair, pairs, pairs_capacity, max_num_pairs + 1);
306 pairs, num_clusters, in_size,
309 BROTLI_FREE(m, pairs);