[MPlayer-dev-eng] Fw: Re: [Ffmpeg-devel] bug in mjpeg.c

Colin Leroy colin at colino.net
Thu Oct 31 11:30:16 CET 2002


Hi,

The message forwarded below made me think of something about vidix on be
architecture where we have
define INREG le2me_32(GETREG(...))

Wouldn't it be better to do the GETREG only once, like in the attached
patch ?

Tell me if it's ok, should i commit or what should i modify, or if it
sucks and we don't care because it's useless.

-- 
Colin

--- Begin forwarded message:
 Date: Thu, 31 Oct 2002 11:48:04 +0100
 From: Alex Beregszaszi <alex at naxine.org>
 To: ffmpeg-devel at lists.sourceforge.net
 Subject: Re: [Ffmpeg-devel] bug in mjpeg.c
 
 Hi,

> I tried reading transcoding a mjpeg file, but it doesn't work
> I found out the following line causes the problem in libavcodec\mjpeg.c
> function mjpeg_decode_app line 1090
> 
> id = be2me_32((get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16));
> 
> This causes lines actually executes 8 times get_bits() instead of 2 time
> This is because the macro be2me_32 is defined (in bswap.h) as  #define
> be2me_32(x) bswap_32(x)
> and bswap_32(x) is defined as
> #define bswap_32(x) \
>      ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) | \
>       (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
thank you for the report, fixed.

-- 
Alex Beregszaszi  <alex at naxine.org>
--- End forwarded message
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mach64_vid.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20021031/d76ecbcb/attachment.txt>


More information about the MPlayer-dev-eng mailing list