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.

JPEG Encode Hardware Acceleration

Walton__Daniel
Beginner
2,171 Views

I have developed an application which encodes JPEG images around Media SDK 1.19.  On my development machine everything works well, however it is a Gen 5 Core CPU (i7-5820K) so the implementation fails back to Software.

On a second machine (Atom E3825) the application also works and automatically fails back to software implementation.

I went out and purchased a Gen 6 Skylake (Pentium E4400) CPU and motherboard so that I can test JPEG hardware acceleration.  Here is my problem:

When I run my application I get the response MFX_ERR_UNSUPPORTED from MFXVideoENCODE_Query.

If I change the IMPL from AUTO to SOFTWARE the program runs with no problems.

If I run the "sample_encode.exe" program provided by Intel like this: "sample_encode.exe jpeg -w 1920 -h 1080 -f 30 -q 90 -i test.bin -o test.jpg" it runs correctly but gives the warning "partial acceleration".

Here is my code for the video param:

                mfxVideoParam m_mfxEncParams;
		memset(&m_mfxEncParams, 0, sizeof(mfxVideoParam));
		m_mfxEncParams.mfx.CodecId = MFX_CODEC_JPEG;

		m_mfxEncParams.mfx.FrameInfo.FrameRateExtN = 120;
		m_mfxEncParams.mfx.FrameInfo.FrameRateExtD = 1;

		m_mfxEncParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
		// frame info parameters
		m_mfxEncParams.mfx.FrameInfo.FourCC = MFX_FOURCC_YV12;
		m_mfxEncParams.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
		m_mfxEncParams.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;


		m_mfxEncParams.mfx.FrameInfo.Width = MSDK_ALIGN16(width);
		m_mfxEncParams.mfx.FrameInfo.Height = (MFX_PICSTRUCT_PROGRESSIVE == m_mfxEncParams.mfx.FrameInfo.PicStruct) ?
			MSDK_ALIGN16(height) : MSDK_ALIGN32(height);

		m_mfxEncParams.mfx.FrameInfo.CropX = 0;
		m_mfxEncParams.mfx.FrameInfo.CropY = 0;
		m_mfxEncParams.mfx.FrameInfo.CropW = width;
		m_mfxEncParams.mfx.FrameInfo.CropH = height;

		m_mfxEncParams.mfx.Interleaved = 1;
		m_mfxEncParams.mfx.Quality = 75;
		m_mfxEncParams.mfx.RestartInterval = 0;

		m_mfxEncParams.AsyncDepth = 1;

		m_mfxEncParams.mfx.BufferSizeInKB = width * height * 32 / 1024;

		mfxStatus status = MFXVideoENCODE_Query(*session, &m_mfxEncParams, &m_mfxEncParams);

And here are the results from mediasdk_system_analyzer_64.exe:

Intel(R) Media Server Studio 2016 R2 - System Analyzer (64-bit)


The following versions of Media SDK API are supported by platform/driver
[opportunistic detection of MSDK API > 1.19]:

    Version    Target    Supported    Dec    Enc
    1.0    HW    Yes        X    X
    1.0    SW    Yes        X    X
    1.1    HW    Yes        X    X
    1.1    SW    Yes        X    X
    1.2    HW    Yes        X    X
    1.2    SW    Yes        X    X
    1.3    HW    Yes        X    X
    1.3    SW    Yes        X    X
    1.4    HW    Yes        X    X
    1.4    SW    Yes        X    X
    1.5    HW    Yes        X    X
    1.5    SW    Yes        X    X
    1.6    HW    Yes        X    X
    1.6    SW    Yes        X    X
    1.7    HW    Yes        X    X
    1.7    SW    Yes        X    X
    1.8    HW    Yes        X    X
    1.8    SW    Yes        X    X
    1.9    HW    Yes        X    X
    1.9    SW    Yes        X    X
    1.10    HW    Yes        X    X
    1.10    SW    Yes        X    X
    1.11    HW    Yes        X    X
    1.11    SW    Yes        X    X
    1.12    HW    Yes        X    X
    1.12    SW    Yes        X    X
    1.13    HW    Yes        X    X
    1.13    SW    Yes        X    X
    1.14    HW    Yes        X    X
    1.14    SW    Yes        X    X
    1.15    HW    Yes        X    X
    1.15    SW    Yes        X    X
    1.16    HW    Yes        X    X
    1.16    SW    Yes        X    X
    1.17    HW    Yes        X    X
    1.17    SW    Yes        X    X
    1.18    HW    Yes        X    X
    1.18    SW    Yes        X    X
    1.19    HW    Yes        X    X
    1.19    SW    Yes        X    X

