]> git.sesse.net Git - ffmpeg/commitdiff
vp9: use resetctx in the same way as libvpx.
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 2 Sep 2015 16:20:29 +0000 (12:20 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Fri, 4 Sep 2015 13:33:44 +0000 (09:33 -0400)
libavcodec/vp9.c

index b986c1e10ff2236b528afac8b43fc2009008eb15..c80468601c1437f7ede10c48a2bd0bed36db0181 100644 (file)
@@ -856,7 +856,7 @@ static int decode_frame_header(AVCodecContext *ctx,
         }
     }
 
-    if (s->keyframe || s->errorres || s->intraonly) {
+    if (s->keyframe || s->errorres || (s->intraonly && s->resetctx == 3)) {
         s->prob_ctx[0].p = s->prob_ctx[1].p = s->prob_ctx[2].p =
                            s->prob_ctx[3].p = vp9_default_probs;
         memcpy(s->prob_ctx[0].coef, vp9_default_coef_probs,
@@ -867,6 +867,10 @@ static int decode_frame_header(AVCodecContext *ctx,
                sizeof(vp9_default_coef_probs));
         memcpy(s->prob_ctx[3].coef, vp9_default_coef_probs,
                sizeof(vp9_default_coef_probs));
+    } else if (s->intraonly && s->resetctx == 2) {
+        s->prob_ctx[c].p = vp9_default_probs;
+        memcpy(s->prob_ctx[c].coef, vp9_default_coef_probs,
+               sizeof(vp9_default_coef_probs));
     }
 
     // next 16 bits is size of the rest of the header (arith-coded)