-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avfilter/tonemap_*: better documentation for constants
- Loading branch information
Showing
3 changed files
with
68 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ Index: FFmpeg/libavfilter/metal/vf_tonemap_videotoolbox.metal | |
=================================================================== | ||
--- /dev/null | ||
+++ FFmpeg/libavfilter/metal/vf_tonemap_videotoolbox.metal | ||
@@ -0,0 +1,914 @@ | ||
@@ -0,0 +1,916 @@ | ||
+/* | ||
+ * Copyright (c) 2024 Gnattu OC <[email protected]> | ||
+ * | ||
|
@@ -269,6 +269,7 @@ Index: FFmpeg/libavfilter/metal/vf_tonemap_videotoolbox.metal | |
+ | ||
+// ------------ | ||
+// Color conversion | ||
+// See libavfilter/colorspace.h for derivation of these constants | ||
+float3 yuv2rgb(float y, float u, float v) { | ||
+ y += mix(0.0f, 0.0009765774014f, y > 0.0f); | ||
+ u += mix(0.0f, 0.0009765774014f, u > 0.0f); | ||
|
@@ -317,7 +318,8 @@ Index: FFmpeg/libavfilter/metal/vf_tonemap_videotoolbox.metal | |
+ v = floor(((224.0f * v + 128.0f) * 256.0f) + 0.5f) / 65535.0f; | ||
+ } | ||
+ } | ||
+ // in rgb2yuv conversion, enable_dither means output is 8bit | ||
+ // in rgb2yuv conversion, enable_dither means output is 8bit in metal pipeline | ||
+ // use this to check if we need the 10bit offset | ||
+ if (!enable_dither) { | ||
+ y -= mix(0.0f, 0.0009765774014f, y > 0.0f); | ||
+ u -= mix(0.0f, 0.0009765774014f, u > 0.0f); | ||
|