annotate mpegvideo.h @ 294:944632089814 libavcodec

4MV motion estimation (not finished yet) SAD functions rewritten (8x8 support & MMX2 optimizations) HQ inter/intra decission msmpeg4 encoding bugfix (MV where too long)
author michaelni
date Wed, 27 Mar 2002 21:25:22 +0000
parents 2899263586cd
children a1234c032636
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
2 * Generic DCT based hybrid video encoder
986e461dc072 Initial revision
glantau
parents:
diff changeset
3 * Copyright (c) 2000,2001 Gerard Lantau.
986e461dc072 Initial revision
glantau
parents:
diff changeset
4 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
986e461dc072 Initial revision
glantau
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
986e461dc072 Initial revision
glantau
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
986e461dc072 Initial revision
glantau
parents:
diff changeset
8 * (at your option) any later version.
986e461dc072 Initial revision
glantau
parents:
diff changeset
9 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
986e461dc072 Initial revision
glantau
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
986e461dc072 Initial revision
glantau
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
986e461dc072 Initial revision
glantau
parents:
diff changeset
13 * GNU General Public License for more details.
986e461dc072 Initial revision
glantau
parents:
diff changeset
14 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
986e461dc072 Initial revision
glantau
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
986e461dc072 Initial revision
glantau
parents:
diff changeset
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
986e461dc072 Initial revision
glantau
parents:
diff changeset
18 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
19
986e461dc072 Initial revision
glantau
parents:
diff changeset
20 /* Macros for picture code type. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
21 #define I_TYPE 1
986e461dc072 Initial revision
glantau
parents:
diff changeset
22 #define P_TYPE 2
986e461dc072 Initial revision
glantau
parents:
diff changeset
23 #define B_TYPE 3
253
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
24 #define S_TYPE 4 //S(GMC)-VOP MPEG4
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
25
986e461dc072 Initial revision
glantau
parents:
diff changeset
26 enum OutputFormat {
986e461dc072 Initial revision
glantau
parents:
diff changeset
27 FMT_MPEG1,
986e461dc072 Initial revision
glantau
parents:
diff changeset
28 FMT_H263,
986e461dc072 Initial revision
glantau
parents:
diff changeset
29 FMT_MJPEG,
986e461dc072 Initial revision
glantau
parents:
diff changeset
30 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
31
986e461dc072 Initial revision
glantau
parents:
diff changeset
32 #define MPEG_BUF_SIZE (16 * 1024)
986e461dc072 Initial revision
glantau
parents:
diff changeset
33
220
0b234715e205 (commit by michael)
arpi_esp
parents: 208
diff changeset
34 #define QMAT_SHIFT_MMX 19
0b234715e205 (commit by michael)
arpi_esp
parents: 208
diff changeset
35 #define QMAT_SHIFT 25
0b234715e205 (commit by michael)
arpi_esp
parents: 208
diff changeset
36
277
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
37 #define MAX_FCODE 7
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
38 #define MAX_MV 2048
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
39
268
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
40 typedef struct Predictor{
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
41 double coeff;
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
42 double count;
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
43 double decay;
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
44 } Predictor;
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
45
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
46 typedef struct MpegEncContext {
71
79be2c581c01 changed opendivx to mpeg4
glantau
parents: 64
diff changeset
47 struct AVCodecContext *avctx;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
48 /* the following parameters must be initialized before encoding */
986e461dc072 Initial revision
glantau
parents:
diff changeset
49 int width, height; /* picture size. must be a multiple of 16 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
50 int gop_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
51 int frame_rate; /* number of frames per second */
986e461dc072 Initial revision
glantau
parents:
diff changeset
52 int intra_only; /* if true, only intra pictures are generated */
986e461dc072 Initial revision
glantau
parents:
diff changeset
53 int bit_rate; /* wanted bit rate */
268
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
54 int bit_rate_tolerance; /* amount of +- bits (>0)*/
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
55 enum OutputFormat out_format; /* output format */
986e461dc072 Initial revision
glantau
parents:
diff changeset
56 int h263_plus; /* h263 plus headers */
986e461dc072 Initial revision
glantau
parents:
diff changeset
57 int h263_rv10; /* use RV10 variation for H263 */
71
79be2c581c01 changed opendivx to mpeg4
glantau
parents: 64
diff changeset
58 int h263_pred; /* use mpeg4/h263 ac/dc predictions */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
59 int h263_msmpeg4; /* generate MSMPEG4 compatible stream */
986e461dc072 Initial revision
glantau
parents:
diff changeset
60 int h263_intel; /* use I263 intel h263 header */
986e461dc072 Initial revision
glantau
parents:
diff changeset
61 int fixed_qscale; /* fixed qscale if non zero */
268
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
62 float qcompress; /* amount of qscale change between easy & hard scenes (0.0-1.0) */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
63 float qblur; /* amount of qscale smoothing over time (0.0-1.0) */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
64 int qmin; /* min qscale */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
65 int qmax; /* max qscale */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
66 int max_qdiff; /* max qscale difference between frames */
7
1d3ac9654178 added skip macroblock optimization (big perf win on black regions for example)
glantau
parents: 0
diff changeset
67 int encoding; /* true if we are encoding (vs decoding) */
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
68 int flags; /* AVCodecContext.flags (HQ, MV4, ...) */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
69 /* the following fields are managed internally by the encoder */
986e461dc072 Initial revision
glantau
parents:
diff changeset
70
986e461dc072 Initial revision
glantau
parents:
diff changeset
71 /* bit output */
986e461dc072 Initial revision
glantau
parents:
diff changeset
72 PutBitContext pb;
986e461dc072 Initial revision
glantau
parents:
diff changeset
73
986e461dc072 Initial revision
glantau
parents:
diff changeset
74 /* sequence parameters */
986e461dc072 Initial revision
glantau
parents:
diff changeset
75 int context_initialized;
986e461dc072 Initial revision
glantau
parents:
diff changeset
76 int picture_number;
986e461dc072 Initial revision
glantau
parents:
diff changeset
77 int fake_picture_number; /* picture number at the bitstream frame rate */
277
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
78 int gop_picture_number; /* index of the first picture of a GOP based on fake_pic_num & mpeg1 specific */
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
79 int picture_in_gop_number; /* 0-> first pic in gop, ... */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
80 int mb_width, mb_height;
233
3f5b72726118 - More work on preliminary bit rate control, just to be able to get an
pulento
parents: 232
diff changeset
81 int mb_num; /* number of MBs of a picture */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
82 int linesize; /* line size, in bytes, may be different from width */
986e461dc072 Initial revision
glantau
parents:
diff changeset
83 UINT8 *new_picture[3]; /* picture to be compressed */
986e461dc072 Initial revision
glantau
parents:
diff changeset
84 UINT8 *last_picture[3]; /* previous picture */
986e461dc072 Initial revision
glantau
parents:
diff changeset
85 UINT8 *last_picture_base[3]; /* real start of the picture */
986e461dc072 Initial revision
glantau
parents:
diff changeset
86 UINT8 *next_picture[3]; /* previous picture (for bidir pred) */
986e461dc072 Initial revision
glantau
parents:
diff changeset
87 UINT8 *next_picture_base[3]; /* real start of the picture */
986e461dc072 Initial revision
glantau
parents:
diff changeset
88 UINT8 *aux_picture[3]; /* aux picture (for B frames only) */
986e461dc072 Initial revision
glantau
parents:
diff changeset
89 UINT8 *aux_picture_base[3]; /* real start of the picture */
986e461dc072 Initial revision
glantau
parents:
diff changeset
90 UINT8 *current_picture[3]; /* buffer to store the decompressed current picture */
986e461dc072 Initial revision
glantau
parents:
diff changeset
91 int last_dc[3]; /* last DC values for MPEG1 */
266
252444e5259b optimization
michaelni
parents: 265
diff changeset
92 INT16 *dc_val[3]; /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
93 int y_dc_scale, c_dc_scale;
986e461dc072 Initial revision
glantau
parents:
diff changeset
94 UINT8 *coded_block; /* used for coded block pattern prediction */
266
252444e5259b optimization
michaelni
parents: 265
diff changeset
95 INT16 (*ac_val[3])[16]; /* used for for mpeg4 AC prediction, all 3 arrays must be continuous */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
96 int ac_pred;
7
1d3ac9654178 added skip macroblock optimization (big perf win on black regions for example)
glantau
parents: 0
diff changeset
97 int mb_skiped; /* MUST BE SET only during DECODING */
1d3ac9654178 added skip macroblock optimization (big perf win on black regions for example)
glantau
parents: 0
diff changeset
98 UINT8 *mbskip_table; /* used to avoid copy if macroblock
1d3ac9654178 added skip macroblock optimization (big perf win on black regions for example)
glantau
parents: 0
diff changeset
99 skipped (for black regions for example) */
191
883f184537e6 AC table reset (memset) optimization - patch by Michael Niedermayer <michaelni@gmx.at>
uid46427
parents: 162
diff changeset
100 UINT8 *mbintra_table; /* used to kill a few memsets */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
101
986e461dc072 Initial revision
glantau
parents:
diff changeset
102 int qscale;
986e461dc072 Initial revision
glantau
parents:
diff changeset
103 int pict_type;
262
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
104 int last_non_b_pict_type; /* used for mpeg4 gmc b-frames */
268
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
105 int last_pict_type; /* used for bit rate stuff (needs that to update the right predictor) */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
106 int frame_rate_index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
107 /* motion compensation */
986e461dc072 Initial revision
glantau
parents:
diff changeset
108 int unrestricted_mv;
986e461dc072 Initial revision
glantau
parents:
diff changeset
109 int h263_long_vectors; /* use horrible h263v1 long vector mode */
986e461dc072 Initial revision
glantau
parents:
diff changeset
110
986e461dc072 Initial revision
glantau
parents:
diff changeset
111 int f_code; /* resolution */
262
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
112 int b_code; /* backward resolution for B Frames (mpeg4) */
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
113 INT16 *mv_table[2]; /* MV table (1MV per MB)*/
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
114 INT16 (*motion_val)[2]; /* used for MV prediction (4MV per MB)*/
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
115 int full_search;
986e461dc072 Initial revision
glantau
parents:
diff changeset
116 int mv_dir;
986e461dc072 Initial revision
glantau
parents:
diff changeset
117 #define MV_DIR_BACKWARD 1
986e461dc072 Initial revision
glantau
parents:
diff changeset
118 #define MV_DIR_FORWARD 2
262
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
119 #define MV_DIRECT 4 // bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
120 int mv_type;
986e461dc072 Initial revision
glantau
parents:
diff changeset
121 #define MV_TYPE_16X16 0 /* 1 vector for the whole mb */
277
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
122 #define MV_TYPE_8X8 1 /* 4 vectors (h263, mpeg4 4MV) */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
123 #define MV_TYPE_16X8 2 /* 2 vectors, one per 16x8 block */
986e461dc072 Initial revision
glantau
parents:
diff changeset
124 #define MV_TYPE_FIELD 3 /* 2 vectors, one per field */
986e461dc072 Initial revision
glantau
parents:
diff changeset
125 #define MV_TYPE_DMV 4 /* 2 vectors, special mpeg2 Dual Prime Vectors */
986e461dc072 Initial revision
glantau
parents:
diff changeset
126 /* motion vectors for a macroblock
986e461dc072 Initial revision
glantau
parents:
diff changeset
127 first coordinate : 0 = forward 1 = backward
986e461dc072 Initial revision
glantau
parents:
diff changeset
128 second " : depend on type
986e461dc072 Initial revision
glantau
parents:
diff changeset
129 third " : 0 = x, 1 = y
986e461dc072 Initial revision
glantau
parents:
diff changeset
130 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
131 int mv[2][4][2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
132 int field_select[2][2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
133 int last_mv[2][2][2];
277
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
134 UINT16 (*mv_penalty)[MAX_MV*2+1]; /* amount of bits needed to encode a MV, used for ME */
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
135 UINT8 *fcode_tab; /* smallest fcode needed for each MV */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
136
986e461dc072 Initial revision
glantau
parents:
diff changeset
137 int has_b_frames;
986e461dc072 Initial revision
glantau
parents:
diff changeset
138 int no_rounding; /* apply no rounding to motion estimation (MPEG4) */
986e461dc072 Initial revision
glantau
parents:
diff changeset
139
986e461dc072 Initial revision
glantau
parents:
diff changeset
140 /* macroblock layer */
986e461dc072 Initial revision
glantau
parents:
diff changeset
141 int mb_x, mb_y;
986e461dc072 Initial revision
glantau
parents:
diff changeset
142 int mb_incr;
986e461dc072 Initial revision
glantau
parents:
diff changeset
143 int mb_intra;
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
144 UINT16 *mb_var; /* Table for MB variances */
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
145 UINT8 *mb_type; /* Table for MB type */
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
146 #define MB_TYPE_INTRA 0x01
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
147 #define MB_TYPE_INTER 0x02
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
148 #define MB_TYPE_INTER4V 0x04
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
149 #define MB_TYPE_SKIPED 0x08
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
150 #define MB_TYPE_DIRECT 0x10
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
151 #define MB_TYPE_FORWARD 0x20
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
152 #define MB_TYPE_BACKWAD 0x40
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
153 #define MB_TYPE_BIDIR 0x80
266
252444e5259b optimization
michaelni
parents: 265
diff changeset
154
252444e5259b optimization
michaelni
parents: 265
diff changeset
155 int block_index[6];
252444e5259b optimization
michaelni
parents: 265
diff changeset
156 int block_wrap[6];
252444e5259b optimization
michaelni
parents: 265
diff changeset
157
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
158 /* matrix transmitted in the bitstream */
986e461dc072 Initial revision
glantau
parents:
diff changeset
159 UINT16 intra_matrix[64];
986e461dc072 Initial revision
glantau
parents:
diff changeset
160 UINT16 chroma_intra_matrix[64];
986e461dc072 Initial revision
glantau
parents:
diff changeset
161 UINT16 non_intra_matrix[64];
986e461dc072 Initial revision
glantau
parents:
diff changeset
162 UINT16 chroma_non_intra_matrix[64];
986e461dc072 Initial revision
glantau
parents:
diff changeset
163 /* precomputed matrix (combine qscale and DCT renorm) */
986e461dc072 Initial revision
glantau
parents:
diff changeset
164 int q_intra_matrix[64];
986e461dc072 Initial revision
glantau
parents:
diff changeset
165 int q_non_intra_matrix[64];
220
0b234715e205 (commit by michael)
arpi_esp
parents: 208
diff changeset
166 /* identical to the above but for MMX & these are not permutated */
0b234715e205 (commit by michael)
arpi_esp
parents: 208
diff changeset
167 UINT16 __align8 q_intra_matrix16[64] ;
0b234715e205 (commit by michael)
arpi_esp
parents: 208
diff changeset
168 UINT16 __align8 q_non_intra_matrix16[64];
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
169 int block_last_index[6]; /* last non zero coefficient in block */
986e461dc072 Initial revision
glantau
parents:
diff changeset
170
986e461dc072 Initial revision
glantau
parents:
diff changeset
171 void *opaque; /* private data for the user */
986e461dc072 Initial revision
glantau
parents:
diff changeset
172
986e461dc072 Initial revision
glantau
parents:
diff changeset
173 /* bit rate control */
986e461dc072 Initial revision
glantau
parents:
diff changeset
174 int I_frame_bits; /* wanted number of bits per I frame */
986e461dc072 Initial revision
glantau
parents:
diff changeset
175 int P_frame_bits; /* same for P frame */
233
3f5b72726118 - More work on preliminary bit rate control, just to be able to get an
pulento
parents: 232
diff changeset
176 int avg_mb_var; /* average MB variance for current frame */
268
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
177 int mc_mb_var; /* motion compensated MB variance for current frame */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
178 int last_mc_mb_var; /* motion compensated MB variance for last frame */
64
5aa6292a1660 win32 fixes
glantau
parents: 41
diff changeset
179 INT64 wanted_bits;
5aa6292a1660 win32 fixes
glantau
parents: 41
diff changeset
180 INT64 total_bits;
268
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
181 int frame_bits; /* bits used for the current frame */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
182 int last_frame_bits; /* bits used for the last frame */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
183 Predictor i_pred;
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
184 Predictor p_pred;
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
185 double qsum; /* sum of qscales */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
186 double qcount; /* count of qscales */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
187 double short_term_qsum; /* sum of recent qscales */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
188 double short_term_qcount; /* count of recent qscales */
09ae29b27ed9 hopefully better bitrate controll
michaelni
parents: 266
diff changeset
189
286
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
190 /* statistics, used for 2-pass encoding */
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
191 int mv_bits;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
192 int header_bits;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
193 int i_tex_bits;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
194 int p_tex_bits;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
195 int i_count;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
196 int p_count;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
197 int skip_count;
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
198 int misc_bits; // cbp, mb_type
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
199 int last_bits; //temp var used for calculating the above vars
91f7c38f5f37 statistics for 2-pass encoding
michaelni
parents: 281
diff changeset
200
154
f914f710b8d0 - Fixed a bug on H.263 MV prediction for MB on GOBs limits.
pulento
parents: 151
diff changeset
201 /* H.263 specific */
f914f710b8d0 - Fixed a bug on H.263 MV prediction for MB on GOBs limits.
pulento
parents: 151
diff changeset
202 int gob_number;
162
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
203 int gob_index;
154
f914f710b8d0 - Fixed a bug on H.263 MV prediction for MB on GOBs limits.
pulento
parents: 151
diff changeset
204 int first_gob_line;
248
56ee684c48bb - H.263+ decoder support for Advanded INTRA Coding (buggy)
pulento
parents: 243
diff changeset
205
79
82e579c37bc3 Moved some H.263+ variables to MpegEncContext to be thread-safe.
pulento
parents: 71
diff changeset
206 /* H.263+ specific */
82e579c37bc3 Moved some H.263+ variables to MpegEncContext to be thread-safe.
pulento
parents: 71
diff changeset
207 int umvplus;
82e579c37bc3 Moved some H.263+ variables to MpegEncContext to be thread-safe.
pulento
parents: 71
diff changeset
208 int umvplus_dec;
248
56ee684c48bb - H.263+ decoder support for Advanded INTRA Coding (buggy)
pulento
parents: 243
diff changeset
209 int h263_aic; /* Advanded INTRA Coding (AIC) */
56ee684c48bb - H.263+ decoder support for Advanded INTRA Coding (buggy)
pulento
parents: 243
diff changeset
210 int h263_aic_dir; /* AIC direction: 0 = left, 1 = top */
79
82e579c37bc3 Moved some H.263+ variables to MpegEncContext to be thread-safe.
pulento
parents: 71
diff changeset
211
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
212 /* mpeg4 specific */
262
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
213 int time_increment_resolution;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
214 int time_increment_bits;
262
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
215 int time_increment;
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
216 int time_base;
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
217 int time;
7d941b8c4e84 mpeg4 b-frames :)
michaelni
parents: 255
diff changeset
218 int last_non_b_time[2];
64
5aa6292a1660 win32 fixes
glantau
parents: 41
diff changeset
219 int shape;
5aa6292a1660 win32 fixes
glantau
parents: 41
diff changeset
220 int vol_sprite_usage;
253
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
221 int sprite_width;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
222 int sprite_height;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
223 int sprite_left;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
224 int sprite_top;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
225 int sprite_brightness_change;
254
b4fed8b24e3a gmc bitstream decoding support (the real motion compensation isnt implemnted yet)
michaelni
parents: 253
diff changeset
226 int num_sprite_warping_points;
255
db20b987c32d divx5-gmc support
michaelni
parents: 254
diff changeset
227 int real_sprite_warping_points;
254
b4fed8b24e3a gmc bitstream decoding support (the real motion compensation isnt implemnted yet)
michaelni
parents: 253
diff changeset
228 int sprite_offset[2][2];
b4fed8b24e3a gmc bitstream decoding support (the real motion compensation isnt implemnted yet)
michaelni
parents: 253
diff changeset
229 int sprite_delta[2][2][2];
b4fed8b24e3a gmc bitstream decoding support (the real motion compensation isnt implemnted yet)
michaelni
parents: 253
diff changeset
230 int sprite_shift[2][2];
b4fed8b24e3a gmc bitstream decoding support (the real motion compensation isnt implemnted yet)
michaelni
parents: 253
diff changeset
231 int mcsel;
64
5aa6292a1660 win32 fixes
glantau
parents: 41
diff changeset
232 int quant_precision;
253
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
233 int quarter_sample;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
234 int scalability;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
235 int new_pred;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
236 int reduced_res_vop;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
237 int aspect_ratio_info;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
238 int sprite_warping_accuracy;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
239 int low_latency_sprite;
4448dd55d415 parsing more of the mpeg4 header & print some "not supported" stuff
michaelni
parents: 248
diff changeset
240 int data_partioning;
290
2899263586cd resync marker support, needed for some mp4 files
michaelni
parents: 288
diff changeset
241 int resync_marker;
2899263586cd resync marker support, needed for some mp4 files
michaelni
parents: 288
diff changeset
242 int resync_x_pos;
255
db20b987c32d divx5-gmc support
michaelni
parents: 254
diff changeset
243
db20b987c32d divx5-gmc support
michaelni
parents: 254
diff changeset
244 /* divx specific, used to workaround (many) bugs in divx5 */
db20b987c32d divx5-gmc support
michaelni
parents: 254
diff changeset
245 int divx_version;
db20b987c32d divx5-gmc support
michaelni
parents: 254
diff changeset
246 int divx_build;
db20b987c32d divx5-gmc support
michaelni
parents: 254
diff changeset
247
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
248 /* RV10 specific */
986e461dc072 Initial revision
glantau
parents:
diff changeset
249 int rv10_version; /* RV10 version: 0 or 3 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
250 int rv10_first_dc_coded[3];
986e461dc072 Initial revision
glantau
parents:
diff changeset
251
986e461dc072 Initial revision
glantau
parents:
diff changeset
252 /* MJPEG specific */
986e461dc072 Initial revision
glantau
parents:
diff changeset
253 struct MJpegContext *mjpeg_ctx;
229
f418b5c5ff67 PATCH by Rik Snel <rsnel@cube.dyndns.org>
arpi_esp
parents: 220
diff changeset
254 int mjpeg_vsample[3]; /* vertical sampling factors, default = {2, 1, 1} */
f418b5c5ff67 PATCH by Rik Snel <rsnel@cube.dyndns.org>
arpi_esp
parents: 220
diff changeset
255 int mjpeg_hsample[3]; /* horizontal sampling factors, default = {2, 1, 1} */
f418b5c5ff67 PATCH by Rik Snel <rsnel@cube.dyndns.org>
arpi_esp
parents: 220
diff changeset
256 int mjpeg_write_tables; /* do we want to have quantisation- and
f418b5c5ff67 PATCH by Rik Snel <rsnel@cube.dyndns.org>
arpi_esp
parents: 220
diff changeset
257 huffmantables in the jpeg file ? */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
258
986e461dc072 Initial revision
glantau
parents:
diff changeset
259 /* MSMPEG4 specific */
986e461dc072 Initial revision
glantau
parents:
diff changeset
260 int mv_table_index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
261 int rl_table_index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
262 int rl_chroma_table_index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
263 int dc_table_index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
264 int use_skip_mb_code;
986e461dc072 Initial revision
glantau
parents:
diff changeset
265 int slice_height; /* in macroblocks */
290
2899263586cd resync marker support, needed for some mp4 files
michaelni
parents: 288
diff changeset
266 int first_slice_line; /* used in mpeg4 too to handle resync markers */
208
2eb04d6be309 (commit by michael)
arpi_esp
parents: 191
diff changeset
267 int flipflop_rounding;
2eb04d6be309 (commit by michael)
arpi_esp
parents: 191
diff changeset
268 int bitrate;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
269 /* decompression specific */
986e461dc072 Initial revision
glantau
parents:
diff changeset
270 GetBitContext gb;
986e461dc072 Initial revision
glantau
parents:
diff changeset
271
986e461dc072 Initial revision
glantau
parents:
diff changeset
272 /* MPEG2 specific - I wish I had not to support this mess. */
986e461dc072 Initial revision
glantau
parents:
diff changeset
273 int progressive_sequence;
986e461dc072 Initial revision
glantau
parents:
diff changeset
274 int mpeg_f_code[2][2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
275 int picture_structure;
986e461dc072 Initial revision
glantau
parents:
diff changeset
276 /* picture type */
986e461dc072 Initial revision
glantau
parents:
diff changeset
277 #define PICT_TOP_FIELD 1
986e461dc072 Initial revision
glantau
parents:
diff changeset
278 #define PICT_BOTTOM_FIELD 2
986e461dc072 Initial revision
glantau
parents:
diff changeset
279 #define PICT_FRAME 3
986e461dc072 Initial revision
glantau
parents:
diff changeset
280
986e461dc072 Initial revision
glantau
parents:
diff changeset
281 int intra_dc_precision;
986e461dc072 Initial revision
glantau
parents:
diff changeset
282 int frame_pred_frame_dct;
986e461dc072 Initial revision
glantau
parents:
diff changeset
283 int top_field_first;
986e461dc072 Initial revision
glantau
parents:
diff changeset
284 int concealment_motion_vectors;
986e461dc072 Initial revision
glantau
parents:
diff changeset
285 int q_scale_type;
986e461dc072 Initial revision
glantau
parents:
diff changeset
286 int intra_vlc_format;
986e461dc072 Initial revision
glantau
parents:
diff changeset
287 int alternate_scan;
986e461dc072 Initial revision
glantau
parents:
diff changeset
288 int repeat_first_field;
986e461dc072 Initial revision
glantau
parents:
diff changeset
289 int chroma_420_type;
986e461dc072 Initial revision
glantau
parents:
diff changeset
290 int progressive_frame;
986e461dc072 Initial revision
glantau
parents:
diff changeset
291 int mpeg2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
292 int full_pel[2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
293 int interlaced_dct;
986e461dc072 Initial revision
glantau
parents:
diff changeset
294 int last_qscale;
986e461dc072 Initial revision
glantau
parents:
diff changeset
295 int first_slice;
162
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
296
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
297 /* RTP specific */
231
840cd25bf259 - Fixes on RTP and GOB headers for H.263.
pulento
parents: 229
diff changeset
298 /* These are explained on avcodec.h */
162
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
299 int rtp_mode;
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
300 int rtp_payload_size;
231
840cd25bf259 - Fixes on RTP and GOB headers for H.263.
pulento
parents: 229
diff changeset
301 void (*rtp_callback)(void *data, int size, int packet_number);
162
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
302 UINT8 *ptr_lastgob;
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
303 UINT8 *ptr_last_mb_line;
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
304 UINT32 mb_line_avgsize;
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
305
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
306 DCTELEM (*block)[64]; /* points to one of the following blocks */
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
307 DCTELEM intra_block[6][64] __align8;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
308 DCTELEM inter_block[6][64] __align8;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
309 DCTELEM inter4v_block[6][64] __align8;
13
174ef88f619a use block[] in structure to have it aligned on 8 bytes for mmx optimizations - dct_unquantize is always a function pointer - added specialized dct_unquantize_h263
glantau
parents: 7
diff changeset
310 void (*dct_unquantize)(struct MpegEncContext *s,
174ef88f619a use block[] in structure to have it aligned on 8 bytes for mmx optimizations - dct_unquantize is always a function pointer - added specialized dct_unquantize_h263
glantau
parents: 7
diff changeset
311 DCTELEM *block, int n, int qscale);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
312 } MpegEncContext;
986e461dc072 Initial revision
glantau
parents:
diff changeset
313
986e461dc072 Initial revision
glantau
parents:
diff changeset
314 int MPV_common_init(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
315 void MPV_common_end(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
316 void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
986e461dc072 Initial revision
glantau
parents:
diff changeset
317 void MPV_frame_start(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
318 void MPV_frame_end(MpegEncContext *s);
13
174ef88f619a use block[] in structure to have it aligned on 8 bytes for mmx optimizations - dct_unquantize is always a function pointer - added specialized dct_unquantize_h263
glantau
parents: 7
diff changeset
319 #ifdef HAVE_MMX
174ef88f619a use block[] in structure to have it aligned on 8 bytes for mmx optimizations - dct_unquantize is always a function pointer - added specialized dct_unquantize_h263
glantau
parents: 7
diff changeset
320 void MPV_common_init_mmx(MpegEncContext *s);
174ef88f619a use block[] in structure to have it aligned on 8 bytes for mmx optimizations - dct_unquantize is always a function pointer - added specialized dct_unquantize_h263
glantau
parents: 7
diff changeset
321 #endif
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
322
986e461dc072 Initial revision
glantau
parents:
diff changeset
323 /* motion_est.c */
986e461dc072 Initial revision
glantau
parents:
diff changeset
324
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
325 void estimate_motion(MpegEncContext *s,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 290
diff changeset
326 int mb_x, int mb_y);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
327
986e461dc072 Initial revision
glantau
parents:
diff changeset
328 /* mpeg12.c */
41
d99e8a2351f4 fixed scan protos
glantau
parents: 19
diff changeset
329 extern INT16 default_intra_matrix[64];
d99e8a2351f4 fixed scan protos
glantau
parents: 19
diff changeset
330 extern INT16 default_non_intra_matrix[64];
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
331
986e461dc072 Initial revision
glantau
parents:
diff changeset
332 void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
986e461dc072 Initial revision
glantau
parents:
diff changeset
333 void mpeg1_encode_mb(MpegEncContext *s,
986e461dc072 Initial revision
glantau
parents:
diff changeset
334 DCTELEM block[6][64],
986e461dc072 Initial revision
glantau
parents:
diff changeset
335 int motion_x, int motion_y);
281
1fc96b02142e mpeg4 aspect_ratio_info in AVCodecContext (requested by alex)
michaelni
parents: 277
diff changeset
336 void mpeg1_encode_init(MpegEncContext *s);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
337
986e461dc072 Initial revision
glantau
parents:
diff changeset
338 /* h263enc.c */
986e461dc072 Initial revision
glantau
parents:
diff changeset
339
986e461dc072 Initial revision
glantau
parents:
diff changeset
340 /* run length table */
986e461dc072 Initial revision
glantau
parents:
diff changeset
341 #define MAX_RUN 64
986e461dc072 Initial revision
glantau
parents:
diff changeset
342 #define MAX_LEVEL 64
986e461dc072 Initial revision
glantau
parents:
diff changeset
343
986e461dc072 Initial revision
glantau
parents:
diff changeset
344 typedef struct RLTable {
986e461dc072 Initial revision
glantau
parents:
diff changeset
345 int n; /* number of entries of table_vlc minus 1 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
346 int last; /* number of values for last = 0 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
347 const UINT16 (*table_vlc)[2];
986e461dc072 Initial revision
glantau
parents:
diff changeset
348 const INT8 *table_run;
986e461dc072 Initial revision
glantau
parents:
diff changeset
349 const INT8 *table_level;
986e461dc072 Initial revision
glantau
parents:
diff changeset
350 UINT8 *index_run[2]; /* encoding only */
986e461dc072 Initial revision
glantau
parents:
diff changeset
351 INT8 *max_level[2]; /* encoding & decoding */
986e461dc072 Initial revision
glantau
parents:
diff changeset
352 INT8 *max_run[2]; /* encoding & decoding */
986e461dc072 Initial revision
glantau
parents:
diff changeset
353 VLC vlc; /* decoding only */
986e461dc072 Initial revision
glantau
parents:
diff changeset
354 } RLTable;
986e461dc072 Initial revision
glantau
parents:
diff changeset
355
986e461dc072 Initial revision
glantau
parents:
diff changeset
356 void init_rl(RLTable *rl);
986e461dc072 Initial revision
glantau
parents:
diff changeset
357 void init_vlc_rl(RLTable *rl);
986e461dc072 Initial revision
glantau
parents:
diff changeset
358
243
a6519f773064 * using static instead of extern
kabi
parents: 239
diff changeset
359 static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
360 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
361 int index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
362 index = rl->index_run[last][run];
986e461dc072 Initial revision
glantau
parents:
diff changeset
363 if (index >= rl->n)
986e461dc072 Initial revision
glantau
parents:
diff changeset
364 return rl->n;
986e461dc072 Initial revision
glantau
parents:
diff changeset
365 if (level > rl->max_level[last][run])
986e461dc072 Initial revision
glantau
parents:
diff changeset
366 return rl->n;
986e461dc072 Initial revision
glantau
parents:
diff changeset
367 return index + level - 1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
368 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
369
986e461dc072 Initial revision
glantau
parents:
diff changeset
370 void h263_encode_mb(MpegEncContext *s,
986e461dc072 Initial revision
glantau
parents:
diff changeset
371 DCTELEM block[6][64],
986e461dc072 Initial revision
glantau
parents:
diff changeset
372 int motion_x, int motion_y);
265
4e9e728021d8 use ac prediction in mpeg4 encoding (5% smaller intra-blocks/keyframes)
michaelni
parents: 262
diff changeset
373 void mpeg4_encode_mb(MpegEncContext *s,
4e9e728021d8 use ac prediction in mpeg4 encoding (5% smaller intra-blocks/keyframes)
michaelni
parents: 262
diff changeset
374 DCTELEM block[6][64],
4e9e728021d8 use ac prediction in mpeg4 encoding (5% smaller intra-blocks/keyframes)
michaelni
parents: 262
diff changeset
375 int motion_x, int motion_y);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
376 void h263_encode_picture_header(MpegEncContext *s, int picture_number);
162
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
377 int h263_encode_gob_header(MpegEncContext * s, int mb_line);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
378 void h263_dc_scale(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
379 INT16 *h263_pred_motion(MpegEncContext * s, int block,
986e461dc072 Initial revision
glantau
parents:
diff changeset
380 int *px, int *py);
986e461dc072 Initial revision
glantau
parents:
diff changeset
381 void mpeg4_pred_ac(MpegEncContext * s, INT16 *block, int n,
986e461dc072 Initial revision
glantau
parents:
diff changeset
382 int dir);
986e461dc072 Initial revision
glantau
parents:
diff changeset
383 void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
277
5cb2978e701f new motion estimation (epzs) not complete yet but allready pretty good :)
michaelni
parents: 268
diff changeset
384 void h263_encode_init(MpegEncContext *s);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
385
986e461dc072 Initial revision
glantau
parents:
diff changeset
386 void h263_decode_init_vlc(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
387 int h263_decode_picture_header(MpegEncContext *s);
162
de80712db90b - Preliminary RTP friendly mode for H.263.
pulento
parents: 154
diff changeset
388 int h263_decode_gob_header(MpegEncContext *s);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
389 int mpeg4_decode_picture_header(MpegEncContext * s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
390 int intel_h263_decode_picture_header(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
391 int h263_decode_mb(MpegEncContext *s,
986e461dc072 Initial revision
glantau
parents:
diff changeset
392 DCTELEM block[6][64]);
986e461dc072 Initial revision
glantau
parents:
diff changeset
393 int h263_get_picture_format(int width, int height);
986e461dc072 Initial revision
glantau
parents:
diff changeset
394
986e461dc072 Initial revision
glantau
parents:
diff changeset
395 /* rv10.c */
986e461dc072 Initial revision
glantau
parents:
diff changeset
396 void rv10_encode_picture_header(MpegEncContext *s, int picture_number);
986e461dc072 Initial revision
glantau
parents:
diff changeset
397 int rv_decode_dc(MpegEncContext *s, int n);
986e461dc072 Initial revision
glantau
parents:
diff changeset
398
986e461dc072 Initial revision
glantau
parents:
diff changeset
399 /* msmpeg4.c */
986e461dc072 Initial revision
glantau
parents:
diff changeset
400 void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
208
2eb04d6be309 (commit by michael)
arpi_esp
parents: 191
diff changeset
401 void msmpeg4_encode_ext_header(MpegEncContext * s);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
402 void msmpeg4_encode_mb(MpegEncContext * s,
986e461dc072 Initial revision
glantau
parents:
diff changeset
403 DCTELEM block[6][64],
986e461dc072 Initial revision
glantau
parents:
diff changeset
404 int motion_x, int motion_y);
986e461dc072 Initial revision
glantau
parents:
diff changeset
405 void msmpeg4_dc_scale(MpegEncContext * s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
406 int msmpeg4_decode_picture_header(MpegEncContext * s);
208
2eb04d6be309 (commit by michael)
arpi_esp
parents: 191
diff changeset
407 int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
408 int msmpeg4_decode_mb(MpegEncContext *s,
986e461dc072 Initial revision
glantau
parents:
diff changeset
409 DCTELEM block[6][64]);
986e461dc072 Initial revision
glantau
parents:
diff changeset
410 int msmpeg4_decode_init_vlc(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
411
986e461dc072 Initial revision
glantau
parents:
diff changeset
412 /* mjpegenc.c */
986e461dc072 Initial revision
glantau
parents:
diff changeset
413
986e461dc072 Initial revision
glantau
parents:
diff changeset
414 int mjpeg_init(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
415 void mjpeg_close(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
416 void mjpeg_encode_mb(MpegEncContext *s,
986e461dc072 Initial revision
glantau
parents:
diff changeset
417 DCTELEM block[6][64]);
986e461dc072 Initial revision
glantau
parents:
diff changeset
418 void mjpeg_picture_header(MpegEncContext *s);
986e461dc072 Initial revision
glantau
parents:
diff changeset
419 void mjpeg_picture_trailer(MpegEncContext *s);