1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-09 14:14:39 +02:00

avcodec/vp8: Enforce key-frame only for WebP

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

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-01-30 21:04:43 +01:00
parent 7375a6ca7b
commit 4b8b1415ae

View File

@ -2665,7 +2665,11 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
if (ret < 0)
goto err;
if (s->actually_webp) {
if (!is_vp7 && s->actually_webp) {
// VP8 in WebP is supposed to be intra-only. Enforce this here
// to ensure that output is reproducible with frame-threading.
if (!s->keyframe)
return AVERROR_INVALIDDATA;
// avctx->pix_fmt already set in caller.
} else if (!is_vp7 && s->pix_fmt == AV_PIX_FMT_NONE) {
s->pix_fmt = get_pixel_format(s);