...Aware of the underlying hardware and supplemental cpu extension sets (up to avx2). Support data coming from a single buffer or coming from multiple image planes. Support non-tightly packed data. Support images greater than 4GB (64 bit). Convert an image from bgra to nv12 (single plane) format containing yuv in BT601. You might want to propagate errors to the caller function or mix with some other error types. So far, buffers were sized taking into account the image pixel format and dimensions; However, you can use a function to compute how many bytes are needed to store an image of a given format and size. ...