This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 3c1aad218f avcodec/av1dec: use sw_pix_fmt for film grain subsampling
3c1aad218f is described below
commit 3c1aad218f8bcbed7a20f6fdff59dd96dc670666
Author: luoye-cpu <[email protected]>
AuthorDate: Sat Nov 7 18:53:17 2026 +0800
Commit: Lynne <[email protected]>
CommitDate: Sun Nov 8 01:33:45 2026 +0000
avcodec/av1dec: use sw_pix_fmt for film grain subsampling
The native AV1 decoder exports film grain parameters for
hardware-accelerated output. Deriving their chroma subsampling from
frame->format uses the hardware pixel-format descriptor rather than
the stream's chroma layout.
For CUDA and CUARRAY output, this exports 0/0 instead of 1/1 for a
4:2:0 stream. After downloading to a 4:2:0 software frame and copying
the frame properties, av_film_grain_params_select() rejects the entry
because its chroma subsampling does not match.
Use avctx->sw_pix_fmt to derive the exported chroma subsampling from
the negotiated software format.
Signed-off-by: luoye-cpu <[email protected]>
---
libavcodec/av1dec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 315828e18a..e6512cd004 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -1072,7 +1072,9 @@ static int export_film_grain(AVCodecContext *avctx,
AVFrame *frame)
{
AV1DecContext *s = avctx->priv_data;
const AV1RawFilmGrainParams *film_grain = &s->cur_frame.film_grain;
- const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(frame->format);
+ /* Use the negotiated software format for chroma subsampling,
+ * since frame->format may be a hardware pixel format. */
+ const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
AVFilmGrainParams *fgp;
AVFilmGrainAOMParams *aom;
--
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]