Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: averne via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: averne <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] vulkan/prores: output LSB-padded data (PR #20755)
Date: Sun, 26 Oct 2025 21:10:04 -0000
Message-ID: <176151300537.81.14890621171261992936@7d278768979e> (raw)

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

                 reply	other threads:[~2025-10-26 21:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176151300537.81.14890621171261992936@7d278768979e \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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