[FFmpeg-soc] [soc]: r279 - matroska/matroskaenc.c
David Conrad
umovimus at gmail.com
Sat Jul 14 00:00:03 CEST 2007
On Jul 7, 2007, at 10:00 AM, Michael Niedermayer wrote:
> 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
That works perfectly, thanks.
More information about the FFmpeg-soc
mailing list