Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NGcode.avs version BETA 0
- LoadPlugin("ExactDedup.dll")
- function AudioTrimSample(clip clp, int samples){
- clp
- AssumeSampleRate(samples+1)
- DelayAudio(-1)
- AssumeSampleRate(clp.AudioRate)
- }
- function TestSource(string name){
- Assert(VersionNumber >= 2.6,
- \ "[TestSource] AVISynth 2.6 required, found " + VersionString)
- a=AviSource(name)
- Assert(a.isRGB, "[TestSource] RGB source required")
- return a
- }
- function resize512(clip clp, int AR_num, int AR_den){
- h = (clp.height +1) /2 *2
- h = (h > 240) ? 240 : h
- w = ((h *AR_num -1) /AR_den +2) /2 *2
- clp.lanczosresize(w, h, taps=2)
- }
- function rgbtoyv12(clip clp){
- clp
- ConvertToYV24(chromaresample= "point", matrix="PC.601")
- ConvertToYV12(chromaresample="lanczos", matrix="PC.601")
- }
- function TASBlend(clip clp, float "ratio", int "level") {
- ratio = default(ratio, 2.0 /3)
- assert(ratio >= 0.0 && 1.0 >= ratio,
- \ "[TASBlend] 1.0 >= ratio >= 0.0, it was " + string(ratio))
- level = default(level, round(ratio * 257))
- assert(level >= 0 && 257 >= level,
- \ "[TASBlend] 257 >= level >= 0, it was " + string(level))
- clp
- Assert(isRGB, "[TASBlend] RGB source required")
- ConverttoRGB32
- Interleave(Layer(SelectEvery(4, 0), SelectEvery(4, 1), level=level),
- \ Layer(SelectEvery(4, 2), SelectEvery(4, 3), level=(257-level)))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement