Log in

View Full Version : What resize method to use in x264 cli ?


lutinor
13th April 2011, 18:43
What is a good resize method in x264 cli ? I guess there is a better methid in downscale and another in upscale?

Fixed with respect to forum rule #12.

J_Darnley
13th April 2011, 18:54
As with avisynth, as long as you don't use point or bilinear, the rest are fine.

roozhou
13th April 2011, 18:57
A very old document about swscale I found in 2008

artifact types:
---------------------------------------------------------------------
ringing
wave or noise like patterns around sharp edges
bad: sinc, lanczos (with high filter length)
acceptable: lanczos (with low filter length), cubic, spline
ok: area, (fast)blinear, gauss, point

blur
loss of detail / high frequency
bad: gauss with high variance
acceptable: (fast)bilinear, area
ok: others

aliasing (only downscale)
straight lines look like staircases
areas of high detail look worse
regular patterns turn into a funny looking mess (moire patterns)
bad: fast bilinear, point, gauss with low variance
acceptable: area
ok: others

blocky (upscale only)
looks like the image is made of rectangular blocks like a mosaic
bad: point
ok: others

recommendations: (based upon my personal opinion many ppl might disagree ...)
---------------------------------------------------------------------

the recommended scalers for upscaling:
fast_bilinear, point if speed is important
cubic, spline, lanczos if quality is important

the recommended scalers for downscaling:
fast_bilinear, point if speed is important
gauss, bilinear if quality is important
cubic, spline, lanczos if a sharper picture is important

note: when encoding at a limited amount of bits (not constant quantizer)
then a slightly blurred input might look better after decoding than a slightly
sharpened one, especially for lower bitrates

sws numbers / names / artifact types
-------------------------------------------------------------------------
r ringing
b blurry
a aliasing (downscale only)
m mosaic (blocky) (upscale only)

-sws 0 fast bilinear bA
-sws 1 bilinear b
-sws 2 bicubic high sharpness r
low sharpness b
-sws 3 experimental ????
-sws 4 nearest neighbour AM
-sws 5 area ba
-sws 6 luma bicubic / chroma bilinear r
-sws 7 gauss low sharpness B
high sharpness AM
-sws 8 sinc R
-sws 9 lanczos long filter R
short filter b
-sws 10 bicubic spline r

Notes:
area upscale is identical to bilinear

lutinor
13th April 2011, 23:15
Btw, i see you can specify the input resolution by : --input-res

Is there useful sometime ?

sneaker_ger
13th April 2011, 23:18
That's for feeding x264 raw uncompressed video data.

lutinor
15th April 2011, 08:31
Any other opinions ? Lanczos or spline for upscaling ?

roozhou
15th April 2011, 09:54
lanczos in libswscale with default number of taps (3) sometimes produces artifacts. You may reduce taps to 2.

lutinor
15th April 2011, 10:28
lanczos in libswscale with default number of taps (3) sometimes produces artifacts. You may reduce taps to 2.

In x264 cli you can mod taps ? I usually see only this kind of line :

--vf resize:width=720,height=576,method=lanczos

You can tweak taps in x264 cli ?

roozhou
15th April 2011, 10:54
My bad. Currently you cannot set parameters for resizers. So submit a feature request to x264 developers.

upyzl
27th April 2011, 03:45
libswscale now is a part of ffmpeg


Hope someone to feedback it to ffmpeg developers... (as my very poor English and I don't know how to feedback...)

pepelugil
3rd May 2011, 07:25
Could anybody please tell me the equivalence between x264 cli's and Avisynth resizers?

Cli's lanczos is Avisynth default lanczos or lanczos4?
Cli's spline is Avisynth spline16 or spline36?

As x264 resizers can't be tweaked, is better to use Avisynth for rescaling or are x264 cli's resizers good enough?

Greetings

Blue_MiSfit
4th May 2011, 14:40
I'd certainly say that it's safe to assume that for 99% of users, x264 cli's resizers are certainly good enough.

In fact, plain bicubic is good enough for most purposes ;)

I rarely (if ever) bother with anything more exotic these days.

Derek

sumawo13
5th May 2011, 04:36
I almost exclusively use spline in both Avisynth and x264 CLI, I like the sharpness it gives. Probably ideal for live-action images.

Blue_MiSfit
6th May 2011, 04:33
Don't get me wrong, I'm a big fan of spline as well. It's just not a great idea if you care a lot about speed.