[FFmpeg-cvslog] r18985 - trunk/libavcodec/lcldec.c
Reimar Döffinger
Reimar.Doeffinger
Sat May 30 12:33:56 CEST 2009
On Sat, May 30, 2009 at 01:20:35AM +0200, Aurelien Jacobs wrote:
> On Fri, May 29, 2009 at 10:15:38PM +0200, reimar wrote:
> > Author: reimar
> > Date: Fri May 29 22:15:38 2009
> > New Revision: 18985
> >
> > Log:
> > Use av_clip_uint8 instead of equivalent but unoptimzed code,
> >
> > Modified:
> > trunk/libavcodec/lcldec.c
> >
> > Modified: trunk/libavcodec/lcldec.c
> > ==============================================================================
> > --- trunk/libavcodec/lcldec.c Fri May 29 15:46:46 2009 (r18984)
> > +++ trunk/libavcodec/lcldec.c Fri May 29 22:15:38 2009 (r18985)
> > @@ -81,11 +81,7 @@ static inline unsigned char fix (int pix
> > int tmp;
> >
> > tmp = (pix14 + 0x80000) >> 20;
> > - if (tmp < 0)
> > - return 0;
> > - if (tmp > 255)
> > - return 255;
> > - return tmp;
> > + return av_clip_uint8(tmp);
> > }
>
> Now the tmp variable looks pretty much useless...
I wish that was the only issue. The only thing the whole code does is to
very inefficiently in *.20 fixed-point do the YUV->RGB conversion which
shouldn't be done in the decoder in the first place.
And yes, the coefficients are within 1% of those in the second formula
in MPlayer's DOCS/tech/colorspaces.txt, so it is completely ordinary
YUV, unlike for some other formats.
Only issue is that it uses a packed format not supported by FFmpeg, so
it should probably be converted into planar YUV.
More information about the ffmpeg-cvslog
mailing list