Commit Graph

462 Commits

Author SHA1 Message Date
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>
2015-09-07 12:37:47 +02:00
Pedro Arthur
3059562aa1 swscale: re-enable gamma
+added gamma conversion to refactored code
2015-09-04 19:00:20 -03:00
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>
2015-08-31 02:00:55 +02:00
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>
2015-08-31 02:00:19 +02:00
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>
2015-08-18 01:33:32 +02:00
Michael Niedermayer
0f9d46b70d swscale/alphablend: Support chroma subsampling
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 18:04:46 +02:00
Michael Niedermayer
b7faa9d314 swscale/alphablend: support packed pixel formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 15:58:43 +02:00
Michael Niedermayer
d0e0757e9a swscale: Implement alphablendaway for planar 4:4:4 formats
Fixes Ticket4746

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-08 13:24:52 +02:00
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>
2015-08-08 13:08:16 +02:00
Paul B Mahol
3cb8eee6f7 swscale: ayuv64le output support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-24 03:45:48 +00:00
Paul B Mahol
052f64ecb2 swscale: ayuv64le input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-24 03:44:58 +00:00
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>
2015-07-15 20:06:34 +02:00
Paul B Mahol
2778fdbe54 swscale: implement YA8 output
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-02 17:36:05 +00:00
Michael Niedermayer
e29d996149 swscale/output: Add rgba64/rgb48/bgra64/bgr48 output functions with full chroma interpolation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 00:45:46 +02:00
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>
2015-06-12 15:06:32 +02:00
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>
2015-06-12 14:47:37 +02:00
Ronald S. Bultje
711d8812ad swscale: add yuv440p10/12 pixfmts. 2015-05-06 12:04:31 -04:00
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>
2015-04-23 20:34:51 +02:00
Pedro Arthur
2a7128f4ed Add gamma encodign/decoding before/after scaling in libswscale
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-23 20:34:51 +02:00
Michael Niedermayer
324067d18b Merge commit '7ebb3022297aa00afda6800105684b8303f2608e'
* commit '7ebb3022297aa00afda6800105684b8303f2608e':
  swscale: Check memory allocation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-22 03:40:37 +01:00
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>
2015-03-21 23:18:11 +01:00
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
Stefano Sabatini
ff9d11f95d lsws: use av_pix_fmt_get_chroma_sub_sample()
Remove duplicated getSubSampleFactors() function. Simplify.
2013-10-24 08:12:38 +02:00
Michael Niedermayer
eb4205cc89 swscale/utils: check mprotect() return code
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-23 10:14:05 +02:00
Michael Niedermayer
2db6547237 swscale/utils/sws_setColorspaceDetails(): fix indention
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-17 14:02:43 +02:00
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>
2013-10-10 17:28:59 +02:00
Michael Niedermayer
5710f55e49 Merge commit '6b3ff6f91a535d6383f41ca7bdf760165dcb6015'
* commit '6b3ff6f91a535d6383f41ca7bdf760165dcb6015':
  swscale: provide a default scaler if none is set

Conflicts:
	libswscale/utils.c

The default is left at bicubic until someone has compared the scalers
properly speed and quality wise.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-06 11:44:05 +02:00
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>
2013-10-05 18:38:55 +02:00
Michael Niedermayer
2e2a2d8801 swscale/utils: dont divide by zero with zero vectors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-01 00:27:28 +02:00
Michael Niedermayer
2d28950da9 swscale/utils: remove redundant NULL checks before sws_freeVec()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 21:48:54 +02:00
Michael Niedermayer
a446657d8c swscale/utils: simplify cpu caps printing code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 21:31:58 +02:00
Michael Niedermayer
9d052adbeb swscale/utils: Simplify scaler name printing code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 21:29:42 +02:00
Michael Niedermayer
aec91de549 swscale/utils: Allow sws_setColorspaceDetails() to use the tables from sws_getColorspaceDetails()
Previously this would have lead to a memcpy(a,a) which violates the
requirement of non overlapping src and dst.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 17:21:13 +02:00
Michael Niedermayer
c914c99d4b swscale/utils: use memcpy instead of loop in sws_cloneVec()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-08 16:39:38 +02:00
Michael Niedermayer
f0a3562382 Merge commit '79aec43ce813a3e270743ca64fa3f31fa43df80b'
* commit '79aec43ce813a3e270743ca64fa3f31fa43df80b':
  x86: Add and use more convenience macros to check CPU extension availability

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-30 11:57:35 +02:00
Michael Niedermayer
01cac26f68 Merge commit '1909f6b1b6da2db371c179bed5a19aaf979b7557'
* commit '1909f6b1b6da2db371c179bed5a19aaf979b7557':
  swscale: cosmetics: Drop silly camelCase from swScale function pointer name

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:56:03 +02:00
Michael Niedermayer
5ff1b588eb Merge commit 'c2503d9c8ab42ea55922e9f5a10c8bfbbbfeaf19'
* commit 'c2503d9c8ab42ea55922e9f5a10c8bfbbbfeaf19':
  swscale: ppc: Hide arch-specific initialization details

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:10:09 +02:00
Michael Niedermayer
29daad5b98 Merge commit 'f61bece684d9685b07895508e6c1c733b5564ccf'
* commit 'f61bece684d9685b07895508e6c1c733b5564ccf':
  ppc: Add and use convenience macro to check for AltiVec availability

