logo Sign In

Post #783787

Author
Intruder
Parent topic
Star Wars GOUT in HD using super resolution algorithm (* unfinished project *)
Link to post in topic
https://originaltrilogy.com/post/id/783787/action/topic#783787
Date created
5-Aug-2015, 11:51 AM

Infognition also recommends multi-threading: http://www.infognition.com/tutorials/rip_guides/avisynth.html

Just a quick writeup of your v10 with multi-threading, only three lines added hopefully make the deal. I have not tested it.

SetMTMode(3) #Multi-Threading mode 3 for source filters

orig=AviSource("Star Wars.avi")

SetMTMode(2,0) #Multi-Threading mode 2 with processor's available threads for processing filters

orig=ConvertToRGB24(orig)

edi0=nnedi2_rpow2(orig,rfactor=2, cshift="spline64resize") # edge directed interpolation

edi=edi0

sr1=SR(orig,1424,548) # super resolution in RGB space

sr1=ConvertToYUY2(sr1)

yuy2=ConvertToYUY2(orig)

sr2=SR(yuy2,1424,548) # super resolution in YUY2 space

rev=Reverse(orig)

sr1r=SR(rev,1424,548) # super resolution in reverse direction in RGB space

sr1r=Reverse(sr1r)

sr1r=ConvertToYUY2(sr1r)

yuy2rev=ConvertToYUY2(rev)

sr2r=SR(yuy2rev,1424,548) # super resolution in reverse direction in YUY2 space

sr2r=Reverse(sr2r)

s64=Spline64Resize(orig,1424,548) 

s64=ConvertToYUY2(s64)

edi=ConvertToYUY2(edi0)

Average(sr1,0.5,sr2,0.5,sr1r,0.5,sr2r,0.5,s64,-2,edi,1) # combine SR in both directions for additional detail, and combine details from SR with nnedi2 to reduce aliasing 

ConvertToRGB24()

sr=last

edicd=ConvertToYUY2(edi0)

edicd=ConvertToRGB24(edicd)

Average(sr,1,edi0,1,edicd,-1) # correct colors

nnedi2_rpow2(rfactor=2, cshift="spline64resize") 

Spline64Resize(1920,816)

There is one addition when using filters that already have multi-threading (I think there are not many):

When using MT mode with filters that have ability to spawn several internal processing threads - be sure to set such filters to use only 1 thread. Otherwise for example with 8-thread system MT mode will spawn 8 threads with once instance of such filter per thread (in MT mode 2), each filter instance will spawn 8 threads. End result: 64 threads (ouch).

One should use MTMode 3 or 5 before that filter then.

JEDIT: Removed bad use of SetMemoryMax, thanks RU.08