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.

32 byte memory alignment in mfxBitstream

alex78
New Contributor I
435 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
435 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

0 Kudos
3 Replies
Harshdeep_B_Intel
436 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,

0 Kudos
alex78
New Contributor I
435 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

0 Kudos
Harshdeep_B_Intel
435 Views

Hi,

Glad to help.

Thanks,

0 Kudos
Reply