Message ID | 67a158c2-8043-50ab-c3f4-3bbf805deedb@sky.com |
---|---|
State | Superseded |
Headers | show |
Hi! 2016-09-07 1:02 GMT+02:00 Sven C. Dack <sven.c.dack@sky.com>: > + case AV_PIX_FMT_RGBA: Should be AV_PIX_FMT_RGB0... > + ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_ABGR; > + break; > + > + case AV_PIX_FMT_BGRA: ... and AV_PIX_FMT_BGR0 > + ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_ARGB; Carl Eugen
On 07/09/16 00:43, Carl Eugen Hoyos wrote: > > Should be AV_PIX_FMT_RGB0... > > > ... and AV_PIX_FMT_BGR0 I was wondering about that. The 0 means undefined/unused and I didn't want to open a can of worms with it. Should I add BGR0 and RGB0, too? Does the 0 mean it is reliably 0? Sven
--- 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_RGBA, + AV_PIX_FMT_BGRA, #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_RGBA: + ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_ABGR; + break; + + case AV_PIX_FMT_BGRA: + ctx->surfaces[idx].format = NV_ENC_BUFFER_FORMAT_ARGB; + break; + default: av_log(avctx, AV_LOG_FATAL, "Invalid input pixel format\n");