Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | __attribute__((visibility("default"))) void qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len) | - |
10 | { | - |
11 | quint32 *const end = dst + len; | - |
12 | | - |
13 | | - |
14 | | - |
15 | const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3; | - |
16 | const int prologLength = qMin(len, offsetToAlignOn16Bytes); | - |
17 | | - |
18 | for (int i = 0; i < prologLengthTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
19 | *dst++ = qRgb(src[0], src[1], src[2]); | - |
20 | src += 3; | - |
21 | } never executed: end of block | 0 |
22 | | - |
23 | | - |
24 | const __m128i shuffleMask = _mm_set_epi8(char(0xff), 9, 10, 11, char(0xff), 6, 7, 8, char(0xff), 3, 4, 5, char(0xff), 0, 1, 2); | - |
25 | | - |
26 | | - |
27 | const __m128i shuffleMaskEnd = _mm_set_epi8(char(0xff), 13, 14, 15, char(0xff), 10, 11, 12, char(0xff), 7, 8, 9, char(0xff), 4, 5, 6); | - |
28 | | - |
29 | | - |
30 | const __m128i alphaMask = _mm_set1_epi32(0xff000000); | - |
31 | | - |
32 | const __m128i *inVectorPtr = (const __m128i *)src; | - |
33 | __m128i *dstVectorPtr = (__m128i *)dst; | - |
34 | | - |
35 | const int simdRoundCount = (len - prologLength) / 16; | - |
36 | for (int i = 0; i < simdRoundCountTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
37 | __m128i firstSrcVector = _mm_lddqu_si128(inVectorPtr); | - |
38 | __m128i outputVector = _mm_shuffle_epi8(firstSrcVector, shuffleMask); | - |
39 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
40 | ++inVectorPtr; | - |
41 | ++dstVectorPtr; | - |
42 | | - |
43 | | - |
44 | | - |
45 | __m128i secondSrcVector = _mm_lddqu_si128(inVectorPtr); | - |
46 | __m128i srcVector = ((__m128i) __builtin_ia32_palignr128 ((__v2di)(__m128i)(secondSrcVector), (__v2di)(__m128i)(firstSrcVector), (int)(12) * 8)); | - |
47 | outputVector = _mm_shuffle_epi8(srcVector, shuffleMask); | - |
48 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
49 | ++inVectorPtr; | - |
50 | ++dstVectorPtr; | - |
51 | firstSrcVector = secondSrcVector; | - |
52 | | - |
53 | | - |
54 | secondSrcVector = _mm_lddqu_si128(inVectorPtr); | - |
55 | srcVector = ((__m128i) __builtin_ia32_palignr128 ((__v2di)(__m128i)(secondSrcVector), (__v2di)(__m128i)(firstSrcVector), (int)(8) * 8)); | - |
56 | outputVector = _mm_shuffle_epi8(srcVector, shuffleMask); | - |
57 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
58 | ++inVectorPtr; | - |
59 | ++dstVectorPtr; | - |
60 | | - |
61 | | - |
62 | | - |
63 | outputVector = _mm_shuffle_epi8(secondSrcVector, shuffleMaskEnd); | - |
64 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
65 | ++dstVectorPtr; | - |
66 | } never executed: end of block | 0 |
67 | src = (const uchar *)inVectorPtr; | - |
68 | dst = (quint32 *)dstVectorPtr; | - |
69 | | - |
70 | while (dst != endTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
71 | *dst++ = qRgb(src[0], src[1], src[2]); | - |
72 | src += 3; | - |
73 | } never executed: end of block | 0 |
74 | } never executed: end of block | 0 |
75 | | - |
76 | void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags) | - |
77 | { | - |
78 | ((!(src->format == QImage::Format_RGB888)) ? qt_assert("src->format == QImage::Format_RGB888",__FILE__,130) : qt_noop()); | - |
79 | ((!(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",__FILE__,131) : qt_noop()); | - |
80 | ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,132) : qt_noop()); | - |
81 | ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,133) : qt_noop()); | - |
82 | | - |
83 | const uchar *src_data = (uchar *) src->data; | - |
84 | quint32 *dest_data = (quint32 *) dest->data; | - |
85 | | - |
86 | for (int i = 0; i < src->heightTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
87 | qt_convert_rgb888_to_rgb32_ssse3(dest_data, src_data, src->width); | - |
88 | src_data += src->bytes_per_line; | - |
89 | dest_data = (quint32 *)((uchar*)dest_data + dest->bytes_per_line); | - |
90 | } never executed: end of block | 0 |
91 | } never executed: end of block | 0 |
92 | | - |
93 | | - |
| | |