Absolute scaling of texture values for HDR (BT2100) videos

When reading frames from HDR video files (BT2100), the values in the textures seem to be in linear RGB BT.2020 colorspace, but absolute scaling of those values differs depending on how the corresponding Psychtoolbox window is opened. What is the scaling constant when Psychtoolbox window is opened without EnableHDR ?

Details:

I open Psychotoolbox window on an HDR display with the following options:

 PsychImaging('AddTask', 'General', 'EnableHDR', 'Nits', 'HDR10');
 PsychImaging('AddTask', 'General', 'FloatingPoint32Bit');
 PsychImaging('AddTask', 'General', 'NormalizedHighresColorRange');

or for a non-HDR display with only (I need to handle both cases):

 PsychImaging('AddTask', 'General', 'FloatingPoint32Bit');
 PsychImaging('AddTask', 'General', 'NormalizedHighresColorRange');

I open the video file:

async=0;
preloadSecs=1;
specialFlags1 = 2 + 16 + 32; % do not play audio + convert all video textures immediately into the RGB format + looping strategy
pixelFormat=11; % HDR10
maxNumberThreads=-1;
movieOptions=[];

[obj.movie, movieduration, new_fps, img_w, img_h, count, aspectRatio, hdrStaticMetaData]= Screen('OpenMovie', obj.win, fname, async, preloadSecs, specialFlags1, pixelFormat, maxNumberThreads, movieOptions); 

The videos are encoded as BT2100 with the PQ EOTF.

When I set 'EnableHDR', 'Nits', 'HDR10' and open a window on an HDR-enabled display, Screen('GetMovieImage', ...); gives me frame that is scaled in absolute colorimetric values (from 0.005 to 10000), as expected.

But when I open a regular window on an SDR display, the values are normalized to a different range. For one video that had the peak linear color value of 10000, the maximum was 33.2099.

When reading a HDR video and with a non-HDR window open, how is the absolute scaling determined?

Can I disable such scaling and always obtain absolute linear RGB values?

'3.0.17 - Flavor: beta - Corresponds to SVN Revision 12153

Look at the explanation for setting 11 for the optional pixelFormat parameter in Screen('Openmovie', ...) on how to use the same HDR/WCG movie decoding for an SDR window as would be used by default on a HDR window. That might do the trick. pixelFormat defaults to 4 for SDR windows, 11 for HDR windows, as explained in that help. 4 uses a different EOTF.

Then read the help of Screen Hookfunction? the section about SetHDRScalingFactors to see how pixelFormat 11 WCG/HDR movie content is mapped to framebuffer values. Lines 370 and following of PsychHDR.m will show you how this is set up by default for HDR-10 windows.

Greetings from the Spain vacation, lots of HDR content here right now.

Thank you. SetHDRScalingFactors was exactly what I had to change. I set maxSDRToHDRScaleFactor to 100000 and now the textures are scaled in absolute units.