Update is_hdr helper function

This commit is contained in:
JonnyWong16 2025-05-10 16:26:12 -07:00
parent c4f8a81190
commit 43fc7eebfe
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 4 additions and 4 deletions

View file

@ -729,7 +729,7 @@ class Export(object):
'frameRate': None,
'frameRateMode': None,
'hasScalingMatrix': None,
'hdr': lambda o: helpers.is_hdr(getattr(o, 'bitDepth', 0), getattr(o, 'colorSpace', '')),
'hdr': lambda o: helpers.is_hdr(getattr(o, 'bitDepth', 0), getattr(o, 'colorTrc', '')),
'height': None,
'level': None,
'pixelAspectRatio': None,

View file

@ -1483,9 +1483,9 @@ def move_to_front(l, value):
return l
def is_hdr(bit_depth, color_space):
def is_hdr(bit_depth, color_trc):
bit_depth = cast_to_int(bit_depth)
return bit_depth > 8 and color_space == 'bt2020nc'
return bit_depth > 8 and (color_trc == 'smpte2084' or color_trc == 'arib-std-b67')
def version_to_tuple(version):

View file

@ -3391,7 +3391,7 @@ class PmsConnect(object):
color_trc = helpers.get_xml_attr(stream, 'colorTrc')
DOVI_profile = helpers.get_xml_attr(stream, 'DOVIProfile')
HDR = bool(bit_depth > 8 and (color_trc == 'smpte2084' or color_trc == 'arib-std-b67'))
HDR = helpers.is_hdr(bit_depth, color_trc)
DV = bool(DOVI_profile)
if not HDR and not DV: