Commit Graph

346 Commits

Author SHA1 Message Date
Michael Niedermayer b6d9ecfe22 swscale/utils: Fix chrSrcHSubSample for GBRAP16
Fixes part of Ticket5264

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 67e5bd0c50)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-29 14:23:40 +02:00
Michael Niedermayer f0b6705e1a swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
This avoids running various table inits unnecessarily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc538e9dbd)

Conflicts:

	libswscale/utils.c
2016-01-15 17:23:55 +01:00
Michael Niedermayer dbe194002a swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
Fixes Ticket4960

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1edf129cbc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:23:54 +01:00
Michael Niedermayer bb70069e6a swscale/utils: Fix intermediate format for cascaded alpha downscaling
Fixes Ticket4926

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b83d8be6bf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:23:54 +01:00
Michael Niedermayer 0fa22a42d6 swscale/utils: Fix for runtime error: left shift of negative value -1
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 325b59368d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 10:59:27 +01:00
Michael Niedermayer fb47b6cb4b 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>
(cherry picked from commit a5d44d5c22)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 04:43:41 +02: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