diff --git a/src/enc/histogram_enc.c b/src/enc/histogram_enc.c index a5814742..8418def2 100644 --- a/src/enc/histogram_enc.c +++ b/src/enc/histogram_enc.c @@ -256,7 +256,7 @@ static WEBP_INLINE float BitsEntropyRefine(const VP8LBitEntropy* entropy) { } { - float min_limit = 2 * entropy->sum - entropy->max_val; + float min_limit = 2.f * entropy->sum - entropy->max_val; min_limit = mix * min_limit + (1.f - mix) * entropy->entropy; return (entropy->entropy < min_limit) ? min_limit : entropy->entropy; } diff --git a/src/enc/predictor_enc.c b/src/enc/predictor_enc.c index d950b9a0..b3d44b59 100644 --- a/src/enc/predictor_enc.c +++ b/src/enc/predictor_enc.c @@ -35,7 +35,7 @@ static float PredictionCostSpatial(const int counts[256], int weight_0, float exp_val) { const int significant_symbols = 256 >> 4; const float exp_decay_factor = 0.6f; - float bits = weight_0 * counts[0]; + float bits = (float)weight_0 * counts[0]; int i; for (i = 1; i < significant_symbols; ++i) { bits += exp_val * (counts[i] + counts[256 - i]);