• wm4's avatar
    imgutils: add function to clear an image to black · 45df7adc
    wm4 authored
    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: 's avatarAnton Khirnov <anton@khirnov.net>
    45df7adc
Name
Last commit
Last update
..
doxy Loading commit data...
examples Loading commit data...
.gitignore Loading commit data...
APIchanges Loading commit data...
Doxyfile Loading commit data...
Makefile Loading commit data...
RELEASE_NOTES Loading commit data...
avconv.texi Loading commit data...
avplay.texi Loading commit data...
avprobe.texi Loading commit data...
avtools-common-opts.texi Loading commit data...
avutil.txt Loading commit data...
bitstream_filters.texi Loading commit data...
build_system.txt Loading commit data...
decoders.texi Loading commit data...
demuxers.texi Loading commit data...
developer.texi Loading commit data...
doxy-wrapper.sh Loading commit data...
encoders.texi Loading commit data...
eval.texi Loading commit data...
faq.texi Loading commit data...
fate.texi Loading commit data...
filters.texi Loading commit data...
general.texi Loading commit data...
git-howto.texi Loading commit data...
git-howto.txt Loading commit data...
indevs.texi Loading commit data...
libavfilter.texi Loading commit data...
metadata.texi Loading commit data...
multithreading.txt Loading commit data...
muxers.texi Loading commit data...
nut.texi Loading commit data...
optimization.txt Loading commit data...
outdevs.texi Loading commit data...
platform.texi Loading commit data...
print_options.c Loading commit data...
protocols.texi Loading commit data...
rate_distortion.txt Loading commit data...
soc.txt Loading commit data...
swscale.txt Loading commit data...
t2h.init Loading commit data...
tablegen.txt Loading commit data...
texi2pod.pl Loading commit data...
viterbi.txt Loading commit data...