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 "bytestream.h"
00028 #include "dsputil.h"
00029
00030 typedef struct {
00031 unsigned char y[4];
00032 unsigned char u, v;
00033 } roq_cell;
00034
00035 typedef struct {
00036 int idx[4];
00037 } roq_qcell;
00038
00039 typedef struct {
00040 int d[2];
00041 } motion_vect;
00042
00043 struct RoqTempData;
00044
00045 typedef struct RoqContext {
00046
00047 AVCodecContext *avctx;
00048 DSPContext dsp;
00049 AVFrame frames[2];
00050 AVFrame *last_frame;
00051 AVFrame *current_frame;
00052 int first_frame;
00053
00054 roq_cell cb2x2[256];
00055 roq_qcell cb4x4[256];
00056
00057 GetByteContext gb;
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