sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef _HUFFMAN_H_ sl@0: #define _HUFFMAN_H_ sl@0: sl@0: #include sl@0: sl@0: #include "jpeg_bits.h" sl@0: sl@0: typedef struct _HuffmanEntry HuffmanEntry; sl@0: typedef struct _HuffmanTable HuffmanTable; sl@0: sl@0: struct _HuffmanEntry { sl@0: unsigned int symbol; sl@0: unsigned int mask; sl@0: int n_bits; sl@0: unsigned char value; sl@0: }; sl@0: sl@0: struct _HuffmanTable { sl@0: int len; sl@0: HuffmanEntry entries[256]; sl@0: }; sl@0: sl@0: sl@0: void huffman_table_init(HuffmanTable *table); sl@0: sl@0: void huffman_table_dump(HuffmanTable *table); sl@0: void huffman_table_add(HuffmanTable *table, uint32_t code, int n_bits, sl@0: int value); sl@0: unsigned int huffman_table_decode_jpeg(HuffmanTable *tab, JpegBits *bits); sl@0: int huffman_table_decode_macroblock(short *block, HuffmanTable *dc_tab, sl@0: HuffmanTable *ac_tab, JpegBits *bits); sl@0: int huffman_table_decode(HuffmanTable *dc_tab, HuffmanTable *ac_tab, JpegBits *bits); sl@0: sl@0: sl@0: #endif sl@0: