wm4
45df7adc1d
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>
2017-07-26 23:21:26 +02:00
..
2017-02-16 09:56:11 +02:00
2017-05-08 14:21:08 +03:00
2016-05-04 18:16:21 +02:00
2015-09-29 11:10:37 +02:00
2017-06-13 12:34:35 +02:00
2017-06-12 11:01:10 +02:00
2017-03-14 17:23:32 +01:00
2016-05-13 14:55:56 +02:00
2016-04-07 16:14:42 +02:00
2016-04-07 16:14:42 +02:00
2015-08-28 16:04:27 +02:00
2017-03-22 14:25:45 +02:00
2016-10-27 12:21:46 +02:00
2016-05-04 18:16:21 +02:00
2016-04-07 16:14:42 +02:00
2015-10-03 13:45:37 +02:00
2016-12-07 14:26:21 -05:00
2016-04-07 16:14:42 +02:00
2016-04-07 16:14:42 +02:00
2015-07-31 09:04:09 +02:00
2016-10-02 18:58:04 +02:00
2016-10-02 18:58:04 +02:00
2016-08-11 10:29:23 +02:00
2015-08-23 21:44:38 +02:00
2015-08-23 21:44:38 +02:00
2016-05-10 11:30:25 +02:00
2017-03-01 11:23:19 -05:00
2015-05-31 12:07:11 +02:00
2017-02-11 11:37:45 +01:00
2017-02-11 11:37:45 +01:00
2016-04-07 16:14:42 +02:00
2016-05-13 14:55:56 +02:00
2015-08-31 17:06:32 +02:00
2015-10-12 13:35:01 +02:00
2016-05-04 18:16:21 +02:00
2015-03-23 20:53:28 +00:00
2016-12-07 14:26:21 -05:00
2017-06-12 11:01:10 +02:00
2017-01-26 10:25:20 +01:00
2014-11-27 09:29:17 +02:00
2017-06-12 11:01:10 +02:00
2016-04-07 16:14:42 +02:00
2017-07-26 23:20:40 +02:00
2017-07-26 23:20:40 +02:00
2017-01-09 15:18:16 +01:00
2015-07-29 22:09:16 +03:00
2017-02-01 10:43:00 +01:00
2016-02-14 22:08:33 +01:00
2017-07-05 13:55:11 +03:00
2017-06-27 00:23:12 +02:00
2017-05-20 09:41:45 +02:00
2017-06-08 21:20:18 +02:00
2017-06-08 20:55:36 +02:00
2017-04-30 17:33:18 +01:00
2016-06-21 19:53:37 +02:00
2017-05-29 13:50:03 +02:00
2017-02-13 21:44:47 +00:00
2016-09-14 20:48:36 +01:00
2016-02-14 22:06:04 +01:00
2017-06-15 00:02:06 +01:00
2017-06-08 20:55:36 +02:00
2016-08-31 08:15:47 +02:00
2017-07-26 23:21:26 +02:00
2017-07-26 23:21:26 +02:00
2017-03-31 22:06:52 +03:00
2017-03-01 11:23:19 -05:00
2016-08-02 21:18:18 +03:00
2016-04-07 16:14:42 +02:00
2016-05-29 16:43:11 +02:00
2016-04-07 16:14:42 +02:00
2015-12-14 16:16:55 +01:00
2015-04-20 19:20:57 +01:00
2017-03-23 10:09:17 +01:00
2015-12-14 16:16:55 +01:00
2017-06-08 20:55:36 +02:00
2016-08-17 12:16:42 +02:00
2017-06-02 21:00:35 -04:00
2017-01-09 15:17:43 +01:00
2017-04-26 09:05:28 +02:00
2017-04-26 09:05:28 +02:00
2016-11-03 20:17:12 +01:00
2017-03-23 10:09:17 +01:00
2017-02-01 10:42:59 +01:00
2015-04-07 12:36:11 +02:00
2017-06-08 20:55:36 +02:00
2016-01-25 12:02:20 -05:00
2017-06-08 20:55:36 +02:00
2016-05-04 18:16:21 +02:00
2015-07-31 09:04:12 +02:00
2015-07-31 09:04:12 +02:00
2016-02-18 15:35:30 +01:00
2016-02-18 15:35:30 +01:00
2017-01-09 15:17:43 +01:00
2017-01-09 15:17:43 +01:00
2017-04-27 09:59:54 -04:00
2017-04-27 09:59:54 -04:00
2017-02-01 10:42:59 +01:00
2016-12-07 14:26:21 -05:00
2017-04-12 10:07:09 +02:00
2014-10-26 00:14:54 +03:00
2014-10-24 09:53:41 +03:00
2014-10-24 09:53:41 +03:00
2015-12-14 16:42:35 +01:00
2016-04-07 16:14:42 +02:00
2015-08-28 16:04:27 +02:00
2015-07-02 23:22:53 +02:00
2017-07-26 23:21:26 +02:00
2014-11-27 09:29:17 +02:00
2016-04-07 16:14:42 +02:00
2015-11-13 21:53:54 +02:00