[FFmpeg-cvslog] avutil/hwcontext_vdpau: Map 444 pix fmts to new VdpYCbCr types
ManojGuptaBonda
git at videolan.org
Sun May 5 21:35:59 EEST 2019
ffmpeg | branch: master | ManojGuptaBonda <mbonda at nvidia.com> | Sat May 4 02:45:53 2019 +0530| [d617d54efa146ddd81309c6236ca561ae1914698] | committer: Philip Langdale
avutil/hwcontext_vdpau: Map 444 pix fmts to new VdpYCbCr types
New VdpYCbCr Formats VDP_YCBCR_FORMAT_Y_U_V_444 and,
VDP_YCBCR_FORMAT_Y_UV_444 have been added in VDPAU with libvdpau-1.2
to be used in get/putbits for YUV 4:4:4 surfaces. Earlier mapping of
AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_YV12 is not valid.
Hence this Change maps AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_Y_U_V_444
to access the YUV 4:4:4 surface via read-back API's of VDPAU.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d617d54efa146ddd81309c6236ca561ae1914698
---
libavutil/hwcontext_vdpau.c | 18 ++++++++++++++----
libavutil/version.h | 2 +-
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/libavutil/hwcontext_vdpau.c b/libavutil/hwcontext_vdpau.c
index c11c3cfdab..6b8c1d5f76 100644
--- a/libavutil/hwcontext_vdpau.c
+++ b/libavutil/hwcontext_vdpau.c
@@ -73,8 +73,10 @@ static const VDPAUPixFmtMap pix_fmts_422[] = {
};
static const VDPAUPixFmtMap pix_fmts_444[] = {
- { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV444P },
- { 0, AV_PIX_FMT_NONE, },
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ { VDP_YCBCR_FORMAT_Y_U_V_444, AV_PIX_FMT_YUV444P },
+#endif
+ { 0, AV_PIX_FMT_NONE, },
};
static const struct {
@@ -349,7 +351,11 @@ static int vdpau_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
return AVERROR(EINVAL);
}
- if (vdpau_format == VDP_YCBCR_FORMAT_YV12)
+ if ((vdpau_format == VDP_YCBCR_FORMAT_YV12)
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ || (vdpau_format == VDP_YCBCR_FORMAT_Y_U_V_444)
+#endif
+ )
FFSWAP(void*, data[1], data[2]);
err = priv->get_data(surf, vdpau_format, data, linesize);
@@ -400,7 +406,11 @@ static int vdpau_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
return AVERROR(EINVAL);
}
- if (vdpau_format == VDP_YCBCR_FORMAT_YV12)
+ if ((vdpau_format == VDP_YCBCR_FORMAT_YV12)
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ || (vdpau_format == VDP_YCBCR_FORMAT_Y_U_V_444)
+#endif
+ )
FFSWAP(const void*, data[1], data[2]);
err = priv->put_data(surf, vdpau_format, data, linesize);
diff --git a/libavutil/version.h b/libavutil/version.h
index 1fcdea95bf..c0968de621 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
#define LIBAVUTIL_VERSION_MAJOR 56
#define LIBAVUTIL_VERSION_MINOR 26
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
More information about the ffmpeg-cvslog
mailing list