Skip to content

Commit

Permalink
Merge pull request #296 from nyanmisaka/next-5.1
Browse files Browse the repository at this point in the history
[5.1] Fix the brightness issue in HLG-2-SDR tonemap
  • Loading branch information
nyanmisaka authored Oct 28, 2023
2 parents 5dbe994 + 185fcf7 commit 56e2640
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 56e2640

Please sign in to comment.