Commit Graph

502 Commits

Author SHA1 Message Date
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
Xi Wang
f73f76fd20 swscale: fix NULL checking in sws_alloc_context()
sws_getCachedContext() and sws_getContext() expect sws_alloc_context()
to return NULL when out of memory, as follows.

    if (!(context = sws_alloc_context()))
        return NULL;

This patch fixes sws_alloc_context() to return NULL in that case.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-01-04 20:44:00 -05:00
Michael Niedermayer
add7513e64 Merge commit 'fa8fcab1e0d31074c0644c4ac5194474c6c26415'
* commit 'fa8fcab1e0d31074c0644c4ac5194474c6c26415':
  x86: h264_chromamc_10bit: drop pointless PAVG %define
  x86: mmx2 ---> mmxext in function names
  swscale: do not forget to swap data in formats with different endianness

Conflicts:
	libavcodec/x86/dsputil_mmx.c
	libavfilter/x86/gradfun.c
	libswscale/input.c
	libswscale/utils.c
	libswscale/x86/swscale.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-01 13:11:51 +01:00
Diego Biurrun
d8eda37080 x86: mmx2 ---> mmxext in function names 2012-10-31 17:53:57 +01:00
Michael Niedermayer
4b874fc4fc Merge commit 'a65bdceb060628881578afb29df4eb222421381f'
* commit 'a65bdceb060628881578afb29df4eb222421381f':
  x86: mmx2 ---> mmxext in variable names

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-31 14:08:49 +01:00
Michael Niedermayer
78ec407d5a Merge commit '652f5185945c8405fc57aed353286858df8d066f'
* commit '652f5185945c8405fc57aed353286858df8d066f':
  x86: mmx2 ---> mmxext in comments and messages

Conflicts:
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-31 14:02:35 +01:00
Diego Biurrun
a65bdceb06 x86: mmx2 ---> mmxext in variable names 2012-10-31 00:37:42 +01:00
Diego Biurrun
652f518594 x86: mmx2 ---> mmxext in comments and messages 2012-10-31 00:37:42 +01:00
Michael Niedermayer
a201639a01 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pixfmt: support more yuva formats
  swscale: support gray to 9bit and 10bit formats
  configure: rewrite print_config() function using awk
  FATE: fix (AD)PCM test dependencies broken in e519990
  Use ptrdiff_t instead of int for intra pred "stride" function parameter.
  x86: use PRED4x4/8x8/8x8L/16x16 macros to declare intrapred prototypes.

Conflicts:
	libavcodec/h264pred.c
	libavcodec/h264pred_template.c
	libavutil/pixfmt.h
	libswscale/swscale_unscaled.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>
2012-10-30 17:47:36 +01:00
Luca Barbato
7658295ba3 pixfmt: support more yuva formats
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-30 12:02:42 +01:00
Michael Niedermayer
8edf9b1fa4 sws: rgb has no range, avoid random results if the user tries to mess with it anyway.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-28 02:46:56 +02:00
Michael Niedermayer
425c30ddae sws: loose the minimum dimension checks
A few quick tests show no fundamental problem with such diemnsions

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-27 16:54:31 +02:00
Michael Niedermayer
733f85b7ae sws: improve error messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-27 16:54:05 +02:00
Michael Niedermayer
7de2196029 sws: fix extreem downscaling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-27 16:29:24 +02:00
Michael Niedermayer
e823e73677 sws_getGaussianVec: check variance and quality
Found-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-27 01:25:00 +02:00
Michael Niedermayer
fe573d1a9b sws_allocVec: check length validity
Found-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-27 01:24:51 +02:00
Michael Niedermayer
ae237a117a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: try to use mmap only if available
  configure: check for mprotect
  wmapro: use planar sample format
  wmalossless: output in planar sample format
  wmadec: use float planar sample format output
  shorten: use planar sample format
  lavc: update documentation for AVFrame.extended_data

Conflicts:
	libavcodec/shorten.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-15 14:09:35 +02:00
