Commit Graph

2267 Commits

Author SHA1 Message Date
Derek Buitenhuis 15d9645fb4 swscale/slice: Actually use the buffers' strides
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 14:25:25 +00:00
Michael Niedermayer 23261e6001 sws/output: fix ordered dither threshold for mono output
This makes sure that white stays white and black black

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-10 17:22:26 +01:00
Michael Niedermayer 61ea7f1509 swscale/swscale-test: Check av_image_fill_linesizes() for failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-04 01:49:38 +01:00
Derek Buitenhuis 21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Hendrik Leppkes 2e31434d84 swscale: add P010 input support 2016-01-26 12:10:45 +01:00
Vittorio Giovara e9175634ec yuv2rgb: Document the color space coefficients
Based on the original documentation found in mpeg2dec (1995).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-20 11:18:31 -05:00
Vittorio Giovara ff8c2c4103 yuv2rgb: Document the color space coefficients
Based on the original documentation found in mpeg2dec (1995).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-19 23:30:36 +01:00
Michael Niedermayer 321e85e176 swscale/swscale: Add some sanity checks for srcSlice* parameters
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 20:35:36 +01:00
Michael Niedermayer c8a9aaab26 swscale/x86/rgb2rgb_template: Fix planar2x() for short width
Fixes: 451b3e0cf956c0bd2f27ed753ac24050/asan_heap-oob_2873c01_3231_7ed10a9464d15f0d57277f5917c566a8.AVI

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 12:34:34 +01:00
Michael Niedermayer 757248ea3c swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
Fixes: 372d2df1f04b49e25f109f07f90b1505/asan_heap-oob_2835d2e_8501_99e0114d7ba3a6db885d0b4684d200c1.cine
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 01:19:43 +01:00
Michael Niedermayer ad3b6fa7d8 swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
Fixes: 372d2df1f04b49e25f109f07f90b1505/asan_heap-oob_2835d2e_8501_99e0114d7ba3a6db885d0b4684d200c1.cine
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 01:19:43 +01:00
Michael Niedermayer fc2588a1d6 swscale/vscale: Use matching sliceY/chrSliceY for luma/chroma
No case known where that makes a difference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 23:49:52 +01:00
Michael Niedermayer eb7802afef swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
Fixes: out of array reads
Fixes: 07e8b9c5d348ccdf7add0f37de20cf6c/asan_heap-oob_27e8df7_6849_e56653f768070ec8cb52f587048444c2.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:59:12 +01:00
Michael Niedermayer b99f498716 swscale/output: Assert that yalpha and uvalpha are within their expected range
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer fe6372bb61 swscale/vscale: Add fixme comment to "ugly" code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer 705a2f70ee swscale/slice: Fix indention
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer 8feeffc1d7 swscale/slice: Fix doc typo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer e06403331c swscale: Move Contexts used only in hscale.c into it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer 7b6e6895f2 swscale: Move VScalerContext into vscale.c
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer cc538e9dbd swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
This avoids running various table inits unnecessarily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Michael Niedermayer 8f3a9a8c27 swscale/yuv2rgb: Increase YUV2RGB table headroom
This makes SWS more robust
Fixes: 07650a772d98aa63b0fed6370dc89037/asan_heap-oob_27ddeaf_2657_2c81ff264dee5d9712cb3251fb9c3bbb.264
Fixes: out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Michael Niedermayer 5e5f82a287 swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Clément Bœsch e8bc642202 lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Michael Niedermayer 1edf129cbc 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>
2016-01-04 23:54:11 +01:00
Matthieu Bouron e4e9b9454e swscale/arm/yuv2rgb: add ff_yuv422p_to_{argb,rgba,abgr,bgra}_neon_{16,32} 2016-01-04 18:56:52 +01:00
Matthieu Bouron 44913d1945 swscale/arm/yuv2rgb: fix typo 2016-01-04 18:56:52 +01:00
Michael Niedermayer b83d8be6bf swscale/utils: Fix intermediate format for cascaded alpha downscaling
Fixes Ticket4926

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-24 21:46:15 +01:00
Matthieu Bouron b32a42295a swscale/arm/yuv2rgb: add ff_yuv420p_to_{argb,rgba,abgr,bgra}_neon_{16,32} 2015-12-19 22:09:28 +01:00
Matthieu Bouron e0dc22b99e swscale/arm/yuv2rgb: disable neon if accurate_rnd is enabled
This disables the 32bit precision neon code path in favor of the
default C one and avoids breaking fate.
2015-12-19 22:09:28 +01:00
Matthieu Bouron c2ad248321 swscale/arm/yuv2rgb: simplify process_16px_* macro call 2015-12-19 10:42:33 +01:00
Clément Bœsch 91b4afd58d swscale/arm/yuv2rgb: fix slicing 2015-12-18 16:21:49 +01:00
Michael Niedermayer a066ff89bc swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
This also as a sideeffect fixes the non aligned case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-15 03:06:33 +01:00
Michael Niedermayer 80bfce35cc swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
Fixes Ticket5013

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-15 02:32:23 +01:00
Ganesh Ajjanagadde c8905e0d67 swscale/utils: replace pow by exp2
exp2 is a faster function.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-08 22:00:05 -05:00
Matthieu Bouron 5aca33c2cf swscale/arm: add ff_nv{12,21}_to_{argb,rgba,abgr,bgra}_neon_16 2015-12-08 08:12:42 +01:00
Michael Niedermayer 325b59368d 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>
2015-12-04 21:44:53 +01:00
Clément Bœsch 010caed261 swscale: use AV_OPT_TYPE_BOOL for {src,dst}_range options 2015-12-04 15:43:34 +01:00
Matthieu Bouron 46feb66972 swscale/arm: add ff_nv{12,21}_to_{argb,rgba,abgr,bgra}_neon
Signed-off-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
Signed-off-by: Clément Bœsch <clement@stupeflix.com>
2015-11-23 14:47:12 +01:00
Andreas Cadhalpun e8c3716064 swscale: rename sws_rgb2rgb_init to ff_sws_rgb2rgb_init
It is an internal swscale function and thus should not be exported.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-29 23:49:46 +01:00
Andreas Cadhalpun 8bfbc8c5e5 swscale: rename sws_context_class to ff_sws_context_class
It is an internal swscale symbol and thus should not be exported.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-29 23:49:10 +01:00
Ganesh Ajjanagadde cd8a0a9a9a swscale/swscale: add av_warn_unused_result to sws_init_context
This should not trigger any warnings; but adds robustness.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-16 17:18:21 -04:00
Pedro Arthur 5bd62a1b3c swscale: fix ticket #4881
When scaling only a slice of a frame the output was written always
in the first lines leaving the rest of the frame black.
2015-10-13 13:43:39 -03:00
Ganesh Ajjanagadde 3b2000c2bf doc/scaler, swscale/options: use proper capitalization
Proper names should be capitalized in all user facing API as far as
possible. The option names themselves have not been changed since:
1. We consistently keep option names in lower case.
2. Changing them would break existing scripts.

