Commit Graph

85 Commits

Author SHA1 Message Date
Ronald S. Bultje b5d08c27c3 swscale: convert rgb/bgr24ToY/UV_mmx functions from inline asm to yasm.
Also implement sse2/ssse3/avx versions.
2012-01-27 11:00:30 +08:00
Ronald S. Bultje 3b15a6d742 config.asm: change %ifdef directives to %if directives.
This allows combining multiple conditionals in a single statement.
2012-01-27 10:19:57 +08:00
Ronald S. Bultje 3c172a4106 swscale: change yuv2yuvX code to use cpuflag(). 2012-01-13 16:57:01 -08:00
Ronald S. Bultje b14fa5572c swscale: fix crash in fast_bilinear code when compiled with -mred-zone.
Additional comments from Måns Rullgard have been integrated
by Reinhard Tartler.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-10 18:20:37 +01:00
Oka Motofumi cd44521625 swscale: specify register type.
Fixes a compilation failure on win64.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-10 09:17:37 -08:00
Ronald S. Bultje 2170a0e6ad swscale: convert yuy2/uyvy/nv12/nv21ToY/UV from inline asm to yasm.
Also implement SSE2/AVX variants.
2012-01-08 16:37:43 -08:00
Ronald S. Bultje 6ea64339c5 swscale: split scale.asm.
scale.asm keeps horizontal scaling functions, whereas output.asm gets
the vertical scaling/output functions.
2012-01-03 20:02:07 -08:00
Diego Biurrun 3c62a71486 swscale_mmx: drop no longer required parameters from VSCALEX macros 2011-12-14 12:00:44 +01:00
Diego Biurrun 52de07e1f1 swscale: Mark yuv2planeX_8_mmx as MMX2; it contains MMX2 instructions. 2011-12-14 11:58:46 +01:00
Mans Rullgard 373211d828 Remove extraneous semicolons
These semicolons cause invalid empty top-level declarations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-11 17:23:24 +00:00
Ronald S. Bultje 8283f90a52 swscale: handle unaligned buffers in yuv2plane1
The issue had been introduced in
c435653627

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-11-13 08:27:20 +01:00
Ronald S. Bultje c435653627 swscale: write yuv2plane1 MMX/SSE2/SSE4/AVX functions. 2011-11-05 20:48:14 -07:00
Ronald S. Bultje 9e66b892e8 swscale: add missing colons to x86 assembly yuv2planeX.
This fixes assembling using "nasm".
2011-10-23 09:44:03 -07:00
Ronald S. Bultje 6cacecdca3 swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware.
Also implement MMX/MMX2 versions and SSE4 versions.
2011-10-22 10:35:14 -07:00
Kieran Kunhya 7fbbf95293 yuv2planeX10 SIMD
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-22 10:35:14 -07:00
Kieran Kunhya 34e8d147b3 Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-22 10:35:13 -07:00
Ronald S. Bultje 6aa3cac6bf swscale: use aligned move for storage into temporary buffer.
The intermediate buffer is always aligned.
2011-10-11 07:50:48 -07:00
Ronald S. Bultje e0c3e07387 sws: implement MMX/SSE2/SSSE3/SSE4 versions for horizontal scaling.
Speed: from 3.9x to 9.6x speed improvement over C, and some small
(up to 15%) speed improvements over existing MMX code (particularly
for bigger filters).
2011-09-13 09:53:42 -07:00
Ronald S. Bultje 3f04ab4fcd swscale: split hScale() function pointer into h[cy]Scale().
This allows using more specific implementations for chroma/luma, e.g.
we can make assumptions on filterSize being constant, thus avoiding
that test at runtime.
2011-08-17 20:56:06 -07:00
Ronald S. Bultje 28c1115a91 swscale: use 15-bit intermediates for 9/10-bit scaling. 2011-08-12 11:54:25 -07:00
Ronald S. Bultje 5c391a161a swscale: rename uv_off/uv_off2 to uv_off_px/byte. 2011-07-08 15:15:31 -07:00
Ronald S. Bultje 4e3e333a79 swscale: error dithering for 16/9/10-bit to 8-bit.
Based on a somewhat similar idea in FFmpeg's swscale copy.
2011-07-08 15:15:30 -07:00
Ronald S. Bultje 42d622fab3 swscale: fix 16-bit scaling when output is 8-bits.
We would use the second half of the U plane buffer, rather than the
V plane buffer, to output the V plane pixels.
2011-07-08 15:15:30 -07:00
Ronald S. Bultje 8a8d0ce208 swscale: for >8bit scaling, read in native bit-depth.
For 9/10bit, it means we don't have to upscale to 16bit before
actual scaling or pixel format conversion, and thus a performance
gain.
2011-07-01 09:08:26 -07:00
Ronald S. Bultje ef1ee362b3 swscale: implement >8bit scaling support.
This means that precision is retained when scaling between sample
formats with >8 bits per component (48bit RGB, 16bit grayscale,
9/10/16bit YUV).
2011-06-29 09:45:52 -07:00
Ronald S. Bultje 13a099799e swscale: change prototypes of scaled YUV output functions.
Remove unused variables "flags" and "dstFormat" in yuv2packed1,
merge source rows per plane for yuv2packed[12], and make every
source argument int16_t (some where invalidly set to uint16_t).
This prevents stack pollution and is part of the Great Evil Plan
to simplify swscale.
2011-06-27 21:24:44 -07:00
Ronald S. Bultje 0d994b2f45 swscale: don't use planar output functions to write to NV12/21.
This prevents a crash when converting to NV12/21 without the bitexact
flags enabled.
2011-06-27 17:15:41 -07:00
Ronald S. Bultje 97535ffb97 swscale: remove unused xInc/srcW arguments from hScale(). 2011-06-26 14:41:44 -07:00
Diego Biurrun a60466dbc3 swscale: Remove HAVE_MMX from files that are only compiled with MMX enabled. 2011-06-15 01:18:10 +02:00
Diego Biurrun 97e057ff81 swscale: Fix compilation with --disable-mmx2.
Some MMX2 functions were being referenced without proper #ifdefs.
2011-06-15 01:17:59 +02:00
Ronald S. Bultje a27db4c349 swscale: fix function declaration keywords in x86/swscale_template.c.
Remove inline keyword for functions that are only called through
their function pointers (and thus cannot be inlined); add av_cold
keyword to init function, and use av_always_inline instead of
inline for functions that must be inlined for performance reasons.
2011-06-09 09:25:59 -04:00
Ronald S. Bultje 9bcbb250e2 swscale: fix types of assembly arguments.
This prevents the following compiler warnings: "warning:
initialization from incompatible pointer type". Since the
variables are only ever used in inline assembly, their type
is actually irrelevant (so the part where it was wrong did
not invoke any buggy behaviour).
2011-06-08 11:39:26 -04:00
Ronald S. Bultje 496d95c34c swscale: move two macros that are only used once into caller.
This way, they look like regular code, which is easier to
understand.
2011-06-08 11:33:46 -04:00
Ronald S. Bultje 0fb5193156 swscale: reindent x86 init code. 2011-06-07 10:05:50 -04:00
Ronald S. Bultje ca364a5b43 swscale: extract SWS_FULL_CHR_H_INT conditional into init code. 2011-06-07 10:03:47 -04:00
Ronald S. Bultje bda9b20fa4 swscale: un-special-case yuv2yuvX16_c().
Make yuv2yuvX16_c a function pointer for yuv2yuvX(), so that the
function pointer becomes bitdepth-independent.
2011-06-07 10:03:12 -04:00
Ronald S. Bultje 983260b0a4 swscale: split out x86/swscale_template.c from swscale.c. 2011-06-03 09:52:09 -07:00
Anton Khirnov b8e893399f sws: replace all long with int.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-28 10:03:37 -04:00
Ronald S. Bultje 009f829dde swscale: fix crash in bilinear scaling. 2011-05-28 08:59:56 -04:00
Diego Biurrun 5a5a0f1613 swscale: Remove unused variables in x86 code.
libswscale/x86/swscale_template.c:2072: warning: unused variable ‘canMMX2BeUsed’
libswscale/x86/swscale_template.c:2145: warning: unused variable ‘canMMX2BeUsed’
libswscale/x86/swscale_template.c:2209: warning: unused variable ‘chrVPixBuf’
libswscale/x86/swscale_template.c:2237: warning: unused variable ‘chrVSrcPtr’
2011-05-27 21:25:57 +02:00
Ronald S. Bultje f327bfa6dc swscale: fix build with --disable-swscale-alpha. 2011-05-27 13:22:27 -04:00
Ronald S. Bultje 9f5d45025e swscale: fix non-bitexact yuv2yuv[X2]() MMX/MMX2 functions. 2011-05-27 09:41:48 -04:00
Ronald S. Bultje e758573a88 swscale: fix compile on x86-32. 2011-05-26 10:41:27 -04:00
Ronald S. Bultje b4a224c5e4 swscale: split chroma buffers into separate U/V planes.
Preparatory step to implement support for sizes > VOFW.
2011-05-26 09:31:27 -04:00
Ronald S. Bultje 522d65ba25 rgb2rgb: remove duplicate mmx/mmx2/3dnow/sse2 functions.
Many functions have such a prefix, but do not actually use any
instructions or features from that set, thus giving the false
impression that swscale is highly optimized for a particular
system, whereas in reality it is not.
2011-05-26 09:31:02 -04:00
Ronald S. Bultje 836b82e3c9 swscale: reindent h[cy]scale_fast() and updateDitherTables(). 2011-05-26 09:31:02 -04:00
Ronald S. Bultje e2bad983b5 swscale: reformat x86/swscale_template.c.
Interleave macros and code so that it's easier to find the
actual code that belongs to a function. Also reindent where
appropriate and remove dead code.
2011-05-26 09:30:15 -04:00
Ronald S. Bultje 71d9c33c86 swscale: remove duplicate mmx/mmx2 functions if they are identical. 2011-05-26 09:30:15 -04:00
Ronald S. Bultje acb96bc268 swscale: remove if (c->dstFormat) branch from yuv2packed[12X]().
This allows cutting up the function in much smaller and easier-
to-maintain chunks.
2011-05-26 09:30:14 -04:00
Ronald S. Bultje b6cac9b3bf swscale: remove if(full_chr_int) from yuv2packed1().
If that flag is set, swScale() already proxies the call to
yuv2rgbXinC_full(). Therefore, this flag is never set when
yuv2packed1() is called.
2011-05-26 09:30:14 -04:00