[FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer
Michael Niedermayer
michael at niedermayer.cc
Mon Mar 20 01:32:48 EET 2017
On Sun, Mar 19, 2017 at 10:37:30PM +0100, Clément Bœsch wrote:
> On Sun, Mar 19, 2017 at 10:13:37PM +0100, Michael Niedermayer wrote:
> [...]
> > > > > +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
> > > > > +{
> > > > > + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> > > > > + av_assert0(desc);
> > > > > + return !strncmp(desc->name, "bayer_", 6);
> > > >
> > > > iam not sure strncmp() is a good idea speed wise
> > > >
> > >
> > > In a non-bayer case, the function will return in the worst case after the
> > > 2nd character, I have high doubt about this being a speed issue. We can
> > > introduce a flag for this, but I don't think it's worth.
> >
> > i think needing to call libc is a bit ugly here
> >
>
> It's already how we do it in libavutil/pixdesc.c.
>
> But anyway, how about the 2 attached patches?
they look nice
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170320/b6e01ba6/attachment.sig>
More information about the ffmpeg-devel
mailing list