Mans Rullgard
95cd815c36 swscale: try to use mmap only if available
Some systems, e.g. Minix, have sys/mman.h defining MAP_ANONYMOUS without
providing (working) mmap and friends.  The mmx filter generation code
checks only for MAP_ANONYMOUS, not for availability of mmap itself which
leads to build errors on aforementioned systems.

This changes the conditional compilation to use mmap only if all the
required functions are available.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-15 02:39:49 +01:00
Paul B Mahol
a291345b1e sws: do not use av_pix_fmt_descriptors directly
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-12 16:57:04 +00:00
Michael Niedermayer
a9bd51b1e6 Merge commit '9953ff3cd844eb5f6d8dfce98cad94b78a0fc7dc'
* commit '9953ff3cd844eb5f6d8dfce98cad94b78a0fc7dc':
  mpegvideo: fix indentation
  sws: do not use av_pix_fmt_descriptors directly.

Conflicts:
	libavcodec/mpegvideo.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-12 15:57:28 +02:00
Luca Barbato
6d5600e855 avutil: add yuva422p and yuva444p formats 2012-10-12 15:09:51 +02:00
Anton Khirnov
0a7068fa5d sws: do not use av_pix_fmt_descriptors directly. 2012-10-12 12:45:38 +02:00
Michael Niedermayer
ac627b3d38 Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
  Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

Conflicts:
	doc/examples/muxing.c
	ffmpeg.h
	ffmpeg_filter.c
	ffmpeg_opt.c
	ffplay.c
	ffprobe.c
	libavcodec/8bps.c
	libavcodec/aasc.c
	libavcodec/aura.c
	libavcodec/avcodec.h
	libavcodec/avs.c
	libavcodec/bfi.c
	libavcodec/bmp.c
	libavcodec/bmpenc.c
	libavcodec/c93.c
	libavcodec/cscd.c
	libavcodec/cyuv.c
	libavcodec/dpx.c
	libavcodec/dpxenc.c
	libavcodec/eatgv.c
	libavcodec/escape124.c
	libavcodec/ffv1.c
	libavcodec/flashsv.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/huffyuv.c
	libavcodec/iff.c
	libavcodec/imgconvert.c
	libavcodec/indeo3.c
	libavcodec/kmvc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c
	libavcodec/motionpixels.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pamenc.c
	libavcodec/pcxenc.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/pnm.c
	libavcodec/pnmdec.c
	libavcodec/pnmenc.c
	libavcodec/ptx.c
	libavcodec/qdrw.c
	libavcodec/qpeg.c
	libavcodec/qtrleenc.c
	libavcodec/raw.c
	libavcodec/rawdec.c
	libavcodec/rl2.c
	libavcodec/sgidec.c
	libavcodec/sgienc.c
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavcodec/sunrast.c
	libavcodec/targa.c
	libavcodec/targaenc.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/tmv.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/vb.c
	libavcodec/vp3.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/xwddec.c
	libavcodec/xwdenc.c
	libavcodec/yop.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/drawutils.c
	libavfilter/formats.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_format.c
	libavfilter/vf_hflip.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/movenc.c
	libavformat/mxf.h
	libavformat/utils.c
	libavformat/yuv4mpeg.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libswscale/input.c
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/x86/swscale_template.c
	libswscale/x86/yuv2rgb.c
	libswscale/x86/yuv2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:06:57 +02:00
Anton Khirnov
716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Michael Niedermayer
77aedc77ab Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: Provide the right alignment for external mmx asm
  x86: Replace checks for CPU extensions and flags by convenience macros
  configure: msvc: fix/simplify setting of flags for hostcc
  x86: mlpdsp: mlp_filter_channel_x86 requires inline asm

Conflicts:
	libavcodec/x86/fft_init.c
	libavcodec/x86/h264_intrapred_init.c
	libavcodec/x86/h264dsp_init.c
	libavcodec/x86/mpegaudiodec.c
	libavcodec/x86/proresdsp_init.c
	libavutil/x86/float_dsp_init.c
	libswscale/utils.c
	libswscale/x86/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-09 13:27:42 +02:00
Martin Storsjö
75c37c5ace swscale: Provide the right alignment for external mmx asm
This reverts parts of e0c6cce447. There is external mmx asm that
requires this alignment.