Graphics Devices:
    Name                                         Version             State
    Intel(R) HD Graphics 510                     20.19.15.4501       Active

System info:
    CPU:    Intel(R) Pentium(R) CPU G4400 @ 3.30GHz
    OS:    Microsoft Windows 7 Professional 
    Arch:    64-bit

Installed Media SDK packages (be patient...processing takes some time):

Installed Media SDK DirectShow filters:

Installed Intel Media Foundation Transforms:
    Intel(R) Hardware VC-1 Decoder MFT : {059A5BAE-5D7A-4C5E-8F7A-BFD57D1D6AAA}
    Intel(R) Hardware H.264 Decoder MFT : {45E5CE07-5AC7-4509-94E9-62DB27CF8F96}
    Intel(R) Hardware MPEG-2 Decoder MFT : {CD5BA7FF-9071-40E9-A462-8DC5152B1776}
    Intel(R) Quick Sync Video H.264 Encoder MFT : {4BE8D3C0-0515-4A37-AD55-E4BAE19AF471}
    Intel(R) Hardware Preprocessing MFT : {EE69B504-1CBF-4EA6-8137-BB10F806B014}

Thank you everyone for your help.

0 Kudos
7 Replies
Walton__Daniel
Beginner
2,171 Views

Additional Information:

Using Intel Media SDK 2016 R2

Using newest driver for Intel HD Graphics 510 - "15.20.48.4501(20.19.15.4501)".

When I make a request to MFXQueryIMPL the response is "514" which is not a valid IMPL value.

0 Kudos
Jiandong_Z_Intel
Employee
2,171 Views

Hi Daniel,

Regarding JPEG HW encode is a new feature of Intel Media Sever Studio 2017 on Intel® 6th Generation Core™ Processors. It looks like your platform is not support JPEG HW encode yet.

 

Thanks,

Zachary

0 Kudos
Steve_S_5
Beginner
2,171 Views

Hi,

I am seeing the same thing as Daniel - except that my cpu is an i7-6770HQ, which I believe from the docs should be supported HW JPEG encodes.  What can I do to diagnose the problem?

Cheers,

Steve

0 Kudos
Walton__Daniel
Beginner
2,171 Views

Thank you for the responses.  I was able to get it to work.  Steve, the key is that HW encode is only supported for 4:2:2 formats (in this case YUY2).  YV12 will always show partial acceleration.

0 Kudos
Jiandong_Z_Intel
Employee
2,171 Views

Great to know it work for you Daniel, and thank you for your contribution for the forum.

0 Kudos
Steve_S_5
Beginner
2,171 Views

Thanks for the info Daniel, I shall try that later today

0 Kudos
a_k_4
Beginner
2,171 Views

Jiandong Z. (Intel) wrote:

Hi Daniel,

Regarding JPEG HW encode is a new feature of Intel Media Sever Studio 2017 on Intel® 6th Generation Core™ Processors. It looks like your platform is not support JPEG HW encode yet.

 

Thanks,

Zachary

I would like to get some clarification regarding JPEG Encode HW acceleration requirements.
I'm using The Intel® Media SDK 2016 R2 (API version 1.19) and indeed I'm getting the HW acceleration only on Intel® 6th Generation Core™ Processors or above.

But! in Release notes it is written that "Hardware acceleration is available through hardware implementations of the Media SDK Library coming with Intel® IrisTM and HD Graphics Driver for Microsoft* Windows* 7/8.1/10 on platforms with: 

  • 3 rd Generation Intel® CoreTM processors
  • 4 th Generation Intel® CoreTM processors 
  • 5 th Generation Intel® CoreTM processors 
  • 6 th Generation Intel® CoreTM processors 
  • 7 th Generation Intel® CoreTM processors"

So  what is right and what is wrong?

0 Kudos
Reply