def get_effective_bsoftclip(self):
"""Return bsoftclip or compute it from paramters and effective bmax"""
bsoftclip = self.bsoftclip
if bsoftclip is None:
return math.inf
if isinstance(bsoftclip, dict):
bmax = self.get_effective_bmax()
bhardclip = self.get_effective_bhardclip()
bmin = bsoftclip.get('bmin', 0)
base = bsoftclip.get('bbase', 0)
scale = bsoftclip.get('scale', 0)
hcscale = bsoftclip.get('hcscale', math.inf)
bsoftclip = max(bmin,
base + (bmax - base) * scale,
max(0, bmax - (bhardclip - bmax) * hcscale))
return bsoftclip
评论列表
文章目录