Skip to content

Commit dae59c1

Browse files
committed
Remove -mask option and MAP_MASK flag
1 parent 1d3e3f8 commit dae59c1

8 files changed

Lines changed: 8 additions & 62 deletions

File tree

Docs/ChangeLog-4x.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ clocked at 4.2 GHz, running `astcenc` using AVX2 and 6 threads.
1414
The 4.3.0 release is an optimization release. There are minor performance
1515
and image quality improvements in this release.
1616

17+
Reminder - the codec library API is not designed to be binary compatible across
18+
versions. We always recommend rebuilding your client-side code using the updated
19+
`astcenc.h` header.
20+
1721
* **General:**
22+
* **Bug-fix:** Use lower case `windows.h` include for MinGW compatibility.
23+
* **Change:** The `-mask` command line option, `ASTCENC_FLG_MAP_MASK` in the
24+
library API, has been removed.
1825
* **Optimization:** Always skip blue-contraction for `QUANT_256` encodings.
1926
This gives a small image quality improvement for the 4x4 block size.
2027
* **Optimization:** Always skip RGBO vector calculation for LDR encodings.
@@ -24,7 +31,6 @@ and image quality improvements in this release.
2431
Impact increases with the active block size.
2532
* **Optimization:** Increased trial and refinement pruning by using stricter
2633
target errors when determining whether to skip iterations.
27-
* **Bug-fix:** Use lower case `windows.h` include for MinGW compatibility.
2834

2935
<!-- ---------------------------------------------------------------------- -->
3036
## 4.2.0

Source/astcenc.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,6 @@ enum astcenc_type
306306
*/
307307
static const unsigned int ASTCENC_FLG_MAP_NORMAL = 1 << 0;
308308

309-
/**
310-
* @brief Enable mask map compression.
311-
*
312-
* Input data will be treated a multi-layer mask map, where is is desirable for the color components
313-
* to be treated independently for the purposes of error analysis.
314-
*/
315-
static const unsigned int ASTCENC_FLG_MAP_MASK = 1 << 1;
316-
317309
/**
318310
* @brief Enable alpha weighting.
319311
*
@@ -376,7 +368,6 @@ static const unsigned int ASTCENC_FLG_MAP_RGBM = 1 << 6;
376368
* @brief The bit mask of all valid flags.
377369
*/
378370
static const unsigned int ASTCENC_ALL_FLAGS =
379-
ASTCENC_FLG_MAP_MASK |
380371
ASTCENC_FLG_MAP_NORMAL |
381372
ASTCENC_FLG_MAP_RGBM |
382373
ASTCENC_FLG_USE_ALPHA_WEIGHT |

Source/astcenc_entry.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ static astcenc_error validate_flags(
273273
}
274274

