Log in

View Full Version : Crazy idea to losslessly encode to Mpeg 2


kurkosdr
23rd March 2010, 19:10
Here is an idea for achieving lossless compresion on Mpeg 2. Provided of course than filesize is not an issue.

As we know, Mpeg 2 has I frames and P frames.

All we need to do is encode the I frames in such way that no quality is lost and then encode the P frames in such way that only the parts that do not change at all from the previous frame are omitted. All the other parts of the picture that do change from the last frame are recaptured in the P frame.

This would result in lossless encoding right?

Sure, the file would be large, but we will have achieved lossless encoding in a lossy format. The same can be done with Mpeg 4 asp, where we could also utilize mpeg 4 asp's features in a similar way as well.

PS: I also found this http://cat.inist.fr/?aModele=afficheN&cpsidt=17717335

Sulik
23rd March 2010, 19:32
True lossless encoding is not possible in mpeg-2:
1. The transform itself is lossy (this can be somewhat resolved if you use the exact same idct implementation in encoder & decoder)
2. Coefficients are always quantized, even at the minimum quantization scale, it is not lossless

You can be 'close' to lossless by essentially using very high-bitrate mpeg-2 (as you can with any other codec), but it is not truly lossless, in the sense that you cannot guarantee that the decoded bitstream will be bit-identical to the original uncompressed stream.

Lyris
24th March 2010, 11:10
And what Sulik describes would be pretty close to Motion JPEG anyway, I believe (at least in terms of appearance).