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
This commit is contained in:
Diego Biurrun
2008-08-19 20:52:26 +00:00
parent 7942269b71
commit 0da49fca79
4 changed files with 33 additions and 34 deletions

View File

@@ -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 */