[Ffmpeg-devel] PUT_UTF8 & asf format enhancement
Guillaume Poirier
gpoirier
Mon Nov 6 11:48:13 CET 2006
Hi,
Zuxy Meng wrote:
> Hi,
>
> 2006/11/6, Guillaume Poirier <gpoirier at mplayerhq.hu>:
>
>> Hi,
>>
>> Off course :)
>>
>> Now it works. Could you maybe add some doxy comments before PUT_UTF8
>> macro?
>> You can also just list what each argument val, tmp, PUT_BYTE means and
>> I'll add the documentation before committing it.
>
>
> PUT_UTF8 is a macro that converts a 32-bit unicode character to its
> utf-8 encoded form (up to 6 bytes long).
>
> val is an input only argument and should be of type uint32_t. It holds
> a ucs4 encoded unicode character that is to be converted to utf-8. If
> val is given as a function it's executed only once.
>
> tmp is a temporary variable and should be of type uint8_t. It
> represents an intermediate value during conversion that is to be
> outputted by PUT_BYTE.
>
> PUT_BYTE writes the converted utf-8 bytes to any proper destination.
> It could be a function or a statement, and uses tmp as the input byte.
> For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
> executed up to 6 times, depending on the length of the converted
> unicode character.
Ok, patch applied.
> You may add docs for GET_UTF8, too; it's similar to PUT_UTF8, only
> simpler :-)
>
Does this seem right?
/*!
* \def GET_UTF8(val, GET_BYTE, ERROR)
* converts a utf-8 to its 32-bit unicode character encoded form (up
to 6 bytes long).
* \param val is an input only argument and should be of type
uint16_t. It holds a utf-8 encoded unicode character that is to be
converted to ucs4. If val is given as a function it's executed only once.
* \param GET_BYTE writes the converted 32-bit bytes to any proper
destination.
* It could be a function or a statement
* \param ERROR ?
*/
Please check types and please tell me what's the purpose of ERROR :-)
Guillaume
More information about the ffmpeg-devel
mailing list