Overview
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
29
To reduce the amount of required memory the 2D core HW supports compressed images.
4.9.1 Compression Formats
The following compression formats for pixel buffer are supported by the 2D core.
Name
Features
Limitations
Recommended use
case
Run-length coded
MML_GDC_SURF_COMP_RLC
−
Lossless compression.
−
Backward compatible to
legacy devices.
−
RLC compression can be
used in combination with
indexed color.
−
Only supported as read
buffer for blit operations and
as window content.
−
Rotation or mirroring is not
supported.
−
Compression of
source images with
long line parts with
constant color.
Run-Length Adaptive
MML_GDC_SURF_COMP_RLA
−
Lossless compression.
−
Good compression
results for images with
smooth content borders.
−
Only supported as read
buffer for blit operations and
as window content.
−
Rotation or mirroring is not
supported.
−
A compressed buffer must
not exceed the window
dimension.
−
Compression of
source images.
Run-Length Adaptive
Dithering
MML_GDC_SURF_COMP_RLA
D
−
The 2D core HW can
read and write this
format.
−
Maximum buffer size can
be calculated (1).
−
Lossy compression.
−
Rotation or mirroring is not
supported.
−
A compressed buffer must
not exceed the window
dimension.
−
Compression of
source images with
size limitation.
4.9.1.1
Calculation of required buffer size for RLAD compression
The following formula can be used to calculate the maximal required buffer size:
pixel_size = cbp cbp cbp cbpc3_max
header_size = (cbpc0 cbpc1 cbpc2 cbpc3_width) + (bpc0 + bpc1 + bpc2 + bpc3)
num_header = ceil(frame_width / 8) * frame_height
buf_size = num_header * heade frame_width * frame_height * pixel_size
buf_words = ceil(buf_size / 32)
bpc0/1/2/3: ComponentBitsRed/Green/Blue/Alpha (see MML_GDC_SURF_ATTR_COLORBITS).
cbpc0/1/2/3_max = RLADCompBitsRed/Green/Blue/Alpha
(see MML_GDC_SURF_ATTR_RLAD_MAXCOLORBITS).
cbpc0/1/2/3_width = floor(log2(bpc0/1/2/3)) +1 or 0 if the component size is 0.
frame_width/height = dimension of input frame.
Some typical setups and resulting compression rates (compressed/uncompressed) for RGB888 image data:
RLADCompBitsRed/Green/Blue
4/5/4 => 73 %
3/4/3 => 61 %
2/3/2 => 48 %
Note:
Images compressed with MML_GDC_SURF_COMP_RLAD may result in a smaller size however also for worst case
images the maximum size will not be exceeded.
4.9.1.2
How to create compressed images