cluster.h 1.0 KB

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