[MPlayer-dev-eng] RFC [PATCH] mjpa decoder
Togni Roberto
rtogni at bresciaonline.it
Fri Feb 15 17:45:29 CET 2002
Hi all.
Please do not apply this patch: it's a mess and can break other mjpeg
movies.
The attached patch makes mjpa playable. (samples on ftp, I just
uploaded a second sample mjpa2.mov).
Some details on mjpa format can be found at
http://developer.apple.com/techpubs/quicktime/qtdevdocs/QTFF/qtdd-64.html
I had to change output format from YV12 to YUY2, because ffmpeg is
broken when decoding interlaced files to YV12 format (Y is ok, but
colors are not).
By the way, also the strandard mjpeg file BABY VOX... on ftp looks
wrong with YV12 format (look at the orange and blue squares near the
ligths at the beginning of the movie).
I added some code to force field ordering, because the original ffmpeg
code don't get it always right: mjpa files have two fields in each
chunk, top field first, and some other data embedded into JPEG APP1
marker (mostly needed for type B decoding, only default QT and HT are
necessary for type A, but my samples don't use them). Please note that
top field first is just an assumption (got somewhere on the net, now I
can't find out where), the official way to get frame order is by
decoding "fiel" section of mov file. Other sections that have to be
decoded if default tables are used are "mjqt" (quantization tables) and
"mjht" (huffman tables)
Most of the messy stuff in this patch is needed to access a private
structure member (bottom_field) of ffmpeg mjpeg decoder.
Now I have to make a choice: should I try to hack mjpa support into
ffmpeg or write a native Mplayer decoder? If I take this second option,
should I copy and reuse code from ffmpeg or try to call it? Can I patch
libavcodec to export what I need (since libavcodec is not part of
mplayer)?
I'd like to know your opinion about it.
Ciao,
Roberto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: codecs.conf.diff
Type: application/octet-stream
Size: 340 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020215/f4db4220/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dec_video.c.diff
Type: application/octet-stream
Size: 2752 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020215/f4db4220/attachment-0001.obj>
More information about the MPlayer-dev-eng
mailing list