Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Byte Reordering

Functions for bytes reordering. More...

Functions

SIMD_API void SimdReorder16bit (const uint8_t *src, size_t size, uint8_t *dst)
 Performs bytes reordering for data array. More...
 
SIMD_API void SimdReorder32bit (const uint8_t *src, size_t size, uint8_t *dst)
 Performs bytes reordering for data array. More...
 
SIMD_API void SimdReorder64bit (const uint8_t *src, size_t size, uint8_t *dst)
 Performs bytes reordering for data array. More...
 

Detailed Description

Functions for bytes reordering.

Function Documentation

◆ SimdReorder16bit()

void SimdReorder16bit ( const uint8_t *  src,
size_t  size,
uint8_t *  dst 
)

Performs bytes reordering for data array.

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.

Parameters
[in]src- a pointer to the input data.
[in]size- a size of input and output data.
[out]dst- a pointer to the output data.

◆ SimdReorder32bit()

void SimdReorder32bit ( const uint8_t *  src,
size_t  size,
uint8_t *  dst 
)

Performs bytes reordering for data array.

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.

Parameters
[in]src- a pointer to the input data.
[in]size- a size of input and output data.
[out]dst- a pointer to the output data.

◆ SimdReorder64bit()

void SimdReorder64bit ( const uint8_t *  src,
size_t  size,
uint8_t *  dst 
)

Performs bytes reordering for data array.

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.

Parameters
[in]src- a pointer to the input data.
[in]size- a size of input and output data.
[out]dst- a pointer to the output data.