h264: simplify calls to ff_er_add_slice().
[FFMpeg-mirror/mplayer-patches.git] / libavcodec / roqvideo.h
blob33d77edc8b118c463baa0849e604ce880376f04f
1 /*
2 * Copyright (C) 2003 Mike Melanson
3 * Copyright (C) 2003 Dr. Tim Ferguson
5 * This file is part of Libav.
7 * Libav is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * Libav is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with Libav; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef AVCODEC_ROQVIDEO_H
23 #define AVCODEC_ROQVIDEO_H
25 #include "libavutil/lfg.h"
26 #include "avcodec.h"
27 #include "bytestream.h"
28 #include "dsputil.h"
30 typedef struct roq_cell {
31 unsigned char y[4];
32 unsigned char u, v;
33 } roq_cell;
35 typedef struct roq_qcell {
36 int idx[4];
37 } roq_qcell;
39 typedef struct motion_vect {
40 int d[2];
41 } motion_vect;
43 struct RoqTempData;
45 typedef struct RoqContext {
47 AVCodecContext *avctx;
48 AVFrame frames[2];
49 AVFrame *last_frame;
50 AVFrame *current_frame;
51 int first_frame;
53 roq_cell cb2x2[256];
54 roq_qcell cb4x4[256];
56 GetByteContext gb;
57 int width, height;
59 /* Encoder only data */
60 AVLFG randctx;
61 uint64_t lambda;
63 motion_vect *this_motion4;
64 motion_vect *last_motion4;
66 motion_vect *this_motion8;
67 motion_vect *last_motion8;
69 unsigned int framesSinceKeyframe;
71 const AVFrame *frame_to_enc;
72 uint8_t *out_buf;
73 struct RoqTempData *tmpData;
74 } RoqContext;
76 #define RoQ_INFO 0x1001
77 #define RoQ_QUAD_CODEBOOK 0x1002
78 #define RoQ_QUAD_VQ 0x1011
79 #define RoQ_SOUND_MONO 0x1020
80 #define RoQ_SOUND_STEREO 0x1021
82 #define RoQ_ID_MOT 0x00
83 #define RoQ_ID_FCC 0x01
84 #define RoQ_ID_SLD 0x02
85 #define RoQ_ID_CCC 0x03
87 void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell);
88 void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell);
90 void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay);
92 void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay);
94 #endif /* AVCODEC_ROQVIDEO_H */