History

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 45df7adc1d9b7.

wm4 committed 9 years ago

Commit 463b81d1 parent caa12024 files · +198 −1Browse files

Showing the changes to doc/APIchanges (1 of 4 files). Show all

Unified · Split

doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182017-08-08 - xxxxxxx - lavu 55.72.100 - imgutils.h
19 Add av_image_fill_black().
20
182017-08-08 - xxxxxxx - lavu 55.71.100 - frame.h212017-08-08 - xxxxxxx - lavu 55.71.100 - frame.h
19 Add av_frame_apply_cropping().22 Add av_frame_apply_cropping().
20 23

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t