[FFmpeg-cvslog] avcodec/nvenc: support RGB input

Sven C. Dack git at videolan.org
Wed Sep 7 19:49:59 EEST 2016


ffmpeg | branch: master | Sven C. Dack <sven.c.dack at sky.com> | Wed Sep  7 15:35:14 2016 +0200| [4aeb7a88ec69aff6490e7f94f5987f7525b7eab7] | committer: Timo Rothenpieler

avcodec/nvenc: support RGB input

nvenc still encodes as yuv, but does the conversion internally which
brings some performance gains.

Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4aeb7a88ec69aff6490e7f94f5987f7525b7eab7
---

 libavcodec/nvenc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index b335116..bff204d 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -81,6 +81,8 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
     AV_PIX_FMT_P010,
     AV_PIX_FMT_YUV444P,
     AV_PIX_FMT_YUV444P16,
+    AV_PIX_FMT_0RGB32,
+    AV_PIX_FMT_0BGR32,
 #if CONFIG_CUDA
     AV_PIX_FMT_CUDA,
 #endif
@@ -1032,6 +1034,14 @@ static av_cold int nvenc_alloc_surface(AVCodecContext *avctx, int idx)
         ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_YUV444_10BIT;
         break;
 
+    case AV_PIX_FMT_0RGB32:
+        ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_ARGB;
+        break;
+
+    case AV_PIX_FMT_0BGR32:
+        ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_ABGR;
+        break;
+
     default:
         av_log(avctx, AV_LOG_FATAL, "Invalid input pixel format\n");
         return AVERROR(EINVAL);



More information about the ffmpeg-cvslog mailing list