#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "av1/common/blockd.h"
#include "av1/encoder/palette.h"
#include "av1/encoder/random.h"
#ifndef AV1_K_MEANS_DIM
#error "This template requires AV1_K_MEANS_DIM to be defined"
#endif
#define RENAME_ …
#define RENAME …
#define K_MEANS_RENAME_C …
#define RENAME_C_ …
#define RENAME_C …
static int RENAME(calc_dist)(const int16_t *p1, const int16_t *p2) { … }
void RENAME_C(av1_calc_indices)(const int16_t *data, const int16_t *centroids,
uint8_t *indices, int64_t *dist, int n, int k) { … }
static void RENAME(calc_centroids)(const int16_t *data, int16_t *centroids,
const uint8_t *indices, int n, int k) { … }
void RENAME(av1_k_means)(const int16_t *data, int16_t *centroids,
uint8_t *indices, int n, int k, int max_itr) { … }
#undef RENAME_
#undef RENAME
#undef K_MEANS_RENAME_C
#undef RENAME_C_
#undef RENAME_C