[MPlayer-dev-eng] PNG and endianness

Erik Auerswald auerswal at unix-ag.uni-kl.de
Wed Apr 6 10:09:50 CEST 2011


Hi,

On Tue, Apr 05, 2011 at 10:30:32PM +0200, Ingo Brückl wrote:
> I'm not sure whether the question might get lost in mplayer-cvslog, so here
> once more:
> 
>   static void Normalize (txSample *bf)
>   {
>     unsigned long i;
> 
>     for (i = 0; i < bf->ImageSize; i += 4)
>   #if HAVE_BIGENDIAN
>       bf->Image[i] = 0;
>   #else
>       bf->Image[i + 3] = 0;
>   #endif
>   }
> 
> The PNG specification says that all integers that require more than one byte
> shall be in network byte order which is big-endian AFAIK, so there should not
> be such distinction, should it?

So on big endian systems the PNG integers are in native byte order,
for little endian systems they are not. The distinction seems to be
needed. Does it work?

Regards,
Erik
-- 
Ringing telephones (and other symmetric communication lines) are the
bane of focused work.
                        -- René Pfeiffer


More information about the MPlayer-dev-eng mailing list