• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/mpeg12.h

Go to the documentation of this file.
00001 /*
00002  * MPEG1/2 common code
00003  * Copyright (c) 2007 Aurelien Jacobs <aurel@gnuage.org>
00004  *
00005  * This file is part of Libav.
00006  *
00007  * Libav is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * Libav is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with Libav; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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; /* true if decoding context allocated */
00036     int repeat_field; /* true if we must repeat the field */
00037     AVPanScan pan_scan;              
00038     int slice_count;
00039     int swap_uv;//indicate VCR2
00040     int save_aspect_info;
00041     int save_width, save_height, save_progressive_seq;
00042     AVRational frame_rate_ext;       
00043     int sync;                        
00044     int closed_gop;                  
00045     int extradata_decoded;
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 /* AVCODEC_MPEG12_H */
Generated on Thu Jul 11 2013 15:38:20 for Libav by doxygen 1.7.1