Hi, On Mon, Apr 11, 2011 at 4:01 PM, Luca Barbato <[email protected]> wrote: > The swscale_template is split among ppc and x86, lots of code is > still duplicated and should be removed later. > > Again uniform the init system to be more similar to the dsputil one > > Unset h*scale_fast in the x86 init in order to make the output > consistent with the previous status. Thanks to Josh for spotting it. > --- > libswscale/ppc/swscale_template.c | 903 +++++++++++ > libswscale/swscale.c | 25 +- > libswscale/swscale_template.c | 2324 +---------------------------- > libswscale/x86/swscale_template.c | 2983 > +++++++++++++++++++++++++++++++++++++ > 4 files changed, 3961 insertions(+), 2274 deletions(-) > create mode 100644 libswscale/ppc/swscale_template.c > create mode 100644 libswscale/x86/swscale_template.c
This one can use a lot more cleanup. Big ones: in x86/swscale_template.c, there's a bunch of #if COMPILE_TEMPLATE_MMX. They are unnecessary, all of 3dnow/mmx/mmx2 set COMPILE_TEMPLATE_MMX, and thus the check (+#else code) can be removed. Minor ones, which you can skip until after the initial patch is applied: - the ppc code has a lot of C code in there also. Have you confirmed that all C code is in fact required? Is there dead code in there? If so, can we figure out which and kill it? - several ppc (and possibly also x86) functions are prefixed with _mmx, _mmx2, _3dnow or _altivec but in fact don't use any mmx2 (only mmx) or even mmx/altivec (only C) instructions. Ideally, the init system would be more like dsputil, where for these functions, we don't duplicate two _c variants (one called _c, one called _altivec/_mmx) and then inline everything, but instead we detect that and call the _c version directly, or call a function pointer that is dynamically assigned. This is complex because swscale isn't as smart as dsputil so you can do this later. Is autodetection of cpuflags working? ffmpeg had a patch and I don't think we have it yet. If we integrate this, we should also have cpuflag autodetection working so we can auto-enable that (at least for x86). Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
