Mercurial > mplayer.hg
annotate libfaad2/codebook/hcb.h @ 13415:0e06453daf08
Cumulative patch 1.727 and 1.722
Better description of Loren Merritt's 3-pass mode, better qns desc., and a
couple of x264 encoding options (based a documentation I read)
author | gpoirier |
---|---|
date | Tue, 21 Sep 2004 09:42:33 +0000 |
parents | d81145997036 |
children | 1d5a49e6d9db |
rev | line source |
---|---|
10725 | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | |
3 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com | |
4 ** | |
5 ** This program is free software; you can redistribute it and/or modify | |
6 ** it under the terms of the GNU General Public License as published by | |
7 ** the Free Software Foundation; either version 2 of the License, or | |
8 ** (at your option) any later version. | |
9 ** | |
10 ** This program is distributed in the hope that it will be useful, | |
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ** GNU General Public License for more details. | |
14 ** | |
15 ** You should have received a copy of the GNU General Public License | |
16 ** along with this program; if not, write to the Free Software | |
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 ** | |
19 ** Any non-GPL usage of this software or parts of this software is strictly | |
20 ** forbidden. | |
21 ** | |
22 ** Commercial non-GPL licensing of this software is possible. | |
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
24 ** | |
12625
d81145997036
More information about modifications to comply more closely with GPL 2a.
diego
parents:
10725
diff
changeset
|
25 ** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 |
d81145997036
More information about modifications to comply more closely with GPL 2a.
diego
parents:
10725
diff
changeset
|
26 ** $Id: hcb.h,v 1.1 2003/08/30 22:30:28 arpi Exp $ |
d81145997036
More information about modifications to comply more closely with GPL 2a.
diego
parents:
10725
diff
changeset
|
27 ** detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/ |
10725 | 28 **/ |
29 | |
30 #ifndef __HCB_H__ | |
31 #define __HCB_H__ | |
32 | |
33 #ifdef __cplusplus | |
34 extern "C" { | |
35 #endif | |
36 | |
37 /* | |
38 * Optimal huffman decoding for AAC taken from: | |
39 * "SELECTING AN OPTIMAL HUFFMAN DECODER FOR AAC" by | |
40 * VLADIMIR Z. MESAROVIC , RAGHUNATH RAO, MIROSLAV V. DOKIC, and SACHIN DEO | |
41 * AES paper 5436 | |
42 * | |
43 * 2 methods are used for huffman decoding: | |
44 * - binary search | |
45 * - 2-step table lookup | |
46 * | |
47 * The choice of the "optimal" method is based on the fact that if the | |
48 * memory size for the Two-step is exorbitantly high then the decision | |
49 * is Binary search for that codebook. However, for marginally more memory | |
50 * size, if Twostep outperforms even the best case of Binary then the | |
51 * decision is Two-step for that codebook. | |
52 * | |
53 * The following methods are used for the different tables. | |
54 * codebook "optimal" method | |
55 * HCB_1 2-Step | |
56 * HCB_2 2-Step | |
57 * HCB_3 Binary | |
58 * HCB_4 2-Step | |
59 * HCB_5 Binary | |
60 * HCB_6 2-Step | |
61 * HCB_7 Binary | |
62 * HCB_8 2-Step | |
63 * HCB_9 Binary | |
64 * HCB_10 2-Step | |
65 * HCB_11 2-Step | |
66 * HCB_SF Binary | |
67 * | |
68 */ | |
69 | |
70 | |
71 #define ZERO_HCB 0 | |
72 #define FIRST_PAIR_HCB 5 | |
73 #define ESC_HCB 11 | |
74 #define QUAD_LEN 4 | |
75 #define PAIR_LEN 2 | |
76 #define NOISE_HCB 13 | |
77 #define INTENSITY_HCB2 14 | |
78 #define INTENSITY_HCB 15 | |
79 | |
80 /* 1st step table */ | |
81 typedef struct | |
82 { | |
83 uint8_t offset; | |
84 uint8_t extra_bits; | |
85 } hcb; | |
86 | |
87 /* 2nd step table with quadruple data */ | |
88 typedef struct | |
89 { | |
90 uint8_t bits; | |
91 int8_t x; | |
92 int8_t y; | |
93 } hcb_2_pair; | |
94 | |
95 typedef struct | |
96 { | |
97 uint8_t bits; | |
98 int8_t x; | |
99 int8_t y; | |
100 int8_t v; | |
101 int8_t w; | |
102 } hcb_2_quad; | |
103 | |
104 /* binary search table */ | |
105 typedef struct | |
106 { | |
107 uint8_t is_leaf; | |
108 int8_t data[4]; | |
109 } hcb_bin_quad; | |
110 | |
111 typedef struct | |
112 { | |
113 uint8_t is_leaf; | |
114 int8_t data[2]; | |
115 } hcb_bin_pair; | |
116 | |
117 hcb *hcb_table[]; | |
118 hcb_2_quad *hcb_2_quad_table[]; | |
119 hcb_2_pair *hcb_2_pair_table[]; | |
120 hcb_bin_pair *hcb_bin_table[]; | |
121 uint8_t hcbN[]; | |
122 uint8_t unsigned_cb[]; | |
123 int hcb_2_quad_table_size[]; | |
124 int hcb_2_pair_table_size[]; | |
125 int hcb_bin_table_size[]; | |
126 | |
127 #include "codebook/hcb_1.h" | |
128 #include "codebook/hcb_2.h" | |
129 #include "codebook/hcb_3.h" | |
130 #include "codebook/hcb_4.h" | |
131 #include "codebook/hcb_5.h" | |
132 #include "codebook/hcb_6.h" | |
133 #include "codebook/hcb_7.h" | |
134 #include "codebook/hcb_8.h" | |
135 #include "codebook/hcb_9.h" | |
136 #include "codebook/hcb_10.h" | |
137 #include "codebook/hcb_11.h" | |
138 #include "codebook/hcb_sf.h" | |
139 | |
140 | |
141 #ifdef __cplusplus | |
142 } | |
143 #endif | |
144 #endif |