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",
1906 "unknown",
"tv",
"pc",
1910 "reserved",
"bt709",
"unknown",
"reserved",
"bt470m",
1911 "bt470bg",
"smpte170m",
"smpte240m",
"film",
"bt2020",
1915 "reserved",
"bt709",
"unknown",
"reserved",
"bt470m",
1916 "bt470bg",
"smpte170m",
"smpte240m",
"linear",
"log100",
1917 "log316",
"iec61966-2-4",
"bt1361e",
"iec61966-2-1",
1918 "bt2020-10",
"bt2020-20",
1922 "gbr",
"bt709",
"unknown",
"reserved",
"fcc",
1923 "bt470bg",
"smpte170m",
"smpte240m",
"ycgco",
1924 "bt2020nc",
"bt2020c",
1928 "unspecified",
"left",
"center",
"topleft",
1929 "top",
"bottomleft",
"bottom",
1938 if (av_pix_fmt_descriptors[pix_fmt].name &&
1939 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1940 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1953 # define X_NE(be, le) be
1955 # define X_NE(be, le) le
1962 if (!strcmp(name,
"rgb32"))
1963 name =
X_NE(
"argb",
"bgra");
1964 else if (!strcmp(name,
"bgr32"))
1965 name =
X_NE(
"abgr",
"rgba");
1971 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1983 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1987 return bits >> log2_pixels;
1998 int s = c == 1 || c == 2 ? 0 : log2_pixels;
2001 for (c = 0; c < 4; c++)
2007 return bits >> log2_pixels;
2015 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
2018 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
2029 return &av_pix_fmt_descriptors[
pix_fmt];
2035 return &av_pix_fmt_descriptors[0];
2036 while (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2046 if (desc < av_pix_fmt_descriptors ||
2047 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2055 int *h_shift,
int *v_shift)
2069 int i, planes[4] = { 0 },
ret = 0;
2086 uint8_t fill[4][8+6+3] = {{0}};
2087 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2088 int linesize[4] = {0,0,0,0};
2112 if (!strncmp(d->
name,
"bayer_", 6))
2129 if (!desc || strlen(desc->
name) < 2)
2132 i = strlen(name) - 2;
2133 if (strcmp(name + i,
"be") && strcmp(name + i,
"le"))
2136 name[i] ^=
'b' ^
'l';
2141 #define FF_COLOR_NA -1
2142 #define FF_COLOR_RGB 0
2143 #define FF_COLOR_GRAY 1
2144 #define FF_COLOR_YUV 2
2145 #define FF_COLOR_YUV_JPEG 3
2147 #define pixdesc_has_alpha(pixdesc) \
2148 ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2158 if(desc->
name && !strncmp(desc->
name,
"yuvj", 4))
2180 *min = INT_MAX, *max = -INT_MAX;
2190 unsigned *lossp,
unsigned consider)
2194 int src_color, dst_color;
2195 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2196 int ret, loss, i, nb_components;
2197 int score = INT_MAX - 1;
2205 if (dst_pix_fmt == src_pix_fmt)
2220 for (i = 0; i < nb_components; i++) {
2224 score -= 65536 >> depth_minus1;
2267 if (src_color != dst_color)
2271 if(loss & FF_LOSS_COLORSPACE)
2305 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2308 int loss1, loss2, loss_mask;
2313 loss_mask= loss_ptr?~*loss_ptr:~0;
2320 if (score1 == score2) {
2327 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2374 if(!desc || !desc->
name) {