This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch release/8.1
in repository ffmpeg.
The following commit(s) were added to refs/heads/release/8.1 by this push:
new ce3c09c101 avutil/hwcontext_cuda: fix yuv420p V/U plane overlap in
cuda_get_buffer()
ce3c09c101 is described below
commit ce3c09c101c83add623774d414a9f9498caf5c25
Author: nyanmisaka <[email protected]>
AuthorDate: Mon Jun 29 15:32:00 2026 +0800
Commit: Marvin Scholz <[email protected]>
CommitDate: Mon Jun 29 17:41:14 2026 +0200
avutil/hwcontext_cuda: fix yuv420p V/U plane overlap in cuda_get_buffer()
Odd-height yuv420p result in incorrect calculations of the U-plane
address offset. The last row of the V-plane overlapped with and was
overwritten by the first row of the U-plane, leading to chroma artifacts.
```
ffmpeg -init_hw_device cuda=cu -filter_hw_device cu -f lavfi -i \
testsrc=s=1920x1081,format=yuv420p -vf hwupload -c:v hevc_nvenc \
-vframes 1 -y <OUTPUT>
```
Signed-off-by: nyanmisaka <[email protected]>
(cherry picked from commit 3f6bf150cb018334809bec029325b28cff8a5a9a)
Signed-off-by: Marvin Scholz <[email protected]>
---
libavutil/hwcontext_cuda.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index b0b65b2446..46f8297168 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -207,7 +207,7 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame
*frame)
if (ctx->sw_format == AV_PIX_FMT_YUV420P) {
frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2;
frame->data[2] = frame->data[1];
- frame->data[1] = frame->data[2] + frame->linesize[2] *
(ctx->height / 2);
+ frame->data[1] = frame->data[2] + frame->linesize[2] *
AV_CEIL_RSHIFT(ctx->height, 1);
}
frame->format = AV_PIX_FMT_CUDA;
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]