37 int x,
int y,
int c,
int w,
38 int read_pal_component)
41 int plane = comp.
plane;
50 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
51 int shift = 8 - depth - (skip & 7);
55 if (read_pal_component)
56 val = data[1][4*val +
c];
63 const uint8_t *p = data[plane] + y * linesize[plane] +
65 int is_8bit = shift + depth <= 8;
71 int val = is_8bit ? *p :
73 val = (val >>
shift) & mask;
74 if (read_pal_component)
75 val = data[1][4 * val +
c];
85 int x,
int y,
int c,
int w)
88 int plane = comp.
plane;
95 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
96 int shift = 8 - depth - (skip & 7);
99 *p |= *src++ <<
shift;
106 uint8_t *p = data[plane] + y * linesize[plane] +
109 if (shift + depth <= 8) {
112 *p |= (*src++ <<
shift);
130 #if !FF_API_PIX_FMT_DESC
645 .name =
"yuva420p9be",
658 .name =
"yuva420p9le",
671 .name =
"yuva422p9be",
684 .name =
"yuva422p9le",
697 .name =
"yuva444p9be",
710 .name =
"yuva444p9le",
723 .name =
"yuva420p10be",
736 .name =
"yuva420p10le",
749 .name =
"yuva422p10be",
762 .name =
"yuva422p10le",
775 .name =
"yuva444p10be",
788 .name =
"yuva444p10le",
801 .name =
"yuva420p16be",
814 .name =
"yuva420p16le",
827 .name =
"yuva422p16be",
840 .name =
"yuva422p16le",
853 .name =
"yuva444p16be",
866 .name =
"yuva444p16le",
880 .name =
"vdpau_h264",
886 .name =
"vdpau_mpeg1",
892 .name =
"vdpau_mpeg2",
898 .name =
"vdpau_wmv3",
910 .name =
"vdpau_mpeg4",
1161 .name =
"vaapi_moco",
1167 .name =
"vaapi_idct",
1173 .name =
"vaapi_vld",
1179 .name =
"yuv420p9le",
1191 .name =
"yuv420p9be",
1203 .name =
"yuv420p10le",
1215 .name =
"yuv420p10be",
1227 .name =
"yuv420p12le",
1239 .name =
"yuv420p12be",
1251 .name =
"yuv420p14le",
1263 .name =
"yuv420p14be",
1275 .name =
"yuv420p16le",
1287 .name =
"yuv420p16be",
1299 .name =
"yuv422p9le",
1311 .name =
"yuv422p9be",
1323 .name =
"yuv422p10le",
1335 .name =
"yuv422p10be",
1347 .name =
"yuv422p12le",
1359 .name =
"yuv422p12be",
1371 .name =
"yuv422p14le",
1383 .name =
"yuv422p14be",
1395 .name =
"yuv422p16le",
1407 .name =
"yuv422p16be",
1419 .name =
"yuv444p16le",
1431 .name =
"yuv444p16be",
1443 .name =
"yuv444p10le",
1455 .name =
"yuv444p10be",
1467 .name =
"yuv444p9le",
1479 .name =
"yuv444p9be",
1491 .name =
"yuv444p12le",
1503 .name =
"yuv444p12be",
1515 .name =
"yuv444p14le",
1527 .name =
"yuv444p14be",
1539 .name =
"dxva2_vld",
1705 .name =
"gbrap16le",
1718 .name =
"gbrap16be",
1761 #define BAYER8_DESC_COMMON \
1762 .nb_components= 3, \
1763 .log2_chroma_w= 0, \
1764 .log2_chroma_h= 0, \
1771 #define BAYER16_DESC_COMMON \
1772 .nb_components= 3, \
1773 .log2_chroma_w= 0, \
1774 .log2_chroma_h= 0, \
1782 .name =
"bayer_bggr8",
1787 .name =
"bayer_bggr16le",
1792 .name =
"bayer_bggr16be",
1797 .name =
"bayer_rggb8",
1802 .name =
"bayer_rggb16le",
1807 .name =
"bayer_rggb16be",
1812 .name =
"bayer_gbrg8",
1817 .name =
"bayer_gbrg16le",
1822 .name =
"bayer_gbrg16be",
1827 .name =
"bayer_grbg8",
1832 .name =
"bayer_grbg16le",
1837 .name =
"bayer_grbg16be",
1889 if (av_pix_fmt_descriptors[pix_fmt].name &&
1890 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
1903 # define X_NE(be, le) be
1905 # define X_NE(be, le) le
1912 if (!strcmp(name,
"rgb32"))
1913 name =
X_NE(
"argb",
"bgra");
1914 else if (!strcmp(name,
"bgr32"))
1915 name =
X_NE(
"abgr",
"rgba");
1921 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1933 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1937 return bits >> log2_pixels;
1948 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1951 for (c = 0; c < 4; c++)
1957 return bits >> log2_pixels;
1964 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
1967 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
1978 return &av_pix_fmt_descriptors[
pix_fmt];
1984 return &av_pix_fmt_descriptors[0];
1985 while (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
1995 if (desc < av_pix_fmt_descriptors ||
1996 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2004 int *h_shift,
int *v_shift)
2018 int i, planes[4] = { 0 },
ret = 0;
2035 uint8_t fill[4][8+6+3] = {{0}};
2036 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2037 int linesize[4] = {0,0,0,0};
2061 if (!strncmp(d->
name,
"bayer_", 6))
2078 if (!desc || strlen(desc->
name) < 2)
2081 i = strlen(name) - 2;
2082 if (strcmp(name + i,
"be") && strcmp(name + i,
"le"))
2085 name[i] ^=
'b' ^
'l';
2090 #define FF_COLOR_NA -1
2091 #define FF_COLOR_RGB 0
2092 #define FF_COLOR_GRAY 1
2093 #define FF_COLOR_YUV 2
2094 #define FF_COLOR_YUV_JPEG 3
2096 #define pixdesc_has_alpha(pixdesc) \
2097 ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2107 if(desc->
name && !strncmp(desc->
name,
"yuvj", 4))
2129 *min = INT_MAX, *max = -INT_MAX;
2139 unsigned *lossp,
unsigned consider)
2143 int src_color, dst_color;
2144 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2145 int ret, loss, i, nb_components;
2146 int score = INT_MAX - 1;
2154 if (dst_pix_fmt == src_pix_fmt)
2169 for (i = 0; i < nb_components; i++) {
2173 score -= 65536 >> depth_minus1;
2216 if (src_color != dst_color)
2220 if(loss & FF_LOSS_COLORSPACE)
2254 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2257 int loss1, loss2, loss_mask;
2262 loss_mask= loss_ptr?~*loss_ptr:~0;
2270 if (score1 == score2) {
2277 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2294 if(!desc || !desc->
name) {