VLCDecodeEscBlock_AAC

Parses the bitstream and decodes variable length code for AAC using signed VLC tables.

Syntax

IppStatus ippsVLCDecodeEscBlock_AAC_1u16s(const Ipp8u** ppBitStream, int* pBitOffset, Ipp16s* pData, int len, const IppsVLCDecodeSpec_32s* pVLCSpec);

Parameters

ppBitStream

Double pointer to the current byte in the bitstream buffer. ppBitStream is updated by the function.

pBitOffset

Pointer to the bit position in the byte pointed by ppBitStream. pBitOffset is updated by the function.

pData

Pointer to the array of decoded values.

len

Number of values to decode into array pData.

pVLCSpec

Pointer to VLCDecoder specification structure.

Description

The function ippsVLCDecodeEscBlock_AAC is 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_AAC, 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).

AACEsc VLC codebook is an unsigned two-dimensional codebook with a large absolute value is equal to 16.

From one record of initial inputTable you can obtain from one to four records of rearranged inputTable. For example,

Initial input table record - {159, 0x1ad, 9}
abs(first_sample_value) = 159/17 = 9;
abs(second_sample_value) = 159 - 17*9 = 6;

code_ini = 0x1ad
length_ini = 9;

record 1: first_sample_value = -9, second_sample_value = -6;
		value = (-9 << 8) + (-6 + 128) = -2182;
		code = (((0x1ad << 1) + 1) << 1) + 1 = 0x6b7;
		length = 9 + 1 + 1 = 11;
		{-2182, 0x6b7, 11)

record 2: first_sample_value = -9, second_sample_value = 6;
		value = (-9 << 8) + (6 + 128) = -2170;
		code = (((0x1ad << 1) + 1) << 1) + 0 = 0x6b6;
		length = 9 + 1 + 1 = 11;
		{-2170, 0x6b6, 11)

record 3: first_sample_value = 9, second_sample_value = -6;
		value = (9 << 8) + (-6 + 128) = 2426;
		code = (((0x1ad << 1) + 0) << 1) + 1 = 0x6b5;
		length = 9 + 1 + 1 = 11;
		{2426, 0x6b7, 11)

record 4: first_sample_value = 9, second_sample_value = 6;
		value = (9 << 8) + (6 + 128) = 2438;
		code = (((0x1ad << 1) + 0) << 1) + 0 = 0x6b4;
		length = 9 + 1 + 1 = 11;
		{2438, 0x6b7, 11)

The function ippsVLCDecodeEscBlock_AAC is used in the float-point and fixed-point versions of AAC decoder included into IPP Samples. See introduction to this section.

Return Values

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.

ippStsVLCAACEscCodeLengthErr

Indicates an error when bitstream contains AAC-Esc code with the length more than 21.

Submit feedback on this help topic

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