Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(987)

Side by Side Diff: third_party/brotli/enc/cluster.h

Issue 1981333002: Fix Brotli warnings on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/brotli/README.chromium ('k') | third_party/brotli/enc/hash.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright 2013 Google Inc. All Rights Reserved. 1 /* Copyright 2013 Google Inc. All Rights Reserved.
2 2
3 Distributed under MIT license. 3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5 */ 5 */
6 6
7 // Functions for clustering similar histograms together. 7 // Functions for clustering similar histograms together.
8 8
9 #ifndef BROTLI_ENC_CLUSTER_H_ 9 #ifndef BROTLI_ENC_CLUSTER_H_
10 #define BROTLI_ENC_CLUSTER_H_ 10 #define BROTLI_ENC_CLUSTER_H_
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 size_t* num_pairs) { 56 size_t* num_pairs) {
57 if (idx1 == idx2) { 57 if (idx1 == idx2) {
58 return; 58 return;
59 } 59 }
60 if (idx2 < idx1) { 60 if (idx2 < idx1) {
61 uint32_t t = idx2; 61 uint32_t t = idx2;
62 idx2 = idx1; 62 idx2 = idx1;
63 idx1 = t; 63 idx1 = t;
64 } 64 }
65 bool store_pair = false; 65 bool store_pair = false;
66 HistogramPair p; 66 HistogramPair p = {};
67 p.idx1 = idx1; 67 p.idx1 = idx1;
68 p.idx2 = idx2; 68 p.idx2 = idx2;
69 p.cost_diff = 0.5 * ClusterCostDiff(cluster_size[idx1], cluster_size[idx2]); 69 p.cost_diff = 0.5 * ClusterCostDiff(cluster_size[idx1], cluster_size[idx2]);
70 p.cost_diff -= out[idx1].bit_cost_; 70 p.cost_diff -= out[idx1].bit_cost_;
71 p.cost_diff -= out[idx2].bit_cost_; 71 p.cost_diff -= out[idx2].bit_cost_;
72 72
73 if (out[idx1].total_count_ == 0) { 73 if (out[idx1].total_count_ == 0) {
74 p.cost_combo = out[idx2].bit_cost_; 74 p.cost_combo = out[idx2].bit_cost_;
75 store_pair = true; 75 store_pair = true;
76 } else if (out[idx2].total_count_ == 0) { 76 } else if (out[idx2].total_count_ == 0) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 // Convert the context map to a canonical form. 322 // Convert the context map to a canonical form.
323 size_t num_histograms = 323 size_t num_histograms =
324 HistogramReindex(&(*out)[0], &(*histogram_symbols)[0], in_size); 324 HistogramReindex(&(*out)[0], &(*histogram_symbols)[0], in_size);
325 out->resize(num_histograms); 325 out->resize(num_histograms);
326 } 326 }
327 327
328 } // namespace brotli 328 } // namespace brotli
329 329
330 #endif // BROTLI_ENC_CLUSTER_H_ 330 #endif // BROTLI_ENC_CLUSTER_H_
OLDNEW
« no previous file with comments | « third_party/brotli/README.chromium ('k') | third_party/brotli/enc/hash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698