diff --git a/vp10/common/ans.h b/vp10/common/ans.h index 163a7a956afb4c9bdec0c803648d6500e2951e05..6bd3012cdc2c89103678745dddecc5cfde67ac87 100644 --- a/vp10/common/ans.h +++ b/vp10/common/ans.h @@ -277,8 +277,8 @@ static INLINE void fetch_sym(struct rans_dec_sym *out, const rans_dec_lut cdf, ++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 b86f6c06fa29df6324bf3bb1c7ceda4e35a8023b..734241eec289ee178234819b5849f55110698f56 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -2143,14 +2143,15 @@ static int64_t rd_pick_intra_angle_sby(VP10_COMP *cpi, MACROBLOCK *x, 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 @@ static int64_t rd_pick_intra_angle_sby(VP10_COMP *cpi, MACROBLOCK *x, 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 @@ static int rd_pick_intra_angle_sbuv(VP10_COMP *cpi, MACROBLOCK *x, 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