summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_vdpau.c
diff options
context:
space:
mode:
authorManojGuptaBonda <mbonda@nvidia.com>2020-06-27 19:04:22 +0530
committerPhilip Langdale <philipl@overt.org>2020-07-09 20:54:11 -0700
commited5ee047222056c76e3a9b0671c3ab93c9b992a5 (patch)
tree144c0b44443ee8ff7ffaadd9cc60f451ba8662b5 /libavutil/hwcontext_vdpau.c
parent3c821c4ad3a11e974294613b3f4873028c6f2bc3 (diff)
downloadffmpeg-ed5ee047222056c76e3a9b0671c3ab93c9b992a5.tar.gz
avcodec/hevcdec: Add VDPAU to list of supported formats
Added VDPAU to list of supported formats for HEVC10 and 12 bit formats also added 42010 bit to surface_parameters and new VDP chroma formats to VDPAUPixFmtMaps Add HEVC 420 10/12 Bit and 444 10/12 Bit support for VDPAU YUV444P10 is defined as the 444 surface with 10bit valid data in LSBs but H/w returns Data in MSBs Hence if we map output as YUV444p16 it is filtering out the LSB to convert to p10 format. Signed-off-by: Philip Langdale <philipl@overt.org>
Diffstat (limited to 'libavutil/hwcontext_vdpau.c')
-rw-r--r--libavutil/hwcontext_vdpau.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/libavutil/hwcontext_vdpau.c b/libavutil/hwcontext_vdpau.c
index 6b8c1d5f76..dbef5495af 100644
--- a/libavutil/hwcontext_vdpau.c
+++ b/libavutil/hwcontext_vdpau.c
@@ -39,8 +39,8 @@ typedef struct VDPAUDeviceContext {
VdpVideoSurfaceCreate *surf_create;
VdpVideoSurfaceDestroy *surf_destroy;
- enum AVPixelFormat *pix_fmts[3];
- int nb_pix_fmts[3];
+ enum AVPixelFormat *pix_fmts[8];
+ int nb_pix_fmts[8];
} VDPAUDeviceContext;
typedef struct VDPAUFramesContext {
@@ -61,6 +61,10 @@ typedef struct VDPAUPixFmtMap {
static const VDPAUPixFmtMap pix_fmts_420[] = {
{ VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV12 },
{ VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV420P },
+#ifdef VDP_YCBCR_FORMAT_P016
+ { VDP_YCBCR_FORMAT_P016, AV_PIX_FMT_P016 },
+ { VDP_YCBCR_FORMAT_P010, AV_PIX_FMT_P010 },
+#endif
{ 0, AV_PIX_FMT_NONE, },
};
@@ -76,6 +80,9 @@ static const VDPAUPixFmtMap pix_fmts_444[] = {
#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
{ VDP_YCBCR_FORMAT_Y_U_V_444, AV_PIX_FMT_YUV444P },
#endif
+#ifdef VDP_YCBCR_FORMAT_P016
+ {VDP_YCBCR_FORMAT_Y_U_V_444_16, AV_PIX_FMT_YUV444P16},
+#endif
{ 0, AV_PIX_FMT_NONE, },
};
@@ -87,6 +94,13 @@ static const struct {
{ VDP_CHROMA_TYPE_420, AV_PIX_FMT_YUV420P, pix_fmts_420 },
{ VDP_CHROMA_TYPE_422, AV_PIX_FMT_YUV422P, pix_fmts_422 },
{ VDP_CHROMA_TYPE_444, AV_PIX_FMT_YUV444P, pix_fmts_444 },
+#ifdef VDP_YCBCR_FORMAT_P016
+ { VDP_CHROMA_TYPE_420_16, AV_PIX_FMT_YUV420P10, pix_fmts_420 },
+ { VDP_CHROMA_TYPE_420_16, AV_PIX_FMT_YUV420P12, pix_fmts_420 },
+ { VDP_CHROMA_TYPE_422_16, AV_PIX_FMT_YUV422P10, pix_fmts_422 },
+ { VDP_CHROMA_TYPE_444_16, AV_PIX_FMT_YUV444P10, pix_fmts_444 },
+ { VDP_CHROMA_TYPE_444_16, AV_PIX_FMT_YUV444P12, pix_fmts_444 },
+#endif
};
static int count_pixfmts(const VDPAUPixFmtMap *map)
@@ -355,6 +369,9 @@ static int vdpau_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
|| (vdpau_format == VDP_YCBCR_FORMAT_Y_U_V_444)
#endif
+#ifdef VDP_YCBCR_FORMAT_P016
+ || (vdpau_format == VDP_YCBCR_FORMAT_Y_U_V_444_16)
+#endif
)
FFSWAP(void*, data[1], data[2]);