[Ffmpeg-devel] [RFC, PATCH] import libswscale

Luca Abeni lucabe72
Wed Mar 22 10:10:55 CET 2006


Hi Michael,

first of all, thanks for the feedback.

On Tue, 2006-03-21 at 20:40 +0100, Michael Niedermayer wrote:
[...]
> > +/* Choose one of the following:
> > +  SWS_FAST_BILINEAR
> > +  SWS_BILINEAR
> > +  SWS_BICUBIC
> > +  SWS_X
> > +  SWS_POINT
> > +  SWS_AREA
> > +  SWS_BICUBLIN
> > +  SWS_GAUSS
> > +  SWS_SINC
> > +  SWS_LANCZOS
> > +  SWS_SPLINE
> > +*/
> > +int sws_flags = SWS_BICUBIC;
> 
> uhm, globals ...
I was not sure about how to make the flags configurable, so I used this
global sws_flags variable. I agree that this is bad, and I'll address
this problem in the next version of the patch.

Is it ok to define an extended version of img_resample_init() (accepting
"flags" as a parameter? If yes, then the SWS_* constants mentioned above
should be moved from swscale.h to libavcodec.h. Is this acceptable?

Otherwise, I can just add a "static const" in front of "sws_flags" until
we find a better solution.

> > +
> > +
> > +int img_convert(AVPicture *dst, int dfmt,
> > +                const AVPicture *src, int sfmt,
> > +                int src_width, int src_height)
> > +{
> > +    int i;
> > +    struct SwsContext *ctx;
> > +    uint8_t *s[3];
> > +    uint8_t *d[3];
> > +    int ss[3], ds[3];
> 
> please use a little bit more descriptive variable names, single letters suck
Opss... Sorry; I'll fix this in the next version of the patch.

> > +    ctx = NULL;
> > +
> > +    ctx = sws_getContext(src_width, src_height, sfmt, src_width, src_height, dfmt, sws_flags, NULL, NULL, NULL);
> 
> setting ctx twice?
Leftover from a previous version... Sorry about that, I'll fix it.

BTW, to compile libswscale in the ffmpeg tree I had to modify some code
in it...
Are you ok with such changes? I am realizing that such changes are
difficult to review by only looking at the .tgz I sent, so I am
attaching a diff showing the changes I introduced in the swscale code.
(I removed the Makefile part from this diff, because the original
Makefile and the new one are completely different)

 
			Thanks,
				Luca
-- 
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Prova GRATIS per 15 giorni! DVDNetRent e ricevi a casa 3 film. Puoi scegliere tra migliaia di titoli
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4632&d=22-3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscaler-integration.diff
Type: text/x-patch
Size: 17357 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060322/a4fc1301/attachment.bin>



More information about the ffmpeg-devel mailing list