qsv: remove CONFIG_VAAPI for mutiple formats

Remove CONFIG_VAAPI for VUYX, YUYV422, Y210, XV30, Y212, XV36.

Make 8-bit, 10-bit, 12-bit YUV 4:2:2 video sources as well as YUV 4:4:4
video sources supported by d3d11va and dxva2 just like what VAAPI does.

Sign-off-by: Tong Wu <tong1.wu@intel.com>
pull/389/head
Tong Wu 2 years ago committed by Haihao Xiang
parent 417eb7d50e
commit d5cc7acff1
  1. 4
      libavcodec/qsv.c
  2. 6
      libavutil/hwcontext_qsv.c

@ -208,7 +208,6 @@ enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
case MFX_FOURCC_P8: return AV_PIX_FMT_PAL8; case MFX_FOURCC_P8: return AV_PIX_FMT_PAL8;
case MFX_FOURCC_A2RGB10: return AV_PIX_FMT_X2RGB10; case MFX_FOURCC_A2RGB10: return AV_PIX_FMT_X2RGB10;
case MFX_FOURCC_RGB4: return AV_PIX_FMT_BGRA; case MFX_FOURCC_RGB4: return AV_PIX_FMT_BGRA;
#if CONFIG_VAAPI
case MFX_FOURCC_YUY2: return AV_PIX_FMT_YUYV422; case MFX_FOURCC_YUY2: return AV_PIX_FMT_YUYV422;
case MFX_FOURCC_Y210: return AV_PIX_FMT_Y210; case MFX_FOURCC_Y210: return AV_PIX_FMT_Y210;
case MFX_FOURCC_AYUV: return AV_PIX_FMT_VUYX; case MFX_FOURCC_AYUV: return AV_PIX_FMT_VUYX;
@ -217,7 +216,6 @@ enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
case MFX_FOURCC_P016: return AV_PIX_FMT_P012; case MFX_FOURCC_P016: return AV_PIX_FMT_P012;
case MFX_FOURCC_Y216: return AV_PIX_FMT_Y212; case MFX_FOURCC_Y216: return AV_PIX_FMT_Y212;
case MFX_FOURCC_Y416: return AV_PIX_FMT_XV36; case MFX_FOURCC_Y416: return AV_PIX_FMT_XV36;
#endif
#endif #endif
} }
return AV_PIX_FMT_NONE; return AV_PIX_FMT_NONE;
@ -245,7 +243,6 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shi
*fourcc = MFX_FOURCC_RGB4; *fourcc = MFX_FOURCC_RGB4;
*shift = 0; *shift = 0;
return AV_PIX_FMT_BGRA; return AV_PIX_FMT_BGRA;
#if CONFIG_VAAPI
case AV_PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUYV422: case AV_PIX_FMT_YUYV422:
*fourcc = MFX_FOURCC_YUY2; *fourcc = MFX_FOURCC_YUY2;
@ -277,7 +274,6 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shi
*fourcc = MFX_FOURCC_Y416; *fourcc = MFX_FOURCC_Y416;
*shift = 1; *shift = 1;
return AV_PIX_FMT_XV36; return AV_PIX_FMT_XV36;
#endif
#endif #endif
default: default:
return AVERROR(ENOSYS); return AVERROR(ENOSYS);

@ -115,11 +115,12 @@ static const struct {
{ AV_PIX_FMT_BGRA, MFX_FOURCC_RGB4, 0 }, { AV_PIX_FMT_BGRA, MFX_FOURCC_RGB4, 0 },
{ AV_PIX_FMT_P010, MFX_FOURCC_P010, 1 }, { AV_PIX_FMT_P010, MFX_FOURCC_P010, 1 },
{ AV_PIX_FMT_PAL8, MFX_FOURCC_P8, 0 }, { AV_PIX_FMT_PAL8, MFX_FOURCC_P8, 0 },
#if CONFIG_VAAPI
{ AV_PIX_FMT_YUYV422, { AV_PIX_FMT_YUYV422,
MFX_FOURCC_YUY2, 0 }, MFX_FOURCC_YUY2, 0 },
#if CONFIG_VAAPI
{ AV_PIX_FMT_UYVY422, { AV_PIX_FMT_UYVY422,
MFX_FOURCC_UYVY, 0 }, MFX_FOURCC_UYVY, 0 },
#endif
{ AV_PIX_FMT_Y210, { AV_PIX_FMT_Y210,
MFX_FOURCC_Y210, 1 }, MFX_FOURCC_Y210, 1 },
// VUYX is used for VAAPI child device, // VUYX is used for VAAPI child device,
@ -144,7 +145,6 @@ static const struct {
{ AV_PIX_FMT_XV36, { AV_PIX_FMT_XV36,
MFX_FOURCC_Y416, 1 }, MFX_FOURCC_Y416, 1 },
#endif #endif
#endif
}; };
extern int ff_qsv_get_surface_base_handle(mfxFrameSurface1 *surf, extern int ff_qsv_get_surface_base_handle(mfxFrameSurface1 *surf,
@ -1526,7 +1526,6 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
surface->Data.R = frame->data[0] + 2; surface->Data.R = frame->data[0] + 2;
surface->Data.A = frame->data[0] + 3; surface->Data.A = frame->data[0] + 3;
break; break;
#if CONFIG_VAAPI
case AV_PIX_FMT_YUYV422: case AV_PIX_FMT_YUYV422:
surface->Data.Y = frame->data[0]; surface->Data.Y = frame->data[0];
surface->Data.U = frame->data[0] + 1; surface->Data.U = frame->data[0] + 1;
@ -1558,6 +1557,7 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
// use the value from the frame. // use the value from the frame.
surface->Data.A = frame->data[0] + 6; surface->Data.A = frame->data[0] + 6;
break; break;
#if CONFIG_VAAPI
case AV_PIX_FMT_UYVY422: case AV_PIX_FMT_UYVY422:
surface->Data.Y = frame->data[0] + 1; surface->Data.Y = frame->data[0] + 1;
surface->Data.U = frame->data[0]; surface->Data.U = frame->data[0];

Loading…
Cancel
Save