Conflicts:
	libavcodec/ppc/dsputil_ppc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 14:24:07 +02:00
Diego Biurrun
79aec43ce8 x86: Add and use more convenience macros to check CPU extension availability 2013-08-29 13:07:37 +02:00
Diego Biurrun
1909f6b1b6 swscale: cosmetics: Drop silly camelCase from swScale function pointer name 2013-08-29 10:23:54 +02:00
Diego Biurrun
c2503d9c8a swscale: ppc: Hide arch-specific initialization details
Also give consistent names to init functions.
2013-08-29 10:23:41 +02:00
Diego Biurrun
f61bece684 ppc: Add and use convenience macro to check for AltiVec availability 2013-08-28 23:54:15 +02:00
Michael Niedermayer
23b3141261 swscale: improve dither checks
Bssed on patch by Øyvind Kolås <pippin@gimp.org>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-19 18:33:50 +02:00
Michael Niedermayer
8c50ea2251 swscale: set dither to a specific value for rgb/bgr8 output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-19 18:31:35 +02:00
Michael Niedermayer
c14fc4585c Merge commit 'aa2ba8c99e5708884a56aea9c1d96e014866f8a3'
* commit 'aa2ba8c99e5708884a56aea9c1d96e014866f8a3':
  swscale: Move extern declarations for tables to swscale_internal.h

Conflicts:
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-16 12:56:48 +02:00
Michael Niedermayer
1e0e193240 sws: add dither enum
This allows specifying more dither algorithms without using up flags and
without ambiguities.

Also initialize the new field based on the flags and use it.
Note, improving the logic of the checks is left to subsequent
commits, this here only switches from flags to enum.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15 21:39:32 +02:00
Diego Biurrun
aa2ba8c99e swscale: Move extern declarations for tables to swscale_internal.h
Also add missing ff_ prefixes where necessary.
2013-08-15 14:38:03 +02:00
Michael Niedermayer
8d745281a4 swscale/utils: Fix potential overflow of srcPos*C before converting to 64bit
Fixes CID1061054

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-08 02:56:26 +02:00
Michael Niedermayer
bc721ac9f7 swscale/utils: Fix potential overflow of dstPos*xInc before converting to 64bit
Fixes CID1061053

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-08 02:51:52 +02:00
Michael Niedermayer
8efe96ee6f swscale/fill_rgb2yuv_table: fix default detection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-27 01:11:37 +02:00
Michael Niedermayer
a7e45cfa11 swscale/sws_getColorspaceDetails: dont fail for non yuv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-25 02:50:46 +02:00
Michael Niedermayer
436616fd42 swscale: exchange src & dst chroma pos
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-24 22:43:50 +02:00
clook
b9b1a2c3e4 libswscale: Adding RGB => XYZ support 2013-07-23 01:02:41 +02:00
Michael Niedermayer
b405f4e916 swscale: Add support to specify chroma position
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-17 01:59:10 +02:00
Michael Niedermayer
37f4aa133d swscale: move default colorspace setup to sws_init_filter()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-16 02:44:25 +02:00
Michael Niedermayer
c75dde6074 swscale: call handle_format() from the functions that need it
This should fix some hypothetical issues with alloc/init_context() usage

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-14 03:36:19 +02:00
Michael Niedermayer
0fc11e7bad swscale: make handle_formats() safe to be called multiple times
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-14 03:36:19 +02:00
Michael Niedermayer
d5f5e51662 swscale: move format handling to its own function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-14 03:36:19 +02:00
Michael Niedermayer
1ba01d3d46 swscale: treat gray as a fullrage (0-255) format
Fixes Ticket2684

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-08 15:21:48 +02:00
Hendrik Leppkes
7cdf574c22 swscale: fix filter alignment reduction without inline asm
Fixes scaling in MSVC/ICL, where inline asm is not present, but the
YASM scaling code is.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-21 21:01:11 +02:00
Michael Niedermayer
a90baa63c3 add YUVJ411P
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 12:56:11 +02:00
Paul B Mahol
e1746d057b swscale: RGBA64 output
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 21:47:19 +02:00
Michael Niedermayer
63725d158d Revert "sws: support endianness conversion for AV_PIX_FMT_RGBA64"
This reverts commit 23f7b14f28.