The converse is also true: improper names should not be capitalized
generally.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-10 19:32:56 +02:00
Ganesh Ajjanagadde 26e8895b73 all: add _DEFAULT_SOURCE locally wherever needed
Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and _SVID_SOURCE.
The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and the old macros.
This solution is on the lines of the one in commit af1818276e.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2015-10-04 12:15:16 -04:00
Pedro Arthur a8602dde5e swscale: fix ticket #4877 2015-09-25 12:18:58 -03:00
Pedro Arthur 77367f61b3 swscale: fix ticket 4850 2015-09-20 18:08:14 -03:00
Ganesh Ajjanagadde 7cf22c7970 swscale/output: fix undefined left shifts of negative numbers
This fixes -Wshift-negative-value reported with clang 3.7+, e.g
http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-20 01:14:36 +02:00
Ganesh Ajjanagadde b4cb597900 libswscale/swscale: fix -Wunused-function
hyscale, hcscale are only used in old filter code, hence place
header guard to silence -Wunused-function.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-18 23:19:42 +02:00
Ganesh Ajjanagadde 80d23d9d32 swscale/swscale: silence unused function warning
gamma_convert is only used with the old code. Thus, it is
placed under a header guard. This patch silences a -Wunused-function
observed on GCC 5.2.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-09-16 16:31:29 -07:00
Michael Niedermayer 0ae40c5a70 swscale/swscale: Fix "unused variable" warning
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-11 20:59:32 +02:00
Michael Niedermayer d730dd8c53 swscale: Forward colorspace updates to the 2nd cascaded context in case of alphablend
The first just does the blending and wouldnt do anything with the colorspace values

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 17:05:20 +02:00
Michael Niedermayer 21c7272859 swscale/utils: Forward luma range to the cascaded context for alphablending
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 17:05:20 +02:00
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>
2015-09-10 15:00:19 +02:00
Michael Niedermayer 816cf5181e swscale/utils: If the source has no alpha then disable alpha blendaway
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 15:00:19 +02:00
Clément Bœsch c97cd1169c swscale: use AV_OPT_TYPE_BOOL 2015-09-08 22:39:24 +02:00
Hendrik Leppkes 5d8e836d0e Replace all remaining occurances of step/depth_minus1 and offset_plus1 2015-09-08 17:10:48 +02:00
Hendrik Leppkes 151aa2ebff Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba':
  lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 16:35:28 +02:00
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
Hendrik Leppkes 160e92c8bf Merge commit 'e88103a7f92cf27a2868b50acc8a9912f6088249'
* commit 'e88103a7f92cf27a2868b50acc8a9912f6088249':
  Bump major versions of all libraries

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 21:35:46 +02:00
Hendrik Leppkes cebe51a625 Merge commit '9d58639e270f7612874681e0ca30fa461e2667b7'
* commit '9d58639e270f7612874681e0ca30fa461e2667b7':
  sws: Drop deprecated SWS_CPU_CAPS defines

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 15:58:52 +02:00
Pedro Arthur 3059562aa1 swscale: re-enable gamma
+added gamma conversion to refactored code
2015-09-04 19:00:20 -03:00
Pedro Arthur f67aff3ad7 swscale: added proper error check for ff_init_filters 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
Vittorio Giovara e88103a7f9 Bump major versions of all libraries
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-08-28 16:04:28 +02:00
Vittorio Giovara 9d58639e27 sws: Drop deprecated SWS_CPU_CAPS defines
Deprecated in 07/2012.
2015-08-28 10:55:26 +02:00
Timothy Gu 68a9c8ac77 swscale: Silence an unused variable warning
Also remove a pair of extraneous ifdeffery.
2015-08-25 17:40:06 -07:00
Ganesh Ajjanagadde eb3cfa7dd3 swscale/alphablend: fix pointer cast
Commit 7c72a4bbd3 was slightly wrong

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-08-22 20:11:48 +00:00
Michael Niedermayer 7c72a4bbd3 swscale/alphablend: Fix pointer type warnings
Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 12:14:08 +02:00
Pedro Arthur 62d176de12 swscale: refactor vertical scaler 2015-08-19 10:43:52 -03:00
Pedro Arthur 4545906f60 swscale: Fixed typos
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 22:56:50 +02:00
Pedro Arthur ed80dec621 swscale: fixed compiler warnings
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 22:56:50 +02:00
Pedro Arthur 0f3687d6fb swscale: add license headers and copyrights
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 22:56:50 +02:00
Pedro Arthur 737aa902f0 swscale: process horizontal lines in batches
Process more lines in a single pass to improve performance

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 01:33:32 +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 3afca32561 swscale/swscale-test: Fix slice height in random reference data creation.
Found-by: Pedro Arthur <bygrandao@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-17 03:08:10 +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 c5ebeaa308 swscale/alphablend: Support SWS_ALPHA_BLEND_CHECKERBOARD
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 17:11:53 +02:00
Michael Niedermayer 87100e828a swscale/alphablend: Factor target computation out of the loops
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 16:09:30 +02:00
Michael Niedermayer f28ba31b1b swscale/alphablend: Fix big endian formats on LE
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 15:59:12 +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 c64f01227f swscale/swscale: Document param[0..1]
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 14:33:19 +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
Michael Niedermayer 1909a9151c swscale/output: Fix "warning: assignment from incompatible pointer type"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-25 03:15:56 +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
Rong Yan 2af180bf1b swscale/ppc/yuv2rgb_altivec: POWER LE support in the macros vec_unh() and vec_unl()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-16 14:27:58 +02: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
Kevin Coyle 1262711388 YUV->BGR32 MMX support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-04 00:03:45 +02:00
Michael Niedermayer 8255b14c68 swscale/output: fix input indexing in yuv2ya8_2_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-04 00:03:45 +02:00
Michael Niedermayer ab80d3fb3a swscale/output: fix null pointer dereference in yuv2ya8_2_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-03 23:03:25 +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 f6ab967eae swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
Fixes fate/dds-rgb16 on big endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-29 13:54:35 +02:00
James Almer e22edbfd41 swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-06-23 13:28:09 -03:00
James Almer 0c15f2f158 swscale/x86/rgb2rgb_template: don't call emms on sse2/avx functions
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-06-23 13:28:03 -03:00
James Almer 910eeab480 swscale/x86/rgb2rgb_template: add missing xmm clobbers
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-06-23 13:27:56 -03:00
Michael Niedermayer 7604358018 swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-23 05:09:11 +02:00
Michael Niedermayer abb833c568 swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-23 05:09:06 +02:00
Michael Niedermayer 4df3cf90bf swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
The function is specific to little endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-22 22:23:22 +02: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 f140a99f8b swscale/output: Factorize rgb48 and 64bit code
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
Luca Barbato da60b99a88 ppc: Restrict some Altivec implementations to Big Endian
In Little Endian the vec_ld/vec_st operations work as
expected only for byte-vectors.
2015-05-31 12:07:11 +02:00
Nick Lewycky 891df2a1ae libswscale/x86/hscale_fast_bilinear_simd.c: There's no need to save BX if it's in the clobber list.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-13 11:59:30 +02:00
Nick Lewycky 48e9f68384 libswscale/x86/hscale_fast_bilinear_simd.c: Include BX in the clobber list on x86_64, because it isn't implicitly included when PIC is on.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-13 11:59:12 +02:00
Michael Niedermayer 54e64eaf68 swscale/x86/swscale: Fix warning about loosing significant bits in cast
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-10 15:09:04 +02:00
Michael Niedermayer 3b12335395 swscale/x86/hscale_fast_bilinear_simd: Remove ancient out-commented debug code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-07 23:58:08 +02:00
Michael Niedermayer b28d5c49f7 Merge remote-tracking branch 'rbultje/vp9-profile23-wip'
* rbultje/vp9-profile23-wip:
  libvpxdec: add 440 pixfmts.
  vp9: add profile 2/3 fate tests.
  vp9: add inter-frame profile 2/3 suport.
  vp9: add keyframe profile 2/3 support.
  vp9: parse profile 2/3 bitdepth in frame header.
  vp9: add profile 2/3 to exported profiles.
  fate: add/update reference files for 440 addition.
  swscale: add yuv440p10/12 pixfmts.
  lavc: add yuv440p10/12 formats to aligned pixfmt list.
  lavu: add yuv440p10/12 pixfmts.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-07 13:22:04 +02:00
