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

Luca Abeni lucabe72
Tue Mar 21 12:17:23 CET 2006

Hi all,

Here is a first candidate for importing swscale in the ffmpeg tree.

Get ffmpeg from CVS, apply my cropping/padding/rescaling patchset, untar
the attached libswscale.tgz into the ffmpeg directory, and apply the
attached sws-internal.diff.
Then, you can configure with "--enable-swscaler --enable-gpl"
As usual, I did some tests with rescaling, cropping, padding, and pixel
format conversion, and everything seems to work.

Some notes/questions:
1) The conversion between ffmpeg pixel format names and sws pixel format
names is now done in swscale.c:sws_getContext(). I remember Michael
suggesting to do the conversion in remove_dup_fourcc(), but this does
not work (because origSrcFormat would remain in "ffmpeg style", but it
is later used by sws_orderYUV()). So, I did the conversion before
calling remove_dup_fourcc().
This implies that the interface of sws_getContext() changes (it now
wants ffmpeg pixel format names). Is this ok?

2) Which interface do we want to use for libswscale? I think we should
access it through ffmpeg's "img_resample*()" and similar functions (this
implies that swscale.h will become a private header). Is this ok?

3) The license is still GPL. As soon as libswscale will be in CVS, I'll
start address the license issues. For the moment, swscale is not enabled
by default, and if it is not enabled the "old" rescaling routines are

4) There still are many details that should be improved, but I think the
important thing is to import libswscale in CVS in a short time.
After that, things can be fixed/improved with small incremental patches.
For example, right now libswscale depends on libavcodec (for av_malloc,
av_free, av_log, and similar), but libavcodec depends on libswscale for
rescaling images. I do not like this kind of "loop dependencies", so
maybe swscale_glue.c should be moved to libswscale. But I think this can
be done in a second time.
Is this acceptable?

Comments are welcome. If you think I did something in the wrong way, let
me know and I'll try to redo this work properly.

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
 Volo Lisbona A/R con Opodo da 193? tutto incluso! 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4936&d=21-3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libswscale.tgz
Type: application/x-compressed-tar
Size: 72665 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060321/712f41b8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-internal.diff
Type: text/x-patch
Size: 10594 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060321/712f41b8/attachment-0001.bin>

More information about the ffmpeg-devel mailing list