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
648 .name =
"yuva420p9be",
661 .name =
"yuva420p9le",
674 .name =
"yuva422p9be",
687 .name =
"yuva422p9le",
700 .name =
"yuva444p9be",
713 .name =
"yuva444p9le",
726 .name =
"yuva420p10be",
739 .name =
"yuva420p10le",
752 .name =
"yuva422p10be",
765 .name =
"yuva422p10le",
778 .name =
"yuva444p10be",
791 .name =
"yuva444p10le",
804 .name =
"yuva420p16be",
817 .name =
"yuva420p16le",
830 .name =
"yuva422p16be",
843 .name =
"yuva422p16le",
856 .name =
"yuva444p16be",
869 .name =
"yuva444p16le",
883 .name =
"vdpau_h264",
889 .name =
"vdpau_mpeg1",
895 .name =
"vdpau_mpeg2",
901 .name =
"vdpau_wmv3",
913 .name =
"vdpau_mpeg4",
1164 .name =
"vaapi_moco",
1170 .name =
"vaapi_idct",
1176 .name =
"vaapi_vld",
1182 .name =
"yuv420p9le",
1194 .name =
"yuv420p9be",
1206 .name =
"yuv420p10le",
1218 .name =
"yuv420p10be",
1230 .name =
"yuv420p12le",
1242 .name =
"yuv420p12be",
1254 .name =
"yuv420p14le",
1266 .name =
"yuv420p14be",
1278 .name =
"yuv420p16le",
1290 .name =
"yuv420p16be",
1302 .name =
"yuv422p9le",
1314 .name =
"yuv422p9be",
1326 .name =
"yuv422p10le",
1338 .name =
"yuv422p10be",
1350 .name =
"yuv422p12le",
1362 .name =
"yuv422p12be",
1374 .name =
"yuv422p14le",
1386 .name =
"yuv422p14be",
1398 .name =
"yuv422p16le",
1410 .name =
"yuv422p16be",
1422 .name =
"yuv444p16le",
1434 .name =
"yuv444p16be",
1446 .name =
"yuv444p10le",
1458 .name =
"yuv444p10be",
1470 .name =
"yuv444p9le",
1482 .name =
"yuv444p9be",
1494 .name =
"yuv444p12le",
1506 .name =
"yuv444p12be",
1518 .name =
"yuv444p14le",
1530 .name =
"yuv444p14be",
1542 .name =
"dxva2_vld",
1727 .name =
"gbrap16le",
1740 .name =
"gbrap16be",
1783 #define BAYER8_DESC_COMMON \
1784 .nb_components= 3, \
1785 .log2_chroma_w= 0, \
1786 .log2_chroma_h= 0, \
1793 #define BAYER16_DESC_COMMON \
1794 .nb_components= 3, \
1795 .log2_chroma_w= 0, \
1796 .log2_chroma_h= 0, \
1804 .name =
"bayer_bggr8",
1809 .name =
"bayer_bggr16le",
1814 .name =
"bayer_bggr16be",
1819 .name =
"bayer_rggb8",
1824 .name =
"bayer_rggb16le",
1829 .name =
"bayer_rggb16be",
1834 .name =
"bayer_gbrg8",
1839 .name =
"bayer_gbrg16le",
1844 .name =
"bayer_gbrg16be",
1849 .name =
"bayer_grbg8",
1854 .name =
"bayer_grbg16le",
1859 .name =
"bayer_grbg16be",
1911 if (av_pix_fmt_descriptors[pix_fmt].name &&
1912 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1913 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1926 # define X_NE(be, le) be
1928 # define X_NE(be, le) le
1935 if (!strcmp(name,
"rgb32"))
1936 name =
X_NE(
"argb",
"bgra");
1937 else if (!strcmp(name,
"bgr32"))
1938 name =
X_NE(
"abgr",
"rgba");
1944 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1956 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1960 return bits >> log2_pixels;
1971 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1974 for (c = 0; c < 4; c++)
1980 return bits >> log2_pixels;
1988 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
1991 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
2002 return &av_pix_fmt_descriptors[
pix_fmt];
2008 return &av_pix_fmt_descriptors[0];
2009 while (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2019 if (desc < av_pix_fmt_descriptors ||
2020 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2028 int *h_shift,
int *v_shift)
2042 int i, planes[4] = { 0 },
ret = 0;
2059 uint8_t fill[4][8+6+3] = {{0}};
2060 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2061 int linesize[4] = {0,0,0,0};
2085 if (!strncmp(d->
name,
"bayer_", 6))
2102 if (!desc || strlen(desc->
name) < 2)
2105 i = strlen(name) - 2;
2106 if (strcmp(name + i,
"be") && strcmp(name + i,
"le"))
2109 name[i] ^=
'b' ^
'l';
2114 #define FF_COLOR_NA -1
2115 #define FF_COLOR_RGB 0
2116 #define FF_COLOR_GRAY 1
2117 #define FF_COLOR_YUV 2
2118 #define FF_COLOR_YUV_JPEG 3
2120 #define pixdesc_has_alpha(pixdesc) \
2121 ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2131 if(desc->
name && !strncmp(desc->
name,
"yuvj", 4))
2153 *min = INT_MAX, *max = -INT_MAX;
2163 unsigned *lossp,
unsigned consider)
2167 int src_color, dst_color;
2168 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2169 int ret, loss, i, nb_components;
2170 int score = INT_MAX - 1;
2178 if (dst_pix_fmt == src_pix_fmt)
2193 for (i = 0; i < nb_components; i++) {
2197 score -= 65536 >> depth_minus1;
2240 if (src_color != dst_color)
2244 if(loss & FF_LOSS_COLORSPACE)
2278 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2281 int loss1, loss2, loss_mask;
2286 loss_mask= loss_ptr?~*loss_ptr:~0;
2293 if (score1 == score2) {
2300 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2317 if(!desc || !desc->
name) {