diff options
author | Diego Biurrun <diego@biurrun.de> | 2008-08-19 20:52:26 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2008-08-19 20:52:26 +0000 |
commit | 0da49fca79ce4bca32bbbca00e79a60f8be523a2 (patch) | |
tree | 2ebfd4a9d539def67ef21cd7aac1b13918234688 /libavcodec/mpeg12.h | |
parent | 7942269b710e138c89171635be1801fde3091c23 (diff) | |
download | ffmpeg-0da49fca79ce4bca32bbbca00e79a60f8be523a2.tar.gz |
Untangle mpeg12.c and mdec.c so that mdec.c can be compiled separately.
Originally committed as revision 14851 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.h')
-rw-r--r-- | libavcodec/mpeg12.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h index 662e3b38f8..d2ab6e774a 100644 --- a/libavcodec/mpeg12.h +++ b/libavcodec/mpeg12.h @@ -24,8 +24,36 @@ #include "mpegvideo.h" +#define DC_VLC_BITS 9 +#define TEX_VLC_BITS 9 + +static VLC dc_lum_vlc; +static VLC dc_chroma_vlc; + extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; void ff_mpeg12_common_init(MpegEncContext *s); +void ff_init_vlcs(void); + +static inline int decode_dc(GetBitContext *gb, int component) +{ + int code, diff; + + if (component == 0) { + code = get_vlc2(gb, dc_lum_vlc.table, DC_VLC_BITS, 2); + } else { + code = get_vlc2(gb, dc_chroma_vlc.table, DC_VLC_BITS, 2); + } + if (code < 0){ + av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n"); + return 0xffff; + } + if (code == 0) { + diff = 0; + } else { + diff = get_xbits(gb, code); + } + return diff; +} #endif /* FFMPEG_MPEG12_H */ |