[FFmpeg-cvslog] r11573 - trunk/libavformat/mxf.c

Måns Rullgård mans
Sat Jan 19 22:50:18 CET 2008


Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:

> Hello,
> On Sat, Jan 19, 2008 at 08:22:23PM +0000, M?ns Rullg?rd wrote:
>> Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:
>> > On Sat, Jan 19, 2008 at 09:00:09PM +0100, bcoudurier wrote:
>> >> Author: bcoudurier
>> >> Date: Sat Jan 19 21:00:09 2008
>> >> New Revision: 11573
>> >> 
>> >> Log:
>> >> init uid to 0
>> >> 
>> >> Modified:
>> >>    trunk/libavformat/mxf.c
>> >> 
>> >> Modified: trunk/libavformat/mxf.c
>> >> ==============================================================================
>> >> --- trunk/libavformat/mxf.c	(original)
>> >> +++ trunk/libavformat/mxf.c	Sat Jan 19 21:00:09 2008
>> >> @@ -922,7 +922,7 @@ static int mxf_read_local_tags(MXFContex
>> >>          int tag = get_be16(pb);
>> >>          int size = get_be16(pb); /* KLV specified by 0x53 */
>> >>          uint64_t next = url_ftell(pb) + size;
>> >> -        UID uid;
>> >> +        UID uid = {0};
>> >
>> > I'm quite sure it does not matter here, but note that even for arrays as
>> > small as 16 bytes memset is quite a bit faster than this kind of
>> > initialization, at least with gcc around 3.4
>> 
>> If memset is the fastest way, gcc should know to call it in such
>> situations.  I've seen gcc generate memcpy() calls for struct
>> assignments, so it's certainly something that is reasonable to expect.
>
> Certainly gcc should know, back then it didn't though (I noticed it
> while optimizing libfaad back then).

If recent gcc versions get it right, I see no reason to obfuscate the code.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-cvslog mailing list