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.

converting BGR frame to NV12 frame

nick_k_5
Beginner
979 Views

Sorry if similar subject already was here - i trying to find answer but cannot..

I need to encode sequence of BGR frames to h264 stream.
I am using sample_encode Media SDK as example. This example uses as input YUV stream - so it is not my case.

The first. I am trying to use IPP functions: ippiBGRToYCrCb420_8u_AC4P3R(...) for 32 bit BGR or ippiBGRToYCrCb420_8u_C3P3R(..) for 24 bit BGR source frame. SO i obtain 3 planes for YCbCr.

The second - I wrote function which makes interleave of CbCr into single plane to be NV12 compatible. So right now all works.

BUT! Question is how to avoid mixing/interleaving step in my  algorithm?

I was expecting to find IPP function like ippiBGRToYCrCb420_8u_AC4P2R() and ippiBGRToYCrCb420_8u_C3P2R(..) but seem those function do not exist! 

What i am doing wrong? What i am missing? I expected that if HW accepts only NV12 source frame then IPP probably should provide functions to convert from ordinal formats to two-plane NV12.. Now i need to do color conversion in 2 steps, so i expect performance loss during conversion because i need intermediate memory buffer written and read.

 

0 Kudos
3 Replies
Alexey_F_Intel
Employee
979 Views

read https://software.intel.com/sites/default/files/mediasdk-man.pdf page 163 listing colour formats convertions supported in HW.

0 Kudos
Jeffrey_M_Intel1
Employee
979 Views

This article explains some ways to match up IPP color conversion functions with color formats supported by VPP.  Perhaps something here is closer to what you need?

https://software.intel.com/en-us/articles/using-unsupported-color-formats-with-the-intel-media-software-development-kit

 

0 Kudos
Roman_T_
New Contributor I
979 Views

Hi nick!

In addition to previous posts I can suggest you another one solution of your task.

IPP function ippiBGRToYCrCb420_8u_AC4P2R() exists, but it available in old IPP version (7.1)

So if you will combine the latest  version of Media SDK and IPP 7.1, ippiBGRToYCrCb420_8u_AC4P2R() will be available.

Best regards,
Roman

 

0 Kudos
Reply