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

libavcodec/rv34.h

Go to the documentation of this file.
00001 /*
00002  * RV30/40 decoder common data declarations
00003  * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
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 
00027 #ifndef AVCODEC_RV34_H
00028 #define AVCODEC_RV34_H
00029 
00030 #include "avcodec.h"
00031 #include "dsputil.h"
00032 #include "mpegvideo.h"
00033 
00034 #include "h264pred.h"
00035 #include "rv34dsp.h"
00036 
00037 #define MB_TYPE_SEPARATE_DC 0x01000000
00038 #define IS_SEPARATE_DC(a)   ((a) & MB_TYPE_SEPARATE_DC)
00039 
00043 enum RV40BlockTypes{
00044     RV34_MB_TYPE_INTRA,      
00045     RV34_MB_TYPE_INTRA16x16, 
00046     RV34_MB_P_16x16,         
00047     RV34_MB_P_8x8,           
00048     RV34_MB_B_FORWARD,       
00049     RV34_MB_B_BACKWARD,      
00050     RV34_MB_SKIP,            
00051     RV34_MB_B_DIRECT,        
00052     RV34_MB_P_16x8,          
00053     RV34_MB_P_8x16,          
00054     RV34_MB_B_BIDIR,         
00055     RV34_MB_P_MIX16x16,      
00056     RV34_MB_TYPES
00057 };
00058 
00064 typedef struct RV34VLC{
00065     VLC cbppattern[2];     
00066     VLC cbp[2][4];         
00067     VLC first_pattern[4];  
00068     VLC second_pattern[2]; 
00069     VLC third_pattern[2];  
00070     VLC coefficient;       
00071 }RV34VLC;
00072 
00074 typedef struct SliceInfo{
00075     int type;              
00076     int quant;             
00077     int vlc_set;           
00078     int start, end;        
00079     int width;             
00080     int height;            
00081     int pts;               
00082 }SliceInfo;
00083 
00085 typedef struct RV34DecContext{
00086     MpegEncContext s;
00087     RV34DSPContext rdsp;
00088     int8_t *intra_types_hist;
00089     int8_t *intra_types;     
00090     int    intra_types_stride;
00091     const uint8_t *luma_dc_quant_i;
00092     const uint8_t *luma_dc_quant_p;
00093 
00094     RV34VLC *cur_vlcs;       
00095     H264PredContext h;       
00096     SliceInfo si;            
00097 
00098     int *mb_type;            
00099     int block_type;          
00100     int luma_vlc;            
00101     int chroma_vlc;          
00102     int is16;                
00103     int dmv[4][2];           
00104 
00105     int rv30;                
00106     int rpr;                 
00107 
00108     int cur_pts, last_pts, next_pts;
00109     int weight1, weight2;    
00110 
00111     uint16_t *cbp_luma;      
00112     uint8_t  *cbp_chroma;    
00113     int      *deblock_coefs; 
00114 
00116     DECLARE_ALIGNED(8, uint32_t, avail_cache)[3*4];
00117 
00119     uint8_t *tmp_b_block_y[2];
00120     uint8_t *tmp_b_block_uv[4];
00121     uint8_t *tmp_b_block_base;
00122 
00123     int (*parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si);
00124     int (*decode_mb_info)(struct RV34DecContext *r);
00125     int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst);
00126     void (*loop_filter)(struct RV34DecContext *r, int row);
00127 }RV34DecContext;
00128 
00132 int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
00133 int ff_rv34_decode_init(AVCodecContext *avctx);
00134 int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt);
00135 int ff_rv34_decode_end(AVCodecContext *avctx);
00136 int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx);
00137 int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
00138 
00139 #endif /* AVCODEC_RV34_H */
Generated on Sun Apr 22 2012 21:54:04 for Libav by doxygen 1.7.1