Mercurial > libavcodec.hg
annotate vc1data.h @ 4933:ed67837533b0 libavcodec
generic S3TC DXT1 and DXT3 decoding functions
author | ivo |
---|---|
date | Mon, 07 May 2007 13:15:24 +0000 |
parents | 67975429cb40 |
children | 845386be542c |
rev | line source |
---|---|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
1 /* |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
2 * VC-1 and WMV3 decoder |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
3 * copyright (c) 2006 Konstantin Shishkov |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
4 * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
5 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
6 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
7 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
12 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
16 * Lesser General Public License for more details. |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
17 * |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
21 */ |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3689
diff
changeset
|
22 |
3359 | 23 /** |
24 * @file vc1data.h | |
3360
2c4ddf5b9217
VC-1 decoder with I-frames support and partial P-frames decoding
kostya
parents:
3359
diff
changeset
|
25 * VC-1 tables. |
3359 | 26 */ |
27 | |
28 #ifndef VC1DATA_H | |
29 #define VC1DATA_H | |
30 | |
4926 | 31 /** Table for conversion between TTBLK and TTMB */ |
4929 | 32 extern const int vc1_ttblk_to_tt[3][8]; |
4926 | 33 |
4929 | 34 extern const int vc1_ttfrm_to_tt[4]; |
4926 | 35 |
36 /** MV P mode - the 5th element is only used for mode 1 */ | |
4929 | 37 extern const uint8_t vc1_mv_pmode_table[2][5]; |
38 extern const uint8_t vc1_mv_pmode_table2[2][4]; | |
4926 | 39 |
4929 | 40 extern const int vc1_fps_nr[5], vc1_fps_dr[2]; |
41 extern const uint8_t vc1_pquant_table[3][32]; | |
4926 | 42 |
43 /** @name VC-1 VLC tables and defines | |
44 * @todo TODO move this into the context | |
45 */ | |
46 //@{ | |
47 #define VC1_BFRACTION_VLC_BITS 7 | |
4928 | 48 extern VLC vc1_bfraction_vlc; |
4926 | 49 #define VC1_IMODE_VLC_BITS 4 |
4928 | 50 extern VLC vc1_imode_vlc; |
4926 | 51 #define VC1_NORM2_VLC_BITS 3 |
4928 | 52 extern VLC vc1_norm2_vlc; |
4926 | 53 #define VC1_NORM6_VLC_BITS 9 |
4928 | 54 extern VLC vc1_norm6_vlc; |
4926 | 55 /* Could be optimized, one table only needs 8 bits */ |
56 #define VC1_TTMB_VLC_BITS 9 //12 | |
4928 | 57 extern VLC vc1_ttmb_vlc[3]; |
4926 | 58 #define VC1_MV_DIFF_VLC_BITS 9 //15 |
4928 | 59 extern VLC vc1_mv_diff_vlc[4]; |
4926 | 60 #define VC1_CBPCY_P_VLC_BITS 9 //14 |
4928 | 61 extern VLC vc1_cbpcy_p_vlc[4]; |
4926 | 62 #define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6 |
4928 | 63 extern VLC vc1_4mv_block_pattern_vlc[4]; |
4926 | 64 #define VC1_TTBLK_VLC_BITS 5 |
4928 | 65 extern VLC vc1_ttblk_vlc[3]; |
4926 | 66 #define VC1_SUBBLKPAT_VLC_BITS 6 |
4928 | 67 extern VLC vc1_subblkpat_vlc[3]; |
4926 | 68 |
4928 | 69 extern VLC vc1_ac_coeff_table[8]; |
4926 | 70 //@} |
71 | |
72 | |
3689 | 73 #if 0 //original bfraction from vc9data.h, not conforming to standard |
3515
20938be7b67b
Some B-frames support (parsing and decoding only, no motion compesation is done)
kostya
parents:
3360
diff
changeset
|
74 /* Denominator used for vc1_bfraction_lut */ |
20938be7b67b
Some B-frames support (parsing and decoding only, no motion compesation is done)
kostya
parents:
3360
diff
changeset
|
75 #define B_FRACTION_DEN 840 |
20938be7b67b
Some B-frames support (parsing and decoding only, no motion compesation is done)
kostya
parents:
3360
diff
changeset
|
76 |
3359 | 77 /* bfraction is fractional, we scale to the GCD 3*5*7*8 = 840 */ |
4928 | 78 extern const int16_t vc1_bfraction_lut[23]; |
3689 | 79 #else |
80 /* Denominator used for vc1_bfraction_lut */ | |
81 #define B_FRACTION_DEN 256 | |
82 | |
83 /* pre-computed scales for all bfractions and base=256 */ | |
4928 | 84 extern const int16_t vc1_bfraction_lut[23]; |
3689 | 85 #endif |
86 | |
4928 | 87 extern const uint8_t vc1_bfraction_bits[23]; |
88 extern const uint8_t vc1_bfraction_codes[23]; | |
3359 | 89 |
90 //Same as H.264 | |
4928 | 91 extern const AVRational vc1_pixel_aspect[16]; |
3359 | 92 |
93 /* BitPlane IMODE - such a small table... */ | |
4928 | 94 extern const uint8_t vc1_imode_codes[7]; |
95 extern const uint8_t vc1_imode_bits[7]; | |
3359 | 96 |
97 /* Normal-2 imode */ | |
4928 | 98 extern const uint8_t vc1_norm2_codes[4]; |
99 extern const uint8_t vc1_norm2_bits[4]; | |
100 extern const uint16_t vc1_norm6_codes[64]; | |
101 extern const uint8_t vc1_norm6_bits[64]; | |
3359 | 102 /* Normal-6 imode */ |
4928 | 103 extern const uint8_t vc1_norm6_spec[64][5]; |
3359 | 104 |
105 /* 4MV Block pattern VLC tables */ | |
4928 | 106 extern const uint8_t vc1_4mv_block_pattern_codes[4][16]; |
107 extern const uint8_t vc1_4mv_block_pattern_bits[4][16]; | |
3359 | 108 |
4928 | 109 extern const uint8_t wmv3_dc_scale_table[32]; |
3359 | 110 |
111 /* P-Picture CBPCY VLC tables */ | |
4928 | 112 extern const uint16_t vc1_cbpcy_p_codes[4][64]; |
113 extern const uint8_t vc1_cbpcy_p_bits[4][64]; | |
3359 | 114 |
115 /* MacroBlock Transform Type: 7.1.3.11, p89 | |
116 * 8x8:B | |
117 * 8x4:B:btm 8x4:B:top 8x4:B:both, | |
118 * 4x8:B:right 4x8:B:left 4x8:B:both | |
119 * 4x4:B 8x8:MB | |
120 * 8x4:MB:btm 8x4:MB:top 8x4,MB,both | |
121 * 4x8,MB,right 4x8,MB,left | |
122 * 4x4,MB */ | |
4928 | 123 extern const uint16_t vc1_ttmb_codes[3][16]; |
3359 | 124 |
4928 | 125 extern const uint8_t vc1_ttmb_bits[3][16]; |
3359 | 126 |
127 /* TTBLK (Transform Type per Block) tables */ | |
4928 | 128 extern const uint8_t vc1_ttblk_codes[3][8]; |
129 extern const uint8_t vc1_ttblk_bits[3][8]; | |
3359 | 130 |
131 /* SUBBLKPAT tables, p93-94, reordered */ | |
4928 | 132 extern const uint8_t vc1_subblkpat_codes[3][15]; |
133 extern const uint8_t vc1_subblkpat_bits[3][15]; | |
3359 | 134 |
135 /* MV differential tables, p265 */ | |
4928 | 136 extern const uint16_t vc1_mv_diff_codes[4][73]; |
137 extern const uint8_t vc1_mv_diff_bits[4][73]; | |
3359 | 138 |
139 /* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ | |
140 | |
141 /* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */ | |
4928 | 142 extern const int8_t vc1_normal_zz[64]; |
143 extern const int8_t vc1_horizontal_zz [64]; | |
144 extern const int8_t vc1_vertical_zz [64]; | |
145 extern const int8_t vc1_simple_progressive_8x8_zz [64]; | |
146 extern const int8_t vc1_simple_progressive_8x4_zz [32]; | |
147 extern const int8_t vc1_simple_progressive_4x8_zz [32]; | |
148 extern const int8_t vc1_simple_progressive_4x4_zz [16]; | |
149 extern const int8_t vc1_adv_progressive_8x4_zz [32]; | |
150 extern const int8_t vc1_adv_progressive_4x8_zz [32]; | |
151 extern const int8_t vc1_adv_interlaced_8x8_zz [64]; | |
152 extern const int8_t vc1_adv_interlaced_8x4_zz [32]; | |
153 extern const int8_t vc1_adv_interlaced_4x8_zz [32]; | |
154 extern const int8_t vc1_adv_interlaced_4x4_zz [16]; | |
3360
2c4ddf5b9217
VC-1 decoder with I-frames support and partial P-frames decoding
kostya
parents:
3359
diff
changeset
|
155 |
2c4ddf5b9217
VC-1 decoder with I-frames support and partial P-frames decoding
kostya
parents:
3359
diff
changeset
|
156 /* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */ |
4928 | 157 extern const int32_t vc1_dqscale[63]; |
158 | |
3359 | 159 #endif /* VC1DATA_H */ |