1 /********************************************************************
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. *
8 * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2003 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
11 ********************************************************************
16 ********************************************************************/
18 /********************************************************************
20 ********************************************************************/
21 #define NUM_HUFF_TABLES 80
22 #define DC_HUFF_OFFSET 0
23 #define AC_HUFF_OFFSET 16
24 #define AC_TABLE_2_THRESH 5
25 #define AC_TABLE_3_THRESH 14
26 #define AC_TABLE_4_THRESH 27
28 #define DC_HUFF_CHOICES 16
29 #define DC_HUFF_CHOICE_BITS 4
31 #define AC_HUFF_CHOICES 16
32 #define AC_HUFF_CHOICE_BITS 4
34 /* Constants assosciated with entropy tokenisation. */
35 #define MAX_SINGLE_TOKEN_VALUE 6
36 #define DCT_VAL_CAT2_MIN 3
37 #define DCT_VAL_CAT3_MIN 7
38 #define DCT_VAL_CAT4_MIN 9
39 #define DCT_VAL_CAT5_MIN 13
40 #define DCT_VAL_CAT6_MIN 21
41 #define DCT_VAL_CAT7_MIN 37
42 #define DCT_VAL_CAT8_MIN 69
44 #define DCT_EOB_TOKEN 0
45 #define DCT_EOB_PAIR_TOKEN 1
46 #define DCT_EOB_TRIPLE_TOKEN 2
47 #define DCT_REPEAT_RUN_TOKEN 3
48 #define DCT_REPEAT_RUN2_TOKEN 4
49 #define DCT_REPEAT_RUN3_TOKEN 5
50 #define DCT_REPEAT_RUN4_TOKEN 6
52 #define DCT_SHORT_ZRL_TOKEN 7
53 #define DCT_ZRL_TOKEN 8
55 #define ONE_TOKEN 9 /* Special tokens for -1,1,-2,2 */
56 #define MINUS_ONE_TOKEN 10
58 #define MINUS_TWO_TOKEN 12
60 #define LOW_VAL_TOKENS (MINUS_TWO_TOKEN + 1)
61 #define DCT_VAL_CATEGORY3 (LOW_VAL_TOKENS + 4)
62 #define DCT_VAL_CATEGORY4 (DCT_VAL_CATEGORY3 + 1)
63 #define DCT_VAL_CATEGORY5 (DCT_VAL_CATEGORY4 + 1)
64 #define DCT_VAL_CATEGORY6 (DCT_VAL_CATEGORY5 + 1)
65 #define DCT_VAL_CATEGORY7 (DCT_VAL_CATEGORY6 + 1)
66 #define DCT_VAL_CATEGORY8 (DCT_VAL_CATEGORY7 + 1)
68 #define DCT_RUN_CATEGORY1 (DCT_VAL_CATEGORY8 + 1)
69 #define DCT_RUN_CATEGORY1B (DCT_RUN_CATEGORY1 + 5)
70 #define DCT_RUN_CATEGORY1C (DCT_RUN_CATEGORY1B + 1)
71 #define DCT_RUN_CATEGORY2 (DCT_RUN_CATEGORY1C + 1)
74 #define MAX_ENTROPY_TOKENS (DCT_RUN_CATEGORY2 + 2)