1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 23:02:37 +00:00

cleanup: remove XvMC remains, reformat img_format.c

Remove remaining references to XvMC. It was already not supported;
remove references to the imgfmt too. Reformat img_format.c.
This commit is contained in:
Uoti Urpala 2012-08-22 15:54:56 +03:00 committed by wm4
parent da374c40de
commit d5aa8dc88f
5 changed files with 33 additions and 46 deletions

View File

@ -202,9 +202,6 @@ static const struct {
{"MPES", IMGFMT_MPEGPES}, {"MPES", IMGFMT_MPEGPES},
{"IDCT_MPEG2",IMGFMT_XVMC_IDCT_MPEG2},
{"MOCO_MPEG2",IMGFMT_XVMC_MOCO_MPEG2},
{"VDPAU_MPEG1",IMGFMT_VDPAU_MPEG1}, {"VDPAU_MPEG1",IMGFMT_VDPAU_MPEG1},
{"VDPAU_MPEG2",IMGFMT_VDPAU_MPEG2}, {"VDPAU_MPEG2",IMGFMT_VDPAU_MPEG2},
{"VDPAU_H264",IMGFMT_VDPAU_H264}, {"VDPAU_H264",IMGFMT_VDPAU_H264},

View File

@ -101,8 +101,6 @@ static const struct {
{IMGFMT_444P, PIX_FMT_YUVJ444P}, {IMGFMT_444P, PIX_FMT_YUVJ444P},
{IMGFMT_440P, PIX_FMT_YUVJ440P}, {IMGFMT_440P, PIX_FMT_YUVJ440P},
{IMGFMT_XVMC_MOCO_MPEG2, PIX_FMT_XVMC_MPEG2_MC},
{IMGFMT_XVMC_IDCT_MPEG2, PIX_FMT_XVMC_MPEG2_IDCT},
{IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1}, {IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1},
{IMGFMT_VDPAU_MPEG2, PIX_FMT_VDPAU_MPEG2}, {IMGFMT_VDPAU_MPEG2, PIX_FMT_VDPAU_MPEG2},
{IMGFMT_VDPAU_H264, PIX_FMT_VDPAU_H264}, {IMGFMT_VDPAU_H264, PIX_FMT_VDPAU_H264},

View File

@ -107,8 +107,6 @@ const char *vo_format_name(int format)
case IMGFMT_YUVP: return "Packed YUVP"; case IMGFMT_YUVP: return "Packed YUVP";
case IMGFMT_UYVP: return "Packed UYVP"; case IMGFMT_UYVP: return "Packed UYVP";
case IMGFMT_MPEGPES: return "Mpeg PES"; case IMGFMT_MPEGPES: return "Mpeg PES";
case IMGFMT_XVMC_MOCO_MPEG2: return "MPEG1/2 Motion Compensation";
case IMGFMT_XVMC_IDCT_MPEG2: return "MPEG1/2 Motion Compensation and IDCT";
case IMGFMT_VDPAU_MPEG1: return "MPEG1 VDPAU acceleration"; case IMGFMT_VDPAU_MPEG1: return "MPEG1 VDPAU acceleration";
case IMGFMT_VDPAU_MPEG2: return "MPEG2 VDPAU acceleration"; case IMGFMT_VDPAU_MPEG2: return "MPEG2 VDPAU acceleration";
case IMGFMT_VDPAU_H264: return "H.264 VDPAU acceleration"; case IMGFMT_VDPAU_H264: return "H.264 VDPAU acceleration";
@ -120,7 +118,8 @@ const char *vo_format_name(int format)
return unknown_format; return unknown_format;
} }
int mp_get_chroma_shift(int format, int *x_shift, int *y_shift, int *component_bits) int mp_get_chroma_shift(int format, int *x_shift, int *y_shift,
int *component_bits)
{ {
int xs = 0, ys = 0; int xs = 0, ys = 0;
int bpp; int bpp;
@ -170,7 +169,8 @@ int mp_get_chroma_shift(int format, int *x_shift, int *y_shift, int *component_b
err = 1; err = 1;
break; break;
} }
} else switch (format) { } else
switch (format) {
case IMGFMT_420A: case IMGFMT_420A:
case IMGFMT_I420: case IMGFMT_I420:
case IMGFMT_IYUV: case IMGFMT_IYUV:
@ -192,9 +192,12 @@ int mp_get_chroma_shift(int format, int *x_shift, int *y_shift, int *component_b
err = 1; err = 1;
break; break;
} }
if (x_shift) *x_shift = xs; if (x_shift)
if (y_shift) *y_shift = ys; *x_shift = xs;
if (component_bits) *component_bits = bits; if (y_shift)
*y_shift = ys;
if (component_bits)
*component_bits = bits;
bpp = 8 + ((16 >> xs) >> ys); bpp = 8 + ((16 >> xs) >> ys);
if (format == IMGFMT_420A) if (format == IMGFMT_420A)
bpp += 8; bpp += 8;

