comparison mpegvideo.h @ 1064:b32afefe7d33 libavcodec

* UINTX -> uintx_t INTX -> intx_t
author kabi
date Tue, 11 Feb 2003 16:35:48 +0000
parents bb5de8a59da8
children 7e79a58954b1
comparison
equal deleted inserted replaced
1063:fdeac9642346 1064:b32afefe7d33
66 float qscale; 66 float qscale;
67 int mv_bits; 67 int mv_bits;
68 int i_tex_bits; 68 int i_tex_bits;
69 int p_tex_bits; 69 int p_tex_bits;
70 int misc_bits; 70 int misc_bits;
71 UINT64 expected_bits; 71 uint64_t expected_bits;
72 int new_pict_type; 72 int new_pict_type;
73 float new_qscale; 73 float new_qscale;
74 int mc_mb_var_sum; 74 int mc_mb_var_sum;
75 int mb_var_sum; 75 int mb_var_sum;
76 int i_count; 76 int i_count;
90 double pass1_wanted_bits; /* bits which should have been outputed by the pass1 code (including complexity init) */ 90 double pass1_wanted_bits; /* bits which should have been outputed by the pass1 code (including complexity init) */
91 double last_qscale; 91 double last_qscale;
92 double last_qscale_for[5]; /* last qscale for a specific pict type, used for max_diff & ipb factor stuff */ 92 double last_qscale_for[5]; /* last qscale for a specific pict type, used for max_diff & ipb factor stuff */
93 int last_mc_mb_var_sum; 93 int last_mc_mb_var_sum;
94 int last_mb_var_sum; 94 int last_mb_var_sum;
95 UINT64 i_cplx_sum[5]; 95 uint64_t i_cplx_sum[5];
96 UINT64 p_cplx_sum[5]; 96 uint64_t p_cplx_sum[5];
97 UINT64 mv_bits_sum[5]; 97 uint64_t mv_bits_sum[5];
98 UINT64 qscale_sum[5]; 98 uint64_t qscale_sum[5];
99 int frame_count[5]; 99 int frame_count[5];
100 int last_non_b_pict_type; 100 int last_non_b_pict_type;
101 }RateControlContext; 101 }RateControlContext;
102 102
103 typedef struct ScanTable{ 103 typedef struct ScanTable{
104 const UINT8 *scantable; 104 const uint8_t *scantable;
105 UINT8 permutated[64]; 105 uint8_t permutated[64];
106 UINT8 raster_end[64]; 106 uint8_t raster_end[64];
107 #ifdef ARCH_POWERPC 107 #ifdef ARCH_POWERPC
108 /* Used by dct_quantise_alitvec to find last-non-zero */ 108 /* Used by dct_quantise_alitvec to find last-non-zero */
109 UINT8 __align8 inverse[64]; 109 uint8_t __align8 inverse[64];
110 #endif 110 #endif
111 } ScanTable; 111 } ScanTable;
112 112
113 typedef struct Picture{ 113 typedef struct Picture{
114 FF_COMMON_FRAME 114 FF_COMMON_FRAME
121 int32_t *mb_cmp_score; /* Table for MB cmp scores, for mb decission */ 121 int32_t *mb_cmp_score; /* Table for MB cmp scores, for mb decission */
122 int b_frame_score; /* */ 122 int b_frame_score; /* */
123 } Picture; 123 } Picture;
124 124
125 typedef struct ParseContext{ 125 typedef struct ParseContext{
126 UINT8 *buffer; 126 uint8_t *buffer;
127 int index; 127 int index;
128 int last_index; 128 int last_index;
129 int buffer_size; 129 int buffer_size;
130 int state; 130 int state;
131 int frame_start_found; 131 int frame_start_found;
145 int penalty_factor; 145 int penalty_factor;
146 int sub_penalty_factor; 146 int sub_penalty_factor;
147 int mb_penalty_factor; 147 int mb_penalty_factor;
148 int pre_pass; /* = 1 for the pre pass */ 148 int pre_pass; /* = 1 for the pre pass */
149 int dia_size; 149 int dia_size;
150 UINT16 (*mv_penalty)[MAX_MV*2+1]; /* amount of bits needed to encode a MV */ 150 uint16_t (*mv_penalty)[MAX_MV*2+1]; /* amount of bits needed to encode a MV */
151 int (*sub_motion_search)(struct MpegEncContext * s, 151 int (*sub_motion_search)(struct MpegEncContext * s,
152 int *mx_ptr, int *my_ptr, int dmin, 152 int *mx_ptr, int *my_ptr, int dmin,
153 int xmin, int ymin, int xmax, int ymax, 153 int xmin, int ymin, int xmax, int ymax,
154 int pred_x, int pred_y, Picture *ref_picture, 154 int pred_x, int pred_y, Picture *ref_picture,
155 int n, int size, uint16_t * const mv_penalty); 155 int n, int size, uint16_t * const mv_penalty);
222 Picture last_picture; /* previous picture */ 222 Picture last_picture; /* previous picture */
223 Picture next_picture; /* previous picture (for bidir pred) */ 223 Picture next_picture; /* previous picture (for bidir pred) */
224 Picture new_picture; /* source picture for encoding */ 224 Picture new_picture; /* source picture for encoding */
225 Picture current_picture; /* buffer to store the decompressed current picture */ 225 Picture current_picture; /* buffer to store the decompressed current picture */
226 int last_dc[3]; /* last DC values for MPEG1 */ 226 int last_dc[3]; /* last DC values for MPEG1 */
227 INT16 *dc_val[3]; /* used for mpeg4 DC prediction, all 3 arrays must be continuous */ 227 int16_t *dc_val[3]; /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
228 int y_dc_scale, c_dc_scale; 228 int y_dc_scale, c_dc_scale;
229 UINT8 *y_dc_scale_table; /* qscale -> y_dc_scale table */ 229 uint8_t *y_dc_scale_table; /* qscale -> y_dc_scale table */
230 UINT8 *c_dc_scale_table; /* qscale -> c_dc_scale table */ 230 uint8_t *c_dc_scale_table; /* qscale -> c_dc_scale table */
231 UINT8 *coded_block; /* used for coded block pattern prediction (msmpeg4v3, wmv1)*/ 231 uint8_t *coded_block; /* used for coded block pattern prediction (msmpeg4v3, wmv1)*/
232 INT16 (*ac_val[3])[16]; /* used for for mpeg4 AC prediction, all 3 arrays must be continuous */ 232 int16_t (*ac_val[3])[16]; /* used for for mpeg4 AC prediction, all 3 arrays must be continuous */
233 int ac_pred; 233 int ac_pred;
234 uint8_t *prev_pict_types; /* previous picture types in bitstream order, used for mb skip */ 234 uint8_t *prev_pict_types; /* previous picture types in bitstream order, used for mb skip */
235 #define PREV_PICT_TYPES_BUFFER_SIZE 256 235 #define PREV_PICT_TYPES_BUFFER_SIZE 256
236 int mb_skiped; /* MUST BE SET only during DECODING */ 236 int mb_skiped; /* MUST BE SET only during DECODING */
237 UINT8 *mbskip_table; /* used to avoid copy if macroblock skipped (for black regions for example) 237 uint8_t *mbskip_table; /* used to avoid copy if macroblock skipped (for black regions for example)
238 and used for b-frame encoding & decoding (contains skip table of next P Frame) */ 238 and used for b-frame encoding & decoding (contains skip table of next P Frame) */
239 UINT8 *mbintra_table; /* used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding */ 239 uint8_t *mbintra_table; /* used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding */
240 UINT8 *cbp_table; /* used to store cbp, ac_pred for partitioned decoding */ 240 uint8_t *cbp_table; /* used to store cbp, ac_pred for partitioned decoding */
241 UINT8 *pred_dir_table; /* used to store pred_dir for partitioned decoding */ 241 uint8_t *pred_dir_table; /* used to store pred_dir for partitioned decoding */
242 uint8_t *allocated_edge_emu_buffer; 242 uint8_t *allocated_edge_emu_buffer;
243 uint8_t *edge_emu_buffer; /* points into the middle of allocated_edge_emu_buffer */ 243 uint8_t *edge_emu_buffer; /* points into the middle of allocated_edge_emu_buffer */
244 244
245 int qscale; /* QP */ 245 int qscale; /* QP */
246 float frame_qscale; /* qscale from the frame level rc FIXME remove*/ 246 float frame_qscale; /* qscale from the frame level rc FIXME remove*/
255 int h263_long_vectors; /* use horrible h263v1 long vector mode */ 255 int h263_long_vectors; /* use horrible h263v1 long vector mode */
256 256
257 DSPContext dsp; /* pointers for accelerated dsp fucntions */ 257 DSPContext dsp; /* pointers for accelerated dsp fucntions */
258 int f_code; /* forward MV resolution */ 258 int f_code; /* forward MV resolution */
259 int b_code; /* backward MV resolution for B Frames (mpeg4) */ 259 int b_code; /* backward MV resolution for B Frames (mpeg4) */
260 INT16 (*motion_val)[2]; /* used for MV prediction (4MV per MB) */ 260 int16_t (*motion_val)[2]; /* used for MV prediction (4MV per MB) */
261 INT16 (*p_mv_table)[2]; /* MV table (1MV per MB) p-frame encoding */ 261 int16_t (*p_mv_table)[2]; /* MV table (1MV per MB) p-frame encoding */
262 INT16 (*b_forw_mv_table)[2]; /* MV table (1MV per MB) forward mode b-frame encoding */ 262 int16_t (*b_forw_mv_table)[2]; /* MV table (1MV per MB) forward mode b-frame encoding */
263 INT16 (*b_back_mv_table)[2]; /* MV table (1MV per MB) backward mode b-frame encoding */ 263 int16_t (*b_back_mv_table)[2]; /* MV table (1MV per MB) backward mode b-frame encoding */
264 INT16 (*b_bidir_forw_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */ 264 int16_t (*b_bidir_forw_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */
265 INT16 (*b_bidir_back_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */ 265 int16_t (*b_bidir_back_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */
266 INT16 (*b_direct_mv_table)[2]; /* MV table (1MV per MB) direct mode b-frame encoding */ 266 int16_t (*b_direct_mv_table)[2]; /* MV table (1MV per MB) direct mode b-frame encoding */
267 int me_method; /* ME algorithm */ 267 int me_method; /* ME algorithm */
268 int scene_change_score; 268 int scene_change_score;
269 int mv_dir; 269 int mv_dir;
270 #define MV_DIR_BACKWARD 1 270 #define MV_DIR_BACKWARD 1
271 #define MV_DIR_FORWARD 2 271 #define MV_DIR_FORWARD 2
282 third " : 0 = x, 1 = y 282 third " : 0 = x, 1 = y
283 */ 283 */
284 int mv[2][4][2]; 284 int mv[2][4][2];
285 int field_select[2][2]; 285 int field_select[2][2];
286 int last_mv[2][2][2]; /* last MV, used for MV prediction in MPEG1 & B-frame MPEG4 */ 286 int last_mv[2][2][2]; /* last MV, used for MV prediction in MPEG1 & B-frame MPEG4 */
287 UINT8 *fcode_tab; /* smallest fcode needed for each MV */ 287 uint8_t *fcode_tab; /* smallest fcode needed for each MV */
288 288
289 MotionEstContext me; 289 MotionEstContext me;
290 290
291 int no_rounding; /* apply no rounding to motion compensation (MPEG4, msmpeg4, ...) 291 int no_rounding; /* apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
292 for b-frames rounding mode is allways 0 */ 292 for b-frames rounding mode is allways 0 */
296 296
297 /* macroblock layer */ 297 /* macroblock layer */
298 int mb_x, mb_y; 298 int mb_x, mb_y;
299 int mb_incr; 299 int mb_incr;
300 int mb_intra; 300 int mb_intra;
301 UINT8 *mb_type; /* Table for MB type */ 301 uint8_t *mb_type; /* Table for MB type */
302 #define MB_TYPE_INTRA 0x01 302 #define MB_TYPE_INTRA 0x01
303 #define MB_TYPE_INTER 0x02 303 #define MB_TYPE_INTER 0x02
304 #define MB_TYPE_INTER4V 0x04 304 #define MB_TYPE_INTER4V 0x04
305 #define MB_TYPE_SKIPED 0x08 305 #define MB_TYPE_SKIPED 0x08
306 #define MB_TYPE_GMC 0x10 306 #define MB_TYPE_GMC 0x10
312 312
313 int block_index[6]; /* index to current MB in block based arrays with edges*/ 313 int block_index[6]; /* index to current MB in block based arrays with edges*/
314 int block_wrap[6]; 314 int block_wrap[6];
315 315
316 /* matrix transmitted in the bitstream */ 316 /* matrix transmitted in the bitstream */
317 UINT16 intra_matrix[64]; 317 uint16_t intra_matrix[64];
318 UINT16 chroma_intra_matrix[64]; 318 uint16_t chroma_intra_matrix[64];
319 UINT16 inter_matrix[64]; 319 uint16_t inter_matrix[64];
320 UINT16 chroma_inter_matrix[64]; 320 uint16_t chroma_inter_matrix[64];
321 #define QUANT_BIAS_SHIFT 4 321 #define QUANT_BIAS_SHIFT 4
322 int intra_quant_bias; /* bias for the quantizer */ 322 int intra_quant_bias; /* bias for the quantizer */
323 int inter_quant_bias; /* bias for the quantizer */ 323 int inter_quant_bias; /* bias for the quantizer */
324 int min_qcoeff; /* minimum encodable coefficient */ 324 int min_qcoeff; /* minimum encodable coefficient */
325 int max_qcoeff; /* maximum encodable coefficient */ 325 int max_qcoeff; /* maximum encodable coefficient */
334 334
335 /* precomputed matrix (combine qscale and DCT renorm) */ 335 /* precomputed matrix (combine qscale and DCT renorm) */
336 int __align8 q_intra_matrix[32][64]; 336 int __align8 q_intra_matrix[32][64];
337 int __align8 q_inter_matrix[32][64]; 337 int __align8 q_inter_matrix[32][64];
338 /* identical to the above but for MMX & these are not permutated */ 338 /* identical to the above but for MMX & these are not permutated */
339 UINT16 __align8 q_intra_matrix16[32][64]; 339 uint16_t __align8 q_intra_matrix16[32][64];
340 UINT16 __align8 q_inter_matrix16[32][64]; 340 uint16_t __align8 q_inter_matrix16[32][64];
341 UINT16 __align8 q_intra_matrix16_bias[32][64]; 341 uint16_t __align8 q_intra_matrix16_bias[32][64];
342 UINT16 __align8 q_inter_matrix16_bias[32][64]; 342 uint16_t __align8 q_inter_matrix16_bias[32][64];
343 int block_last_index[6]; /* last non zero coefficient in block */ 343 int block_last_index[6]; /* last non zero coefficient in block */
344 /* scantables */ 344 /* scantables */
345 ScanTable __align8 intra_scantable; 345 ScanTable __align8 intra_scantable;
346 ScanTable intra_h_scantable; 346 ScanTable intra_h_scantable;
347 ScanTable intra_v_scantable; 347 ScanTable intra_v_scantable;
348 ScanTable inter_scantable; // if inter == intra then intra should be used to reduce tha cache usage 348 ScanTable inter_scantable; // if inter == intra then intra should be used to reduce tha cache usage
349 UINT8 idct_permutation[64]; 349 uint8_t idct_permutation[64];
350 int idct_permutation_type; 350 int idct_permutation_type;
351 #define FF_NO_IDCT_PERM 1 351 #define FF_NO_IDCT_PERM 1
352 #define FF_LIBMPEG2_IDCT_PERM 2 352 #define FF_LIBMPEG2_IDCT_PERM 2
353 #define FF_SIMPLE_IDCT_PERM 3 353 #define FF_SIMPLE_IDCT_PERM 3
354 #define FF_TRANSPOSE_IDCT_PERM 4 354 #define FF_TRANSPOSE_IDCT_PERM 4
355 355
356 void *opaque; /* private data for the user */ 356 void *opaque; /* private data for the user */
357 357
358 /* bit rate control */ 358 /* bit rate control */
359 int I_frame_bits; //FIXME used in mpeg12 ... 359 int I_frame_bits; //FIXME used in mpeg12 ...
360 INT64 wanted_bits; 360 int64_t wanted_bits;
361 INT64 total_bits; 361 int64_t total_bits;
362 int frame_bits; /* bits used for the current frame */ 362 int frame_bits; /* bits used for the current frame */
363 RateControlContext rc_context; // contains stuff only accessed in ratecontrol.c 363 RateControlContext rc_context; // contains stuff only accessed in ratecontrol.c
364 364
365 /* statistics, used for 2-pass encoding */ 365 /* statistics, used for 2-pass encoding */
366 int mv_bits; 366 int mv_bits;
373 int skip_count; 373 int skip_count;
374 int misc_bits; // cbp, mb_type 374 int misc_bits; // cbp, mb_type
375 int last_bits; //temp var used for calculating the above vars 375 int last_bits; //temp var used for calculating the above vars
376 376
377 /* error concealment / resync */ 377 /* error concealment / resync */
378 UINT8 *error_status_table; /* table of the error status of each MB */ 378 uint8_t *error_status_table; /* table of the error status of each MB */
379 #define VP_START 1 /* current MB is the first after a resync marker */ 379 #define VP_START 1 /* current MB is the first after a resync marker */
380 #define AC_ERROR 2 380 #define AC_ERROR 2
381 #define DC_ERROR 4 381 #define DC_ERROR 4
382 #define MV_ERROR 8 382 #define MV_ERROR 8
383 #define AC_END 16 383 #define AC_END 16
407 /* mpeg4 specific */ 407 /* mpeg4 specific */
408 int time_increment_resolution; 408 int time_increment_resolution;
409 int time_increment_bits; /* number of bits to represent the fractional part of time */ 409 int time_increment_bits; /* number of bits to represent the fractional part of time */
410 int last_time_base; 410 int last_time_base;
411 int time_base; /* time in seconds of last I,P,S Frame */ 411 int time_base; /* time in seconds of last I,P,S Frame */
412 INT64 time; /* time of current frame */ 412 int64_t time; /* time of current frame */
413 INT64 last_non_b_time; 413 int64_t last_non_b_time;
414 UINT16 pp_time; /* time distance between the last 2 p,s,i frames */ 414 uint16_t pp_time; /* time distance between the last 2 p,s,i frames */
415 UINT16 pb_time; /* time distance between the last b and p,s,i frame */ 415 uint16_t pb_time; /* time distance between the last b and p,s,i frame */
416 UINT16 pp_field_time; 416 uint16_t pp_field_time;
417 UINT16 pb_field_time; /* like above, just for interlaced */ 417 uint16_t pb_field_time; /* like above, just for interlaced */
418 int shape; 418 int shape;
419 int vol_sprite_usage; 419 int vol_sprite_usage;
420 int sprite_width; 420 int sprite_width;
421 int sprite_height; 421 int sprite_height;
422 int sprite_left; 422 int sprite_left;
453 uint8_t *tex_pb_buffer; 453 uint8_t *tex_pb_buffer;
454 uint8_t *pb2_buffer; 454 uint8_t *pb2_buffer;
455 int mpeg_quant; 455 int mpeg_quant;
456 #define CO_LOCATED_TYPE_4MV 1 456 #define CO_LOCATED_TYPE_4MV 1
457 #define CO_LOCATED_TYPE_FIELDMV 2 457 #define CO_LOCATED_TYPE_FIELDMV 2
458 INT8 *co_located_type_table; /* 4mv & field_mv info for next b frame */ 458 int8_t *co_located_type_table; /* 4mv & field_mv info for next b frame */
459 INT16 (*field_mv_table)[2][2]; /* used for interlaced b frame decoding */ 459 int16_t (*field_mv_table)[2][2]; /* used for interlaced b frame decoding */
460 INT8 (*field_select_table)[2]; /* wtf, no really another table for interlaced b frames */ 460 int8_t (*field_select_table)[2]; /* wtf, no really another table for interlaced b frames */
461 int t_frame; /* time distance of first I -> B, used for interlaced b frames */ 461 int t_frame; /* time distance of first I -> B, used for interlaced b frames */
462 int padding_bug_score; /* used to detect the VERY common padding bug in MPEG4 */ 462 int padding_bug_score; /* used to detect the VERY common padding bug in MPEG4 */
463 463
464 /* divx specific, used to workaround (many) bugs in divx5 */ 464 /* divx specific, used to workaround (many) bugs in divx5 */
465 int divx_version; 465 int divx_version;
466 int divx_build; 466 int divx_build;
467 #define BITSTREAM_BUFFER_SIZE 1024*256 467 #define BITSTREAM_BUFFER_SIZE 1024*256
468 UINT8 *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them 468 uint8_t *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them
469 int bitstream_buffer_size; 469 int bitstream_buffer_size;
470 470
471 int xvid_build; 471 int xvid_build;
472 472
473 /* lavc specific stuff, used to workaround bugs in libavcodec */ 473 /* lavc specific stuff, used to workaround bugs in libavcodec */
539 /* RTP specific */ 539 /* RTP specific */
540 /* These are explained on avcodec.h */ 540 /* These are explained on avcodec.h */
541 int rtp_mode; 541 int rtp_mode;
542 int rtp_payload_size; 542 int rtp_payload_size;
543 void (*rtp_callback)(void *data, int size, int packet_number); 543 void (*rtp_callback)(void *data, int size, int packet_number);
544 UINT8 *ptr_lastgob; 544 uint8_t *ptr_lastgob;
545 UINT8 *ptr_last_mb_line; 545 uint8_t *ptr_last_mb_line;
546 UINT32 mb_line_avgsize; 546 uint32_t mb_line_avgsize;
547 547
548 DCTELEM (*block)[64]; /* points to one of the following blocks */ 548 DCTELEM (*block)[64]; /* points to one of the following blocks */
549 DCTELEM blocks[2][6][64] __align8; // for HQ mode we need to keep the best block 549 DCTELEM blocks[2][6][64] __align8; // for HQ mode we need to keep the best block
550 int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch() 550 int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
551 #define SLICE_OK 0 551 #define SLICE_OK 0
562 void (*dct_unquantize)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) 562 void (*dct_unquantize)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
563 DCTELEM *block/*align 16*/, int n, int qscale); 563 DCTELEM *block/*align 16*/, int n, int qscale);
564 int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); 564 int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
565 int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); 565 int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
566 void (*fdct)(DCTELEM *block/* align 16*/); 566 void (*fdct)(DCTELEM *block/* align 16*/);
567 void (*idct_put)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/); 567 void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
568 void (*idct_add)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/); 568 void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
569 //FIXME move above funcs into dspContext perhaps 569 //FIXME move above funcs into dspContext perhaps
570 } MpegEncContext; 570 } MpegEncContext;
571 571
572 572
573 int DCT_common_init(MpegEncContext *s); 573 int DCT_common_init(MpegEncContext *s);
595 void MPV_common_init_armv4l(MpegEncContext *s); 595 void MPV_common_init_armv4l(MpegEncContext *s);
596 #endif 596 #endif
597 #ifdef ARCH_POWERPC 597 #ifdef ARCH_POWERPC
598 void MPV_common_init_ppc(MpegEncContext *s); 598 void MPV_common_init_ppc(MpegEncContext *s);
599 #endif 599 #endif
600 extern void (*draw_edges)(UINT8 *buf, int wrap, int width, int height, int w); 600 extern void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w);
601 void ff_conceal_past_errors(MpegEncContext *s, int conceal_all); 601 void ff_conceal_past_errors(MpegEncContext *s, int conceal_all);
602 void ff_copy_bits(PutBitContext *pb, UINT8 *src, int length); 602 void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length);
603 void ff_clean_intra_table_entries(MpegEncContext *s); 603 void ff_clean_intra_table_entries(MpegEncContext *s);
604 void ff_init_scantable(MpegEncContext *s, ScanTable *st, const UINT8 *src_scantable); 604 void ff_init_scantable(MpegEncContext *s, ScanTable *st, const uint8_t *src_scantable);
605 void ff_error_resilience(MpegEncContext *s); 605 void ff_error_resilience(MpegEncContext *s);
606 void ff_draw_horiz_band(MpegEncContext *s); 606 void ff_draw_horiz_band(MpegEncContext *s);
607 void ff_emulated_edge_mc(MpegEncContext *s, UINT8 *src, int linesize, int block_w, int block_h, 607 void ff_emulated_edge_mc(MpegEncContext *s, uint8_t *src, int linesize, int block_w, int block_h,
608 int src_x, int src_y, int w, int h); 608 int src_x, int src_y, int w, int h);
609 char ff_get_pict_type_char(int pict_type); 609 char ff_get_pict_type_char(int pict_type);
610 int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size); 610 int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size);
611 611
612 extern enum PixelFormat ff_yuv420p_list[2]; 612 extern enum PixelFormat ff_yuv420p_list[2];
643 void ff_init_me(MpegEncContext *s); 643 void ff_init_me(MpegEncContext *s);
644 int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y); 644 int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y);
645 645
646 646
647 /* mpeg12.c */ 647 /* mpeg12.c */
648 extern const INT16 ff_mpeg1_default_intra_matrix[64]; 648 extern const int16_t ff_mpeg1_default_intra_matrix[64];
649 extern const INT16 ff_mpeg1_default_non_intra_matrix[64]; 649 extern const int16_t ff_mpeg1_default_non_intra_matrix[64];
650 extern UINT8 ff_mpeg1_dc_scale_table[128]; 650 extern uint8_t ff_mpeg1_dc_scale_table[128];
651 651
652 void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); 652 void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
653 void mpeg1_encode_mb(MpegEncContext *s, 653 void mpeg1_encode_mb(MpegEncContext *s,
654 DCTELEM block[6][64], 654 DCTELEM block[6][64],
655 int motion_x, int motion_y); 655 int motion_x, int motion_y);
658 658
659 /* h263enc.c */ 659 /* h263enc.c */
660 typedef struct RLTable { 660 typedef struct RLTable {
661 int n; /* number of entries of table_vlc minus 1 */ 661 int n; /* number of entries of table_vlc minus 1 */
662 int last; /* number of values for last = 0 */ 662 int last; /* number of values for last = 0 */
663 const UINT16 (*table_vlc)[2]; 663 const uint16_t (*table_vlc)[2];
664 const INT8 *table_run; 664 const int8_t *table_run;
665 const INT8 *table_level; 665 const int8_t *table_level;
666 UINT8 *index_run[2]; /* encoding only */ 666 uint8_t *index_run[2]; /* encoding only */
667 INT8 *max_level[2]; /* encoding & decoding */ 667 int8_t *max_level[2]; /* encoding & decoding */
668 INT8 *max_run[2]; /* encoding & decoding */ 668 int8_t *max_run[2]; /* encoding & decoding */
669 VLC vlc; /* decoding only deprected FIXME remove*/ 669 VLC vlc; /* decoding only deprected FIXME remove*/
670 RL_VLC_ELEM *rl_vlc[32]; /* decoding only */ 670 RL_VLC_ELEM *rl_vlc[32]; /* decoding only */
671 } RLTable; 671 } RLTable;
672 672
673 void init_rl(RLTable *rl); 673 void init_rl(RLTable *rl);
682 if (level > rl->max_level[last][run]) 682 if (level > rl->max_level[last][run])
683 return rl->n; 683 return rl->n;
684 return index + level - 1; 684 return index + level - 1;
685 } 685 }
686 686
687 extern UINT8 ff_mpeg4_y_dc_scale_table[32]; 687 extern uint8_t ff_mpeg4_y_dc_scale_table[32];
688 extern UINT8 ff_mpeg4_c_dc_scale_table[32]; 688 extern uint8_t ff_mpeg4_c_dc_scale_table[32];
689 extern const INT16 ff_mpeg4_default_intra_matrix[64]; 689 extern const int16_t ff_mpeg4_default_intra_matrix[64];
690 extern const INT16 ff_mpeg4_default_non_intra_matrix[64]; 690 extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
691 int ff_h263_decode_init(AVCodecContext *avctx); 691 int ff_h263_decode_init(AVCodecContext *avctx);
692 int ff_h263_decode_frame(AVCodecContext *avctx, 692 int ff_h263_decode_frame(AVCodecContext *avctx,
693 void *data, int *data_size, 693 void *data, int *data_size,
694 UINT8 *buf, int buf_size); 694 uint8_t *buf, int buf_size);
695 int ff_h263_decode_end(AVCodecContext *avctx); 695 int ff_h263_decode_end(AVCodecContext *avctx);
696 void h263_encode_mb(MpegEncContext *s, 696 void h263_encode_mb(MpegEncContext *s,
697 DCTELEM block[6][64], 697 DCTELEM block[6][64],
698 int motion_x, int motion_y); 698 int motion_x, int motion_y);
699 void mpeg4_encode_mb(MpegEncContext *s, 699 void mpeg4_encode_mb(MpegEncContext *s,
700 DCTELEM block[6][64], 700 DCTELEM block[6][64],
701 int motion_x, int motion_y); 701 int motion_x, int motion_y);
702 void h263_encode_picture_header(MpegEncContext *s, int picture_number); 702 void h263_encode_picture_header(MpegEncContext *s, int picture_number);
703 int h263_encode_gob_header(MpegEncContext * s, int mb_line); 703 int h263_encode_gob_header(MpegEncContext * s, int mb_line);
704 INT16 *h263_pred_motion(MpegEncContext * s, int block, 704 int16_t *h263_pred_motion(MpegEncContext * s, int block,
705 int *px, int *py); 705 int *px, int *py);
706 void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, 706 void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
707 int dir); 707 int dir);
708 void ff_set_mpeg4_time(MpegEncContext * s, int picture_number); 708 void ff_set_mpeg4_time(MpegEncContext * s, int picture_number);
709 void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); 709 void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
749 int ff_msmpeg4_decode_init(MpegEncContext *s); 749 int ff_msmpeg4_decode_init(MpegEncContext *s);
750 void ff_msmpeg4_encode_init(MpegEncContext *s); 750 void ff_msmpeg4_encode_init(MpegEncContext *s);
751 int ff_wmv2_decode_picture_header(MpegEncContext * s); 751 int ff_wmv2_decode_picture_header(MpegEncContext * s);
752 void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr); 752 void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
753 void ff_mspel_motion(MpegEncContext *s, 753 void ff_mspel_motion(MpegEncContext *s,
754 UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr, 754 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
755 UINT8 **ref_picture, op_pixels_func (*pix_op)[4], 755 uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
756 int motion_x, int motion_y, int h); 756 int motion_x, int motion_y, int h);
757 int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number); 757 int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
758 void ff_wmv2_encode_mb(MpegEncContext * s, 758 void ff_wmv2_encode_mb(MpegEncContext * s,
759 DCTELEM block[6][64], 759 DCTELEM block[6][64],
760 int motion_x, int motion_y); 760 int motion_x, int motion_y);