Go to file
Philip Langdale ed83a3a5bd lavu/pixdesc: favour formats where depth and subsampling exactly match
Since introducing the various packed formats used by VAAPI (and p012),
we've noticed that there's actually a gap in how
av_find_best_pix_fmt_of_2 works. It doesn't actually assign any value
to having the same bit depth as the source format, when comparing
against formats with a higher bit depth. This usually doesn't matter,
because av_get_padded_bits_per_pixel() will account for it.

However, as many of these formats use padding internally, we find that
av_get_padded_bits_per_pixel() actually returns the same value for the
10 bit, 12 bit, 16 bit flavours, etc. In these tied situations, we end
up just picking the first of the two provided formats, even if the
second one should be preferred because it matches the actual bit depth.

This bug already existed if you tried to compare yuv420p10 against p016
and p010, for example, but it simply hadn't come up before so we never
noticed.

But now, we actually got a situation in the VAAPI VP9 decoder where it
offers both p010 and p012 because Profile 3 could be either depth and
ends up picking p012 for 10 bit content due to the ordering of the
testing.

In addition, in the process of testing the fix, I realised we have the
same gap when it comes to chroma subsampling - we do not favour a
format that has exactly the same subsampling vs one with less
subsampling when all else is equal.

To fix this, I'm introducing a small score penalty if the bit depth or
subsampling doesn't exactly match the source format. This will break
the tie in favour of the format with the exact match, but not offset
any of the other scoring penalties we already have.

I have added a set of tests around these formats which will fail
without this fix.
2022-09-17 15:11:13 -07:00
compat
doc avformat: add LAF demuxer 2022-09-16 10:02:19 +02:00
ffbuild
fftools fftools/ffplay: fix rotation incorrect when frame contains the displaymatrix 2022-09-15 16:16:16 +08:00
libavcodec avcodec/exr: recreate offset table outside of packet 2022-09-17 11:26:49 +02:00
libavdevice
libavfilter avfilter/vf_libvmaf: Update ssim, ms_ssim options description 2022-09-16 13:07:43 -07:00
libavformat avformat/ape: fix overflow in total_blocks 2022-09-16 18:04:20 +02:00
libavutil lavu/pixdesc: favour formats where depth and subsampling exactly match 2022-09-17 15:11:13 -07:00
libpostproc
libswresample swsresample/swresample: error out on invalid layouts 2022-09-14 09:52:33 -03:00
libswscale swscale/la: Add output_lasx.c file. 2022-09-10 22:56:39 +02:00
presets
tests lavu/pixdesc: favour formats where depth and subsampling exactly match 2022-09-17 15:11:13 -07:00
tools tools/target_dec_fuzzer: Adjust threshold for Jpeg2000 2022-09-16 21:30:59 +02:00
.gitattributes
.gitignore
.mailmap
.travis.yml
Changelog avformat: add LAF demuxer 2022-09-16 10:02:19 +02:00
configure libavfilter: add vf_colorrange_cuda, CUDA-accelerated color conversion filter 2022-09-13 22:59:30 +02:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md
MAINTAINERS
Makefile
README.md
RELEASE

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides means to alter decoded audio and video through a directed graph of connected filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.