Skip to content

Commit c3fe69e

Browse files
committed
stats.lua: show also min_luma if max_luma is nominal SDR
Useful to see set black point.
1 parent 12a7825 commit c3fe69e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

player/lua/stats.lua

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,30 +810,33 @@ local function append_hdr(s, hdr, video_out)
810810
return
811811
end
812812

813-
local function should_show(val)
814-
return val and val ~= 203 and val > 0
813+
local function has(val, target)
814+
return val and math.abs(val - target) > 1e-4
815815
end
816816

817817
-- If we are printing video out parameters it is just display, not mastering
818818
local display_prefix = video_out and "Display:" or "Mastering display:"
819819

820820
local indent = ""
821+
local has_dml = has(hdr["min-luma"], 0.203) or has(hdr["max-luma"], 203)
822+
local has_cll = hdr["max-cll"] and hdr["max-cll"] > 0
823+
local has_fall = hdr["max-fall"] and hdr["max-fall"] > 0
821824

822-
if should_show(hdr["max-cll"]) or should_show(hdr["max-luma"]) then
825+
if has_dml or has_cll or has_fall then
823826
append(s, "", {prefix="HDR10:"})
824-
if hdr["min-luma"] and should_show(hdr["max-luma"]) then
827+
if has_dml then
825828
-- libplacebo uses close to zero values as "defined zero"
826829
hdr["min-luma"] = hdr["min-luma"] <= 1e-6 and 0 or hdr["min-luma"]
827830
append(s, format("%.2g / %.0f", hdr["min-luma"], hdr["max-luma"]),
828831
{prefix=display_prefix, suffix=" cd/m²", nl="", indent=indent})
829832
indent = o.prefix_sep .. o.prefix_sep
830833
end
831-
if should_show(hdr["max-cll"]) then
834+
if has_cll then
832835
append(s, string.format("%.0f", hdr["max-cll"]), {prefix="MaxCLL:",
833836
suffix=" cd/m²", nl="", indent=indent})
834837
indent = o.prefix_sep .. o.prefix_sep
835838
end
836-
if hdr["max-fall"] and hdr["max-fall"] > 0 then
839+
if has_fall then
837840
append(s, hdr["max-fall"], {prefix="MaxFALL:", suffix=" cd/m²", nl="",
838841
indent=indent})
839842
end

0 commit comments

Comments
 (0)