VP8-in-WebP only uses key frame encoding (see [1]), yet this is currently not enforced. This commit does so in order to make output reproducible with frame-threading as the VP8 decoder's update_thread_context is not called at all when using decoding VP8-in-WebP (as this is unnecessary for key frame-only streams). [1]: https://developers.google.com/speed/webp/docs/riff_container
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -2665,7 +2665,11 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, · 2664 unmodified lines | |||
| 2665 | if (ret < 0) | 2665 | if (ret < 0) |
| 2666 | goto err; | 2666 | goto err; |
| 2667 | 2667 | ||
| 2668 | if (s->actually_webp) { | 2668 | if (!is_vp7 && s->actually_webp) { |
| 2669 | // VP8 in WebP is supposed to be intra-only. Enforce this here | ||
| 2670 | // to ensure that output is reproducible with frame-threading. | ||
| 2671 | if (!s->keyframe) | ||
| 2672 | return AVERROR_INVALIDDATA; | ||
| 2669 | // avctx->pix_fmt already set in caller. | 2673 | // avctx->pix_fmt already set in caller. |
| 2670 | } else if (!is_vp7 && s->pix_fmt == AV_PIX_FMT_NONE) { | 2674 | } else if (!is_vp7 && s->pix_fmt == AV_PIX_FMT_NONE) { |
| 2671 | s->pix_fmt = get_pixel_format(s); | 2675 | s->pix_fmt = get_pixel_format(s); |