History

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

Andreas Rheinhardt committed 2 years ago

Commit 4b8b1411 parent 7375a6c1 file · +5 −1Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/vp8.c+5−1
@@ -2665,7 +2665,11 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, · 2664 unmodified lines
26652665 if (ret < 0)
26662666 goto err;
26672667
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;
26692673 // avctx->pix_fmt already set in caller.
26702674 } else if (!is_vp7 && s->pix_fmt == AV_PIX_FMT_NONE) {
26712675 s->pix_fmt = get_pixel_format(s);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t