Last active
November 26, 2022 17:00
-
-
Save wiwaz/8b39e4332d0a627fba32b07de94c4a5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lehmer_merge(clip, lowpass=lambda i: core.std.BoxBlur(i, hradius=3, vradius=3, hpasses=2, vpasses=2)): | |
count = len(clip) | |
expr = "" | |
for i in range(count): | |
expr += f"src{i} src{count + i} - D{i}! " | |
for v in range(2): | |
for i in range(count): | |
expr += f"D{i}@ {v + 2} pow " | |
expr += "+ " * (count - 1) + f"P{v}! " | |
for i in range(count): | |
expr += f"src{count + i} " | |
expr += "+ " * (count - 1) + f"{count} / " | |
expr += "P0@ 0 = 0 P1@ P0@ / ? +" | |
blur = [lowpass(i) for i in clip] | |
return core.akarin.Expr(clip + blur, expr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment