Libav
|
00001 /* 00002 * Copyright (C) 2003 Mike Melanson 00003 * Copyright (C) 2003 Dr. Tim Ferguson 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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 /* Encoder only data */ 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 /* AVCODEC_ROQVIDEO_H */