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.

YUYV format DOES NOT be supported...

IDZ_A_Intel
Employee
908 Views

Hi,

I read all the manuals in 'doc' folder and found that Intel Media SDK supports planar YUV format( ex.NV12 ) but not packed YUV format( ex. YUYV ).

Therefore I use the converter function as below whosefirst parameter is YUYV format and the Second is NV12.

Ioptimizedthe functionin my own way but it needs many CPU operation in line 17-30. In multi-decoder environment, it's terrible.

Has Intel any plan to support YUYV format? ... as decoder output.
Or give me any information abouthow todiscard many pixel-by-pixel copys( shown in line 17-30 ).

[bash]WriteFrame( BYTE *pDec, mfxFrameSurface1 *pSurface )
{
	if ( !pSurface || !pSurface->Data.Y || !pSurface->Data.UV )
		return FALSE;

	BYTE *Y		= pSurface->Data.Y;
	BYTE *UV	= pSurface->Data.UV;
	int i, j, k, h, w, w_pitch, h_Y, h_UV;
	h = pSurface->Info.CropH;
	w = pSurface->Info.CropW;	
	w_pitch = pSurface->Data.Pitch;		
	i = h;
	k = w * h * 2 - 1;
	h_Y = (h - 1) * w_pitch;
	h_UV = ( (h - 1) >> 1 ) * w_pitch;

	while ( i-- )
	{
		j = w;
		while ( j-- )
		{	
			pDec[ k-- ] = UV[ h_UV + j ];
			pDec[ k-- ] = Y[ h_Y + j-- ];
			pDec[ k-- ] = UV[ h_UV + j ];
			pDec[ k-- ] = Y[ h_Y + j ];
		}
		h_Y -= w_pitch;
		if ( i & 0x1 )
			h_UV -= w_pitch;
	}

	return TRUE;
}[/bash]



Regards,
kmjlove130

0 Kudos
5 Replies
Vassili_Yakovlev
Beginner
908 Views
Hi,

Optionally you can use DirectX surfaces to do convert job.
0 Kudos
IDZ_A_Intel
Employee
908 Views
Hi kmjlove130,

There are no plans to natively support any other color formats than NV12 in Media SDK.
However, the Media SDK VPP component supports a set of color conversion operations (From NV12 to RBG32, YV12 or YUY2).

As far as I know YUYV should be the same format as YUY2, so you should be able to use VPP to perform the conversion.http://www.fourcc.org/yuv.php#YUYV

If you are looking for the reverse operation such as NV12 to YUY2, then I'm sorry to say that Media SDK does not support this operation. For an optimized implementation of such an algorithm you may explore the Intel Integrated Performance Primitives (IPP).

Also, as Vassili suggested, if you keep your surfaces in D3D mem, you may also explore using DirectX to do the color conversion.

Regards,
Petter
0 Kudos
Hari_K_2
Beginner
908 Views

Hi all does the intel ipp support the conversion of yuyv to yuv422 ,if suppted please let me know how to do that . Please reply .

Thank you very much .

Regards,

Harikrishna

0 Kudos
Jeffrey_M_Intel1
Employee
908 Views

IPP has many color conversions.  It doesn't cover every permutation, but the selection is pretty wide.

I haven't verified the solution, but you may find a match in IPP with the 'YCbCr422' functions. In this case, C2  indicates the "packed" version of the format.  In the header it's sometimes referred to as YUYV or YUY2.  'P3' indicates 3 separate planes for Y, U, and V values.

The function to convert YUYV to YUV422 should be something like ippiYCbCr422_8u_C2P3R.  As you can see from the header or docs the packed image is treated as a single contiguous buffer, but you'll need to prepare a 3-element array for the planar version.

It looks like you could also try YUYV to NV12 with ippiYCbCr422ToYCbCr420_8u_C2P2R.  I'd guess this might be faster but you'll have to check to make sure.

 

0 Kudos
Hari_K_2
Beginner
908 Views

Dear Jeffrey Mcallister thank you very much for the reply.

0 Kudos
Reply