We have an application that reads a GigE YUV video stream and displays it on the screen. By profiling, we have learned that the function converting each frame from YUV (UYVY) to RGB24 is taking at least an order of magnitude more time and CPU than any other piece of our camera-to-screen pipeline.
The conversion function we are using is provided by the GigE software vendor (Pleora) and is slightly faster than our own 'naive' (non-optimized) implementation. We are using DirectShow for the rest of our pipeline. 'Task-manager benchmarking' shows for our 1080p 30fps stream, a cpu usage of 4-5% when we skip the conversion (and get garbled image of course), and 15-19% CPU usage when we call the conversion function.
The questions we have are:
Thanks! Eric.
The function [R, G, B] = Y′UV444toRGB888(Y′, U, V) converts Y′UV format to simple RGB format.
YUV color-spaces are a more efficient coding and reduce the bandwidth more than RGB capture can. Most video cards, therefore, render directly using YUV or luminance/chrominance images. The most important component for YUV capture is always the luminance, or Y component.
The conversion is perhaps a good candidate for GPU processing, however what are you going to do with the converted data? If you need it for further processing in software, then reading back from video adapter might ruin all the gain you might have obtained by offloading processing to GPU. If you need it for presentation purposes only, then you don't need to convert, you can deliver YUV image right to video adapter and let it present it this way (which is the ideal configuration of the pipeline, since you don't have any conversion at all).
Talking about software conversion, I am not sure about the quality of the conversions you are using right now, however there are highly optimized (SIMD-enabled) conversions available:
All three are more or less easily pluggable into DirectShow pipeline. Additionally high resolution images are good candidates for parallel software processing too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With