[MPlayer-dev-eng] RFC [PATCH] mjpa decoder
Arpi
arpi at thot.banki.hu
Sat Feb 16 07:25:21 CET 2002
Hi,
> Please do not apply this patch: it's a mess and can break other mjpeg
> movies.
is see
> 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).
known problem... mplayer needs to know colorspace _before_ decoding teh
first frame, but in case of ffmpeg mjpeg decoder, it's not known...
i'm working on this nowdays.
> 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)
you should add these to the qt demuxer.
> Most of the messy stuff in this patch is needed to access a private
> structure member (bottom_field) of ffmpeg mjpeg decoder.
i see.
> 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.
ok. do NOT copy parts of libavcodec.
as you need to set field only, i suggest changing libavcodec (i can commit
trivial patches there) to make field number common (so move it from priv to
codec_context). so it would be accessible from dec_video without any mess.
A'rpi / Astral & ESP-team
--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
More information about the MPlayer-dev-eng
mailing list