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.
Showing the changes to doc/APIchanges (1 of 4 files). Show all
Unified · Split
| @@ -13,6 +13,9 @@ libavutil: 2017-03-23 · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 14 | API changes, most recent first: |
| 15 | 15 | ||
| 16 | 2017-xx-xx - xxxxxxx - lavu 56.4.0 - imgutils.h | ||
| 17 | Add av_image_fill_black(). | ||
| 18 | |||
| 16 | 2017-xx-xx - xxxxxxx - lavu 56.3.0 - frame.h | 19 | 2017-xx-xx - xxxxxxx - lavu 56.3.0 - frame.h |
| 17 | Add av_frame_apply_cropping(). | 20 | Add av_frame_apply_cropping(). |
| 18 | 21 | ||