36 int x,
int y,
int c,
int w,
37 int read_pal_component)
40 int plane = comp.
plane;
42 int mask = (1 << depth) - 1;
43 int shift = comp.
shift;
49 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
50 int shift = 8 - depth - (skip & 7);
53 int val = (*p >> shift) & mask;
54 if (read_pal_component)
55 val = data[1][4*val + c];
62 const uint8_t *p = data[plane] + y * linesize[plane] +
64 int is_8bit = shift + depth <= 8;
70 int val = is_8bit ? *p :
72 val = (val >> shift) & mask;
73 if (read_pal_component)
74 val = data[1][4 * val + c];
84 int x,
int y,
int c,
int w)
87 int plane = comp.
plane;
94 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
95 int shift = 8 - depth - (skip & 7);
98 *p |= *src++ << shift;
104 int shift = comp.
shift;
105 uint8_t *p = data[plane] + y * linesize[plane] +
108 if (shift + depth <= 8) {
111 *p |= (*src++ << shift);
117 uint16_t val =
AV_RB16(p) | (*src++ << shift);
120 uint16_t val =
AV_RL16(p) | (*src++ << shift);
129 #if !FF_API_PIX_FMT_DESC 581 .name =
"yuva420p9be",
594 .name =
"yuva420p9le",
607 .name =
"yuva422p9be",
620 .name =
"yuva422p9le",
633 .name =
"yuva444p9be",
646 .name =
"yuva444p9le",
659 .name =
"yuva420p10be",
672 .name =
"yuva420p10le",
685 .name =
"yuva422p10be",
698 .name =
"yuva422p10le",
711 .name =
"yuva444p10be",
724 .name =
"yuva444p10le",
737 .name =
"yuva420p16be",
750 .name =
"yuva420p16le",
763 .name =
"yuva422p16be",
776 .name =
"yuva422p16le",
789 .name =
"yuva444p16be",
802 .name =
"yuva444p16le",
816 .name =
"vdpau_h264",
822 .name =
"vdpau_mpeg1",
828 .name =
"vdpau_mpeg2",
834 .name =
"vdpau_wmv3",
846 .name =
"vdpau_mpeg4",
1097 .name =
"vaapi_moco",
1103 .name =
"vaapi_idct",
1109 .name =
"vaapi_vld",
1121 .name =
"yuv420p9le",
1133 .name =
"yuv420p9be",
1145 .name =
"yuv420p10le",
1157 .name =
"yuv420p10be",
1169 .name =
"yuv420p16le",
1181 .name =
"yuv420p16be",
1193 .name =
"yuv422p9le",
1205 .name =
"yuv422p9be",
1217 .name =
"yuv422p10le",
1229 .name =
"yuv422p10be",
1241 .name =
"yuv422p16le",
1253 .name =
"yuv422p16be",
1265 .name =
"yuv444p16le",
1277 .name =
"yuv444p16be",
1289 .name =
"yuv444p10le",
1301 .name =
"yuv444p10be",
1313 .name =
"yuv444p9le",
1325 .name =
"yuv444p9be",
1337 .name =
"dxva2_vld",
1532 if (av_pix_fmt_descriptors[pix_fmt].name &&
1533 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1534 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1547 # define X_NE(be, le) be 1549 # define X_NE(be, le) le 1556 if (!strcmp(name,
"rgb32"))
1557 name =
X_NE(
"argb",
"bgra");
1558 else if (!strcmp(name,
"bgr32"))
1559 name =
X_NE(
"abgr",
"rgba");
1565 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1577 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1581 return bits >> log2_pixels;
1589 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
1592 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
1603 return &av_pix_fmt_descriptors[
pix_fmt];
1609 return &av_pix_fmt_descriptors[0];
1610 if (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
1617 if (desc < av_pix_fmt_descriptors ||
1618 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1626 int *h_shift,
int *v_shift)
1640 int i, planes[4] = { 0 }, ret = 0;
1655 #define PIX_FMT_SWAP_ENDIANNESS(fmt) \ 1656 case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE; \ 1657 case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE 1701 #undef PIX_FMT_SWAP_ENDIANNESS #define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_r...
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
packed RGB 8:8:8, 24bpp, RGBRGB...
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
char * av_get_pix_fmt_string(char *buf, int buf_size, enum AVPixelFormat pix_fmt)
Print in buf the string corresponding to the pixel format with number pix_fmt, or an header if pix_fm...
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 ...
#define FF_ARRAY_ELEMS(a)
const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
The array of all the pixel format descriptors.
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
uint16_t shift
Number of least significant bits that must be shifted away to get the value.
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
8 bit with PIX_FMT_RGB32 palette
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
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.
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
planar GBR 4:4:4 48bpp, big-endian
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
planar GBR 4:4:4 27bpp, big-endian
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
uint16_t depth_minus1
Number of bits in the component minus 1.
16bit gray, 16bit alpha (big-endian)
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
static const uint16_t mask[17]
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
XVideo Motion Acceleration via common packet passing.
int av_match_name(const char *name, const char *names)
Match instances of a name in a comma-separated list of names.
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Libavutil version macros.
HW acceleration through VDA, data[3] contains a CVPixelBufferRef.
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
common internal API header
as above, but U and V bytes are swapped
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
uint8_t nb_components
The number of components each pixel has, (1-4)
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
#define AV_PIX_FMT_FLAG_PSEUDOPAL
The pixel format is "pseudo-paletted".
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
packed RGB 8:8:8, 24bpp, BGRBGR...
packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big...
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian ...
enum AVPixelFormat pix_fmt
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, 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
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
planar GBR 4:4:4 30bpp, big-endian
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
uint16_t step_minus1
Number of elements between 2 horizontally consecutive pixels minus 1.
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 ...
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
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...
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 ...
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
hardware decoding through VDA
uint16_t plane
Which of the 4 planes contains the component.
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal and external API header
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
planar GBR 4:4:4 27bpp, little-endian
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
FF_ENABLE_DEPRECATION_WARNINGS int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
static FF_DISABLE_DEPRECATION_WARNINGS enum AVPixelFormat get_pix_fmt_internal(const char *name)
packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as lit...
#define FF_ENABLE_DEPRECATION_WARNINGS
uint16_t offset_plus1
Number of elements before the component of the first pixel plus 1.
Y , 16bpp, little-endian.
16bit gray, 16bit alpha (little-endian)
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 ...
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
planar GBR 4:4:4 48bpp, little-endian
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 ...
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian ...
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
AVPixelFormat
Pixel format.
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
planar GBR 4:4:4 30bpp, little-endian
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
#define PIX_FMT_SWAP_ENDIANNESS(fmt)
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian