CalcSF

Restores actual scale factors from the bit stream values.

Syntax

IppStatus ippsCalcSF_16s32f(const Ipp16s* pSrc, int offset, Ipp32s* pDst, int len);

Parameters

pSrc

Pointer to the input data array.

offset

Scale factors offset.

pDst

Pointer to the output data array.

len

Number of elements in the vector.

Description

This function is declared in the ippac.h header file. The function ippsCalcSF restores actual scale factors from the values pSrc transmitted in the bit stream, using the common scale factor offset. Computation is performed according to the following formula

pDst[i] = 21/4(pSrc[i] - offset), 0i < len.

Restored scale factors are written into pDst.

Below see example  of using ippsCalcSF_16s32f function.

The function ippsCalcSF 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.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pSrc or pDst pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Note iconNote

The input values in the pSrc array must be in the range -512 ≤ (pSrc[i] - offset) < 512. Otherwise the function may operate incorrectly. No error message is returned in this case.

ippsCalcSF Usage  

#undef SF_OFFSET
#define SF_OFFSET 100
IppStatus calcSF(void) 
{
  Ipp16s pSrc[5] = {65, 128, 163, 58, 100};
  Ipp32f pDst[5];
  IppStatus st = ippsCalcSF_16s32f(pSrc, SF_OFFSET, pDst, 5);
  int i;

		
  printf("\n pDst = ");
  for (i = 0; i < 5; i++)
    printf("%f ", pDst[i]);
  printf("\n");
}

		
//Output:
//   pDst = 0.002323 128.000000 55108.988281 0.000691 1.000000

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.