comparison roqvideo.h @ 5080:e72265f4e518 libavcodec

Split RoQ decoder to accommodate future encoder patch patch by Vitor vitor1001 gmail moc original thread: [FFmpeg-devel] [PATCH] RoQ video encoder, take 2 date: 05/27/2007 12:21 PM
author benoit
date Tue, 29 May 2007 15:01:33 +0000
parents
children 8e206208db1f
comparison
equal deleted inserted replaced
5079:4ff805f87391 5080:e72265f4e518
1 /*
2 * Copyright (C) 2003 the ffmpeg project
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22 #include "avcodec.h"
23 #include "dsputil.h"
24
25 typedef struct {
26 unsigned char y[4];
27 unsigned char u, v;
28 } roq_cell;
29
30 typedef struct {
31 int idx[4];
32 } roq_qcell;
33
34 typedef struct RoqContext {
35
36 AVCodecContext *avctx;
37 DSPContext dsp;
38 AVFrame frames[2];
39 AVFrame *last_frame;
40 AVFrame *current_frame;
41 int first_frame;
42 int y_stride;
43 int c_stride;
44
45 roq_cell cells[256];
46 roq_qcell qcells[256];
47
48 unsigned char *buf;
49 int size;
50
51 } RoqContext;
52
53 #define RoQ_INFO 0x1001
54 #define RoQ_QUAD_CODEBOOK 0x1002
55 #define RoQ_QUAD_VQ 0x1011
56 #define RoQ_SOUND_MONO 0x1020
57 #define RoQ_SOUND_STEREO 0x1021
58
59 #define RoQ_ID_MOT 0x00
60 #define RoQ_ID_FCC 0x01
61 #define RoQ_ID_SLD 0x02
62 #define RoQ_ID_CCC 0x03
63
64 void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell);
65 void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell);
66
67 void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay);
68
69 void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay);