void decode_init() { int i; // decoding uint32_t accel = 0; vo_driver_t *drivers; drivers = vo_drivers(); for (i = 0; drivers[i].name; i++) if (!strcmp(drivers[i].name, "xv")) output_open = drivers[i].open; if (!output_open) { fprintf(stderr, "%s", _("can't find 'xv' output\n")); exit(1); } accel = (mm_accel() | MM_ACCEL_MLIB); vo_accel(accel); output = vo_open(output_open); if (!output) { fprintf(stderr, "%s", _("can't open 'xv' output\n")); exit(1); } mpeg2_init(&mpeg2dec, accel, output); }
static void deinterlace_frame_di_tomsmocomp( uint8_t *output, int outstride, deinterlace_frame_data_t *data, int bottom_field, int second_field, int width, int height ) { TDeinterlaceInfo Info; TPicture Picture[ 8 ]; int stride = (width*2); int i; Info.FieldHeight = height / 2; Info.FrameHeight = height; Info.FrameWidth = width; Info.InputPitch = stride*2; Info.LineLength = stride; Info.OverlayPitch = outstride; Info.pMemcpy = fast_memcpy; if( bottom_field ) { Picture[ 0 ].pData = data->f0 + stride; Picture[ 0 ].Flags = PICTURE_INTERLACED_ODD; Picture[ 1 ].pData = data->f0; Picture[ 1 ].Flags = PICTURE_INTERLACED_EVEN; Picture[ 2 ].pData = data->f1 + stride; Picture[ 2 ].Flags = PICTURE_INTERLACED_ODD; Picture[ 3 ].pData = data->f1; Picture[ 3 ].Flags = PICTURE_INTERLACED_EVEN; Picture[ 4 ].pData = data->f2 + stride; Picture[ 4 ].Flags = PICTURE_INTERLACED_ODD; Picture[ 5 ].pData = data->f2; Picture[ 5 ].Flags = PICTURE_INTERLACED_EVEN; } else { Picture[ 0 ].pData = data->f0; Picture[ 0 ].Flags = PICTURE_INTERLACED_EVEN; Picture[ 1 ].pData = data->f1 + stride; Picture[ 1 ].Flags = PICTURE_INTERLACED_ODD; Picture[ 2 ].pData = data->f1; Picture[ 2 ].Flags = PICTURE_INTERLACED_EVEN; Picture[ 3 ].pData = data->f2 + stride; Picture[ 3 ].Flags = PICTURE_INTERLACED_ODD; Picture[ 4 ].pData = data->f2; Picture[ 4 ].Flags = PICTURE_INTERLACED_EVEN; } Info.Overlay = output; for( i = 0; i < MAX_PICTURE_HISTORY; i++ ) { Info.PictureHistory[ i ] = &(Picture[ i ]); } if( mm_accel() & MM_ACCEL_X86_MMXEXT ) { tomsmocomp_filter_sse( &Info ); } else if( mm_accel() & MM_ACCEL_X86_3DNOW ) { tomsmocomp_filter_3dnow( &Info ); } else { tomsmocomp_filter_mmx( &Info ); } }