2 * \brief VP Api. Output SDL stage declaration
3 * \author Sylvain Gaeremynck <sylvain.gaeremynck@parrot.fr>
4 * \author Aurelien Morelle <aurelien.morelle@parrot.fr>
5 * \author Thomas Landais <thomas.landais@parrot.fr>
7 * \date first release 16/03/2007
8 * \date modification 28/03/2007
11 #ifndef _VP_API_PICTURE_H_
12 #define _VP_API_PICTURE_H_
14 #include <VP_Os/vp_os_types.h>
16 #include <libavutil/avutil.h>
19 * Pixel format. Notes:
21 * PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA
22 * color is put together as:
23 * (A << 24) | (R << 16) | (G << 8) | B
24 * This is stored as BGRA on little endian CPU architectures and ARGB on
27 * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
28 * image data is stored in AVFrame.data[0]. The palette is transported in
29 * AVFrame.data[1] and, is 1024 bytes long (256 4-byte entries) and is
30 * formatted the same as in PIX_FMT_RGBA32 described above (i.e., it is
31 * also endian-specific). Note also that the individual RGB palette
32 * components stored in AVFrame.data[1] should be in the range 0..255.
33 * This is important as many custom PAL8 video codecs that were designed
34 * to run on the IBM VGA graphics adapter use 6-bit palette components.
38 PIX_FMT_YUV420P, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
39 PIX_FMT_YUV422, ///< Packed pixel, Y0 Cb Y1 Cr
40 PIX_FMT_RGB24, ///< Packed pixel, 3 bytes per pixel, RGBRGB...
41 PIX_FMT_BGR24, ///< Packed pixel, 3 bytes per pixel, BGRBGR...
42 PIX_FMT_YUV422P, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
43 PIX_FMT_YUV444P, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples)
44 PIX_FMT_RGBA32, ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
45 PIX_FMT_YUV410P, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
46 PIX_FMT_YUV411P, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
47 PIX_FMT_RGB565, ///< always stored in cpu endianness
48 PIX_FMT_RGB555, ///< always stored in cpu endianness, most significant bit to 1
50 PIX_FMT_MONOWHITE, ///< 0 is white
51 PIX_FMT_MONOBLACK, ///< 0 is black
52 PIX_FMT_PAL8, ///< 8 bit with RGBA palette
53 PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0 full scale (jpeg)
54 PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2 full scale (jpeg)
55 PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4 full scale (jpeg)
56 PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
57 PIX_FMT_XVMC_MPEG2_IDCT,
58 PIX_FMT_UYVY422, ///< Packed pixel, Cb Y0 Cr Y1
59 PIX_FMT_UYVY411, ///< Packed pixel, Cb Y0 Y1 Cr Y2 Y3
66 #define MB_HEIGHT_Y MB_WIDTH_Y
68 #define MB_HEIGHT_C MB_WIDTH_C
72 #define SQCIF_WIDTH 128
73 #define SQCIF_HEIGHT 96
74 #define SQCIF_SIZE (SQCIF_WIDTH * SQCIF_HEIGHT)
77 #define QCIF_WIDTH 176
78 #define QCIF_HEIGHT 144
79 #define QCIF_SIZE (QCIF_WIDTH * QCIF_HEIGHT)
81 #define QQVGA_WIDTH 160
82 #define QQVGA_HEIGHT 120
83 #define QQVGA_SIZE (QQVGA_WIDTH * QQVGA_HEIGHT)
86 #define QQCIF_WIDTH 88
87 #define QQCIF_HEIGHT 72
88 #define QQCIF_SIZE (QQCIF_WIDTH * QQCIF_HEIGHT)
91 #define QQVGA_WIDTH 160
92 #define QQVGA_HEIGHT 120
93 #define QQVGA_SIZE (QQVGA_WIDTH * QQVGA_HEIGHT)
96 #define QVGA_WIDTH 320
97 #define QVGA_HEIGHT 240
98 #define QVGA_SIZE (QVGA_WIDTH * QVGA_HEIGHT)
101 #define TWEAKY_QQVGA_WIDTH 320
102 #define TWEAKY_QQVGA_HEIGHT (240-16)
103 #define TWEAKY_QQVGA_SIZE (TWEAKY_QQVGA_WIDTH * TWEAKY_QQVGA_HEIGHT)
106 #define CIF_WIDTH 352
107 #define CIF_HEIGHT 288
108 #define CIF_SIZE (CIF_WIDTH * CIF_HEIGHT)
111 #define VGA_WIDTH 640
112 #define VGA_HEIGHT 480
113 #define VGA_SIZE (VGA_WIDTH * VGA_HEIGHT)
116 typedef struct _vp_api_picture_
118 enum PixelFormat format; // camif -> encoder : PIX_FMT_YUV420P
120 uint32_t width; // camif -> encoder
121 uint32_t height; // camif -> encoder
122 uint32_t framerate; // camif -> encoder
124 uint8_t *y_buf; // camif -> encoder
125 uint8_t *cb_buf; // camif -> encoder
126 uint8_t *cr_buf; // camif -> encoder
128 uint32_t y_pad; // 2* camif_config.y_pad
129 uint32_t c_pad; // 2* camif_config.c_pad
131 uint32_t y_line_size;
132 uint32_t cb_line_size;
133 uint32_t cr_line_size;
135 uint32_t vision_complete;
142 #endif // ! _VP_API_PICTURE_H_