tests: add yuv-buffer test
This adds a test to ensure that the wl_shm formats YUV420, NV12 and YUYV are decoded and converted to RGB correctly in GL-renderer. The test deliberately uses a 256 x 256 test image so that effects from width vs. pitch vs. stride cannot be observed, and row padding is zero. Also padding between planes is zero. Attempting to use a test image with less "round" dimensions lead to stride mismatch in GL-renderer, likely due to GL_UNPACK_ALIGNMENT being left at value 4. It is unclear if YUV wl_shm buffers' row stride needs to be aligned to 4 bytes or not, so I did not pursue fixing it. GL-renderer seems to be confusing width, pitch and stride even further, and not e.g. allow padding with ARGB buffers. See also: wayland/weston#354 Furthermore, the test arranges so that each 2x2 pixel block has the same color. This avoids having to consider chroma siting when sub-sampling. This way all the test cases can use the same reference image. The source image chocolate-cake.png is taken and copyright by Pekka Paalanen, hereby licensed as http://creativecommons.org/licenses/by-sa/4.0/ . Signed-off-by:Pekka Paalanen <pekka.paalanen@collabora.com>
Showing
- tests/meson.build 7 additions, 0 deletionstests/meson.build
- tests/reference/chocolate-cake.png 0 additions, 0 deletionstests/reference/chocolate-cake.png
- tests/reference/yuv-buffer-00.png 0 additions, 0 deletionstests/reference/yuv-buffer-00.png
- tests/yuv-buffer-test.c 428 additions, 0 deletionstests/yuv-buffer-test.c
Loading
Please register or sign in to comment