Giter Club home page Giter Club logo

Comments (6)

matteocontrini avatar matteocontrini commented on August 20, 2024 1

Of course :)

from digital_video_introduction.

Waranoi avatar Waranoi commented on August 20, 2024

I don't fully understand the Chroma subsampling ratios so I went online to find more info but that just ended with me becoming more confused. This blog post shows an example of 4:2:0 subsampling which seemingly conflicts with the statement given in this introduction

y is the number of changes of chroma samples between the first and seconds rows of a pixels.

I assume that if the number of sample changes between the first and second and row (i.e. y) is 0 then the chroma subsampling of row one and two should be identical, which is not the case in the mentioned blog post.

All that aside, the only reason I started looking up other resources was because I found it hard to understand the explanation of the different ratios. Maybe having an example image similar to the YCbCr 4:2:0 merge but for 4:2:2 would illustrate what the y value does. I personally found the illustration from the blog post more intuitive.

My current understanding of the subsampling system presented in this introduction might be completely wrong, I can't come up with any suggestions for improvement in that case.

from digital_video_introduction.

matteocontrini avatar matteocontrini commented on August 20, 2024

@Waranoi the visualization from Wikipedia is clearer in my opinion:

Wikipedia chrome subsampling 4:2:0

  • the 4 in 4:2:0 is the width of the grid taken as a reference
  • the 2 in 4:2:0 is the number of chrominance values for the first row
  • the 0 in 4:2:0 is the number of changes in chrominance between the first and second row. In fact, the second row doesn't have new chrominance values, but has the same chrominance as the first row.

What might be confusing in that article is the fact that it says:

one line has Cb samples for every other pixel, and the next line has Cr samples for every other pixel.

But as the article says, it's just "one of many ways" to achieve 4:2:0. In that case, instead of saying that the first row has certain Cb and Cr values and the second row "inherits" them (hence the 0 in 4:2:0), it says that the chrominance is "split" in different pixels. So the Cb and Cr values are put in different rows, but are indeed used together to compose the final "colour", which is common for all the pixels in the 2x2 sub-grid.

I actually find that explanation a bit more confusing, but I think it does it that way to better highlight how chroma subsampling is implemented (so putting Cb and Cr in multiple pixels, but using the values together to have the actual chrominance for any pixel).

I hope it makes some sense :)

from digital_video_introduction.

Waranoi avatar Waranoi commented on August 20, 2024

Indeed, after looking it up I also think that the visualization from Wikipedia is clearer. Having multiple example images and J, a and b indexes to the side makes it a lot easier for me to understand. Also your expanded explanation of the b index helps a lot.

So if I understand correctly, the 2 in 4:2:0 does not mean that it only uses chrominance values found in the first row, because the 0 in 4:2:0 says that the final colour for row 1 and row 2 are identical. That's why both row 1 and row 2 can be used to sample the final color? If it's like this then I would understand why the article and this intro's explanation are not conflicting each other.

from digital_video_introduction.

matteocontrini avatar matteocontrini commented on August 20, 2024

That's why both row 1 and row 2 can be used to sample the final color?

Yes. As you say, in 4:2:0 the final chrominance is identical for row 1 and row 2, so you can spread the chrominance information (Cb and Cr) in which row you want, and then use row 1 and/or row 2 at your choice to revert the subsampling

from digital_video_introduction.

Waranoi avatar Waranoi commented on August 20, 2024

Nice! If it's ok for you I might create a pull request later with the stuff you told me because I think it's much easier to understand than the current subsampling section.

from digital_video_introduction.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.