[Ffmpeg-devel] [PATCH] Allowing (k,M,G and B) unit postfixes
Thu Sep 14 00:46:24 CEST 2006
Michael Niedermayer <michaelni at gmx.at> writes:
> On Wed, Sep 13, 2006 at 01:52:26PM +0200, Panagiotis Issaris wrote:
>> 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.
mru at inprovide.com
More information about the ffmpeg-devel