00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef AVCODEC_ROQVIDEO_H
00023 #define AVCODEC_ROQVIDEO_H
00024 
00025 #include "libavutil/lfg.h"
00026 #include "avcodec.h"
00027 #include "dsputil.h"
00028 
00029 typedef struct {
00030     unsigned char y[4];
00031     unsigned char u, v;
00032 } roq_cell;
00033 
00034 typedef struct {
00035     int idx[4];
00036 } roq_qcell;
00037 
00038 typedef struct {
00039     int d[2];
00040 } motion_vect;
00041 
00042 struct RoqTempData;
00043 
00044 typedef struct RoqContext {
00045 
00046     AVCodecContext *avctx;
00047     DSPContext dsp;
00048     AVFrame frames[2];
00049     AVFrame *last_frame;
00050     AVFrame *current_frame;
00051     int first_frame;
00052 
00053     roq_cell cb2x2[256];
00054     roq_qcell cb4x4[256];
00055 
00056     const unsigned char *buf;
00057     int size;
00058     int width, height;
00059 
00060     
00061     AVLFG randctx;
00062     uint64_t lambda;
00063 
00064     motion_vect *this_motion4;
00065     motion_vect *last_motion4;
00066 
00067     motion_vect *this_motion8;
00068     motion_vect *last_motion8;
00069 
00070     unsigned int framesSinceKeyframe;
00071 
00072     AVFrame *frame_to_enc;
00073     uint8_t *out_buf;
00074     struct RoqTempData *tmpData;
00075 } RoqContext;
00076 
00077 #define RoQ_INFO              0x1001
00078 #define RoQ_QUAD_CODEBOOK     0x1002
00079 #define RoQ_QUAD_VQ           0x1011
00080 #define RoQ_SOUND_MONO        0x1020
00081 #define RoQ_SOUND_STEREO      0x1021
00082 
00083 #define RoQ_ID_MOT              0x00
00084 #define RoQ_ID_FCC              0x01
00085 #define RoQ_ID_SLD              0x02
00086 #define RoQ_ID_CCC              0x03
00087 
00088 void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell);
00089 void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell);
00090 
00091 void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay);
00092 
00093 void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay);
00094 
00095 #endif