return group_idx;
}
-void vp9_kmeans(double *ctr_ls, double *boundary_ls, int k, KMEANS_DATA *arr,
- int size) {
+void vp9_kmeans(double *ctr_ls, double *boundary_ls, int *count_ls, int k,
+ KMEANS_DATA *arr, int size) {
double min, max;
double step;
int i, j;
}
}
- // compute group_idx
+ // compute group_idx, boundary_ls and count_ls
+ for (j = 0; j < k; ++j) {
+ count_ls[j] = 0;
+ }
compute_boundary_ls(ctr_ls, k, boundary_ls);
group_idx = 0;
for (i = 0; i < size; ++i) {
}
}
arr[i].group_idx = group_idx;
+ ++count_ls[group_idx];
}
}
wiener_var_rdmult(cpi, BLOCK_64X64, mi_row, mi_col, cpi->rd.RDMULT);
vp9_kmeans(cpi->kmeans_ctr_ls, cpi->kmeans_boundary_ls,
- cpi->kmeans_ctr_num, cpi->kmeans_data_arr,
- cpi->kmeans_data_size);
+ cpi->kmeans_count_ls, cpi->kmeans_ctr_num,
+ cpi->kmeans_data_arr, cpi->kmeans_data_size);
vp9_perceptual_aq_mode_setup(cpi, &cm->seg);
}
int content_state);
struct KMEANS_DATA;
-void vp9_kmeans(double *ctr_ls, double *boundary_ls, int k,
+void vp9_kmeans(double *ctr_ls, double *boundary_ls, int *count_ls, int k,
struct KMEANS_DATA *arr, int size);
int vp9_get_group_idx(double value, double *boundary_ls, int k);