Michael Niedermayer 21b30947f2 swscale/x86/hscale_fast_bilinear_simd: Fix variable names in comments
Found-by: Nick Lewycky <nlewycky@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-07 03:57:21 +02:00
Ronald S. Bultje 711d8812ad swscale: add yuv440p10/12 pixfmts. 2015-05-06 12:04:31 -04:00
Rong Yan 603c839398 swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF() it was wrong
GCC tool had a bug of PPC intrinsic interpret, which has been fixed in GCC 4.9.1. This bug lead to
errors in two of our previous patches. We found this when we update our GCC tools to 4.9.1 and by
reading the related info on GCC website. We fix our previous error in two separate commits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 12:59:05 +02: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 bdcd36a4c8 swscale/output: Fix undefined shifts
Fixes: da14e86d8462be6493eab16bc2d40f88/asan_heap-oob_204cfd2_528_cov_340150052_COMPRESS.BMP

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 18:31:25 +01: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 3e48616226 Merge commit '9a60b1fad02cb783b895b2145c3dafc01f7b337c'
* commit '9a60b1fad02cb783b895b2145c3dafc01f7b337c':
  libswscale: fix compiler warnings enumerated type mixed with another type

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-16 00:15:16 +01:00
Himangi Saraogi 9a60b1fad0 libswscale: fix compiler warnings enumerated type mixed with another type
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-15 18:29:22 +01:00
Christophe Gisquet 5d38c628b0 ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 18:39:28 +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 ae20682f6b swscale: Add prefix to updateMMXDitherTables()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-27 19:23:46 +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 03bffb68f6 swscale: Use av_clip_uintp2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 14:49:17 +01:00
Michael Niedermayer b20426398c swscale/yuv2rgb: Use av_clip_uint8()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 14:44:47 +01:00
Michael Niedermayer d501b986a9 swscale/bayer_template: Add () to protect the argument of BAYER_READ()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-18 01:55:15 +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 f30798584f swscale/input: fix rgba64 alpha non native
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-21 21:21:00 +01:00
Michael Niedermayer 95d04690aa swscale/input: Fix alpha of YA16 input
Fixes Ticket4278

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-21 21:21:00 +01:00
Vittorio Giovara 2df7277711 swscale: fix gbrap to gbrap alpha scaling 2015-01-16 02:47:15 +01:00
Vittorio Giovara 89df3fd49e swscale: fix warning about incompatible function pointer type 2015-01-16 02:47:10 +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
Michael Niedermayer 90de28befd Merge commit '1dd797e3c9f179f957316a0becbec048b42df8aa'
* commit '1dd797e3c9f179f957316a0becbec048b42df8aa':
  swscale: check memory allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 21:44:50 +01:00
