Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
17th July 2012, 15:31 | #1 | Link |
Registered User
Join Date: Oct 2009
Posts: 930
|
x264: No subsampling vs. subsampling
Hi!
After an argument I was wondering if chroma subsampling has any advantage outside speed. I'm not aware of the internals of x264 but I thought maybe it could reduce the chroma information in the video in a more advanced manner, using complicated algorithms, instead of just cutting the resolution in half. (as far as I know x264 has a lot of psychovisual optimizations) It does reduce chroma information anyway (at least in lossy mode). Also the renderers wouldn't have to bother with upsampling. If encoded to the same size which would look better? (lets assume that the subsampled has a good renderer) Would encoding without subsampling have any encode time expense? If a video can be encoded to a just as good (or better) quality without subsampling, why do they use 4:2:0 on Blu-rays? If it can't be encoded to at least as good quality as with subsampling, what is the reason for it? |
17th July 2012, 16:16 | #2 | Link |
Guest
Posts: n/a
|
Chroma subsampling is still used on Blu-Rays to save space. It's the same reason chroma subsampling has been used on every home video format. The average person won't see the difference, anyway, unless they have a player with a chroma upsampling bug.
Last edited by SassBot; 17th July 2012 at 16:19. |
17th July 2012, 17:40 | #3 | Link |
Registered User
Join Date: Apr 2012
Posts: 38
|
Like SassBot said, the idea is that chroma subsampling has no significant affect on quality as perceived by humans. This holds true in most cases anyway. This article explains when it's not the case: http://www.glennchan.info/articles/t...ma/chroma1.htm. If you notice artefacts after subsampling, it is then that you should consider a higher-resolution chroma format. If you compressed the video without subsampling and was aiming for the same size (compared to if you were subsampling), the video would look less sharp and you'd possibly get macroblock artefacts and so on. At least with subsampling there are no macroblock artefacts and the affect on sharpness is much less if present at all.
Note that x264 doesn't necessarily do any subsampling. If you were converting to a different chroma format, then yes, it would affect time. |
17th July 2012, 18:14 | #4 | Link | ||
Registered User
Join Date: Oct 2009
Posts: 930
|
Quote:
Quote:
Last edited by mzso; 17th July 2012 at 18:20. |
||
17th July 2012, 19:04 | #5 | Link |
Guest
Posts: n/a
|
Since subsampling reduces the amount of bits needed to compress the video, no. If you could get similar quality at the same bitrates without subsampled chroma there would be no reason to use subsample the chroma to begin with.
Last edited by SassBot; 17th July 2012 at 19:07. |
17th July 2012, 19:22 | #6 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Subsampling was originally used to reduce analog video bandwidth. It provides no real benefit for compressed video beyond speed. It's largely around for legacy and analog reasons.
Note that in real-world video formats, 4:2:0 may be better or worse than 4:4:4 depending on bitrate because of how the codecs are designed and the psychovisual effects of trading off resolution for quality. If the source is 4:2:0, there is little point in compressing as 4:4:4, naturally. |
17th July 2012, 19:23 | #7 | Link | |
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
Quote:
You can easily do it by yourself: 1) find any video withou subsampling (e.g. proper screen capture) or downscale any video by 50%. 2) encode it using x264. http://mewiki.project357.com/wiki/X2...ngs#output-csp 3) compare it (using not broken player & renderer). Last edited by vivan; 17th July 2012 at 19:26. |
|
17th July 2012, 19:39 | #8 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
|
I did a few limited tests with 4:2:2 source material (SVHS captures so very soft and very bad chroma already) using the lowest crf I thought gave a transparent 4:2:0 H.264.
Using 4:2:2 with the same settings gave a noticeably larger file that wasn't noticeably higher quality. Trying to match the size (I never really got the same size) resulted in a lower quality file. I never messed with chroma-qp-offset. This is after deinterlacing, I could notice the difference (at least I thought I could) converting to 4:2:0 before deinterlacing. Edit: I don't think any of this is relevant to modern digital source videos, sorry. Ah good ol' analogue formats. Last edited by Asmodian; 17th July 2012 at 19:45. |
17th July 2012, 20:13 | #9 | Link | ||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
Quote:
This was a big deal with Main Profile MPEG-2 sources (and a big reason High Profile 4:2:2 MPEG-2 gets used for mezzanine files in the industry). I've done some experimentation with H.264 interlaced 4:2:0 using MBAFF, which seems to be a lot less problematic. This would make sense, as progressive macroblocks don't get the interlaced chroma, and interlaced blocks by definition will have less chroma correlation between physically adjoining lines versus temporally adjoining lines. Still, I'm not quite ready to say MBAFF 4:2:0 is good enough for mezzanine use. Quote:
|
||
17th July 2012, 20:44 | #10 | Link | |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,389
|
Quote:
(At some point time back, I cracked my head about how MBAFF might handle the point of different chroma sample positions for [progressive] vs. [interlaced]. Days and headaches later, I realized that it just doesn't, because there's no need. Chroma sample positions play a role when 4:2:0 is created from a higher (chroma) resolution parent. But when the encoder gets into play, all is already fixed and done.)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
17th July 2012, 22:21 | #11 | Link | ||
Registered User
Join Date: Oct 2009
Posts: 930
|
Quote:
Quote:
I didn't say it was bad at it, that was "turab". I implied/assumed the opposite. |
||
17th July 2012, 22:35 | #12 | Link | |
Registered User
Join Date: Apr 2012
Posts: 38
|
Quote:
|
|
18th July 2012, 00:40 | #13 | Link | |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
|
Quote:
|
|
5th August 2012, 03:50 | #15 | Link |
Registered User
Join Date: Sep 2011
Posts: 86
|
Video game footage pulled from an emulator is one source of unsubsampled video.
Most of the recent videos at TASVideos.org are encoded in 8bit420 and 10bit444. Subsampling artifacts are most noticeable in static, highly detailed areas with contrasting colors. This probably happens more often in video games than real life sources. Code:
#http://tasvideos.org/2078M.html a=ffvideosource("supermetroid-tas-reversebossorder-saturn.mp4").converttorgb24.subtitle("420") b=ffvideosource("supermetroid-tas-reversebossorder-saturn_10bit444.mp4").converttorgb24.subtitle("444") stackhorizontal(a,b).trim(43950,43950) |
5th September 2012, 16:04 | #16 | Link | |
Registered User
Join Date: Oct 2009
Posts: 930
|
Quote:
|
|
5th September 2012, 18:43 | #17 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
Quote:
Some MPEG-2 encoders can do this, but I don't know that x264 can. One place where x264 could improve is by supporting input color spaces (both >4:2:0 and >8-bit) even with the output format is 8-bit 4:2:0, and using that higher precision in its internal optimizations. In the case of 10-bit sources, an encoder should be able to do a much more compression-friendly dither than a preprocessing dithering algorithm. (At some point time back, I cracked my head about how MBAFF might handle the point of different chroma sample positions for [progressive] vs. [interlaced]. Days and headaches later, I realized that it just doesn't, because there's no need. Chroma sample positions play a role when 4:2:0 is created from a higher (chroma) resolution parent. But when the encoder gets into play, all is already fixed and done.)[/QUOTE] |
|
9th January 2013, 07:27 | #18 | Link |
Registered User
Join Date: Sep 2006
Posts: 31
|
Bumping old thread.
Out of interest, has anyone done any comparisons of this for x264? I'm interested in what quality you could get from a fixed size with various options. For example, out of these three, which would be optimal for quality? - encoding as 4:2:0 - encoding as 4:4:4 but the chroma QP offset raised enough to give similar resulting filesize as the above - encoding as 4:4:4 but raising crf to give similar resulting filesize |
16th March 2013, 08:06 | #19 | Link |
Useless idea generator
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
|
Note that for human faces HVS is very sensitive.
The subsampling seems to me to be safer than possibly noticable color quantization, except for high bitrates... I may try some simulation TESTS with JPG subsampling modes saving to the same size.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 / focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC] Last edited by Poutnik; 16th March 2013 at 08:32. |
16th March 2013, 08:52 | #20 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
I don't think you know what quantization (in terms of frequency-domain coding) actually means...
If you're worried about the average color changing, that's quite unlikely to happen given the way DC coefficients are coded in H.264 and the way chroma QPs are calculated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|