31 int read_pal_component)
34 int plane = comp.
plane;
37 int shift = comp.
shift;
43 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
44 int shift = 8 - depth - (skip & 7);
47 int val = (*p >> shift) & mask;
48 if (read_pal_component)
49 val = data[1][4*val + c];
56 const uint8_t *p = data[plane] + y * linesize[plane] + x * step + comp.
offset_plus1 - 1;
57 int is_8bit = shift + depth <= 8;
63 int val = is_8bit ? *p :
65 val = (val >> shift) & mask;
66 if (read_pal_component)
67 val = data[1][4 * val + c];
78 int plane = comp.
plane;
85 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
86 int shift = 8 - depth - (skip & 7);
89 *p |= *src++ << shift;
95 int shift = comp.
shift;
96 uint8_t *p = data[plane] + y * linesize[plane] + x * step + comp.
offset_plus1 - 1;
98 if (shift + depth <= 8) {
101 *p |= (*src++ << shift);
107 uint16_t val =
AV_RB16(p) | (*src++ << shift);
110 uint16_t val =
AV_RL16(p) | (*src++ << shift);
525 .name =
"vdpau_h264",
531 .name =
"vdpau_mpeg1",
537 .name =
"vdpau_mpeg2",
543 .name =
"vdpau_wmv3",
555 .name =
"vdpau_mpeg4",
753 .name =
"vaapi_moco",
759 .name =
"vaapi_idct",
777 .name =
"yuv420p9le",
789 .name =
"yuv420p9be",
801 .name =
"yuv420p10le",
813 .name =
"yuv420p10be",
825 .name =
"yuv420p16le",
837 .name =
"yuv420p16be",
849 .name =
"yuv422p9le",
861 .name =
"yuv422p9be",
873 .name =
"yuv422p10le",
885 .name =
"yuv422p10be",
897 .name =
"yuv422p16le",
909 .name =
"yuv422p16be",
921 .name =
"yuv444p16le",
933 .name =
"yuv444p16be",
945 .name =
"yuv444p10le",
957 .name =
"yuv444p10be",
969 .name =
"yuv444p9le",
981 .name =
"yuv444p9be",
1096 for (pix_fmt = 0; pix_fmt <
PIX_FMT_NB; pix_fmt++)
1097 if (av_pix_fmt_descriptors[pix_fmt].name &&
1098 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
1111 # define X_NE(be, le) be
1113 # define X_NE(be, le) le
1120 if (!strcmp(name,
"rgb32"))
1121 name =
X_NE(
"argb",
"bgra");
1122 else if (!strcmp(name,
"bgr32"))
1123 name =
X_NE(
"abgr",
"rgba");
1129 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1141 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1145 return bits >> log2_pixels;
1152 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
1155 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 ...
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
planar GBR 4:4:4 27bpp, little endian
hardware decoding through VDA
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint16_t shift
number of least significant bits that must be shifted away to get the value
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 ...
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_r...
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 ...
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w)
Write the values from src to the pixel format component c of an image line.
XVideo Motion Acceleration via common packet passing.
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Y , 16bpp, little-endian.
uint16_t depth_minus1
number of bits in the component minus 1
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
char * av_get_pix_fmt_string(char *buf, int buf_size, enum PixelFormat pix_fmt)
Print in buf the string corresponding to the pixel format with number pix_fmt, or an header if pix_fm...
static const uint16_t mask[17]
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
#define PIX_FMT_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
planar GBR 4:4:4 27bpp, big endian
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
uint8_t nb_components
The number of components each pixel has, (1-4)
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 ...
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
const char * av_get_pix_fmt_name(enum PixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
#define PIX_FMT_BITSTREAM
All values of a component are bit-wise packed end to end.
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
as above, but U and V bytes are swapped
static enum PixelFormat get_pix_fmt_internal(const char *name)
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
planar GBR 4:4:4 30bpp, big endian
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
#define PIX_FMT_HWACCEL
Pixel format is an HW accelerated format.
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 ...
#define PIX_FMT_PLANAR
At least one pixel component is not in the first data plane.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
planar GBR 4:4:4 48bpp, little endian
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 ...
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
uint16_t step_minus1
Number of elements between 2 horizontally consecutive pixels minus 1.
packed RGB 8:8:8, 24bpp, BGRBGR...
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component)
Read a line from an image, and write the values of the pixel format component c to dst...
#define PIX_FMT_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale)
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
uint16_t plane
which of the 4 planes contains the component
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
8 bit with PIX_FMT_RGB32 palette
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
planar GBR 4:4:4 48bpp, big endian
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
packed RGB 8:8:8, 24bpp, RGBRGB...
uint16_t offset_plus1
Number of elements before the component of the first pixel plus 1.
planar GBR 4:4:4 30bpp, little endian
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
enum PixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define PIX_FMT_BE
Pixel format is big-endian.