Vittorio Giovara 1dd797e3c9 swscale: check memory allocations
CC: libav-stable@libav.org
Bug-Id: CID 1257779
2015-01-05 15:35:39 +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 3a2bed1f9e swscale/yuv2rgb: Fix width % 4 != 0 with bgr4_byte/rgb4_byte
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 00:33:21 +01:00
Michael Niedermayer 3848512d48 swscale/yuv2rgb: Fix width % 4 != 0 with bgr4/rgb4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 00:32:53 +01:00
Michael Niedermayer 3d00ba2688 swscale/yuv2rgb: fix width % 8 != 0 and rgb/bgr8 output
Fixes Ticket2570

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 00:23:49 +01:00
Michael Niedermayer 2a983ff7fe swscale: increase yuv2rgb table headroom
Fixes out of array access
Fixes: case2_bad_read_yuv2rgbx32.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-16 23:37:26 +01:00
Michael Niedermayer e827f65618 Merge commit '33c827f632f95ffe3399b695a5a0d47b366b6e20'
* commit '33c827f632f95ffe3399b695a5a0d47b366b6e20':
  swscale: Properly scale YUV

Conflicts:
	libswscale/swscale_unscaled.c
	tests/ref/fate/filter-pixdesc-yuv420p10be
	tests/ref/fate/filter-pixdesc-yuv420p10le
	tests/ref/fate/filter-pixdesc-yuv420p9be
	tests/ref/fate/filter-pixdesc-yuv420p9le
	tests/ref/fate/filter-pixdesc-yuva420p10be
	tests/ref/fate/filter-pixdesc-yuva420p10le
	tests/ref/fate/filter-pixdesc-yuva420p9be
	tests/ref/fate/filter-pixdesc-yuva420p9le
	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: abe0b8e9f3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-06 01:30:08 +01:00
Derek Buitenhuis 33c827f632 swscale: Properly scale YUV
Only shift limited range luma, and always only shift chroma
for upconversion.

Based off a patch by Michael Niedermayer.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-12-05 13:03:49 +00:00
Michael Niedermayer 8524558858 swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
Fixes Ticket4151

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 20:21:56 +01:00
Michael Niedermayer 4388e78a0f swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
This avoids out of array accesses
Should fix Ticket3451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-20 01:20:31 +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
Rong Yan e74e14608f libswscale/ppc/swscale_altivec.c : fix hScale_altivec_real() yuv2planeX_16_altivec() yuv2planeX_8() for little endian
add marcos GET_LS() GET_VF() LOAD_FILTER() LOAD_L1() GET_VF4() FIRST_LOAD() UPDATE_PTR() LOAD_SRCV() LOAD_SRCV8() GET_VFD() for POWER LE

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-12 15:15:03 +01:00
Kieran Kunhya b546023b93 swscale: fix yuv2yuvX_8 assembly on x86
use_mmx_vfilter check/fix by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-09 23:52:17 +01:00
Michael Niedermayer fa040c2247 Merge commit 'fc1eda543c6ef043300612db90da5cfd972af650'
* commit 'fc1eda543c6ef043300612db90da5cfd972af650':
  swscale: fix sign extensions in yuv planar conversion

Conflicts:
	libswscale/rgb2rgb_template.c

See: a07e9d72a1
See: a30972609c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18 23:40:50 +02:00
Vittorio Giovara fc1eda543c swscale: fix sign extensions in yuv planar conversion
Casting the left-most byte to unsigned avoids an undefined
result of the shift by 24 if bit 7 is set.

yuvPlanartouyvy_c and yuvPlanartoyuy2_c are affected.

