ceil((width_exp + height_exp + 2 × max_depth + 1) / 8): enough bytes for a depth-max_depth cell plus its marker bit.
ceil((width_exp + height_exp + 2 × max_depth + 1) / 8)
max_depth
ceil((width_exp + height_exp + 2 × max_depth + 1) / 8): enough bytes for a depth-max_depthcell plus its marker bit.