You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
4.9KB

  1. /*
  2. * pixel format descriptor
  3. * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include "libavutil/pixfmt.h"
  22. #include "pixdesc.h"
  23. static const AVPixFmtDescriptor pix_fmt_desc[PIX_FMT_NB] = {
  24. [PIX_FMT_YUV422P] = {
  25. .name = "yuv422p",
  26. .nb_channels = 3,
  27. .log2_chroma_w= 1,
  28. .log2_chroma_h= 0,
  29. .comp = {
  30. {0,0,1,0,7},
  31. {1,0,1,0,7},
  32. {2,0,1,0,7},
  33. },
  34. },
  35. [PIX_FMT_YUV420P] = {
  36. .name = "yuv420p",
  37. .nb_channels = 3,
  38. .log2_chroma_w= 1,
  39. .log2_chroma_h= 1,
  40. .comp = {
  41. {0,0,1,0,7},
  42. {1,0,1,0,7},
  43. {2,0,1,0,7},
  44. },
  45. },
  46. [PIX_FMT_YUV410P] = {
  47. .name = "yuv410p",
  48. .nb_channels = 3,
  49. .log2_chroma_w= 2,
  50. .log2_chroma_h= 2,
  51. .comp = {
  52. {0,0,1,0,7},
  53. {1,0,1,0,7},
  54. {2,0,1,0,7},
  55. },
  56. },
  57. [PIX_FMT_NV12] = {
  58. .name = "nv12",
  59. .nb_channels = 3,
  60. .log2_chroma_w= 1,
  61. .log2_chroma_h= 1,
  62. .comp = {
  63. {0,0,1,0,7},
  64. {1,1,1,0,7},
  65. {1,1,2,0,7},
  66. },
  67. },
  68. [PIX_FMT_YUYV422] = {
  69. .name = "yuyv422",
  70. .nb_channels = 3,
  71. .log2_chroma_w= 1,
  72. .log2_chroma_h= 0,
  73. .comp = {
  74. {0,1,1,0,7},
  75. {0,3,2,0,7},
  76. {0,3,4,0,7},
  77. },
  78. },
  79. [PIX_FMT_UYVY422] = {
  80. .name = "uyvy422",
  81. .nb_channels = 3,
  82. .log2_chroma_w= 1,
  83. .log2_chroma_h= 0,
  84. .comp = {
  85. {0,1,2,0,7},
  86. {0,3,1,0,7},
  87. {0,3,3,0,7},
  88. },
  89. },
  90. [PIX_FMT_GRAY16LE] = {
  91. .name = "gray16le",
  92. .nb_channels = 1,
  93. .log2_chroma_w= 0,
  94. .log2_chroma_h= 0,
  95. .comp = {
  96. {0,1,1,0,15},
  97. },
  98. },
  99. [PIX_FMT_GRAY16BE] = {
  100. .name = "gray16be",
  101. .nb_channels = 1,
  102. .log2_chroma_w= 0,
  103. .log2_chroma_h= 0,
  104. .comp = {
  105. {0,1,1,0,15},
  106. },
  107. .flags = PIX_FMT_BE,
  108. },
  109. [PIX_FMT_RGB24] = {
  110. .name = "rgb24",
  111. .nb_channels = 3,
  112. .log2_chroma_w= 0,
  113. .log2_chroma_h= 0,
  114. .comp = {
  115. {0,2,1,0,7},
  116. {0,2,2,0,7},
  117. {0,2,3,0,7},
  118. },
  119. },
  120. [PIX_FMT_RGBA] = {
  121. .name = "rgba",
  122. .nb_channels = 4,
  123. .log2_chroma_w= 0,
  124. .log2_chroma_h= 0,
  125. .comp = {
  126. {0,3,1,0,7},
  127. {0,3,2,0,7},
  128. {0,3,3,0,7},
  129. {0,3,4,0,7},
  130. },
  131. },
  132. [PIX_FMT_RGB48LE] = {
  133. .name = "rgb48le",
  134. .nb_channels = 3,
  135. .log2_chroma_w= 0,
  136. .log2_chroma_h= 0,
  137. .comp = {
  138. {0,5,1,0,15},
  139. {0,5,3,0,15},
  140. {0,5,5,0,15},
  141. },
  142. },
  143. [PIX_FMT_RGB48BE] = {
  144. .name = "rgb48be",
  145. .nb_channels = 3,
  146. .log2_chroma_w= 0,
  147. .log2_chroma_h= 0,
  148. .comp = {
  149. {0,5,1,0,15},
  150. {0,5,3,0,15},
  151. {0,5,5,0,15},
  152. },
  153. .flags = PIX_FMT_BE,
  154. },
  155. //FIXME change pix fmt defines so that we have a LE & BE instead of a native-endian
  156. #if 0
  157. [PIX_FMT_RGB565LE] = {
  158. .name = "rgb565le",
  159. .nb_channels = 3,
  160. .log2_chroma_w= 0,
  161. .log2_chroma_h= 0,
  162. .comp = {
  163. {0,1,1,0,4},
  164. {0,1,1,5,5},
  165. {0,1,2,3,4},
  166. },
  167. },
  168. [PIX_FMT_RGB565BE] = {
  169. .name = "rgb565be",
  170. .nb_channels = 3,
  171. .log2_chroma_w= 0,
  172. .log2_chroma_h= 0,
  173. .comp = {
  174. {0,1,1, 0,4},
  175. {0,1,1, 5,5},
  176. {0,1,0, 3,4},
  177. },
  178. .flags = PIX_FMT_BE,
  179. },
  180. #endif
  181. [PIX_FMT_MONOBLACK] = {
  182. .name = "monoblack",
  183. .nb_channels = 1,
  184. .log2_chroma_w= 0,
  185. .log2_chroma_h= 0,
  186. .comp = {
  187. {0,0,1,7,0},
  188. },
  189. .flags = PIX_FMT_BITSTREAM,
  190. },
  191. [PIX_FMT_PAL8] = {
  192. .name = "pal8",
  193. .nb_channels = 1,
  194. .log2_chroma_w= 0,
  195. .log2_chroma_h= 0,
  196. .comp = {
  197. {0,0,1,0,7},
  198. },
  199. .flags = PIX_FMT_PAL,
  200. },
  201. };