275275
// Flags field must only contain at most a single map type
276-
exMask = ASTCENC_FLG_MAP_MASK
277-
| ASTCENC_FLG_MAP_NORMAL
276+
exMask = ASTCENC_FLG_MAP_NORMAL
278277
| ASTCENC_FLG_MAP_RGBM;
279278
if (popcount(flags & exMask) > 1)
280279
{
@@ -665,12 +664,6 @@ astcenc_error astcenc_config_init(
665664
// so force compressor to try harder here ...
666665
config.tune_db_limit *= 1.03f;
667666
}
668-
else if (flags & ASTCENC_FLG_MAP_MASK)
669-
{
670-
// Masks are prone to blocking artifacts on mask edges
671-
// so force compressor to try harder here ...
672-
config.tune_db_limit *= 1.03f;
673-
}
674667
else if (flags & ASTCENC_FLG_MAP_RGBM)
675668
{
676669
config.rgbm_m_scale = 5.0f;

Source/astcenccli_toplevel.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,6 @@ static int init_astcenc_config(
551551
argidx++;
552552
flags |= ASTCENC_FLG_USE_ALPHA_WEIGHT;
553553
}
554-
else if (!strcmp(argv[argidx], "-mask"))
555-
{
556-
flags |= ASTCENC_FLG_MAP_MASK;
557-
}
558554
else if (!strcmp(argv[argidx], "-normal"))
559555
{
560556
flags |= ASTCENC_FLG_MAP_NORMAL;
@@ -842,10 +838,6 @@ static int edit_astcenc_config(
842838
cli_config.swz_decode.a = swizzle_components[3];
843839
}
844840
// presets begin here
845-
else if (!strcmp(argv[argidx], "-mask"))
846-
{
847-
argidx++;
848-
}
849841
else if (!strcmp(argv[argidx], "-normal"))
850842
{
851843
argidx++;

Source/astcenccli_toplevel_help.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,6 @@ COMPRESSION
159159
to consider for common usage, based on the type of image data being
160160
compressed.
161161
162-
-mask
163-
The input texture is a mask texture with unrelated data stored
164-
in the various color components, so enable error heuristics that
165-
aim to improve quality by minimizing the effect of error
166-
cross-talk across the color components.
167-
168162
-normal
169163
The input texture is a three component linear LDR normal map
170164
storing unit length normals as (R=X, G=Y, B=Z). The output will

Test/astc_test_functional.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -804,27 +804,6 @@ def test_valid_comp_hdr_output_formats(self):
804804
colOut = tli.Image(imOut2).get_colors((7, 7))
805805
self.assertColorSame(colIn, colOut2)
806806

807-
def test_compress_mask(self):
808-
"""
809-
Test compression of mask textures.
810-
"""
811-
decompFile = self.get_tmp_image_path("LDR", "decomp")
812-
813-
command = [
814-
self.binary, "-tl",
815-
"./Test/Images/Small/LDR-RGB/ldr-rgb-10.png",
816-
decompFile, "4x4", "-medium"]
817-
818-
noMaskdB = float(self.exec(command, LDR_RGB_PSNR_PATTERN))
819-
820-
command.append("-mask")
821-
maskdB = float(self.exec(command, LDR_RGB_PSNR_PATTERN))
822-
823-
# Note that this test simply asserts that the "-mask" is connected and
824-
# affects the output. We don't test it does something useful; that it
825-
# outside the scope of this test case.
826-
self.assertNotEqual(noMaskdB, maskdB)
827-
828807
def test_compress_normal_psnr(self):
829808
"""
830809
Test compression of normal textures using PSNR error metrics.

Test/testlib/encoder.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ def build_cli(self, image, blockSize="6x6", preset="-thorough",
285285
if image.colorFormat == "xy":
286286
command.append("-normal")
287287

288-
if image.isMask:
289-
command.append("-mask")
290-
291288
if image.isAlphaScaled:
292289
command.append("-a")
293290
command.append("1")
@@ -389,9 +386,6 @@ def build_cli(self, image, blockSize="6x6", preset="-thorough",
389386
if image.colorProfile == "hdr":
390387
command.append("-hdr")
391388

392-
if image.isMask:
393-
command.append("-mask")
394-
395389
if image.isAlphaScaled:
396390
command.append("-alphablend")
397391

Test/testlib/image.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class TestImage():
5959
colorFormat: The image color format.
6060
name: The image human name.
6161
is3D: True if the image is 3D, else False.
62-
isMask: True if the image is a non-correlated mask texture, else False.
6362
isAlphaScaled: True if the image wants alpha scaling, else False.
6463
TEST_EXTS: Expected test image extensions.
6564
PROFILES: Tuple of valid color profile values.
@@ -150,7 +149,6 @@ def decode_file_name(self, fileName):
150149

151150
# Set default values for the optional fields
152151
self.is3D = False
153-
self.isMask = False
154152
self.isAlphaScaled = False
155153

156154
# Decode the flags field if present
@@ -165,7 +163,6 @@ def decode_file_name(self, fileName):
165163
seenFlags.add(flag)
166164

167165
self.is3D = "3" in seenFlags
168-
self.isMask = "m" in seenFlags
169166
self.isAlphaScaled = "a" in seenFlags
170167

171168
def get_size(self):

0 commit comments

Comments
 (0)