Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st June 2018, 09:55 | #22 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
What bout HDR PQ to HLG conversion based on this paper:
http://downloads.bbc.co.uk/rd/pubs/p...anscode_v2.pdf which suggests it should be pure math (no tone mapping, etc at leats for 1000 nits masters). |
22nd June 2018, 09:03 | #27 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
I have no needs for PQ to HLG for now. But technicaly, once i'll implement the HLG in the plugins (because for now there is only PQ, my plugins have a HLGMode parameter, not implemented yet), doing something like :
Code:
ConvertYUVtoLinearRGB(Color=0,HLGMode=true) ConvertLinearRGBtoYUV(Color=0) I didn't implement HLG yet, because i've trouble to understand properly how it works. There is several range mode (so i'm a little loss). But...! Maybe the doc you provided will help me to understand things. But, HLG is not my prority for now. Ah... Just take a look. The french version and english version of the same release version document don't say the same thing. French version (R-REC-BT.2100-1-201706-I!!PDF-F) talk of [0:12] range and possibility of [0:1], when english (R-REC-BT.2100-1-201706-I!!PDF-E) talk only of [0:1]... Nice ! Edit : Quick look, it seems that PQ has fixed parameters functions, for luminance range up to 10000 cd/mē. It seems that for HLG, the parameters changes according (Lw/Lb) values, when they are fixed for PQ. Meaning i'll have to add these parameters on my plugins, for when i'll implement HLG. I'll also have to add some "WhitePeak" value (at least on plugins using linear data on input), if i want to properly handle both HLG and PQ, because it seems that i can't assume (like i thought), that in linear value, 1.0 = 10000 cd/mē. Well... I'll see this for later... when i'll do the 0.3 release
__________________
My github. Last edited by jpsdr; 22nd June 2018 at 09:34. |
22nd June 2018, 11:38 | #29 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Didn't read properly yet (but retrieved), i'm on something else for now, but there is a big chance it may help me to understand better HLG and this eventualy "whitepeak" information.
Edit : Read a little more, it will help me. From what i understood (if properly), PQ is "fixed" -> 1 = 10000cd/mē, but HLG is adaptative. Stop investigating for now, will continue in second time.
__________________
My github. Last edited by jpsdr; 22nd June 2018 at 12:09. |
26th June 2018, 19:28 | #32 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
And having someone to test/verify also
Otherwise, does anyone know if it's possible to make a script which display, in the frame, the max value of Y for the curent frame (for an YUV video) ? If yes, what would it be ?
__________________
My github. |
26th June 2018, 20:44 | #33 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Something like this maybe [EDIT: Below intended for 8 bit only]
Code:
Function TestFunc(clip c,Float Thresh_Min, Float Thresh_Max,Bool Debug,String LogFile) { c Yave=AverageLuma YMin=YPLaneMin(Thresh_Min) YMax=YPLaneMax(Thresh_Max) Subtitle(String(YAve,"YAve=%7.3f : ")+String(YMin,"YMin=%3.0f : ")+String(YMax,"YMax=%3.0f"),Align=8) # Added RT_Subtitle("%d] YAve=%7.3f YMin=%3d YMax=%3d",current_frame,YAve,YMin,YMax,Align=5) (Debug) ? RT_DebugF("%d] YAve=%7.3f YMin=%3d YMax=%3d",current_frame,YAve,YMin,YMax,name="TestFunc: ") : NOP (LogFile!="") ? RT_Writefile(LogFile,"%d] YAve=%7.3f YMin=%3d YMax=%3d",current_frame,YAve,YMin,YMax,Append=True) : NOP Return last } FN = "D:\TestClip.avi" LOGFILE = "D:\TestClip.Log" DEBUG = True Thresh_Min = 0.0 Thresh_Max = 0.0 (LOGFILE!="") ? RT_FileDelete(LOGFILE) : NOP # We Will Append SSS = "TestFunc(" + \ String(Thresh_Min,"%f") + \ String(Thresh_Max,",%f,") + \ String(DEBUG) + \ "," + Chr(34) + LogFile + Chr(34) + \ ")" #SSS=RT_String("""TestFunc(%f,%f,%s,"%s")""",Thresh_Min,Thresh_Max,DEBUG,LogFile) # Alternative #RT_DebugF("SSS=%s",SSS) AviSource(FN) Return Last.Scriptclip(SSS) EDIT: Alternative to RT_string, StrFmt(Small dll):- https://forum.doom9.org/showthread.p...ghlight=StrFmt EDIT: Or RT_Stats for 'RT_xxx' funcs:- https://forum.doom9.org/showthread.p...light=RT_Stats
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 26th June 2018 at 21:56. |
27th June 2018, 09:08 | #34 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Tested, and seems there is a problem. I've used your 2.00 beta version.
The message is telling me that Average Plane can only be used within run-time filters. No log file is created.
__________________
My github. |
27th June 2018, 09:40 | #35 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
That is why its called from ScriptClip() in given code.
AverageLuma can only be called from within runtime environment, or alternatively, cheat a bit, simulate within runtime filter, must eg current_frame=n, before the call to AverageLuma. (Scriptclip et al, set current_frame at every frame so it is known what frame is current). For RT_AverageLuma(n=n).will also suffice, where n is accepted as current_frame, but MUST be done for every frame, thats is why Scriptclip is a good idea, unless using eg GScript for next to access frames. "No log file is created", thats because its already caused an error and exited. Try the script as given. MOBILE: EDIT: Post your failing script. EDIT: do frame 42 only (untested) Code:
Function TestFunc(clip c,Float Thresh_Min, Float Thresh_Max,Bool Debug,String LogFile) { c n=current_frame trim(n,-1) current_frame=0 Yave=AverageLuma YMin=YPLaneMin(Thresh_Min) YMax=YPLaneMax(Thresh_Max) Subtitle(String(YAve,"YAve=%7.3f : ")+String(YMin,"YMin=%3.0f : ")+String(YMax,"YMax=%3.0f"),Align=8) # Added RT_Subtitle("%d] YAve=%7.3f YMin=%3d YMax=%3d",n,YAve,YMin,YMax,Align=5) (Debug) ? RT_DebugF("%d] YAve=%7.3f YMin=%3d YMax=%3d",n,YAve,YMin,YMax,name="TestFunc: ") : NOP (LogFile!="") ? RT_Writefile(LogFile,"%d] YAve=%7.3f YMin=%3d YMax=%3d",n,YAve,YMin,YMax,Append=True) : NOP Return last } FN = "D:\TestClip.avi" LOGFILE = "D:\TestClip.Log" DEBUG = True Thresh_Min = 0.0 Thresh_Max = 0.0 (LOGFILE!="") ? RT_FileDelete(LOGFILE) : NOP # We Will Append AviSource(FN) current_frame=42 /* Simulate runtime */ TestClip(Thresh_Min,Thresh_Max,DEBUG,LOGFILE) Return Last EDIT: Oops again, will print frame 0] in stats, well you get the idea anyways I hope. Alternative, MUST call with n=frame number, or n=current_frame from within ScriptClip. Code:
Function TestFunc(clip c,int n,Float Thresh_Min, Float Thresh_Max,Bool Debug,String LogFile) { c trim(n,-1) current_frame=0 Yave=AverageLuma YMin=YPLaneMin(Thresh_Min) YMax=YPLaneMax(Thresh_Max) Subtitle(String(YAve,"YAve=%7.3f : ")+String(YMin,"YMin=%3.0f : ")+String(YMax,"YMax=%3.0f"),Align=8) # Added RT_Subtitle("%d] YAve=%7.3f YMin=%3d YMax=%3d",n,YAve,YMin,YMax,Align=5) (Debug) ? RT_DebugF("%d] YAve=%7.3f YMin=%3d YMax=%3d",n,YAve,YMin,YMax,name="TestFunc: ") : NOP (LogFile!="") ? RT_Writefile(LogFile,"%d] YAve=%7.3f YMin=%3d YMax=%3d",n,YAve,YMin,YMax,Append=True) : NOP Return last }
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 28th June 2018 at 04:50. |
28th June 2018, 17:57 | #38 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
http://4kmedia.org/travelxp-4k-hdr-hlg-sample/
Or google for "hdr hlg sample files". You'll find a lot of them. Not all have the SEI denoting HLG, but some do. Last edited by videoh; 28th June 2018 at 18:06. |
28th June 2018, 18:18 | #39 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
It didn't even cross my mind to google search...
Thanks. What are exactly HLG SEI information ? Is there some other mastering informations in the H265 spec ? I've tried a search for "HLG" in the T-REC-H.265-201612-I!!PDF-E document, but found no information about such a thing.
__________________
My github. |
|
|