Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1067)

Unified Diff: source/libvpx/vp9/encoder/vp9_aq_cyclicrefresh.c

Issue 996503002: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_dthread.c ('k') | source/libvpx/vp9/encoder/vp9_avg.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_aq_cyclicrefresh.c
diff --git a/source/libvpx/vp9/encoder/vp9_aq_cyclicrefresh.c b/source/libvpx/vp9/encoder/vp9_aq_cyclicrefresh.c
index ff08f04e6a1d4ab085f6fbcfaa1ae63463b9e6f5..154068052c7c3db569aa01a29928fd44813c3a8c 100644
--- a/source/libvpx/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/source/libvpx/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -368,9 +368,11 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
cr->time_for_refresh = 0;
// Set rate threshold to some multiple (set to 2 for now) of the target
// rate (target is given by sb64_target_rate and scaled by 256).
- cr->thresh_rate_sb = (rc->sb64_target_rate << 8) << 1;
+ cr->thresh_rate_sb = ((int64_t)(rc->sb64_target_rate) << 8) << 1;
// Distortion threshold, quadratic in Q, scale factor to be adjusted.
- cr->thresh_dist_sb = (int)(q * q) << 2;
+ // q will not exceed 457, so (q * q) is within 32bit; see:
+ // vp9_convert_qindex_to_q(), vp9_ac_quant(), ac_qlookup*[].
+ cr->thresh_dist_sb = ((int64_t)(q * q)) << 2;
cr->motion_thresh = 32;
// Set up segmentation.
// Clear down the segment map.
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_dthread.c ('k') | source/libvpx/vp9/encoder/vp9_avg.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698