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.
13 years ago
Michael Niedermayer
d9c9a0c767
sws: remove hScale16NX_c()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
66bb5cd592
sws: remove hScale16N() and use ronalds reformated version of it.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
3652409f5b
sws: remove unneeded code from last merge
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Luca Barbato
3304a1e69a
swscale: add dithering to yuv2yuvX_altivec_real
...
It just does that part in scalar form, I doubt using a vector store
over 2 array would speed it up particularly.
The function should be written to not use a scratch buffer.
13 years ago
Ronald S. Bultje
28c1115a91
swscale: use 15-bit intermediates for 9/10-bit scaling.
13 years ago
Stefano Sabatini
6a92551234
lsws: remove optimization debug logs in sws_init_context()
...
The logged information is possibly false, and it tends to be outdated
after each change since the logging code needs to be manually updated.
Simplify and prevent confusing wrong debug messages.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
13 years ago
Stefano Sabatini
347167ecf5
lsws: use array for storing the supported in/out information
...
Also remove the unnecessary isSupportedIn/Out macros.
Make the code more compact/readable, and simplify the access to
lsws-specific pixel format information.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
13 years ago
Stefano Sabatini
4ce0a94656
lsws: remove deprecated and unused stuff after the 0->1 major bump
13 years ago
Ronald S. Bultje
62ee0e6a97
Revert "swscale: use 15-bit intermediates for 9/10-bit scaling."
...
This reverts commit ac0fb59348
. It
causes valgrind errors which I'll want to investigate before
resubmitting this.
13 years ago
Ronald S. Bultje
ac0fb59348
swscale: use 15-bit intermediates for 9/10-bit scaling.
13 years ago
Kostya Shishkov
42ba12888b
Do not convert RGB buffer at once when stride does not fit exact samples.
...
When converting RGB format to RGB format with the same bits per sample,
unscaled path performs conversion on the whole buffer at once. For
non-multiple-of-16 BGR24 to RGB24 conversion it means that padding at the
end of line will be converted too. Since it may be of arbitrary length
(e.g. 8 bytes), operating on the whole buffer produces obviously wrong
results.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Stefano Sabatini
25a53c54d1
lsws: apply logging factorization in sws_scale_init()
14 years ago
Stefano Sabatini
07f49ca1d1
lsws: remove redundant macros isSupportedIn/Out
...
Directly call sws_isSupportedInput/Output.
14 years ago
Stefano Sabatini
64bb656326
lsws: factorize some logging code in sws_init_context()
14 years ago
Stefano Sabatini
e8794f1d5e
lsws: fix weird indent
14 years ago
Stefano Sabatini
c899bedbca
lsws: use array for storing the supported in/out information
14 years ago
Joseph Artsimovich
eedb1f2034
swscale: mark YUV422P10(LE,BE) as supported for output
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Ronald S. Bultje
baba2eedac
swscale: extend mmx padding.
...
Fixes a crash when forcing libc to strictly adhere to malloc sizes.
14 years ago
Ronald S. Bultje
55eda370cb
swscale: clip unscaled colorspace conversion path.
...
Prevents overflows on very bright scenes when adding dither,
which may lead to black dots.
14 years ago
Diego Biurrun
96c1e6d40d
doxygen: Make sure parameter names match between .c and .h files.
14 years ago
Michael Niedermayer
e1d9cee13d
sws: dont mess with XInc when the code needing it isnt used
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Michael Niedermayer
29fb1b5a06
sws: Fix chroma init for 32bit buffers.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Ronald S. Bultje
c59f9a68e2
swscale: error dithering for 16/9/10-bit to 8-bit.
...
Based on a somewhat similar idea in FFmpeg's swscale copy.
14 years ago
Ronald S. Bultje
93a10dd561
swscale: fix overflow in 16-bit vertical scaling.
...
We operated on 31-bits, but with e.g. lanczos scaling, values can
add up to beyond 0x80000000, thus leading to output of zeroes. Drop
one bit of precision fixes this.
14 years ago
Ronald S. Bultje
71a04bc19d
swscale: fix crash in 8-bpc bilinear output without alpha.
...
We accessed the alpha array even it wasn't used and didn't
exist, hence leading to a NULL pointer segfault.
(cherry picked from commit bf2cba4532
)
14 years ago
Ronald S. Bultje
ac9ac45aca
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.
14 years ago
Michael Niedermayer
08b57574c6
sws: fix non native endian 9-15 bit input with 16bit out
14 years ago
Michael Niedermayer
ca78fa24b7
sws: disable scale16 when int32 is used
14 years ago
Michael Niedermayer
987e4c1787
sws: fix rgb -> 16bit
14 years ago
Michael Niedermayer
b5ff61695f
sws: fix uv overwrite in 32bt
14 years ago
Michael Niedermayer
d2c910b9a4
sws: fix gray16_1
14 years ago
Michael Niedermayer
9470205414
sws:ix yuv2rgb48_1_c_template()
14 years ago
Michael Niedermayer
ae05dd8731
sws: fix 16/32 bug from merge
14 years ago
Ronald S. Bultje
948ccdadf4
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.
14 years ago
Anton Mitrofanov
142e76f105
swscale: fix crash with dithering due incorrect offset calculation.
...
ptrdiff_t can be 4 bytes, which leads to the next element being 4-byte
aligned and thus at a different offset than intended. Forcing 8-byte
alignment forces equal offset of dither16/32 on x86-32 and x86-64.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Ronald S. Bultje
5c391a161a
swscale: rename uv_off/uv_off2 to uv_off_px/byte.
14 years ago
Ronald S. Bultje
1ce724ee39
swscale: implement error dithering in planarCopyWrapper.
...
Based on a somewhat similar idea in FFmpeg's swscale.
14 years ago
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.
14 years ago
Ronald S. Bultje
7d7bacf0f1
swscale: fix overflow in 16-bit vertical scaling.
...
We operated on 31-bits, but with e.g. lanczos scaling, values can
add up to beyond 0x80000000, thus leading to output of zeroes. Drop
one bit of precision fixes this.
14 years ago
Ronald S. Bultje
bf2cba4532
swscale: fix crash in 8-bpc bilinear output without alpha.
...
We accessed the alpha array even it wasn't used and didn't
exist, hence leading to a NULL pointer segfault.
14 years ago
Ronald S. Bultje
f44d50a94c
swscale: fix 16-bit horizontal scaling underflow.
...
When using e.g. lanczos scaling, values can drop below 0, so they
should never be unsigned.
14 years ago
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.
14 years ago
Ronald S. Bultje
f28aaae1c5
swscale: amend documentation to mention use of native depth for scaling.
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
14 years ago
Diego Biurrun
e589e4b82d
Remove unused static tables and static inline functions.
14 years ago
Mans Rullgard
abc78a5a7c
Do not include log.h in avutil.h
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Mans Rullgard
d49ea4afb4
Do not include pixfmt.h in avutil.h
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Diego Biurrun
01c17c88ed
doxygen: Remove spurious documentation for non-existing function parameters.
14 years ago
Ronald S. Bultje
8f440223f6
swscale: disable full_chroma_int when converting to non-24/32bpp RGB.
...
This functionality is only implemented for RGB24/32 and causes crashes
otherwise.
14 years ago
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.
14 years ago