View File

@ -198,14 +198,6 @@
#define IMGFMT_MPEGPES (('M'<<24)|('P'<<16)|('E'<<8)|('S')) #define IMGFMT_MPEGPES (('M'<<24)|('P'<<16)|('E'<<8)|('S'))
#define IMGFMT_MJPEG (('M')|('J'<<8)|('P'<<16)|('G'<<24)) #define IMGFMT_MJPEG (('M')|('J'<<8)|('P'<<16)|('G'<<24))
// I think that this code could not be used by any other codec/format
#define IMGFMT_XVMC 0x1DC70000
#define IMGFMT_XVMC_MASK 0xFFFF0000
#define IMGFMT_IS_XVMC(fmt) (((fmt)&IMGFMT_XVMC_MASK)==IMGFMT_XVMC)
//these are chroma420
#define IMGFMT_XVMC_MOCO_MPEG2 (IMGFMT_XVMC|0x02)
#define IMGFMT_XVMC_IDCT_MPEG2 (IMGFMT_XVMC|0x82)
// VDPAU specific format. // VDPAU specific format.
#define IMGFMT_VDPAU 0x1DC80000 #define IMGFMT_VDPAU 0x1DC80000
#define IMGFMT_VDPAU_MASK 0xFFFF0000 #define IMGFMT_VDPAU_MASK 0xFFFF0000
@ -217,7 +209,7 @@
#define IMGFMT_VDPAU_VC1 (IMGFMT_VDPAU|0x05) #define IMGFMT_VDPAU_VC1 (IMGFMT_VDPAU|0x05)
#define IMGFMT_VDPAU_MPEG4 (IMGFMT_VDPAU|0x06) #define IMGFMT_VDPAU_MPEG4 (IMGFMT_VDPAU|0x06)
#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VDPAU(fmt) || IMGFMT_IS_XVMC(fmt)) #define IMGFMT_IS_HWACCEL(fmt) IMGFMT_IS_VDPAU(fmt)
typedef struct { typedef struct {
void* data; void* data;

View File

@ -194,9 +194,6 @@ static int init(sh_video_t *sh)
avctx->release_buffer = release_buffer; avctx->release_buffer = release_buffer;
avctx->reget_buffer = get_buffer; avctx->reget_buffer = get_buffer;
avctx->draw_horiz_band = draw_slice; avctx->draw_horiz_band = draw_slice;
if (lavc_codec->capabilities & CODEC_CAP_HWACCEL)
mp_msg(MSGT_DECVIDEO, MSGL_V, "[VD_FFMPEG] XVMC-accelerated "
"MPEG-2.\n");
if (lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) if (lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
mp_msg(MSGT_DECVIDEO, MSGL_V, "[VD_FFMPEG] VDPAU hardware " mp_msg(MSGT_DECVIDEO, MSGL_V, "[VD_FFMPEG] VDPAU hardware "
"decoding.\n"); "decoding.\n");