[FFmpeg-devel] zlib decoder

Michael Niedermayer michaelni
Fri Jul 6 13:39:29 CEST 2007


Hi

On Fri, Jul 06, 2007 at 12:04:28AM +0100, M?ns Rullg?rd wrote:
> M?ns Rullg?rd <mans at mansr.com> writes:
> 
> > static inline unsigned int
> > rev_bits16(unsigned int v, unsigned int nb)
> > {
> >     unsigned int r;
> >
> >     if (nb <= 8)
> >         return ff_reverse[v] >> (8 - nb);
> >
> >     r = ff_reverse[v & 255] << 8;
> >     r |= ff_reverse[v >> 8];
> >     return r >> (16 - nb);
> > }
> 
> This is generic enough that it should perhaps be added somewhere more
> centrally.  If so, where?

hmm, is there anything else which needs it?

also if its not speed critical then the if (nb <= 8) special case could
be droped

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/ffmpeg-devel/attachments/20070706/b46b8a36/attachment.pgp>



More information about the ffmpeg-devel mailing list