1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/tests/ref
Rudolf Polzer dcc9454ab9 vf_paletteuse: fix color cache lookup for Bayer dithering mode.
To trigger this bug, use `paletteuse=dither=bayer:bayer_scale=0`; you will see
that adjacent pixel lines will use the same dither pattern, instead of being
shifted from each other by 32 units (0x20).

One way to demostrate the bug is:

$ convert -size 64x256 gradient:black-white -rotate 270 grad.png
$ echo 'P2 2 1 255 0 255' > bw.pnm
$ ffmpeg -i grad.png -filter_complex 'movie=bw.pnm,scale=256x1[bw]; [0:v][bw]paletteuse=dither=bayer:bayer_scale=0' gradbw.png

Previously: https://www.rm.cloudns.org/img/uploaded/0bd152c11b9cd99e5945115534b1bdde.png
Now:        https://www.rm.cloudns.org/img/uploaded/89caaa5e36c38bc2c01755b30811f969.png

This was caused by passing inconsistent color vs (a,r,g,b) parameters to
color_get(), and NBITS being 5 meaning actually hitting the same cache node
does happen in this case, but ONLY if bayer_scale is zero.

The fix is passing the correct color value to color_get().

Also added a previous-failing FATE test; image comparison of the first frame:

Previously: https://www.rm.cloudns.org/img/uploaded/d0ff9db8d8a7d8a3b8b88bbe92bf5fed.png
Now:        https://www.rm.cloudns.org/img/uploaded/a72389707e719b5cd1c58916a9e79ca8.png

(on this less synthetic test image, the bug basically causes noise from cache
 hits vs misses)

Tested: FATE passes, which exercises this filter but at the default bayer_scale.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
2022-01-17 01:31:06 +05:30
..
acodec avformat/argo_asf: pass name through as metadata 2021-10-15 23:40:15 +10:00
fate vf_paletteuse: fix color cache lookup for Bayer dithering mode. 2022-01-17 01:31:06 +05:30
lavf avformat/mxfenc: fix DNxHD GC element_type 2021-12-27 00:39:35 +01:00
lavf-fate avformat/matroskaenc: Pass dispositions through unchanged by default 2021-08-24 04:23:29 +02:00
pixfmt fate/pixfmt: test xyz12le 2021-08-29 18:44:46 +02:00
seek lavf/mov: Change default to prefer TFDT time and allow for fallback to SIDX or TFDT 2021-11-05 16:22:04 +01:00
vsynth
vsynth1
vsynth_lena