Skip to content

Commit 0cd7af9

Browse files
authored
Update 3rd libs (#2411)
- astcenc to 5.2.0 - openssl to 3.0.16 - curl to 8.12.1 - png to 1.6.47
1 parent c6cd800 commit 0cd7af9

31 files changed

+1984
-3068
lines changed

3rdparty/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## astcenc
88
- [![Upstream](https://img.shields.io/github/v/release/ARM-software/astc-encoder?label=Upstream)](https://github.com/ARM-software/astc-encoder)
9-
- Version: 5.1.0
9+
- Version: 5.2.0
1010
- License: Apache-2.0
1111

1212
## Box2D
@@ -47,7 +47,7 @@
4747

4848
## curl
4949
- [![Upstream](https://img.shields.io/github/v/release/curl/curl?label=Upstream)](https://github.com/curl/curl)
50-
- Version: 8.11.1
50+
- Version: 8.12.1
5151
- License: Curl (MIT/X)
5252

5353
## doctest
@@ -180,12 +180,12 @@
180180

181181
## OpenSSL
182182
- [![Upstream](https://img.shields.io/github/v/tag/openssl/openssl?label=Upstream)](https://github.com/openssl/openssl)
183-
- Version: 3.0.15
183+
- Version: 3.0.16
184184
- License: Apache-2.0
185185

186186
## png
187187
- [![Upstream](https://img.shields.io/github/v/tag/glennrp/libpng?label=Upstream)](https://github.com/glennrp/libpng)
188-
- Version: 1.6.46
188+
- Version: 1.6.47
189189
- License: PNG Reference Library License version 2
190190

191191
## poly2tri

3rdparty/astcenc/astcenc.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2020-2024 Arm Limited
3+
// Copyright 2020-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -784,6 +784,20 @@ ASTCENC_PUBLIC astcenc_error astcenc_compress_image(
784784
ASTCENC_PUBLIC astcenc_error astcenc_compress_reset(
785785
astcenc_context* context);
786786

787+
/**
788+
* @brief Cancel any pending compression operation.
789+
*
790+
* The caller must behave as if the compression completed normally, even though the data will be
791+
* undefined. They are still responsible for synchronizing threads in the worker thread pool, and
792+
* must call reset before starting another compression.
793+
*
794+
* @param context Codec context.
795+
*
796+
* @return @c ASTCENC_SUCCESS on success, or an error if cancellation failed.
797+
*/
798+
ASTCENC_PUBLIC astcenc_error astcenc_compress_cancel(
799+
astcenc_context* context);
800+
787801
/**
788802
* @brief Decompress an image.
789803
*

3rdparty/astcenc/astcenc_color_unquantize.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -925,15 +925,8 @@ void unpack_color_endpoints(
925925
alpha_hdr = false;
926926
}
927927

928-
vmask4 mask(true, true, true, false);
929-
930-
vint4 output0rgb = lsl<8>(output0) | vint4(0x80);
931-
vint4 output0a = output0 * 257;
932-
output0 = select(output0a, output0rgb, mask);
933-
934-
vint4 output1rgb = lsl<8>(output1) | vint4(0x80);
935-
vint4 output1a = output1 * 257;
936-
output1 = select(output1a, output1rgb, mask);
928+
output0 = lsl<8>(output0) | vint4(0x80);
929+
output1 = lsl<8>(output1) | vint4(0x80);
937930
}
938931
// An HDR profile decode, but may be using linear LDR endpoints
939932
// Linear LDR 8-bit endpoints are expanded to 16-bit by replication

3rdparty/astcenc/astcenc_compress_symbolic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2024 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -1280,7 +1280,7 @@ void compress_block(
12801280
1.0f
12811281
};
12821282

1283-
static const float errorval_overshoot = 1.0f / ctx.config.tune_mse_overshoot;
1283+
const float errorval_overshoot = 1.0f / ctx.config.tune_mse_overshoot;
12841284

12851285
// Only enable MODE0 fast path if enabled
12861286
// Never enable for 3D blocks as no "always" block modes are available

3rdparty/astcenc/astcenc_entry.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2024 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -1123,6 +1123,29 @@ astcenc_error astcenc_compress_reset(
11231123
#endif
11241124
}
11251125

1126+
/* See header for documentation. */
1127+
astcenc_error astcenc_compress_cancel(
1128+
astcenc_context* ctxo
1129+
) {
1130+
#if defined(ASTCENC_DECOMPRESS_ONLY)
1131+
(void)ctxo;
1132+
return ASTCENC_ERR_BAD_CONTEXT;
1133+
#else
1134+
astcenc_contexti* ctx = &ctxo->context;
1135+
if (ctx->config.flags & ASTCENC_FLG_DECOMPRESS_ONLY)
1136+
{
1137+
return ASTCENC_ERR_BAD_CONTEXT;
1138+
}
1139+
1140+
// Cancel compression before cancelling avg. This avoids the race condition
1141+
// where cancelling them in the other order could see a compression worker
1142+
// starting to process even though some of the avg data is undefined.
1143+
ctxo->manage_compress.cancel();
1144+
ctxo->manage_avg.cancel();
1145+
return ASTCENC_SUCCESS;
1146+
#endif
1147+
}
1148+
11261149
/* See header for documentation. */
11271150
astcenc_error astcenc_decompress_image(
11281151
astcenc_context* ctxo,

3rdparty/astcenc/astcenc_internal.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,19 +1583,13 @@ static inline vmask4 get_u8_component_mask(
15831583
astcenc_profile decode_mode,
15841584
const image_block& blk
15851585
) {
1586-
vmask4 u8_mask(false);
1587-
// Decode mode writing to a unorm8 output value
1588-
if (blk.decode_unorm8)
1586+
// Decode mode or sRGB forces writing to unorm8 output value
1587+
if (blk.decode_unorm8 || decode_mode == ASTCENC_PRF_LDR_SRGB)
15891588
{
1590-
u8_mask = vmask4(true);
1591-
}
1592-
// SRGB writing to a unorm8 RGB value
1593-
else if (decode_mode == ASTCENC_PRF_LDR_SRGB)
1594-
{
1595-
u8_mask = vmask4(true, true, true, false);
1589+
return vmask4(true);
15961590
}
15971591

1598-
return u8_mask;
1592+
return vmask4(false);
15991593
}
16001594

16011595
/**

3rdparty/astcenc/astcenc_internal_entry.h

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2024 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -100,6 +100,9 @@ class ParallelManager
100100
/** @brief Lock used for critical section and condition synchronization. */
101101
std::mutex m_lock;
102102

103+
/** @brief True if the current operation is cancelled. */
104+
std::atomic<bool> m_is_cancelled;
105+
103106
/** @brief True if the stage init() step has been executed. */
104107
bool m_init_done;
105108

@@ -147,6 +150,7 @@ class ParallelManager
147150
{
148151
m_init_done = false;
149152
m_term_done = false;
153+
m_is_cancelled = false;
150154
m_start_count = 0;
151155
m_done_count = 0;
152156
m_task_count = 0;
@@ -155,6 +159,16 @@ class ParallelManager
155159
m_callback_min_diff = 1.0f;
156160
}
157161

162+
/**
163+
* @brief Clear the tracker and stop new tasks being assigned.
164+
*
165+
* Note, all in-flight tasks in a worker will still complete normally.
166+
*/
167+
void cancel()
168+
{
169+
m_is_cancelled = true;
170+
}
171+
158172
/**
159173
* @brief Trigger the pipeline stage init step.
160174
*
@@ -211,7 +225,7 @@ class ParallelManager
211225
unsigned int get_task_assignment(unsigned int granule, unsigned int& count)
212226
{
213227
unsigned int base = m_start_count.fetch_add(granule, std::memory_order_relaxed);
214-
if (base >= m_task_count)
228+
if (m_is_cancelled || base >= m_task_count)
215229
{
216230
count = 0;
217231
return 0;
@@ -241,16 +255,17 @@ class ParallelManager
241255
local_count = m_done_count;
242256
local_last_value = m_callback_last_value;
243257

244-
if (m_done_count == m_task_count)
258+
// Ensure the progress bar hits 100%
259+
if (m_callback && m_done_count == m_task_count)
245260
{
246-
// Ensure the progress bar hits 100%
247-
if (m_callback)
248-
{
249-
std::unique_lock<std::mutex> cblck(m_callback_lock);
250-
m_callback(100.0f);
251-
m_callback_last_value = 100.0f;
252-
}
261+
std::unique_lock<std::mutex> cblck(m_callback_lock);
262+
m_callback(100.0f);
263+
m_callback_last_value = 100.0f;
264+
}
253265

266+
// Notify if nothing left to do
267+
if (m_is_cancelled || m_done_count == m_task_count)
268+
{
254269
lck.unlock();
255270
m_complete.notify_all();
256271
}
@@ -285,7 +300,7 @@ class ParallelManager
285300
void wait()
286301
{
287302
std::unique_lock<std::mutex> lck(m_lock);
288-
m_complete.wait(lck, [this]{ return m_done_count == m_task_count; });
303+
m_complete.wait(lck, [this]{ return m_is_cancelled || m_done_count == m_task_count; });
289304
}
290305

291306
/**

3rdparty/astcenc/astcenc_vecmathlib_neon_4.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -582,15 +582,6 @@ ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
582582
return vint4(vmaxvq_s32(a.m));
583583
}
584584

585-
/**
586-
* @brief Return the horizontal sum of a vector.
587-
*/
588-
ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
589-
{
590-
int32x2_t t = vadd_s32(vget_high_s32(a.m), vget_low_s32(a.m));
591-
return vget_lane_s32(vpadd_s32(t, t), 0);
592-
}
593-
594585
/**
595586
* @brief Store a vector to a 16B aligned memory address.
596587
*/

3rdparty/astcenc/astcenc_vecmathlib_none_4.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,6 @@ ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
646646
return vint4(std::max(b, c));
647647
}
648648

649-
/**
650-
* @brief Return the horizontal sum of vector lanes as a scalar.
651-
*/
652-
ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
653-
{
654-
return a.m[0] + a.m[1] + a.m[2] + a.m[3];
655-
}
656-
657649
/**
658650
* @brief Store a vector to an aligned memory address.
659651
*/

3rdparty/astcenc/astcenc_vecmathlib_sse_4.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -621,22 +621,6 @@ ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
621621
return a;
622622
}
623623

624-
/**
625-
* @brief Return the horizontal sum of a vector as a scalar.
626-
*/
627-
ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
628-
{
629-
// Add top and bottom halves, lane 1/0
630-
__m128i fold = _mm_castps_si128(_mm_movehl_ps(_mm_castsi128_ps(a.m),
631-
_mm_castsi128_ps(a.m)));
632-
__m128i t = _mm_add_epi32(a.m, fold);
633-
634-
// Add top and bottom halves, lane 0 (_mm_hadd_ps exists but slow)
635-
t = _mm_add_epi32(t, _mm_shuffle_epi32(t, 0x55));
636-
637-
return _mm_cvtsi128_si32(t);
638-
}
639-
640624
/**
641625
* @brief Store a vector to a 16B aligned memory address.
642626
*/

0 commit comments

Comments
 (0)