Commit Graph

39 Commits

Author SHA1 Message Date
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
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 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 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
Ronald S. Bultje 2159a24573 swscale: remove if(accurate_rnd) branch from functions. 2011-05-26 09:30:14 -04:00
Diego Biurrun 0093199184 swscale: Remove commented-out printf cruft. 2011-05-26 03:45:58 +02:00
Ronald S. Bultje 1bb0f0c925 swscale: remove if(bitexact) branch from functions.
Instead, only set the function pointers if bitexact flag is
not set during initialization. Since a change in flags triggers
a re-init anyway, this doesn't situations where flag values
change during runtime.
2011-05-24 14:50:20 -04:00
Ronald S. Bultje 566b5fbbb3 swscale: remove if(canMMX2BeUsed) conditional.
Instead, set function pointers conditionally during init. This
patch also reveals a whole branch of dead assembly code that is
therefore also removed.
2011-05-24 14:50:19 -04:00
Ronald S. Bultje aaca69c130 swscale: remove swScale_{c,MMX,MMX2} duplication. 2011-05-24 14:50:15 -04:00
Ronald S. Bultje c4fd283a46 swscale: use emms_c(). 2011-05-24 14:48:49 -04:00
Ronald S. Bultje b9eb2136af swscale: remove dead macro WRITEBGR24OLD. 2011-05-24 10:46:40 -04:00
Ronald S. Bultje 1dd4f4be5a swscale: remove AMD3DNOW "optimizations".
The functions are identical to their MMX counterparts. Thus,
pretending that swscale is highly optimized for AMD3DNOW
extensions is a poorly executed practical joke at best.
2011-05-24 10:19:41 -04:00
Ronald S. Bultje 11ffefefdb swscale: remove duplicated x86/ functions. 2011-05-24 10:11:26 -04:00
Ronald S. Bultje e66149e714 swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*. 2011-05-24 10:03:26 -04:00
Ronald S. Bultje c8f487deae swscale: fix YUV420P 9/10bit support.
Fix handling of input if not in native endianness, and add support for
9/10-bit output. This allows us to force endianness of YUV420P 9/10bit
in the H264/10bit fate tests, which should fix them on big-endian
systems.
2011-05-11 19:15:14 -04:00
Janne Grunau 7f2ae5c7af swscale: fix compilation with --enable-runtime-cpudetect 2011-04-15 09:07:37 +02:00
Josh Allmann 735bf19511 swscale: further cleanup swscale.c
Move x86-specific constants out of swscale.c
2011-04-14 22:16:47 +02:00
Luca Barbato 86330b4c92 swscale: partially move the arch specific code left
PPC and x86 code is split off from swscale_template.c. Lots of code is
still duplicated and should be removed later.

Again uniformize 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.
2011-04-14 22:16:47 +02:00