PDA

View Full Version : mjpeg vs photojpeg in quicktime - the answers


topherz
21st October 2005, 06:27 AM
Hi all,
I just came across a post on the 0xFF list that is a forward from a post on the Eyecandy list that is a forward from a post on the After Effects list.

Ive always wondered what the difference was between Photo-jpeg compression and Mjpeg compression... and this looks to be the 'straight dope'.

-topher


http://music.columbia.edu/pipermail/0xff/2004-June/000655.html
Contents of post::

Hi all,



I've been trying to clarify the differences between the Quicktime
Photo-JPEG & Motion-JPEG codecs, because they are commonly used amongst
After Effects users but there have been mixed reports about their
relative quality.



I've had some feedback from the Apple Quicktime-talk list, and have
confirmed some details with an Apple Quicktime engineer.



So just for the record, here's some useful and reliable info:



JPEG is a lossy format, and there are 2 main sources of loss when a JPEG
codec is used- firstly there's chroma downsampling and secondly there's
quantisation. There are also some small rounding errors which result
from the overall process but they are negligible.



The most significant piece of information to know is that at 100%
quality, all 3 codecs do not downsample chroma (they work at 4:4:4) and
they do not quantise the resulting data (they use a quantisation table
of
1s). At 100% quality the only losses come from rounding errors and
these are negligible.



In other words, at 100% quality Photo JPEG, MJPEGA & MJPEGB are all
practically lossless.



There are some important differences between the codecs, however.



Both the MJPEG codecs allow fields and a field order to be specified,
and
if used the fields are compressed separately and then combined. This
prevents artifacts from mushing fields together, and at lower quality
settings this can make a significant difference. For this reason alone,
anyone working with interlaced video should use the MJPEG codecs and not
the Photo JPEG codec.



At quality levels below 100%, chroma is downsampled respective to the
quality level selected, but Photo JPEG samples at 4:2:0 (ie. vertical
samples) while the MJPEG codecs sample at 4:2:2 (ie. horizontal
samples).
In terms of video footage, this relates to a fields issue and is another
reason why you should use MJPEG codecs for interlaced footage instead of
Photo JPEG. If your video footage is frames (eg. footage shot on film
and telecined 1:1) then it's less of an issue.



As has been pointed out before, there is no quality difference between
MJPEGA and MJPEGB, they are simply optimized for different hardware
decoders.



In summary- at 100% quality all 3 codecs are practically lossless.
Below
100%, the fact that the MJPEG codecs compress fields separately and
downsample chroma horizontally means they will deliver better quality
results from interlaced footage. Photo JPEG does not compress fields
separately and downsamples chroma vertically, which can lead to field
mush when used with interlaced footage.





Hope you find this information useful, I use the MJPEG codecs a lot and
I'm glad to finally have received some definitive info about them.



Thanks to those who sent me info,





Chris Zwar

Entertainment Media

DFUNC
21st October 2005, 06:57 AM
I've been using MJPEG A all the time. Looks like my intuition was right. :D

Thanks for the input.

trotskythecat
21st October 2005, 09:00 AM
damn. gotta re-do most of my clips from the masters. I'll do a batch and see if I can spot the difference.

many2
21st October 2005, 12:02 PM
thanks for sharing - that was a very useful piece of info.

lowRes
21st October 2005, 02:13 PM
thanx topherz!!

usefull!

btw:: been using mjpeg-B.. in win and mac also.. can?t spot the difference.
can?t find wich hardware is supported by either A or B codec.. anyone knows this??

* )
r_x