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.

CAVLC Enable

paco2011
Beginner
377 Views

How to enable the CAVLC option in the sample_encode?

Can someone give me a sample code?

0 Kudos
1 Reply
IDZ_A_Intel
Employee
377 Views
Hi,

to use CAVLC you must use the extended encoding options feature of Intel Media SDK.

See below for an example on to implement this. Please refer to Intel Media SDK samples for details on common code.

[cpp]//
// In containing class declaration
//
mfxExtBuffer*	m_pExtBuf[1];
mfxExtCodingOption m_ExtCO;
mfxVideoParam m_mfxParamsVideo;

//
// In section of code initializing encoder video paramters
//
memset(&m_ExtCO, 0, sizeof(mfxExtCodingOption));
m_ExtCO.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
m_ExtCO.Header.BufferSz = sizeof(mfxExtCodingOption);
m_ExtCO.CAVLC = MFX_CODINGOPTION_ON;
m_mfxParamsVideo.ExtParam = m_pExtBuf;
m_pExtBuf[0] = (mfxExtBuffer*)&(m_ExtCO);
m_mfxParamsVideo.NumExtParam = 1;

//
// Call to query the encoder
//  (note: make sure to also reference the extended buffer from the Query out structure)
mfxVideoParam actualParams;
actualParams.ExtParam = m_mfxParamsVideo.ExtParam;
actualParams.NumExtParam = m_mfxParamsVideo.NumExtParam;
sts = m_pmfxEnc->Query(&m_mfxParamsVideo, &actualParams);

//
// Alternatively if you use encoder Init without Query
//
sts = m_pmfxEnc->Init(&m_mfxParamsVideo);[/cpp]


Regards,
Petter
0 Kudos
Reply