View Full Version : X264 and resolution
mezzanine
11th July 2005, 09:01
Is it better qualitywise to keep original resolution with sar when encoding from dvd source (e.g. Pal 720x576) or downscale ? (for 1CD backups)
Comparing the same source encoded full res sar and at 640x256 the first one looks better to me.
IRMA1024
11th July 2005, 09:57
i always use orginal res.. with crop offcourse and resize again to its original res.. (eg 720x400) the result is good... better than downscaling res.
bond
11th July 2005, 10:15
i always use orginal res.. with crop offcourse and resize again to its original res.. (eg 720x400) the result is good... better than downscaling res.resizing the cropped picture to the "original res"?
the best is either you crop only, no resizing, and use SAR or
you crop and resize without using SAR
mezzanine
11th July 2005, 10:27
resizing the cropped picture to the "original res"?
the best is either you crop only, no resizing, and use SAR or
you crop and resize without using SAR
I suppose for future hardware players just encoding at full res (no cropping) with sar is the best option.
How do i set the sar in x264 when only cropping the black borders (no resizing) ?
bond
11th July 2005, 10:31
I suppose for future hardware players just encoding at full res (no cropping) with sar is the best option.why?
How do i set the sar in x264 when only cropping the black borders (no resizing) ?via the sar option of x264? :p
leowai
11th July 2005, 10:33
I think it's better to use SAR as I heard resizing some how might cause you lost in video quality (by how much I don't know).
mezzanine
11th July 2005, 10:37
why?
via the sar option of x264? :p
Current mp4 players (asp) have problems with aspect ratios (my philips dvp720sa for example).
You mean i just crop and use the same sar (73:50 for Pal anamorphic) ?
:stupid:
bond
11th July 2005, 10:38
I think it's better to use SAR as I heard resizing some how might cause you lost in video quality (by how much I don't know).using anamorphic resizing means that the picture is resized during playback with a resizer like bilinearresize afaik (not sure), so qualitywise it should be better to resize before encoding with a better resizer (like lanczos)
of course this will make the video harder to compress
edit:
Current mp4 players (asp) have problems with aspect ratios (my philips dvp720sa for example).so you say that the player handles an anamorphic picture better than a normal one? cant believe it :D
You mean i just crop and use the same sar (73:50 for Pal anamorphic) ?yep (no idea if 73:50 is right tough)
Sharktooth
11th July 2005, 13:27
using anamorphic resizing means that the picture is resized during playback with a resizer like bilinearresize afaik (not sure), so qualitywise it should be better to resize before encoding with a better resizer (like lanczos)
Not true. If you have a 16:9 TV or a HD TV or a PC monitor the "real time" resizer wont resize the horizontal (576 will remain 576) res but the vertical res (7xx -> 10xx).
So anamorphic encoding gives always a better quality unless you watch your movies on old 4:3 SD TVs.
bond
11th July 2005, 14:03
Not true. If you have a 16:9 TV or a HD TV or a PC monitor the "real time" resizer wont resize the horizontal (576 will remain 576) res but the vertical res (7xx -> 10xx).i never claimed that horizontal resizing takes place...
So anamorphic encoding gives always a better quality unless you watch your movies on old 4:3 SD TVs. no, because anamorphic resizing means that the picture gets vertically resized with bilinearresize, which provides less quality than if you resize with lanczosresize
in other words:
you get a better quality if you do the resizing yourself with lanczos than if you let the renderer do the resizing with bilinear (as its done with anamorphic resize)
Sharktooth
11th July 2005, 14:44
...but you have to resize it to 10xx*576 and use a higher bitrate...
so at the same bitrate anamorphic is always better :p
bond
11th July 2005, 14:47
...but you have to resize it to 10xx*576 and use a higher bitrate...
so at the same bitrate anamorphic is always better :p proove that the anamorphic resized picture with bilinear resize during playback has a higher quality than the one resized before encoding with lanczos resize!
i am not so sure about it, especially with a high efficiency codec like x264/nero
resizing the cropped picture to the "original res"?
the best is either you crop only, no resizing, and use SAR or
you crop and resize without using SAR
This might be a stupid question, but what is wrong with cropping, resizing and using sar?
akupenguin
11th July 2005, 16:02
proove that the anamorphic resized picture with bilinear resize during playback has a higher quality than the one resized before encoding with lanczos resize!
OTOH, with a high efficiency codec like H.264, it may even be faster to lanczos during playback instead of decoding a higher resolution (though I haven't benchmarked it).
bond
11th July 2005, 16:57
This might be a stupid question, but what is wrong with cropping, resizing and using sar?using sar means that the renderer resizes during playback. therefore if you also resize via avisynth you resize twice
of course this can make sense (eg if you want to downsize but still use anamorphic resize if you think it provides better quality), but what IRMA1024 does sounds very wierd
OTOH, with a high efficiency codec like H.264, it may even be faster to lanczos during playback instead of decoding a higher resolution (though I haven't benchmarked it).well i am not sure if any renderer can use lanczos?
also i didnt talk about playback till now, but of course a higher res is harder to decode
using sar means that the renderer resizes during playback. therefore if you also resize via avisynth you resize twice
of course this can make sense (eg if you want to downsize but still use anamorphic resize if you think it provides better quality)
ok, thanks a lot for the clarification - I am actually just doing a couple of encodes, where I am downsizing and using anamorphic resize... But I'm not sure whether or not it improves quality.
bill_baroud
12th July 2005, 08:14
well i am not sure if any renderer can use lanczos?
also i didnt talk about playback till now, but of course a higher res is harder to decode
You can use ffdshow for that, it's not a renderer but it will do the job.
IRMA1024
13th July 2005, 09:07
... but what IRMA1024 does sounds very wierd
for example input 720x480...
i crop black border got 712x396
then i resize to 720x400 (still maintaining AR)
what's wrong with that?
Soulhunter
13th July 2005, 09:25
Using anamorphic resizing means that the picture is resized during playback with a resizer like bilinear resize afaik (not sure), so qualitywise it should be better to resize before encoding with a better resizer (like lanczos)
True, but this only works if the resulting res matches ya display res...
Otherwise its... Lanczos resize -> Encode -> Decode -> Bilinear resize !!!
Bye
Sharktooth
13th July 2005, 13:24
proove that the anamorphic resized picture with bilinear resize during playback has a higher quality than the one resized before encoding with lanczos resize!
i am not so sure about it, especially with a high efficiency codec like x264/nero
I said after encoding... not before...
example:
Encode 1: source(7xx*576) -> crop(7xx*432)-> lanczos(10xx*432) -> encode to 1CD (~900kbps)
Encode 2: source(7xx*576) -> crop(7xx*432)-> AR signaling(16:9) -> encode to 1CD (~900kbps)
Which one will look better? IMHO the 1st encode has not enaugh bits per pixel and will show artifacts or lack of details.
The 2nd encode has more bits per pixel and will be more "watchable"...
EDIT: Also soulhunter is right...:)
mezzanine
13th July 2005, 13:38
Encode 1: source(7xx*576) -> crop(7xx*432)-> lanczos(10xx*432) -> encode to 1CD (~900kbps)
Encode 2: source(7xx*576) -> crop(7xx*432)-> AR signaling(16:9) -> encode to 1CD (~900kbps)
Let's forget about Encode 1
and add this
Encode 3: source(7xx*576) -> crop(7xx*432)-> lanczos(7xx*304) -> encode to 1CD (~900kbps)
What's the best option ?
Sharktooth
13th July 2005, 13:46
Not sure, but 900kbps should be enaugh for an anamorphic encode with x264, expecially if you use some light filters to rise compressibility.
however, if you wanna keep all the original pixels, anamorphic is the best solution.
Audionut
13th July 2005, 13:48
For a 4:3 aspect display device, i believe encode 3 will be best.
For a 16:9 aspect display device, you most certainaly would want to keep a "True" anomorphic resolution.
Sharktooth
13th July 2005, 13:58
For a 4:3 aspect display device, i believe encode 3 will be best.
Not properly...
it's ok for a 4:3 TV... not for a 4:3 PC monitor...
What's the best option ?who can tell ?
i've just made some short tests w/some clips. i got 1st pass avg bitrate (xvid, q2) like ~950, ~2850, ~4500, respectively. the first one would look more than transparent but the last one would be worse than bad at 900 kbps (w/xvid, of course).
i know, x264 worx differently than xvid, but there must be sg like 'compressibility' there too. (yet) i don't know how to measure it w/x264, but i'm sure, i should. wout that there remains the method of trial-and-error only. which is the less effective one.
btw, what method (if any) do u use to 'scale' your x264 encodings ? i mean, how do u decide on the target bitrate/size ...
the bests
y
Sharktooth
13th July 2005, 15:36
well... i know about the compressibility...
my example was intended for an average comp. movie...
for "scaling" i look at some of the theoretically harder to compress scenes on a movie, i trim and encode them using 1 pass average bitrate...
if i like how they come out i keep that bitrate for a full 2 pass encoding... if i dont like it i rise the bitrate accordingly to my impressions...
i usually tend to keep the full res though...
EDIT: fixed typos...
cuban
13th July 2005, 17:06
Correct me if I am wrong: in all situations the resizing is done twice:
1. When encoding anamorphic video (only cropping, no resize + sar) first resize is done when correcting aspect ratio during decoding, and second during putting video on the display (if there is need of course, but nearly in all cases)
2. When encoding widescreen (using resize to correct aspect ratio before encoding, no sar) resizing is done before encoding and after decoding, when displaying on the screen (as above, if needed)
I see certain adventages an disadventages of both.
Adventages of 1.
We feed encoder with not resized video, so the input is better quality (not spoiled by resizing). If it is good quality encoder, and bits/pixel value is big enough, encoded video might have better quality than in 2., becouse of higher vertical resolution -> probably sharper image, more details.
Adventages of 2.
First, we don't bother about aspect ratio anymore: we don't need player that supports aspect ratio correction and there are sometimes problems with that (like now we have many hardware mpeg4 ASP decoders, that do not handle properly anamorphic videos). Second, we know what resizer is used to correct aspect ratio (we choose it), so it might give better results than resizer used by decoder when applying SAR. On the contrary, we loose some "vertical" quality.
Concluding: if I know, that "SAR" resizer is good quality, i would choose anamorphic, becouse all decisions about quality are made by encoder and it might give better vertical quality of compressed video. If I know that "SAR" resizer is not good quality (or not good enough) I would choose widescreen encoding - I get lower vertical resolution (softer image), but bigger bits/pixel value, so encoder can be more precise.
Conclusion: there is no "best" solution :)
(by "SAR" resizer I mean resizer used during applying SAR)
vlada
13th July 2005, 18:23
for example input 720x480...
i crop black border got 712x396
then i resize to 720x400 (still maintaining AR)
what's wrong with that?
I would say this is absolutely wrong. You do a resize from 712x396 which will degrade the quality. I would rather crop to 704x400 to eliminate the resize. Or to any suitable resolution dividable by 16. Cropping a little of the picture or leaving some black area is less destructive than resizing.
Or once you are already resizing I would resize to a square pixel aspect ratio. The non square pixels found in DV and DVD were introduced for backward compatibility with analog systems and for a compatibility between digital PAL and NTSC. It is a costdown for manufactures, but a lot of confusion for unexperienced users. I think that non square pixels shouldn't be used if it's not necessary.
Soulhunter
13th July 2005, 19:05
When encoding anamorphic video (only cropping, no resize + sar) first resize is done when correcting aspect ratio during decoding, and second during putting video on the display (if there is need of course, but nearly in all cases)
Not sure, but afaik both is done by the renderer...
So I think AR correction + fullscreen-scaling is done as single step !!!
Bye
Sharktooth
13th July 2005, 19:09
AR correction is made storing a simple flag set in the bitstream and the video doesnt get resized at all during encoding.
When the decoder reads the bistream finds the AR flag and resize (during playback) accordingly to the specified AR and the display resolution.
cuban
13th July 2005, 19:51
AR correction is made storing a simple flag set in the bitstream and the video doesnt get resized at all during encoding.
When the decoder reads the bistream finds the AR flag and resize (during playback) accordingly to the specified AR and the display resolution.
Agreed (i didn't write, the video is resized during encoding). But when playing, is it a single step resizing, or there is more then one step ? For example info from mPlayer (source is 512x288, SAR=13:10; playing full screen 1280x960):
Movie-Aspect is 2.31:1 - prescaling to correct movie aspect.
VO: [directx] 512x288 => 666x288 Planar YV12 [fs]
For me it looks like two steps resizing - 512x288 -> 666x288 -> display resolution
There is no doubt, that renderer resizes picture, but the question is which one: 512x288(original) or 666x288 (the one with already corrected aspect ratio). The information given by mPlayer makes me unsure...
Sharktooth
13th July 2005, 20:20
dunno have to check the resizer in mplayer...
however doing it in 2 steps is stupid. maybe only the calculations are done in 2 steps and the resize is made directly to the final res...
Soulhunter
13th July 2005, 21:49
When the decoder reads the bistream finds the AR flag and resize (during playback) accordingly to the specified AR and the display resolution.
Are you sure that the resizing is done by the decoder n' not by the renderer ???
I thought the decoder simply forwards the info to the renderer... :\
Bye
Sharktooth
14th July 2005, 03:16
well the "real" resize is done by the renderer... but it renders what decoder says to render...
i mean, the decoder calculates the final resolution and the renderer well... renders it at the resolution told by the decoder.
uray
12th October 2005, 05:40
is there any PSNR/Quality comparison between anamorphic resize and pre-encode lanchoz resize? with same bitrate ofcourse... which one is better?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.