00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_MPEG12_H
00023 #define AVCODEC_MPEG12_H
00024
00025 #include "mpegvideo.h"
00026
00027 #define DC_VLC_BITS 9
00028 #define TEX_VLC_BITS 9
00029
00030 extern VLC ff_dc_lum_vlc;
00031 extern VLC ff_dc_chroma_vlc;
00032
00033 typedef struct Mpeg1Context {
00034 MpegEncContext mpeg_enc_ctx;
00035 int mpeg_enc_ctx_allocated;
00036 int repeat_field;
00037 AVPanScan pan_scan;
00038 int slice_count;
00039 int swap_uv;
00040 int save_aspect_info;
00041 int save_width, save_height, save_progressive_seq;
00042 AVRational frame_rate_ext;
00043 int sync;
00044 int tmpgexs;
00045 } Mpeg1Context;
00046
00047 extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
00048
00049 void ff_mpeg12_common_init(MpegEncContext *s);
00050 void ff_mpeg12_init_vlcs(void);
00051
00052 static inline int decode_dc(GetBitContext *gb, int component)
00053 {
00054 int code, diff;
00055
00056 if (component == 0) {
00057 code = get_vlc2(gb, ff_dc_lum_vlc.table, DC_VLC_BITS, 2);
00058 } else {
00059 code = get_vlc2(gb, ff_dc_chroma_vlc.table, DC_VLC_BITS, 2);
00060 }
00061 if (code < 0){
00062 av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n");
00063 return 0xffff;
00064 }
00065 if (code == 0) {
00066 diff = 0;
00067 } else {
00068 diff = get_xbits(gb, code);
00069 }
00070 return diff;
00071 }
00072
00073 extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);
00074
00075 #endif