Skip to content

Commit

Permalink
astcenc: Update to 4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Feb 29, 2024
1 parent 7d2ca2d commit 82f20cd
Show file tree
Hide file tree
Showing 22 changed files with 1,040 additions and 717 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ License: BSD-3-clause

Files: ./thirdparty/astcenc/
Comment: Arm ASTC Encoder
Copyright: 2011-2023, Arm Limited
Copyright: 2011-2024, Arm Limited
License: Apache-2.0

Files: ./thirdparty/basis_universal/
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Files extracted from upstream source:
## astcenc

- Upstream: https://github.com/ARM-software/astc-encoder
- Version: 4.4.0 (5a5b5a1ef60dd47c27c28c66c118d22c40e3197e, 2023)
- Version: 4.7.0 (1a51f2915121275038677317c8bf61f1a78b590c, 2024)
- License: Apache 2.0

Files extracted from upstream source:
Expand Down
41 changes: 40 additions & 1 deletion thirdparty/astcenc/astcenc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2020-2023 Arm Limited
// Copyright 2020-2024 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -215,6 +215,8 @@ enum astcenc_error {
ASTCENC_ERR_BAD_CONTEXT,
/** @brief The call failed due to unimplemented functionality. */
ASTCENC_ERR_NOT_IMPLEMENTED,
/** @brief The call failed due to an out-of-spec decode mode flag set. */
ASTCENC_ERR_BAD_DECODE_MODE,
#if defined(ASTCENC_DIAGNOSTICS)
/** @brief The call failed due to an issue with diagnostic tracing. */
ASTCENC_ERR_DTRACE_FAILURE,
Expand Down Expand Up @@ -302,6 +304,11 @@ enum astcenc_type
ASTCENC_TYPE_F32 = 2
};

/**
* @brief Function pointer type for compression progress reporting callback.
*/
extern "C" typedef void (*astcenc_progress_callback)(float);

/**
* @brief Enable normal map compression.
*
Expand All @@ -312,6 +319,19 @@ enum astcenc_type
*/
static const unsigned int ASTCENC_FLG_MAP_NORMAL = 1 << 0;

/**
* @brief Enable compression heuristics that assume use of decode_unorm8 decode mode.
*
* The decode_unorm8 decode mode rounds differently to the decode_fp16 decode mode, so enabling this
* flag during compression will allow the compressor to use the correct rounding when selecting
* encodings. This will improve the compressed image quality if your application is using the
* decode_unorm8 decode mode, but will reduce image quality if using decode_fp16.
*
* Note that LDR_SRGB images will always use decode_unorm8 for the RGB channels, irrespective of
* this setting.
*/
static const unsigned int ASTCENC_FLG_USE_DECODE_UNORM8 = 1 << 1;

/**
* @brief Enable alpha weighting.
*
Expand Down Expand Up @@ -378,6 +398,7 @@ static const unsigned int ASTCENC_ALL_FLAGS =
ASTCENC_FLG_MAP_RGBM |
ASTCENC_FLG_USE_ALPHA_WEIGHT |
ASTCENC_FLG_USE_PERCEPTUAL |
ASTCENC_FLG_USE_DECODE_UNORM8 |
ASTCENC_FLG_DECOMPRESS_ONLY |
ASTCENC_FLG_SELF_DECOMPRESS_ONLY;

Expand Down Expand Up @@ -542,6 +563,24 @@ struct astcenc_config
*/
float tune_2plane_early_out_limit_correlation;

/**
* @brief The config enable for the mode0 fast-path search.
*
* If this is set to TUNE_MIN_TEXELS_MODE0 or higher then the early-out fast mode0
* search is enabled. This option is ineffective for 3D block sizes.
*/
float tune_search_mode0_enable;

/**
* @brief The progress callback, can be @c nullptr.
*
* If this is specified the codec will peridocially report progress for
* compression as a percentage between 0 and 100. The callback is called from one
* of the compressor threads, so doing significant work in the callback will
* reduce compression performance.
*/
astcenc_progress_callback progress_callback;

#if defined(ASTCENC_DIAGNOSTICS)
/**
* @brief The path to save the diagnostic trace data to.
Expand Down
Loading

0 comments on commit 82f20cd

Please sign in to comment.