summaryrefslogtreecommitdiff
path: root/test/blitters-test.c
AgeCommit message (Collapse)AuthorFilesLines
2013-01-23utils.[ch]: Add new format_name() functionSøren Sandmann Pedersen1-2/+4
This function returns the name of the given format code, which is useful for printing out debug information. The function is written as a switch without a default value so that the compiler will warn if new formats are added in the future. The fake formats used in the fast path tables are also recognized. The function is used in alpha_map.c, where it replaces an existing format_name() function, and in blitters-test.c, affine-test.c, and scaling-test.c.
2013-01-23test/utils.[ch]: Add new function operator_name()Søren Sandmann Pedersen1-2/+2
This function returns the name of the given operator, which is useful for printing out debug information. The function is done as a switch without a default value so that the compiler will warn if new operators are added in the future. The function is used in affine-test.c, scaling-test.c, and blitters-test.c.
2012-12-06test: Switch to the new PRNG instead of old LCGSiarhei Siamashka1-11/+5
Wallclock time for running pixman "make check" (compile time not included): ----------------------------+----------------+-----------------------------+ | old PRNG (LCG) | new PRNG (Bob Jenkins) | Processor type +----------------+------------+----------------+ | gcc 4.5 | gcc 4.5 | gcc 4.7 (simd) | ----------------------------+----------------+------------+----------------+ quad Intel Core i7 @2.8GHz | 0m49.494s | 0m43.722s | 0m37.560s | dual ARM Cortex-A15 @1.7GHz | 5m8.465s | 4m37.375s | 3m45.819s | IBM Cell PPU @3.2GHz | 23m0.821s | 20m38.316s | 16m37.513s | ----------------------------+----------------+------------+----------------+ But some tests got a particularly large boost. For example benchmarking and profiling blitters-test on Core i7: === before === $ time ./blitters-test real 0m10.907s user 0m55.650s sys 0m0.000s 70.45% blitters-test blitters-test [.] create_random_image 15.81% blitters-test blitters-test [.] compute_crc32_for_image_internal 2.26% blitters-test blitters-test [.] _pixman_implementation_lookup_composite 1.07% blitters-test libc-2.15.so [.] _int_free 0.89% blitters-test libc-2.15.so [.] malloc_consolidate 0.87% blitters-test libc-2.15.so [.] _int_malloc 0.75% blitters-test blitters-test [.] combine_conjoint_general_u 0.61% blitters-test blitters-test [.] combine_disjoint_general_u 0.40% blitters-test blitters-test [.] test_composite 0.31% blitters-test libc-2.15.so [.] _int_memalign 0.31% blitters-test blitters-test [.] _pixman_bits_image_setup_accessors 0.28% blitters-test libc-2.15.so [.] malloc === after === $ time ./blitters-test real 0m3.655s user 0m20.550s sys 0m0.000s 41.77% blitters-test.n blitters-test.new [.] compute_crc32_for_image_internal 15.77% blitters-test.n blitters-test.new [.] prng_randmemset_r 6.15% blitters-test.n blitters-test.new [.] _pixman_implementation_lookup_composite 3.09% blitters-test.n libc-2.15.so [.] _int_free 2.68% blitters-test.n libc-2.15.so [.] malloc_consolidate 2.39% blitters-test.n libc-2.15.so [.] _int_malloc 2.27% blitters-test.n blitters-test.new [.] create_random_image 2.22% blitters-test.n blitters-test.new [.] combine_conjoint_general_u 1.52% blitters-test.n blitters-test.new [.] combine_disjoint_general_u 1.40% blitters-test.n blitters-test.new [.] test_composite 1.02% blitters-test.n blitters-test.new [.] prng_srand_r 1.00% blitters-test.n blitters-test.new [.] _pixman_image_validate 0.96% blitters-test.n blitters-test.new [.] _pixman_bits_image_setup_accessors 0.90% blitters-test.n libc-2.15.so [.] malloc
2012-12-06test: Search/replace 'lcg_*' -> 'prng_*'Siarhei Siamashka1-24/+24
The 'lcg' prefix is going to be misleading if we replace PRNG algorithm.
2012-10-01blitters-test: Prepare for floating pointSøren Sandmann Pedersen1-1/+3
Comment out some formats in blitters-test that are going to rely on floating point in some upcoming patches.
2012-09-22Fix bugs in component alpha combiners for separable PDF operatorsSøren Sandmann Pedersen1-1/+1
In general, the component alpha version of an operator is supposed to do this: - multiply source with mask in all channels - multiply mask with source alpha in all channels - compute the regular operator in all channels using the mask value whenever source alpha is called for The first two steps are usually accomplished with the function combine_mask_ca(), but for operators where source alpha is not used, such as SRC, ADD and OUT, the simpler function combine_mask_value_ca(), which doesn't compute the new mask values, can be used. However, the PDF blend modes generally *do* make use of source alpha, so they can't use combine_mask_value_ca() as they do now. They have to use combine_mask_ca(). This patch fixes this in combine_multiply_ca() and the CA combiners generated by PDF_SEPARABLE_BLEND_MODE.
2012-06-02Move CRC32 computation from blitters-test.c into utils.cSøren Sandmann Pedersen1-30/+1
This way it can be used in other tests.
2012-01-09Fix rounding for DIV_UNc()Søren Sandmann Pedersen1-1/+1
We need to compute floor (a/b * 255 + 0.5), not floor (a / b * 255), so add b/2 to the numerator in the DIV_UNc() macro.
2012-01-09Fix a bunch of signed overflow issuesSøren Sandmann Pedersen1-1/+1
In pixman-fast-path.c: (1 << 31) - 1 causes a signed overflow, so change to (1U << n) - 1. In pixman-image.c: The check for whether m10 == -m01 will overflow when -m01 == INT_MIN. Instead just check whether the variables are 1 and -1. In pixman-utils.c: When the depth of the topmost channel is 0, we can end up shifting by 32. In blitters-test.c: Replicating the mask would end up shifting more than 32. In region-contains-test.c: Computing the average of two large integers could overflow. Instead add half the difference between them to the first integer. In stress-test.c: Masking the value in fake_reader() would sometimes shift by 32. Instead just use the most significant bits instead of the least significant. All these issues were found by the IOC tool: http://embed.cs.utah.edu/ioc/
2012-01-09Fix some signed overflow bugsSøren Sandmann Pedersen1-1/+1
In the macros for the PDF blend modes, two comp1_t variables are multiplied together and then used as if the result were a comp4_t. When comp1_t is a uint8_t, this is fine because they are promoted to int, and the product of two uint8_ts fits in an int. However, when comp1_t is uint16, the product does not necessarily fit in an int, so casts are necessary. Fix for bug 43906, reported by Siarhei Siamashka.
2011-11-09Use the ARRAY_LENGTH() macro when possibleAndrea Canciani1-1/+1
This patch has been generated by the following Coccinelle semantic patch: // Use the ARRAY_LENGTH() macro when possible // // Replace open-coded array length computations with the // ARRAY_LENGTH() macro @@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_LENGTH (E)
2011-11-09test: Cleanup includesAndrea Canciani1-1/+0
All the tests are linked to libutil, hence it makes sence to always include utils.h and reuse what it provides (config.h inclusion, access to private pixman APIs, ARRAY_LENGTH, ...).
2011-09-21test: Occasionally use a BILINEAR filter in blitters-testSøren Sandmann Pedersen1-1/+4
To test that reductions of BILINEAR->NEAREST for identity transformations happen correctly, occasionally use a bilinear filter in blitters test.
2011-09-14test: Do not include config.h unless HAVE_CONFIG_H is definedAndrea Canciani1-1/+0
The win32 build system does not generate config.h and correctly runs the compiler without defining HAVE_CONFIG_H. Nevertheless some files include config.h without checking for its availability, breaking the build from a clean directory: test\utils.h(2) : fatal error C1083: Cannot open include file: 'config.h': No such file or directory ...
2011-06-25blitters-test: Make common formats more likely to be tested.Søren Sandmann Pedersen1-8/+14
Move the eight most common formats to the top of the list of image formats and make create_random_image() much more likely to select one of those eight formats. This should help catch more bugs in SIMD optimized operations.
2011-03-22Add support for the r8g8b8a8 and r8g8b8x8 formats to the tests.Alexandros Frantzis1-2/+7
2011-03-07test: In image_endian_swap() use pixman_image_get_format() to get the bpp.Søren Sandmann Pedersen1-2/+2
There is no reason to pass in the bpp as an argument; it can be gotten directly from the image.
2011-01-26test: Use the right enum types instead of int to fix warningsRolland Dudemaine1-8/+8
Green Hills Software MULTI compiler was producing a number of warnings due to incorrect uses of int instead of the correct corresponding pixman_*_t type.
2010-12-17test: Move palette initialization to utils.[ch]Søren Sandmann Pedersen1-55/+2
2010-10-11Remove broken optimizations in combine_disjoint_over_u()Søren Sandmann Pedersen1-1/+1
The first broken optimization is that it checks "a != 0x00" where it should check "s != 0x00". The other is that it skips the computation when alpha is 0xff. That is wrong because in the formula: min (1, (1 - Aa)/Ab) the render specification states that if Ab is 0, the quotient is defined to positive infinity. That is the case even if (1 - Aa) is 0.
2010-09-21Move aligned_malloc() to utilsDmitri Vorobiev1-15/+0
The aligned_malloc() routine will be used in more than one test utility. At least, a low-level blitter benchmark needs it. Therefore, let's make this function a part of common test utilities code.
2010-09-13test: detection of possible floating point registers corruptionSiarhei Siamashka1-1/+2
Added a pair of macros which can help to detect corruption of floating point registers after a function call. This may happen if _mm_empty() call is forgotten in MMX/SSE2 fast path code, or ARM NEON assembly optimized function forgets to save/restore d8-d15 registers before use.
2010-08-04Add x14r6g6b6 format to blitters-testSøren Sandmann Pedersen1-1/+2
2010-07-11When converting indexed formats to 64 bits, don't correct for channel widthsSøren Sandmann Pedersen1-1/+1
Indexed formats are mapped to a8r8g8b8 with full precision, so when expanding we shouldn't correct for the width of the channels
2010-07-11test: Make sure the palettes for indexed format roundtrip properlySøren Sandmann Pedersen1-11/+63
The palettes for indexed formats must satisfy the condition that if some index maps to a color C, then the 15 bit version of that color must map back to the index. This ensures that the destination operator is always a no-op, which seems like a reasonable assumption to make.
2010-06-18Make separate gray scanline storers.Søren Sandmann Pedersen1-1/+1
For gray formats the palettes are indexed by luminance, not RGB, so we can't use the color storers for gray too.
2010-06-18When storing a g1 pixel, store the lowest bit, rather than comparing with 0.Søren Sandmann Pedersen1-1/+1
2010-05-13test: blitters-test updated to use new fuzzer_test_main() functionSiarhei Siamashka1-75/+9
2010-05-03Don't consider indexed formats opaque.Søren Sandmann Pedersen1-1/+1
The indexed formats have 0 bits of alpha, but can't be considered opaque because there may be non-opaque colors in the palette.
2010-03-17Ensure that only the low 4 bit of 4 bit pixels are stored.Søren Sandmann Pedersen1-1/+1
In some cases we end up trying to use the STORE_4 macro with an 8 bit values, which resulted in other pixels getting overwritten. Fix this by always masking off the low 4 bits. This fixes blitters-test on big-endian machines.
2010-03-14test: Add support for indexed formats to blitters-testSøren Sandmann Pedersen1-3/+24
These formats work fine, they just need to have a palette set.
2010-03-03test: Remove obsolete commentSøren Sandmann Pedersen1-2/+0
2009-11-27test: support for testing pixbuf fast path functions in blitters-testSiarhei Siamashka1-18/+41
2009-11-20Remove stray semicolon from blitters-test.cSøren Sandmann Pedersen1-1/+1
Pointed out by scottmc2@gmail.com in bug 25137.
2009-11-17test: Move image_endian_swap() from blitters-test.c to utils.[ch]Søren Sandmann Pedersen1-82/+0
2009-11-17test: Move random number generator from blitters/scaling-test to utils.[ch]Søren Sandmann Pedersen1-22/+0
2009-11-17test: Move CRC32 code from blitters-test to new files utils.[ch]Søren Sandmann Pedersen1-104/+1
2009-10-27blitters-test updated to also randomly generate mask_x/mask_ySiarhei Siamashka1-2/+8
2009-10-20Fix compile warningsBenjamin Otte1-1/+2
2009-10-08Fix double semicolon; pointed out by Travis GriggsSøren Sandmann Pedersen1-1/+1
2009-09-24Update CRC value in blitters-test for the new bug fixesSøren Sandmann Pedersen1-1/+1
2009-09-24Fix bug in blitters-test with BGRA formats.Søren Sandmann Pedersen1-0/+3
When masking out the x bits, blitter-test would make the incorrect assumption that the they were always in the topmost position. This is not correct for formats of type PIXMAN_TYPE_BGRA.
2009-08-13Check if we have posix_memalign() in configure.ac. [23260, 23261]Søren Sandmann Pedersen1-2/+16
Fall back to malloc() in blitters-test.c if we don't.
2009-08-08Update CRC value in blitters-test.Søren Sandmann Pedersen1-1/+1
At this point, the SIMD, SSE2, MMX and general implementations all agree.
2009-08-08Various formatting fixesSøren Sandmann Pedersen1-27/+56
2009-08-08Add the ability to print intermediate CRC valuesSøren Sandmann Pedersen1-0/+4
2009-08-08Reenable commented-out tests in blitter-test.Søren Sandmann Pedersen1-14/+0
The crashes and valgrind issues are all fixed at this point.
2009-08-08One more update to blitters-test - use aligned memorySiarhei Siamashka1-5/+6
allocations in order in order to make reproducibility of alignment sensitive bugs more deterministic Also testing of masks is reenabled
2009-08-08HACK: updated test to better cover new neon optimizationsSiarhei Siamashka1-4/+16
2009-08-08Test program for stressing the use of different formats and operatorsSiarhei Siamashka1-0/+606
The code and overall method is mostly based on scaling-test. This one focuses on trying to stress as many different color formats and types of composition operations as possible. This is an initial implementation which may need more tuning. Also not all color format and operator combinations are actually used. When cpu specific optimizations are disabled, this test provides identical deterministic results on x86, PPC and ARM. Script blitters-test-bisect.rb now works in non-stop mode, until it finds any problem. This allows to run it for example overnight in order to test a lot more variants of pixman calls and increase chances of detecting problems in pixman. Just like with scaling-test, running blitters-test binary alone with no command line arguments runs a small predefined number of tests and compares checksum with a reference value for quick verification.