fix warnings about uint64_t -> uint32_t conversion

Change-Id: Iee027979b404d4b7edda506b844d354aa1026dae
This commit is contained in:
Pascal Massimino 2015-09-25 17:36:11 +02:00
parent 76a7dc39e5
commit 56668c9fc5
3 changed files with 4 additions and 3 deletions

View File

@ -110,7 +110,7 @@ void WebPRescalerExportRowExpandC(WebPRescaler* const wrk) {
}
} else {
const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub);
const uint32_t A = WEBP_RESCALER_ONE - B;
const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B);
for (x_out = 0; x_out < x_out_max; ++x_out) {
const uint64_t I = (uint64_t)A * frow[x_out]
+ (uint64_t)B * irow[x_out];

View File

@ -105,7 +105,7 @@ static void RescalerExportRowExpandSSE2(WebPRescaler* const wrk) {
}
} else {
const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub);
const uint32_t A = WEBP_RESCALER_ONE - B;
const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B);
const __m128i mA = _mm_set_epi64x(A, A);
const __m128i mB = _mm_set_epi64x(B, B);
const __m128i rounder = _mm_set_epi64x(ROUNDER, ROUNDER);

View File

@ -22,7 +22,8 @@ extern "C" {
#define WEBP_RESCALER_RFIX 32 // fixed-point precision for multiplies
#define WEBP_RESCALER_ONE (1ull << WEBP_RESCALER_RFIX)
#define WEBP_RESCALER_FRAC(x, y) (((uint64_t)(x) << WEBP_RESCALER_RFIX) / (y))
#define WEBP_RESCALER_FRAC(x, y) \
((uint32_t)(((uint64_t)(x) << WEBP_RESCALER_RFIX) / (y)))
// Structure used for on-the-fly rescaling
typedef uint32_t rescaler_t; // type for side-buffer