Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] vulkan/prores: output LSB-padded data (PR #20755)
@ 2025-10-26 21:10 averne via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: averne via ffmpeg-devel @ 2025-10-26 21:10 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: averne

PR #20755 opened by averne
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20755
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20755.patch

As discussed on #ffmpeg-devel, this fixes video playback on mpv using the gpu-next VO.
Breaks frame hwdownload, pending the introduction and wiring up of MSB pixfmts.


>From 68ab3fb5b4a4512799e7e346c1335e53795994fe Mon Sep 17 00:00:00 2001
From: averne <averne381@gmail.com>
Date: Sun, 26 Oct 2025 22:05:07 +0100
Subject: [PATCH] vulkan/prores: output LSB-padded data

For consistency with existing Vulkan-based hwaccels
---
 libavcodec/vulkan/prores_idct.comp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vulkan/prores_idct.comp b/libavcodec/vulkan/prores_idct.comp
index 645cb02979..642fcb5bd5 100644
--- a/libavcodec/vulkan/prores_idct.comp
+++ b/libavcodec/vulkan/prores_idct.comp
@@ -110,14 +110,14 @@ void main(void)
     idct(block, idx, 9);
 
     float fact = 1.0f / (1 << (12 - depth)), off = 1 << (depth - 1);
-    int maxv = (1 << depth) - 1;
+    int maxv = (1 << depth) - 1, shift = 16 - depth;
 
     /* 7.5.1 Color Component Samples. Rescale, clamp and write back to global memory */
     barrier();
     if (act) {
         [[unroll]] for (uint i = 0; i < 8; ++i) {
             float v = blocks[block][i * 9 + idx] * fact + off;
-            put_px(comp, ivec2(gid.x, (gid.y << 3) | i), clamp(int(v), 0, maxv));
+            put_px(comp, ivec2(gid.x, (gid.y << 3) | i), clamp(int(v), 0, maxv) << shift);
         }
     }
 }
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-26 21:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-26 21:10 [FFmpeg-devel] [PATCH] vulkan/prores: output LSB-padded data (PR #20755) averne via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git