Color Format Conversion - Samsung S3C2416 User Manual

16/32-bit risc
Table of Contents

Advertisement

2D

2 COLOR FORMAT CONVERSION

2D supports seven color formats: RGB_565, RGBA_5551, ARGB_1555, RGBA_8888, ARGB_8888, XRGB_8888,
and RGBX_8888. The structure of each color format is illustrated in Figure 18-1.
RGB_565
RGBA_5551
ARGB_1555
RGBA_8888
ARGB_8888
XRGB_8888
RGBX_8888
The internal computations use ARGB_8888 format. All data (source, destination, foreground, background, blue-
screen, pattern) are converted to ARGB_8888 format before computation, and the final result are converted to the
color format specified by DEST_COLOR_MODE_REG before writing to frame buffer.
When a 16-bit color data is converted to 32-bit, the data of each field is shifted (8 – x) bits to left, where x is the
bit-width of the field. The least significant x bits of the new field data are padded with the most significant x bits of
the original field data. For example, if the R value in RGB_565 format is 5'b11010, it will be converted to
8'b11010110, with three LSBs padded with three MSBs (3'b110) from the original R value. Note that, the A field in
RGBA_5551 and ARGB_1555 only has one bit, so it is converted to either 8'b00000000 or 8'b11111111 (A=1'b1).
When a 32-bit color data is converted to 16-bit, the data of each field is truncated to x bits, where x is the bit-width
of the field in the new color format. For example, if the R value in RGBA_8888 format is 8'b11001110, it will be
converted to 5'b11001 in the RGB_565 format, with the three LSBs discarded. Note that, if the A field of the 32-bit
color data is not 0, the A field in RGBA_5551 and ARGB_1555 will be 1'b1; otherwise, 1'b0.
2D also supports YUV input (format: YUV422, 2-planar). The memory allocation of a 16-pixel image of YUV422
format is illustrated in Figure 18-2. Note that when YUV format is used, the source image horizontal resolution
must be an even number.
18-2
31
24
R
31
24
A
31
24
0xFF
31
24
R
Figure 18-1. Color Format
15
10
R
15
10
R
15 14
A
R
16
G
B
16
R
G
16
R
G
16
G
B
S3C2416X RISC MICROPROCESSOR
5
G
B
6
G
B
10
5
G
B
8
A
8
B
8
B
8
0xFF
0
1
0
A
0
0
0
0
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents