Skip to content

Commit

Permalink
Fix the brightness issue in HLG-2-SDR tonemap
Browse files Browse the repository at this point in the history
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
  • Loading branch information
nyanmisaka committed Oct 25, 2023
1 parent 8a12a4c commit d20635f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions debian/patches/0005-add-cuda-tonemap-impl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ Index: jellyfin-ffmpeg/libavfilter/colorspace.c
+
+// linearizer for HLG/ARIB-B67
+float eotf_arib_b67(float x) {
+ return ootf_1_2(inverse_oetf_arib_b67(x));
+ return ootf_1_2(inverse_oetf_arib_b67(x)) * 5.0f;
+}
+
+// delinearizer for HLG/ARIB-B67
+float inverse_eotf_arib_b67(float x) {
+ return oetf_arib_b67(inverse_ootf_1_2(x));
+ return oetf_arib_b67(inverse_ootf_1_2(x / 5.0f));
+}
+
+// delinearizer for BT709, BT2020-10
Expand Down Expand Up @@ -468,12 +468,12 @@ Index: jellyfin-ffmpeg/libavfilter/cuda/colorspace_common.h
+
+// linearizer for HLG/ARIB-B67
+static __inline__ __device__ float eotf_arib_b67(float x) {
+ return ootf_1_2(inverse_oetf_arib_b67(x));
+ return ootf_1_2(inverse_oetf_arib_b67(x)) * 5.0f;
+}
+
+// delinearizer for HLG/ARIB-B67
+static __inline__ __device__ float inverse_eotf_arib_b67(float x) {
+ return oetf_arib_b67(inverse_ootf_1_2(x));
+ return oetf_arib_b67(inverse_ootf_1_2(x / 5.0f));
+}
+
+// delinearizer for BT709, BT2020-10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ Index: jellyfin-ffmpeg/libavfilter/opencl/colorspace_common.cl
+
+// linearizer for HLG/ARIB-B67
+float eotf_arib_b67(float x) {
+ return ootf_1_2(inverse_oetf_arib_b67(x));
+ return ootf_1_2(inverse_oetf_arib_b67(x)) * 5.0f;
+}
+
+// delinearizer for HLG/ARIB-B67
+float inverse_eotf_arib_b67(float x) {
+ return oetf_arib_b67(inverse_ootf_1_2(x));
+ return oetf_arib_b67(inverse_ootf_1_2(x / 5.0f));
}

-float inverse_eotf_bt1886(float c) {
Expand Down

0 comments on commit d20635f

Please sign in to comment.