[FFmpeg-devel] [PATCH]Fix Pegasus lossless JPEG

Michael Niedermayer michaelni
Mon Oct 12 01:36:56 CEST 2009


On Sun, Oct 11, 2009 at 10:27:33PM +0200, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached patch fixes issue 1466 and miss_congeniality_pegasus_ljpg.avi on 
> samples.
>
> Please comment, Carl Eugen

>  mjpegdec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 2c5ad68907623e2680e2deeee5d991b51ad85469  patchmjpeg.diff
> Index: libavcodec/mjpegdec.c
> ===================================================================
> --- libavcodec/mjpegdec.c	(revision 20202)
> +++ libavcodec/mjpegdec.c	(working copy)
> @@ -298,7 +298,7 @@
>      switch(pix_fmt_id){
>      case 0x11111100:
>          if(s->rgb){
> -            s->avctx->pix_fmt = PIX_FMT_RGB32;
> +            s->avctx->pix_fmt = s->avctx->codec_tag == MKTAG('J', 'P', 'G', 'L') ? PIX_FMT_BGR32 : PIX_FMT_RGB32;

this looks wrong (both original & new code), have you tested this on
little & big endian?
and checked the file is decoded losslessly?

also pegasus should have a header (see below  if (id == AV_RL32("LJIF")){)
that would be better to be used than codec_tag

(note ive not looked at the actual ljpeg file, so i might be missing some
 things)

[..]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091012/8f1158a3/attachment.pgp>



More information about the ffmpeg-devel mailing list