V4L2 pixel format 格式参考

V4L2 pixel format 格式参考1.v4l2_pix_format定义/**VIDEOIMAGEFORMAT*/structv4l2_pix_format{__u32width;__u32height;__u32pixelformat;enumv4l2_fieldfield;…

大家好,欢迎来到IT知识分享网。V4L2 pixel format 格式参考

1. v4l2_pix_format定义

    /*
     *    V I D E O   I M A G E   F O R M A T
     */
    struct v4l2_pix_format {

        __u32                 width;
        __u32            height;
        __u32            pixelformat;
        enum v4l2_field      field;
        __u32                bytesperline;    /* for padding, zero if unused */
        __u32                  sizeimage;
        enum v4l2_colorspace    colorspace;
        __u32            priv;        /* private data, depends on pixelformat */
    };

2. 具体Pixel Format定义

    /*  Four-character-code (FOURCC) */
    #define v4l2_fourcc(a, b, c, d)\
        ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))

 

    /*      Pixel format         FOURCC                          depth  Description  */
     
    /* RGB formats */
    #define V4L2_PIX_FMT_RGB332  v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘1’) /*  8  RGB-3-3-2     */
    #define V4L2_PIX_FMT_RGB444  v4l2_fourcc(‘R’, ‘4’, ‘4’, ‘4’) /* 16  xxxxrrrr ggggbbbb */
    #define V4L2_PIX_FMT_RGB555  v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘O’) /* 16  RGB-5-5-5     */
    #define V4L2_PIX_FMT_RGB565  v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘P’) /* 16  RGB-5-6-5     */
    #define V4L2_PIX_FMT_RGB555X v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘Q’) /* 16  RGB-5-5-5 BE  */
    #define V4L2_PIX_FMT_RGB565X v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘R’) /* 16  RGB-5-6-5 BE  */
    #define V4L2_PIX_FMT_BGR666  v4l2_fourcc(‘B’, ‘G’, ‘R’, ‘H’) /* 18  BGR-6-6-6      */
    #define V4L2_PIX_FMT_BGR24   v4l2_fourcc(‘B’, ‘G’, ‘R’, ‘3’) /* 24  BGR-8-8-8     */
    #define V4L2_PIX_FMT_RGB24   v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘3’) /* 24  RGB-8-8-8     */
    #define V4L2_PIX_FMT_BGR32   v4l2_fourcc(‘B’, ‘G’, ‘R’, ‘4’) /* 32  BGR-8-8-8-8   */
    #define V4L2_PIX_FMT_RGB32   v4l2_fourcc(‘R’, ‘G’, ‘B’, ‘4’) /* 32  RGB-8-8-8-8   */
     
    /* Grey formats */
    #define V4L2_PIX_FMT_GREY    v4l2_fourcc(‘G’, ‘R’, ‘E’, ‘Y’) /*  8  Greyscale     */
    #define V4L2_PIX_FMT_Y4      v4l2_fourcc(‘Y’, ‘0’, ‘4’, ‘ ‘) /*  4  Greyscale     */
    #define V4L2_PIX_FMT_Y6      v4l2_fourcc(‘Y’, ‘0’, ‘6’, ‘ ‘) /*  6  Greyscale     */
    #define V4L2_PIX_FMT_Y10     v4l2_fourcc(‘Y’, ‘1’, ‘0’, ‘ ‘) /* 10  Greyscale     */
    #define V4L2_PIX_FMT_Y12     v4l2_fourcc(‘Y’, ‘1’, ‘2’, ‘ ‘) /* 12  Greyscale     */
    #define V4L2_PIX_FMT_Y16     v4l2_fourcc(‘Y’, ‘1’, ‘6’, ‘ ‘) /* 16  Greyscale     */
     
    /* Grey bit-packed formats */
    #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc(‘Y’, ‘1’, ‘0’, ‘B’) /* 10  Greyscale bit-packed */
     
    /* Palette formats */
    #define V4L2_PIX_FMT_PAL8    v4l2_fourcc(‘P’, ‘A’, ‘L’, ‘8’) /*  8  8-bit palette */
     
    /* Luminance+Chrominance formats */
    #define V4L2_PIX_FMT_YVU410  v4l2_fourcc(‘Y’, ‘V’, ‘U’, ‘9’) /*  9  YVU 4:1:0     */
    #define V4L2_PIX_FMT_YVU420  v4l2_fourcc(‘Y’, ‘V’, ‘1’, ‘2’) /* 12  YVU 4:2:0     */
    #define V4L2_PIX_FMT_YUYV    v4l2_fourcc(‘Y’, ‘U’, ‘Y’, ‘V’) /* 16  YUV 4:2:2     */
    #define V4L2_PIX_FMT_YYUV    v4l2_fourcc(‘Y’, ‘Y’, ‘U’, ‘V’) /* 16  YUV 4:2:2     */
    #define V4L2_PIX_FMT_YVYU    v4l2_fourcc(‘Y’, ‘V’, ‘Y’, ‘U’) /* 16 YVU 4:2:2 */
    #define V4L2_PIX_FMT_UYVY    v4l2_fourcc(‘U’, ‘Y’, ‘V’, ‘Y’) /* 16  YUV 4:2:2     */
    #define V4L2_PIX_FMT_VYUY    v4l2_fourcc(‘V’, ‘Y’, ‘U’, ‘Y’) /* 16  YUV 4:2:2     */
    #define V4L2_PIX_FMT_YUV422P v4l2_fourcc(‘4’, ‘2’, ‘2’, ‘P’) /* 16  YVU422 planar */
    #define V4L2_PIX_FMT_YUV411P v4l2_fourcc(‘4’, ‘1’, ‘1’, ‘P’) /* 16  YVU411 planar */
    #define V4L2_PIX_FMT_Y41P    v4l2_fourcc(‘Y’, ‘4’, ‘1’, ‘P’) /* 12  YUV 4:1:1     */
    #define V4L2_PIX_FMT_YUV444  v4l2_fourcc(‘Y’, ‘4’, ‘4’, ‘4’) /* 16  xxxxyyyy uuuuvvvv */
    #define V4L2_PIX_FMT_YUV555  v4l2_fourcc(‘Y’, ‘U’, ‘V’, ‘O’) /* 16  YUV-5-5-5     */
    #define V4L2_PIX_FMT_YUV565  v4l2_fourcc(‘Y’, ‘U’, ‘V’, ‘P’) /* 16  YUV-5-6-5     */
    #define V4L2_PIX_FMT_YUV32   v4l2_fourcc(‘Y’, ‘U’, ‘V’, ‘4’) /* 32  YUV-8-8-8-8   */
    #define V4L2_PIX_FMT_YUV410  v4l2_fourcc(‘Y’, ‘U’, ‘V’, ‘9’) /*  9  YUV 4:1:0     */
    #define V4L2_PIX_FMT_YUV420  v4l2_fourcc(‘Y’, ‘U’, ‘1’, ‘2’) /* 12  YUV 4:2:0     */
    #define V4L2_PIX_FMT_HI240   v4l2_fourcc(‘H’, ‘I’, ‘2’, ‘4’) /*  8  8-bit color   */
    #define V4L2_PIX_FMT_HM12    v4l2_fourcc(‘H’, ‘M’, ‘1’, ‘2’) /*  8  YUV 4:2:0 16×16 macroblocks */
    #define V4L2_PIX_FMT_M420    v4l2_fourcc(‘M’, ‘4’, ‘2’, ‘0’) /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */
     
    /* two planes — one Y, one Cr + Cb interleaved  */
    #define V4L2_PIX_FMT_NV12    v4l2_fourcc(‘N’, ‘V’, ‘1’, ‘2’) /* 12  Y/CbCr 4:2:0  */
    #define V4L2_PIX_FMT_NV21    v4l2_fourcc(‘N’, ‘V’, ‘2’, ‘1’) /* 12  Y/CrCb 4:2:0  */
    #define V4L2_PIX_FMT_NV16    v4l2_fourcc(‘N’, ‘V’, ‘1’, ‘6’) /* 16  Y/CbCr 4:2:2  */
    #define V4L2_PIX_FMT_NV61    v4l2_fourcc(‘N’, ‘V’, ‘6’, ‘1’) /* 16  Y/CrCb 4:2:2  */
     
    /* two non contiguous planes – one Y, one Cr + Cb interleaved  */
    #define V4L2_PIX_FMT_NV12M   v4l2_fourcc(‘N’, ‘M’, ‘1’, ‘2’) /* 12  Y/CbCr 4:2:0  */
    #define V4L2_PIX_FMT_NV12MT  v4l2_fourcc(‘T’, ‘M’, ‘1’, ‘2’) /* 12  Y/CbCr 4:2:0 64×32 macroblocks */
     
    /* three non contiguous planes – Y, Cb, Cr */
    #define V4L2_PIX_FMT_YUV420M v4l2_fourcc(‘Y’, ‘M’, ‘1’, ‘2’) /* 12  YUV420 planar */
     
    /* Bayer formats – see http://www.siliconimaging.com/RGB%20Bayer.htm */
    #define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc(‘B’, ‘A’, ‘8’, ‘1’) /*  8  BGBG.. GRGR.. */
    #define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc(‘G’, ‘B’, ‘R’, ‘G’) /*  8  GBGB.. RGRG.. */
    #define V4L2_PIX_FMT_SGRBG8  v4l2_fourcc(‘G’, ‘R’, ‘B’, ‘G’) /*  8  GRGR.. BGBG.. */
    #define V4L2_PIX_FMT_SRGGB8  v4l2_fourcc(‘R’, ‘G’, ‘G’, ‘B’) /*  8  RGRG.. GBGB.. */
    #define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc(‘B’, ‘G’, ‘1’, ‘0’) /* 10  BGBG.. GRGR.. */
    #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc(‘G’, ‘B’, ‘1’, ‘0’) /* 10  GBGB.. RGRG.. */
    #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc(‘B’, ‘A’, ‘1’, ‘0’) /* 10  GRGR.. BGBG.. */
    #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc(‘R’, ‘G’, ‘1’, ‘0’) /* 10  RGRG.. GBGB.. */
    #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc(‘B’, ‘G’, ‘1’, ‘2’) /* 12  BGBG.. GRGR.. */
    #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc(‘G’, ‘B’, ‘1’, ‘2’) /* 12  GBGB.. RGRG.. */
    #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc(‘B’, ‘A’, ‘1’, ‘2’) /* 12  GRGR.. BGBG.. */
    #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc(‘R’, ‘G’, ‘1’, ‘2’) /* 12  RGRG.. GBGB.. */
        /* 10bit raw bayer DPCM compressed to 8 bits */
    #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc(‘B’, ‘D’, ‘1’, ‘0’)
        /*
         * 10bit raw bayer, expanded to 16 bits
         * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb…
         */
    #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc(‘B’, ‘Y’, ‘R’, ‘2’) /* 16  BGBG.. GRGR.. */
     
    /* compressed formats */
    #define V4L2_PIX_FMT_MJPEG    v4l2_fourcc(‘M’, ‘J’, ‘P’, ‘G’) /* Motion-JPEG   */
    #define V4L2_PIX_FMT_JPEG     v4l2_fourcc(‘J’, ‘P’, ‘E’, ‘G’) /* JFIF JPEG     */
    #define V4L2_PIX_FMT_DV       v4l2_fourcc(‘d’, ‘v’, ‘s’, ‘d’) /* 1394          */
    #define V4L2_PIX_FMT_MPEG     v4l2_fourcc(‘M’, ‘P’, ‘E’, ‘G’) /* MPEG-1/2/4    */
     
    /*  Vendor-specific formats   */
    #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc(‘C’, ‘P’, ‘I’, ‘A’) /* cpia1 YUV */
    #define V4L2_PIX_FMT_WNVA     v4l2_fourcc(‘W’, ‘N’, ‘V’, ‘A’) /* Winnov hw compress */
    #define V4L2_PIX_FMT_SN9C10X  v4l2_fourcc(‘S’, ‘9’, ‘1’, ‘0’) /* SN9C10x compression */
    #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc(‘S’, ‘9’, ‘2’, ‘0’) /* SN9C20x YUV 4:2:0 */
    #define V4L2_PIX_FMT_PWC1     v4l2_fourcc(‘P’, ‘W’, ‘C’, ‘1’) /* pwc older webcam */
    #define V4L2_PIX_FMT_PWC2     v4l2_fourcc(‘P’, ‘W’, ‘C’, ‘2’) /* pwc newer webcam */
    #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc(‘E’, ‘6’, ‘2’, ‘5’) /* ET61X251 compression */
    #define V4L2_PIX_FMT_SPCA501  v4l2_fourcc(‘S’, ‘5’, ‘0’, ‘1’) /* YUYV per line */
    #define V4L2_PIX_FMT_SPCA505  v4l2_fourcc(‘S’, ‘5’, ‘0’, ‘5’) /* YYUV per line */
    #define V4L2_PIX_FMT_SPCA508  v4l2_fourcc(‘S’, ‘5’, ‘0’, ‘8’) /* YUVY per line */
    #define V4L2_PIX_FMT_SPCA561  v4l2_fourcc(‘S’, ‘5’, ‘6’, ‘1’) /* compressed GBRG bayer */
    #define V4L2_PIX_FMT_PAC207   v4l2_fourcc(‘P’, ‘2’, ‘0’, ‘7’) /* compressed BGGR bayer */
    #define V4L2_PIX_FMT_MR97310A v4l2_fourcc(‘M’, ‘3’, ‘1’, ‘0’) /* compressed BGGR bayer */
    #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc(‘S’, ‘O’, ‘N’, ‘X’) /* compressed GBRG bayer */
    #define V4L2_PIX_FMT_SQ905C   v4l2_fourcc(‘9’, ‘0’, ‘5’, ‘C’) /* compressed RGGB bayer */
    #define V4L2_PIX_FMT_PJPG     v4l2_fourcc(‘P’, ‘J’, ‘P’, ‘G’) /* Pixart 73xx JPEG */
    #define V4L2_PIX_FMT_OV511    v4l2_fourcc(‘O’, ‘5’, ‘1’, ‘1’) /* ov511 JPEG */
    #define V4L2_PIX_FMT_OV518    v4l2_fourcc(‘O’, ‘5’, ‘1’, ‘8’) /* ov518 JPEG */
    #define V4L2_PIX_FMT_STV0680  v4l2_fourcc(‘S’, ‘6’, ‘8’, ‘0’) /* stv0680 bayer */
    #define V4L2_PIX_FMT_TM6000   v4l2_fourcc(‘T’, ‘M’, ‘6’, ‘0’) /* tm5600/tm60x0 */
    #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc(‘C’, ‘I’, ‘T’, ‘V’) /* one line of Y then 1 line of VYUY */
    #define V4L2_PIX_FMT_KONICA420  v4l2_fourcc(‘K’, ‘O’, ‘N’, ‘I’) /* YUV420 planar in blocks of 256 pixels */
    #define V4L2_PIX_FMT_JPGL    v4l2_fourcc(‘J’, ‘P’, ‘G’, ‘L’) /* JPEG-Lite */

————————————————
版权声明:本文为CSDN博主「Arrow」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/myarrow/article/details/8516266

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/12346.html

(0)

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信