mirror of https://github.com/mpv-player/mpv
video: get rid of swapped packed YUV
Another legacy annoyance. The only place where packed YUV is still important is slightly older Apple hardware or drivers, which require it for efficient hardware decoding.
This commit is contained in:
parent
6eb0bbe312
commit
1ad036a2ef
|
@ -33,7 +33,6 @@ static const struct {
|
|||
{IMGFMT_ABGR, AV_PIX_FMT_ABGR},
|
||||
{IMGFMT_RGBA, AV_PIX_FMT_RGBA},
|
||||
{IMGFMT_RGB24, AV_PIX_FMT_RGB24},
|
||||
{IMGFMT_YUYV, AV_PIX_FMT_YUYV422},
|
||||
{IMGFMT_UYVY, AV_PIX_FMT_UYVY422},
|
||||
{IMGFMT_NV12, AV_PIX_FMT_NV12},
|
||||
{IMGFMT_Y8, AV_PIX_FMT_GRAY8},
|
||||
|
|
|
@ -152,7 +152,6 @@ enum mp_imgfmt {
|
|||
IMGFMT_YA8,
|
||||
|
||||
// Packed YUV formats (components are byte-accessed)
|
||||
IMGFMT_YUYV, // Y0 U Y1 V
|
||||
IMGFMT_UYVY, // U Y0 V Y1
|
||||
|
||||
// Y plane + packed plane for chroma
|
||||
|
|
|
@ -461,9 +461,7 @@ void mp_image_clear(struct mp_image *img, int x0, int y0, int x1, int y1)
|
|||
|
||||
uint32_t plane_clear[MP_MAX_PLANES] = {0};
|
||||
|
||||
if (area.imgfmt == IMGFMT_YUYV) {
|
||||
plane_clear[0] = av_le2ne16(0x8000);
|
||||
} else if (area.imgfmt == IMGFMT_UYVY) {
|
||||
if (area.imgfmt == IMGFMT_UYVY) {
|
||||
plane_clear[0] = av_le2ne16(0x0080);
|
||||
} else if (area.fmt.flags & MP_IMGFLAG_YUV_NV) {
|
||||
plane_clear[1] = 0x8080;
|
||||
|
|
|
@ -90,8 +90,6 @@ static const struct gl_format gl_formats[] = {
|
|||
GL_UNSIGNED_SHORT_5_6_5, F_TF | F_GL2 | F_GL3},
|
||||
{GL_RGB, GL_RGB_422_APPLE,
|
||||
GL_UNSIGNED_SHORT_8_8_APPLE, F_TF | F_APPL},
|
||||
{GL_RGB, GL_RGB_422_APPLE,
|
||||
GL_UNSIGNED_SHORT_8_8_REV_APPLE, F_TF | F_APPL},
|
||||
|
||||
{0}
|
||||
};
|
||||
|
@ -324,11 +322,9 @@ bool gl_get_imgfmt_desc(GL *gl, int imgfmt, struct gl_imgfmt_desc *out)
|
|||
res.chroma_w = res.chroma_h = 1;
|
||||
goto supported;
|
||||
}
|
||||
if (imgfmt == IMGFMT_UYVY || imgfmt == IMGFMT_YUYV) {
|
||||
if (imgfmt == IMGFMT_UYVY) {
|
||||
res.num_planes = 1;
|
||||
res.planes[0] = gl_find_gl_type_format(gl, imgfmt == IMGFMT_UYVY
|
||||
? GL_UNSIGNED_SHORT_8_8_APPLE
|
||||
: GL_UNSIGNED_SHORT_8_8_REV_APPLE);
|
||||
res.planes[0] = gl_find_gl_type_format(gl, GL_UNSIGNED_SHORT_8_8_APPLE);
|
||||
if (!res.planes[0])
|
||||
return false;
|
||||
res.components[0][0] = 3;
|
||||
|
|
|
@ -207,7 +207,6 @@ static const struct fmt_entry fmt_table[] = {
|
|||
{IMGFMT_420P, MAKEFOURCC('I','Y','U','V')},
|
||||
{IMGFMT_NV12, MAKEFOURCC('N','V','1','2')},
|
||||
// packed YUV
|
||||
{IMGFMT_YUYV, D3DFMT_YUY2},
|
||||
{IMGFMT_UYVY, D3DFMT_UYVY},
|
||||
// packed RGB
|
||||
{IMGFMT_BGR32, D3DFMT_X8R8G8B8},
|
||||
|
|
|
@ -54,7 +54,6 @@ struct formatmap_entry {
|
|||
const struct formatmap_entry formats[] = {
|
||||
{SDL_PIXELFORMAT_YV12, IMGFMT_420P, 0},
|
||||
{SDL_PIXELFORMAT_IYUV, IMGFMT_420P, 0},
|
||||
{SDL_PIXELFORMAT_YUY2, IMGFMT_YUYV, 0},
|
||||
{SDL_PIXELFORMAT_UYVY, IMGFMT_UYVY, 0},
|
||||
//{SDL_PIXELFORMAT_YVYU, IMGFMT_YVYU, 0},
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
|
|
|
@ -104,7 +104,6 @@ struct xvctx {
|
|||
#define MP_FOURCC_I420 MP_FOURCC('I', '4', '2', '0')
|
||||
#define MP_FOURCC_IYUV MP_FOURCC('I', 'Y', 'U', 'V')
|
||||
#define MP_FOURCC_UYVY MP_FOURCC('U', 'Y', 'V', 'Y')
|
||||
#define MP_FOURCC_YUY2 MP_FOURCC('Y', 'U', 'Y', '2')
|
||||
|
||||
struct fmt_entry {
|
||||
int imgfmt;
|
||||
|
@ -113,7 +112,6 @@ struct fmt_entry {
|
|||
static const struct fmt_entry fmt_table[] = {
|
||||
{IMGFMT_420P, MP_FOURCC_YV12},
|
||||
{IMGFMT_420P, MP_FOURCC_I420},
|
||||
{IMGFMT_YUYV, MP_FOURCC_YUY2},
|
||||
{IMGFMT_UYVY, MP_FOURCC_UYVY},
|
||||
{0}
|
||||
};
|
||||
|
|
|
@ -59,7 +59,6 @@ static const struct fmtentry va_to_imgfmt[] = {
|
|||
{VA_FOURCC_YV12, IMGFMT_420P},
|
||||
{VA_FOURCC_IYUV, IMGFMT_420P},
|
||||
{VA_FOURCC_UYVY, IMGFMT_UYVY},
|
||||
{VA_FOURCC_YUY2, IMGFMT_YUYV},
|
||||
// Note: not sure about endian issues (the mp formats are byte-addressed)
|
||||
{VA_FOURCC_RGBA, IMGFMT_RGBA},
|
||||
{VA_FOURCC_RGBX, IMGFMT_RGBA},
|
||||
|
|
|
@ -527,10 +527,6 @@ bool mp_vdpau_get_format(int imgfmt, VdpChromaType *out_chroma_type,
|
|||
case IMGFMT_NV12:
|
||||
ycbcr = VDP_YCBCR_FORMAT_NV12;
|
||||
break;
|
||||
case IMGFMT_YUYV:
|
||||
ycbcr = VDP_YCBCR_FORMAT_YUYV;
|
||||
chroma = VDP_CHROMA_TYPE_422;
|
||||
break;
|
||||
case IMGFMT_UYVY:
|
||||
ycbcr = VDP_YCBCR_FORMAT_UYVY;
|
||||
chroma = VDP_CHROMA_TYPE_422;
|
||||
|
|
Loading…
Reference in New Issue