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 int parsed_extra;
00046 } Mpeg1Context;
00047
00048 extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
00049
00050 void ff_mpeg12_common_init(MpegEncContext *s);
00051 void ff_mpeg12_init_vlcs(void);
00052
00053 static inline int decode_dc(GetBitContext *gb, int component)
00054 {
00055 int code, diff;
00056
00057 if (component == 0) {
00058 code = get_vlc2(gb, ff_dc_lum_vlc.table, DC_VLC_BITS, 2);
00059 } else {
00060 code = get_vlc2(gb, ff_dc_chroma_vlc.table, DC_VLC_BITS, 2);
00061 }
00062 if (code < 0){
00063 av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n");
00064 return 0xffff;
00065 }
00066 if (code == 0) {
00067 diff = 0;
00068 } else {
00069 diff = get_xbits(gb, code);
00070 }
00071 return diff;
00072 }
00073
00074 extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);
00075
00076 #endif