[FFmpeg-devel] [PATCH] [RFC] Second try at pixdesc.h:write_line()

Michael Niedermayer michaelni
Sat Apr 18 19:00:45 CEST 2009


On Sat, Apr 18, 2009 at 04:59:21PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2009-04-14 15:10:58 +0200, Michael Niedermayer encoded:
> > On Tue, Apr 14, 2009 at 02:44:53PM +0200, Stefano Sabatini wrote:
> [...]
> > anyway as you seem to be confused:
> > for(){
> >     *buf |= *pixel++ << s;
> >     s-= C;
> >     buf -= s>>8;
> >     s&=7;
> > }
> > 
> > is one of many startpoints
> 
> In attachment a new try, unfortunately this is rather slow with the
> only case I can try (that is monowhite/monoblack), maybe Michael or
> someone else may suggest a better approach.
[...]
> +        while (w--) {
> +            uint32_t *p1 = (uint32_t *)p;
> +            int shift = 32 - depth - skip;
> +            *p1 &= be2me_32(~mask << shift);
> +            *p1 |= be2me_32(*src++ << shift);
> +            skip += step;
> +            p+= skip >> 3;
> +            skip &= 7;
> +        }

let me simply ask why you added all that crap?
here is my suggestion again:

> > for(){
> >     *buf |= *pixel++ << s;
> >     s-= C;
> >     buf -= s>>8;
> >     s&=7;
> > }


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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- 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/20090418/775e71f6/attachment.pgp>



More information about the ffmpeg-devel mailing list