isp_types.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /****************************************************************************
  2. *
  3. * The MIT License (MIT)
  4. *
  5. * Copyright (c) 2020 VeriSilicon Holdings Co., Ltd.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a
  8. * copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation
  10. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. * and/or sell copies of the Software, and to permit persons to whom the
  12. * Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in
  15. * all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. *
  25. *****************************************************************************
  26. *
  27. * The GPL License (GPL)
  28. *
  29. * Copyright (c) 2020 VeriSilicon Holdings Co., Ltd.
  30. *
  31. * This program is free software; you can redistribute it and/or
  32. * modify it under the terms of the GNU General Public License
  33. * as published by the Free Software Foundation; either version 2
  34. * of the License, or (at your option) any later version.
  35. *
  36. * This program is distributed in the hope that it will be useful,
  37. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. * GNU General Public License for more details.
  40. *
  41. * You should have received a copy of the GNU General Public License
  42. * along with this program;
  43. *
  44. *****************************************************************************
  45. *
  46. * Note: This software is released under dual MIT and GPL licenses. A
  47. * recipient may use this file under the terms of either the MIT license or
  48. * GPL License. If you wish to use only one license not the other, you can
  49. * indicate your decision by deleting one of the above license notices in your
  50. * version of this file.
  51. *
  52. *****************************************************************************/
  53. #ifndef _ISP_TYPES_H_
  54. #define _ISP_TYPES_H_
  55. enum {
  56. IC_MI_PATH_INVALID = -1, /**< lower border (only for an internal evaluation) */
  57. IC_MI_PATH_MAIN = 0, /**< main path index */
  58. IC_MI_PATH_SELF = 1, /**< self path index */
  59. IC_MI_PATH_SELF2 = 2, /**< self path index */
  60. IC_MI_PATH_MAX /**< upper border (only for an internal evaluation) */
  61. };
  62. enum {
  63. IC_MI_DATAMODE_INVALID = 0, /**< lower border (only for an internal evaluation) */
  64. IC_MI_DATAMODE_DISABLED = 1, /**< disables the path */
  65. IC_MI_DATAMODE_JPEG = 2, /**< data output format is JPEG (only valid for mainpath @ref CamerIcMiPath_e) */
  66. IC_MI_DATAMODE_YUV444 = 3, /**< data output format is YUV444 */
  67. IC_MI_DATAMODE_YUV422 = 4, /**< data output format is YUV422 */
  68. IC_MI_DATAMODE_YUV420 = 5, /**< data output format is YUV420 */
  69. IC_MI_DATAMODE_YUV400 = 6, /**< data output format is YUV400 */
  70. IC_MI_DATAMODE_RGB888 = 7, /**< data output format is RGB888 (only valid for selpath @ref CamerIcMiPath_e) */
  71. IC_MI_DATAMODE_RGB666 = 8, /**< data output format is RGB666 (only valid for selpath @ref CamerIcMiPath_e) */
  72. IC_MI_DATAMODE_RGB565 = 9, /**< data output format is RGB565 (only valid for selpath @ref CamerIcMiPath_e) */
  73. IC_MI_DATAMODE_RAW8 = 10, /**< data output format is RAW8 (only valid for mainpath @ref CamerIcMiPath_e) */
  74. IC_MI_DATAMODE_RAW12 = 11, /**< data output format is RAW12 (only valid for mainpath @ref CamerIcMiPath_e) */
  75. IC_MI_DATAMODE_DPCC = 12, /**< path dumps out the current measured defect pixel table */
  76. IC_MI_DATAMODE_RAW10 = 13, /**< data output format is RAW10 (only valid for mainpath @ref CamerIcMiPath_e) */
  77. IC_MI_DATAMODE_RAW14 = 14, /**< data output format is RAW14 (only valid for mainpath @ref CamerIcMiPath_e) */
  78. IC_MI_DATAMODE_RAW16 = 15, /**< data output format is RAW16 (only valid for mainpath @ref CamerIcMiPath_e) */
  79. IC_MI_DATAMODE_MAX /**< upper border (only for an internal evaluation) */
  80. };
  81. enum {
  82. IC_MI_DATASTORAGE_INVALID = 0, /**< lower border (only for an internal evaluation) */
  83. IC_MI_DATASTORAGE_PLANAR = 1, /**< YUV values are packed together as: YYYY......, UVUVUVUV...... */
  84. IC_MI_DATASTORAGE_SEMIPLANAR = 2, /**< YUV values are packed together as: YUV, YUV, YUV, ...... */
  85. IC_MI_DATASTORAGE_INTERLEAVED = 3, /**< Y values for all pixels are put together, as well as U and V,
  86. like: YYYYYY......, UUUUUUU......., VVVVVV...... */
  87. IC_MI_DATASTORAGE_MAX /**< upper border (only for an internal evaluation) */
  88. };
  89. enum {
  90. ISP_PICBUF_TYPE_INVALID = 0x00,
  91. ISP_PICBUF_TYPE_DATA = 0x08, /* just some sequential data */
  92. ISP_PICBUF_TYPE_RAW8 = 0x10,
  93. ISP_PICBUF_TYPE_RAW16 = 0x11, /* includes: 9..16bits, MSBit aligned, LSByte first! */
  94. ISP_PICBUF_TYPE_RAW10 = 0x12, /* includes: 10bits, MSBit aligned, LSByte first! */
  95. ISP_PICBUF_TYPE_RAW12 = 0x13,
  96. ISP_PICBUF_TYPE_RAW14 = 0x14,
  97. ISP_PICBUF_TYPE_JPEG = 0x20,
  98. ISP_PICBUF_TYPE_YCbCr444 = 0x30,
  99. ISP_PICBUF_TYPE_YCbCr422 = 0x31,
  100. ISP_PICBUF_TYPE_YCbCr420 = 0x32,
  101. ISP_PICBUF_TYPE_YCbCr400 = 0x33,
  102. ISP_PICBUF_TYPE_YCbCr32 = 0x3f,
  103. ISP_PICBUF_TYPE_RGB888 = 0x40,
  104. ISP_PICBUF_TYPE_RGB666 = 0x41, /* R, G & B are LSBit aligned! */
  105. ISP_PICBUF_TYPE_RGB565 = 0x42, /* TODO: don't know the memory layout right now, investigate! */
  106. ISP_PICBUF_TYPE_RGB32 = 0x4f,
  107. _ISP_PICBUF_TYPE_DUMMY_
  108. };
  109. enum {
  110. ISP_PICBUF_LAYOUT_INVALID = 0,
  111. ISP_PICBUF_LAYOUT_COMBINED = 0x10, /* ISP_PICBUF_TYPE_DATA: Data: D0 D1 D2... */
  112. /* ISP_PICBUF_TYPE_RAW8: Data: D0 D1 D2... */
  113. /* ISP_PICBUF_TYPE_RAW16/10: Data: D0L D0H D1L D1H... */
  114. /* ISP_PICBUF_TYPE_JPEG: Data: J0 J1 J2... */
  115. /* ISP_PICBUF_TYPE_YCbCr444: Data: Y0 Cb0 Cr0 Y1 Cb1Cr1... */
  116. /* ISP_PICBUF_TYPE_YCbCr422: Data: Y0 Cb0 Y1 Cr0 Y2 Cb1 Y3 Cr1... */
  117. /* ISP_PICBUF_TYPE_YCbCr32: Data: Cr0 Cb0 Y0 A0 Cr1 Cb1 Y1 A1... */
  118. /* ISP_PICBUF_TYPE_RGB888: Data: R0 G0 B0 R1 B2 G1... */
  119. /* ISP_PICBUF_TYPE_RGB666: Data: {00,R0[5:0]} {00,G0[5:0]} {00,B0[5:0]} {00,R1[5:0]} {00,G2[5:0]} {00,B3[5:0]}... */
  120. /* ISP_PICBUF_TYPE_RGB565: Data: {R0[4:0],G0[5:3]} {G0[2:0],B0[4:0]} {R1[4:0],G1[5:3]} {G1[2:0],B1[4:0]}... (is this correct?) */
  121. /* ISP_PICBUF_TYPE_RGB32: Data: B0 G0 R0 A0 B1 G1 R1 A1... */
  122. ISP_PICBUF_LAYOUT_BAYER_RGRGGBGB = 0x11, /* 1st line: RGRG... , 2nd line GBGB... , etc. */
  123. ISP_PICBUF_LAYOUT_BAYER_GRGRBGBG = 0x12, /* 1st line: GRGR... , 2nd line BGBG... , etc. */
  124. ISP_PICBUF_LAYOUT_BAYER_GBGBRGRG = 0x13, /* 1st line: GBGB... , 2nd line RGRG... , etc. */
  125. ISP_PICBUF_LAYOUT_BAYER_BGBGGRGR = 0x14, /* 1st line: BGBG... , 2nd line GRGR... , etc. */
  126. ISP_PICBUF_LAYOUT_SEMIPLANAR = 0x20, /* ISP_PICBUF_TYPE_YCbCr422: Luma: Y0 Y1 Y2 Y3... ; Chroma: Cb0 Cr0 Cb1 Cr1... */
  127. /* ISP_PICBUF_TYPE_YCbCr420: Luma: Y0 Y1 Y2 Y3... ; Chroma: Cb0 Cr0 Cb1 Cr1... */
  128. /* ISP_PICBUF_TYPE_YCbCr400: Luma: Y0 Y1 Y2 Y3... ; Chroma: not used */
  129. ISP_PICBUF_LAYOUT_PLANAR = 0x30, /* ISP_PICBUF_TYPE_YCbCr444: Y: Y0 Y1 Y2 Y3...; Cb: Cb0 Cb1 Cb2 Cb3...; Cr: Cr0 Cr1 Cr2 Cr3... */
  130. /* ISP_PICBUF_TYPE_YCbCr422: Y: Y0 Y1 Y2 Y3...; Cb: Cb0 Cb1 Cb2 Cb3...; Cr: Cr0 Cr1 Cr2 Cr3... */
  131. /* ISP_PICBUF_TYPE_YCbCr420: Y: Y0 Y1 Y2 Y3...; Cb: Cb0 Cb1 Cb2 Cb3...; Cr: Cr0 Cr1 Cr2 Cr3... */
  132. /* ISP_PICBUF_TYPE_YCbCr400: Y: Y0 Y1 Y2 Y3...; Cb: not used; Cr: not used... */
  133. /* ISP_PICBUF_TYPE_RGB888: R: R0 R1 R2 R3...; G: G0 G1 G2 G3...; B: B0 B1 B2 B3... */
  134. /* ISP_PICBUF_TYPE_RGB666: R: {00,R0[5:0]}...; G: {00,G0[5:0]}...; B: {00,B0[5:0]}... */
  135. _ISP_PICBUF_LAYOUT_DUMMY_
  136. };
  137. enum {
  138. IC_DPF_RB_FILTERSIZE_INVALID = 0, /**< lower border (only for an internal evaluation) */
  139. IC_DPF_RB_FILTERSIZE_9x9 = 1, /**< red and blue filter kernel size 9x9 (means 5x5 active pixel) */
  140. IC_DPF_RB_FILTERSIZE_13x9 = 2, /**< red and blue filter kernel size 13x9 (means 7x5 active pixel) */
  141. IC_DPF_RB_FILTERSIZE_MAX /**< upper border (only for an internal evaluation) */
  142. };
  143. enum {
  144. ISP_MI_DATA_ALIGN_MODE_INVALID = -1,
  145. ISP_MI_DATA_UNALIGN_MODE = 0, /* pixel data not aligned. */
  146. ISP_MI_DATA_ALIGN_128BIT_MODE = 1, /* pixel data aligned with 128 bit. */
  147. ISP_MI_DATA_ALIGN_16BIT_MODE = 2, /* pixel data aligned with 16 bit. */
  148. ISP_MI_DATA_ALIGN_MODE_MAX
  149. };
  150. enum {
  151. IC_DPF_GAIN_USAGE_INVALID = 0, /**< lower border (only for an internal evaluation) */
  152. IC_DPF_GAIN_USAGE_DISABLED = 1, /**< don't use any gains in preprocessing stage */
  153. IC_DPF_GAIN_USAGE_NF_GAINS = 2, /**< use only the noise function gains from registers DPF_NF_GAIN_R, ... */
  154. IC_DPF_GAIN_USAGE_LSC_GAINS = 3, /**< use only the gains from LSC module */
  155. IC_DPF_GAIN_USAGE_NF_LSC_GAINS = 4, /**< use the moise function gains and the gains from LSC module */
  156. IC_DPF_GAIN_USAGE_AWB_GAINS = 5, /**< use only the gains from AWB module */
  157. IC_DPF_GAIN_USAGE_AWB_LSC_GAINS = 6, /**< use the gains from AWB and LSC module */
  158. IC_DPF_GAIN_USAGE_MAX /**< upper border (only for an internal evaluation) */
  159. };
  160. enum {
  161. IC_NLL_SCALE_INVALID = 0, /**< lower border (only for an internal evaluation) */
  162. IC_NLL_SCALE_LINEAR = 1, /**< use a linear scaling */
  163. IC_NLL_SCALE_LOGARITHMIC = 2, /**< use a logarithmic scaling */
  164. IC_NLL_SCALE_MAX /**< upper border (only for an internal evaluation) */
  165. };
  166. #endif /* _ISP_TYPES_H_ */