CC: libav-stable@libav.org
Bug-Id: CID 732281 / CID 732282
2014-10-18 16:15:10 +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
Vitor Sessak 55d11d277b swscale/x86: do not expect registers to be preserved across inline ASM blocks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-18 00:03:29 +02:00
Clément Bœsch d469aa8cfa sws: use av_clip() instead of av_clip_c() 2014-09-16 16:57:20 +02:00
James Almer 9ffac3d00d lsws: duplicate ff_log2_tab
libswscale uses the table but wasn't duplicating it like the rest of the libs.
This should fix compilation failures on msvc/icl after lavu stopped exporting
internal functions and tables.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 20:52:21 +02:00
Michael Niedermayer a57ece0cb4 Merge commit '1985c2e75c607ac51bfd8dc87d2957a5edf2b6f8'
* commit '1985c2e75c607ac51bfd8dc87d2957a5edf2b6f8':
  Bump major versions of all libraries.

Conflicts:
	doc/APIchanges
	libavcodec/version.h
	libavdevice/version.h
	libavfilter/version.h
	libavformat/version.h
	libavutil/version.h
	libswscale/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 00:26:45 +02:00
Michael Niedermayer 3e41d2e612 Merge commit 'f4c444e17d137c786f0ed2da0e5943df505d5f9e'
* commit 'f4c444e17d137c786f0ed2da0e5943df505d5f9e':
  Postpone API-incompatible changes until the next bump.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-09 22:19:45 +02:00
Anton Khirnov 1985c2e75c Bump major versions of all libraries. 2014-08-09 16:58:33 +00:00
Anton Khirnov f4c444e17d Postpone API-incompatible changes until the next bump. 2014-08-09 16:57:10 +00: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 aee99a5d44 swscale/swscale_internal: fix ya16 -> rgba
Fixes Ticket644

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 01:51:11 +02:00
Michael Niedermayer 700bf1fa4e swscale/swscale_unscaled: fix ya16 input
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 00:33:27 +02: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
Michael Niedermayer 8862c49661 Merge commit '5420099cab1e915b191cceccec4364f54cec6e52'
* commit '5420099cab1e915b191cceccec4364f54cec6e52':
  swscale: correctly pad destination buffer in rgb conversion

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 21:18:17 +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
Kostya Shishkov 5420099cab swscale: correctly pad destination buffer in rgb conversion
Bug-Id: 772
CC: libav-stable@libav.org
Found-By: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-04 12:55:07 +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 54cba3f53e swscale/x86/hscale_fast_bilinear_simd: add inline asm guards
Should fix MSVC build

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 13:26:36 +02:00
Michael Niedermayer d5ee3580d8 sws: move inline asm hscale to MMX_OBJS
Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 05:53:42 +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
Michael Niedermayer e9f7c7aef9 sws: Move fast bilinear C code into seperate file
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 05:36:26 +02:00
Michael Niedermayer 76899be113 swscale/swscale_internal: add needed version.h
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-19 05:36:26 +02:00
Michael Niedermayer 1e3f77b53a swscale/x86/rgb2rgb_template: fix 1 byte overread in yuyvtoyuv420 and uyvytoyuv420
might fix ticket 3410

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-13 05:48:09 +02:00
Andreas Cadhalpun 39a6e02fd4 fix spelling errors
Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-12 22:33:27 +02:00
Michael Niedermayer 4abffbbc54 swscale/x86/input: prevent RGB32_TO_Y_FN from reading into the padding
This avoids reading uninitialized bytes and confusing valgrind

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-22 03:09:28 +02:00
Michael Niedermayer a1a76b209b swscale/x86/input: prevent RGB32_TO_UV_FN from reading into the padding
This avoids reading uninitialized bytes and confusing valgrind

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-22 02:32:30 +02:00
Carl Eugen Hoyos 891307b4d1 s86/scale: Do not return the result of a (void) function from a void function.
Fixes compilation with Sun C 5.12.
Reported by Bradley Mitchell in ticket #3649.
2014-06-19 18:45:13 +02:00
Michael Niedermayer 7f5296005c swscale/swscale: replace potentially slow % by &
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 04:24:31 +02:00
Michael Niedermayer 293d5d7a8e swscale/input: fix harmless integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-16 23:28:32 +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
James Almer 345f2234d1 x86/scale: fix xmm register count for hscale*_sse2
xmm6 was being clobbered in ff_hscale8to{15,19}_8_sse2 on Win64

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 04:13:23 +02:00
Michael Niedermayer b55d3bbeed Merge commit '880e2aa23645ed9871c66ee1cbd00f93c72d2d73'
* commit '880e2aa23645ed9871c66ee1cbd00f93c72d2d73':
  Remove all Blackfin architecture optimizations

Conflicts:
	libavcodec/bfin/dsputil.S
	libavcodec/bfin/dsputil_init.c
	libavcodec/bfin/fdct_bfin.S
	libavcodec/bfin/hpel_pixels_no_rnd.S
	libavcodec/bfin/hpeldsp_init.c
	libavcodec/bfin/idct_bfin.S
	libavcodec/bfin/mathops.h
	libavcodec/bfin/pixels.S
	libavcodec/bfin/pixels.h
	libavcodec/bfin/vp3dsp.S
	libavcodec/bfin/vp3dsp_init.c
	libavutil/bfin/asm.h
	libavutil/bfin/attributes.h
	libswscale/bfin/internal_bfin.S
	libswscale/bfin/swscale_bfin.c
	libswscale/bfin/yuv2rgb_bfin.c
	libswscale/swscale_internal.h
	libswscale/version.h

