Applies scale factors to spectral bands in accordance with spectral bands boundaries.
IppStatus ippsScale_32f_I(Ipp32f* pSrcDst, const Ipp32f* pSF, const int* pBandOffset, int bandsNumber);
pSrcDst |
Pointer to the input and output data array. The size of array must be not less than pBandOffset [bands_number]. |
pSF |
Pointer to the data array containing scale factors. The size of the array must be not less than bands_number. |
pBandOffset |
Pointer to the vector of band offsets. The size of array must be not less than bands_number + 1. |
bandsNumber |
Number of bands to which scale factors are applied. |
This function is declared in the ippac.h header file. The function ippsScale_32f_I computes scaled values from the input vector, the vector of scale factors, and the vector of band offsets. Operations are performed in-place.
This function applies the set of scale factors pSF with bandsNumber elements to the bands constructed from the input vector pSrc. Band boundaries are defined by the vector of the band offsets pBandOffset. All values in each band are multiplied by the corresponding scale factor.
The function operates on the assumption that the end of the last band coincides with the end of the spectral data vector, that is, the size of pSrcDst vector is contained in the pBandsOffset[bandsNumber] element.
Below see an example of using ippsScale_32f_I.
The function ippsScale is used in the float-point versions of AAC and MP3 decoders included into Intel IPP Samples downloadable from http://www.intel.com/cd/software/products/asmo-na/eng/220046.htm.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when the pSrcDst or pBandsOffset pointer is NULL. |
ippStsSizeErr |
Indicates an error when bandsNumber is less than or equal to 0. |
IppStatus scale(void)
{
Ipp32f pSrcDst[20];
Ipp32f pSF[5] = {0.002323, 128, 55108.988281, 0.000691, 1};
int pBandOffset[6] = {0,1,3,8,13,20};
IppStatus st;
int i;
for (i = 0; i < 20; i++)
pSrcDst[i] = (Ipp32f)i;
st = ippsScale_32f_I(pSrcDst, pSF, pBandOffset, 5);
printf("\n pSrcDst = ");
for (i = 0; i < 20; i++)
printf("%f ", pSrcDst[i]);
printf("\n");
}
//Output:
// pDst = 0.000000 128.000000 256.000000 165326.968750 220435.953125
// 275544.937500 330653.937500 385762.906250 0.005528 0.006219
// 0.006910 0.007601 0.008292 13.000000 14.000000
// 15.000000 16.000000 17.000000 18.000000 19.000000
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.