HuffmanDecodeSegment_DV100

Decodes and rearranges DV100 segment block, multiplies first block element by 128.

Syntax

IppStatus ippiHuffmanDecodeSegment_DV100_8u16s(const Ipp8u* pStream, const Ipp32u* pZigzagTables, const Ipp32u* pHuffTable, Ipp16s* pBlock, Ipp32u* pBlockParam);

Parameters

pStream

Pointer to bitstream (compressed video segment).

pZigzagTables

Pointer to the de-zigzag table.

pHuffTable

Pointer to the decoding Huffman table.

pBlock

Pointer to the array where DCT decoded blocks should be stored.

pBlockParam

Pointer to output parameters array [40].

Description

This function is declared in the ippvc.h header file. The function ippiHuffmanDecodeSegment_DV100_8u16s decodes and rearranges DV100 video segment, multiplies the first block element by 128.

AC coefficients are decoded using Variable Length Codes with the help of the destination decoding table created by InitAllocHuffmanTable_DV. Since this table contains level values multiplied by 64, the output values of AC coefficients are also multiplied by 64.

DC coefficients are obtained from the first 2 bytes of the compressed blocks (see "Arrangement of Y compressed blocks cbY0, cbY1, cbY2, cbY3" and "Arrangement of Cr compressed blocks cbU, cbV") with zeroing of the last 7 bits. The output values of DC coefficients are multiplied by 128 (shift left by 7).

The pointer pStream points to a compressed video segment, which is a sequence of 5 compressed macroblocks. Each macroblock consists of 8 DCT blocks (4 luma and 4 color difference blocks).

The pZigzagTables pointer refers to the array that contains the de-zigzag index.

The argument *pBlockParam ("BlockParam Structure") stores values m0 (block type), cl (class number) for every block. In DV100, the same DCT mode (8-8-frame or 8-8-field) is applied to all DCT blocks in a macroblock. The DCT mode is stored in the first DCT block of the macro block; m0 values of the other DCT blocks are not used. Value qn0 (quantization number) is obtained from the first block of the macroblock. The same value qn0 is used for all blocks of the macroblock.

See the usage example below for ippiHuffmanDecodeSegment_DV100_8u16s.

Usage of HuffmanDecodeSegment_DV100

{
    /* Create Huffman Decoding table*/
    /*Dv and DV100 use same Huffman Decoding table*/
    ippiInitAllocHuffmanTable_DV_32u( ..., ..., &pHuffTable);
    /*
    ...
    */
    /* Huffman Decode video segment
    pEncodedVideoSegment - (Ipp8u*) pointer to compresses video segment
    DeZigzagTables - (Ipp32u*) pointer to array of de-zigzag table
    pHuffTable - (Ipp32u*) pointer to Huffman decoding table created
    by the ippiInitAllocHuffmanTable_DV_32u function
    lpsDecodedBlocks - (Ipp16s*) pointer to 40 decoded DCT blocks (5 macro
    blocks of 8 DCT blocks, 8*  5 = 40)
    BlockParamBuffer - (Ipp32u*) pointer to array of 40 unsigned double
    words, containing DC, m0 and cl values for DCT blocks
    */
    ippiHuffmanDecodeSegment_DV100_8u16s(pEncodedVideoSegment,
                                            DeZigzagTable,
                                            pHuffTable,
                                            lpsDecodedBlocks,
                                            BlockParamBuffer);
    /*
    ...
    */
};

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when at least one input pointer is NULL.


Submit feedback on this help topic

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