[FFmpeg-devel] [PATCH]Basic XSUB encoder (take 5)

Reimar Döffinger Reimar.Doeffinger
Sat Feb 7 15:10:42 CET 2009


On Sat, Feb 07, 2009 at 03:07:34PM +0100, Reimar D?ffinger wrote:
> On Fri, Feb 06, 2009 at 02:59:15AM +0100, Michael Niedermayer wrote:
> > > +/** Encode a single color run. At most 16 bits will be used. */
> > > +static void put_xsub_rle(PutBitContext *pb, int len, int color)
> > > +{
> > > +    if (len <= 255)
> > 
> > > +        put_bits(pb, 2 + ((ff_log2_tab[len] >> 1) << 2), len);
> > 
> > do you really have to access the table directly? cant av_log2() be used?
> 
> Of course, but by reading some other code I came to the conclusion that
> av_log2 should be used for 32 bit, av_log2_16bit for 16 bit values and
> 8 bit values should use ff_log2_tab directly.

Note that ff_log2_tab is part of the public ABI (not API) anyway, since it is used
in common.h, thus direct references to it will be compiled into
applications.




More information about the ffmpeg-devel mailing list