From 47a2d8e1d9c927d9b545f6bbf2c9168c45933b12 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Sat, 27 Sep 2014 00:36:01 -0700 Subject: [PATCH] fix MSVC float->int conversion warning + add a clarifying comment Change-Id: I8ac1df1de2e5277f2d968dec489546e680bb5e0c --- src/enc/histogram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/enc/histogram.c b/src/enc/histogram.c index 1042077c..faca4a5a 100644 --- a/src/enc/histogram.c +++ b/src/enc/histogram.c @@ -965,7 +965,8 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, { const float x = quality / 100.f; - const int threshold_size = 1 + (x * x * x) * (MAX_HISTO_GREEDY - 1); + // cubic ramp between 1 and MAX_HISTO_GREEDY: + const int threshold_size = (int)(1 + (x * x * x) * (MAX_HISTO_GREEDY - 1)); HistogramCombineStochastic(image_histo, histos, quality, threshold_size); if ((image_histo->size <= threshold_size) && !HistogramCombineGreedy(image_histo, histos->histograms[0])) {