Computes forward modified discrete cosine transform (MDCT) of windowed signals.
IppStatus ippsMDCTFwd_AAC_32s_I(Ipp32s* pSrcDst, int winSequence, int winShape, int prevWinShape, int len);
pSrcDst |
Pointer to the source and destination vector for the in-place operation. |
winSequence |
Window sequence indicator. |
winShape |
Window shape indicator. |
prevWinShape |
Window shape indicator of the previous frame. |
len |
Number of samples in Src buffer. |
The ippsMDCTFwd_AAC_32s_I function is declared in the ippac.h file. This function performs forward MDCT operation. Before MDCT is calculated, the source data is multiplied by the window described with winSequence, winShape, and prevWinShape parameters.
This function is implemented for using in AAC decoder. It does not perform any saturation so the user should consider overflow possibility. The source and destination have different positions of the decimal point (Q format). The Q format of destination depends on the window sequence indicator.
WinSequence = 0 (long window): If Src is in Qn format then Dst in Q(n-12) format
WinSequence = 1 (long start window): If Src is in Qn format then Dst in Q(n-12) format
WinSequence = 2 (eight short window): If Src is in Qn format then Dst in Q(n-9) format
WinSequence = 3 (long stop window): If Src is in Qn format then Dst in Q(n-12) format.
For example, if Src is in Q14 format, then Dst is in Q5 format in the case of eight short window and in Q2 in other cases.
Only len = 2048 is supported in the current implementation.
Below see code example of using ippsMDCTFwd_AAC_32s_I function.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when any of the pointers passed to the function is NULL. |
ippStsAacWinSeqErr |
Indicates an error when winSequence exceeds [0,3]. |
ippStsAacWinShapeErr |
Indicates an error when winShape or prevWinShape exceeds [0,1]. |
ippStsSizeErr |
Indicates an error when len is not equal to 2048. |
#undef ONLY_LONG_SEQUENCE
#undef LONG_START_SEQUENCE
#undef EIGHT_SHORT_SEQUENCE
#undef LONG_STOP_SEQUENCE
#undef WINDOW_SHAPE_FHG
#undef WINDOW_SHAPE_DOLBY
#define ONLY_LONG_SEQUENCE 0
#define LONG_START_SEQUENCE 1
#define EIGHT_SHORT_SEQUENCE 2
#define LONG_STOP_SEQUENCE 3
#define WINDOW_SHAPE_FHG 0
#define WINDOW_SHAPE_DOLBY 1
IppStatus mdctfwdaac(void)
{
Ipp32s pSrcDst[2048];
IppStatus st;
int i;
for (i = 0; i < 2048; i++)
pSrcDst[i] = (Ipp32s)(cos(IPP_2PI * i / 2048) * 16384); /* Q14 */
st = ippsMDCTFwd_AAC_32s_I(pSrcDst, ONLY_LONG_SEQUENCE,
WINDOW_SHAPE_DOLBY, WINDOW_SHAPE_DOLBY, 2048);
/* Output will be in Q2 format */
printf("\n pSrcDst = ");
for (i = 0; i < 10; i++)
printf("%i ", pSrcDst[i]);
printf("\n");
return st;
}
//Output (first 10 elements):
// pSrcDst = 3174 -2549 -333 -300 26 -8 -3 -1 1 1
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.