diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-19 11:20:52 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-03-03 13:38:17 +0000 |
commit | 59f168c5e5eec7ac247e6154a65f85a7ccc6e7ad (patch) | |
tree | 6c80267788ca979465fe7ea3cb921947c05a4476 /tests/benchmarks | |
parent | bfb92c03e0d8e7a3a65b64d1f2f5b89f442e2b8a (diff) |
Optimize fallback RGB888 to RGB32 conversion
Improves the conversion from RGB888 to RGB32 on platforms without SIMD
versions. This includes the fallback used on non-neon ARM devices.
Besides image conversion the routine is also used for decoding JPEG.
On x86 this version is within 0.7x of the speed of the SSSE3 version.
Change-Id: Id131994d7c3c4f879d89e80f9d6c435bb5535ed7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp index d4834a04e2..2d4a453b58 100644 --- a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp +++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp @@ -43,6 +43,9 @@ private slots: void convertRgb888ToRgb32_data(); void convertRgb888ToRgb32(); + void convertRgb888ToRgbx8888_data(); + void convertRgb888ToRgbx8888(); + void convertRgb32ToRgb888_data(); void convertRgb32ToRgb888(); @@ -74,8 +77,8 @@ void tst_QImageConversion::convertRgb888ToRgb32_data() // 16 pixels, minimum for the SSSE3 implementation QTest::newRow("width: 16px; height: 5000px;") << generateImageRgb888(16, 5000); - // 50 pixels, more realistic use case - QTest::newRow("width: 50px; height: 5000px;") << generateImageRgb888(50, 5000); + // 200 pixels, more realistic use case + QTest::newRow("width: 200px; height: 5000px;") << generateImageRgb888(200, 5000); // 2000 pixels -> typical values for pictures QTest::newRow("width: 2000px; height: 2000px;") << generateImageRgb888(2000, 2000); @@ -93,6 +96,23 @@ void tst_QImageConversion::convertRgb888ToRgb32() } } +void tst_QImageConversion::convertRgb888ToRgbx8888_data() +{ + convertRgb888ToRgb32_data(); +} + +void tst_QImageConversion::convertRgb888ToRgbx8888() +{ + QFETCH(QImage, inputImage); + + QBENCHMARK { + volatile QImage output = inputImage.convertToFormat(QImage::Format_RGBX8888); + // we need the volatile and the following to make sure the compiler does not do + // anything stupid :) + (void)output; + } +} + void tst_QImageConversion::convertRgb32ToRgb888_data() { QTest::addColumn<QImage>("inputImage"); |