This fixes crashes when using swscale in builds with external mmx,
without inline assembly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-09 01:52:35 +03:00
Diego Biurrun
e0c6cce447 x86: Replace checks for CPU extensions and flags by convenience macros
This separates code relying on inline from that relying on external
assembly and fixes instances where the coalesced check was incorrect.
2012-09-08 18:18:34 +02:00
Michael Niedermayer
c617bed34f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  MSS1 and MSS2: set final pixel format after common stuff has been initialised
  MSS2 decoder
  configure: handle --disable-asm before check_deps
  x86: Split inline and external assembly #ifdefs
  configure: x86: Separate inline from standalone assembler capabilities
  pktdumper: Use a custom define instead of PATH_MAX for buffers
  pktdumper: Use av_strlcpy instead of strncpy
  pktdumper: Use sizeof(variable) instead of the direct buffer length

Conflicts:
	Changelog
	configure
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/codec_desc.c
	libavcodec/dct-test.c
	libavcodec/imgconvert.c
	libavcodec/mss12.c
	libavcodec/version.h
	libavfilter/x86/gradfun.c
	libswscale/x86/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-31 13:34:32 +02:00
Diego Biurrun
17337f54c0 x86: Split inline and external assembly #ifdefs 2012-08-31 01:53:25 +02:00
Michael Niedermayer
9f088a1ed4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo: reduce excessive inlining of mpeg_motion()
  mpegvideo: convert mpegvideo_common.h to a .c file
  build: factor out mpegvideo.o dependencies to CONFIG_MPEGVIDEO
  Move MASK_ABS macro to libavcodec/mathops.h
  x86: move MANGLE() and related macros to libavutil/x86/asm.h
  x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h
  aacdec: Don't fall back to the old output configuration when no old configuration is present.
  rtmp: Add message tracking
  rtsp: Support mpegts in raw udp packets
  rtsp: Support receiving plain data over UDP without any RTP encapsulation
  rtpdec: Remove an unused include
  rtpenc: Remove an av_abort() that depends on user-supplied data
  vsrc_movie: discourage its use with avconv.
  avconv: allow no input files.
  avconv: prevent invalid reads in transcode_init()
  avconv: rename OutputStream.is_past_recording_time to finished.

Conflicts:
	configure
	doc/filters.texi
	ffmpeg.c
	ffmpeg.h
	libavcodec/Makefile
	libavcodec/aacdec.c
	libavcodec/mpegvideo.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-09 19:31:56 +02:00
Mans Rullgard
c318626ce2 x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h
This puts x86-specific things in the x86/ subdirectory where they
belong.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 00:58:20 +01:00
Michael Niedermayer
e776ee8f29 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavr: fix handling of custom mix matrices
  fate: force pix_fmt in lagarith-rgb32 test
  fate: add tests for lagarith lossless video codec.
  ARMv6: vp8: fix stack allocation with Apple's assembler
  ARM: vp56: allow inline asm to build with clang
  fft: 3dnow: fix register name typo in DECL_IMDCT macro
  x86: dct32: port to cpuflags
  x86: build: replace mmx2 by mmxext
  Revert "wmapro: prevent division by zero when sample rate is unspecified"
  wmapro: prevent division by zero when sample rate is unspecified
  lagarith: fix color plane inversion for YUY2 output.
  lagarith: pad RGB buffer by 1 byte.
  dsputil: make add_hfyu_left_prediction_sse4() support unaligned src.

Conflicts:
	doc/APIchanges
	libavcodec/lagarith.c
	libavfilter/x86/gradfun.c
	libavutil/cpu.h
	libavutil/version.h
	libswscale/utils.c
	libswscale/version.h
	libswscale/x86/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-04 23:51:43 +02:00
