Fix several MSVC compiler warning/errors
Change-Id: Iccaacee9b7a66b016b5747a3902c236888ad4ba1
diff --git a/vp10/common/ans.h b/vp10/common/ans.h
index 163a7a9..6bd3012 100644
--- a/vp10/common/ans.h
+++ b/vp10/common/ans.h
@@ -277,8 +277,8 @@
++i;
}
out->val = i - 1;
- out->prob = cdf[i] - cdf[i - 1];
- out->cum_prob = cdf[i - 1];
+ out->prob = (AnsP8)(cdf[i] - cdf[i - 1]);
+ out->cum_prob = (AnsP8)cdf[i - 1];
}
static INLINE int rans_read(struct AnsDecoder *ans,
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index b86f6c0..734241e 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -2143,14 +2143,15 @@
p_angle = mode_to_angle_map[mbmi->mode] +
mbmi->angle_delta[0] * ANGLE_STEP;
for (filter = INTRA_FILTER_LINEAR; filter < INTRA_FILTERS; ++filter) {
+ int64_t tmp_best_rd;
if ((FILTER_FAST_SEARCH || !pick_intra_filter(p_angle)) &&
filter != INTRA_FILTER_LINEAR)
continue;
mic->mbmi.intra_filter = filter;
+ tmp_best_rd = (i == 0 && filter == INTRA_FILTER_LINEAR &&
+ best_rd < INT64_MAX) ? (int64_t)(best_rd * rd_adjust) : best_rd;
super_block_yrd(cpi, x, &this_rate_tokenonly, &this_distortion,
- &s, NULL, bsize,
- (i == 0 && filter == INTRA_FILTER_LINEAR &&
- best_rd < INT64_MAX) ? best_rd * rd_adjust : best_rd);
+ &s, NULL, bsize, tmp_best_rd);
if (this_rate_tokenonly == INT_MAX) {
if (i == 0 && filter == INTRA_FILTER_LINEAR)
return best_rd;
@@ -2255,7 +2256,7 @@
return best_rd;
}
-static inline int get_angle_index(double angle) {
+static INLINE int get_angle_index(double angle) {
const double step = 22.5, base = 45;
return (int)round((angle - base) / step);
}
@@ -3397,11 +3398,12 @@
int i, j, best_i = -1;
for (i = 0; i < level1; ++i) {
+ int64_t tmp_best_rd;
mbmi->angle_delta[1] = deltas_level1[i];
- if (!super_block_uvrd(cpi, x, &this_rate_tokenonly,
- &this_distortion, &s, &this_sse, bsize,
- (i == 0 && best_rd < INT64_MAX) ?
- best_rd * rd_adjust : best_rd)) {
+ tmp_best_rd = (i == 0 && best_rd < INT64_MAX) ?
+ (int64_t)(best_rd * rd_adjust) : best_rd;
+ if (!super_block_uvrd(cpi, x, &this_rate_tokenonly, &this_distortion,
+ &s, &this_sse, bsize, tmp_best_rd)) {
if (i == 0)
break;
else