SatPrevSA:
SatPreSALuma=SatPrevHighPCTLLuma
SatPrevSATarget=[setparam/tr:lux+lux]
SatPrevSAAdjRatioFSAATgt=SatPrevTarget*FrameSALuma/(SatPrevSALuma*FrameSATarget)
SatPrevSAAdjRatio.Start=0
SatPrevSAAdjRatio.End=[setparam/tr:lux+SatPrevSAAdjRatioFSATgt*FrameSATarget/FrameSALuma
在SatPrevSA的计算中,我们首先定义亮部预览的亮度(Luma)为SatPrevHighPCTLLuma。目标饱和度(SATarget)通过参数设置获取,形式为[setparam/tr:lux+lux](这里假设lux为变量占位符,实际使用中需替换为具体值)。
接着,我们计算调整比率(Adjustment Ratio)的帧内平均目标值(FSATgt),该值基于目标饱和度、当前帧与目标帧的亮度比。调整比率的起始值设为0,结束值则根据FSATgt、当前帧与目标帧的饱和度与亮度计算得出,具体公式为:
SatPrevSAAdjRatio.End = [setparam/tr:lux + (SatPrevTarget * FrameSATarget) / (SatPrevSALuma * FrameSALuma) * FrameSATarget / FrameSALuma]
DarkPrevSA:
DarkPrevSALuma= [set param/tr:lux+DarkPrevLowPCTLLuma]
DarkPrevSATarget= [set param/tr: lux+lux]
DarkPrevSAAdjRatioStartFSATgt=(DarkPrevSATarget*FrameSALuma)/(DarkPrevSALuma*FrameSATarget)
DarkPrevSAAdjRatioEndFSATgt=(DarkPrevSATarget*FrameSALuma)/(DarkPrevSALuma*FrameSATarget)
DarkPrevSAAdjRatio.Start=[setparam/tr:lux+DarkPrevSAAdjRatioStartFSATgt]*FrameSATarget/FrameSALuma
DarkPrevSAAdjRatio.End=[setparam/tr:lux+DarkPrevSAAdjRatioEndFSATgt]*FrameSATarget/FrameSALuma
对于暗部预览(DarkPrevSA),我们类似地定义了暗部预览的亮度(DarkPrevLowPCTLLuma)和目标饱和度([setparam/tr:lux+lux])。调整比率的起始和结束值计算采用了相同的逻辑,但分别基于暗部预览的参数:
DarkPrevSAAdjRatioStartFSATgt = (DarkPrevSATarget * FrameSALuma) / (DarkPrevSALuma * FrameSATarget)
DarkPrevSAAdjRatio.Start = [setparam/tr:lux + DarkPrevSAAdjRatioStartFSATgt] * FrameSATarget / FrameSALuma
DarkPrevSAAdjRatio.End = 同上逻辑,但通常暗部调整范围较小或固定,可能无需变化,故这里也使用相同公式或设定为固定值。
LongDarkPrevSA:
LongDarkPrevSALuma= [set param/tr: lux+LongDarkPrevLowPCTLLuma]
LongDarkPrevSATarget= [set param/tr: lux]
LongDarkPrevSAAdjRatioFSATgt= (LongDarkPrevSATarget * FrameSALuma) / (LongDarkPrevSALuma * FrameSATarget)
LongDarkPrevSA3HDRLongExp= LongDarkPrevSATarget * TriggerCtrlShortExp / LongDarkPrevSALuma
LongDarkPrevSA3HDRRealDRCGain= LongDarkPrevSA3HDRLongExp / ShortSatPrevSA3HDRShortExp
LongDarkPrevSAAdjRatio.Start= [set param/tr:lux+LongDarkPrevSAAdjRatioFSATgt] * FrameSATarget / FrameSALuma
LongDarkPrevSAAdjRatio.End= 256
长期暗部预览(LongDarkPrevSA)的计算考虑了更长时间的暗部信息。我们定义了长期暗部预览的亮度(LongDarkPrevLowPCTLLuma)和目标饱和度([setparam/tr:lux])。此外,还计算了与HDR相关的曝光时间(LongDarkPrevSA3HDRLongExp)和动态范围控制增益(LongDarkPrevSA3HDRRealDRCGain)。
调整比率的起始值基于FSATgt计算,结束值固定为256(或根据具体需求调整):
LongDarkPrevSAAdjRatioFSATgt = (LongDarkPrevSATarget * FrameSALuma) / (LongDarkPrevSALuma * FrameSATarget)
LongDarkPrevSAAdjRatio.Start = [setparam/tr:lux + LongDarkPrevSAAdjRatioFSATgt] * FrameSATarget / FrameSALuma
LongDarkPrevSAAdjRatio.End = 256
ShortSatPrevSA:
ShortSatPrevSALuma= ShortSatPrevHighPCTLLuma
ShortSatPrevSATarget= [set param/tr:lux]
ShortSatPrevSAAdjRatioFSATgt= (ShortSatPrevSATarget*FrameSALuma)/(ShortSatPrevSALuma*FrameSATarget)
ShoartSatPrevSA3HDRShortExp= ShortSatPrevSATarget*TriggerCtrlShortExp/ShortSatPrevSALuma
ShortSatPrevSAAdjRatio.Start= 0.0
ShortSatPrevSAAdjRatio.End= [set param/tr:lux+ShortSatPrevSAAdjRatioFSATgt]*FrameSATarget/FrameSALuma
短期亮部预览(ShortSatPrevSA)的计算较为直接,定义了短期高亮度区域的亮度(ShortSatPrevHighPCTLLuma)和目标饱和度([setparam/tr:lux])。调整比率的起始值设为0.0,结束值根据FSATgt计算得出:
ShortSatPrevSAAdjRatioFSATgt = (ShortSatPrevSATarget * FrameSALuma) / (ShortSatPrevSALuma * FrameSATarget)
ShortSatPrevSAAdjRatio.Start = 0.0
ShortSatPrevSAAdjRatio.End = [setparam/tr:lux + ShortSatPrevSAAdjRatioFSATgt] * FrameSATarget / FrameSALuma