Diego Biurrun
239fdf1b4a x86: build: replace mmx2 by mmxext
Refactoring mmx2/mmxext YASM code with cpuflags will force renames.
So switching to a consistent naming scheme beforehand is sensible.
The name "mmxext" is more official and widespread and also the name
of the CPU flag, as reported e.g. by the Linux kernel.
2012-08-03 22:51:05 +02:00
Michael Niedermayer
2cb4d51654 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  v410dec: Implement explode mode support
  zerocodec: fix direct rendering.
  wav: init st to NULL to avoid a false-positive warning.
  wavpack: set bits_per_raw_sample for S32 samples to properly identify 24-bit
  h264: refactor NAL decode loop
  RTMPTE protocol support
  RTMPE protocol support
  rtmp: Add ff_rtmp_calc_digest_pos()
  rtmp: Rename rtmp_calc_digest to ff_rtmp_calc_digest and make it global
  swscale: add missing HAVE_INLINE_ASM check.
  lavfi: place x86 inline assembly under HAVE_INLINE_ASM.
  vc1: Add a test for interlaced field pictures
  swscale: Mark all init functions as av_cold
  swscale: x86: Drop pointless _mmx suffix from filenames
  lavf: use conditional notation for default codec in muxer declarations.
  swscale: place inline assembly bilinear scaler under HAVE_INLINE_ASM.
  dsputil: ppc: cosmetics: pretty-print
  dsputil: x86: add SHUFFLE_MASK_W macro
  configure: respect CC_O setting in check_cc

Conflicts:
	Changelog
	configure
	libavcodec/v410dec.c
	libavcodec/zerocodec.c
	libavformat/asfenc.c
	libavformat/version.h
	libswscale/utils.c
	libswscale/x86/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-23 21:25:09 +02:00
Diego Biurrun
5a6e3c039c swscale: Mark all init functions as av_cold 2012-07-23 01:30:05 +02:00
Ronald S. Bultje
a6e922ffa2 swscale: place inline assembly bilinear scaler under HAVE_INLINE_ASM. 2012-07-22 16:08:13 -07:00
Michael Niedermayer
21d8255423 sws: handle non native rgb<->rgb convertions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-17 14:40:59 +02:00
Michael Niedermayer
fa36f33422 sws: support 12&14 bit planar colorspaces
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-04 23:47:01 +02:00
Michael Niedermayer
e003da7139 sws/utils: use av_assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-16 17:34:07 +02:00
Carl Eugen Hoyos
143a5c55ff Add yuva422p pix_fmt. 2012-05-08 08:39:37 +02:00
Michael Niedermayer
367d9b2957 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: K&R formatting cosmetics (part II)
  tiffdec: Add a malloc check and refactor another.
  faxcompr: Check malloc results and unify return path
  configure: escape colons in values written to config.fate
  ac3dsp: call femms/emms at the end of float_to_fixed24() for 3DNow and SSE
  matroska: Fix leaking memory allocated for laces.
  pthread: Fix crash due to fctx->delaying not being cleared.
  vp3: Assert on invalid filter_limit values.
  h264: fix 10bit biweight functions after recent x86inc.asm fixes.
  ffv1: Fix size mismatch in encode_line.
  movenc: Remove a dead initialization
  git-howto: Explain how to avoid Windows line endings in git checkouts.
  build: Move all arch OBJS declarations into arch subdirectory Makefiles.

Conflicts:
	configure
	libavcodec/vp3.c
	libavformat/matroskadec.c
	libavutil/Makefile
	libswscale/Makefile
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-13 21:50:37 +02:00
Diego Biurrun
ef0ee7f657 swscale: K&R formatting cosmetics (part II)
Also adjust some comments including wording and typo fixes.
2012-04-13 19:22:00 +02:00
Michael Niedermayer
87a72b9122 swscale: Merge a hunk from qatar that seems to have been forgotten or lost.
Author of the code from qatar is Ronald S. Bultje
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-21 15:30:52 +01:00
Michael Niedermayer
6df42f9874 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  SBR DSP: fix SSE code to not use SSE2 instructions.
  cpu: initialize mask to -1, so that by default, optimizations are used.
  error_resilience: initialize s->block_index[].
  svq3: protect against negative quantizers.
  Don't use ff_cropTbl[] for IDCT.
  swscale: make filterPos 32bit.
  FATE: add CPUFLAGS variable, mapping to -cpuflags avconv option.
  avconv: add -cpuflags option for setting supported cpuflags.
  cpu: add av_set_cpu_flags_mask().
  libx264: Allow overriding the sliced threads option
  avconv: fix counting encoded video size.

