View Full Version : Acceptable Image Degradation?
DrPhill
15th July 2012, 11:15
I have written a primitive encoder for MPG.
I have only tested it on very small images so far (32x32bits). I am loosing more image resolution than I imagined I would, but that may be acceptable. Could somebody cast an eye on the image (JPG) and video (MPG) attached, and tell me if I am being too fussy?
I appreciate any input.
Edit - I had to upload mpg to http://youtu.be/kjmPwhrZb2c because mpgs are not allowed as attachments!
mpucoder
16th July 2012, 04:49
mpeg and jpeg use virtually the same compression techniques, therefore you should not be able to see any difference if properly encoded.
2Bdecided
16th July 2012, 12:39
That (source?) looks like 4:4:4 encoded blocks of uniform colours with hard transitions.
If you're going to down to 4:2:0 chroma subsampling, it'll look very different. Plus high compression MPEG or JPEG won't like the sharp edges.
Cheers,
David.
DrPhill
16th July 2012, 14:28
Both comments proved very helpful.
I expected some image degrradation, but was not sure how much. GIMP allowed me to vary the compression on the JPG which gave me a feel for that dimension.
Yes those are 4:4:4 images with hard edges (and they are tiny!) so it is not a 'fair' test of the encoder/decoder pair. But it did point up problems. And they were hand-coded too, to avoid any artifacts introduced by JPG compression/decompression.
Examining the decoder code has highlighted a difference in the way the DC and AC components are de-quantised. Assuming that this represents a difference in the quantisation process, I have adjusted my encoder and the results look a lot better (at 32x32 pixels at least).
Now to work my way up to larger frames. I think I am within sight of something usable now.
DrPhill
16th July 2012, 14:39
OK, here is a quick screenshot. Up in the top left are two 32x32 images (one above the other and not well separated). The lower is the round-trip version of the upper.
Is the image degradation what you would expect for encode/decode?
(Yes, hard edges, hand coded, 4:4:4 images. Got to make it work hard....)
Your help is greatly appreciated.
Bloax
16th July 2012, 14:57
How does it perform on an image such as this?:
https://dl.dropbox.com/u/63152810/n_bngr02.png
Or hell, you could try it on this weirdo avatar I have. :p
DrPhill
17th July 2012, 17:47
Here is a ''proof on concept', if not a 'proof of quality'.
http://youtu.be/LHlPifoTaG8
Are the 'artifacts' expected, or do they indicate flaws in my encoder?
This was generated entirely programmatically, in Java, using a MPG1 encoder written entirely by me. I am still not happy wiith the result, but amazed at how far I have come in a couple of weeks.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.