Commit Graph

138 Commits

Author SHA1 Message Date
Michael Niedermayer
91c981857b rgb2rgb_template: add MMX/SSE2/AVX-optimized deinterleaveBytes
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-21 18:03:41 +01:00
Michael Niedermayer
7597e6efe4 swscale/x86/rgb2rgb: add support for AVX
This does not yet include any actual AVX code

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-21 18:01:29 +01:00
Diego Biurrun
46bacb5cc6 x86: Consistently use cpu flag detection macros in places that still miss it 2014-01-14 00:04:58 +01:00
Diego Biurrun
c16bfb147d swscale: x86: Consistently use lowercase function name suffixes 2013-11-22 23:01:51 +01:00
Diego Biurrun
a519583991 swscale: x86: Hide arch-specific initialization details
Also give consistent names to init functions.
2013-08-28 23:59:24 +02:00
Diego Biurrun
2b677ffca5 swscale: Add av_cold attributes to init functions missing them 2013-05-04 22:48:05 +02:00
Diego Biurrun
b6649ab503 cosmetics: Remove unnecessary extern keywords from function declarations 2013-03-27 14:21:45 +01:00
Diego Biurrun
ef5d41a553 x86inc: Rename "program_name" to "private_prefix"
The new name is more descriptive and will allow defining a separate
public prefix for externally visible library symbols.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-01-18 20:29:53 +01:00
Diego Biurrun
87af05c575 x86: SPLATD: port to cpuflags 2012-11-18 18:34:05 +01:00
Diego Biurrun
26301caaa1 x86: mmx2 ---> mmxext in asm constructs 2012-11-14 00:58:51 +01:00
Diego Biurrun
4b60fac419 x86: PALIGNR: port to cpuflags 2012-11-09 21:31:31 +01:00
Diego Biurrun
d8eda37080 x86: mmx2 ---> mmxext in function names 2012-10-31 17:53:57 +01:00
Diego Biurrun
588fafe7f3 x86: MMX2 ---> MMXEXT in macro names 2012-10-31 01:04:55 +01:00
Diego Biurrun
a65bdceb06 x86: mmx2 ---> mmxext in variable names 2012-10-31 00:37:42 +01:00
Diego Biurrun
652f518594 x86: mmx2 ---> mmxext in comments and messages 2012-10-31 00:37:42 +01:00
Diego Biurrun
04581c8c77 x86: yasm: Use complete source path for macro helper %includes
This is more consistent with the way we handle C #includes and
it simplifies the build system.
2012-10-31 00:37:42 +01:00
Diego Biurrun
6860b4081d x86: include x86inc.asm in x86util.asm
This is necessary to allow refactoring some x86util macros with cpuflags.
2012-10-31 00:37:42 +01:00
Anton Khirnov
716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Diego Biurrun
e0c6cce447 x86: Replace checks for CPU extensions and flags by convenience macros
This separates code relying on inline from that relying on external
assembly and fixes instances where the coalesced check was incorrect.
2012-09-08 18:18:34 +02:00
Diego Biurrun
17337f54c0 x86: Split inline and external assembly #ifdefs 2012-08-31 01:53:25 +02:00
Diego Biurrun
a886b279a0 x86: cosmetics: Comment some #endifs for better readability 2012-08-30 18:50:33 +02:00
Giorgio Vazzana
1e6072139b swscale: x86: fix #endif comments in rgb2rgb template file
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-19 21:50:09 +02:00
Mans Rullgard
90540c2d5a x86: swscale: fix fragile memory accesses
To access data at multiple fixed offsets from a base address, this
code uses a single "m" operand and code of the form "32%0", relying on
the memory operand instantiation having no displacement, giving a final
result of the form "32(%rax)".  If the compiler uses a register and
displacement, e.g. "64(%rax)", the end result becomes "3264(%rax)",
which obviously does not work.

Replacing the "m" operands with "r" operands allows safe addition of a
displacement.  In theory, multiple memory operands could use a shared
base register with different index registers, "(%rax,%rbx)", potentially
making more efficient use of registers.  In the cases at hand, no such
sharing is possible since the addresses involved are entirely unrelated.

After this change, the code somewhat rudely accesses memory without
using a corresponding memory operand, which in some cases can lead to
unwanted "optimisations" of surrounding code.  However, the original
code also accesses memory not covered by a memory operand, so this is
not adding any defect not already present.  It is also hightly unlikely
that any such optimisations could be performed here since the memory
locations in questions are not accessed elsewhere in the same functions.

