[FFmpeg-devel] [PATCH] pixdesc: use 8-bit accesses when possible in av_read/write_image_line()

Stefano Sabatini stefano.sabatini-lala
Sun Sep 12 23:54:45 CEST 2010


On date Sunday 2010-09-12 22:34:22 +0100, M?ns Rullg?rd encoded:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
[...]
> >> I don't like putting conditional things in tight loops.  GCC has a
> >> nasty habit of not optimising it properly.  In this case it also makes
> >> the whole thing look more convoluted than it really is.  The code can
> >> be reduced a little though:
> >> 
> >>             while (w--) {
> >>                 int val = (*p>>shift) & mask;
> >>                 if (read_pal_component)
> >>                     val = data[1][4*val + c];
> >>                 p += step;
> >>                 *dst++ = val;
> >>             }
> >> 
> >> Besides, I don't think a couple of duplicated lines are anything to
> >> fret over.
> >
> > I still prefer the version with less lines of code as I found it more
> > readable,
> 
> And I find it more difficult to understand at a glance, but have it
> your way.  Is the write function OK?

Yes, thanks.
-- 
FFmpeg = Fanciful Faithless Minimal Pitiless Extended Gadget



More information about the ffmpeg-devel mailing list