Bug 1293996: Workaround AMD hardware related crash. r=jya
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 12 Oct 2016 21:19:54 +1100
changeset 317840 6154e22334bcc18df530851213ef75c5f1e26d49
parent 317780 d5f3348f69be78b798941d308d25fc62b93de8a8
child 317841 73b3f8cc7d5f13b9254a533319d8f17e8db4794d
push id33170
push usercbook@mozilla.com
push dateFri, 14 Oct 2016 10:37:07 +0000
treeherderautoland@0d101ebfd95c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1293996
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1293996: Workaround AMD hardware related crash. r=jya MozReview-Commit-ID: IONAxzyag1b
media/ffvpx/libavcodec/vp9.c
--- a/media/ffvpx/libavcodec/vp9.c
+++ b/media/ffvpx/libavcodec/vp9.c
@@ -3700,21 +3700,20 @@ static void set_tile_offset(int *start, 
 static av_always_inline void adapt_prob(uint8_t *p, unsigned ct0, unsigned ct1,
                                         int max_count, int update_factor)
 {
     unsigned ct = ct0 + ct1, p2, p1;
 
     if (!ct)
         return;
 
+    update_factor = FASTDIV(update_factor * FFMIN(ct, max_count), max_count);
     p1 = *p;
-    p2 = ((ct0 << 8) + (ct >> 1)) / ct;
+    p2 = ((((int64_t) ct0) << 8) + (ct >> 1)) / ct;
     p2 = av_clip(p2, 1, 255);
-    ct = FFMIN(ct, max_count);
-    update_factor = FASTDIV(update_factor * ct, max_count);
 
     // (p1 * (256 - update_factor) + p2 * update_factor + 128) >> 8
     *p = p1 + (((p2 - p1) * update_factor + 128) >> 8);
 }
 
 static void adapt_probs(VP9Context *s)
 {
     int i, j, k, l, m;