If someone wants to maintain blackfin support in FFmpeg, please contact
ffmpeg-devel@ffmpeg.org

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 19:38:01 +02:00
Diego Biurrun 880e2aa236 Remove all Blackfin architecture optimizations
Blackfin is a painful platform to work with, no test machines are available
and the range of multimedia applications is dubious. Thus it only represents
a maintenance burden.
2014-06-02 08:41:47 -07: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 3d7218d932 Merge commit '449511740f06a4675b0066730fa45cdb764ffafc'
* commit '449511740f06a4675b0066730fa45cdb764ffafc':
  build: handle library dependencies in configure

Conflicts:
	common.mak
	configure
	libavdevice/Makefile
	libavfilter/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-13 22:40:32 +02:00
Janne Grunau 449511740f build: handle library dependencies in configure
Instead of setting FFLIBS in each library Makefile configure
exports FFLIBS-$library in config.mak.
2014-05-13 20:02:01 +02:00
Matt Oliver 1898c2f49d inline asm: fix arrays as named constraints.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-07 15:02:45 +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 421b21ca8a sws: dont use the optimized 410->420 unscaled conversion when height%4
Fixes Ticket3594
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 06:23:39 +02:00
Michael Niedermayer a5e20d9f4d Fix teh typos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-27 15:16:13 +02:00
Carl Eugen Hoyos b38910c979 Fix compilation with !HAVE_6REGS.
Can be tested with:
$ ./configure --cc='cc -m32' --disable-optimizations --enable-pic
2014-04-19 09:56:01 +02:00
Michael Niedermayer 14fa7fc6a8 swscale/swscale: fix srcStride/srcSlice typo
Fixes part of Ticket3466
Found by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-16 02:09:39 +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 a2f088c0f9 swscale: factor ff_sws_init_range_convert() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-14 23:25:28 +02:00
Michael Niedermayer 3751e5a821 swscale/swscale: clear to/from convert pointers when they used.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-14 23:15:31 +02:00
Michael Niedermayer 28875c4188 Merge commit '60c4660ba035bbfbcc84ac34129ce40e037c70ad'
* commit '60c4660ba035bbfbcc84ac34129ce40e037c70ad':
  swscale: fix an implementation-defined unsigned-to-signed conversion

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-13 01:26:49 +02:00
Justin Ruggles d9a542ace1 swscale: Set alpha to opaque for internal palettes.
Fixes conversion of pal8 to rgb formats with alpha.

Updated references for 2 FATE tests which previously encoded fully
transparent images.

Based on a patch by Baptiste Coudurier <baptiste.coudurier@gmail.com>
2014-04-12 14:07:19 -04:00
Justin Ruggles 60c4660ba0 swscale: fix an implementation-defined unsigned-to-signed conversion 2014-04-12 13:24:47 -04:00
Justin Ruggles 20c38c9c18 swscale: fix some undefined signed left shifts
Based on a patch by Michael Niedermayer <michaelni@gmx.at>
2014-04-12 13:24:47 -04:00
Lukasz Marek fbf05759e3 sws: fix warning about RGB_PACK24_B_OPERANDS redefinition
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 02:07:07 +02:00
Michael Niedermayer d98688efb1 swscale/input: replace assert() by av_assert1()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-09 05:14:34 +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
Michael Niedermayer 2fcef4a044 swscale/swscale_internal: remove obsolete warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-08 19:09:05 +02:00
Michael Niedermayer 955d7e26b6 swscale/swscale_internal: make the offset strings update themselfs when the MAX_FILTER_SIZE is changed
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-08 18:51:34 +02:00
Michael Niedermayer f6759d9ad4 swscale/x86/swscale_template: loose hardcoded dstw_offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-08 18:39:39 +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
Michael Niedermayer 0371eaebcd Merge commit 'aba70bb5387f12dfa5e6cd8cb861c9c7e668151f'
* commit 'aba70bb5387f12dfa5e6cd8cb861c9c7e668151f':
  Add missing headers to make template files compile (more) standalone

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-26 14:50:55 +01:00
Diego Biurrun aba70bb538 Add missing headers to make template files compile (more) standalone 2014-03-26 04:31:27 -07: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
Michael Niedermayer c9c0451224 swscale/swscale: fix integer overflow
Should fix fate failure with clang ftrapv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-24 05:01:32 +01:00
Carl Eugen Hoyos 074db4b764 Add APIchanges entry and bump libswscale micro version for making gray16 full-scale. 2014-03-19 09:11:22 +01:00
Matt Oliver 8236747511 Automatically change MANGLE() into named inline asm operands when direct symbol reference in inline asm are not supported.
This is part of the patch-set for intel C inline asm on windows support

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-18 23:39:30 +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
Michael Niedermayer 6b1ca1709f Merge commit '1481d24c3a0abf81e1d7a514547bd5305232be30'
* commit '1481d24c3a0abf81e1d7a514547bd5305232be30':
  RGBA64 pixel formats

Conflicts:
	doc/APIchanges
	libavutil/pixdesc.c
	libavutil/pixfmt.h
	libavutil/version.h
	libswscale/utils.c

See: 9569a3c9f4
See: 92afb43162, as well as others
Note: the enum values added in libav are incompatible/different to what ffmpeg used since 3 years
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 14:41:13 +01:00
Matt Oliver 9eb3f11c55 Add missing external declarations.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 00:48:09 +01:00
Michael Niedermayer 2f955d572b swscale/x86/swscale: remove unused constants
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 00:06:45 +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
Michael Niedermayer 6c47a4e972 swscale/x86/swscale: fix missing xmm clobbers in yuv2yuvX_sse3()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 22:52:22 +01:00
Michael Niedermayer 3141b04c7f Merge commit 'da785231ea0b82b5c2526babbb2871c935b21a87'
* commit 'da785231ea0b82b5c2526babbb2871c935b21a87':
  bfin: Refactor duplicated assembly-related macros

