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