diff options
author | James Almer <jamrial@gmail.com> | 2022-12-14 12:55:38 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-12-17 21:37:23 -0300 |
commit | 7af947c0c0a2917f86005a30350eb3ab361ef328 (patch) | |
tree | 91c1d8cd87d98b2a207a645dcd6de2e3377c8f48 | |
parent | 8ad988ac37d4d92dbb60796e26c3ad558a3eebeb (diff) | |
download | ffmpeg-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.c | 9 |
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; |