Raises a vector to the power of 4/3 with scaling.
IppStatus ippsPow43Scale_16s32s_Sf(const Ipp16s* pSrc, Ipp32f* pDst, const Ipp16s *pScaleFactor, const Ipp32s *pBandOffset, int offset, int bandsNumber, int groupLen, int scalef);
pSrc |
Pointer to the input data vector. |
pDst |
Pointer to the output data vector. |
pScaleFactor |
Pointer to the data array containing scale factors. The size of the array must be not less than bandsNumber. |
pBandOffset |
Pointer to the vector of band offsets. The size of array must be not less than bandsNumber + 1. |
offset |
Scale factors offset. |
bandsNumber |
Number of bands to which scale factors are applied. |
groupLen |
Number of windows in the current group. |
scalef |
Scale factor of the output data. |
This function is declared in the ippac.h header file. The ippsPow43Scale function performs the following operation:
pDst[i] = pSrc[i]4/3 * 21/4(pScaleFactor[band] - offset).
This function does not perform any saturation so the user must consider overflow possibility. Absolute values of pSrc[i] must be less than 214.
Below see an example of using ippsPow43Scale function.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when one of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error when groupLen or bandsNumber is less than 0. |
#undef SF_OFFSET
#define SF_OFFSET 100
IppStatus pow43scale(void)
{
Ipp16s pSrc[40];
Ipp32s pDst0[40], pDst1[40];
Ipp16s pScaleFactor[5] = {65, 128, 163, 58, 100};
Ipp32s pBandOffset0[6] = {0,1,3,8,13,20};
Ipp32s pBandOffset1[6];
int groupLen = 2;
int bandsNumber = 5;
int i;
IppStatus st;
for (i = 0; i < 40; i++)
pSrc[i] = (Ipp16s)(100 * i);
/* The are two ways of using ippsPow43Scale_16s32s_Sf when groupLen */
/* is not equal to 1 */
/* First way is to use function as is */
st = ippsPow43Scale_16s32s_Sf(pSrc, pDst0, pScaleFactor, pBandOffset0,
SF_OFFSET, bandsNumber, groupLen, 0);
if (st != ippStsOk) return st;
/* The second way is to recalculate pBandOffset */
pBandOffset1[0] = pBandOffset0[0];
for (i = 0; i < bandsNumber; i++)
pBandOffset1[i+1] = pBandOffset1[i] +
(pBandOffset0[i+1] - pBandOffset0[i]) * groupLen;
/* and use function ippsPow43Scale_16s32s_Sf with groupLen is equal to 1 */
/* The result will be the same */
st = ippsPow43Scale_16s32s_Sf(pSrc, pDst1, pScaleFactor, pBandOffset1,
SF_OFFSET, bandsNumber, 1, 0);
printf("\n pDst0 = ");
for (i = 0; i < 40; i++)
printf("%i ", pDst0[i]);
printf("\n");
printf("\n pDst1 = ");
for (i = 0; i < 40; i++)
printf("%i ", pDst1[i]);
printf("\n");
return st;
}
//Output:
// pDst1 = 0 1 149709 257062 377244 507968 278884317
// 342520430 409269211 478864278 551089873
// 625767026 702744444 781892234 863097398
// 946260634 12 14 15 16 17 18 19 20 22 23
// 35751 37596 39464 41355 43267 45201 47155
// 49130 51125 53140 55174 57227 59298 61388
//
// pDst1 = 0 1 149709 257062 377244 507968 278884317
// 342520430 409269211 478864278 551089873
// 625767026 702744444 781892234 863097398
// 946260634 12 14 15 16 17 18 19 20 22 23
// 35751 37596 39464 41355 43267 45201 47155
// 49130 51125 53140 55174 57227 59298 61388
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.