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