Parses the bitstream and decodes variable length code for MP3 using signed VLC tables.
IppStatus ippsVLCDecodeEscBlock_MP3_1u16s(const Ipp8u** ppBitStream, int* pBitOffset, int linbits, Ipp16s* pData, int len, const IppsVLCDecodeSpec_32s* pVLCSpec);
ppBitStream |
Doubleo pointer to the current byte in the bitstream buffer, is updated by the function. |
pBitOffset |
Pointer to the bit position in the byte pointed by ppBitStream. pBitOffset is updated by the function. |
linbits |
Length of escape sequence. |
pData |
Pointer to the array of decoded values. |
len |
Number of values to decode into array pData. |
pVLCSpec |
Pointer to VLCDecoder specification structure. |
The function ippsVLCDecodeEscBlock_MP3is declared in the ippac.h header file. The function parses the bitstream and decodes variable length code using the VLCDecoder specification structure built by the function ippsVLCDecodeInit_32s or ippsVLCDecodeInitAlloc_32s from data compression domain, and resets the pointers to new positions. The pointer pBitStream points to the 8-bit value and the bit offset may vary from one to 32. After processing, the pointer and bit offset are changed and their new values are returned. To use the function ippsVLCDecodeEscBlock_MP3, rearrange inputTable before initialization as follows:
value = (first_sample_value) << 8) + (second_sample_value + 128).
code = (((code_ini << (first_sample_value != 0)) + (first_sample_value < 0)) << (second_sample_value != 0)) + (first_sample_value < 0).
length = length_ini + (first_sample_value != 0) + (second_sample_value != 0).
MP3Esc VLC codebook is an unsigned two-dimensional codebook with a large absolute value equal to 15.
From one record of the initial inputTable you can obtain from one to four records of rearranged inputTable. For example:
abs(first_sample_value) = 9; abs(second_sample_value) = 6; code_ini = 0xf5 length_ini = 12; record 1: first_sample_value = -9, second_sample_value = -6; value = (-9 << 8) + (-6 + 128) = -2182; code = (((0xf5 << 1) + 1) << 1) + 1 = 0x3d7; length = 12 + 1 + 1 = 14; {-2182, 0x3d7, 14) record 2: first_sample_value = -9, second_sample_value = 6; value = (-9 << 8) + (6 + 128) = -2170; code = (((0xf5 << 1) + 1) << 1) + 0 = 0x3d6; length = 12 + 1 + 1 = 14; -2170, 0x3d6, 14) record 3: first_sample_value = 9, second_sample_value = -6; value = (9 << 8) + (-6 + 128) = 2426; code = (((0xf5 << 1) + 0) << 1) + 1 = 0x3d5; length = 12 + 1 + 1 = 14; {2426, 0x3d7, 14) record 4: first_sample_value = 9, second_sample_value = 6; value = (9 << 8) + (6 + 128) = 2438; code = (((0xf5 << 1) + 0) << 1) + 0 = 0x3d4; length = 12 + 1 + 1 = 14; {2438, 0x3d7, 14)
The function ippsVLCDecodeEscBlock_MP3_1u16s is used in the float-point and fixed-point versions of MP3 decoder included into IPP Samples. See introduction to this section.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when one of the specified pointers is NULL. |
ippStsBitOffsetErr |
Indicates an error when pBitOffset is less than 0 or more than 7. |
ippStsContextMatchErr |
Indicates an error when pVLCSpec structure does not match the operation. |
ippStsVLCInputDataErr |
Indicates an error when incorrect input is used. For decode functions it can indicate that bitstream contains code that is not specified inside the used table. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.