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

Michael Niedermayer michaelni
Sat Jun 5 00:51:33 CEST 2010


On Wed, Jun 02, 2010 at 06:06:48PM +0200, Michael Karcher wrote:
> Am Mittwoch, den 02.06.2010, 17:55 +0200 schrieb Aurelien Jacobs:
> > Huh... Just pass this as a string, this is simpler and more readable:
> > static const char *id3v2_ea3_magic "ea";
> > 
> > [...]
> > 
> > ff_id3v2_match(buf, id3v2_ea3_magic);
> > 
> > [...]
> > 
> > int ff_id3v2_match(const uint8_t *buf, char *magic)
> > {
> >     return  buf[0]         == magic[0] &&
> >             buf[1]         == magic[1] &&
> >             buf[2]         ==  '3' &&
> > [...]
> 
> This adds another layer of indirection, as instead of "ea", the
> *address* of "ea" is passed. I was essentially trying to avoid that.
> Also the memory access to magic[0] and magic[1] very likely will be a
> cache miss.
> 
> As it is "cold" code, performance probably isn't that critical, but as
> ffmpeg people seem to be very strict on performance, I tried to get the
> maximum out of it.

do you want to help optimizing h264?
it would be quite welcome (seriously)

for this here i think that more understandable code is better than
the lowest instruction count

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- 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/20100605/cc062e66/attachment.pgp>



More information about the ffmpeg-devel mailing list