GNOME Bugzilla – Bug 693817
ffmpegcolorspace: add direct conversion from UYVY to NV12
Last modified: 2013-08-16 10:09:04 UTC
Hi, right now conversion from UYVY to NV12 passes through an intermediate conversion; a direct conversion routine can perform better and can be more easily optimized to save even more CPU and battery on embedded systems. A scenario when a conversion from UYVY to NV12 is needed is not rare at all: a lot of camera sensors provide YUV422 data using the UYVY pixel format, and many encoders (e.g. h264) expect data in the NV12 pixel format. I am attaching a uyvy422_to_nv12() routine, plus a NEON optimized version of the code, both developed by Michael Trimarchi. The project the code has been written for still uses 0.10 so the patches are against this version, let us know if we should submit patches for videoscale in 1.x and then propose a backport of those. Thanks, Antonio
Created attachment 236089 [details] [review] ffmpegcolorspace: add a routine to convert from UYVY to NV12
Created attachment 236090 [details] [review] configure: add checking for ARM NEON instructions
Created attachment 236091 [details] [review] ffmpegcolorspace: add NEON optimization to uyvy422_to_nv12()
Please check that it handles odd widths correctly, as well as unaligned buffers for both source and destination. (You can assume that pointers and strides are aligned to 4 bytes for all planes, however.)
Also, videoconvert in 1.0 uses Orc. A UYVY->NV12 converter would be pretty easy to write, about 10 lines of code.
Closing as this is for 0.10, and 0.10 is no longer maintained. Patches to add a direct converter to videoconvert would be nice to have nonetheless.