Functions for bytes reordering. More...
Functions | |
| SIMD_API void | SimdReorder16bit (const uint8_t *src, size_t size, uint8_t *dst) |
| Reverses byte order inside every 16-bit element of a data array. More... | |
| SIMD_API void | SimdReorder32bit (const uint8_t *src, size_t size, uint8_t *dst) |
| Reverses byte order inside every 32-bit element of a data array. More... | |
| SIMD_API void | SimdReorder64bit (const uint8_t *src, size_t size, uint8_t *dst) |
| Reverses byte order inside every 64-bit element of a data array. More... | |
Detailed Description
Functions for bytes reordering.
Function Documentation
◆ SimdReorder16bit()
| void SimdReorder16bit | ( | const uint8_t * | src, |
| size_t | size, | ||
| uint8_t * | dst | ||
| ) |
Reverses byte order inside every 16-bit element of a data array.
This function changes endian representation of each 2-byte element independently. The order of elements in the array is not changed.
For every 2 bytes:
dst[2*i + 0] = src[2*i + 1]; dst[2*i + 1] = src[2*i + 0];
The data size must be a multiple of 2 bytes.
- Parameters
-
[in] src - a pointer to the input data. [in] size - a size of input and output data in bytes. [out] dst - a pointer to the output data.
◆ SimdReorder32bit()
| void SimdReorder32bit | ( | const uint8_t * | src, |
| size_t | size, | ||
| uint8_t * | dst | ||
| ) |
Reverses byte order inside every 32-bit element of a data array.
This function changes endian representation of each 4-byte element independently. The order of elements in the array is not changed.
For every 4 bytes:
dst[4*i + 0] = src[4*i + 3]; dst[4*i + 1] = src[4*i + 2]; dst[4*i + 2] = src[4*i + 1]; dst[4*i + 3] = src[4*i + 0];
The data size must be a multiple of 4 bytes.
- Parameters
-
[in] src - a pointer to the input data. [in] size - a size of input and output data in bytes. [out] dst - a pointer to the output data.
◆ SimdReorder64bit()
| void SimdReorder64bit | ( | const uint8_t * | src, |
| size_t | size, | ||
| uint8_t * | dst | ||
| ) |
Reverses byte order inside every 64-bit element of a data array.
This function changes endian representation of each 8-byte element independently. The order of elements in the array is not changed.
For every 8 bytes:
dst[8*i + 0] = src[8*i + 7]; dst[8*i + 1] = src[8*i + 6]; dst[8*i + 2] = src[8*i + 5]; dst[8*i + 3] = src[8*i + 4]; dst[8*i + 4] = src[8*i + 3]; dst[8*i + 5] = src[8*i + 2]; dst[8*i + 6] = src[8*i + 1]; dst[8*i + 7] = src[8*i + 0];
The data size must be a multiple of 8 bytes.
- Parameters
-
[in] src - a pointer to the input data. [in] size - a size of input and output data in bytes. [out] dst - a pointer to the output data.