Paste P164

Masterwork From Distant Lands
ActivePublic

Authored by dkazakov on Feb 13 2018, 3:38 PM.
diff --git a/libs/pigment/compositeops/KoOptimizedCompositeOpOver32.h b/libs/pigment/compositeops/KoOptimizedCompositeOpOver32.h
index a1b7861..93f7a5d 100644
--- a/libs/pigment/compositeops/KoOptimizedCompositeOpOver32.h
+++ b/libs/pigment/compositeops/KoOptimizedCompositeOpOver32.h
@@ -25,6 +25,7 @@
#include "KoCompositeOpRegistry.h"
#include "KoStreamedMath.h"
+#include "kis_debug.h"
template<Vc::Implementation _impl>
struct OptiDiv {
@@ -57,7 +58,6 @@ struct OptiDiv {
};
-
template<typename channels_type, typename pixel_type, bool alphaLocked, bool allChannelsFlag>
struct OverCompositor32 {
struct OptionalParams {
@@ -74,6 +74,11 @@ struct OverCompositor32 {
{
Q_UNUSED(oparams);
+ typename KoStreamedMath<_impl>::uint16_16_v tempVar =
+ KoStreamedMath<_impl>::template fetch_alpha_32_into_uint16<src_aligned>(src);
+ Q_UNUSED(tempVar);
+ qDebug() << ppVar(tempVar.size());
+
Vc::float_v src_alpha;
Vc::float_v dst_alpha;
diff --git a/libs/pigment/compositeops/KoStreamedMath.h b/libs/pigment/compositeops/KoStreamedMath.h
index 01fdde8..76a783c 100644
--- a/libs/pigment/compositeops/KoStreamedMath.h
+++ b/libs/pigment/compositeops/KoStreamedMath.h
@@ -48,6 +48,11 @@ struct KoStreamedMath {
using int_v = Vc::SimdArray<int, Vc::float_v::size()>;
using uint_v = Vc::SimdArray<unsigned int, Vc::float_v::size()>;
+using int32_16_v = Vc::SimdArray<qint32, Vc::uint16_v::size()>;
+using uint32_16_v = Vc::SimdArray<quint32, Vc::uint16_v::size()>;
+using uint16_16_v = Vc::SimdArray<quint16, Vc::uint16_v::size()>;
+
+
/**
* Composes src into dst without using vector instructions
*/
@@ -175,6 +180,18 @@ static inline void fetch_colors_32(const quint8 *data,
c3 = Vc::float_v(int_v( data_i & mask));
}
+template <bool aligned>
+static inline uint16_16_v fetch_alpha_32_into_uint16(const quint8 *data) {
+ uint32_16_v data_i;
+ if (aligned) {
+ data_i.load((const quint32*)data, Vc::Aligned);
+ } else {
+ data_i.load((const quint32*)data, Vc::Unaligned);
+ }
+
+ return uint16_16_v(data_i >> 24);
+}
+
/**
* Pack color and alpha values to Vc::float_v::size() pixels 32-bit each
* (4 channels, 8 bit per channel). The color data is considered
dkazakov edited the content of this paste. (Show Details)Feb 13 2018, 3:38 PM
dkazakov changed the title of this paste from untitled to Masterwork From Distant Lands.
dkazakov updated the paste's language from autodetect to autodetect.