Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

How to optimize conversation from YUY2 to NV12 with MMX/SSE?

Brooks_L_
New Contributor I
452 Views

Does someone know how to do this conversation as title with MMX/SSE? General speaking, I think the process is just unpack the interleaved Y,U,V data in each byte and rearrange them into one block of Y, UV block consisting of interleaved U,V. Here, I do not see any instructive could help to improve this data copy process. Maybe, it's just because, I am fresh new to MMX/SSE. Is there someone being so kind to give me hint? Thanks in advance.

0 Kudos
5 Replies
OTorg
New Contributor III
452 Views
0 Kudos
Anthony_P_Intel
Employee
452 Views

To do this with a MediaSDK surface, the VPP implementation is optimized to use CPU or GPU depending on what type of memory the surface resides.  For example, if your surface is in VIdeo Memory, it is more efficient to have the graphics processor provide this conversion.

0 Kudos
Brooks_L_
New Contributor I
452 Views

Thank you so much, dj_alek. It sounds very helpful for me. I am learning and thinking how to take it to unpack YUYV to YY UV. 

Tony, Thanks for your tips as well. However, would you please elaberate with further details? I went through the SDK document, but did not see the relavant APIs about VPP for this. In the samples provided in by intel_media_sdk_tutorial_041813 from your web site, the conversion is done by C code. So, is there any other example for my reference?

0 Kudos
BMart1
New Contributor II
452 Views

I found http://code.google.com/p/libyuv/ the easiest to use.

0 Kudos
Brooks_L_
New Contributor I
452 Views

Hi Bruno, thanks for your information. Unfortunately, that link is not accessbile for me for the time being. I will try it later. Is that a third party library to do color space conversion?

To Tony, I evetually managed to get VPP code snippet from media sdk developper guide document, about what you said. I will try it. However, to be honest, I do not like the asynchronous API style for this step. My usage scenario is that, I've already got the YUY2. For next, I want do conversion from YUY2 to NV12 and H264 compression in serial. That would make my life easier to maintain the code. Anyway, thanks for your warmhearted help! 

0 Kudos
Reply