diff --git a/vsrgtools/blur.py b/vsrgtools/blur.py index 7c84317..9bc6d97 100644 --- a/vsrgtools/blur.py +++ b/vsrgtools/blur.py @@ -10,7 +10,7 @@ from vspyplugin import FilterMode, ProcessMode, PyPluginCuda from vstools import ( ConvMode, CustomNotImplementedError, CustomRuntimeError, FunctionUtil, NotFoundEnumValue, PlanesT, StrList, - check_variable, core, depth, fallback, get_depth, get_neutral_values, join, normalize_planes, normalize_seq, split, + check_variable, core, depth, fallback, get_depth, get_neutral_value, join, normalize_planes, normalize_seq, split, to_arr, vs ) @@ -263,7 +263,7 @@ def sbr( planes = normalize_planes(clip, planes) - neutral = get_neutral_values(clip) + neutral = get_neutral_value(clip) blur_func = partial(blur, radius=radius, mode=mode, planes=planes) diff --git a/vsrgtools/contra.py b/vsrgtools/contra.py index f5086d3..967ec6f 100644 --- a/vsrgtools/contra.py +++ b/vsrgtools/contra.py @@ -6,7 +6,7 @@ from vsexprtools import complexpr_available, norm_expr from vstools import ( - CustomValueError, GenericVSFunction, PlanesT, check_ref_clip, check_variable, clamp_arr, get_neutral_values, + CustomValueError, GenericVSFunction, PlanesT, check_ref_clip, check_variable, clamp_arr, get_neutral_value, iterate, normalize_planes, to_arr, vs ) @@ -42,10 +42,7 @@ def contrasharpening( assert check_variable(flt, contrasharpening) check_ref_clip(src, flt, contrasharpening) - if flt.format.sample_type == vs.INTEGER: - neutral = get_neutral_values(flt) - else: - neutral = [0.0] + neutral = get_neutral_value(flt) planes = normalize_planes(flt, planes) @@ -94,7 +91,7 @@ def contrasharpening_dehalo( weighted2 = median_blur(weighted, 2, planes=planes) weighted2 = iterate(weighted2, partial(repair, repairclip=weighted), 2, mode=rep_modes) - neutral = get_neutral_values(flt) + neutral = get_neutral_value(flt) if complexpr_available: clips = [weighted, weighted2, src, flt] @@ -163,10 +160,7 @@ def fine_contra( assert check_variable(flt, contrasharpening) check_ref_clip(src, flt, contrasharpening) - if flt.format.sample_type == vs.INTEGER: - neutral = get_neutral_values(flt) - else: - neutral = [0.0] + neutral = get_neutral_value(flt) planes = normalize_planes(flt, planes) diff --git a/vsrgtools/freqs.py b/vsrgtools/freqs.py index 18f7e48..f640afd 100644 --- a/vsrgtools/freqs.py +++ b/vsrgtools/freqs.py @@ -1,13 +1,13 @@ from __future__ import annotations from itertools import count -from math import e, log, pi, sin, sqrt +from math import log, pi, sqrt from typing import Iterable from vsexprtools import ExprOp, ExprVars, combine, norm_expr from vstools import ( - ColorRange, ConvMode, CustomIntEnum, CustomNotImplementedError, FuncExceptT, FunctionUtil, KwargsT, PlanesT, - StrList, check_ref_clip, flatten_vnodes, get_y, scale_value, vs + ConvMode, CustomIntEnum, CustomNotImplementedError, FuncExceptT, FunctionUtil, KwargsT, PlanesT, + StrList, check_ref_clip, flatten_vnodes, get_y, vs ) from .blur import gauss_blur diff --git a/vsrgtools/func.py b/vsrgtools/func.py index 2ddf7ae..f2969f8 100644 --- a/vsrgtools/func.py +++ b/vsrgtools/func.py @@ -5,7 +5,7 @@ from vsexprtools import complexpr_available, norm_expr from vstools import ( - CustomIndexError, PlanesT, VSFunction, check_variable, core, fallback, get_neutral_values, normalize_planes, vs + CustomIndexError, PlanesT, VSFunction, check_variable, core, fallback, get_neutral_value, normalize_planes, vs ) from .enum import LimitFilterMode @@ -46,7 +46,7 @@ def median_diff(clip: vs.VideoNode, diffa: vs.VideoNode, diffb: vs.VideoNode, pl assert check_variable(clip, median_diff) planes = normalize_planes(clip, planes) - neutral = get_neutral_values(clip) + neutral = get_neutral_value(clip) if complexpr_available: expr = 'y z - D! x D@ y {mid} clamp D@ {mid} y clamp - -' diff --git a/vsrgtools/limit.py b/vsrgtools/limit.py index aca5abd..9b5f32c 100644 --- a/vsrgtools/limit.py +++ b/vsrgtools/limit.py @@ -91,8 +91,8 @@ def _limit_filter_lut( ) -> vs.VideoNode: assert check_variable(diff, limit_filter) - neutral = int(get_neutral_value(diff)) - peak = int(get_peak_value(diff)) + neutral = get_neutral_value(diff) + peak = get_peak_value(diff) thr = int(thr * peak / 255) largen_thr = int(largen_thr * peak / 255)