aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-12-14 12:55:38 -0300
committerJames Almer <jamrial@gmail.com>2022-12-17 21:37:23 -0300
commit7af947c0c0a2917f86005a30350eb3ab361ef328 (patch)
tree91c1d8cd87d98b2a207a645dcd6de2e3377c8f48
parent8ad988ac37d4d92dbb60796e26c3ad558a3eebeb (diff)
downloadffmpeg-7af947c0c0a2917f86005a30350eb3ab361ef328.tar.gz
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@gmail.com>
-rw-r--r--libavcodec/libdav1d.c9
1 files changed, 9 insertions, 0 deletions
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;