Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.

CAVLC Enable

paco2011
Beginner
198 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
198 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
Reply