ffmpeg/libavutil/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
..
.gitignore avutil/tests/.gitignore: Add channel_layout testtool 2022-09-05 02:00:08 +02:00
adler32.c avutil/tests/adler32: Remove unnecessary volatile 2022-01-29 21:26:26 +01:00
aes.c lavu/tests: move timer.h include earlier 2017-09-08 18:51:05 +02:00
aes_ctr.c avutil/avassert: Don't include avutil.h 2022-02-24 12:56:49 +01:00
audio_fifo.c avutil/tests/audio_ffio: add missing header 2021-06-13 13:39:57 -03:00
avstring.c lavu/avstring: deprecate av_d2str(). 2020-08-21 11:01:39 +02:00
base64.c lavu/tests: move timer.h include earlier 2017-09-08 18:51:05 +02:00
blowfish.c Merge commit '8131bd4c22' 2016-06-24 11:14:23 +02:00
bprint.c Remove unnecessary avassert.h inclusions 2021-07-22 15:02:30 +02:00
camellia.c avutil/log: Don't include avutil.h 2022-02-24 12:56:49 +01:00
cast5.c avutil/log: Don't include avutil.h 2022-02-24 12:56:49 +01:00
channel_layout.c avutil/tests/channel_layout: also test ambisonic layouts in av_channel_layout_subset() 2022-03-25 17:10:39 -03:00
color_utils.c Remove unnecessary libavutil/(avutil|common|internal).h inclusions 2022-02-24 12:56:49 +01:00
cpu.c avutil/tests/cpu: add slowgather 2021-12-21 17:52:09 -03:00
cpu_init.c avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS 2016-12-10 18:47:10 -03:00
crc.c crc: add AV_CRC_8_SBC as a 8 bits CRC with polynomial 0x1D 2018-03-07 22:26:53 +01:00
des.c lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bump 2021-01-01 14:14:57 +01:00
dict.c avutil/tests/dict: Check return of av_dict_parse_string() 2017-03-30 23:35:18 +02:00
display.c avutil/display: Don't include avutil.h 2022-02-24 12:56:49 +01:00
encryption_info.c avutil/avassert: Don't include avutil.h 2022-02-24 12:56:49 +01:00
error.c
eval.c lavu/tests: move timer.h include earlier 2017-09-08 18:51:05 +02:00
fifo.c lavu/fifo: add a test for _cb functions 2022-02-15 10:16:16 +01:00
file.c
hash.c
hmac.c avutil/tests/hmac: remove superfluous loop 2017-10-22 20:25:38 -03:00
hwdevice.c hwcontext: Add test for device creation and derivation 2018-05-21 20:54:52 +01:00
imgutils.c tests/imgutils: test the output of av_image_fill_* functions 2020-07-30 19:33:09 -03:00
integer.c avutil/integer: move the test to the corresponding subdirectory 2018-03-20 23:27:58 -03:00
lfg.c avutil/tests/lfg: Remove debugging start/stop timer 2017-03-08 14:32:00 +01:00
lls.c lavu: move LOCAL_ALIGNED from internal.h to mem_internal.h 2021-01-01 14:11:01 +01:00
log.c
lzo.c avutil/tests/lzo: remove timer macros 2021-06-13 13:39:57 -03:00
md5.c libavutil/tests/md5: Remove 'volatile workaround' to avoid warnings 2022-06-08 22:24:31 +02:00
murmur3.c
opt.c lavu: support AVChannelLayout AVOptions 2022-03-15 09:42:29 -03:00
parseutils.c avutil/tests/parseutils: add some big duration tests 2018-10-07 20:26:29 +02:00
pca.c
pixdesc.c avutil/pixdesc: add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8 2018-04-30 21:51:31 +02:00
pixelutils.c Remove unnecessary libavutil/(avutil|common|internal).h inclusions 2022-02-24 12:56:49 +01:00
pixfmt_best.c lavu/pixdesc: favour formats where depth and subsampling exactly match 2022-09-17 15:11:13 -07:00
random_seed.c avutil/tests/random_seed: seeds[] is uint32_t, therefore use PRIX32 macro 2018-12-16 13:52:21 +11:00
rational.c
ripemd.c
sha.c
sha512.c
softfloat.c lavu/tests: move timer.h include earlier 2017-09-08 18:51:05 +02:00
tea.c
tree.c
twofish.c avutil/log: Don't include avutil.h 2022-02-24 12:56:49 +01:00
utf8.c
uuid.c avutil/tests/uuid: add uuid tests 2022-06-12 18:34:37 +10:00
xtea.c Merge commit 'ded4a6543d' 2016-06-24 11:16:52 +02:00