1 /* Copyright 2013 Google Inc. All Rights Reserved. 2 3 Distributed under MIT license. 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 */ 6 7 /* Functions for clustering similar histograms together. */ 8 9 #ifndef BROTLI_ENC_CLUSTER_H_ 10 #define BROTLI_ENC_CLUSTER_H_ 11 12 #include <brotli/types.h> 13 14 #include "../common/platform.h" 15 #include "histogram.h" 16 #include "memory.h" 17 18 #if defined(__cplusplus) || defined(c_plusplus) 19 extern "C" { 20 #endif 21 22 typedef struct HistogramPair { 23 uint32_t idx1; 24 uint32_t idx2; 25 double cost_combo; 26 double cost_diff; 27 } HistogramPair; 28 29 #define CODE(X) /* Declaration */; 30 31 #define FN(X) X ## Literal 32 #include "cluster_inc.h" /* NOLINT(build/include) */ 33 #undef FN 34 35 #define FN(X) X ## Command 36 #include "cluster_inc.h" /* NOLINT(build/include) */ 37 #undef FN 38 39 #define FN(X) X ## Distance 40 #include "cluster_inc.h" /* NOLINT(build/include) */ 41 #undef FN 42 43 #undef CODE 44 45 #if defined(__cplusplus) || defined(c_plusplus) 46 } /* extern "C" */ 47 #endif 48 49 #endif /* BROTLI_ENC_CLUSTER_H_ */ 50