This commit broke fate
2013-05-12 15:05:25 +02:00
Paul B Mahol
23f7b14f28 sws: support endianness conversion for AV_PIX_FMT_RGBA64
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-12 11:44:20 +00:00
Clément Bœsch
570d63eef3 lavu: add FF_CEIL_RSHIFT and use it in various places. 2013-05-09 16:59:42 +02:00
Paul B Mahol
5c057433cc libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-08 12:48:05 +00:00
Michael Niedermayer
dce12f6948 Merge commit '9cfa21c8c2b81146aab574f55c93f27e5c2d435c'
* commit '9cfa21c8c2b81146aab574f55c93f27e5c2d435c':
  swscale: support endianness conversion for AV_PIX_FMT_XYZ12

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

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-07 11:13:46 +02:00
Michael Niedermayer
2060d94409 Merge commit 'c1eb3e7fecdc270e03a700d61ef941600a6af491'
* commit 'c1eb3e7fecdc270e03a700d61ef941600a6af491':
  swscale: add support for endianness only conversion

Conflicts:
	libswscale/utils.c
	libswscale/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-07 11:04:07 +02:00
Janne Grunau
9cfa21c8c2 swscale: support endianness conversion for AV_PIX_FMT_XYZ12 2013-05-06 21:48:14 +02:00
Janne Grunau
c1eb3e7fec swscale: add support for endianness only conversion
Use bitfields in FormatEntry array to avoid wasting an int for each flag.
2013-05-06 18:55:58 +02:00
Michael Niedermayer
d5dbd84c9a Merge commit '2b677ffca54a5fbef9c8860841c32f28ecd68f70'
* commit '2b677ffca54a5fbef9c8860841c32f28ecd68f70':
  swscale: Add av_cold attributes to init functions missing them

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 13:00:21 +02:00
Reimar Döffinger
3bb1c58e95 Avoid incorrect deprecated pixel format warning.
Should only be printed if a "JPEG" format was used,
not for e.g. XYZ.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-05-05 10:01:22 +02:00
Diego Biurrun
2b677ffca5 swscale: Add av_cold attributes to init functions missing them 2013-05-04 22:48:05 +02:00
Paul B Mahol
e6d4e68755 lavu: add planar 16 bit and 8 bit rgb with alpha
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-03 16:58:22 +00:00
Michael Niedermayer
2514b80045 sws: share xyzgamma tables.
They are currently always constant and thus theres no point to
store them in the context.
This makes the context 16kb smaller

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 17:52:18 +02:00
Michael Niedermayer
0c47c9028b sws: support xyz input
The implementation is heavily based on Matthias Buerchers and Nicolas Bertrands vf_xyz2rgb.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-28 19:30:01 +02:00
Michael Niedermayer
45f1cf88a8 sws: remove hack to support partial convert / xyz bswaping
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-28 19:20:06 +02:00
Michael Niedermayer
2fa08abdb6 sws: enable xyz12, this for now is just for swaping between le and be
Needed for fixing fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-28 15:53:20 +02:00
Michael Niedermayer
13bbfb8fda sws: Skip ff_yuv2rgb_c_init_tables() when the output is YUV
Fixes "20bpp not supported by yuv2rgb" warning

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-16 17:50:43 +02:00
Michael Niedermayer
f05cfb654f sws/fill_rgb2yuv_table: use ROUNDED_DIV
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-16 11:33:40 +02:00
Michael Niedermayer
bcf643486f sws/fill_rgb2yuv_table: increase precission to 32bit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-16 11:33:40 +02:00
Michael Niedermayer
2fa11a94a3 sws/fill_rgb2yuv_table: avoid 2 divisions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-16 11:13:20 +02:00
Michael Niedermayer
3950236332 sws/x86: update RENAME(rgb24toyv12)() to using the user provided rgb2yuv table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 21:44:50 +02:00
Michael Niedermayer
2a5d1cb2d9 sws/x86: update rgba->yuv to use user supplied table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 01:31:01 +02:00
Michael Niedermayer
17ad06c753 sws/x86: update rgb/bgr->yuv code to use provided coefficient table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 01:31:01 +02:00
Michael Niedermayer
9aafb95ae2 sws: init input_rgb2yuv_table depending on yuv colorspace
For the default table we keep using the exact previous
coefficients, this way individual functions can be updated seperately
without breaking fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 01:30:15 +02:00
Martin Storsjö
d192ac3e03 swscale: Disallow conversion to GBRP16
This reverts parts of d6d5ef5534, that didn't work right. (The
tests that were added failed on big endian, and the output looked
garbled on little endian as well.)

