View Full Version : Subpixel Shifting
Mole
9th September 2010, 12:45
I have a few videos which has been resized using a few advanced resize methods.
However, the resulting videos has introduced a small subpixel shift.
How can I use AviSynth's resize engine to position the video back to correct place?
The shift is half pixel right and half pixel down.
Alex_ander
9th September 2010, 13:23
You can try using internal crop engine of a resizer for this, but it's not lossless since it will resample video. Like this:
AddBorders(4,4,4,4)
Spline36Resize(720,480,4+x,4+y,-4+x,-4+y)
where x & y are your sub-pixel values
Mole
9th September 2010, 17:30
Umm, thanks!
So, if I need to shift it left and up half pixel, what values do I use?
Didée
9th September 2010, 17:37
spline36resize(width,height,0.5,0.5,width,height)
Using AddBorders() is not required.
If by chance you're still using Avisynth 2.5.6, the above code will do exactly nothing. For 2.5.6, you need
(width,height,0.5,0.5,width+0.001,height+0.001)
Mole
10th September 2010, 00:23
Thanks a lot!
I use Avisynth 2.5.8.
So, in my case, would it be:
(1920,1080,0.5,0.5,1920,1080)
By the way, what kind of resizer would you recommend for this purpose?
IanB
10th September 2010, 04:34
Given subrange_height == target_height and subrange_width == target_width you don't want any actual resizing, just pure 0.5 pixel shifting. So try either BilinearResize() or BicubicResize(). These will involve the minimum number of input pixels per output pixel. If you involve to many input pixels like with Lanzos or Spline36 you may introduce ringing artefacts. With Bicubic you may want to try even softer B and C values than the default 1/3, 1/3.
*.mp4 guy
10th September 2010, 05:54
less processed pixels, more blurring. You should really try both a high tap shift, and a low tap shift and see what does batter on you source. If your input is already blurry, for whatever reason, you should probably use a higher tap filter.However if you have something really sharp like flash animation, IanB is likely correct.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.