Skip to content

Commit

Permalink
avfilter/tonemap_hw: use rec2020 primaries for lum
Browse files Browse the repository at this point in the history
  • Loading branch information
gnattu committed Jul 24, 2024
1 parent 07f6528 commit 2c7b718
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debian/patches/0005-add-cuda-tonemap-impl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ Index: FFmpeg/libavfilter/cuda/tonemap.cu
+
+static __inline__ __device__
+float3 map_one_pixel_rgb_mode_rl(float3 rgb, const FFCUDAFrame& src, const FFCUDAFrame& dst) {
+ float sig = max((rgb.x * 0.2126f + rgb.y * 0.7152f + rgb.z * 0.0722f), FLOAT_EPS);
+ float sig = max((rgb.x * 0.2627f + rgb.y * 0.678f + rgb.z * 0.0593f), FLOAT_EPS);
+ float peak = src.peak;
+ sig = min(sig, peak);
+ float sig_old = sig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ Index: FFmpeg/libavfilter/opencl/tonemap.cl
+ #ifdef TONE_MODE_MAX
+ float4 sig = fmax(fmax(*r4, fmax(*g4, *b4)), FLOAT_EPS);
+ #else
+ float4 sig = fmax((*r4 * 0.2126f + *g4 * 0.7152f + *b4 * 0.0722f), FLOAT_EPS);
+ float4 sig = fmax((*r4 * 0.2627f + *g4 * 0.678f + *b4 * 0.0593f), FLOAT_EPS);
+ #endif
+ float4 sig_o = sig;
+#endif
Expand Down

0 comments on commit 2c7b718

Please sign in to comment.