Conflicts:
	libavcodec/bfin/hpel_pixels_bfin.S

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-14 01:56:25 +01:00
Michael Niedermayer 91a61c4c15 Merge commit 'e99af2a3b1660b4f328335149980064692097cad'
* commit 'e99af2a3b1660b4f328335149980064692097cad':
  bfin: Refactor duplicated l1_text/l1_data_B macros

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-14 01:49:44 +01:00
Michael Niedermayer 3fc2362aef Merge commit 'b4dd424d96f09f9bafb88e47f37df65dc4529143'
* commit 'b4dd424d96f09f9bafb88e47f37df65dc4529143':
  Remove all SPARC architecture optimizations

Conflicts:
	Makefile
	configure
	libavcodec/sparc/dsputil_vis.c
	libavcodec/sparc/dsputil_vis.h
	libavcodec/sparc/hpeldsp_vis.c
	libavcodec/sparc/simple_idct_vis.c
	libavcodec/sparc/vis.h
	libswscale/sparc/yuv2rgb_vis.c
	libswscale/swscale_internal.h

If someone wants to maintain these (or other) SPARC optimizations, please
contact me or ffmpeg-devel.
I am happy to revert this removial if theres someone considering to
maintain this code.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-13 22:35:47 +01:00
Diego Biurrun da785231ea bfin: Refactor duplicated assembly-related macros 2014-03-13 08:15:52 -07:00
Diego Biurrun e99af2a3b1 bfin: Refactor duplicated l1_text/l1_data_B macros 2014-03-13 08:15:52 -07:00
Diego Biurrun b4dd424d96 Remove all SPARC architecture optimizations
SPARC is no longer being used in any multimedia-related fields and the
VIS optimizations only represent a maintenance burden.
2014-03-13 05:50:28 -07: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 977abf9aed Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rgb2rgb_template: add MMX/SSE2/AVX-optimized deinterleaveBytes

Conflicts:
	libswscale/x86/rgb2rgb_template.c

See: 3033cd7555
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 22:20:26 +01:00
Michael Niedermayer ef25595b71 Merge commit '7597e6efe492cb2449bb771054d64cc7fdf62ff5'
* commit '7597e6efe492cb2449bb771054d64cc7fdf62ff5':
  swscale/x86/rgb2rgb: add support for AVX

Conflicts:
	libswscale/x86/rgb2rgb_template.c

See: 4729b529e6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 22:03:28 +01:00
Michael Niedermayer 53feab7a4e Merge commit '9047491f8bcd87673eed55fb310647a03b0981e9'
* commit '9047491f8bcd87673eed55fb310647a03b0981e9':
  swscale: add nv12/nv21->yuv420 converter

Conflicts:
	libswscale/rgb2rgb.c
	libswscale/rgb2rgb_template.c

See: ef627bf9ec
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 21:55:20 +01:00
Michael Niedermayer 91c981857b rgb2rgb_template: add MMX/SSE2/AVX-optimized deinterleaveBytes
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-21 18:03:41 +01:00
Michael Niedermayer 7597e6efe4 swscale/x86/rgb2rgb: add support for AVX
This does not yet include any actual AVX code

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-21 18:01:29 +01:00
Michael Niedermayer 9047491f8b swscale: add nv12/nv21->yuv420 converter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-21 17:55:07 +01:00
Michael Niedermayer eb01a25fe1 swscale: fix stride used in planarToNv12Wrapper()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-21 17:54:40 +01:00
Michael Niedermayer b148a39d55 Merge commit '46bacb5cc6169ff5e8e982495c4925467c1d8bb7'
* commit '46bacb5cc6169ff5e8e982495c4925467c1d8bb7':
  x86: Consistently use cpu flag detection macros in places that still miss it

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 14:44:59 +01:00
Diego Biurrun 46bacb5cc6 x86: Consistently use cpu flag detection macros in places that still miss it 2014-01-14 00:04:58 +01:00
Michael Niedermayer 6bd001d766 swscale: disable ARM code until its build failure with clang/iphone is fixed
See: "19:40 Yu Xiaolei Re: [FFmpeg-devel] [PATCH] fix build with gas-preprocessor.pl"

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 19:58:38 +01:00
Michael Niedermayer 6044f161d3 Revert "swscale: disable ARM code until its build failure with clang/iphone is fixed"
This reverts commit c8c7736c10.
2014-01-12 18:01:39 +01:00
Yu Xiaolei 842b8f4ba2 fix build with gas-preprocessor.pl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 18:01:39 +01:00
Michael Niedermayer ab9d7e0b12 swscale: fix rgb48Toxyz12() endianness
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 17:26:39 +01:00
Carl Eugen Hoyos 693a36b6f8 Unscaled 16bit packed RGB to planar GBR converter.
Fixes r210(rgb48) -> ffv1 (gbrp10) -> r210 roundtrip
as reported by forum user JasonCA.
2014-01-10 10:47:46 +01:00
Michael Niedermayer c8c7736c10 swscale: disable ARM code until its build failure with clang/iphone is fixed
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 17:17:34 +01:00
Yu Xiaolei af228a9f9f swscale/arm: fix build error with --enable-shared
use string comparison in assembler derivatives to prevents assembler from treating names in test expressions as imported symbols

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-28 14:28:25 +01:00
Michael Niedermayer 25b243759c Merge commit 'b83d1ee3b41cfe8357836e2582104db2f3364cb0'
* commit 'b83d1ee3b41cfe8357836e2582104db2f3364cb0':
  avutil: Move library version related macros to version.h

