[FFmpeg-cvslog] r25112 - trunk/libavutil/pixdesc.c

Måns Rullgård mans
Mon Sep 27 10:08:54 CEST 2010


Michael Niedermayer <michaelni at gmx.at> writes:

> On Mon, Sep 27, 2010 at 12:16:14AM +0200, Stefano Sabatini wrote:
>> On date Sunday 2010-09-26 23:25:40 +0200, Aurelien Jacobs wrote:
>> > On Mon, Sep 13, 2010 at 12:00:45AM +0200, stefano wrote:
>> > > Author: stefano
>> > > Date: Mon Sep 13 00:00:45 2010
>> > > New Revision: 25112
>> > > 
>> > > Log:
>> > > Apply minor simplification in av_read_image_line().
>> > > 
>> > > Modified:
>> > >    trunk/libavutil/pixdesc.c
>> > > 
>> > > Modified: trunk/libavutil/pixdesc.c
>> > > ==============================================================================
>> > > --- trunk/libavutil/pixdesc.c	Sun Sep 12 23:39:57 2010	(r25111)
>> > > +++ trunk/libavutil/pixdesc.c	Mon Sep 13 00:00:45 2010	(r25112)
>> > > @@ -53,12 +53,11 @@ void av_read_image_line(uint16_t *dst, c
>> > >          }
>> > >      } else {
>> > >          const uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1;
>> > > -        int is_8bit = 0;
>> > > +        int is_8bit = shift + depth <= 8;
>> > >  
>> > > -        if (shift + depth <= 8) {
>> > > +        if (is_8bit)
>> > >              p += !!(flags & PIX_FMT_BE);
>> > > -            is_8bit = 1;
>> > > -        }
>> > 
>> > What about removing the if() and simply having:
>> >   p += is_8bit && (flags & PIX_FMT_BE);
>> 
>> Not contrary to it if you prefer it that way.
>
> benchmark it please before changing

I would expect the same or almost the same code to be generated.  A
quick look at the disassembly should confirm.  Any difference is
unlikely to be measurable by benchmarking.

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



More information about the ffmpeg-cvslog mailing list