[FFmpeg-devel] [PATCH 5/5] avcodec/nvenc: Accept YUV444P10_MSB and YUV444P12_MSB content
Philip Langdale
philipl at overt.org
Sat Oct 20 23:47:01 EEST 2018
12bit is implicitly truncated to 10bit as part of doing this, but we
already do that for P016 and YUV444P16.
I've bundled a single version bump and changelog entry in this change
to reflect the updates to all three of nvdec/nvenc/cuviddec.
Signed-off-by: Philip Langdale <philipl at overt.org>
---
Changelog | 1 +
libavcodec/nvenc.c | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/Changelog b/Changelog
index 1b0bc95b7a..1334eec474 100644
--- a/Changelog
+++ b/Changelog
@@ -35,6 +35,7 @@ version <next>:
- AV1 parser
- SER demuxer
- sinc audio filter source
+- Support for HEVC 4:4:4 content in nvdec/nvenc/cuviddec
version 4.0:
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index e180d7b993..5be98a5182 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -41,8 +41,10 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_P016, // Truncated to 10bits
- AV_PIX_FMT_YUV444P16, // Truncated to 10bits
+ AV_PIX_FMT_P016, // Truncated to 10bits
+ AV_PIX_FMT_YUV444P10_MSB,
+ AV_PIX_FMT_YUV444P12_MSB, // Truncated to 10bits
+ AV_PIX_FMT_YUV444P16, // Truncated to 10bits
AV_PIX_FMT_0RGB32,
AV_PIX_FMT_0BGR32,
AV_PIX_FMT_CUDA,
@@ -52,11 +54,15 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
AV_PIX_FMT_NONE
};
-#define IS_10BIT(pix_fmt) (pix_fmt == AV_PIX_FMT_P010 || \
- pix_fmt == AV_PIX_FMT_P016 || \
+#define IS_10BIT(pix_fmt) (pix_fmt == AV_PIX_FMT_P010 || \
+ pix_fmt == AV_PIX_FMT_P016 || \
+ pix_fmt == AV_PIX_FMT_YUV444P10_MSB || \
+ pix_fmt == AV_PIX_FMT_YUV444P12_MSB || \
pix_fmt == AV_PIX_FMT_YUV444P16)
-#define IS_YUV444(pix_fmt) (pix_fmt == AV_PIX_FMT_YUV444P || \
+#define IS_YUV444(pix_fmt) (pix_fmt == AV_PIX_FMT_YUV444P || \
+ pix_fmt == AV_PIX_FMT_YUV444P10_MSB || \
+ pix_fmt == AV_PIX_FMT_YUV444P12_MSB || \
pix_fmt == AV_PIX_FMT_YUV444P16)
static const struct {
@@ -1263,6 +1269,8 @@ static NV_ENC_BUFFER_FORMAT nvenc_map_buffer_format(enum AVPixelFormat pix_fmt)
return NV_ENC_BUFFER_FORMAT_YUV420_10BIT;
case AV_PIX_FMT_YUV444P:
return NV_ENC_BUFFER_FORMAT_YUV444_PL;
+ case AV_PIX_FMT_YUV444P10_MSB:
+ case AV_PIX_FMT_YUV444P12_MSB:
case AV_PIX_FMT_YUV444P16:
return NV_ENC_BUFFER_FORMAT_YUV444_10BIT;
case AV_PIX_FMT_0RGB32:
--
2.19.1
More information about the ffmpeg-devel
mailing list