Conflicts:
	libavcodec/version.h
	libavresample/version.h
	libavutil/avutil.h
	libavutil/utils.c

See: 183117fed7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 12:01:23 +01:00
Diego Biurrun b83d1ee3b4 avutil: Move library version related macros to version.h
This is a more sensible place for these macros.
2013-12-26 19:05: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 f618cb1a4b swscale/x86/rgb2rgb_template: try to fix build failure with avx disabled
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-16 03:38:13 +01:00
Yu Xiaolei 1c67ad9d93 swscale: NEON optimized unscaled rgba to nv12 conversion
Signed-off-by: Yu Xiaolei <dreifachstein@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-16 00:47:39 +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 688c3d944d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doxy: Define a group for libswscale documentation

Conflicts:
	libavutil/avutil.h
	libswscale/swscale.h

See: 18d9398143
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-14 13:09:30 +01:00
Michael Niedermayer 445c58a8c6 swscale/x86/rgb2rgb: Make sure COMPILE_TEMPLATE_AVX is defined
Found-by: iive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-14 02:54:28 +01:00
Michael Niedermayer 3f4290a206 swscale/x86/rgb2rgb_template: try to fix build without AVX
Found-by: iive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-14 02:22:44 +01:00
Luca Barbato c85aad9cb2 doxy: Define a group for libswscale documentation
Uniform the style and eliminate a warning on newer doxygen version..
2013-12-13 23:53:30 +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
James Almer 56572787ae Add Windows resource file support for shared libraries
Originally written by James Almer <jamrial@gmail.com>

With the following contributions by Timothy Gu <timothygu99@gmail.com>

* Use descriptions of libraries from the pkg-config file generation function
* Use "FFmpeg Project" as CompanyName (suggested by Alexander Strasser)
* Use "FFmpeg" for ProductName as MSDN says "name of the product with which the
  file is distributed" [1].
* Use FFmpeg's version (N-xxxxx-gxxxxxxx) for ProductVersion per MSDN [1].
* Only build the .rc files when --enable-small is not enabled.

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-05 23:42:07 +01:00
Michael Niedermayer 8733b363ac Merge commit 'c16bfb147df8a9d350e8a0dbc01937b78faf5949'
* commit 'c16bfb147df8a9d350e8a0dbc01937b78faf5949':
  swscale: x86: Consistently use lowercase function name suffixes

Conflicts:
	libswscale/x86/rgb2rgb.c
	libswscale/x86/swscale.c

See: 1de064e21e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-23 12:10:40 +01:00
Diego Biurrun c16bfb147d swscale: x86: Consistently use lowercase function name suffixes 2013-11-22 23:01:51 +01:00
Michael Niedermayer f836b0c581 swscale/x86: SIMD deinterleaveBytes() depends on YASM
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 22:36:27 +01:00
Michael Niedermayer 3033cd7555 swscale/x86/rgb2rgb_template: add mmx/sse2/avx optimized deinterleaveBytes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 15:13:48 +01:00
Michael Niedermayer 1de064e21e swscale/x86/rgb2rgb: change cpu optim identifiers to lower case
This makes the code more similar to the other optims and allows us
to use the same macros to build function names

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 15:13:48 +01:00
Michael Niedermayer 4729b529e6 swscale/x86/rgb2rgb: extend framework to also include AVX
This does not yet include any actual AVX code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 15:13:48 +01:00
Michael Niedermayer 94d7ca2b58 swscale: fix used stride in planarToNv12Wrapper()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 15:13:48 +01:00
Michael Niedermayer ef627bf9ec swscale: add nv12/nv21->yuv420 converter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 15:13:48 +01:00
Michael Niedermayer 6909a611d2 swscale/swscale_unscaled: fix right column handling in planarCopyWrapper
Found-by: Михаил <Micky53@mail.ru>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-16 21:15:05 +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
Reimar Döffinger 4fab08c94f Optimize pure C unscaled yuv2rgb.
Aligning the tables reduces the amount of code generated on
e.g. ARM as the offset constant then has few enough set bits
so it can be encoded inside a single instruction instead of 2.
Ideally all should be declared aligned, but the DECLARE_ALIGNED
macros does not work with pointer tables, thus also reordered
the tables.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-10-30 20:52:24 +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 d0a3bc1302 swscale/yuv2rgb: clip cy, avoid division by 0 with 0 contrast
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-17 14:02:43 +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
Paul B Mahol 37d6b2b4e6 swsscale/swscale_unscaled: add GBRAP16
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 20:44:12 +02:00
Michael Niedermayer 9ec9d46365 swscale/swscale_unscaled: fix alpha pointer & stride for planarRgb16ToRgb16Wrapper()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 20:44:12 +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
Michael Niedermayer ccf96f8c64 swscale/options: switch default to bicubic
Suggested-by: Ronald S. Bultje
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-06 10:47:09 +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
wm4 01e3340fb6 swscale: make bilinear scaling the default
Before this commit, sws_init_context() failed with an error if no scaler
was explicitly set.

Defaulting to something reasonable is better behavior.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-30 18:14:58 +02:00
Michael Niedermayer 13eff473ad swscale/swscale_unscaled: fix alpha values for rgb/bgr -> RGB32_1 / BGR32_1
Found-by: Justin Ruggles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-19 23:15:51 +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