ffmpeg/tests
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
..
api tests/api: use AVFrame.duration instead of AVFrame.pkt_duration 2022-07-19 12:27:18 +02:00
checkasm checkasm/tx: add checkasm support for the iMDCT 2022-09-06 04:21:49 +02:00
fate fate/spdif: Add spdif tests 2022-09-13 14:50:01 +02:00
filtergraphs tests: use a filtergraph script for fate-mov-channel-description 2022-04-05 21:25:26 -03:00
ref lavu/pixdesc: favour formats where depth and subsampling exactly match 2022-09-17 15:11:13 -07:00
.gitignore
Makefile fate/spdif: Add spdif tests 2022-09-13 14:50:01 +02:00
audiogen.c
audiomatch.c
base64.c
copycooker.sh
extended.ffconcat
fate-run.sh tests/fate-run: Allow to set input options for encoding pass 2022-09-10 01:38:07 +02:00
fate-valgrind.supp
fate.sh
md5.sh
refcmp-metadata.awk fate/filter-refcmp-*: make refcmp_metadata fail on empty or truncated input 2022-04-10 20:12:23 +02:00
reference.pnm
rotozoom.c
simple1.ffconcat
simple2.ffconcat
test.ffmeta
tiny_psnr.c
tiny_ssim.c test: tiny_ssim: Don't include config.h 2022-03-30 14:56:07 +03:00
utils.c
videogen.c