From 2c7b71872340aa0d93e90d896f1abeb4bc4014af Mon Sep 17 00:00:00 2001 From: gnattu Date: Wed, 24 Jul 2024 20:01:28 +0800 Subject: [PATCH] avfilter/tonemap_hw: use rec2020 primaries for lum --- debian/patches/0005-add-cuda-tonemap-impl.patch | 2 +- ...08-add-bt2390-eetf-and-code-refactor-to-opencl-tonemap.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/patches/0005-add-cuda-tonemap-impl.patch b/debian/patches/0005-add-cuda-tonemap-impl.patch index e784474dcf4..ef33fc7fc08 100644 --- a/debian/patches/0005-add-cuda-tonemap-impl.patch +++ b/debian/patches/0005-add-cuda-tonemap-impl.patch @@ -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; diff --git a/debian/patches/0008-add-bt2390-eetf-and-code-refactor-to-opencl-tonemap.patch b/debian/patches/0008-add-bt2390-eetf-and-code-refactor-to-opencl-tonemap.patch index 57ed65c31c3..29abd6d16de 100644 --- a/debian/patches/0008-add-bt2390-eetf-and-code-refactor-to-opencl-tonemap.patch +++ b/debian/patches/0008-add-bt2390-eetf-and-code-refactor-to-opencl-tonemap.patch @@ -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