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
# -*- coding: utf-8 -*- | |
import numpy as np | |
import vapoursynth as vs | |
def bool_to_number(function): | |
def wrapped(*args): | |
value = function(*args) | |
return np.where(value, np.array(1.0), np.array(-1.0)) | |
return wrapped |
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
# -*- coding: utf-8 -*- | |
import cv2 | |
import numpy as np | |
binary_operators = { | |
"+": lambda x, y: x + y, | |
"-": lambda x, y: x - y, | |
"*": lambda x, y: x * y, | |
"/": lambda x, y: x / y, | |
} |
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
# -*- coding: utf-8 -*- | |
import mmap | |
import ctypes | |
def run(): | |
code_stream = mmap.mmap(-1, 4096, mmap.MAP_PRIVATE, | |
mmap.PROT_EXEC | mmap.PROT_READ | mmap.PROT_WRITE) | |
code_stream.write(b"\x01\xf7") # add edi, esi | |
code_stream.write(b"\x89\xf8") # mov eax, edi |
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
''' | |
A simple script that can remove useless \iclip's and invisible lines from your ass subtitles. | |
Usage: clean-iclips.py script.ass | |
It will not overwrite the input file. Probably. | |
You have to have avisynth, avsmeter, masktools and vsfilter plugin installed. | |
Also be sure the fonts are loaded (e.g. using some font manager), otherwise it might remove wrong clips/lines. | |
Poorly written by tp7, must be used for no evil. | |
''' |
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
########################################################################### | |
# DO NOT OPEN THIS DOCUMENT IN GOOGLE TRANSLATE OR BAD THINGS WILL HAPPEN # | |
########################################################################### | |
# General info: | |
# 1. Do not include core filters in the list | |
# 2. Specify the lowest mode that produces correct output with any settings. | |
# For example if something works with MT_MULTI_INSTANCE on some parameters and MT_SERIALIZED with other, MT_SERIALIZED should be used | |
# You can of course specify this in comments so people who do want to get MAXIMUM PERFORMANCE can modify the script themselves. | |
# 3. Do not specify MT modes for runtime filters. Behaviour of runtime filtering with mt is not very well known yet. | |
# 4. In case it isn't obvious, NICE_FILTER - mt mode 1, MULTI_INSTANCE - mt mode 2, SERIALIZED - mt mode 3. Variables are defined by avs+ core. |