[FFmpeg-cvslog] avcodec/libdav1d: honor the requested skip_frame level
James Almer
git at videolan.org
Sun Dec 18 02:38:38 EET 2022
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Dec 14 12:55:38 2022 -0300| [7af947c0c0a2917f86005a30350eb3ab361ef328] | committer: James Almer
avcodec/libdav1d: honor the requested skip_frame level
This allows dropping non-reference, non-intra, or non-key frames on supported
libdav1d versions.
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7af947c0c0a2917f86005a30350eb3ab361ef328
---
libavcodec/libdav1d.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 2f151d2d1b..b43af03732 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -260,6 +260,15 @@ static av_cold int libdav1d_init(AVCodecContext *c)
s.n_frame_threads, s.n_tile_threads);
#endif
+#if FF_DAV1D_VERSION_AT_LEAST(6,8)
+ if (c->skip_frame >= AVDISCARD_NONKEY)
+ s.decode_frame_type = DAV1D_DECODEFRAMETYPE_KEY;
+ else if (c->skip_frame >= AVDISCARD_NONINTRA)
+ s.decode_frame_type = DAV1D_DECODEFRAMETYPE_INTRA;
+ else if (c->skip_frame >= AVDISCARD_NONREF)
+ s.decode_frame_type = DAV1D_DECODEFRAMETYPE_REFERENCE;
+#endif
+
res = libdav1d_parse_extradata(c);
if (res < 0)
return res;
More information about the ffmpeg-cvslog
mailing list