PDA

View Full Version : [new filter] tbc update


jmac698
13th April 2010, 06:33
Hello,
I mentioned before I was working on a dejitter filter. Just wanted to say I've made some progress; I did dejitter a video with no TBC.
I'm dealing with some numerical optimization now, but should have my first rock steady video anytime now.
On some samples I had perfect alignment, with 1/16th subpixel precision.
I'm looking forward to measuring jitter on various sources. I should also be able to dejitter against a reference, for example I have a stable source that is too bright and another source with proper levels, I could stabilize against the reference to have the perfect video. (I can't get another version of the stable source).

I have one question now; bilinearresize does not give expected results when using for "shifting";
where sx is the shift,


w=last.width
pointresize(w*32,last.height)
s==1?crop(0,0,w*32-sx*2,0):crop(sx*2,0,0,0)
pad=last.crop(0,0,sx*2,0).coloryuv(off_y=-255).coloryuv(off_y=16)#make a black line with same properties as clip
s==1?stackhorizontal(pad,last):stackhorizontal(last,pad)
bilinearresize(last.width/32,last.height,0,0)

When I shift by 4 pixels eg, it doesn't simply shift but combines several pixels in a gradient. I had an idea maybe I should crop by 1/2 pixel for some reason, I saw that used in another script with a suggestive comment.
In other words, bilinearresize is "out of phase" somehow.

Gavino
13th April 2010, 09:54
When I shift by 4 pixels eg, it doesn't simply shift but combines several pixels in a gradient. I had an idea maybe I should crop by 1/2 pixel for some reason, I saw that used in another script with a suggestive comment.
In other words, bilinearresize is "out of phase" somehow.
Perhaps you are referring to this recent thread? The point to remember is that the Avisynth resizers preserve the image centre position, except for PointResize (which preserves the origin), so when mixing the two, you need to use compensating offsets.

However, if I understand your script correctly, I think the whole thing can be replaced by
BilinearResize(width(), height(), (s==1 ? -sx/16.0 : sx/16.0), 0)