Add AVX support for the JPEG handler

Apparently I had forgotten about this previously. Use the AVX conversion
function if the compiler could generate AVX code.

Note: the functions need to be declared outside of the function block
so namespace scoping works properly with MSVC. For functions declared
inside, it expects them to be in the global namespace.

Change-Id: I7b7248dbfce3cc7c580dee920407c205049cb746
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
bb10
Thiago Macieira 2012-08-15 22:50:20 +02:00 committed by Qt by Nokia
parent 6e8c719e3b
commit adc4a8e42b
1 changed files with 13 additions and 3 deletions

View File

@ -870,22 +870,32 @@ bool QJpegHandlerPrivate::read(QImage *image)
}
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len);
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len);
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_avx(quint32 *dst, const uchar *src, int len);
QJpegHandler::QJpegHandler()
: d(new QJpegHandlerPrivate(this))
{
#if defined(QT_COMPILER_SUPPORTS_NEON)
// from qimage_neon.cpp
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len);
if (qCpuHasFeature(NEON))
rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_neon;
#endif // QT_COMPILER_SUPPORTS_NEON
#if defined(QT_COMPILER_SUPPORTS_SSSE3)
// from qimage_ssse3.cpp
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len);
if (qCpuHasFeature(SSSE3))
if (false) {
# if defined(QT_COMPILER_SUPPORTS_AVX)
} else if (qCpuHasFeature(AVX)) {
rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_avx;
# endif
# ifndef __AVX__
} else if (qCpuHasFeature(SSSE3)) {
rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_ssse3;
# endif
}
#endif // QT_COMPILER_SUPPORTS_SSSE3
}