[MPlayer-dev-eng] Fwd: [MPlayer-users] Work done twice: problems in libswscale assembly optimization codes

Michael Niedermayer michaelni at gmx.at
Fri Jan 19 01:03:49 CET 2007


Hi

On Thu, Jan 18, 2007 at 11:10:52PM +0100, Guillaume POIRIER wrote:
> The below message is more appropriate in this mailing list, so I'm
> forwarding it here...
> 
> ---------- Forwarded message ----------
> From: Netex <netex at 163.com>
> Date: Jan 5, 2007 10:04 AM
> Subject: [MPlayer-users] Work done twice: problems in libswscale
> assembly optimization codes
> To: "MPlayer usage questions, feature requests,  bug reports"
> <mplayer-users at mplayerhq.hu>
> 
> 
> Hi,
> 
> Today I read libswscale codes and found there are problems in #ifdef's
> branching. See the code:
> 
> static inline void RENAME(rgb32to24)(const uint8_t *src,uint8_t
> *dst,long src_size)
> {
>  uint8_t *dest = dst;
>  const uint8_t *s = src;
>  const uint8_t *end;
> #ifdef HAVE_MMX
>  const uint8_t *mm_end;
> #endif
>  end = s + src_size;
> #ifdef HAVE_MMX
>  // ...MMX Codes...
> #endif
>  while(s < end)
>  {
> #ifdef WORDS_BIGENDIAN
>    /* RGB32 (= A,B,G,R) -> RGB24 (= R,G,B) */
>    s++;
>    dest[2] = *s++;
>    dest[1] = *s++;
>    dest[0] = *s++;
>    dest += 3;
> #else
>    *dest++ = *s++;
>    *dest++ = *s++;
>    *dest++ = *s++;
>    s++;
> #endif
>  }
> }
[...]
> So the work are done *TWICE*. Am I too stupid?

the mmx code only works with 8 pixels at a time if they number is not
a multiple of 8 then the remaining 1-7 are converted in the c code

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070119/cd177ece/attachment.pgp>


More information about the MPlayer-dev-eng mailing list