[FFmpeg-devel] [PATCH] provide AV_BASE64_SIZE() macro

Michael Niedermayer michaelni
Fri Jun 4 02:54:21 CEST 2010


On Thu, Jun 03, 2010 at 05:47:05PM -0700, Howard Chu wrote:
> M?ns Rullg?rd wrote:
>> Michael Niedermayer<michaelni at gmx.at>  writes:
>>
>>> On Thu, Jun 03, 2010 at 11:00:49PM +0100, M?ns Rullg?rd wrote:
>>>> Michael Niedermayer<michaelni at gmx.at>  writes:
>>>>
>>>>> On Thu, Jun 03, 2010 at 10:39:52PM +0100, M?ns Rullg?rd wrote:
>>>>>> Michael Niedermayer<michaelni at gmx.at>  writes:
>>>>>>
>>>>>>> On Thu, Jun 03, 2010 at 01:50:06PM -0700, Howard Chu wrote:
>>>>>>>> Just for convenience...
>>>>>>>
>>>>>>> IMHO this is making the code harder to understand
>>>>>>
>>>>>> How so?  It's an obscure calculation repeated multiple times.  That is
>>>>>> exactly the kind of situation functions and macros were invented for.
>>>>>
>>>>> to me the calculation is clear,
>>>>
>>>> Because you happen to know exactly how base64 encoding works.  This is
>>>> IMO not a reasonable requirement to place on users of the interface.
>>>
>>> its documented though, and i think its reasonable to expect users
>>> to read the dox of what they use.
>>
>> By extension, one could argue that the base64 encoding is documented,
>> wherefore we don't need to provide a function for it.
>>
>> I think a macro like this is good for the same reasons we have FFMAX
>> and similar macros.
>>
>>>> Besides, the same rather complex calculation repeated numerous times
>>>> is a recipe for trouble.  Sooner or later, someone will get it wrong
>>>> in one place.  Then people will copy it from there, and the error will
>>>> spread.  It's much better to put it all in a macro.
>>>
>>> i dont really see this as a big issue but if people prefer then iam not
>>> against the macro
>
> So, OK to commit, with the fixed comment?
>
> +/**
> + * Calculate the output size needed to base64-encode x bytes.
> + */

ok if it makes people happy

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100604/ce2c0b52/attachment.pgp>



More information about the ffmpeg-devel mailing list