Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / media / libtheora / lib / dec / decint.h
blob656006897ed87e6447015d3b9a0f574c8e80cc72
1 /********************************************************************
2 * *
3 * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7 * *
8 * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
10 * *
11 ********************************************************************
13 function:
14 last mod: $Id: decint.h 14369 2008-01-05 23:15:32Z tterribe $
16 ********************************************************************/
18 #include <limits.h>
19 #if !defined(_decint_H)
20 # define _decint_H (1)
21 # include "theora/theoradec.h"
22 # include "../internal.h"
23 # include "bitwise.h"
25 typedef struct th_setup_info oc_setup_info;
26 typedef struct th_dec_ctx oc_dec_ctx;
28 # include "idct.h"
29 # include "huffdec.h"
30 # include "dequant.h"
32 /*Constants for the packet-in state machine specific to the decoder.*/
34 /*Next packet to read: Data packet.*/
35 #define OC_PACKET_DATA (0)
39 struct th_setup_info{
40 /*The Huffman codes.*/
41 oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES];
42 /*The quantization parameters.*/
43 th_quant_info qinfo;
48 struct th_dec_ctx{
49 /*Shared encoder/decoder state.*/
50 oc_theora_state state;
51 /*Whether or not packets are ready to be emitted.
52 This takes on negative values while there are remaining header packets to
53 be emitted, reaches 0 when the codec is ready for input, and goes to 1
54 when a frame has been processed and a data packet is ready.*/
55 int packet_state;
56 /*Buffer in which to assemble packets.*/
57 oggpack_buffer opb;
58 /*Huffman decode trees.*/
59 oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES];
60 /*The index of one past the last token in each plane for each coefficient.
61 The final entries are the total number of tokens for each coefficient.*/
62 int ti0[3][64];
63 /*The index of one past the last extra bits entry in each plane for each
64 coefficient.
65 The final entries are the total number of extra bits entries for each
66 coefficient.*/
67 int ebi0[3][64];
68 /*The number of outstanding EOB runs at the start of each coefficient in each
69 plane.*/
70 int eob_runs[3][64];
71 /*The DCT token lists.*/
72 unsigned char **dct_tokens;
73 /*The extra bits associated with DCT tokens.*/
74 ogg_uint16_t **extra_bits;
75 /*The out-of-loop post-processing level.*/
76 int pp_level;
77 /*The DC scale used for out-of-loop deblocking.*/
78 int pp_dc_scale[64];
79 /*The sharpen modifier used for out-of-loop deringing.*/
80 int pp_sharp_mod[64];
81 /*The DC quantization index of each block.*/
82 unsigned char *dc_qis;
83 /*The variance of each block.*/
84 int *variances;
85 /*The storage for the post-processed frame buffer.*/
86 unsigned char *pp_frame_data;
87 /*Whether or not the post-processsed frame buffer has space for chroma.*/
88 int pp_frame_has_chroma;
89 /*The buffer used for the post-processed frame.*/
90 th_ycbcr_buffer pp_frame_buf;
91 /*The striped decode callback function.*/
92 th_stripe_callback stripe_cb;
95 #endif