Skip to content

Commit

Permalink
Merge pull request #405 from jellyfin/fix-dovi-peak-calculation
Browse files Browse the repository at this point in the history
avfilter/colorspace: fix dovi peak calculation
  • Loading branch information
nyanmisaka authored Jun 25, 2024
2 parents 69aca1d + 4ce00f1 commit 44e1bf0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions debian/patches/0005-add-cuda-tonemap-impl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Index: jellyfin-ffmpeg/libavfilter/colorspace.c
void ff_matrix_mul_3x3(double dst[3][3],
const double src1[3][3], const double src2[3][3])
{
@@ -191,3 +203,155 @@ void ff_update_hdr_metadata(AVFrame *in,
@@ -191,3 +203,154 @@ void ff_update_hdr_metadata(AVFrame *in,
metadata->max_luminance = av_d2q(peak * REFERENCE_WHITE, 10000);
}
}
Expand All @@ -120,8 +120,7 @@ Index: jellyfin-ffmpeg/libavfilter/colorspace.c
+ peak = powf(peak, 1.0f / ST2084_M2);
+ peak = fmaxf(peak - ST2084_C1, 0.0f) / (ST2084_C2 - ST2084_C3 * peak);
+ peak = powf(peak, 1.0f / ST2084_M1);
+ peak *= 10000.0f;
+ peak *= REFERENCE_WHITE_ALT;
+ peak *= 100.0f;
+
+ return peak;
+}
Expand Down

0 comments on commit 44e1bf0

Please sign in to comment.