Commit Graph

1158 Commits

Author SHA1 Message Date
Diego Biurrun b6649ab503 cosmetics: Remove unnecessary extern keywords from function declarations 2013-03-27 14:21:45 +01:00
Anton Khirnov 542b83fc90 Replace some forgotten instances of PIX_FMT_* with AV_PIX_FMT_*. 2013-03-08 07:42:09 +01:00
Derek Buitenhuis 57c4c25596 swscale: Add support for unscaled 8-bit Packed RGB -> Planar RGB
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-27 09:46:39 -05:00
Martin Storsjö d192ac3e03 swscale: Disallow conversion to GBRP16
This reverts parts of d6d5ef5534, that didn't work right. (The
tests that were added failed on big endian, and the output looked
garbled on little endian as well.)

This is due to the fact that the intermediate scaling values (from
e.g. hScale8To19_c or hScale16To19_c) are stored as int32_t and
thus requires a separate output function, while yuv2gbrp_full_X_c
only interprets it as int16_t.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-11 20:03:16 +02:00
Michael Niedermayer 813784a8bf sws: disable yuv2rgb warning for planar rgb.
planar rgb formats do not use the table

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-09 14:32:50 -05:00
Michael Niedermayer 7b41c24c5f sws: dont enable chrSrcHSubSample for planar RGB
This code path is not implemented and makes not much sense to implement
either.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-09 14:31:53 -05:00
Michael Niedermayer e58013dd8f sws: use planarRgbToRgbWrapper only for 8bit per component
The function doesnt support >8bit currently

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-09 14:31:53 -05:00
Michael Niedermayer d6d5ef5534 sws: GBRP9, GBRP10, and GBRP16 output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-09 14:31:11 -05:00
Michael Niedermayer 4eb93bed4e swscale: GBRP output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-01-27 15:28:07 -05: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
Xi Wang f73f76fd20 swscale: fix NULL checking in sws_alloc_context()
sws_getCachedContext() and sws_getContext() expect sws_alloc_context()
to return NULL when out of memory, as follows.

    if (!(context = sws_alloc_context()))
        return NULL;

This patch fixes sws_alloc_context() to return NULL in that case.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-01-04 20:44:00 -05:00
Diego Biurrun 511cf612ac miscellaneous typo fixes 2012-12-21 00:18:34 +01:00
Diego Biurrun 87af05c575 x86: SPLATD: port to cpuflags 2012-11-18 18:34:05 +01:00
Janne Grunau 80716953c2 libswscale: remove unnecessary direct #if LIBSWSCALE_VERSION_MAJOR
SWS_CPU_CAPS are deprecated and slated to removed with libswscale major
version 3. No need to provide a SWS_CPU_CAPS_MMX2 as backward
compatibility define under the same explicit condition.
2012-11-16 15:04:57 +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
Kostya Shishkov 38fdf72580 swscale: do not forget to swap data in formats with different endianness
Otherwise during scaling it will try to interpret input in the wrong way and
that leads to the test results disagreeing on different platforms and with
different optimizations.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
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
Luca Barbato 7658295ba3 pixfmt: support more yuva formats
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-30 12:02:42 +01:00
Luca Barbato 26b5ad2543 swscale: support gray to 9bit and 10bit formats
With the input of Kostya and Ronald.
2012-10-30 12:02:41 +01:00
Mans Rullgard a805cefd8b swscale: avoid pointless use of compound literals
Some compilers (e.g. old gcc) have trouble with these.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 12:00:21 +01:00
Mans Rullgard 95cd815c36 swscale: try to use mmap only if available
Some systems, e.g. Minix, have sys/mman.h defining MAP_ANONYMOUS without
providing (working) mmap and friends.  The mmx filter generation code
checks only for MAP_ANONYMOUS, not for availability of mmap itself which
leads to build errors on aforementioned systems.

This changes the conditional compilation to use mmap only if all the
required functions are available.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-15 02:39:49 +01:00
Luca Barbato 6d5600e855 avutil: add yuva422p and yuva444p formats 2012-10-12 15:09:51 +02:00
Anton Khirnov 0a7068fa5d sws: do not use av_pix_fmt_descriptors directly. 2012-10-12 12:45:38 +02:00
Diego Biurrun 6d0beefbf6 swscale: Do not make ff_ symbols globally visible. 2012-10-10 02:08:01 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Diego Biurrun e4cbf7529b Give all anonymously typedeffed structs in headers a name
Anonymous structs cannot be forward declared and have no benefit.
2012-10-06 09:27:11 +02:00
Mans Rullgard 07eb7e20af ppc: swscale: rework yuv2planeX_altivec()
This gets rid of the variable-length scratch buffer by filtering 16
pixels at a time and writing directly to the destination.  The extra
loads this requires to load the source values are compensated by not
doing a round-trip to memory before shifting.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-05 22:33:32 +01:00
Diego Biurrun b9141aa346 swscale: Remove two bogus asserts 2012-09-13 12:13:28 +02:00
Martin Storsjö 75c37c5ace swscale: Provide the right alignment for external mmx asm
This reverts parts of e0c6cce447. There is external mmx asm that
requires this alignment.

This fixes crashes when using swscale in builds with external mmx,
without inline assembly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-09 01:52:35 +03: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 1169f0d0af x86: more specific checks for availability of required assembly capabilities 2012-09-07 18:16:04 +02:00
Martin Storsjö e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Martin Storsjö d58dd4b5b5 avopt: Store defaults for AV_OPT_TYPE_FLAGS in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:38 +03:00
Martin Storsjö 124134e424 avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:32 +03: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
Ronald S. Bultje b64a72e1b2 yuv2rgb: handle line widths that are not a multiple of 4.
This introduces support for width%4==2 in addition to width%4==0. For
odd widths, some more checks are needed, since the current code always
handles two luma items in a row, thus there is a possibility of an
overread by one.
2012-08-28 14:58:52 -07:00
Martin Storsjö 3ad9eac5a0 testprogs: Remove unused includes
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-29 00:23:51 +03: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
Martin Storsjö 1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03: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