Michael Niedermayer
fa74058dd3
swscale/utils: Fix undefined shift in initFilter()
...
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
007498fc1a
swscale/utils: clear formatConvBuffer on allocation
...
Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
fb8e5044b4
swscale/utils: add asserts to check filterpos
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1895d414aa
swscale/utils: More carefully merge and clear coefficients outside the input
...
Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Federico Tomassetti
e51f22122d
swscale: Check memory allocations
...
CC: libav-stable@libav.org
Bug-Id: CID 1267888 / CID 1267890
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Michael Niedermayer
692b22626e
swscale/utils: Limit filter shifting so as not to read from prior the array
...
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Paul B Mahol
928061670e
libswscale: GBRAP input & output and GBRAP16 input support
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Kieran Kunhya
18982f084c
swscale: Pass through chroma positions in sws_getCachedContext
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
2f6bb86f85
swscale/utils: support bayer input + scaling, and bayer input + any supported output
...
Fixes Ticket4053
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
fba894615d
swscale: support internal scaler cascades
...
Fixes Ticket3170
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
fb7d8d50bc
swscale: remove obsolete FF_API_SWS_FORMAT_NAME cruft
...
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Michael Niedermayer
61af6bebb4
swscale: Allow chroma samples to be above and to the left of luma samples
...
Found-by: Kierank
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
bb789016d4
swscale: Undeprecate sws_getContext()
...
sws_getCachedContext is not a full replacement for the function.
10 years ago
Vittorio Giovara
f84a1b597c
swscale: support AV_PIX_FMT_YA16 as input
...
Based on a long debug session with Kostya.
10 years ago
Vittorio Giovara
e96c3b81ca
avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8
...
The rationale is that you have a packed format in form
<greyscale sample> <alpha sample> <greyscale sample> <alpha sample>
and shortening greyscale to 'G' might make one thing about Greenscale instead.
An alias pixel format and color space name are provided for compatibility.
10 years ago
Michael Niedermayer
b53bdae11f
swscale/utils: fix rgb -> fullrange yuv
...
Fixes part of Ticket3785
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
d84abf35c0
swscale/utils: remove unused define
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
6532a1a828
sws/x86: split mmxext fast bilinear scaler out
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Derek Buitenhuis
a4bd4733c0
swscale: Allow the max filter size to be set at compile time
...
This can help "extreme" resizes, e.g with some 4k stuff.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Michael Niedermayer
ce4d91ba2a
sws: document color range >8bit oddity
11 years ago
Michael Niedermayer
c3417ed7fd
swscale/utils: Add check that ensures that the hardcoded struct offsets are valid
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
656fe7ecce
swscale/utils: use FF_ALLOC(Z)_ARRAY_OR_GOTO() and av_malloc(z)_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
3a177a9cca
swscale: Fix an undefined behaviour
...
Prevent a division by zero down the codepath.
Sample-Id: 00001721-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Michael Niedermayer
4959a4fcf7
swscale/utils: fix changing src/dst range after initializing the context
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
fa98885be4
swscale/utils: move handling of unscaled case to the end of init function
...
This way all context fields get initialized and can be used without needing to reinit the context
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1752b1459d
swscale/utils: scale filter_size in warning so that it can be used as max for the compile time define
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7b2b06eb43
swscale/utils: dont print message about filter size when the cause is a malloc failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
92b099daf4
swscale: support converting YVYU422 pixel format
11 years ago
Michael Niedermayer
37f69cd93e
swscale: add full bgra64 support
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Janne Grunau
0ca0924c10
swscale: add endianness conversion for AV_PIX_FMT_BGRA64|RGBA64
11 years ago
Carl Eugen Hoyos
e6fe804bdd
Do not set swscale sizeFactor to -1.
...
Fixes ticket #3495 .
11 years ago
Øyvind Kolås
3e6016622e
swscale: add two spatially stable dithering methods
...
Both of these dithering methods are from http://pippin.gimp.org/a_dither/ for
GIF they can be considered better than bayer (provides more gray-levels), and
spatial stability - often more than twice as good compression and less visual
flicker than error diffusion methods (the methods also avoids error-shadow
artifacts of diffusion dithers).
These methods are similar to blue/green noise type dither masks; but are
simple enough to generate their mask on the fly. They are still research work
in progress; though more expensive to generate masks (which can be used in a
LUT) like 'void and cluster' and similar methods will yield superior results
11 years ago
Carl Eugen Hoyos
37c07d4529
swscale/utils: Fix color range of gray16
...
Improves rgb -> gray16 conversion
Fixes Ticket3422
The pam and png output files look visually similar, in both cases the
dynamics increase to 0x0 -> 0xfffb.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Jean First
1481d24c3a
RGBA64 pixel formats
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
11 years ago
Peter Ross
02b63246cf
libswscale: bayer to rgb24 & yv12 colorspace converters
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
51fed95dde
swscale/utils: fix wrong deprecated message with rgb0
...
Fixes Ticket3242
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
037fc3b054
swscale/utils: check chroma width for fast bilinear scaler
...
Fixes artifacts where fast bilinear was used for downscaling chroma
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
554e913fd7
swscale/utils: remove useless ()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
dc54bd4e8d
swscale/utils: factor (d + 1 < 4) out
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4d18060e56
swscale/utils: fill xyz tables only when they will be used
...
makes the first call to sws_getContext() 1ms faster
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Stefano Sabatini
2a6c95d85f
lsws/utils: introduce scale_algorithms array
...
Allow some dumb factorizations, slightly decrease spaghetti factor.
11 years ago
Stefano Sabatini
246e323de8
lsws/utils: fix typo
11 years ago
Stefano Sabatini
ff9d11f95d
lsws: use av_pix_fmt_get_chroma_sub_sample()
...
Remove duplicated getSubSampleFactors() function. Simplify.
11 years ago
Michael Niedermayer
eb4205cc89
swscale/utils: check mprotect() return code
...
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2db6547237
swscale/utils/sws_setColorspaceDetails(): fix indention
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a830915b78
swscale: Use full resolution chroma for yuv2rgb when the input has full chroma
...
See Ticket3028
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
6b3ff6f91a
swscale: provide a default scaler if none is set
...
Lanczos for general case, sinc for upscaling, Gaussian for
downscaling. According to current literature these scalers
should be the best quality-wise algorithms for each case.
Inspired from a patch by wm4 <nfxjfg@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Michael Niedermayer
2e2a2d8801
swscale/utils: dont divide by zero with zero vectors
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2d28950da9
swscale/utils: remove redundant NULL checks before sws_freeVec()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a446657d8c
swscale/utils: simplify cpu caps printing code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago