2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef __IA_CSS_FRAME_FORMAT_H
16 #define __IA_CSS_FRAME_FORMAT_H
19 * This file contains information about formats supported in the ISP
22 /** Frame formats, some of these come from fourcc.org, others are
23 better explained by video4linux2. The NV11 seems to be described only
24 on MSDN pages, but even those seem to be gone now.
25 Frames can come in many forms, the main categories are RAW, RGB and YUV
26 (or YCbCr). The YUV frames come in 4 flavors, determined by how the U and V
27 values are subsampled:
28 1. YUV420: hor = 2, ver = 2
29 2. YUV411: hor = 4, ver = 1
30 3. YUV422: hor = 2, ver = 1
31 4. YUV444: hor = 1, ver = 1
33 Warning: not all frame formats are supported as input or output to/from ISP.
34 Some of these formats are therefore not defined in the output table module.
35 Modifications in below frame format enum can require modifications in the
38 Warning2: Throughout the CSS code assumptions are made on the order
39 of formats in this enumeration type, or some sort of copy is maintained.
40 The following files are identified:
42 - css/isp/kernels/fc/fc_1.0/formats.isp.c
43 - css/isp/kernels/output/output_1.0/output_table.isp.c
44 - css/isp/kernels/output/sc_output_1.0/formats.hive.c
45 - css/isp/modes/interface/isp_formats.isp.h
46 - css/bxt_sandbox/psyspoc/interface/ia_css_pg_info.h
47 - css/bxt_sandbox/psysapi/data/interface/ia_css_program_group_data.h
48 - css/bxt_sandbox/isysapi/interface/ia_css_isysapi_fw_types.h
50 enum ia_css_frame_format {
51 IA_CSS_FRAME_FORMAT_NV11 = 0, /**< 12 bit YUV 411, Y, UV plane */
52 IA_CSS_FRAME_FORMAT_NV12, /**< 12 bit YUV 420, Y, UV plane */
53 IA_CSS_FRAME_FORMAT_NV12_16, /**< 16 bit YUV 420, Y, UV plane */
54 IA_CSS_FRAME_FORMAT_NV12_TILEY, /**< 12 bit YUV 420, Intel proprietary tiled format, TileY */
55 IA_CSS_FRAME_FORMAT_NV16, /**< 16 bit YUV 422, Y, UV plane */
56 IA_CSS_FRAME_FORMAT_NV21, /**< 12 bit YUV 420, Y, VU plane */
57 IA_CSS_FRAME_FORMAT_NV61, /**< 16 bit YUV 422, Y, VU plane */
58 IA_CSS_FRAME_FORMAT_YV12, /**< 12 bit YUV 420, Y, V, U plane */
59 IA_CSS_FRAME_FORMAT_YV16, /**< 16 bit YUV 422, Y, V, U plane */
60 IA_CSS_FRAME_FORMAT_YUV420, /**< 12 bit YUV 420, Y, U, V plane */
61 IA_CSS_FRAME_FORMAT_YUV420_16, /**< yuv420, 16 bits per subpixel */
62 IA_CSS_FRAME_FORMAT_YUV422, /**< 16 bit YUV 422, Y, U, V plane */
63 IA_CSS_FRAME_FORMAT_YUV422_16, /**< yuv422, 16 bits per subpixel */
64 IA_CSS_FRAME_FORMAT_UYVY, /**< 16 bit YUV 422, UYVY interleaved */
65 IA_CSS_FRAME_FORMAT_YUYV, /**< 16 bit YUV 422, YUYV interleaved */
66 IA_CSS_FRAME_FORMAT_YUV444, /**< 24 bit YUV 444, Y, U, V plane */
67 IA_CSS_FRAME_FORMAT_YUV_LINE, /**< Internal format, 2 y lines followed
68 by a uvinterleaved line */
69 IA_CSS_FRAME_FORMAT_RAW, /**< RAW, 1 plane */
70 IA_CSS_FRAME_FORMAT_RGB565, /**< 16 bit RGB, 1 plane. Each 3 sub
71 pixels are packed into one 16 bit
72 value, 5 bits for R, 6 bits for G
74 IA_CSS_FRAME_FORMAT_PLANAR_RGB888, /**< 24 bit RGB, 3 planes */
75 IA_CSS_FRAME_FORMAT_RGBA888, /**< 32 bit RGBA, 1 plane, A=Alpha
77 IA_CSS_FRAME_FORMAT_QPLANE6, /**< Internal, for advanced ISP */
78 IA_CSS_FRAME_FORMAT_BINARY_8, /**< byte stream, used for jpeg. For
79 frames of this type, we set the
80 height to 1 and the width to the
81 number of allocated bytes. */
82 IA_CSS_FRAME_FORMAT_MIPI, /**< MIPI frame, 1 plane */
83 IA_CSS_FRAME_FORMAT_RAW_PACKED, /**< RAW, 1 plane, packed */
84 IA_CSS_FRAME_FORMAT_CSI_MIPI_YUV420_8, /**< 8 bit per Y/U/V.
86 interleaved even line */
87 IA_CSS_FRAME_FORMAT_CSI_MIPI_LEGACY_YUV420_8, /**< Legacy YUV420. UY odd
89 IA_CSS_FRAME_FORMAT_CSI_MIPI_YUV420_10 /**< 10 bit per Y/U/V. Y odd
90 line; UYVY interleaved
94 /* NOTE: IA_CSS_FRAME_FORMAT_NUM was purposely defined outside of enum type ia_css_frame_format, */
95 /* because of issues this would cause with the Clockwork code checking tool. */
96 #define IA_CSS_FRAME_FORMAT_NUM (IA_CSS_FRAME_FORMAT_CSI_MIPI_YUV420_10 + 1)
98 /** Number of valid output frame formats for ISP **/
99 #define IA_CSS_FRAME_OUT_FORMAT_NUM (IA_CSS_FRAME_FORMAT_RGBA888 + 1)
101 #endif /* __IA_CSS_FRAME_FORMAT_H */