This fixes crashes with suncc.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 14:51:52 +01:00
Mans Rullgard
10b83cb653 x86: swscale: remove disabled code
This code has been disabled since 2003.  Nobody will ever look at
it again.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 14:51:52 +01:00
Mans Rullgard
c318626ce2 x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h
This puts x86-specific things in the x86/ subdirectory where they
belong.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 00:58:20 +01:00
Diego Biurrun
239fdf1b4a x86: build: replace mmx2 by mmxext
Refactoring mmx2/mmxext YASM code with cpuflags will force renames.
So switching to a consistent naming scheme beforehand is sensible.
The name "mmxext" is more official and widespread and also the name
of the CPU flag, as reported e.g. by the Linux kernel.
2012-08-03 22:51:05 +02:00
Diego Biurrun
5a6e3c039c swscale: Mark all init functions as av_cold 2012-07-23 01:30:05 +02:00
Diego Biurrun
16d2a1a51c swscale: x86: Drop pointless _mmx suffix from filenames
The files do not contain only MMX code.
2012-07-23 01:30:04 +02:00
Ronald S. Bultje
b2668c85e9 x86: swscale: Place inline assembly code under appropriate #ifdefs
Fixes compilation for compilers that do not support gcc inline assembly.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-07-21 22:22:58 +02:00
Martin Storsjö
557519189f swscale: yuv2planeX 8bit >=sse2 functions need aligned stack on x86-32.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-07-04 08:25:57 -07:00
Diego Biurrun
baaab6069a build: Move all arch OBJS declarations into arch subdirectory Makefiles. 2012-04-12 21:30:13 +02:00
Henrik Gramner
729f90e268 x86inc improvements for 64-bit
Add support for all x86-64 registers
Prefer caller-saved register over callee-saved on WIN64
Support up to 15 function arguments

Also (by Ronald S. Bultje)
Fix up our asm to work with new x86inc.asm.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-11 15:47:00 -04:00
Ronald S. Bultje
45fdcc8e2d swscale: convert hscale() to use named arguments. 2012-03-14 20:09:53 -07:00
Ronald S. Bultje
aba7a827aa swscale: convert hscale to cpuflags(). 2012-03-14 20:09:53 -07:00
Ronald S. Bultje
2254b559cb swscale: make filterPos 32bit.
Fixes overflows for large image sizes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-06 10:47:41 -08:00
Ronald S. Bultje
dccb2cd3f9 swscale: make %rep unconditional.
Fixes pre-processing with latest versions of nasm.
2012-03-03 20:40:00 -08:00
Ronald S. Bultje
8249a23fc1 swscale: remove now unnecessary hack. 2012-03-03 20:39:59 -08:00
Ronald S. Bultje
1d8c4af396 swscale: take first/lastline over/underflows into account for MMX.
Fixes crashes for extremely large resizes (several 100-fold).

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-23 10:30:08 -08:00
Ronald S. Bultje
b18f8cbf3d Revert two swscale commits.
Revert "swscale: update context offsets after removal of AlpMmxFilter."
(commit a95e3fa90b)
and
Revert "swscale: Remove some write-only variables related to alpha handling."
(commit 9d03cb9fc5).

They broke alpha handling - it's the evil inline asm that still uses that
variable, so it's not truely write-only.
2012-02-19 13:31:12 -08:00
Ronald S. Bultje
1bab6f852c swscale: make access to filter data conditional on filter type.
Prevents crashes on 1-tap filter (unscaled). Also rename "bguf" argument
to "vbuf", seems that was a typo.
2012-02-17 10:31:15 -08:00
Ronald S. Bultje
a95e3fa90b swscale: update context offsets after removal of AlpMmxFilter. 2012-02-17 10:31:15 -08:00
Diego Biurrun
9d03cb9fc5 swscale: Remove some write-only variables related to alpha handling. 2012-02-14 10:12:43 +01:00
Ronald S. Bultje
771bab7f57 swscale: fix crashes in yuv2yuvX on x86-32.
They were introduced in an earlier commit that introduced use of named
arguments. One cause was a typo, a second cause appears to be a bug in
x264asm that I work around by not using named arguments.
2012-02-13 13:41:13 -08:00
Ronald S. Bultje
3e23badd83 swscale: convert yuv2yuvX() to using named arguments. 2012-02-12 08:27:51 -08:00
Ronald S. Bultje
8c433d8a03 swscale: rename "dstw" to "w" to prevent name collisions.
"dstw" can collide with the word-version of the "dst" argument, causing
all kind of weird stuff down the pipe.
2012-02-12 08:27:50 -08:00
Ronald S. Bultje
ef66a0ed2e swscale: use named registers in yuv2yuv1_plane() place.
Most of the function had been converted before, but I forgot this
particular location.
2012-02-12 08:27:50 -08:00
Ronald S. Bultje
783487ae44 swscale: sign-extend integer function argument to qword on x86-64. 2012-02-08 10:31:14 -08:00
Ronald S. Bultje
ef1c785f11 swscale: make yuv2yuv1 use named registers. 2012-02-07 11:38:13 -08:00
Ronald S. Bultje
b7542dd3d7 swscale: fix V plane memory location in bilinear/unscaled RGB/YUYV case.
Fixes bug 221.

CC: libav-stable@libav.org
2012-02-07 11:33:20 -08:00
Ronald S. Bultje
7e4d9d5d45 win64: add a XMM clobber test configure option.
This will be useful to test more aggressively for failures to mark XMM
registers as clobbered in Win64 builds, and prevent regressions thereof.

Based on a patch by Ramiro Polla <ramiro.polla@gmail.com>
2012-02-02 12:00:48 -08:00