PackSideInfo_MP3

Packs the side information into the bitstream buffer.

Syntax

IppStatus ippsPackSideInfo_MP3(IppMP3SideInfo* pSrcSideInfo, Ipp8u** ppBitStream, int mainDataBegin, int privateBits, int* pSrcScfsi, IppMP3FrameHeader* pFrameHeader);

Parameters

pSrcSideInfo

Pointer to the IppMP3SideInfo structures. It must contain twice the channel number of elements. The order is the following: granule 1, channel 1; granule 1, channel 2; granule 2, channel 1;granule 2, channel 2. All fields of all set elements must contain valid data upon the function entry.

ppBitStream

Updated bitstream byte pointer. The parameter ppBitStream points to the first available bitstream buffer byte immediately following the packed side information bits. The frame header bits are formatted according to the bitstream syntax given in ISO/IEC 11172-3 :1993.

mainDataBegin

Negative bitstream offset, in bytes. The parameter value is typically the number of bytes remaining in the bit reservoir before the start of quantization for the current frame. When computing mainDataBegin, you must exclude the header and side information bytes.

privateBits

Channel-dependent number of application-specific (private) bits in the layer III bitstream audio data section.

pSrcScfsi

Pointer to the scale factor selection information table.

pFrameHeader

Pointer to the IppMP3FrameHeader structure. Only MPEG‑1 (id = 1) is supported.

Description

The function is declared in the ippac.h file. This function packs the side information into the bitstream buffer.

The side information formatter packs the 9-bit value of mainDataBegin into the main_data_begin field of the output bitstream.

The scale factor selection information table pSrcScfsi contains a set of binary flags that indicate whether scalefactors are shared across granules of a frame within predefined scale factor selection groups. For example, bands 0,1,2,3,4,5 form one group and bands 6,7,8,9,10 form the second group, as defined in ISO/IEC 11172-3.

The vector is indexed as pDstScfsi[ ch][scfsi_band ], where ch is the channel index (0 stands for channel 1, 1 stands for channel 2), scfsi_band is the scale factor selection group number:

group 0 includes SFBs 0-5, group 1 includes SFBs 6-10, group 2 includes SFBs 11-15, group 3 includes SFBs 16-20.

Depending on the number of channels, the function extracts the appropriate number of least significant bits from the parameter privateBits and packs them into the private_bits field of the output bitstream. The ISO/IEC 11172-3 bitstream syntax reserves a channel-dependent number of application-specific (private) bits in the layer III bitstream audio data section immediately following the parameter main_data_begin. For dual- and single-channel streams, respectively, three and five bits are reserved.

Upon the function entry, the structure fields id, mode, and layer of the pFrameHeader must contain, respectively, the algorithm id (MPEG-1 or MPEG-2), the mono or stereo mode, and the MPEG layer specifier.

All other pFrameHeader fields are ignored

The resulting bitstream is fully compliant with the syntax specified in ISO/IEC 11172-3 .

This function should be called once per frame.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when pSrcSideInfo, ppBitStream, pSrcScfsi, or pFrameHeader is NULL.

ippStsMP3FrameHeaderErr

Indicates an error when pFrameHeader->id != IPP_MP3_ID_MPEG1 pFrameHeader->id != IPP_MP3_ID_MPEG2 pFrameHeader->layer != 1 pFrameHeader->mode exceeds [0..3].

Submit feedback on this help topic

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