Commit Graph

341 Commits

Author SHA1 Message Date
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>
2015-03-11 15:40:28 +01:00
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>
2015-02-27 03:13:14 +01:00
Michael Niedermayer fb8e5044b4 swscale/utils: add asserts to check filterpos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 01:00:24 +01:00
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>
2015-02-24 01:00:24 +01:00
Michael Niedermayer 2a1b79d7e6 Merge commit 'e51f22122d23589e93ac4f0b3e570bb925755915'
* commit 'e51f22122d23589e93ac4f0b3e570bb925755915':
  swscale: Check memory allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 22:22:17 +01:00
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>
2015-02-17 12:16:43 -05:00
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>
2015-02-05 00:33:50 +01:00
Michael Niedermayer 27513846f6 Merge commit '928061670e873e816daa14827853b7e11221ff5f'
* commit '928061670e873e816daa14827853b7e11221ff5f':
  libswscale: GBRAP input & output and GBRAP16 input support

Conflicts:
	libswscale/input.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	tests/ref/fate/filter-pixdesc-gbrap
	tests/ref/fate/filter-pixfmts-copy
	tests/ref/fate/filter-pixfmts-null
	tests/ref/fate/filter-pixfmts-scale
	tests/ref/fate/filter-pixfmts-vflip

See: 5c057433cc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 05:47:25 +01:00
Paul B Mahol 928061670e libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-01-14 17:17:24 +01:00
Kieran Kunhya 18982f084c swscale: Pass through chroma positions in sws_getCachedContext
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 17:55:12 +01:00
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>
2014-11-12 23:59:37 +01:00
Michael Niedermayer fba894615d swscale: support internal scaler cascades
Fixes Ticket3170

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-11 05:05:17 +02:00
James Almer fb7d8d50bc swscale: remove obsolete FF_API_SWS_FORMAT_NAME cruft
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:29 -03:00
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>
2014-09-21 12:23:24 +02:00
Michael Niedermayer 4917fecf4a Merge commit 'bb789016d423d2cfacd2904ac66257bdf7f0964e'
* commit 'bb789016d423d2cfacd2904ac66257bdf7f0964e':
  swscale: Undeprecate sws_getContext()

Conflicts:
	libswscale/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 20:52:40 +02:00
Diego Biurrun bb789016d4 swscale: Undeprecate sws_getContext()
sws_getCachedContext is not a full replacement for the function.
2014-08-07 04:03:00 -07:00
Michael Niedermayer 2f5bf2f7f2 Merge commit 'f84a1b597c29dc035b8d5529ef88c2d7ff057820'
* commit 'f84a1b597c29dc035b8d5529ef88c2d7ff057820':
  swscale: support AV_PIX_FMT_YA16 as input

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 22:32:13 +02:00
Michael Niedermayer 4c8bc6fdee Merge commit 'e96c3b81cadd0ba84d43b1f3a54980df3785d9a5'
* commit 'e96c3b81cadd0ba84d43b1f3a54980df3785d9a5':
  avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8

Conflicts:
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/raw.c
	libavutil/pixdesc.c
	libavutil/pixfmt.h
	libavutil/version.h
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 21:48:00 +02:00
Vittorio Giovara f84a1b597c swscale: support AV_PIX_FMT_YA16 as input
Based on a long debug session with Kostya.
2014-08-04 12:56:05 +01:00
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.
2014-08-04 12:55:08 +01:00
Michael Niedermayer b53bdae11f swscale/utils: fix rgb -> fullrange yuv
Fixes part of Ticket3785

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 23:24:26 +02:00
Michael Niedermayer d84abf35c0 swscale/utils: remove unused define
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 22:45:43 +02:00
Michael Niedermayer 6532a1a828 sws/x86: split mmxext fast bilinear scaler out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 05:36:27 +02:00
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>
2014-06-13 14:49:59 +01:00
Michael Niedermayer ce4d91ba2a sws: document color range >8bit oddity 2014-05-21 21:29:33 +02:00
Michael Niedermayer c3417ed7fd swscale/utils: Add check that ensures that the hardcoded struct offsets are valid
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-14 01:32:11 +02:00
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>
2014-05-04 19:49:06 +02:00
Michael Niedermayer 1c4110be90 Merge commit '3a177a9cca924e097265b32f9282814f6b653e08'
* commit '3a177a9cca924e097265b32f9282814f6b653e08':
  swscale: Fix an undefined behaviour

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-03 23:36:54 +02:00
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
2014-05-03 18:25:17 +02:00
Michael Niedermayer 4959a4fcf7 swscale/utils: fix changing src/dst range after initializing the context
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-15 00:40:39 +02:00
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>
2014-04-14 23:32:41 +02:00
Michael Niedermayer ed962414bd Merge commit '92b099daf4b8ef93513e38b43899cb8458a2fde3'
* commit '92b099daf4b8ef93513e38b43899cb8458a2fde3':
  swscale: support converting YVYU422 pixel format

Conflicts:
	libswscale/input.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-09 03:36:38 +02:00
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>
2014-04-09 00:57:12 +02:00
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>
2014-04-09 00:57:12 +02:00
Vittorio Giovara 92b099daf4 swscale: support converting YVYU422 pixel format 2014-04-07 23:50:34 +02:00
Michael Niedermayer 37f69cd93e swscale: add full bgra64 support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-02 19:44:08 +02:00
Michael Niedermayer 3428a9b8d5 Merge commit '0ca0924c10d9617a5793964bf79655424ef32b68'
* commit '0ca0924c10d9617a5793964bf79655424ef32b68':
  swscale: add endianness conversion for AV_PIX_FMT_BGRA64|RGBA64

Conflicts:
	libswscale/swscale_unscaled.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-02 17:46:19 +02:00
Janne Grunau 0ca0924c10 swscale: add endianness conversion for AV_PIX_FMT_BGRA64|RGBA64 2014-04-02 11:39:26 +02:00
Carl Eugen Hoyos e6fe804bdd Do not set swscale sizeFactor to -1.
Fixes ticket #3495.
2014-03-25 15:46:35 +01:00
Ø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
2014-03-25 13:48:06 +01:00
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>
2014-03-18 22:15:15 +01:00
Jean First 1481d24c3a RGBA64 pixel formats
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-03-16 23:05:47 +01:00
Peter Ross 02b63246cf libswscale: bayer to rgb24 & yv12 colorspace converters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-23 02:38:22 +01:00
Michael Niedermayer 51fed95dde swscale/utils: fix wrong deprecated message with rgb0
Fixes Ticket3242
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 22:47:49 +01:00
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>
2013-12-15 14:13:55 +01:00
Michael Niedermayer 554e913fd7 swscale/utils: remove useless ()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 14:10:02 +01:00
Michael Niedermayer dc54bd4e8d swscale/utils: factor (d + 1 < 4) out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 13:49:20 +01:00
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>
2013-12-07 02:04:31 +01:00
Stefano Sabatini 2a6c95d85f lsws/utils: introduce scale_algorithms array
Allow some dumb factorizations, slightly decrease spaghetti factor.
2013-11-05 14:01:53 +01:00
Stefano Sabatini 246e323de8 lsws/utils: fix typo 2013-11-05 00:04:17 +01:00