FFmpeg
Loading...
Searching...
No Matches
vc1data.h
Go to the documentation of this file.
1/*
2 * VC-1 and WMV3 decoder
3 * copyright (c) 2006 Konstantin Shishkov
4 * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23/**
24 * @file
25 * VC-1 tables.
26 */
27
28#ifndef AVCODEC_VC1DATA_H
29#define AVCODEC_VC1DATA_H
30
31#include <stdint.h>
32
34#include "libavutil/rational.h"
35
36#include "vlc.h"
37
39/** Table for conversion between TTBLK and TTMB */
40extern const int ff_vc1_ttblk_to_tt[3][8];
41
42extern const int ff_vc1_ttfrm_to_tt[4];
43
44/** MV P mode - the 5th element is only used for mode 1 */
45extern const uint8_t ff_vc1_mv_pmode_table[2][5];
46extern const uint8_t ff_vc1_mv_pmode_table2[2][4];
47
48extern const int ff_vc1_fps_nr[7], ff_vc1_fps_dr[2];
49extern const uint8_t ff_vc1_pquant_table[3][32];
50
51/* MBMODE table for interlaced frame P-picture */
52extern const uint8_t ff_vc1_mbmode_intfrp[2][15][4];
53
54/** @name VC-1 VLC tables and defines
55 * @todo TODO move this into the context
56 */
57//@{
58#define VC1_IMODE_VLC_BITS 4
60#define VC1_NORM2_VLC_BITS 3
62#define VC1_NORM6_VLC_BITS 9
63extern VLCElem ff_vc1_norm6_vlc[556];
64/* Could be optimized, one table only needs 8 bits */
65#define VC1_TTMB_VLC_BITS 9 //12
66extern const VLCElem *ff_vc1_ttmb_vlc[3];
67#define VC1_MV_DIFF_VLC_BITS 9 //15
68extern const VLCElem *ff_vc1_mv_diff_vlc[4];
69#define VC1_CBPCY_P_VLC_BITS 9 //14
70extern const VLCElem *ff_vc1_cbpcy_p_vlc[4];
71#define VC1_ICBPCY_VLC_BITS 9
72extern const VLCElem *ff_vc1_icbpcy_vlc[8];
73#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6
75#define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3
77#define VC1_TTBLK_VLC_BITS 5
78extern const VLCElem *ff_vc1_ttblk_vlc[3];
79#define VC1_SUBBLKPAT_VLC_BITS 6
80extern const VLCElem *ff_vc1_subblkpat_vlc[3];
81#define VC1_INTFR_4MV_MBMODE_VLC_BITS 9
83#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6
85#define VC1_IF_MMV_MBMODE_VLC_BITS 5
86extern const VLCElem *ff_vc1_if_mmv_mbmode_vlc[8];
87#define VC1_IF_1MV_MBMODE_VLC_BITS 5
88extern const VLCElem *ff_vc1_if_1mv_mbmode_vlc[8];
89#define VC1_1REF_MVDATA_VLC_BITS 9
90extern const VLCElem *ff_vc1_1ref_mvdata_vlc[4];
91#define VC1_2REF_MVDATA_VLC_BITS 9
92extern const VLCElem *ff_vc1_2ref_mvdata_vlc[8];
93
94extern const VLCElem *ff_vc1_ac_coeff_table[8];
95
96#define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS
97 // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same
98//@}
99
100#define B_FRACTION_DEN 256
101
102/* pre-computed scales for all bfractions and base=256 */
103extern const int16_t ff_vc1_bfraction_lut[23];
104
105//Same as H.264
106extern const AVRational ff_vc1_pixel_aspect[16];
107
108extern const uint8_t ff_wmv3_dc_scale_table[32];
109
110/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
111
112/* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */
113extern const uint8_t ff_vc1_simple_progressive_4x4_zz [16];
114extern const uint8_t ff_vc1_adv_progressive_8x4_zz [32];
115extern const uint8_t ff_vc1_adv_progressive_4x8_zz [32];
116extern const uint8_t ff_vc1_adv_interlaced_8x8_zz [64];
117extern const uint8_t ff_vc1_adv_interlaced_8x4_zz [32];
118extern const uint8_t ff_vc1_adv_interlaced_4x8_zz [32];
119extern const uint8_t ff_vc1_adv_interlaced_4x4_zz [16];
120
121/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */
122extern const int32_t ff_vc1_dqscale[63];
123
124/* P Interlaced field picture MV predictor scaling values (Table 114) */
125extern const uint16_t ff_vc1_field_mvpred_scales[2][7][4];
126/* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */
127extern const uint16_t ff_vc1_b_field_mvpred_scales[7][4];
128
129#define AC_MODES 8
130
131extern const int ff_vc1_ac_sizes[AC_MODES];
133
134#endif /* AVCODEC_VC1DATA_H */
#define FF_VISIBILITY_PUSH_HIDDEN
#define FF_VISIBILITY_POP_HIDDEN
int32_t
Utilities for rational number calculation.
Rational number (pair of numerator and denominator).
Definition rational.h:58
Definition vlc.h:32
const int ff_vc1_ac_sizes[AC_MODES]
const VLCElem * ff_vc1_2ref_mvdata_vlc[8]
Definition vc1data.c:122
const uint8_t ff_vc1_adv_interlaced_4x4_zz[16]
Definition vc1data.c:236
const AVRational ff_vc1_pixel_aspect[16]
Definition vc1data.c:154
const VLCElem * ff_vc1_ttblk_vlc[3]
Definition vc1data.c:115
const VLCElem * ff_vc1_icbpcy_vlc[8]
Definition vc1data.c:112
const int ff_vc1_ttfrm_to_tt[4]
Definition vc1data.c:40
const VLCElem * ff_vc1_ac_coeff_table[8]
Definition vc1data.c:124
const int32_t ff_vc1_dqscale[63]
Definition vc1data.c:245
VLCElem ff_vc1_norm6_vlc[556]
Definition vc1data.c:107
const int ff_vc1_fps_dr[2]
Definition vc1data.c:88
const int16_t ff_vc1_bfraction_lut[23]
Definition vc1data.c:142
const uint8_t ff_vc1_mv_pmode_table[2][5]
MV P mode - the 5th element is only used for mode 1.
Definition vc1data.c:43
const uint8_t ff_vc1_mv_pmode_table2[2][4]
Definition vc1data.c:47
const uint8_t ff_vc1_mbmode_intfrp[2][15][4]
Definition vc1data.c:53
VLCElem ff_vc1_imode_vlc[1<< VC1_IMODE_VLC_BITS]
Definition vc1data.c:105
const VLCElem * ff_vc1_subblkpat_vlc[3]
Definition vc1data.c:116
VLCElem ff_vc1_norm2_vlc[1<< VC1_NORM2_VLC_BITS]
Definition vc1data.c:106
const VLCElem * ff_vc1_ttmb_vlc[3]
Definition vc1data.c:109
const VLCElem * ff_vc1_if_1mv_mbmode_vlc[8]
Definition vc1data.c:120
const uint8_t ff_vc1_adv_progressive_4x8_zz[32]
Definition vc1data.c:196
const uint8_t ff_vc1_pquant_table[3][32]
Definition vc1data.c:89
const VLCElem * ff_vc1_if_mmv_mbmode_vlc[8]
Definition vc1data.c:119
const uint8_t ff_vc1_adv_interlaced_8x4_zz[32]
Definition vc1data.c:218
const int ff_vc1_fps_nr[7]
Definition vc1data.c:87
const uint16_t ff_vc1_b_field_mvpred_scales[7][4]
Definition vc1data.c:281
const VLCElem * ff_vc1_intfr_4mv_mbmode_vlc[4]
Definition vc1data.c:117
const uint8_t ff_wmv3_dc_scale_table[32]
Definition vc1data.c:173
const uint8_t ff_vc1_adv_interlaced_8x8_zz[64]
Definition vc1data.c:207
const int ff_vc1_ttblk_to_tt[3][8]
Table for conversion between TTBLK and TTMB.
Definition vc1data.c:34
const uint8_t ff_vc1_simple_progressive_4x4_zz[16]
Definition vc1data.c:182
const VLCElem * ff_vc1_intfr_non4mv_mbmode_vlc[4]
Definition vc1data.c:118
const VLCElem * ff_vc1_2mv_block_pattern_vlc[4]
Definition vc1data.c:114
const VLCElem * ff_vc1_1ref_mvdata_vlc[4]
Definition vc1data.c:121
const VLCElem * ff_vc1_4mv_block_pattern_vlc[4]
Definition vc1data.c:113
const VLCElem * ff_vc1_cbpcy_p_vlc[4]
Definition vc1data.c:111
const VLCElem * ff_vc1_mv_diff_vlc[4]
Definition vc1data.c:110
const uint8_t ff_vc1_adv_progressive_8x4_zz[32]
Definition vc1data.c:189
const uint8_t ff_vc1_adv_interlaced_4x8_zz[32]
Definition vc1data.c:225
const uint16_t ff_vc1_field_mvpred_scales[2][7][4]
Definition vc1data.c:257
#define VC1_IMODE_VLC_BITS
Definition vc1data.h:58
#define AC_MODES
Definition vc1data.h:129
#define VC1_NORM2_VLC_BITS
Definition vc1data.h:60