Converts mantissa and exponent arrays to float arrays.
IppStatus ippsMakeFloat_16s32f (Ipp16s* inmant, Ipp16s* inexp, Ipp32s size, Ipp32f* outfloat);
inmant |
Array of mantissas. |
inexp |
Array of exponents. |
size |
Number of array elements. |
outfloat |
Array of resulting float arrays. |
Th function ippsMakeFloat is declared in the ippac.h header file. This function converts the mantissa and exponent arrays decoded from the bitstream to the float array of spectral samples by the formula:
outfloat[i] = inmant[1] x 2-inexp[i] -15, where i = 0...size.
The conversion serves to improve application performance when decoding bitstreams in the AC3 format.
Below see an example of using ippsMakeFloat_16s32f.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when the inmant, inexp or outfloat pointer is NULL. |
ippStsSizeErr |
Indicates an error when size is less than or equal to 0. |
IppStatus makefloat(void)
{
Ipp16s inmant[5] = {1234, 56, 25907, 3498, 27854};
Ipp16s inexp[5] = {-2, -1, 0, 1, 2};
Ipp32f outfloat[5];
IppStatus st = ippsMakeFloat_16s32f(inmant, inexp, 5, outfloat);
int i;
printf("\n outfloat = ");
for (i = 0; i < 5; i++)
printf("%f ", outfloat[i]);
printf("\n");
}
//Output:
// outfloat = 0.150635 0.003418 0.790619 0.053375 0.212509
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.