Decoding AVIF: Deep dive with cats and imgproxy
evilmartians.com
Decoding AVIF: Deep dive with cats and imgproxy
1–10 of 29 posts
Re: Decoding AVIF: Deep dive with cats and imgproxy
#2 the first is always 4, don’t ask me why"
Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean?The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detail in the image is preserved through the luminance channel. The subsampling in the chroma is much less perceptable to humans, but more more noticeable in the luminance. Therefore, some very smart people learned to cheat the data saved for chroma, but not the luminance. "don't ask me why" in detailed write ups is just bad in so many ways.
Re: Decoding AVIF: Deep dive with cats and imgproxy
#3"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
Re: Decoding AVIF: Deep dive with cats and imgproxy
#4"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
Re: Decoding AVIF: Deep dive with cats and imgproxy
#5"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
Re: Decoding AVIF: Deep dive with cats and imgproxy
#6"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
I assume it is because with 4 you have 3 different subsampling ratios (if you want to keep factors of two, which you typically want to keep algorithms simple)
Re: Decoding AVIF: Deep dive with cats and imgproxy
#7"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
I don't think you're being generous with the author's statement, especially since this is in the section within which he's describing chroma subsampling. The author is stating "We use 4 as a convention. why is that the convention? No one really knows". That seems accurate to me. Do you have a clearer answer? Your Wikipedia link doesn't provide any enlightment AFAICT, although maybe I missed explanation?
"Now, let's break it down the differences between 4:4:4; 4:2:2 and 4:2:0:
The number of pixels that share color is determined by what type of chroma subsampling it is. Each sample is defined by a block of 8 pixels. The first number refers to the size of the sample and its pattern, which is typically 4 pixels wide. The second number refers to how many pixels in the top row will receive color or chroma sampling. The third number shows how many pixels on the bottom row will receive chroma samples"[0]
The block sizes and sub-sampling methods are also why there are warnings issued when trying to scale an image when the dimensions are not divisible by the block sizes. If you try to scale to an odd number, then the sampling within the blocks is broken. If you scale to a number not divisible evenly by the largest block sizes requested, then you also get issues.
[0] https://blog.westpennwire.com/what-is-chroma-subsampling
Re: Decoding AVIF: Deep dive with cats and imgproxy
#8"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
Not sure that explains why the first number has to be 4, which was their point.
Re: Decoding AVIF: Deep dive with cats and imgproxy
#9"Commonly, three numbers are used to specify downsampling: the first is always 4, don’t ask me why" Wow. Someone going to this much detail on explaining how a video/image codec works, and cannot bother learning what the numbers of chroma subsampling mean? The first number represents the luminance.[0] Even if they know the first number represents luminance, the "don't ask me why" is just horrible on its own. The detai…
Okay, the real reason, as far as the bundles of paper I have* is accurate, is that digital chroma subsampling was first invented for MUSE, a Japanese analogue HD video standard (with pre-broadcast digital components). They chose four for horizontal because it's relatively easy to manipulate using their digital systems at the time and two for vertical so that it's easy to handle interlacing stuff. Unfortunately, I'm not Sony or NHK so I can't say for certain why not eight or any other powers of two. Also, Americans (aka the SMPTE) set the 1,080 lines (the Japanese standard is 1,025), the 16:9 compromise (between the European and Japanese 15:9 and cinema 21:9) and the "limited RGB" dilemma that is experienced in digital video systems (that's literally from the days of NTSC signalling!). Both the Japanese NHK/Sony MUSE system and the British IBA (adopted as European) D-MAC system uses the full-range 8-bit system that is used for JPEG (pre-broadcast to analogue, of course).
Analogous to this, the reason why CD audio is 44,100 Hz is because that's the commonality between NTSC (System M, 525-line 480-visible 60-Hz) and 625-line (576-visible 50-Hz) systems. Digital audio was literally stored on U-matic systems at the time, and it was initially only 14-bit PCM rather than the 16-bit PCM of CDs.
* or rather, my employer's mini-library.