Conflicts:
	doc/APIchanges
	doc/fate.texi
	doc/ffmpeg.texi
	ffmpeg.c
	libavcodec/h264idct_template.c
	libavcodec/svq3.c
	libavutil/avutil.h
	libavutil/cpu.c
	libavutil/cpu.h
	libswscale/swscale.c
	tests/Makefile
	tests/fate-run.sh
	tests/regression-funcs.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-07 03:22:49 +01:00
Michael Niedermayer
4707f1da8a swscale: remove duplicate PIX_FMT_GBRP entry from format_entries.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-07 00:22:20 +01:00
Ronald S. Bultje
2254b559cb swscale: make filterPos 32bit.
Fixes overflows for large image sizes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-06 10:47:41 -08:00
Carl Eugen Hoyos
f972193a15 Support RGBA64 as input colour space.
Mostly fixes ticket #503,
opaque still overflows for RGBA64 -> RGBA conversion.
2012-03-04 00:43:18 +01:00
Michael Niedermayer
79ae084e9b Merge remote-tracking branch 'qatar/master'
* qatar/master: (58 commits)
  amrnbdec: check frame size before decoding.
  cscd: use negative error values to indicate decode_init() failures.
  h264: prevent overreads in intra PCM decoding.
  FATE: do not decode audio in the nuv test.
  dxa: set audio stream time base using the sample rate
  psx-str: do not allow seeking by bytes
  asfdec: Do not set AVCodecContext.frame_size
  vqf: set packet parameters after av_new_packet()
  mpegaudiodec: use DSPUtil.butterflies_float().
  FATE: add mp3 test for sample that exhibited false overreads
  fate: add cdxl test for bit line plane arrangement
  vmnc: return error on decode_init() failure.
  libvorbis: add/update error messages
  libvorbis: use AVFifoBuffer for output packet buffer
  libvorbis: remove unneeded e_o_s check
  libvorbis: check return values for functions that can return errors
  libvorbis: use float input instead of s16
  libvorbis: do not flush libvorbis analysis if dsp state was not initialized
  libvorbis: use VBR by default, with default quality of 3
  libvorbis: fix use of minrate/maxrate AVOptions
  ...

Conflicts:
	Changelog
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/dpxenc.c
	libavcodec/libvorbis.c
	libavcodec/vmnc.c
	libavformat/asfdec.c
	libavformat/id3v2enc.c
	libavformat/internal.h
	libavformat/mp3enc.c
	libavformat/utils.c
	libavformat/version.h
	libswscale/utils.c
	tests/fate/video.mak
	tests/ref/fate/nuv
	tests/ref/fate/prores-alpha
	tests/ref/lavf/ffm
	tests/ref/vsynth1/prores
	tests/ref/vsynth2/prores

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-01 03:17:11 +01:00
Ronald S. Bultje
791de61bbb swscale: fix another integer overflow.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-29 11:19:03 -08:00
Ronald S. Bultje
2bb628f870 swscale: fix another integer overflow at large dimensions/rescales. 2012-02-24 15:39:55 -08:00
Michael Niedermayer
e2cc39b609 Merge remote-tracking branch 'qatar/master'
* qatar/master: (40 commits)
  swf: check return values for av_get/new_packet().
  wavpack: Don't shift minclip/maxclip
  rtpenc: Expose the max packet size via an avoption
  rtpenc: Move max_packet_size to a context variable
  rtpenc: Add an option for not sending RTCP packets
  lavc: drop encode() support for video.
  snowenc: switch to encode2().
  snowenc: don't abuse input picture for storing information.
  a64multienc: switch to encode2().
  a64multienc: don't write into output buffer when there's no output.
  libxvid: switch to encode2().
  tiffenc: switch to encode2().
  tiffenc: properly forward error codes in encode_frame().
  lavc: drop libdirac encoder.
  gifenc: switch to encode2().
  libvpxenc: switch to encode2().
  flashsvenc: switch to encode2().
  Remove libpostproc.
  lcl: don't overwrite input memory.
  swscale: take first/lastline over/underflows into account for MMX.
  ...

