X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvp9.c;h=1aab6ba03c319895b5ff80ae8523396d733c9530;hb=bd0db4a32d85d027da4d4dc00490c20048090312;hp=cb2a4a29212f1618ad0ff104c999f13ba33bc11d;hpb=32c25f06b79f9edcda726f6e043325d40036cdce;p=ffmpeg diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index cb2a4a29212..1aab6ba03c3 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -3705,11 +3705,10 @@ static av_always_inline void adapt_prob(uint8_t *p, unsigned ct0, unsigned ct1, 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); @@ -3992,7 +3991,12 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame, } if ((res = av_frame_ref(frame, s->s.refs[ref].f)) < 0) return res; + ((AVFrame *)frame)->pts = pkt->pts; +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS ((AVFrame *)frame)->pkt_pts = pkt->pts; +FF_ENABLE_DEPRECATION_WARNINGS +#endif ((AVFrame *)frame)->pkt_dts = pkt->dts; for (i = 0; i < 8; i++) { if (s->next_refs[i].f->buf[0])