Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Integer Descriptor

Functions for conversion and comparison of Integer Descriptor. More...

Functions

SIMD_API void * SimdDescrIntInit (size_t size, size_t depth)
 Initilizes Integer Descriptor Engine. More...
 
SIMD_API size_t SimdDescrIntEncodedSize (const void *context)
 Gets size in bytes of encoded integer descriptor. More...
 
SIMD_API size_t SimdDescrIntDecodedSize (const void *context)
 Gets length of original (32-bit or 16-bit) float descriptor. More...
 
SIMD_API void SimdDescrIntEncode32f (const void *context, const float *src, uint8_t *dst)
 Encodes 32-bit float descriptor to integer form. More...
 
SIMD_API void SimdDescrIntEncode16f (const void *context, const uint16_t *src, uint8_t *dst)
 Encodes 16-bit float descriptor to integer form. More...
 
SIMD_API void SimdDescrIntDecode32f (const void *context, const uint8_t *src, float *dst)
 Decodes integer descriptor to original 32-bit float form. More...
 
SIMD_API void SimdDescrIntDecode16f (const void *context, const uint8_t *src, uint16_t *dst)
 Decodes integer descriptor to original 16-bit float form. More...
 
SIMD_API void SimdDescrIntCosineDistance (const void *context, const uint8_t *a, const uint8_t *b, float *distance)
 Calculates cosine distance of two integer descriptors. More...
 
SIMD_API void SimdDescrIntCosineDistancesMxNa (const void *context, size_t M, size_t N, const uint8_t *const *A, const uint8_t *const *B, float *distances)
 Calculates mutual cosine distance of two arrays of integer descriptor arrays. More...
 
SIMD_API void SimdDescrIntCosineDistancesMxNp (const void *context, size_t M, size_t N, const uint8_t *A, const uint8_t *B, float *distances)
 Calculates mutual cosine distance of two arrays of integer descriptors. More...
 
SIMD_API void SimdDescrIntVectorNorm (const void *context, const uint8_t *a, float *norm)
 Calculates vector norm for integer descriptor. More...
 

Detailed Description

Functions for conversion and comparison of Integer Descriptor.

Function Documentation

◆ SimdDescrIntInit()

void * SimdDescrIntInit ( size_t  size,
size_t  depth 
)

Initilizes Integer Descriptor Engine.

Parameters
[in]size- a length of original (32-bit or 16-bit) float descriptor. It be multiple of 8. Also it must be less or equal than 32768.
[in]depth- a number of bits in encoded integer descriptor. Supported values: 4, 5, 6, 7, 8.
Returns
a pointer to Integer Descriptor Engine context. On error it returns NULL. It must be released with using of function SimdRelease. This pointer is used in functions SimdDescrIntEncodedSize, SimdDescrIntDecodedSize, SimdDescrIntEncode32f, SimdDescrIntEncode16f, SimdDescrIntDecode32f, SimdDescrIntDecode16f, SimdDescrIntCosineDistance, SimdDescrIntCosineDistancesMxNa, SimdDescrIntCosineDistancesMxNp, SimdDescrIntVectorNorm.

◆ SimdDescrIntEncodedSize()

size_t SimdDescrIntEncodedSize ( const void *  context)

Gets size in bytes of encoded integer descriptor.

Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
Returns
size in bytes of encoded integer descriptor.

◆ SimdDescrIntDecodedSize()

size_t SimdDescrIntDecodedSize ( const void *  context)

Gets length of original (32-bit or 16-bit) float descriptor.

Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
Returns
length of original (32-bit or 16-bit) float descriptor.

◆ SimdDescrIntEncode32f()

void SimdDescrIntEncode32f ( const void *  context,
const float *  src,
uint8_t *  dst 
)

Encodes 32-bit float descriptor to integer form.

Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]src- a pointer to original 32-bit float descriptor. Its length can be determined by function SimdDescrIntDecodedSize.
[out]dst- a pointer to encoded integer descriptor. Its size in bytes can be determined by function SimdDescrIntEncodedSize.

◆ SimdDescrIntEncode16f()

