Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/zimg/files/, media-libs/zimg/
Date: Sun, 28 Jul 2019 21:21:10
Message-Id: 1564348848.e77dea4a53648561d5aeee46c779e4d546f979ef.asturm@gentoo
1 commit: e77dea4a53648561d5aeee46c779e4d546f979ef
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 28 21:17:43 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 28 21:20:48 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e77dea4a
7
8 media-libs/zimg: Drop old
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 media-libs/zimg/Manifest | 3 -
14 media-libs/zimg/files/zimg-2.7.5-sse2.patch | 231 ----------------------------
15 media-libs/zimg/zimg-2.5.ebuild | 36 -----
16 media-libs/zimg/zimg-2.7.4.ebuild | 36 -----
17 media-libs/zimg/zimg-2.7.5.ebuild | 33 ----
18 5 files changed, 339 deletions(-)
19
20 diff --git a/media-libs/zimg/Manifest b/media-libs/zimg/Manifest
21 index 71b6acd6d38..812439a44b6 100644
22 --- a/media-libs/zimg/Manifest
23 +++ b/media-libs/zimg/Manifest
24 @@ -1,4 +1 @@
25 -DIST zimg-2.5.tar.gz 213054 BLAKE2B 0532693c11c1b2bcc0d5bde3a0bc16bf4f736ceff5fcda5d9bf491fcebe7e8be538041cc536e40bc110e438370c8599ce0be35f71cea00429b16c6eeb680cb86 SHA512 7fc48c704b434d837c36d4bafc51b35789eaf90fc81a68dcd7ec546f1e82a3e41c53263f8d381541d5c0ce58e25dddf0adaf1c3575512842ae633b5581778938
26 -DIST zimg-2.7.4.tar.gz 246376 BLAKE2B b6a21a1f7ca5106810485a69bb4e8f1d59d67fe3a619fd0ac412b1e441fe2d8892f64826666fbdfa48ae441fa5a21512b5ba0977eeaca7dcb7e0fcc43447f6e4 SHA512 adbb525b2611ef5267a4c0d4e8c6dd164c2814241c4d58d5356545b23dcf0cbeabb140141ae6ff0e70ef8e0741e351cbfadbadd60923061ddd693a2c3d9e5fde
27 -DIST zimg-2.7.5.tar.gz 246416 BLAKE2B a0ce1497356238aee5d3965a7ec57f1591d51c5df2475fb05d208a07f1431f073f8caaac110775fb17c6df8f887ed974b53f262e01f5532de13dc4c539958c1b SHA512 600139f86b074f2ed9614daa58d969465fa3d1578d8165bd2f841193f7b793c4b36389064dd4eee8e01e66a745d1c71c62e5bdb0b5283e54c435ed4a130a5b3b
28 DIST zimg-2.8.tar.gz 265363 BLAKE2B a8982c64325e0089617136fcd5d6ee429ab861e3b9445b9cc0292bd3bbd3abb5783e94983e3e802fd9e59c2c7089eeea176d1eda4f3a850379cfc4fb36cbc408 SHA512 1e89087a756798a7ae3bfae3bc8244b29ae8ae7f04f53bdf6c4d4de3cb11412dc1eecd95a4a121bb9077437e633f8fbb665522ff8112ade806d9191ea4b5f7bf
29
30 diff --git a/media-libs/zimg/files/zimg-2.7.5-sse2.patch b/media-libs/zimg/files/zimg-2.7.5-sse2.patch
31 deleted file mode 100644
32 index 77483ab59e7..00000000000
33 --- a/media-libs/zimg/files/zimg-2.7.5-sse2.patch
34 +++ /dev/null
35 @@ -1,231 +0,0 @@
36 -From e30112df0ca703be82ed2c852511916fc46defbd Mon Sep 17 00:00:00 2001
37 -From: sekrit-twc <noreply@×××××××.com>
38 -Date: Fri, 22 Mar 2019 18:51:14 -0700
39 -Subject: [PATCH] colorspace: use bfloat16 for SSE2 linear-to-gamma LUT
40 -
41 -On Skylake, processing 512 pixel array:
42 -
43 -direction cycles/sample cycles/pxvector
44 - g->l 2.35 9.43
45 - l->g 2.49 9.97
46 ----
47 - .../colorspace/x86/operation_impl_avx2.cpp | 3 +-
48 - .../colorspace/x86/operation_impl_sse2.cpp | 104 ++++++++++++++++--
49 - test/colorspace/x86/colorspace_sse2_test.cpp | 14 +--
50 - 3 files changed, 100 insertions(+), 21 deletions(-)
51 -
52 -diff --git a/src/zimg/colorspace/x86/operation_impl_avx2.cpp b/src/zimg/colorspace/x86/operation_impl_avx2.cpp
53 -index bbbbf896..f0e7f792 100644
54 ---- a/src/zimg/colorspace/x86/operation_impl_avx2.cpp
55 -+++ b/src/zimg/colorspace/x86/operation_impl_avx2.cpp
56 -@@ -114,8 +114,7 @@ class ToGammaLutOperationAVX2 final : public Operation {
57 - {
58 - EnsureSinglePrecision x87;
59 -
60 -- // Allocate an extra LUT entry so that indexing can be done by multipying by a power of 2.
61 -- for (unsigned long i = 0; i <= UINT16_MAX; ++i) {
62 -+ for (size_t i = 0; i <= UINT16_MAX; ++i) {
63 - uint16_t half = static_cast<uint16_t>(i);
64 - float x = _mm_cvtss_f32(_mm_cvtph_ps(_mm_set1_epi16(half)));
65 - m_lut[i] = func(x * prescale);
66 -diff --git a/src/zimg/colorspace/x86/operation_impl_sse2.cpp b/src/zimg/colorspace/x86/operation_impl_sse2.cpp
67 -index 48645031..da9d4dbc 100644
68 ---- a/src/zimg/colorspace/x86/operation_impl_sse2.cpp
69 -+++ b/src/zimg/colorspace/x86/operation_impl_sse2.cpp
70 -@@ -3,11 +3,13 @@
71 - #include <algorithm>
72 - #include <cstddef>
73 - #include <cstdint>
74 -+#include <type_traits>
75 - #include <vector>
76 - #include <emmintrin.h>
77 - #include "common/align.h"
78 - #include "common/ccdep.h"
79 - #include "common/make_unique.h"
80 -+#include "common/x86/sse2_util.h"
81 - #include "colorspace/gamma.h"
82 - #include "colorspace/operation.h"
83 - #include "colorspace/operation_impl.h"
84 -@@ -20,14 +22,25 @@ namespace {
85 -
86 - constexpr unsigned LUT_DEPTH = 16;
87 -
88 --void lut_filter_line(const float *RESTRICT lut, unsigned lut_depth, float prescale, const float *src, float *dst, unsigned left, unsigned right)
89 -+template <class T, class U>
90 -+T bit_cast(const U &x) noexcept
91 -+{
92 -+ static_assert(sizeof(T) == sizeof(U), "object sizes must match");
93 -+ static_assert(std::is_pod<T>::value && std::is_pod<U>::value, "object types must be POD");
94 -+
95 -+ T ret;
96 -+ std::copy_n(reinterpret_cast<const char *>(&x), sizeof(x), reinterpret_cast<char *>(&ret));
97 -+ return ret;
98 -+}
99 -+
100 -+void to_linear_lut_filter_line(const float *RESTRICT lut, unsigned lut_depth, const float *src, float *dst, unsigned left, unsigned right)
101 - {
102 - unsigned vec_left = ceil_n(left, 4);
103 - unsigned vec_right = floor_n(right, 4);
104 -
105 - const int32_t lut_limit = static_cast<int32_t>(1) << lut_depth;
106 -
107 -- const __m128 scale = _mm_set_ps1(0.5f * prescale * lut_limit);
108 -+ const __m128 scale = _mm_set_ps1(0.5f * lut_limit);
109 - const __m128 offset = _mm_set_ps1(0.25f * lut_limit);
110 - const __m128i limit = _mm_set1_epi16(std::min(lut_limit + INT16_MIN, static_cast<int32_t>(INT16_MAX)));
111 - const __m128i bias_epi16 = _mm_set1_epi16(INT16_MIN);
112 -@@ -73,16 +86,61 @@ void lut_filter_line(const float *RESTRICT lut, unsigned lut_depth, float presca
113 - }
114 - }
115 -
116 -+void to_gamma_lut_filter_line(const float *RESTRICT lut, const float *src, float *dst, unsigned left, unsigned right)
117 -+{
118 -+ unsigned vec_left = ceil_n(left, 4);
119 -+ unsigned vec_right = floor_n(right, 4);
120 -+
121 -+ for (unsigned j = left; j < vec_left; ++j) {
122 -+ __m128i x = _mm_castps_si128(_mm_load_ss(src + j));
123 -+ __m128i msb = _mm_srli_epi32(x, 16);
124 -+ __m128i lsb = _mm_and_si128(_mm_srli_epi32(x, 15), _mm_set1_epi32(1));
125 -+ x = mm_packus_epi32(msb, lsb);
126 -+ x = _mm_adds_epi16(x, _mm_shuffle_epi32(x, _MM_SHUFFLE(1, 0, 3, 2)));
127 -+
128 -+ dst[j] = lut[_mm_cvtsi128_si32(x)];
129 -+ }
130 -+ for (unsigned j = vec_left; j < vec_right; j += 4) {
131 -+ __m128i x = _mm_castps_si128(_mm_load_ps(src + j));
132 -+ __m128i msb = _mm_srli_epi32(x, 16);
133 -+ __m128i lsb = _mm_and_si128(_mm_srli_epi32(x, 15), _mm_set1_epi32(1));
134 -+ x = mm_packus_epi32(msb, lsb);
135 -+ x = _mm_adds_epi16(x, _mm_shuffle_epi32(x, _MM_SHUFFLE(1, 0, 3, 2)));
136 -+
137 -+#if SIZE_MAX >= UINT64_MAX
138 -+ uint64_t tmp = _mm_cvtsi128_si64(x);
139 -+ dst[j + 0] = lut[tmp & 0xFFFFU];
140 -+ dst[j + 1] = lut[(tmp >> 16) & 0xFFFFU];
141 -+ dst[j + 2] = lut[(tmp >> 32) & 0xFFFFU];
142 -+ dst[j + 3] = lut[tmp >> 48];
143 -+#else
144 -+ uint32_t tmp0 = _mm_cvtsi128_si32(x);
145 -+ uint32_t tmp1 = _mm_cvtsi128_si32(_mm_shuffle_epi32(x, _MM_SHUFFLE(3, 2, 0, 1)));
146 -+ dst[j + 0] = lut[tmp0 & 0xFFFFU];
147 -+ dst[j + 1] = lut[tmp0 >> 16];
148 -+ dst[j + 2] = lut[tmp1 & 0xFFFFU];
149 -+ dst[j + 3] = lut[tmp1 >> 16];
150 -+#endif
151 -+ }
152 -+ for (unsigned j = vec_right; j < right; ++j) {
153 -+ __m128i x = _mm_castps_si128(_mm_load_ss(src + j));
154 -+ __m128i msb = _mm_srli_epi32(x, 16);
155 -+ __m128i lsb = _mm_and_si128(_mm_srli_epi32(x, 15), _mm_set1_epi32(1));
156 -+ x = mm_packus_epi32(msb, lsb);
157 -+ x = _mm_adds_epi16(x, _mm_shuffle_epi32(x, _MM_SHUFFLE(1, 0, 3, 2)));
158 -+
159 -+ dst[j] = lut[_mm_cvtsi128_si32(x)];
160 -+ }
161 -+}
162 -+
163 -
164 --class LutOperationSSE2 final : public Operation {
165 -+class ToLinearLutOperationSSE2 final : public Operation {
166 - std::vector<float> m_lut;
167 - unsigned m_lut_depth;
168 -- float m_prescale;
169 - public:
170 -- LutOperationSSE2(gamma_func func, unsigned lut_depth, float prescale, float postscale) :
171 -+ ToLinearLutOperationSSE2(gamma_func func, unsigned lut_depth, float postscale) :
172 - m_lut((1UL << lut_depth) + 1),
173 -- m_lut_depth{ lut_depth },
174 -- m_prescale{ static_cast<float>(prescale) }
175 -+ m_lut_depth{ lut_depth }
176 - {
177 - EnsureSinglePrecision x87;
178 -
179 -@@ -95,9 +153,31 @@ class LutOperationSSE2 final : public Operation {
180 -
181 - void process(const float * const *src, float * const *dst, unsigned left, unsigned right) const override
182 - {
183 -- lut_filter_line(m_lut.data(), m_lut_depth, m_prescale, src[0], dst[0], left, right);
184 -- lut_filter_line(m_lut.data(), m_lut_depth, m_prescale, src[1], dst[1], left, right);
185 -- lut_filter_line(m_lut.data(), m_lut_depth, m_prescale, src[2], dst[2], left, right);
186 -+ to_linear_lut_filter_line(m_lut.data(), m_lut_depth, src[0], dst[0], left, right);
187 -+ to_linear_lut_filter_line(m_lut.data(), m_lut_depth, src[1], dst[1], left, right);
188 -+ to_linear_lut_filter_line(m_lut.data(), m_lut_depth, src[2], dst[2], left, right);
189 -+ }
190 -+};
191 -+
192 -+class ToGammaLutOperationSSE2 final : public Operation {
193 -+ std::vector<float> m_lut;
194 -+public:
195 -+ ToGammaLutOperationSSE2(gamma_func func, float prescale) :
196 -+ m_lut(static_cast<uint32_t>(UINT16_MAX) + 1)
197 -+ {
198 -+ EnsureSinglePrecision x87;
199 -+
200 -+ for (size_t i = 0; i <= UINT16_MAX; ++i) {
201 -+ float x = bit_cast<float>(static_cast<uint32_t>(i << 16));
202 -+ m_lut[i] = func(x * prescale);
203 -+ }
204 -+ }
205 -+
206 -+ void process(const float * const *src, float * const *dst, unsigned left, unsigned right) const override
207 -+ {
208 -+ to_gamma_lut_filter_line(m_lut.data(), src[0], dst[0], left, right);
209 -+ to_gamma_lut_filter_line(m_lut.data(), src[1], dst[1], left, right);
210 -+ to_gamma_lut_filter_line(m_lut.data(), src[2], dst[2], left, right);
211 - }
212 - };
213 -
214 -@@ -109,7 +189,7 @@ std::unique_ptr<Operation> create_gamma_operation_sse2(const TransferFunction &t
215 - if (!params.approximate_gamma)
216 - return nullptr;
217 -
218 -- return ztd::make_unique<LutOperationSSE2>(transfer.to_gamma, LUT_DEPTH, transfer.to_gamma_scale, 1.0f);
219 -+ return ztd::make_unique<ToGammaLutOperationSSE2>(transfer.to_gamma, transfer.to_gamma_scale);
220 - }
221 -
222 - std::unique_ptr<Operation> create_inverse_gamma_operation_sse2(const TransferFunction &transfer, const OperationParams &params)
223 -@@ -117,7 +197,7 @@ std::unique_ptr<Operation> create_inverse_gamma_operation_sse2(const TransferFun
224 - if (!params.approximate_gamma)
225 - return nullptr;
226 -
227 -- return ztd::make_unique<LutOperationSSE2>(transfer.to_linear, LUT_DEPTH, 1.0f, transfer.to_linear_scale);
228 -+ return ztd::make_unique<ToLinearLutOperationSSE2>(transfer.to_linear, LUT_DEPTH, transfer.to_linear_scale);
229 - }
230 -
231 - } // namespace colorspace
232 -diff --git a/test/colorspace/x86/colorspace_sse2_test.cpp b/test/colorspace/x86/colorspace_sse2_test.cpp
233 -index d5130868..ecaa05e7 100644
234 ---- a/test/colorspace/x86/colorspace_sse2_test.cpp
235 -+++ b/test/colorspace/x86/colorspace_sse2_test.cpp
236 -@@ -53,9 +53,9 @@ TEST(ColorspaceConversionSSE2Test, test_transfer_lut)
237 - "162687e701627cdc17283a32c36ea711d28a953e"
238 - },
239 - {
240 -- "492587e7ed75b7e3ab868bead6ade7a4137c6ea1",
241 -- "3b0694e9fbce61466cb5a575f300d784089b6cad",
242 -- "b68f103f52ccafae867d664d7f27fe56ae9208af"
243 -+ "95f2715bd0d417028bebd5c5377180fcd5b01119",
244 -+ "76f7c88b198f1ab08167f8162c1237b54f22007a",
245 -+ "1099c3ae187c0a9f79acb9445761b6056218c779"
246 - },
247 - {
248 - "4c0b5ffe768a7812d1ef102b4d8d52614838bc8e",
249 -@@ -63,13 +63,13 @@ TEST(ColorspaceConversionSSE2Test, test_transfer_lut)
250 - "85a277a80dfca2e21789cedd76aaee307dbc4562"
251 - },
252 - {
253 -- "df546ce0ad6f859499a96d2d697d896067e60e38",
254 -- "f0041b8a008ab45f0ea1319090ac7e8be0990d92",
255 -- "06880efb598e41f96fa79e04dbdfcccd50d6dc6f"
256 -+ "5e35786d313e936566d9873ba7a08a8d6005b2ee",
257 -+ "829fa88acfbbb26801871bf3cadf5cc2eb6830c9",
258 -+ "f82fcad18a19b548d419a1952b6a7a423a684b62"
259 - },
260 - };
261 - const double expected_tolinear_snr = 80.0;
262 -- const double expected_togamma_snr = 40.0;
263 -+ const double expected_togamma_snr = 60.0;
264 -
265 - SCOPED_TRACE("tolinear 709");
266 - test_case({ MatrixCoefficients::RGB, TransferCharacteristics::REC_709, ColorPrimaries::UNSPECIFIED },
267
268 diff --git a/media-libs/zimg/zimg-2.5.ebuild b/media-libs/zimg/zimg-2.5.ebuild
269 deleted file mode 100644
270 index df91e3a3d81..00000000000
271 --- a/media-libs/zimg/zimg-2.5.ebuild
272 +++ /dev/null
273 @@ -1,36 +0,0 @@
274 -# Copyright 1999-2019 Gentoo Authors
275 -# Distributed under the terms of the GNU General Public License v2
276 -
277 -EAPI=5
278 -
279 -AUTOTOOLS_AUTORECONF=yes
280 -
281 -SCM=""
282 -
283 -if [ "${PV#9999}" != "${PV}" ] ; then
284 - SCM="git-r3"
285 - EGIT_REPO_URI="https://github.com/sekrit-twc/zimg"
286 -fi
287 -
288 -inherit autotools-multilib ${SCM}
289 -
290 -DESCRIPTION="Scaling, colorspace conversion, and dithering library"
291 -HOMEPAGE="https://github.com/sekrit-twc/zimg"
292 -
293 -if [ "${PV#9999}" = "${PV}" ] ; then
294 - SRC_URI="https://github.com/sekrit-twc/zimg/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
295 - KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86"
296 - S="${WORKDIR}/${PN}-release-${PV}/"
297 -fi
298 -
299 -LICENSE="WTFPL-2"
300 -SLOT="0"
301 -IUSE="static-libs cpu_flags_x86_sse"
302 -
303 -DEPEND=""
304 -RDEPEND="${DEPEND}"
305 -
306 -src_configure() {
307 - autotools-multilib_src_configure \
308 - $(use_enable cpu_flags_x86_sse x86simd)
309 -}
310
311 diff --git a/media-libs/zimg/zimg-2.7.4.ebuild b/media-libs/zimg/zimg-2.7.4.ebuild
312 deleted file mode 100644
313 index 1d720a336c9..00000000000
314 --- a/media-libs/zimg/zimg-2.7.4.ebuild
315 +++ /dev/null
316 @@ -1,36 +0,0 @@
317 -# Copyright 1999-2019 Gentoo Authors
318 -# Distributed under the terms of the GNU General Public License v2
319 -
320 -EAPI=5
321 -
322 -AUTOTOOLS_AUTORECONF=yes
323 -
324 -SCM=""
325 -
326 -if [ "${PV#9999}" != "${PV}" ] ; then
327 - SCM="git-r3"
328 - EGIT_REPO_URI="https://github.com/sekrit-twc/zimg"
329 -fi
330 -
331 -inherit autotools-multilib ${SCM}
332 -
333 -DESCRIPTION="Scaling, colorspace conversion, and dithering library"
334 -HOMEPAGE="https://github.com/sekrit-twc/zimg"
335 -
336 -if [ "${PV#9999}" = "${PV}" ] ; then
337 - SRC_URI="https://github.com/sekrit-twc/zimg/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
338 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
339 - S="${WORKDIR}/${PN}-release-${PV}/"
340 -fi
341 -
342 -LICENSE="WTFPL-2"
343 -SLOT="0"
344 -IUSE="static-libs cpu_flags_x86_sse"
345 -
346 -DEPEND=""
347 -RDEPEND="${DEPEND}"
348 -
349 -src_configure() {
350 - autotools-multilib_src_configure \
351 - $(use_enable cpu_flags_x86_sse x86simd)
352 -}
353
354 diff --git a/media-libs/zimg/zimg-2.7.5.ebuild b/media-libs/zimg/zimg-2.7.5.ebuild
355 deleted file mode 100644
356 index 7bac59befc3..00000000000
357 --- a/media-libs/zimg/zimg-2.7.5.ebuild
358 +++ /dev/null
359 @@ -1,33 +0,0 @@
360 -# Copyright 1999-2019 Gentoo Authors
361 -# Distributed under the terms of the GNU General Public License v2
362 -
363 -EAPI=7
364 -
365 -if [[ ${PV} = *9999* ]] ; then
366 - EGIT_REPO_URI="https://github.com/sekrit-twc/zimg"
367 - inherit git-r3
368 -else
369 - SRC_URI="https://github.com/sekrit-twc/zimg/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
370 - KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
371 - S="${WORKDIR}/${PN}-release-${PV}/"
372 -fi
373 -inherit autotools multilib-minimal
374 -
375 -DESCRIPTION="Scaling, colorspace conversion, and dithering library"
376 -HOMEPAGE="https://github.com/sekrit-twc/zimg"
377 -
378 -LICENSE="WTFPL-2"
379 -SLOT="0"
380 -IUSE="static-libs cpu_flags_x86_sse"
381 -
382 -PATCHES=( "${FILESDIR}/${P}-sse2.patch" )
383 -
384 -src_prepare() {
385 - default
386 - eautoreconf
387 -}
388 -
389 -multilib_src_configure() {
390 - ECONF_SOURCE="${S}" econf \
391 - $(use_enable cpu_flags_x86_sse x86simd)
392 -}