mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibGfx/JPEGXL: Consider the HfGlobal section of the TOC
There is always a section for HfGlobal, even if it's empty like with Modular images. I also removed the outdated (and misinterpreted) spec comment and replace it with the name of the section.
This commit is contained in:
parent
ea8384219f
commit
c6731b0970
1 changed files with 2 additions and 8 deletions
|
@ -652,17 +652,11 @@ struct TOC {
|
|||
|
||||
static u64 num_toc_entries(FrameHeader const& frame_header, u64 num_groups, u64 num_lf_groups)
|
||||
{
|
||||
// F.3.1 - General
|
||||
if (num_groups == 1 && frame_header.passes.num_passes == 1)
|
||||
return 1;
|
||||
|
||||
// Otherwise, there is one entry for each of the following sections,
|
||||
// in the order they are listed: LfGlobal, one per LfGroup in raster
|
||||
// order, one for HfGlobal followed by HfPass data for all the passes,
|
||||
// and num_groups * frame_header.passes.num_passes for the PassGroup sections.
|
||||
|
||||
auto const hf_contribution = frame_header.encoding == FrameHeader::Encoding::kVarDCT ? (1 + frame_header.passes.num_passes) : 0;
|
||||
|
||||
return 1 + num_lf_groups + hf_contribution + num_groups * frame_header.passes.num_passes;
|
||||
return 1 + num_lf_groups + 1 + num_groups * frame_header.passes.num_passes;
|
||||
}
|
||||
|
||||
static ErrorOr<TOC> read_toc(LittleEndianInputBitStream& stream, FrameHeader const& frame_header, u64 num_groups, u64 num_lf_groups)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue