ReQuantize_MP3, ReQuantizeSfb_MP3

Requantizes the decoded Huffman symbols.

Syntax

IppStatus ippsReQuantize_MP3_32s_I(Ipp32s* pSrcDstIsXr, int* pNonZeroBound, Ipp8s* pScaleFactor, IppMP3SideInfo* pSideInfo, IppMP3FrameHeader* pFrameHeader, Ipp32s* pBuffer);

IppStatus ippsReQuantizeSfb_MP3_32s_I(Ipp32s* pSrcDstIsXr, int* pNonZeroBound, Ipp8s* pScaleFactor, IppMP3SideInfo* pSideInfo, IppMP3FrameHeader* pFrameHeader, Ipp32s* pBuffer, IppMP3ScaleFactorBandTableLong pSfbTableLong, IppMP3ScaleFactorBandTableShort pSfbTableShort);

Parameters

pSrcDstIsXr

Pointer to the vector of the decoded Huffman symbols. For stereo and dual channel modes, right channel data begins at the address &(pSrcDstIsXr [576]). The function updates this vector.

pNonZeroBound

Pointer to the spectral bound above which all coefficients are set to zero. For stereo and dual channel modes, the left channel bound is pNonZeroBound [0], and the right channel bound is pNonZeroBound [1].

pScaleFactor

Pointer to the scalefactor buffer. For stereo and dual channel modes, the right channel scalefactors begin at & (pScaleFactor [IPP_MP3_SF_BUF_LEN]).

pSideInfo

Pointer to the side information for the current granule.

pFrameHeader

Pointer to the frame header for the current frame.

pBuffer

Pointer to the workspace buffer. The buffer length must be 576 samples.

pSfbTableLong

Pointer to the scale factor bands table for a long block.

pSfbTableShort

Pointer to the scale factor bands table for a short block.

Description

The functions ippsReQuantize_MP3 and ippsReQuantizeSfb_MP3 are declared in the ippac.h file. These functions requantize the decoded Huffman symbols. Spectral samples for the synthesis filter bank are derived from the decoded symbols using the requantization equations given in the ISO standard.

If necessary, you can apply stereophonic mid/side (M/S) and/or intensity decoding. The function returns requantized spectral samples in the vector pSrcDstIsXr.

For short blocks you can perform reordering operation. You should preallocate a workspace buffer pointed to by pBuffer prior to calling the requantization function. For short blocks, the value pointed to by pNonZeroBound is recalculated according to the reordered sequence.

You can use predefined scale factor bands table for a long or short block with the function ippsReQuantizeSfb_MP3. Alternatively, you can use the default table from MPEG-1, or MPEG-2 standards.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.

ippStsBadArgErr

Indicates an error when pNonZeroBound exceeds [0, 576].

ippStsMP3FrameHeaderErr

Indicates an error when pFrameHeader->id != IPP_MP3_ID_MPEG1 pFrameHeader->id != IPP_MP3_ID_MPEG2 pFrameHeader->samplingFreq exceeds [0, 2], pFrameHeader->mode exceeds [0, 3], pFrameHeader->modeExt exceeds [0, 3].

ippStsMP3SideInfoErr

Indicates an error when the bitstream is in the stereo mode, but the block type of left is different from that of right, pSideInfo[ch].blockType exceeds [0, 3], pSideInfo[ch].mixedBlock exceeds [0, 1], pSideInfo[ch].globGain exceeds [0, 255], pSideInfo[ch].sfScale exceeds [0, 1], pSideInfo[ch].preFlag exceeds [0, 1], pSideInfo [ch].pSubBlkGain[w] exceeds [0, 7], where ch is within the range of 0 to 1, and w is within the range of 0 to 2.

ippStsErr

Indicates an unknown error.

Submit feedback on this help topic

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