Skip to content

Commit

Permalink
avfilter/tonemap_cuda: properly handle passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
gnattu committed Aug 14, 2024
1 parent 1587cc1 commit d89ccb2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions debian/patches/0004-add-cuda-tonemap-impl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ Index: FFmpeg/libavfilter/cuda/tonemap.cu
===================================================================
--- /dev/null
+++ FFmpeg/libavfilter/cuda/tonemap.cu
@@ -0,0 +1,573 @@
@@ -0,0 +1,579 @@
+/*
+ * This file is part of FFmpeg.
+ *
Expand Down Expand Up @@ -1544,10 +1544,16 @@ Index: FFmpeg/libavfilter/cuda/tonemap.cu
+ yuv3 = lrgb2yuv(c3);
+
+#define _RGB2YUV_S \
+ c0 = gamut_compress(lrgb2lrgb(c0)); \
+ c1 = gamut_compress(lrgb2lrgb(c1)); \
+ c2 = gamut_compress(lrgb2lrgb(c2)); \
+ c3 = gamut_compress(lrgb2lrgb(c3)); \
+ c0 = lrgb2lrgb(c0); \
+ c1 = lrgb2lrgb(c1); \
+ c2 = lrgb2lrgb(c2); \
+ c3 = lrgb2lrgb(c3); \
+ if (!rgb2rgb_passthrough) { \
+ c0 = gamut_compress(c0); \
+ c1 = gamut_compress(c1); \
+ c2 = gamut_compress(c2); \
+ c3 = gamut_compress(c3); \
+ } \
+ yuv0 = lrgb2yuv(clamp3(c0, 0.0f, 1.0f)); \
+ yuv1 = lrgb2yuv(clamp3(c1, 0.0f, 1.0f)); \
+ yuv2 = lrgb2yuv(clamp3(c2, 0.0f, 1.0f)); \
Expand Down

0 comments on commit d89ccb2

Please sign in to comment.