[FFmpeg-soc] [soc]: r279 - matroska/matroskaenc.c

Michael Niedermayer michaelni at gmx.at
Sat Jul 7 16:00:40 CEST 2007


Hi

On Fri, Jul 06, 2007 at 11:58:01PM -0400, David Conrad wrote:
[...]
> > [...]
> >> +static int ebml_id_size(unsigned int id)
> >> +{
> >> +    if (id >= 0x3fffff)
> >> +        return 4;
> >> +    if (id >= 0x7fff)
> >> +        return 3;
> >> +    if (id >= 0xff)
> >> +        return 2;
> >> +    return 1;
> >
> > maybe this can be done simpler with av_log2()
> 
> I couldn't figure out how to scale the values to get the correct  
> answers :(

(av_log2(id+1)-1)/7+1

untested though

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- 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-soc/attachments/20070707/3f766c4b/attachment.pgp>


More information about the FFmpeg-soc mailing list