Mercurial > libavcodec.hg
comparison mpeg12.h @ 7623:0bd920dcb7a5 libavcodec
Untangle mpeg12.c and mdec.c so that mdec.c can be compiled separately.
author | diego |
---|---|
date | Tue, 19 Aug 2008 20:52:26 +0000 |
parents | 1d83e9c34641 |
children | d6390123201d |
comparison
equal
deleted
inserted
replaced
7622:5a3907818652 | 7623:0bd920dcb7a5 |
---|---|
22 #ifndef FFMPEG_MPEG12_H | 22 #ifndef FFMPEG_MPEG12_H |
23 #define FFMPEG_MPEG12_H | 23 #define FFMPEG_MPEG12_H |
24 | 24 |
25 #include "mpegvideo.h" | 25 #include "mpegvideo.h" |
26 | 26 |
27 #define DC_VLC_BITS 9 | |
28 #define TEX_VLC_BITS 9 | |
29 | |
30 static VLC dc_lum_vlc; | |
31 static VLC dc_chroma_vlc; | |
32 | |
27 extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; | 33 extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; |
28 | 34 |
29 void ff_mpeg12_common_init(MpegEncContext *s); | 35 void ff_mpeg12_common_init(MpegEncContext *s); |
36 void ff_init_vlcs(void); | |
37 | |
38 static inline int decode_dc(GetBitContext *gb, int component) | |
39 { | |
40 int code, diff; | |
41 | |
42 if (component == 0) { | |
43 code = get_vlc2(gb, dc_lum_vlc.table, DC_VLC_BITS, 2); | |
44 } else { | |
45 code = get_vlc2(gb, dc_chroma_vlc.table, DC_VLC_BITS, 2); | |
46 } | |
47 if (code < 0){ | |
48 av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n"); | |
49 return 0xffff; | |
50 } | |
51 if (code == 0) { | |
52 diff = 0; | |
53 } else { | |
54 diff = get_xbits(gb, code); | |
55 } | |
56 return diff; | |
57 } | |
30 | 58 |
31 #endif /* FFMPEG_MPEG12_H */ | 59 #endif /* FFMPEG_MPEG12_H */ |