Spoiler :
What this does now is restoring the original 23.976 framerate after bobbing with nnedi2. It does so by picking the frames that should be clean with the selectevery.
Of course, it is highly hit or miss, and if you find it to not work well enough with the default sel value (0), you can try changing it to 1 and see how it works. If you still are getting too many blended frames without their clean version in the previous/following frame, then you're out of luck as that means that the original clean frame really isn't there anymore. Also, if you set sel to any other value (meaning something else from 0 or 1), it'll still be a simple bob deinterlacer like it was before, so if you were using it just as a simple bobber, it will still do so, though not at default values.
So well, here's the updated code:
- Code: Select all
#####################################
#
# BlendedPALsux ver 2.0 by mirkosp
#
# Requires nnedi2.dll ver 1.3 or higher
#
# Changed this up a bit. Now it's not just a bobber anymore.
# Basically, it now attempts to restore the original 23.976 framerate by picking the frames that shouldn't be blended.
# Of course, it doesn't actually look for the frames that aren't blended, but just goes in an order that should be free of blending.
# If you get a lot of blended frames without the clean version of them in the previous or following frame, you might want to change the sel value to 1 and see if you have any luck.
# If you are still getting a lot of blended frames without any possibility to manually restore them, well, not much to do: the clean frame isn't there anymore.
# In any case, if you want to keep using it as just a bobber, you can still do so.
#
# Usage: BlendedPALsux(nsize,qual,sel)
#
# nsize must be 0 or 1. It's speed vs quality, 0 being the default (faster) option. The difference between the two gets more noticeable with higher qual value.
# qual must be 1, 2 or 3. 1 is default. The higher the number, the better the interpolation quality, at expense of speed.
# sel must be 0, 1 or any other int. Default is 0. Setting 1 will change the picked frames, other values will make the filter be a simple bobber.
#
#####################################
function BlendedPALsux(clip clpchk, int "nsize", int "qual", int "sel")
{
clpchk = clpchk.isYV12() ? clpchk : clpchk.converttoyv12()
ox = clpchk.width
oy = clpchk.height
nsize = default(nsize,0)
qual = default(qual,1)
sel = default(sel,0)
clpchk.separatefields()
sauce = last.nnedi2_rpow2(rfactor=2,nsize=nsize,qual=qual,pscrn=true,cshift="spline36resize",fwidth=ox,fheight=oy).converttorgb32()
even = sauce.selecteven().crop(0,1,0,0).addborders(0,0,0,1)
odd = sauce.selectodd()
interleave(even,odd).converttoyv12()
sel == 0 ? Eval("""selectevery(50,0,2,4,6,8,10,13,15,17,19,21,23,25,27,29,31,33,35,38,40,42,44,46,48).assumefps(24000,1001,true)""") : sel == 1 ? Eval("""selectevery(50,1,3,4,7,9,11,14,16,18,20,22,24,26,28,30,32,34,36,39,41,43,45,47,49).assumefps(24000,1001,true)""") : last
}
#####################################
#
# PS: YES I SUCK AT AVISYNTH CODING, THANKS FOR ASKING KTHXBAI.
#
#####################################
Hope to get some feedback as for what you think about it... it's far from perfect but it should be better than other deinterlacers when a lot of blending occurs.


