]> git.sesse.net Git - ffmpeg/commit
avcodec/nvenc: Declare support for P016
authorPhilip Langdale <philipl@overt.org>
Sun, 25 Feb 2018 17:08:06 +0000 (09:08 -0800)
committerPhilip Langdale <philipl@overt.org>
Fri, 2 Mar 2018 22:52:48 +0000 (14:52 -0800)
commit6a89cdc474bc1a2a276dff63629784d68b9cab6e
tree020f727e9954ac94d81ec5d1443cfaf30e3a34c6
parent9d5aff09a7163b17ec98f8c712ddde7727372dbc
avcodec/nvenc: Declare support for P016

nvenc doesn't support P016, but we have two problems today:

1) We declare support for YUV444P16 which nvenc also doesn't support.
   We do this because it's the only pix_fmt we have that can
   approximate nvenc's internal format that is YUV444P10 with data in
   MSBs instead of LSBs. Because the declared format is a 16bit one,
   it will be preferrentially chosen when encoding >10bit content,
   but that content will normally be YUV420P12 or P016 which should
   get mapped to P010 and not YUV444P10.

2) Transcoding P016 content with nvenc should be possible in a pure
   hardware pipeline, and that can't be done if nvenc doesn't say it
   accepts P016. By mapping it to P010, we can use it, albeit with
   truncation. I have established that swscale doesn't know how to
   dither to 10bits so we'd get truncation anyway, even if we tried
   to do this 'properly'.
libavcodec/nvenc.c
libavcodec/version.h