Implements ISO/IEC 11172-3 psychoacoustic model recommendation 2 to estimate masked threshold and perceptual entropy associated with a block of PCM audio input.
IppStatus ippsPsychoacousticModelTwo_MP3_16s(const Ipp16s* pSrcPcm, IppMP3PsychoacousticModelTwoAnalysis* pDstPsyInfo, int* pDstIsSfbBound, IppMP3SideInfo* pDstSideInfo, IppMP3FrameHeader* pFrameHeader, IppMP3PsychoacousticModelTwoState* pFramePsyState, Ipp32s* pWorkBuffer, int pcmMode);
pSrcPcm |
Pointer to the start of the buffer containing the input PCM audio vector, the samples of which must conform to the following format specification:16-bits per sample, signed, little-endian, Q15. The buffer must contain 1152 samples, that is, two granules of 576 samples each, if the parameter pFrameHeader -> mode has the value 1 (mono), or 2304 samples, that is, two granules of 576 samples each, if the parameter pFrameHeader -> mode has the value of 2 (stereo, dual mono). In the stereophonic case, the PCM samples associated with the left and right channels should be organized according to the pcmMode flag. Failure to satisfy any of the above PCM format and/or buffer requirements results in undefined model outputs. |
pDstPsychoInfo |
Pointer to the first element in a set of PsychoacousticModelTwoAnalysis structures. Each set member contains the MSR and PE estimates for one granule. The number of elements in the set is equal to the number of channels, with the outputs arranged as follows: (Analysis[0] = granule 1, channel 1), (...Analysis[1] = granule 1, channel 2), (...Analysis[2] = granule 2, channel 1), (...Analysis[3] = granule 2, channel 2). |
pDstIsSfbBound |
If intensity coding has been enabled, pDstIsSfbBound points to the list of SFB lower bounds above which all spectral coefficients should be processed by the joint stereo intensity coding module. Since the intensity coding SFB lower bound is block-specific, the number of valid elements pointed to by pDstIsSfbBound varies depending upon the individual block types associated with each granule. In particular, the list of SFB bounds is indexed as follows: pIsSfbBound[3* gr] for long block granules pIsSfbBound[3* gr + w ] for short block granules, where gr is the granule index (0 indicates granule 1 and 1 indicates granule 2), and w is the block index (0 indicates block 1, 1 indicates block 2, 2 indicates block 3). |
For example, given short-block analysis in granule 1 followed by long block analysis in granule 2, the list of SFB bounds would be generated in the following order: pIsSfbBound[] = {granule 1/block 1, granule 1/block 2, granule 1/block 2, granule 2/long block}. | |
Only one SFB lower bound decision is generated for long block granules, whereas three are generated for short block granules. If both MS and intensity coding are enabled, then the SFB intensity coding lower bound simultaneously represents the upper bound SFB for MS coding. If only MS coding has been enabled, then the SFB bound represents the lowest non-MS SFB. | |
pDstSideInfo |
Pointer to the updated set of IppMP3SideInfo structures associated with all granules and channels. The model updates the following fields in all set elements: blockType, winSwitch, and mixedBlock. The number of elements in the set is equal to 2 times the number of channels. Ordering of the set elements is the same as pDstPsychoInfo. |
pFrameHeader |
Pointer to the updated IppMP3FrameHeader structure that contains the header associated with the current frame. The model updates the element modeExt to reflect the joint stereo coding mode decision. No other frame header fields are modified by this function. |
pFramePsyState |
Pointer to the first element in a set of IppMP3PsychoacousticModelTwoState> structures that contains the updated psychoacoustic model state information associated with both the current frame and next frame. The number of elements in the set is equal to the number of channels contained in the input audio. That is, a separate analysis is carried for each channel. |
Prior to encoding a new audio stream, all elements of the psychoacoustic model state structure pPsychoacousticModelState should be initialized to contain the value 0. | |
In the signal processing domain, this could be accomplished using the function ippsZero_16s as follows: ippsZero_16s ((Ipp16s *) pPsychoacousticModelState, sizeof(IppMP3PsychoacousticModelTwoState)/sizeof(Ipp16s)). | |
pWorkBuffer |
Pointer to the workspace buffer internally used by the psychoacoustic model for storage of intermediate results and other temporary data. The buffer length must be at least 25,200 bytes, that is, 6300 elements of type Ipp32s. |
pcmMode |
PCM mode flag. Communicates the psychoacoustic model which type of PCM vector organization to expect:pcmMode = 1 denotes non-interleaved PCM input samples, that is, pSrcPcm[0..1151] contains the input samples associated with the left channel, and pSrcPcm[1152..2303] contains the input samples associated with the right channel.pcmMode = 2 denotes interleaved PCM input samples, that is, pSrcPcm[2* i] and pSrcPcm[2 *i+1] contain the samples associated with the left and right channels, respectively, where i= 0,1,...,1151. |
You can also use appropriately typecast elements ippMP3NonInterleavedPCM and ippMP3InterleavedPCM of the enumerated type IppMP3PcmMode as an alternative to the constants 1 and 2 for pcmMode. |
The function is declared in the ippac.h file. This function implements the ISO/IEC 11172-3 psychoacoustic model recommendation 2 to estimate the masked threshold and perceptual entropy associated with a block of PCM audio input. Quantization process uses model outputs to estimate a perceptually optimal bit allocation for the spectral coefficients generated by the analysis filterbank. The psychoacoustic model also controls stereophonic MS/intensity mode selection and processing as well as analysis filterbank block size switching. Given one frame of PCM input audio of 1152 samples per channel, that is, two granules of 576 samples each, the psychoacoustic model generates the following outputs:
The psychoacoustic model performs analysis on a frame basis (1152 samples per channel), including two granules and up to two channels for either stereophonic or dual mono inputs. Valid lengths for both input and output vectors depend upon which mono or stereo channel modes have been enabled.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when at least one of the pointers pSrcPcm, pDstPsyInfo, pDstSideInfo, pDstIsSfbBound, pFrameHeader, pDstPsyState, or pWorkBuffer is NULL. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.