[Ffmpeg-devel] PUT_UTF8 & asf format enhancement

Zuxy Meng zuxy.meng
Mon Nov 6 12:21:48 CET 2006


Hi,

2006/11/6, Guillaume Poirier <gpoirier at mplayerhq.hu>:
> Hi,
>
> Does this seem right?

Err...not exactly, I'm afraid.

>
> /*!
>  * \def GET_UTF8(val, GET_BYTE, ERROR)
>  * converts a utf-8 to its 32-bit unicode character encoded form (up
> to 6 bytes long).

Should be 'converts a utf-8 character (up to 4 bytes long) to its
32-bit ucs-4 encoded form'

Sorry but a utf-8 character can't be longer than 4 bytes (not 6
bytes), pls correct this for PUT_UTF8 too.

>  * \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.

val is the output and should be of type uint32_t. It holds the
converted ucs-4 character and should be a left value.

>  * \param GET_BYTE writes the converted 32-bit bytes to any proper
> destination.
>  * It could be a function or a statement

GET_BYTE gets utf-8 encoded bytes from any proper source. It could be
a function or a statement whose return value or evaluated value is of
type uint8_t. It will be execuded up to 4 times.

Again, pls change 6-byte to 4-byte for PUT_BYTE.

>  * \param ERROR ?
>  */

Action that should be taken when an invalid utf-8 byte is returned
from GET_BYTE. It should be a statement that jumps out of the macro,
like exit(), goto, return, break, or continue.

>
> Please check types and please tell me what's the purpose of ERROR :-)

-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6




More information about the ffmpeg-devel mailing list