[FFmpeg-devel] [PATCH] Handle metadata in oma demuxer

Michael Karcher ffmpeg
Wed Jun 2 09:58:45 CEST 2010


Am Mittwoch, den 02.06.2010, 03:04 +0200 schrieb Michael Niedermayer:
> > So like in the new attached patch?
> > I decided to use a two-member struct because that allows pass-by-value,
> > without having to think about endianness (which I would have to do if I
> > pass as an int).
> does thinking about that hurt? ;)
If I pass the two bytes in an int, the bytes are in wrong order either
on little- or on big-endian machines. I supposed the performance to be a
bit better if the bytes are always in the right order. I expected gcc to
emit a 16-bit compare instruction, which it (looking at the assembly)
didn't do.

> we have AV_RL/B16 macros that shoul make this quite easy
I tried to be more tricky. I'm using AV_RN16 to get the two bytes from
the stream in machine byte order (in the expectation that this is faster
than forcing little- or big-endian) and le2me_16('I' | ('D' << 8)) to
create the ID constant in machine byte order. This really gets a 16-bit
compare instruction on x86_64, and I hope on many other architecture,
too.

Regards,
  Michael Karcher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oma_id.diff
Type: text/x-patch
Size: 9069 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100602/b23c19d6/attachment.bin>



More information about the ffmpeg-devel mailing list