[FFmpeg-devel] [PATCH] Split utils.c out of swscale.c.

Ramiro Polla ramiro.polla
Tue Jan 19 14:32:18 CET 2010


Hi,

Currently swscale.c has most of the swscaler code, including init
code, some helper functions, some vector-related code, and the main
scaler path itself (with swscale_template.c).

Attached patch (needs "svn cp swscale.c utils.c" first) splits helper
functions and init code to utils.c.

A few remarks:
- COMPILE_ALTIVEC and COMPILE_MMX2 in utils.c have been replaced by
their definition from swscale.c.
- ff_hardcodedcpuflags() has been created from and left in swscale.c
because the logic that defines COMPILE_TEMPLATE_xxx is there. Same
reason also applies to the function below.
- ff_get_unscaled_swscale() has been created from and left in
swscale.c so it stays on the same source file as the Wrapper functions
it references. It should be changed afterwards to, instead of setting
c->swScale, return the function pointer. I left it as-is to minimize
this diff.
- The license header has been left the same in utils.c because there
is still MMX2 code there, this should be the last GPL code. When it's
moved to another file, the license should be changed to LGPL.
- The #includes haven't been changed much, I haven't gone in depth to
see which ones become unused.

Regression tests and swscale-example (ignoring the tests that returns
random results) pass with and without runtime-cpudetect on x86, and
also on ppc.

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale_split.diff
Type: text/x-diff
Size: 135395 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100119/f593c15e/attachment.diff>



More information about the ffmpeg-devel mailing list