s_levelSizeCases
global · image
- Address
0x5a81f8· 32 bytes, up to0x5a8217- Type
const void *[8]- Meaning
- Holds the case addresses of the format switch of 0x5a8140
- Confidence
- verified, proof one
- Finding
- image/mips#level-byte-size-and-pitch
Finding: Level byte size and pitch in image: mip geometry
0x5a8140(fmt, level, &size, &pitch) is the decoded size of a level for the formats the decoders
write: with wl, hl the dimensions shifted by the level and floored at 1 and area = wl · hl,
format 2 gives 4 · area with pitch 4 · wl, formats 3 to 5 give 2 · area with pitch 2 · wl,
format 9 gives 2 · area + max(1, area >> 2) with pitch 2 · wl, and any other format
gives 0 and returns 0.
The derivation is in the doc.