Appendix A. Pixels in Memory

This appendix provides examples of the more common in-memory pixel formats, along with their corresponding dmSDK parameters.

Greyscale Examples

8-bit greyscale (1 byte per pixel)

byte 0
7      0
+------+
YYYYYYYY

Parameters:

  • DM_PACKING_8

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_400

Padded 12-bit greyscale (1 short per pixel)

short 0
15             0
+--------------+
ssssYYYYYYYYYYYY

Parameters:

  • DM_PACKING_S12in16R

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_400

RGB Examples

8-bit RGB (3 bytes per pixel)

byte 0    byte 1    byte 2
7      0  7      0  7      0
+------+  +------+  +------+
RRRRRRRR  GGGGGGGG  BBBBBBBB

Parameters:

  • DM_PACKING_8

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_444

8-bit BGR (3 bytes per pixel)

byte 0    byte 1    byte 2
7      0  7      0  7      0
+------+  +------+  +------+
BBBBBBBB  GGGGGGGG  RRRRRRRR

Parameters:

  • DM_PACKING_8_R

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_444

8-bit RGBA (4 bytes per pixel)

byte 0    byte 1    byte 2    byte 3
7      0  7      0  7      0  7      0
+------+  +------+  +------+  +------+
RRRRRRRR  GGGGGGGG  BBBBBBBB  AAAAAAAA

Parameters:

  • DM_PACKING_8

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_4444

8-bit ABGR (4 bytes per pixel)

byte 0    byte 1    byte 2    byte3
7      0  7      0  7      0  7      0
+------+  +------+  +------+  +------+
AAAAAAAA  BBBBBBBB  GGGGGGGG  RRRRRRRR

Parameters:

  • DM_PACKING_8_R

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_444

10-bit RGB (one 32-bit integer per pixel)

31            int              0
+------------------------------+
RRRRRRRRRRGGGGGGGGGGBBBBBBBBBB00

Parameters:

  • DM_PACKING_10_10_10_2

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_444

10-bit RGBA (one 32-bit integer per pixel)

31            int              0
+------------------------------+
RRRRRRRRRRGGGGGGGGGGBBBBBBBBBBAA

Parameters:

  • DM_PACKING_10_10_10_2

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_4444

12-bit RGBA (6 bytes per pixel)

byte 0    byte 1    byte 2    byte 3    byte 4    byte 5
7      0  7      0  7      0  7      0  7      0  7      0
+------+  +------+  +------+  +------+  +------+  +------+
RRRRRRRR  RRRRGGGG  GGGGGGGG  BBBBBBBB  BBBBAAAA  AAAAAAAA

Parameters:

  • DM_PACKING_S12

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_4444

Padded 12-bit RGB (three 16-bit shorts per pixel)

short 0           short 1           short 2
15             0  15             0  15             0
+--------------+  +--------------+  +--------------+
ssssRRRRRRRRRRRR  ssssGGGGGGGGGGGG  ssssBBBBBBBBBBBB

Parameters:

  • DM_PACKING_S12in16R

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_444

Padded 12-bit RGBA (four 16-bit shorts per pixel)

short 0           short 1           short 2           short 3
15             0  15             0  15             0  15             0
+--------------+  +--------------+  +--------------+  +--------------+
ssssRRRRRRRRRRRR  ssssGGGGGGGGGGGG  ssssBBBBBBBBBBBB  ssssAAAAAAAAAAAA

Parameters:

  • DM_PACKING_S12in16R

  • DM_COLORSPACE_RGB_*

  • DM_SAMPLING_4444

CbYCr Examples

8-bit CbYCr (3 bytes per pixel)

byte 0    byte 1    byte 2
7      0  7      0  7      0
+------+  +------+  +------+
bbbbbbbb  YYYYYYYY  rrrrrrrr

Parameters:

  • DM_PACKING_8

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_444

8-bit CbYCrA (4 bytes per pixel)

byte 0    byte 1    byte 2    byte 3
7      0  7      0  7      0  7      0
+------+  +------+  +------+  +------+
bbbbbbbb  YYYYYYYY  rrrrrrrr  AAAAAAAA

Parameters:

  • DM_PACKING_8

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_4444

10-bit CbYCr (one 32-bit integer per pixel)

31            int              0
+------------------------------+
bbbbbbbbbbYYYYYYYYYYrrrrrrrrrr00

Parameters:

  • DM_PACKING_10_10_10_2

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_444

10-bit CbYCrA (one 32-bit integer per pixel)

31             int             0
+------------------------------+
bbbbbbbbbbYYYYYYYYYYrrrrrrrrrrAA

Parameters:

  • DM_PACKING_10_10_10_2

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_4444

Padded 12-bit CbYCrA (four 16-bit shorts per pixel)

short 0           short 1           short 2           short 3
15             0  15             0  15             0  15             0
+--------------+  +--------------+  +--------------+  +--------------+
ssssbbbbbbbbbbbb  ssssYYYYYYYYYYYY  ssssrrrrrrrrrrrr  ssssAAAAAAAAAAAA

Parameters:

  • DM_PACKING_S12in16R

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_4444

422x CbYCr Examples

10-bit 422 CbYCr (5 bytes per 2 pixels)

   byte 0    byte 1    byte 2    byte 3    byte 4
   7      0  7      0  7      0  7      0  7      0
   +------+  +------+  +------+  +------+  +------+
   bbbbbbbb  bbYYYYYY  YYYYrrrr  rrrrrrYY  YYYYYYYY

pixel 1

      ++++++++  ++++++++  ++++++++  ++++++

pixel 2

      ++++++++  ++        ++++      ++++++++  ++++++++

Parameters:

  • DM_PACKING_10

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_422

10-bit 422 CbYCr (5 bytes per 2 pixels)

   byte 0    byte 1    byte 2    byte 3    byte 4
   7      0  7      0  7      0  7      0  7      0
   +------+  +------+  +------+  +------+  +------+
   bbbbbbbb  bbYYYYYY  YYYYrrrr  rrrrrrYY  YYYYYYYY

pixel 1

      ++++++++  ++++++++  ++++++++  ++++++

pixel 2

      ++++++++  ++        ++++      ++++++++  ++++++++

Parameters:

  • DM_PACKING_10_R

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_422

Padded 12-bit 422 CbYCr (four 16-bit shorts per 2 pixels)

short 0           short 1           short 2           short 3
15             0  15             0  15             0  15             0
+--------------+  +--------------+  +--------------+  +--------------+
ssssbbbbbbbbbbbb  ssssYYYYYYYYYYYY  ssssrrrrrrrrrrrr  ssssYYYYYYYYYYYY

pixel 1

   ++++++++++++++++  ++++++++++++++++  ++++++++++++++++

pixel 2
   ++++++++++++++++                    ++++++++++++++++  ++++++++++++++++

Parameters:

  • DM_PACKING_S12in16R

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_422

10-bit 4224 CbYCrA (two 32-bit integers per 2 pixels)

31          int 0              0  31          int 1              0
+------------------------------+  +------------------------------+
bbbbbbbbbbYYYYYYYYYYAAAAAAAAAA00  rrrrrrrrrrYYYYYYYYYYAAAAAAAAAA00

pixel 1

   ++++++++++++++++++++++++++++++    ++++++++++

pixel 2
   ++++++++++                        ++++++++++++++++++++++++++++++

Parameters:

  • DM_PACKING_10_10_10_2

  • DM_COLORSPACE_CbYCr_*

  • DM_SAMPLING_4224