mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-08 07:38:30 +00:00
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
|
||
---|---|---|
.. | ||
aarch64 | ||
arm | ||
avr32 | ||
bfin | ||
mips | ||
ppc | ||
sh4 | ||
tests | ||
tomi | ||
x86 | ||
.gitignore | ||
adler32.c | ||
adler32.h | ||
aes_ctr.c | ||
aes_ctr.h | ||
aes_internal.h | ||
aes.c | ||
aes.h | ||
atomic_gcc.h | ||
atomic_suncc.h | ||
atomic_win32.h | ||
atomic.c | ||
atomic.h | ||
attributes.h | ||
audio_fifo.c | ||
audio_fifo.h | ||
avassert.h | ||
avstring.c | ||
avstring.h | ||
avutil.h | ||
avutilres.rc | ||
base64.c | ||
base64.h | ||
blowfish.c | ||
blowfish.h | ||
bprint.c | ||
bprint.h | ||
bswap.h | ||
buffer_internal.h | ||
buffer.c | ||
buffer.h | ||
camellia.c | ||
camellia.h | ||
cast5.c | ||
cast5.h | ||
channel_layout.c | ||
channel_layout.h | ||
color_utils.c | ||
color_utils.h | ||
colorspace.h | ||
common.h | ||
cpu_internal.h | ||
cpu.c | ||
cpu.h | ||
crc.c | ||
crc.h | ||
des.c | ||
des.h | ||
dict.c | ||
dict.h | ||
display.c | ||
display.h | ||
downmix_info.c | ||
downmix_info.h | ||
dynarray.h | ||
error.c | ||
error.h | ||
eval.c | ||
eval.h | ||
ffmath.h | ||
fifo.c | ||
fifo.h | ||
file_open.c | ||
file.c | ||
file.h | ||
fixed_dsp.c | ||
fixed_dsp.h | ||
float_dsp.c | ||
float_dsp.h | ||
frame.c | ||
frame.h | ||
hash.c | ||
hash.h | ||
hmac.c | ||
hmac.h | ||
hwcontext_cuda_internal.h | ||
hwcontext_cuda.c | ||
hwcontext_cuda.h | ||
hwcontext_d3d11va.c | ||
hwcontext_d3d11va.h | ||
hwcontext_dxva2.c | ||
hwcontext_dxva2.h | ||
hwcontext_internal.h | ||
hwcontext_qsv.c | ||
hwcontext_qsv.h | ||
hwcontext_vaapi.c | ||
hwcontext_vaapi.h | ||
hwcontext_vdpau.c | ||
hwcontext_vdpau.h | ||
hwcontext_videotoolbox.c | ||
hwcontext_videotoolbox.h | ||
hwcontext.c | ||
hwcontext.h | ||
imgutils_internal.h | ||
imgutils.c | ||
imgutils.h | ||
integer.c | ||
integer.h | ||
internal.h | ||
intfloat.h | ||
intmath.c | ||
intmath.h | ||
intreadwrite.h | ||
lfg.c | ||
lfg.h | ||
libavutil.v | ||
libm.h | ||
lls.c | ||
lls.h | ||
log2_tab.c | ||
log.c | ||
log.h | ||
lzo.c | ||
lzo.h | ||
macros.h | ||
Makefile | ||
mastering_display_metadata.c | ||
mastering_display_metadata.h | ||
mathematics.c | ||
mathematics.h | ||
md5.c | ||
md5.h | ||
mem_internal.h | ||
mem.c | ||
mem.h | ||
motion_vector.h | ||
murmur3.c | ||
murmur3.h | ||
opencl_internal.c | ||
opencl_internal.h | ||
opencl.c | ||
opencl.h | ||
opt.c | ||
opt.h | ||
parseutils.c | ||
parseutils.h | ||
pca.c | ||
pca.h | ||
pixdesc.c | ||
pixdesc.h | ||
pixelutils.c | ||
pixelutils.h | ||
pixfmt.h | ||
qsort.h | ||
random_seed.c | ||
random_seed.h | ||
rational.c | ||
rational.h | ||
rc4.c | ||
rc4.h | ||
replaygain.h | ||
reverse.c | ||
reverse.h | ||
ripemd.c | ||
ripemd.h | ||
samplefmt.c | ||
samplefmt.h | ||
sha512.c | ||
sha512.h | ||
sha.c | ||
sha.h | ||
slicethread.c | ||
slicethread.h | ||
softfloat_ieee754.h | ||
softfloat_tables.h | ||
softfloat.h | ||
spherical.c | ||
spherical.h | ||
stereo3d.c | ||
stereo3d.h | ||
tablegen.h | ||
tea.c | ||
tea.h | ||
thread.h | ||
threadmessage.c | ||
threadmessage.h | ||
time_internal.h | ||
time.c | ||
time.h | ||
timecode.c | ||
timecode.h | ||
timer.h | ||
timestamp.h | ||
tree.c | ||
tree.h | ||
twofish.c | ||
twofish.h | ||
utils.c | ||
version.h | ||
wchar_filename.h | ||
xga_font_data.c | ||
xga_font_data.h | ||
xtea.c | ||
xtea.h |