Conflicts:
	.gitignore
	Makefile
	cmdutils.c
	configure
	doc/APIchanges
	libavcodec/Makefile
	libavcodec/allcodecs.c
	libavcodec/libdiracenc.c
	libavcodec/libxvidff.c
	libavcodec/qtrleenc.c
	libavcodec/tiffenc.c
	libavcodec/utils.c
	libavformat/mov.c
	libavformat/movenc.c
	libpostproc/Makefile
	libpostproc/postprocess.c
	libpostproc/postprocess.h
	libpostproc/postprocess_altivec_template.c
	libpostproc/postprocess_internal.h
	libpostproc/postprocess_template.c
	libswscale/swscale.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-24 02:57:18 +01:00
Ronald S. Bultje
19a65b5be4 swscale: fix overflows in filterPos[] calculation for large sizes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-23 10:30:07 -08:00
Ronald S. Bultje
1254022ea7 swscale: fix filtersize clipping.
if srcW<=2, clip(x, 1, srcW-2) still allows srcW to be < 1.
2012-02-22 16:54:20 -08:00
Michael Niedermayer
cd1c12b5c5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  FATE: update reference for seek-alac_mp4
  sunrast: Return AVERROR values instead of -1.
  sunrast: Add support for gray8 decoding.
  swscale: enforce a minimum filtersize.
  alacenc: use AVCodec.encode2()
  alacenc: cosmetics: indentation
  alacenc: consolidate bitstream writing into a single function.
  alacenc: only encode frame size in header for a final smaller frame
  alacenc: store current frame size in AlacEncodeContext.
  alacenc: return AVERROR codes in alac_encode_frame()
  alacenc: calculate a new max frame size for the final small frame
  alacenc: pretty-printing and other cosmetics
  alacenc: fix error handling and potential memleaks in alac_encode_init()
  alacenc: do not set coded_frame->key_frame
  alacenc: do not set bits_per_coded_sample
  alacenc: remove unneeded frame_size check in alac_encode_frame()
  tta: error out if samplerate is zero.
  ttadec: fix invalid free when an error occurs while decoding 24-bit tta
  wavpack: add needed braces for 2 statements inside an if block

Conflicts:
	tests/ref/acodec/alac

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-12 01:06:13 +01:00
Ronald S. Bultje
dae2ce361a swscale: enforce a minimum filtersize.
At very small dimensions, this calculation could lead to zero-sized
filters, which leads to uninitialized output, zero-sized allocations,
loop overflows in SIMD that uses do{..}while(i++<filtersize); instead
of for(i=0;i<filtersize;i++){..} and several other similar failures.
Therefore, require a minimum filtersize of 1.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-11 10:06:50 -08:00
Michael Niedermayer
c065255bba Merge remote-tracking branch 'qatar/master'
* qatar/master:
  aacenc: Fix LONG_START windowing.
  aacenc: Fix a bug where deinterleaved samples were stored in the wrong place.
  avplay: use the correct array size for stride.
  lavc: extend doxy for avcodec_alloc_context3().
  APIchanges: mention avcodec_alloc_context()/2/3
  avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS.
  aacsbr: ARM NEON optimised sbrdsp functions
  aacsbr: align some arrays
  aacsbr: move some simdable loops to function pointers
  cosmetics: Remove extra newlines at EOF

Conflicts:
	libavcodec/utils.c
	libavfilter/formats.c
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-29 00:34:59 +01:00
Alex Converse
7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Paul B Mahol
f9ca1ac796 sws/pixfmt/pixdesc: add support for yuva444p
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>

Conflicts:

	libavutil/avutil.h
	libavutil/pixfmt.h
2012-01-28 01:30:41 +01:00
Alex Converse
08628b6afb Revert "sws/pixfmt/pixdesc: add support for yuva444p"
This reverts commit fc115c80b7.

Tests are broken.
2012-01-26 18:06:57 -08:00
Paul B Mahol
fc115c80b7 sws/pixfmt/pixdesc: add support for yuva444p
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-27 09:24:08 +08:00
Michael Niedermayer
1c910d2f11 sws: Fix RGB0->alpha containing formats.
Fixes Ticket869

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 17:01:10 +01:00