Commit 696d19f4 authored by Michel Lespinasse's avatar Michel Lespinasse

cosmetic checkin

renaming picture_t into decoder_t - picture_t will be used for new lowlevel API
also fixing a few typos here and there
parent aaa83d1b
......@@ -33,7 +33,7 @@ mpeg2dec-0.1.7 Thu Nov 2 21:38:33 PST 2000
-new configuration code
mpeg2dec-0.1.6 Wed Mar 22 09:45:44 PST 2000
-enhanced g200
-enhanced g200
-solaris fixes
-inlined, rewritten bitstream code (much faster now)
-moved colorspace conversion code into yuv2rgb.c
......
mpeg2dec-0.2.1 Sun Mar 17 23:24:04 PST 2002
mpeg2dec-0.2.1 Sun Mar 17 23:24:04 PST 2002
Two major new features: First, a much higher tolerance to corrupted
streams. Instead of just segfaulting, we should now be able to keep
......@@ -15,7 +15,7 @@ And, the libvo interface has been slightly extended so people can more
easily make use of the various mpeg flags.
mpeg2dec-0.2.0 Thu Feb 15 20:12:34 PST 2001
mpeg2dec-0.2.0 Thu Feb 15 20:12:34 PST 2001
The most important new feature is the support for field
pictures. mpeg2dec is now able to display any conformant
......
......@@ -26,12 +26,12 @@
/* Structure for the mpeg2dec decoder */
typedef struct mpeg2dec_s {
typedef struct {
vo_instance_t * output;
/* this is where we keep the state of the decoder */
struct picture_s * picture;
struct decoder_s * decoder;
uint32_t shift;
int is_display_initialized;
int is_sequence_needed;
......
......@@ -54,7 +54,7 @@ struct vo_instance_s {
vo_frame_t * (* get_frame) (vo_instance_t * instance, int flags);
};
typedef struct vo_driver_s {
typedef struct {
char * name;
vo_open_t * open;
} vo_driver_t;
......
......@@ -55,7 +55,7 @@ void mpeg2_init (mpeg2dec_t * mpeg2dec, uint32_t mm_accel,
}
mpeg2dec->chunk_buffer = memalign (16, BUFFER_SIZE + 4);
mpeg2dec->picture = memalign (16, sizeof (picture_t));
mpeg2dec->decoder = memalign (16, sizeof (decoder_t));
mpeg2dec->shift = 0xffffff00;
mpeg2dec->is_sequence_needed = 1;
......@@ -66,16 +66,16 @@ void mpeg2_init (mpeg2dec_t * mpeg2dec, uint32_t mm_accel,
mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
mpeg2dec->code = 0xb4;
memset (mpeg2dec->picture, 0, sizeof (picture_t));
memset (mpeg2dec->decoder, 0, sizeof (decoder_t));
/* initialize substructures */
mpeg2_header_state_init (mpeg2dec->picture);
mpeg2_header_state_init (mpeg2dec->decoder);
}
static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
uint8_t * buffer)
{
picture_t * picture;
decoder_t * decoder;
int is_frame_done;
/* wait for sequence_header_code */
......@@ -84,56 +84,56 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
mpeg2_stats (code, buffer);
picture = mpeg2dec->picture;
decoder = mpeg2dec->decoder;
is_frame_done = 0;
if (mpeg2dec->in_slice && ((!code) || (code >= 0xb0))) {
mpeg2dec->in_slice = 0;
if (((picture->picture_structure == FRAME_PICTURE) ||
(picture->second_field)) &&
if (((decoder->picture_structure == FRAME_PICTURE) ||
(decoder->second_field)) &&
(!(mpeg2dec->drop_frame))) {
is_frame_done = 1;
vo_draw ((picture->picture_coding_type == B_TYPE) ?
picture->current_frame :
picture->forward_reference_frame);
vo_draw ((decoder->picture_coding_type == B_TYPE) ?
decoder->current_frame :
decoder->forward_reference_frame);
}
}
switch (code) {
case 0x00: /* picture_start_code */
if (mpeg2_header_picture (picture, buffer)) {
if (mpeg2_header_picture (decoder, buffer)) {
fprintf (stderr, "bad picture header\n");
exit (1);
}
mpeg2dec->drop_frame =
mpeg2dec->drop_flag && (picture->picture_coding_type == B_TYPE);
mpeg2dec->drop_flag && (decoder->picture_coding_type == B_TYPE);
break;
case 0xb3: /* sequence_header_code */
if (mpeg2_header_sequence (picture, buffer)) {
if (mpeg2_header_sequence (decoder, buffer)) {
fprintf (stderr, "bad sequence header\n");
exit (1);
}
if (mpeg2dec->is_sequence_needed) {
mpeg2dec->is_sequence_needed = 0;
if (vo_setup (mpeg2dec->output, picture->coded_picture_width,
picture->coded_picture_height)) {
if (vo_setup (mpeg2dec->output, decoder->coded_picture_width,
decoder->coded_picture_height)) {
fprintf (stderr, "display setup failed\n");
exit (1);
}
picture->forward_reference_frame =
decoder->forward_reference_frame =
vo_get_frame (mpeg2dec->output,
VO_PREDICTION_FLAG | VO_BOTH_FIELDS);
picture->backward_reference_frame =
decoder->backward_reference_frame =
vo_get_frame (mpeg2dec->output,
VO_PREDICTION_FLAG | VO_BOTH_FIELDS);
}
mpeg2dec->frame_rate_code = picture->frame_rate_code; /* FIXME */
mpeg2dec->frame_rate_code = decoder->frame_rate_code; /* FIXME */
break;
case 0xb5: /* extension_start_code */
if (mpeg2_header_extension (picture, buffer)) {
if (mpeg2_header_extension (decoder, buffer)) {
fprintf (stderr, "bad extension\n");
exit (1);
}
......@@ -149,41 +149,41 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
if (!(mpeg2dec->in_slice)) {
mpeg2dec->in_slice = 1;
if (picture->second_field)
vo_field (picture->current_frame, picture->picture_structure);
if (decoder->second_field)
vo_field (decoder->current_frame, decoder->picture_structure);
else {
vo_frame_t * frame;
if (picture->picture_coding_type == B_TYPE)
picture->current_frame =
if (decoder->picture_coding_type == B_TYPE)
decoder->current_frame =
vo_get_frame (mpeg2dec->output,
picture->picture_structure);
decoder->picture_structure);
else {
picture->current_frame =
decoder->current_frame =
vo_get_frame (mpeg2dec->output,
(VO_PREDICTION_FLAG |
picture->picture_structure));
picture->forward_reference_frame =
picture->backward_reference_frame;
picture->backward_reference_frame = picture->current_frame;
decoder->picture_structure));
decoder->forward_reference_frame =
decoder->backward_reference_frame;
decoder->backward_reference_frame = decoder->current_frame;
}
/* hopefully vektor will be happy */
frame = picture->current_frame;
frame->aspect_ratio = picture->aspect_ratio_information;
frame->frame_rate_code = picture->frame_rate_code;
frame->bitrate = picture->bitrate;
frame->progressive_sequence = picture->progressive_sequence;
frame->progressive_frame = picture->progressive_frame;
frame->top_field_first = picture->top_field_first;
frame->repeat_first_field = picture->repeat_first_field;
frame->picture_coding_type = picture->picture_coding_type;
frame = decoder->current_frame;
frame->aspect_ratio = decoder->aspect_ratio_information;
frame->frame_rate_code = decoder->frame_rate_code;
frame->bitrate = decoder->bitrate;
frame->progressive_sequence = decoder->progressive_sequence;
frame->progressive_frame = decoder->progressive_frame;
frame->top_field_first = decoder->top_field_first;
frame->repeat_first_field = decoder->repeat_first_field;
frame->picture_coding_type = decoder->picture_coding_type;
frame->pts = mpeg2dec->pts;
}
}
if (!(mpeg2dec->drop_frame))
mpeg2_slice (picture, code, buffer);
mpeg2_slice (decoder, code, buffer);
}
return is_frame_done;
......@@ -275,10 +275,10 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec)
mpeg2_decode_data (mpeg2dec, finalizer, finalizer+4);
if (! (mpeg2dec->is_sequence_needed))
vo_draw (mpeg2dec->picture->backward_reference_frame);
vo_draw (mpeg2dec->decoder->backward_reference_frame);
free (mpeg2dec->chunk_buffer);
free (mpeg2dec->picture);
free (mpeg2dec->decoder);
}
void mpeg2_drop (mpeg2dec_t * mpeg2dec, int flag)
......
......@@ -69,12 +69,12 @@ uint8_t mpeg2_scan_alt[64] ATTR_ALIGN(16) =
53,61,22,30,7,15,23,31,38,46,54,62,39,47,55,63
};
void mpeg2_header_state_init (picture_t * picture)
void mpeg2_header_state_init (decoder_t * decoder)
{
picture->scan = mpeg2_scan_norm;
decoder->scan = mpeg2_scan_norm;
}
int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer)
int mpeg2_header_sequence (decoder_t * decoder, uint8_t * buffer)
{
int width, height;
int i;
......@@ -90,46 +90,46 @@ int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer)
if ((width > 1920) || (height > 1152))
return 1; /* size restrictions for MP@HL */
picture->coded_picture_width = width;
picture->coded_picture_height = height;
decoder->coded_picture_width = width;
decoder->coded_picture_height = height;
/* this is not used by the decoder */
picture->aspect_ratio_information = buffer[3] >> 4;
picture->frame_rate_code = buffer[3] & 15;
picture->bitrate = (buffer[4]<<10)|(buffer[5]<<2)|(buffer[6]>>6);
decoder->aspect_ratio_information = buffer[3] >> 4;
decoder->frame_rate_code = buffer[3] & 15;
decoder->bitrate = (buffer[4]<<10)|(buffer[5]<<2)|(buffer[6]>>6);
if (buffer[7] & 2) {
for (i = 0; i < 64; i++)
picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
decoder->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
(buffer[i+7] << 7) | (buffer[i+8] >> 1);
buffer += 64;
} else
for (i = 0; i < 64; i++)
picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
decoder->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
default_intra_quantizer_matrix [i];
if (buffer[7] & 1)
for (i = 0; i < 64; i++)
picture->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
decoder->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
buffer[i+8];
else
for (i = 0; i < 64; i++)
picture->non_intra_quantizer_matrix[i] = 16;
decoder->non_intra_quantizer_matrix[i] = 16;
/* MPEG1 - for testing only */
picture->mpeg1 = 1;
picture->intra_dc_precision = 0;
picture->frame_pred_frame_dct = 1;
picture->q_scale_type = 0;
picture->concealment_motion_vectors = 0;
/* picture->alternate_scan = 0; */
picture->picture_structure = FRAME_PICTURE;
/* picture->second_field = 0; */
decoder->mpeg1 = 1;
decoder->intra_dc_precision = 0;
decoder->frame_pred_frame_dct = 1;
decoder->q_scale_type = 0;
decoder->concealment_motion_vectors = 0;
/* decoder->alternate_scan = 0; */
decoder->picture_structure = FRAME_PICTURE;
/* decoder->second_field = 0; */
return 0;
}
static int sequence_extension (picture_t * picture, uint8_t * buffer)
static int sequence_extension (decoder_t * decoder, uint8_t * buffer)
{
/* check chroma format, size extensions, marker bit */
if (((buffer[1] & 0x07) != 0x02) || (buffer[2] & 0xe0) ||
......@@ -137,96 +137,96 @@ static int sequence_extension (picture_t * picture, uint8_t * buffer)
return 1;
/* this is not used by the decoder */
picture->progressive_sequence = (buffer[1] >> 3) & 1;
decoder->progressive_sequence = (buffer[1] >> 3) & 1;
if (!(picture->progressive_sequence))
picture->coded_picture_height =
(picture->coded_picture_height + 31) & ~31;
if (!(decoder->progressive_sequence))
decoder->coded_picture_height =
(decoder->coded_picture_height + 31) & ~31;
/* MPEG1 - for testing only */
picture->mpeg1 = 0;
decoder->mpeg1 = 0;
return 0;
}
static int quant_matrix_extension (picture_t * picture, uint8_t * buffer)
static int quant_matrix_extension (decoder_t * decoder, uint8_t * buffer)
{
int i;
if (buffer[0] & 8) {
for (i = 0; i < 64; i++)
picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
decoder->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
(buffer[i] << 5) | (buffer[i+1] >> 3);
buffer += 64;
}
if (buffer[0] & 4)
for (i = 0; i < 64; i++)
picture->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
decoder->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
(buffer[i] << 6) | (buffer[i+1] >> 2);
return 0;
}
static int picture_coding_extension (picture_t * picture, uint8_t * buffer)
static int picture_coding_extension (decoder_t * decoder, uint8_t * buffer)
{
/* pre subtract 1 for use later in compute_motion_vector */
picture->f_motion.f_code[0] = (buffer[0] & 15) - 1;
picture->f_motion.f_code[1] = (buffer[1] >> 4) - 1;
picture->b_motion.f_code[0] = (buffer[1] & 15) - 1;
picture->b_motion.f_code[1] = (buffer[2] >> 4) - 1;
picture->intra_dc_precision = (buffer[2] >> 2) & 3;
picture->picture_structure = buffer[2] & 3;
picture->frame_pred_frame_dct = (buffer[3] >> 6) & 1;
picture->concealment_motion_vectors = (buffer[3] >> 5) & 1;
picture->q_scale_type = (buffer[3] >> 4) & 1;
picture->intra_vlc_format = (buffer[3] >> 3) & 1;
decoder->f_motion.f_code[0] = (buffer[0] & 15) - 1;
decoder->f_motion.f_code[1] = (buffer[1] >> 4) - 1;
decoder->b_motion.f_code[0] = (buffer[1] & 15) - 1;
decoder->b_motion.f_code[1] = (buffer[2] >> 4) - 1;
decoder->intra_dc_precision = (buffer[2] >> 2) & 3;
decoder->picture_structure = buffer[2] & 3;
decoder->frame_pred_frame_dct = (buffer[3] >> 6) & 1;
decoder->concealment_motion_vectors = (buffer[3] >> 5) & 1;
decoder->q_scale_type = (buffer[3] >> 4) & 1;
decoder->intra_vlc_format = (buffer[3] >> 3) & 1;
if (buffer[3] & 4) /* alternate_scan */
picture->scan = mpeg2_scan_alt;
decoder->scan = mpeg2_scan_alt;
else
picture->scan = mpeg2_scan_norm;
decoder->scan = mpeg2_scan_norm;
/* these are not used by the decoder */
picture->top_field_first = buffer[3] >> 7;
picture->repeat_first_field = (buffer[3] >> 1) & 1;
picture->progressive_frame = buffer[4] >> 7;
decoder->top_field_first = buffer[3] >> 7;
decoder->repeat_first_field = (buffer[3] >> 1) & 1;
decoder->progressive_frame = buffer[4] >> 7;
return 0;
}
int mpeg2_header_extension (picture_t * picture, uint8_t * buffer)
int mpeg2_header_extension (decoder_t * decoder, uint8_t * buffer)
{
switch (buffer[0] & 0xf0) {
case 0x10: /* sequence extension */
return sequence_extension (picture, buffer);
return sequence_extension (decoder, buffer);
case 0x30: /* quant matrix extension */
return quant_matrix_extension (picture, buffer);
return quant_matrix_extension (decoder, buffer);
case 0x80: /* picture coding extension */
return picture_coding_extension (picture, buffer);
return picture_coding_extension (decoder, buffer);
}
return 0;
}
int mpeg2_header_picture (picture_t * picture, uint8_t * buffer)
int mpeg2_header_picture (decoder_t * decoder, uint8_t * buffer)
{
picture->picture_coding_type = (buffer [1] >> 3) & 7;
decoder->picture_coding_type = (buffer [1] >> 3) & 7;
/* forward_f_code and backward_f_code - used in mpeg1 only */
picture->f_motion.f_code[1] = (buffer[3] >> 2) & 1;
picture->f_motion.f_code[0] =
decoder->f_motion.f_code[1] = (buffer[3] >> 2) & 1;
decoder->f_motion.f_code[0] =
(((buffer[3] << 1) | (buffer[4] >> 7)) & 7) - 1;
picture->b_motion.f_code[1] = (buffer[4] >> 6) & 1;
picture->b_motion.f_code[0] = ((buffer[4] >> 3) & 7) - 1;
decoder->b_motion.f_code[1] = (buffer[4] >> 6) & 1;
decoder->b_motion.f_code[0] = ((buffer[4] >> 3) & 7) - 1;
/* move in header_process_picture_header */
picture->second_field =
(picture->picture_structure != FRAME_PICTURE) &&
!(picture->second_field);
decoder->second_field =
(decoder->picture_structure != FRAME_PICTURE) &&
!(decoder->second_field);
return 0;
}
......@@ -100,7 +100,7 @@ static void inline idct_row (int16_t * block)
x8 = W3 * (x6 + x7);
x6 = x8 - (W3 - W5) * x6;
x7 = x8 - (W3 + W5) * x7;
/* second stage */
x8 = x0 + x1;
x0 -= x1;
......@@ -111,7 +111,7 @@ static void inline idct_row (int16_t * block)
x4 -= x6;
x6 = x5 + x7;
x5 -= x7;
/* third stage */
x7 = x8 + x3;
x8 -= x3;
......@@ -119,7 +119,7 @@ static void inline idct_row (int16_t * block)
x0 -= x2;
x2 = (181 * (x4 + x5) + 128) >> 8;
x4 = (181 * (x4 - x5) + 128) >> 8;
/* fourth stage */
block[0] = (x7 + x1) >> 8;
block[1] = (x3 + x2) >> 8;
......@@ -171,7 +171,7 @@ static void inline idct_col (int16_t *block)
x8 = W3 * (x6 + x7) + 4;
x6 = (x8 - (W3 - W5) * x6) >> 3;
x7 = (x8 - (W3 + W5) * x7) >> 3;
/* second stage */
x8 = x0 + x1;
x0 -= x1;
......@@ -182,7 +182,7 @@ static void inline idct_col (int16_t *block)
x4 -= x6;
x6 = x5 + x7;
x5 -= x7;
/* third stage */
x7 = x8 + x3;
x8 -= x3;
......@@ -190,7 +190,7 @@ static void inline idct_col (int16_t *block)
x0 -= x2;
x2 = (181 * (x4 + x5) + 128) >> 8;
x4 = (181 * (x4 - x5) + 128) >> 8;
/* fourth stage */
block[8*0] = (x7 + x1) >> 14;
block[8*1] = (x3 + x2) >> 14;
......
......@@ -35,7 +35,7 @@
static void MC_put_o_16_mlib (uint8_t * dest, uint8_t * ref,
int stride, int height)
{
if (height == 16)
if (height == 16)
mlib_VideoCopyRef_U8_U8_16x16 (dest, ref, stride);
else
mlib_VideoCopyRef_U8_U8_16x8 (dest, ref, stride);
......@@ -98,7 +98,7 @@ static void MC_put_y_8_mlib (uint8_t * dest, uint8_t * ref,
static void MC_put_xy_8_mlib (uint8_t * dest, uint8_t * ref,
int stride, int height)
{
if (height == 8)
if (height == 8)
mlib_VideoInterpXY_U8_U8_8x8 (dest, ref, stride, stride);
else
mlib_VideoInterpXY_U8_U8_8x4 (dest, ref, stride, stride);
......
......@@ -47,14 +47,14 @@
#define B_TYPE 3
#define D_TYPE 4
typedef struct motion_s {
typedef struct {
uint8_t * ref[2][3];
uint8_t ** ref2[2];
int pmv[2][2];
int f_code[2];
} motion_t;
typedef struct picture_s {
typedef struct decoder_s {
/* first, state that carries information from one macroblock to the */
/* next inside a slice, and is never used outside of mpeg2_slice() */
......@@ -103,9 +103,9 @@ typedef struct picture_s {
/* what type of picture this is (I, P, B, D) */
int picture_coding_type;
/* picture coding extension stuff */
/* quantization factor for intra dc coefficients */
int intra_dc_precision;
/* top/bottom/both fields */
......@@ -143,9 +143,9 @@ typedef struct picture_s {
int repeat_first_field;
int progressive_frame;
int bitrate;
} picture_t;
} decoder_t;
typedef struct cpu_state_s {
typedef struct {
#ifdef ARCH_PPC
uint8_t regv[12*16];
#endif
......@@ -156,10 +156,10 @@ typedef struct cpu_state_s {
void mpeg2_cpu_state_init (uint32_t mm_accel);
/* header.c */
void mpeg2_header_state_init (picture_t * picture);
int mpeg2_header_picture (picture_t * picture, uint8_t * buffer);
int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer);
int mpeg2_header_extension (picture_t * picture, uint8_t * buffer);
void mpeg2_header_state_init (decoder_t * decoder);
int mpeg2_header_picture (decoder_t * decoder, uint8_t * buffer);
int mpeg2_header_sequence (decoder_t * decoder, uint8_t * buffer);
int mpeg2_header_extension (decoder_t * decoder, uint8_t * buffer);
/* idct.c */
void mpeg2_idct_init (uint32_t mm_accel);
......@@ -186,7 +186,7 @@ void mpeg2_idct_altivec_init (void);
/* motion_comp.c */
void mpeg2_mc_init (uint32_t mm_accel);
typedef struct mpeg2_mc_s {
typedef struct {
void (* put [8]) (uint8_t * dst, uint8_t *, int32_t, int32_t);
void (* avg [8]) (uint8_t * dst, uint8_t *, int32_t, int32_t);
} mpeg2_mc_t;
......@@ -206,7 +206,7 @@ extern mpeg2_mc_t mpeg2_mc_altivec;
extern mpeg2_mc_t mpeg2_mc_mlib;
/* slice.c */
void mpeg2_slice (picture_t * picture, int code, uint8_t * buffer);
void mpeg2_slice (decoder_t * decoder, int code, uint8_t * buffer);
/* stats.c */
void mpeg2_stats (int code, uint8_t * buffer);
This diff is collapsed.
......@@ -36,7 +36,7 @@ static int debug_level = -1;
static int debug_is_on (void)
{
char * env_var;
if (debug_level < 0) {
env_var = getenv ("MPEG2_DEBUG");
......@@ -45,7 +45,7 @@ static int debug_is_on (void)
else
debug_level = 0;
}
return debug_level;
}
......@@ -244,7 +244,7 @@ static void stats_picture_coding_extension (uint8_t * buffer)
" (pic_ext) forward horizontal f_code % d, forward vertical f_code % d\n",
f_code[0][0], f_code[0][1]);
fprintf (stderr,
" (pic_ext) backward horizontal f_code % d, backward vertical f_code % d\n",
" (pic_ext) backward horizontal f_code % d, backward vertical f_code % d\n",
f_code[1][0], f_code[1][1]);
fprintf (stderr,
" (pic_ext) intra_dc_precision %d, top_field_first %d, frame_pred_frame_dct %d\n",
......
......@@ -27,12 +27,12 @@ do { \
bit_ptr += 2; \
} while (0)
static inline void bitstream_init (picture_t * picture, uint8_t * start)
static inline void bitstream_init (decoder_t * decoder, uint8_t * start)
{
picture->bitstream_buf =
decoder->bitstream_buf =
(start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3];
picture->bitstream_ptr = start + 4;
picture->bitstream_bits = -16;
decoder->bitstream_ptr = start + 4;
decoder->bitstream_bits = -16;
}
/* make sure that there are at least 16 valid bits in bit_buf */
......
......@@ -24,20 +24,19 @@
#ifndef __LINUX_HW_BES_H
#define __LINUX_HW_BES_H
typedef struct mga_vid_config_s
{
uint32_t card_type;
uint32_t ram_size;
uint32_t src_width;
uint32_t src_height;
uint32_t dest_width;
uint32_t dest_height;
uint32_t x_org;
uint32_t y_org;
uint8_t colkey_on;
uint8_t colkey_red;
uint8_t colkey_green;
uint8_t colkey_blue;
typedef struct {
uint32_t card_type;
uint32_t ram_size;
uint32_t src_width;
uint32_t src_height;
uint32_t dest_width;
uint32_t dest_height;
uint32_t x_org;
uint32_t y_org;
uint8_t colkey_on;
uint8_t colkey_red;
uint8_t colkey_green;
uint8_t colkey_blue;
} mga_vid_config_t;
#define MGA_VID_CONFIG _IOR('J', 1, mga_vid_config_t)
......
......@@ -86,7 +86,7 @@ vo_driver_t * vo_drivers (void)
return video_out_drivers;
}
typedef struct common_instance_s {
typedef struct {
vo_instance_t vo;
int prediction_index;
vo_frame_t * frame_ptr[3];
......
......@@ -117,7 +117,7 @@ static void yuv2g400_c (uint8_t * dst, uint8_t * py,
} while (--i);
}
typedef struct mga_instance_s {
typedef struct {
vo_instance_t vo;
int prediction_index;
vo_frame_t * frame_ptr[3];
......@@ -148,7 +148,7 @@ static void mga_draw_frame (vo_frame_t * frame)
ioctl (instance->fd, MGA_VID_FSEL, &instance->next_frame);
instance->next_frame ^= 2; /* switch between fields A1 and B1 */
if (instance->next_frame)
if (instance->next_frame)
instance->vid_data = instance->frame1;
else
instance->vid_data = instance->frame0;
......
/*
/*
* video_out_null.c
* Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
......@@ -29,14 +29,14 @@
#include "video_out.h"
#include "video_out_internal.h"
typedef struct null_frame_s {
typedef struct {
vo_frame_t vo;
uint8_t * rgb_ptr;
int rgb_stride;
int yuv_stride;
} null_frame_t;
typedef struct null_instance_s {
typedef struct {
vo_instance_t vo;
int prediction_index;