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.

32 byte memory alignment in mfxBitstream

alex78
New Contributor I
150 Views

Hi all,

I am currently getting familiar with the decoding sample of the Intel Media SDK (so sorry for the newbie question), while investigating the code, one question came up:

The documentation says in the description of mfxBitstream structure that the "data" member is a "32-bytes aligned pointer". Now, in the decoding sample code (sample_utils.cpp) the data member is allocated simply by

 pBitstream->Data = new mfxU8[nSize];

which AFAIK will not guarantee the alignment. So, could anybody please explain to me the 32-bytes alignment requirements - especially for passing encoded data blocks to the decoder?

Thanks

Alex 

0 Kudos
1 Solution
Harshdeep_B_Intel
150 Views

Hi,

The documentation says in the description of mfxBitstream structure that the "data" member is a "32-bytes aligned pointer".-> Yes, it is but the pointer variable is unsigned char mfxU8. The pointer is a variable and it is pointing to a 32-byte aligned data.That does not mean pointer itself is 32-byte. Please refer tho the documentation. Hope this helps

Thanks,

View solution in original post

3 Replies
Harshdeep_B_Intel
151 Views

Hi,

The documentation says in the description of mfxBitstream structure that the "data" member is a "32-bytes aligned pointer".-> Yes, it is but the pointer variable is unsigned char mfxU8. The pointer is a variable and it is pointing to a 32-byte aligned data.That does not mean pointer itself is 32-byte. Please refer tho the documentation. Hope this helps

Thanks,

alex78
New Contributor I
150 Views

Hi,

thanks. It seems that I've misunderstood the "32-bytes aligned pointer". I really thought that the pointer itself must be aligned, i.e. the block of memory it is pointing to must start at a special (32-bytes aligned) memory location.

Alex

Harshdeep_B_Intel
150 Views

Hi,

Glad to help.

Thanks,

Reply