os/ossrv/genericopenlibs/liboil/tsrc/examples/jpeg/inc/jpeg_huffman.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #ifndef _HUFFMAN_H_
    20 #define _HUFFMAN_H_
    21 
    22 #include <liboil/liboil-stdint.h>
    23 
    24 #include "jpeg_bits.h"
    25 
    26 typedef struct _HuffmanEntry HuffmanEntry;
    27 typedef struct _HuffmanTable HuffmanTable;
    28 
    29 struct _HuffmanEntry {
    30   unsigned int symbol;
    31   unsigned int mask;
    32   int n_bits;
    33   unsigned char value;
    34 };
    35 
    36 struct _HuffmanTable {
    37   int len;
    38   HuffmanEntry entries[256];
    39 };
    40 
    41 
    42 void huffman_table_init(HuffmanTable *table);
    43 
    44 void huffman_table_dump(HuffmanTable *table);
    45 void huffman_table_add(HuffmanTable *table, uint32_t code, int n_bits,
    46 	int value);
    47 unsigned int huffman_table_decode_jpeg(HuffmanTable *tab, JpegBits *bits);
    48 int huffman_table_decode_macroblock(short *block, HuffmanTable *dc_tab,
    49 	HuffmanTable *ac_tab, JpegBits *bits);
    50 int huffman_table_decode(HuffmanTable *dc_tab, HuffmanTable *ac_tab, JpegBits *bits);
    51 
    52 
    53 #endif
    54