void SimdDescrIntEncode16f ( const void *  context,
const uint16_t *  src,
uint8_t *  dst 
)

Encodes 16-bit float descriptor to integer form.

Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]src- a pointer to original 16-bit float descriptor. Its length can be determined by function SimdDescrIntDecodedSize.
[out]dst- a pointer to encoded integer descriptor. Its size in bytes can be determined by function SimdDescrIntEncodedSize.

◆ SimdDescrIntDecode32f()

void SimdDescrIntDecode32f ( const void *  context,
const uint8_t *  src,
float *  dst 
)

Decodes integer descriptor to original 32-bit float form.

Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]src- a pointer to encoded integer descriptor. Its size in bytes can be determined by function SimdDescrIntEncodedSize.
[out]dst- a pointer to output 32-bit float descriptor. Its lenght can be determined by function SimdDescrIntDecodedSize.

◆ SimdDescrIntDecode16f()

void SimdDescrIntDecode16f ( const void *  context,
const uint8_t *  src,
uint16_t *  dst 
)

Decodes integer descriptor to original 16-bit float form.

Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]src- a pointer to encoded integer descriptor. Its size in bytes can be determined by function SimdDescrIntEncodedSize.
[out]dst- a pointer to output 16-bit float descriptor. Its length can be determined by function SimdDescrIntDecodedSize.

◆ SimdDescrIntCosineDistance()

void SimdDescrIntCosineDistance ( const void *  context,
const uint8_t *  a,
const uint8_t *  b,
float *  distance 
)

Calculates cosine distance of two integer descriptors.

Note
Integer descriptor can be recieved with using of functions SimdDescrIntEncode32f of SimdDescrIntEncode16f. Its size in bytes is determined by function SimdDescrIntEncodedSize.
Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]a- a pointer to the first integer descriptor.
[in]b- a pointer to the second integer descriptor.
[out]distance- a pointer to 32-bit float with cosine distance.

◆ SimdDescrIntCosineDistancesMxNa()

void SimdDescrIntCosineDistancesMxNa ( const void *  context,
size_t  M,
size_t  N,
const uint8_t *const *  A,
const uint8_t *const *  B,
float *  distances 
)

Calculates mutual cosine distance of two arrays of integer descriptor arrays.

Note
Integer descriptor can be recieved with using of functions SimdDescrIntEncode32f of SimdDescrIntEncode16f. Its size in bytes is determined by function SimdDescrIntEncodedSize.
Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]M- a number of A arrays.
[in]N- a number of B arrays.
[in]A- a pointer to the first array with pointers to integer descriptors.
[in]B- a pointer to the second array with pointers to integer descriptors.
[out]distances- a pointer to result 32-bit float array with cosine distances. It size must be M*N.

◆ SimdDescrIntCosineDistancesMxNp()

void SimdDescrIntCosineDistancesMxNp ( const void *  context,
size_t  M,
size_t  N,
const uint8_t *  A,
const uint8_t *  B,
float *  distances 
)

Calculates mutual cosine distance of two arrays of integer descriptors.

Note
Integer descriptor can be recieved with using of functions SimdDescrIntEncode32f of SimdDescrIntEncode16f. Its size in bytes is determined by function SimdDescrIntEncodedSize.
Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]M- a number of A arrays.
[in]N- a number of B arrays.
[in]A- a pointer to the first array with integer descriptors.
[in]B- a pointer to the second array with integer descriptors.
[out]distances- a pointer to result 32-bit float array with cosine distances. It size must be M*N.

◆ SimdDescrIntVectorNorm()

void SimdDescrIntVectorNorm ( const void *  context,
const uint8_t *  a,
float *  norm 
)

Calculates vector norm for integer descriptor.

Note
Integer descriptor can be recieved with using of functions SimdDescrIntEncode32f of SimdDescrIntEncode16f. Its size in bytes is determined by function SimdDescrIntEncodedSize.
Parameters
[in]context- a pointer to Integer Descriptor Engine context. It must be created by function SimdDescrIntInit and released by function SimdRelease.
[in]a- a pointer to integer descriptor.
[out]norm- a pointer to result 32-bit float norm.