This is due to the fact that the intermediate scaling values (from
e.g. hScale8To19_c or hScale16To19_c) are stored as int32_t and
thus requires a separate output function, while yuv2gbrp_full_X_c
only interprets it as int16_t.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-11 20:03:16 +02:00
Michael Niedermayer
f2b89f21cc Merge commit '7b41c24c5fa221b55a9302efaf1a9eeb38b12551'
* commit '7b41c24c5fa221b55a9302efaf1a9eeb38b12551':
  sws: dont enable chrSrcHSubSample for planar RGB

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 14:07:27 +01:00
Michael Niedermayer
42431a557e Merge commit 'd6d5ef5534d582f9dbaf18ac2605cf5bb72cd821'
* commit 'd6d5ef5534d582f9dbaf18ac2605cf5bb72cd821':
  sws: GBRP9, GBRP10, and GBRP16 output support

Conflicts:
	libswscale/output.c
	libswscale/utils.c
	tests/ref/lavfi/pixdesc
	tests/ref/lavfi/pixfmts_copy
	tests/ref/lavfi/pixfmts_null
	tests/ref/lavfi/pixfmts_scale
	tests/ref/lavfi/pixfmts_vflip

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 13:49:53 +01:00
Michael Niedermayer
7b41c24c5f sws: dont enable chrSrcHSubSample for planar RGB
This code path is not implemented and makes not much sense to implement
either.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-09 14:31:53 -05:00
Michael Niedermayer
d6d5ef5534 sws: GBRP9, GBRP10, and GBRP16 output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-09 14:31:11 -05:00
Michael Niedermayer
bb2f4ae434 Merge commit '05b0998f511ffa699407465d48c7d5805f746ad2'
* commit '05b0998f511ffa699407465d48c7d5805f746ad2':
  dsputil: Fix error by not using redzone and register name
  swscale: GBRP output support

Conflicts:
	libswscale/output.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/utils.c
	tests/ref/lavfi/pixdesc
	tests/ref/lavfi/pixfmts_copy
	tests/ref/lavfi/pixfmts_null
	tests/ref/lavfi/pixfmts_scale
	tests/ref/lavfi/pixfmts_vflip

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 14:11:31 +01:00
Michael Niedermayer
4eb93bed4e swscale: GBRP output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-01-27 15:28:07 -05:00
Michael Niedermayer
3c2ecfcc24 sws: dont enable chrSrcHSubSample for planar RGB
This code path is not implemented and makes not much sense to implement
either.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 20:40:44 +01:00
Michael Niedermayer
e4033d89f1 sws: GBRP9, GBRP10 GBRP12 GBRP14 output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 06:11:52 +01:00
Michael Niedermayer
61884d1985 sws: GBRP output support
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 06:11:52 +01:00
Michael Niedermayer
aef5c0b68f sws: Check for unsupported combination of ED/FULL_CHR flags
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 23:13:40 +01:00
Michael Niedermayer
2dc2e4f5af sws: Enable full chroma resolution when needed for ED dither
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 02:38:48 +01:00
Michael Niedermayer
ca447592b1 sws: rgb/bgr 4/8 error diffusion dither
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 02:38:48 +01:00
Michael Niedermayer
646ade7679 sws: Support error diffusion dither for mono output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 23:26:00 +01:00
Michael Niedermayer
bb4fb7715c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: fix NULL checking in sws_alloc_context()
  mxfdec: fix NULL checking in mxf_get_sorted_table_segments()
  finalize changelog for version 9

Conflicts:
	Changelog
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-05 13:37:30 +01:00