fix some implicit type conversion warnings

Change-Id: I0653d10410c0d46f91fedad4c4dffa9c1de402cb
This commit is contained in:
James Zern 2012-06-04 18:36:02 -07:00
parent 8fbb91884e
commit 42f6df9da3
3 changed files with 10 additions and 10 deletions

View File

@ -132,7 +132,7 @@ float VP8LFastLog(int v) {
}
return kLogTable[v] + (log_cnt * LOG_2_BASE_E);
}
return log(v);
return (float)log(v);
}
#endif

View File

@ -86,7 +86,7 @@ static int EncodeLossless(const uint8_t* data, int width, int height,
config.method = effort_level; // impact is very small
// quality below 50 doesn't change things much (in speed and size).
// quality above 80 can be very very slow.
config.quality = 40 + 10 * effort_level;
config.quality = 40 + 10.f * effort_level;
VP8LBitWriterInit(&tmp_bw, (width * height) >> 3);
ok = (VP8LEncodeStream(&config, &picture, &tmp_bw) == VP8_ENC_OK);

View File

@ -97,7 +97,7 @@ static int AnalyzeAndCreatePalette(const uint32_t* const argb, int num_pix,
return 1;
}
static int AnalyzeEntropy(const uint32_t const *argb, int xsize, int ysize,
static int AnalyzeEntropy(const uint32_t* const argb, int xsize, int ysize,
double* const nonpredicted_bits,
double* const predicted_bits) {
int i;
@ -707,12 +707,12 @@ static WebPEncodingError WriteImage(const WebPPicture* const pic,
static WebPEncodingError AllocateTransformBuffer(VP8LEncoder* const enc,
int width, int height) {
WebPEncodingError err = VP8_ENC_OK;
const size_t tile_size = 1 << enc->transform_bits_;
const size_t image_size = height * width;
const size_t argb_scratch_size = (tile_size + 1) * width;
const int tile_size = 1 << enc->transform_bits_;
const size_t image_size = width * height;
const size_t argb_scratch_size = tile_size * width + width;
const size_t transform_data_size =
VP8LSubSampleSize(height, enc->transform_bits_) *
VP8LSubSampleSize(width, enc->transform_bits_);
VP8LSubSampleSize(width, enc->transform_bits_) *
VP8LSubSampleSize(height, enc->transform_bits_);
const size_t total_size =
image_size + argb_scratch_size + transform_data_size;
uint32_t* mem = (uint32_t*)malloc(total_size * sizeof(*mem));
@ -865,7 +865,7 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config,
const WebPPicture* const picture,
VP8LBitWriter* const bw) {
WebPEncodingError err = VP8_ENC_OK;
const int quality = config->quality;
const int quality = (int)config->quality;
const int width = picture->width;
const int height = picture->height;
VP8LEncoder* const enc = VP8LEncoderNew(config, picture);
@ -997,7 +997,7 @@ int VP8LEncodeImage(const WebPConfig* const config,
stats->PSNR[1] = 99.;
stats->PSNR[2] = 99.;
stats->PSNR[3] = 99.;
stats->coded_size = coded_size;
stats->coded_size = (int)coded_size;
}
if (picture->extra_info != NULL) {