annotate roqvideo.h @ 8520:a0164882aa38 libavcodec

Generic metadata API. avi is updated as example. No version bump, the API still might change slightly ... No update to ffmpeg.c as requested by aurel.
author michael
date Sun, 04 Jan 2009 18:48:37 +0000
parents c4a4495715dd
children 1fa3e8a72ca5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
1 /*
5189
ab669ac706dc right copyrights
benoit
parents: 5184
diff changeset
2 * Copyright (C) 2003 Mike Melanson
ab669ac706dc right copyrights
benoit
parents: 5184
diff changeset
3 * Copyright (C) 2003 Dr. Tim Ferguson
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
4 *
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
5 * This file is part of FFmpeg.
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
6 *
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
11 *
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
15 * Lesser General Public License for more details.
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
16 *
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
20 */
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
21
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6763
diff changeset
22 #ifndef AVCODEC_ROQVIDEO_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6763
diff changeset
23 #define AVCODEC_ROQVIDEO_H
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 5104
diff changeset
24
6763
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6314
diff changeset
25 #include "libavutil/random.h"
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
26 #include "avcodec.h"
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
27 #include "dsputil.h"
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
28
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
29 typedef struct {
5190
c356e14774cb indentation
benoit
parents: 5189
diff changeset
30 unsigned char y[4];
c356e14774cb indentation
benoit
parents: 5189
diff changeset
31 unsigned char u, v;
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
32 } roq_cell;
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
33
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
34 typedef struct {
5190
c356e14774cb indentation
benoit
parents: 5189
diff changeset
35 int idx[4];
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
36 } roq_qcell;
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
37
5184
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
38 typedef struct {
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
39 int d[2];
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
40 } motion_vect;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
41
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
42 typedef struct RoqContext {
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
43
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
44 AVCodecContext *avctx;
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
45 DSPContext dsp;
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
46 AVFrame frames[2];
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
47 AVFrame *last_frame;
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
48 AVFrame *current_frame;
5184
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
49 int first_frame;
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
50
5104
b8e8aa53f613 Rename cb field
benoit
parents: 5088
diff changeset
51 roq_cell cb2x2[256];
b8e8aa53f613 Rename cb field
benoit
parents: 5088
diff changeset
52 roq_qcell cb4x4[256];
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
53
6314
de5d97b6c25b Add some const where appropriate
reimar
parents: 5830
diff changeset
54 const unsigned char *buf;
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
55 int size;
5184
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
56 int width, height;
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
57
5184
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
58 /* Encoder only data */
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
59 AVRandomState randctx;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
60 uint64_t lambda;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
61
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
62 motion_vect *this_motion4;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
63 motion_vect *last_motion4;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
64
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
65 motion_vect *this_motion8;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
66 motion_vect *last_motion8;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
67
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
68 unsigned int framesSinceKeyframe;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
69
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
70 AVFrame *frame_to_enc;
f3873cd7f473 RoQ video encoder
benoit
parents: 5169
diff changeset
71 uint8_t *out_buf;
5080
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
72 } RoqContext;
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
73
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
74 #define RoQ_INFO 0x1001
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
75 #define RoQ_QUAD_CODEBOOK 0x1002
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
76 #define RoQ_QUAD_VQ 0x1011
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
77 #define RoQ_SOUND_MONO 0x1020
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
78 #define RoQ_SOUND_STEREO 0x1021
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
79
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
80 #define RoQ_ID_MOT 0x00
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
81 #define RoQ_ID_FCC 0x01
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
82 #define RoQ_ID_SLD 0x02
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
83 #define RoQ_ID_CCC 0x03
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
84
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
85 void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell);
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
86 void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell);
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
87
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
88 void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay);
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
89
e72265f4e518 Split RoQ decoder to accommodate future encoder patch
benoit
parents:
diff changeset
90 void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay);
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 5104
diff changeset
91
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6763
diff changeset
92 #endif /* AVCODEC_ROQVIDEO_H */