00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00036 #define MB_TYPE_SEPARATE_DC 0x01000000
00037 #define IS_SEPARATE_DC(a) ((a) & MB_TYPE_SEPARATE_DC)
00038
00042 enum RV40BlockTypes{
00043 RV34_MB_TYPE_INTRA,
00044 RV34_MB_TYPE_INTRA16x16,
00045 RV34_MB_P_16x16,
00046 RV34_MB_P_8x8,
00047 RV34_MB_B_FORWARD,
00048 RV34_MB_B_BACKWARD,
00049 RV34_MB_SKIP,
00050 RV34_MB_B_DIRECT,
00051 RV34_MB_P_16x8,
00052 RV34_MB_P_8x16,
00053 RV34_MB_B_BIDIR,
00054 RV34_MB_P_MIX16x16,
00055 RV34_MB_TYPES
00056 };
00057
00063 typedef struct RV34VLC{
00064 VLC cbppattern[2];
00065 VLC cbp[2][4];
00066 VLC first_pattern[4];
00067 VLC second_pattern[2];
00068 VLC third_pattern[2];
00069 VLC coefficient;
00070 }RV34VLC;
00071
00073 typedef struct SliceInfo{
00074 int type;
00075 int quant;
00076 int vlc_set;
00077 int start, end;
00078 int width;
00079 int height;
00080 int pts;
00081 }SliceInfo;
00082
00084 typedef struct RV34DecContext{
00085 MpegEncContext s;
00086 int8_t *intra_types_hist;
00087 int8_t *intra_types;
00088 const uint8_t *luma_dc_quant_i;
00089 const uint8_t *luma_dc_quant_p;
00090
00091 RV34VLC *cur_vlcs;
00092 int bits;
00093 H264PredContext h;
00094 SliceInfo si;
00095
00096 int *mb_type;
00097 int block_type;
00098 int luma_vlc;
00099 int chroma_vlc;
00100 int is16;
00101 int dmv[4][2];
00102
00103 int rv30;
00104 int rpr;
00105
00106 int cur_pts, last_pts, next_pts;
00107
00108 uint16_t *cbp_luma;
00109 uint8_t *cbp_chroma;
00110 int *deblock_coefs;
00111
00113 DECLARE_ALIGNED_8(uint32_t, avail_cache[3*4]);
00114
00115 int (*parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si);
00116 int (*decode_mb_info)(struct RV34DecContext *r);
00117 int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst);
00118 void (*loop_filter)(struct RV34DecContext *r, int row);
00119 }RV34DecContext;
00120
00124 int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
00125 int ff_rv34_decode_init(AVCodecContext *avctx);
00126 int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size);
00127 int ff_rv34_decode_end(AVCodecContext *avctx);
00128
00129 #endif