[Ffmpeg-devel] [PATCH] Allowing (k,M,G and B) unit postfixes

Måns Rullgård mru
Thu Sep 14 00:46:24 CEST 2006


Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
>
> On Wed, Sep 13, 2006 at 01:52:26PM +0200, Panagiotis Issaris wrote:
>> Hi,
>> 
>> The attached patch allows parameter values (AVOptions) to use the
>> 'k', 'M', 'G' and 'B' postfixes. Specifying '700k' would mean 700
>> kbits, while '700kB' would mean 700 kbytes. This eases using the
>> -bit_rate parameter which uses bits as its unit. I've used the SI
>> units, keeping the case intact. If someone prefers all lowercase
>> postfixes, similar to the option names, I can ofcourse adapt this.
>> 
>> Furthermore, I've used the SI unit values, k==1000 and not
>> k==1024. I wasn't sure about this, as I thought for networking and
>> bitrates that was a good idea, but for storage sizes, I think the
>> Ki==1024 ("kibi") units are also being used.
>
> iam a little unsure about the upper/lowwer case and kibibit (every
> time i read about these gigibit units i somehow want to vomit ...)
>
> maybe we could have lowwer case for one and upper case for the other
> or we just follow all the standard comitees and add kiB, MiB and GiB
> after all using k to mean 2 things is just wrong and theres no real
> standard which say k=1024 ...

In the context of bitrates, k=1000 etc is the standard way.  The >1 SI
prefixes are all uppercase, except for 'k'.  The <1 prefixes are
lowercase.  Since the "small" prefixes don't make sense here,
supporting both cases could be useful.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list