View Full Version : SSEbilinear
freelock7
12th December 2004, 11:56
I would like to use the SSEbilinear resize known in DVDx output option but Avisynth don't have this resizer.
What kind of resizer can I use to have this similar quality?
Wilbert
12th December 2004, 14:47
BilinearResize ?
freelock7
12th December 2004, 15:56
Yes but DVDx 2.2 have 3 options with bilinear:
-MMXbilinear
-SSEbilinear
-TAPbilinear
It changes considerably the picture quality.
How to set these options in Avisynth?
Wilbert
12th December 2004, 16:01
I guess you have to ask dragongodz.
I don't know about TAPbilinear. But there should be no difference between MMXbilinear and SSEbilinear (only optimization stuff).
Didée
12th December 2004, 16:32
Originally posted by freelock7
It changes considerably the picture quality.
That should mean that all versions but (perhaps) one are b0rked. Either an algorithm calculates bilinear sampling, or it does not. If it shall be bilinear, the result is "predetermined" - there is no room for a quality change.
dragongodz
12th December 2004, 20:11
the SSE and MMX resizes should be the same yes but TAP is a different thing. it is meant to increase quality and does from my own tests and feedback from others.
you can do it with avisynth aswell though. TAP resizing is simply resizing in steps. i read about it in regards to photoshop once so tried it out with DVDx, for a larger resize ,such as dvd to vcd, it is easy to see the improvement with edges etc.
so what DVDx does when TAP resizing is selected is take 2 steps to reach the final desired size. so you have original size ,lets call that A, and target size, lets call that B. you resize to B+(A-B)/2 (rounded to a size divisible by 4) and then to final target size. obviously for small resizing there isnt any need for this but again for a larger resize it does give better quality, especially bilinear.
freelock7
12th December 2004, 21:17
Many thanks dragongodz.
Macanudo
13th December 2004, 04:00
Originally posted by dragongodz
TAP resizing is simply resizing in steps. i read about it in regards to photoshop once so tried it out with DVDx, for a larger resize ,such as dvd to vcd, it is easy to see the improvement with edges etc.
so what DVDx does when TAP resizing is selected is take 2 steps to reach the final desired size. so you have original size ,lets call that A, and target size, lets call that B. you resize to B+(A-B)/2 (rounded to a size divisible by 4) and then to final target size. obviously for small resizing there isnt any need for this but again for a larger resize it does give better quality, especially bilinear.
Sounds interesting. Is there anyway we could get you create an avisynth function that utilizes this method?
Thanks,
Macanudo
Didée
13th December 2004, 09:00
Upon request:function Bilinear2stepResize( clip clp, int "x", int "y" )
{ ox = clp.width
oy = clp.height
modx = (clp.isyuy2 || clp.isyv12) ? 4 : 1
mody = clp.isyv12 ? 4 : (clp.isyuy2 ? 2 : 1)
x = default( x, clp.width /(modx*2) * modx )
y = default( y, clp.height/(mody*2) * mody )
clp.BilinearResize( ((x+(ox-x)/2)/modx)*modx, ((y+(oy-y)/2)/mody)*mody )
BilinearResize( (x/modx)*modx, (y/mody)*mody )
return last
}
Without specifying a size, it defaults to halving the size (as ReduceBy2). Width is kept MOD4 for YUV clips, height MOD2 for YUY2 and MOD4 for YV12. RGB is unrestricted. Hope I didn't make an error, too early in the morning.
However,for most tasks good old bicubic resizing with "softer" parameters, like (x,y,0.6,0.2), is fairly similar ...
Macanudo
13th December 2004, 22:55
Originally posted by Didée
Upon request:function Bilinear2stepResize( clip clp, int "x", int "y" )
{ ox = clp.width
oy = clp.height
modx = (clp.isyuy2 || clp.isyv12) ? 4 : 1
mody = clp.isyv12 ? 4 : (clp.isyuy2 ? 2 : 1)
x = default( x, clp.width /(modx*2) * modx )
y = default( y, clp.height/(mody*2) * mody )
clp.BilinearResize( ((x+(ox-x)/2)/modx)*modx, ((y+(oy-y)/2)/mody)*mody )
BilinearResize( (x/modx)*modx, (y/mody)*mody )
return last
}
Without specifying a size, it defaults to halving the size (as ReduceBy2). Width is kept MOD4 for YUV clips, height MOD2 for YUY2 and MOD4 for YV12. RGB is unrestricted. Hope I didn't make an error, too early in the morning.
However,for most tasks good old bicubic resizing with "softer" parameters, like (x,y,0.6,0.2), is fairly similar ...
Thanks very much for the function! It works great. I do however agree with your last statement. IMHO there is no perceptible difference in quality over Bicubic. I could be wrong. I only tried it on one clip. I plan to test it further. It is an interesting concept that could possibly be applied to a different filter in the future.
Thanks Again,
Macanudo
Macanudo
14th December 2004, 06:18
Didée,
Question:
Would the following changes to the function increase the steps from 2steps to 4steps? I think I followed your code, but I am code averse to say the least.
function Bilinear2stepResize( clip clp, int "x", int "y" )
{ ox = clp.width
oy = clp.height
modx = (clp.isyuy2 || clp.isyv12) ? 4 : 1
mody = clp.isyv12 ? 4 : (clp.isyuy2 ? 2 : 1)
x = default( x, clp.width /(modx*4) * modx )
y = default( y, clp.height/(mody*4) * mody )
clp.BilinearResize( ((x+(ox-x)/4)/modx)*modx, ((y+(oy-y)/4)/mody)*mody )
BilinearResize( (x/modx)*modx, (y/mody)*mody )
return last
}
Thanks Again
Macanudo
Didée
14th December 2004, 09:10
Nnnnnn...nno, not quite. But the following does the procedure with an arbitrary step number:
function BilinearNstepResize( clip clp, int "x", int "y", int "steps" )
{ ox = clp.width
oy = clp.height
stp = default( steps, 1 )
stp = stp>0 ? stp-1 : 0
modx = (clp.isyuy2 || clp.isyv12) ? 4 : 1
mody = clp.isyv12 ? 4 : (clp.isyuy2 ? 2 : 1)
x = default( x, clp.width /(modx*2) * modx )
y = default( y, clp.height/(mody*2) * mody )
stp > 0 ? clp.BilinearNstepResize( ((x+(ox-x)/stp)/modx)*modx, ((y+(oy-y)/stp)/mody)*mody, stp ) : clp
BilinearResize( (x/modx)*modx, (y/mody)*mody )
return last
}
dragongodz
14th December 2004, 12:17
it does increase bicubic quality aswell by the way, though it is harder to see when playing back. the thing to generally look at are diagonal edges where you normally see stepping etc.
Macanudo
15th December 2004, 00:58
Originally posted by Didée
Nnnnnn...nno, not quite. But the following does the procedure with an arbitrary step number:
function BilinearNstepResize( clip clp, int "x", int "y", int "steps" )
{ ox = clp.width
oy = clp.height
stp = default( steps, 1 )
stp = stp>0 ? stp-1 : 0
modx = (clp.isyuy2 || clp.isyv12) ? 4 : 1
mody = clp.isyv12 ? 4 : (clp.isyuy2 ? 2 : 1)
x = default( x, clp.width /(modx*2) * modx )
y = default( y, clp.height/(mody*2) * mody )
stp > 0 ? clp.BilinearNstepResize( ((x+(ox-x)/stp)/modx)*modx, ((y+(oy-y)/stp)/mody)*mody, stp ) : clp
BilinearResize( (x/modx)*modx, (y/mody)*mody )
return last
}
Thanks...I told you I was a coding idiot...LOL. Love your LimitedSharpen function by the way and look forward to your Sharpening Suite.
Thanks Again,
Macanudo
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.