00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00027 #ifndef FFMPEG_RV34_H
00028 #define FFMPEG_RV34_H
00029
00030 #include "avcodec.h"
00031 #include "dsputil.h"
00032 #include "mpegvideo.h"
00033
00034 #include "h264pred.h"
00035
00039 enum RV40BlockTypes{
00040 RV34_MB_TYPE_INTRA,
00041 RV34_MB_TYPE_INTRA16x16,
00042 RV34_MB_P_16x16,
00043 RV34_MB_P_8x8,
00044 RV34_MB_B_FORWARD,
00045 RV34_MB_B_BACKWARD,
00046 RV34_MB_SKIP,
00047 RV34_MB_B_DIRECT,
00048 RV34_MB_P_16x8,
00049 RV34_MB_P_8x16,
00050 RV34_MB_B_BIDIR,
00051 RV34_MB_P_MIX16x16,
00052 RV34_MB_TYPES
00053 };
00054
00060 typedef struct RV34VLC{
00061 VLC cbppattern[2];
00062 VLC cbp[2][4];
00063 VLC first_pattern[4];
00064 VLC second_pattern[2];
00065 VLC third_pattern[2];
00066 VLC coefficient;
00067 }RV34VLC;
00068
00070 typedef struct SliceInfo{
00071 int type;
00072 int quant;
00073 int vlc_set;
00074 int start, end;
00075 int width;
00076 int height;
00077 }SliceInfo;
00078
00080 typedef struct RV34DecContext{
00081 MpegEncContext s;
00082 int8_t *intra_types_hist;
00083 int8_t *intra_types;
00084 const uint8_t *luma_dc_quant_i;
00085 const uint8_t *luma_dc_quant_p;
00086
00087 RV34VLC *cur_vlcs;
00088 int bits;
00089 H264PredContext h;
00090 SliceInfo si;
00091
00092 int *mb_type;
00093 int block_type;
00094 int luma_vlc;
00095 int chroma_vlc;
00096 int is16;
00097 int dmv[4][2];
00098
00099 int rv30;
00100 int rpr;
00101
00102 uint16_t *cbp_luma;
00103 uint8_t *cbp_chroma;
00104
00106 DECLARE_ALIGNED_8(uint32_t, avail_cache[3*4]);
00107
00108 int (*parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si);
00109 int (*decode_mb_info)(struct RV34DecContext *r);
00110 int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst);
00111 void (*loop_filter)(struct RV34DecContext *r);
00112 }RV34DecContext;
00113
00117 int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
00118 int ff_rv34_decode_init(AVCodecContext *avctx);
00119 int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size);
00120 int ff_rv34_decode_end(AVCodecContext *avctx);
00121
00122 #endif