Michael Niedermayer
319898bba2
swscale/utils: handle gray+alpha formats like gray for luma ranges
...
Its illogic to handle gray differently depending on the existence of an alpha channel
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
816cf5181e
swscale/utils: If the source has no alpha then disable alpha blendaway
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Hendrik Leppkes
5d8e836d0e
Replace all remaining occurances of step/depth_minus1 and offset_plus1
9 years ago
Vittorio Giovara
2268db2cd0
lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields
...
The new fields can be accessed directly and are more intelligible.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Pedro Arthur
3059562aa1
swscale: re-enable gamma
...
+added gamma conversion to refactored code
9 years ago
Michael Niedermayer
1acd6311a1
swscale/utils: If cascaded contexts are used forward sws_setColorspaceDetails() to the first context
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
8e05f9217a
swscale/utils: Split scaling if possible and yuv->yuv with different matrixes is requested
...
This uses a RGB intermediate, a more optimal solution would be to perform the rematrixing
directly in subsampled YUV, this is quite a bit more complicated though
Fixes Ticket4805
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Pedro Arthur
e0a3173a94
swscale: refactor horizontal scaling
...
+ split color conversion from scaling
- disabled gamma correction, until it's refactored too
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
0f9d46b70d
swscale/alphablend: Support chroma subsampling
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
b7faa9d314
swscale/alphablend: support packed pixel formats
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
d0e0757e9a
swscale: Implement alphablendaway for planar 4:4:4 formats
...
Fixes Ticket4746
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
c382d9e8cb
swscale: Add sws_alloc_set_opts()
...
This simplifies allocating and initializing swscale contexts with custom options.
The function is internal currently but could be moved into the public header
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Paul B Mahol
3cb8eee6f7
swscale: ayuv64le output support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
052f64ecb2
swscale: ayuv64le input support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Michael Niedermayer
a5d44d5c22
swscale/utils: Clear pix buffers
...
Fixes use of uninitialized memory
Fixes: a96874b9466b6edc660a519c7ad47977_signal_sigsegv_7ffff713351a_744_nc_sample.avi with memlimit 2147483648
Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Paul B Mahol
2778fdbe54
swscale: implement YA8 output
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Michael Niedermayer
e29d996149
swscale/output: Add rgba64/rgb48/bgra64/bgr48 output functions with full chroma interpolation
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
80b5a1e2ee
Mark vectors as NAN instead of dereferencing NULL pointers on malloc failure
...
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ae0148ff60
swscale: Assert that pixel format descriptor is not NULL
...
This may help static analyzers, the pixel format is checked
during initialization
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Ronald S. Bultje
711d8812ad
swscale: add yuv440p10/12 pixfmts.
10 years ago
Michael Niedermayer
b57f9f5724
swscale/swscale: Get rid of the SWS_GAMMA_CORRECT flag
...
This avoids using up a bit of the public flags
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Pedro Arthur
2a7128f4ed
Add gamma encodign/decoding before/after scaling in libswscale
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Federico Tomassetti
7ebb302229
swscale: Check memory allocation
...
Bug-Id: CID 1267890
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
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