[FFmpeg-devel] [PATCH 1/2] avutil: Add MSB packed YUV444P10 format
h.leppkes at gmail.com
Thu Feb 2 11:48:17 EET 2017
On Wed, Feb 1, 2017 at 11:54 PM, Philip Langdale <philipl at overt.org> wrote:
> nvenc supports a YUV444P10 format with the same bit layout as P010,
> with the data bits at the MSB end.
> Unfortunately, the current YUV444P10 format we have defined puts
> the data bits at the LSB end.
> This mismatch led to us introducing a fudge in nvenc where we
> mapped their 444P10 format to the ffmpeg 444P16 format. This
> ensured that the data ends up in the right place if you are
> starting with 10bit content, but it leads to other problems.
> * >10bit content will be preferrentially converted to 444P16
> to pass to nvenc to 'preserve' the additional bits. However, they
> aren't actually preserved, but are discarded, so we're worse off
> because no dithering took place in swscale.
> * On top of that, the input data is almost certainly 4:2:0 and so
> the conversion to 4:4:4 is pointless, while also leading to an
> output file that's incompatible with many playback scenarios
> (no hardware decoder supports 4:4:4 content).
> So, for the sake of accuracy, introduce an explicit pixfmt for this
> situation. There's no conversion support because you'll basically
> never have a use for it. If someone ever finds one, they can write
> the swscale code.
> In the mean time, common 12 bit content (YUV420P12 or P016) will be
> correctly converted to P010 for nvenc.
What does this change have to do with 4:2:0 content?
More information about the ffmpeg-devel