Skip to content

Commit

Permalink
based_aa: Add double_rate param
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Oct 1, 2024
1 parent 7c478f2 commit dd6a9e0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion vsaa/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def based_aa(
mask: vs.VideoNode | EdgeDetectT | Literal[False] = Prewitt, mask_thr: int = 60, pskip: bool = True,
downscaler: ScalerT | None = None,
supersampler: ScalerT | ShaderFile | Path | Literal[False] = ArtCNN.C16F64,
double_rate: bool = False,
eedi3_kwargs: KwargsT | None = dict(alpha=0.125, beta=0.25, vthresh0=12, vthresh1=24, field=1),
prefilter: vs.VideoNode | VSFunction | None = None, postfilter: VSFunction | None | Literal[False] = None,
show_mask: bool = False, planes: PlanesT = 0,
Expand Down Expand Up @@ -345,6 +346,10 @@ def based_aa(
The supersampler should ideally be fairly sharp without
introducing too much ringing.
Default: ArtCNN.C16F64.
:param double_rate: Whether to use double-rate antialiasing.
If True, both fields will be processed separately, which may improve
anti-aliasing strength at the cost of increased processing time and detail loss.
Default: False.
:param eedi3_kwargs: Keyword arguments to pass on to EEDI3.
:param prefilter: Prefilter to apply before anti-aliasing.
Must be a VideoNode, a function that takes a VideoNode and returns a VideoNode,
Expand All @@ -370,6 +375,7 @@ def based_aa(
mask: vs.VideoNode | EdgeDetectT | Literal[False] = Prewitt, mask_thr: int = 60, pskip: bool = True,
downscaler: ScalerT | None = None,
supersampler: ScalerT | ShaderFile | Path | Literal[False] | MissingT = MISSING,
double_rate: bool = False,
eedi3_kwargs: KwargsT | None = dict(alpha=0.125, beta=0.25, vthresh0=12, vthresh1=24, field=1),
prefilter: vs.VideoNode | VSFunction | None = None, postfilter: VSFunction | None | Literal[False] = None,
show_mask: bool = False, planes: PlanesT = 0,
Expand Down Expand Up @@ -440,7 +446,11 @@ def based_aa(
ss = supersampler.scale(ss_clip, aaw, aah)
mclip = Bilinear.scale(mask, aaw, aah) if mask else None

aa = Eedi3(mclip=mclip, sclip_aa=True).aa(ss, **eedi3_kwargs | kwargs)
if double_rate:
aa = Eedi3(mclip=mclip, sclip_aa=True).draa(ss, **eedi3_kwargs | kwargs)
else:
aa = Eedi3(mclip=mclip, sclip_aa=True).aa(ss, **eedi3_kwargs | kwargs)

aa = downscaler.scale(aa, func.work_clip.width, func.work_clip.height)

if postfilter is None:
Expand Down

0 comments on commit dd6a9e0

Please sign in to comment.