We can now describe the main step that introduces error, meaning quantization. And it's also the step that I figured out was to compress a lot. Without quantization, we won't be able to compress too much. We will be able to compress, but not as much as we see in our digital comments. So basically, we have the forward transform, which we have seen. We have these, we have seen earlier, but now we're going to describe the quantization. So let's talk about it. And we have actually already seen quantization when we started talking, the very early weeks of this class, but let's just describe it in detail in the context of JPEG compression. So, remember, we started from an eight by eight image, and we have that on transform. And what I'm going to represent here are the transform coefficients. So just, in the previous video, we saw that we actually have the transform coefficients. And we get them as a double sum, with sum over the X, with sum over the Y, with sum over coordinates of the image. And we're basically summing the image. This is the image, and we have, basically, the cosine basis. So that's how we got to these coefficients that we represent here. We start from an eight by eight, and we get eight by eight coefficients. So we have kind of an image in a different domain, in the cosine domain. So what we have here are different things that we could do to those coefficients. Now we are working with coefficients. So for example, we could say that we are only going to take coefficients and we'll ignore all these other coefficients. We could, that would be very, very simple, sway go to the upper left corner and only use those coefficients, ignore everybody else. And I'm going to write in a second what that means. We could also do these, which says, somehow, I'm going to say which coefficients to take. Those that are shaded, or says 1 are going to be coefficients I'm going to send. Those that say 0 or unshaded coefficients, I'm not going to send or store. Now we can do something else and we can say you know what, I don't want to, include or discard coefficients. I want you to take this coefficient up here and represent it with eight bits. So I'm going to let you to do quantization to 256 levels. On the other hand, this coefficient that shows up here, so that would be the coefficient 07, T-07. I want you to use only one bit. So you're going to only be able to represent two different levels for that coefficient. And we are going to talk about this in a second. Now, what happens when we do quantization? Remember that F is going to be then reconstructed, as we saw in the previous, video, as the sum of T. The transform coefficients. And we can put R because you remember that the forward and inverse were basically the same. So this is how we're going to reconstruct our image. Now if we quantize T we're not going to reconstruct F because we're going to have an approximation of T. And then we're going to reconstruct an approximation of F. And remember what's happening is this. Our F is a linear combination of the coefficients, either the original coefficients, or the quantized coefficients, a linear combination multiplying the bases. And these are the bases. So here I'm just drawing them in a four by four, but we know that we are talking eight by eight. So this top coefficient basically says how much of this basis we are going to be using. And you can say, you know what? Maybe our visual perception is such that if instead of what I wanted to use, which is 7.7 times these bases. Maybe if I do 7.5 it's not such a big deal, and my visual system won't perceive the difference. So that's idea of quantization, to basically round or say, if I put slightly a different number of this component, whatever component TUV represents, it might not be such a big deal in the reconstruction. And we're going to see that. Now, remember why are we doing quantization? We are doing quantization because we are going to do Huffman coding after that. And remember, in Huffman coding, we want a non-uniform distribution. We want some coefficients to appear a lot, so we're going to give a short code, and some coefficients to appear not much, so we can give them a long code. for example, if we quantize a load, we might find out that 7, 8, 9, 10 all become 0. And then we're going to be able to basically compress a lot and we're going to see a bit more examples of that in the next transparencies. Now, this is the basic idea. As I say, we are going to quantize, we are going to change the coefficients that hopefully we are not going to notice that.
Информация по комментариям в разработке