Ceppo
8th January 2021, 14:21
I have a filter that I want to run on each 8x8 block separately, so I made a script with a loop to do that. To filter the first vertical line it takes less than a second but if I filter the whole picture it fails to load (the window freezes and nothing happens) so either I'm doing wrong or I'm pushing avisynth limits. Which is it?
src = last
width = src.width()
height = src.height()
VS = src.Crop(0,0,-width+8,-height+8).Invert() #or any filter
for(h=16,height,8){
V = src.Crop(0,h-8,-width+8,-height+h).invert()
VS = StackVertical(VS,V)
}
for(w=16,width,8){
VS2 = src.Crop(w-8,0,-width+w,-height+8).Invert()
for(h=16,height,8){
V2 = src.Crop(w-8,h-8,-width+w,-height+h).invert()
VS2 = StackVertical(VS2,V2)
}
VS = StackHorizontal(VS,VS2)
}
VS
src = last
width = src.width()
height = src.height()
VS = src.Crop(0,0,-width+8,-height+8).Invert() #or any filter
for(h=16,height,8){
V = src.Crop(0,h-8,-width+8,-height+h).invert()
VS = StackVertical(VS,V)
}
for(w=16,width,8){
VS2 = src.Crop(w-8,0,-width+w,-height+8).Invert()
for(h=16,height,8){
V2 = src.Crop(w-8,h-8,-width+w,-height+h).invert()
VS2 = StackVertical(VS2,V2)
}
VS = StackHorizontal(VS,VS2)
}
VS