third_party_ffmpeg/libavutil
wm4 463b81de2b imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 45df7adc1d.
2017-08-08 13:37:37 +02:00
..
aarch64 aarch64: Add parentheses around the offset parameter in movrel 2017-03-11 13:14:50 +02:00
arm Merge commit '6a1ea4ec932f4fc9fdc00ec51ee070b298ddb35f' 2017-04-04 16:04:29 -03:00
avr32 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb' 2016-06-21 21:55:34 +02:00
bfin Merge commit '880e2aa23645ed9871c66ee1cbd00f93c72d2d73' 2014-06-02 19:38:01 +02:00
mips libavcodec/mips: Optimize avc idct 4x4 for msa 2017-07-25 22:04:34 +02:00
ppc Merge commit '05a603a94e4b3eeefa5e18ae653a848001461e89' 2017-04-26 16:27:24 +02:00
sh4
tests fate: update pixfmt_best test to check for endianness 2017-07-27 08:53:37 +02:00
tomi
x86 x86inc: don't use read-only data sections on COFF targets 2017-06-27 12:48:04 -03:00
.gitignore Merge commit '257f00ec1ab06a2a161f535036c6512f3fc8e801' 2016-06-22 11:28:51 +02:00
adler32.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
adler32.h avutil: Group hash functions separately in Doxygen 2016-08-02 07:48:08 -07:00
aes_ctr.c avutil/aes_crt: free AVAESCTR struct properly 2016-02-03 19:33:23 -03:00
aes_ctr.h libavutil: add aes-ctr support 2015-12-15 14:16:28 +01:00
aes_internal.h lavu/aes: align AVAES struct members 2015-10-28 04:23:14 -05:00
aes.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
aes.h lavu: Drop deprecated context size variables 2015-08-28 16:04:27 +02:00
atomic_gcc.h Revert "lavu/atomic: add support for the new memory model aware gcc built-ins" 2017-03-08 00:48:37 -03:00
atomic_suncc.h lavu: remove the custom atomic API 2016-10-02 19:35:55 +02:00
atomic_win32.h lavu: remove the custom atomic API 2016-10-02 19:35:55 +02:00
atomic.c lavu: remove the custom atomic API 2016-10-02 19:35:55 +02:00
atomic.h lavu: remove the custom atomic API 2016-10-02 19:35:55 +02:00
attributes.h Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5' 2017-02-02 11:26:05 +01:00
audio_fifo.c Merge commit '0456e684394dc5a7b98ab9ebb48396d743bf3730' 2017-03-24 13:17:55 +01:00
audio_fifo.h avfilter: add loop filters 2016-02-18 11:55:00 +01:00
avassert.h avutil/avassert: Add av_assertX_fpu() 2016-10-22 13:50:09 +02:00
avstring.c avutil/avstring: improve av_strreplace implement 2017-04-11 10:54:35 +08:00
avstring.h avutil/avstring: improve av_strreplace implement 2017-04-11 10:54:35 +08:00
avutil.h lavu: add av_fourcc_make_string() and av_fourcc2str() 2017-03-29 14:49:29 +02:00
avutilres.rc Add Windows resource file support for shared libraries 2013-12-05 23:42:07 +01:00
base64.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
base64.h lavu/base64: add AV_BASE64_DECODE_SIZE() macro 2016-04-02 12:48:21 +02:00
blowfish.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
blowfish.h avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
bprint.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
bprint.h avutil/bprint: C++ compatible AVBPrint definition. 2014-11-29 03:51:35 +01:00
bswap.h Fix compile error on bfin. 2014-08-05 01:54:47 +02:00
buffer_internal.h Merge commit '27079a426c9d3db918b158976e44b9b143d78e1c' 2017-03-22 17:46:01 +01:00
buffer.c Merge commit '27079a426c9d3db918b158976e44b9b143d78e1c' 2017-03-22 17:46:01 +01:00
buffer.h Merge commit 'ec021d48445a414325ad59a73f9cde3212b173e4' 2017-03-18 19:22:30 +01:00
camellia.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
camellia.h avutil/camellia: fix documentation for av_camellia_crypt() 2015-01-02 21:23:45 +01:00
cast5.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
cast5.h avutil/cast5: update Doxygen for av_cast5_init with return information 2015-10-15 22:32:58 -04:00
channel_layout.c avutil/channel_layout: add av_get_extended_channel_layout 2017-01-24 23:51:36 +01:00
channel_layout.h avutil/channel_layout: add av_get_extended_channel_layout 2017-01-24 23:51:36 +01:00
color_utils.c lavu: Adding ARIB STD-B67 (hybrid log-gamma) enum value and transfer function. 2016-06-01 16:32:08 +02:00
color_utils.h avutil/color_utils: Add basic transfer functions for each AVColorTransferCharacteristic 2015-09-10 23:53:05 +02:00
colorspace.h Merge commit '1f77e634bb838f71ff21923b5e9fe3104c831c52' 2016-06-21 22:16:16 +02:00
common.h avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT 2016-01-27 16:36:46 +00:00
cpu_internal.h x86: add some more helper macros to check for slow cpuflags 2016-02-14 20:00:17 -03:00
cpu.c lavu/cpu: disable MMX warning on non x86 platforms 2017-06-29 18:00:58 +02:00
cpu.h Merge commit '7d7355aa92bb36ca0765c49a569a999bcb96f332' 2017-01-31 15:17:19 -03:00
crc.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
crc.h avutil: Add detailed Doxygen description to a few hashes 2016-08-02 07:48:21 -07:00
des.c Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196' 2016-06-22 13:44:34 +02:00
des.h avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
dict.c avformat: factorize iso 8601 timestamp writer to a dictionary avutil function 2016-08-17 23:45:41 +02:00
dict.h cosmetics: Fix spelling mistakes 2016-05-04 18:16:21 +02:00
display.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
display.h Merge commit '075acbb6ff5740b2eea1bb7dd3afbc8e66e2ebf8' 2017-04-13 17:31:15 -03:00
downmix_info.c Merge commit 'c98f3169bfb578c1a4e407b44524f0bfa3b4dc0c' 2014-02-16 02:05:29 +01:00
downmix_info.h fix spelling errors 2014-07-12 22:33:27 +02:00
dynarray.h dynarray: Change AV_ to FF_ for AV_DYNARRAY_ADD 2016-07-31 10:19:03 -07:00
error.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
error.h avutil/error: Introduce new error codes for 4XX and 5XX replies from remote servers 2014-10-19 22:32:14 +02:00
eval.c libavutil/eval: Add round function to expression parser 2017-06-06 18:31:47 +02:00
eval.h avutil/eval: minor typo 2015-11-01 19:35:01 -05:00
ffmath.h all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h 2016-03-22 10:15:31 -07:00
fifo.c libavutil/fifo: Fix fifo grow step 2016-06-03 14:49:56 +02:00
fifo.h avutil/fifo: add function av_fifo_generic_peek_at() 2015-10-14 20:23:58 +02:00
file_open.c lavu/file_open: Use current directory for temporary files also on Android. 2016-06-11 22:41:18 +02:00
file.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
file.h avutil/file: Move av_tempfile() to avutil/file_open ff_tempfile() 2016-03-12 02:08:34 +01:00
fixed_dsp.c x86/fixed_dsp: add ff_butterflies_fixed_sse2 2016-01-16 21:09:38 -03:00
fixed_dsp.h x86/fixed_dsp: add ff_butterflies_fixed_sse2 2016-01-16 21:09:38 -03:00
float_dsp.c avutil/float_dsp: add vector_dmac_scalar() 2017-04-10 12:04:14 +02:00
float_dsp.h avutil/float_dsp: add vector_dmac_scalar() 2017-04-10 12:04:14 +02:00
frame.c lavc, lavu: move frame cropping to a convenience function 2017-08-08 13:35:09 +02:00
frame.h lavc, lavu: move frame cropping to a convenience function 2017-08-08 13:35:09 +02:00
hash.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
hash.h avutil/hash: Add more detailed Doxygen documentation 2016-08-02 21:49:52 -07:00
hmac.c Merge commit '00b6a765430e5c5cacf0bd1be8b318d631cd4e14' 2017-05-05 13:27:03 +02:00
hmac.h lavu/hmac: remove deprecated type ids 2015-09-05 18:07:20 +02:00
hwcontext_cuda_internal.h avutil/hwcontext_cuda: use dynamically loaded CUDA 2016-11-22 10:34:27 +01:00
hwcontext_cuda.c hwcontext_cuda : Support YUV444P16 format 2017-08-03 15:25:35 -07:00
hwcontext_cuda.h avutil/hwcontext_cuda: use dynamically loaded CUDA 2016-11-22 10:34:27 +01:00
hwcontext_d3d11va.c hwcontext_d3d11va: use correct license header 2017-06-28 00:19:55 +02:00
hwcontext_d3d11va.h hwcontext_d3d11va: use correct license header 2017-06-28 00:19:55 +02:00
hwcontext_dxva2.c avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects 2017-05-16 21:45:52 +01:00
hwcontext_dxva2.h dxva: add support for new dxva2 and d3d11 hwaccel APIs 2017-06-27 18:05:02 +02:00
hwcontext_internal.h lavu: add new D3D11 pixfmt and hwcontext 2017-06-27 18:05:02 +02:00
hwcontext_qsv.c hwcontext_qsv: Implement mapping frames to the child device type 2017-06-14 22:27:07 +01:00
hwcontext_qsv.h Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da' 2016-09-28 13:30:27 -03:00
hwcontext_vaapi.c hwcontext_vaapi: Try to support the VDPAU wrapper 2017-06-14 22:23:43 +01:00
hwcontext_vaapi.h hwcontext_vaapi: Try to support the VDPAU wrapper 2017-06-14 22:23:43 +01:00
hwcontext_vdpau.c Merge commit '09a145b3c837273b1379321e44386a3233156e75' 2017-03-20 16:05:51 +01:00
hwcontext_vdpau.h Merge commit 'a001ce31bc2bcf875a39b5fb22dae49120293b42' 2016-02-17 16:16:34 +00:00
hwcontext_videotoolbox.c videotoolbox: add hwcontext support 2017-05-15 11:30:36 +02:00
hwcontext_videotoolbox.h hwcontext_videotoolbox: fix fate-source 2017-05-15 18:50:04 +02:00
hwcontext.c lavu: add new D3D11 pixfmt and hwcontext 2017-06-27 18:05:02 +02:00
hwcontext.h lavu: add new D3D11 pixfmt and hwcontext 2017-06-27 18:05:02 +02:00
imgutils_internal.h Merge commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5' 2017-03-20 08:34:10 +01:00
imgutils.c imgutils: add function to clear an image to black 2017-08-08 13:37:37 +02:00
imgutils.h imgutils: add function to clear an image to black 2017-08-08 13:37:37 +02:00
integer.c avutil/integer: Fix av_mod_i() with negative dividend 2015-12-01 13:26:12 +01:00
integer.h
internal.h avutil/internal: Do not enable CHECKED with DEBUG 2017-04-11 01:05:05 +02:00
intfloat.h Reinstate proper FFmpeg license for all files. 2013-08-30 15:47:38 +00:00
intmath.c intmath: remove av_ctz. 2015-10-11 18:03:10 -04:00
intmath.h lavu: rename and move ff_parity to av_parity 2016-01-07 20:04:24 -03:00
intreadwrite.h Merge commit 'f79d847400d218cfd0b95f10358fe6e65ec3c9c4' 2017-03-15 21:20:44 -03:00
lfg.c libavutil: add av_lfg_init_from_data() function 2017-01-22 02:28:53 +01:00
lfg.h libavutil: add av_lfg_init_from_data() function 2017-01-22 02:28:53 +01:00
libavutil.v build: Change structure of the linker version script templates 2016-05-29 16:43:11 +02:00
libm.h lavu/libm: add isfinite fallback 2016-01-13 20:00:19 -05:00
lls.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
lls.h Merge commit '50078c1c8070dd8d1c329e8117ff30ec72489039' 2016-01-02 10:25:12 +01:00
log2_tab.c
log.c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
log.h lavu: remove comma at final enumeration items to fix pedantic warnings 2016-10-26 19:36:09 +02:00
lzo.c avutil/lzo: split test out into a separate file 2016-05-13 22:48:56 -03:00
lzo.h
macros.h Merge commit '50078c1c8070dd8d1c329e8117ff30ec72489039' 2016-01-02 10:25:12 +01:00
Makefile avutil: merge slice threading implementation from avcodec and avfilter 2017-07-19 15:50:07 +07:00
mastering_display_metadata.c lavu: add support for Content Light Level side metadata 2017-04-06 11:26:25 -03:00
mastering_display_metadata.h lavu: add support for Content Light Level side metadata 2017-04-06 11:26:25 -03:00
mathematics.c lavu/mathematics: split closing bracket out of ifdefery 2017-03-18 23:50:05 +01:00
mathematics.h mathematics: Extend and edit Doxygen 2016-08-02 21:53:34 -07:00
md5.c Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551' 2017-05-05 13:04:38 +02:00
md5.h Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551' 2017-05-05 13:04:38 +02:00
mem_internal.h avutil/mem_internal: add missing header includes 2015-07-13 21:54:15 -03:00
mem.c Merge commit '4fb311c804098d78e5ce5f527f9a9c37536d3a08' 2017-03-20 08:54:44 +01:00
mem.h lavu/mem: clamp alignment to 16 for DJGPP 2017-03-29 14:49:29 +02:00
motion_vector.h avutil/motion_vector: export subpel motion information 2015-11-23 10:55:15 +01:00
murmur3.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
murmur3.h murmur3: Add Doxygen documentation 2016-08-02 07:50:44 -07:00
opencl_internal.c lavu: rename ff_opencl_set_parameter() to avpriv_opencl_set_parameter() 2014-08-12 03:49:45 +02:00
opencl_internal.h all: Add missing header guards 2016-01-28 19:49:48 -08:00
opencl.c libavutil/opencl: fixed uninitialized var warning 2016-05-23 11:28:03 +02:00
opencl.h all: Make header guard names consistent 2016-01-31 15:44:11 -08:00
opt.c Merge commit '67351924fa91dea4339109100a4c0689f006581f' 2017-03-30 10:26:29 +02:00
opt.h avutil/opt: Add AV_OPT_TYPE_UINT64 2016-11-23 02:01:05 +01:00
parseutils.c add locale month names to av_small_strptime 2017-02-26 17:16:22 +01:00
parseutils.h Merge commit '27f274628234c1f934b9a6a6380ed567c1b4ceae' 2015-04-07 20:46:25 +02:00
pca.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
pca.h avutil/pca: Make argument of ff_pca_add() const 2014-09-28 16:17:18 +02:00
pixdesc.c libavutil: add GRAY9 pixel format 2017-08-07 13:06:51 +02:00
pixdesc.h lavu: add AV_PIX_FMT_FLAG_BAYER 2017-03-20 08:02:30 +01:00
pixelutils.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
pixelutils.h avutil: add pixelutils API 2014-08-05 21:05:52 +02:00
pixfmt.h libavutil: add GRAY9 pixel format 2017-08-07 13:06:51 +02:00
qsort.h all: Add missing header guards 2016-01-28 19:49:48 -08:00
random_seed.c libavutil/random_seed: Ensure that get_generic_seed() spends at least 1/32 sec gathering entropy 2016-12-31 17:20:06 +01:00
random_seed.h
rational.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
rational.h rational: Extend Doxygen 2016-08-02 21:52:40 -07:00
rc4.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
rc4.h avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
replaygain.h Merge commit '29c2d06d67724e994980045afa055c6c34611b30' 2016-02-24 17:31:44 +00:00
reverse.c avutil: add ff_reverse as av_reverse replacement 2015-08-12 00:14:14 +02:00
reverse.h avutil/reverse: move the ff_reverse declaration to a separate header 2017-01-12 19:59:37 -03:00
ripemd.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
ripemd.h avutil: Group hash functions separately in Doxygen 2016-08-02 07:48:08 -07:00
samplefmt.c swresample: add int64 sample format 2016-08-18 15:30:05 +02:00
samplefmt.h swresample: add int64 sample format 2016-08-18 15:30:05 +02:00
sha512.c lavu/sha512: update length argument following sha+md5 changes 2017-05-05 13:24:35 +02:00
sha512.h lavu/sha512: update length argument following sha+md5 changes 2017-05-05 13:24:35 +02:00
sha.c Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551' 2017-05-05 13:04:38 +02:00
sha.h Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551' 2017-05-05 13:04:38 +02:00
slicethread.c avutil: merge slice threading implementation from avcodec and avfilter 2017-07-19 15:50:07 +07:00
slicethread.h avutil: merge slice threading implementation from avcodec and avfilter 2017-07-19 15:50:07 +07:00
softfloat_ieee754.h avutil/softfloat_ieee754: make all functions inline 2016-11-05 17:53:26 -03:00
softfloat_tables.h avutil/softfloat_tables: add missing stdint.h include 2015-04-30 17:38:41 -03:00
softfloat.h avutil/softfloat: Fix sign error in and improve documentation of av_int2sf() 2017-06-04 23:41:08 +02:00
spherical.c avutil/spherical: add av_spherical_projection_name() 2017-03-31 13:26:56 -03:00
spherical.h avutil/spherical: add av_spherical_projection_name() 2017-03-31 13:26:56 -03:00
stereo3d.c Merge commit '0c4468dc185fa8b9e7d6add914595c5e928b24fd' 2016-06-23 12:38:51 +02:00
stereo3d.h Merge commit '075acbb6ff5740b2eea1bb7dd3afbc8e66e2ebf8' 2017-04-13 17:31:15 -03:00
tablegen.h libavutil/tablegen: add missing math.h include 2015-12-04 14:49:35 +01:00
tea.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
tea.h Add support for TEA (Tiny Encryption Algorithm) 2015-07-21 23:10:44 +02:00
thread.h libavutil/thread.h: Fixed g++ build error when ASSERT_LEVEL is greater than 1 2017-04-22 23:32:41 +02:00
threadmessage.c avutil/threadmessage: fix error return in case of av_fifo_alloc failure 2017-07-14 02:30:37 +02:00
threadmessage.h avutil/threadmessage.h: Fix swapped comments 2016-06-16 23:54:51 +02:00
time_internal.h avutil/time_internal: do not attempt to override *time_r() macros 2014-11-05 18:44:15 +01:00
time.c avutil/tile: check clock_gettime at runtime for apple platforms 2017-01-09 11:52:06 +08:00
time.h Merge commit '1bd0bdcdc236099d5c0d179696951f35f5310fa5' 2014-10-24 11:06:56 +02:00
timecode.c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
timecode.h lavu/timecode: Increase AV_TIMECODE_STR_SIZE. 2017-05-05 10:09:12 +02:00
timer.h Merge commit '64034849dad8410bedbe1def4c533490fb85cc4a' 2016-01-02 10:26:42 +01:00
timestamp.h lavu/timestamp: Avoid C++-unfriendly code in user header 2016-09-01 20:01:28 +01:00
tree.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
tree.h doc: fix spelling errors 2016-10-21 23:58:47 +02:00
twofish.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
twofish.h libavutil: Added twofish symmetric block cipher 2015-01-29 01:56:11 +01:00
utils.c lavu: add av_fourcc_make_string() and av_fourcc2str() 2017-03-29 14:49:29 +02:00
version.h imgutils: add function to clear an image to black 2017-08-08 13:37:37 +02:00
wchar_filename.h avutil/wchar_filename: add av_warn_unused_result 2015-10-30 13:47:28 -04:00
xga_font_data.c
xga_font_data.h
xtea.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
xtea.h Merge commit '588b6215b4c74945994eb9636b0699028c069ed2' 2015-11-22 14:29:09 +00:00