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 #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 scaled_weight;
00110 int weight1, weight2;
00111 int mv_weight1, mv_weight2;
00112
00113 uint16_t *cbp_luma;
00114 uint8_t *cbp_chroma;
00115 uint16_t *deblock_coefs;
00116
00118 DECLARE_ALIGNED(8, uint32_t, avail_cache)[3*4];
00119
00121 uint8_t *tmp_b_block_y[2];
00122 uint8_t *tmp_b_block_uv[4];
00123 uint8_t *tmp_b_block_base;
00124
00125 int (*parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si);
00126 int (*decode_mb_info)(struct RV34DecContext *r);
00127 int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst);
00128 void (*loop_filter)(struct RV34DecContext *r, int row);
00129 }RV34DecContext;
00130
00134 int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
00135 int ff_rv34_decode_init(AVCodecContext *avctx);
00136 int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt);
00137 int ff_rv34_decode_end(AVCodecContext *avctx);
00138 int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx);
00139 int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
00140
00141 #endif