Ponder
8th May 2011, 23:24
I wanted to get the fantastic effects from HDRAGC, but it is 240% slower (cpu dependent)on dvd,
much slower on HD. On some materials, the slowness is 100% worthwhile, but in general, may not
be suitable. With the idea of side by side pixels are very alike, a color mask can extracted and
used with proper correction later to get the speed up.
Visually the result is close to identical(my goal), but a little sharper. So I sped
it up as follow:
On 1280x720, decoding is 60% faster, x264 is 38% faster.
Resize 1280 to 1024( if desired final size) , decode 39% faster, x264 28% faster.
On dvd, x264 is 28% faster, 7% larger size on long A.Flux clips, it sharpen the dvd a little, On
soft material, it actully looks better. On short extreme motion scenes, size can be 20% bigger.
Using undot or RemoveGrain(1) before and/or after help shave several % off size..
It is one of my favorite script now.
More improventments may be possible on size, speed or even visually since I have not try parameters
from the great unfilter resizers, or limiter techniques using Masktool. Any refinements are welcome.
Please share your CPU findings, between pure HDRAGC and this Speed_up_HDRAGC script. It will be
interesting to see how different between dual core,quad, cache size, Intel,and AMD all stack up.
Above results are tested on E5300.
#LoadPlugin("f:\AviSynth 2.5\PLUGINS1\DGDecodeNanSSE2.dll")
LoadPlugin("F:\AviSynth 2.5\PLUGINS\SimpleResize.dll") # sharp, use for hd
#LoadPlugin("F:\AviSynth 2.5\PLUGINS1\BicublinResize.dll")#sharper than SimpleResize,good for dvd
MPEG2Source("b:\z.d2v",idct=2,cpu=0)
#ffdshow("default") #if want, set 1024 inside ffdshow's LanczosResize, 10% faster
#RemoveGrain(1)
source=last #Too be safe, mod4 preferred
#width=1024
my_wid0=1280
#my_wid0=1024
ratio=my_wid0/4
mod4h=4*ROUND((HEIGHT*ratio)/width) #wrong mod may get ghosting
my_HEIGHT=mod4h
my_wid = (width > my_wid0) ? my_wid0 : width
a = source.SimpleResize(my_wid/2,my_HEIGHT/2)
a_up=a.SimpleResize(my_wid,my_HEIGHT)# (width,HEIGHT)
a_diff=mt_makediff(a_up,source)#get detail from unalter source
a=a.HDRAGC(Corrector=0.7,Reducer=1,protect=1,MODE=1,PASSES=2)
b=a.SimpleResize(my_wid,my_HEIGHT) #(width,HEIGHT)
bri2=mt_makediff(b,a_up)
mt_adddiff(bri2,source) # Add "brighten diff mask2" to unalter source
briten=mt_adddiff(bri2,source) #sharp, add details
mt_makediff(briten,a_diff)
#RemoveGrain(1)
hdr=source.HDRAGC(Corrector=0.7,Reducer=1,protect=1,MODE=1,PASSES=2)
stackhorizontal(hdr,last)
much slower on HD. On some materials, the slowness is 100% worthwhile, but in general, may not
be suitable. With the idea of side by side pixels are very alike, a color mask can extracted and
used with proper correction later to get the speed up.
Visually the result is close to identical(my goal), but a little sharper. So I sped
it up as follow:
On 1280x720, decoding is 60% faster, x264 is 38% faster.
Resize 1280 to 1024( if desired final size) , decode 39% faster, x264 28% faster.
On dvd, x264 is 28% faster, 7% larger size on long A.Flux clips, it sharpen the dvd a little, On
soft material, it actully looks better. On short extreme motion scenes, size can be 20% bigger.
Using undot or RemoveGrain(1) before and/or after help shave several % off size..
It is one of my favorite script now.
More improventments may be possible on size, speed or even visually since I have not try parameters
from the great unfilter resizers, or limiter techniques using Masktool. Any refinements are welcome.
Please share your CPU findings, between pure HDRAGC and this Speed_up_HDRAGC script. It will be
interesting to see how different between dual core,quad, cache size, Intel,and AMD all stack up.
Above results are tested on E5300.
#LoadPlugin("f:\AviSynth 2.5\PLUGINS1\DGDecodeNanSSE2.dll")
LoadPlugin("F:\AviSynth 2.5\PLUGINS\SimpleResize.dll") # sharp, use for hd
#LoadPlugin("F:\AviSynth 2.5\PLUGINS1\BicublinResize.dll")#sharper than SimpleResize,good for dvd
MPEG2Source("b:\z.d2v",idct=2,cpu=0)
#ffdshow("default") #if want, set 1024 inside ffdshow's LanczosResize, 10% faster
#RemoveGrain(1)
source=last #Too be safe, mod4 preferred
#width=1024
my_wid0=1280
#my_wid0=1024
ratio=my_wid0/4
mod4h=4*ROUND((HEIGHT*ratio)/width) #wrong mod may get ghosting
my_HEIGHT=mod4h
my_wid = (width > my_wid0) ? my_wid0 : width
a = source.SimpleResize(my_wid/2,my_HEIGHT/2)
a_up=a.SimpleResize(my_wid,my_HEIGHT)# (width,HEIGHT)
a_diff=mt_makediff(a_up,source)#get detail from unalter source
a=a.HDRAGC(Corrector=0.7,Reducer=1,protect=1,MODE=1,PASSES=2)
b=a.SimpleResize(my_wid,my_HEIGHT) #(width,HEIGHT)
bri2=mt_makediff(b,a_up)
mt_adddiff(bri2,source) # Add "brighten diff mask2" to unalter source
briten=mt_adddiff(bri2,source) #sharp, add details
mt_makediff(briten,a_diff)
#RemoveGrain(1)
hdr=source.HDRAGC(Corrector=0.7,Reducer=1,protect=1,MODE=1,PASSES=2)
stackhorizontal(hdr,last)