1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

LibGfx/JPEGXL: Support clusters with a single distribution

This type of cluster is an exception and has specific rules (but
simpler) to be read. This is a requirement to support complex
distributions as they use a symbol decoder initialized with a single
distribution.
This commit is contained in:
Lucas CHOLLET 2023-07-23 14:39:02 -04:00 committed by Andreas Kling
parent a8857c06b3
commit 18c511f54c

View file

@ -1201,8 +1201,12 @@ private:
ErrorOr<void> read_pre_clustered_distributions(LittleEndianInputBitStream& stream, u8 num_distrib)
{
// C.2.2 Distribution clustering
if (num_distrib == 1)
TODO();
if (num_distrib == 1) {
// If num_dist == 1, then num_clusters = 1 and clusters[0] = 0, and the remainder of this subclause is skipped.
m_clusters = { 0 };
TRY(m_configs.try_resize(1));
return {};
};
TRY(m_clusters.try_resize(num_distrib));