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",
1910 "unknown",
"tv",
"pc",
1914 "reserved",
"bt709",
"unknown",
"reserved",
"bt470m",
1915 "bt470bg",
"smpte170m",
"smpte240m",
"film",
"bt2020",
1919 "reserved",
"bt709",
"unknown",
"reserved",
"bt470m",
1920 "bt470bg",
"smpte170m",
"smpte240m",
"linear",
"log100",
1921 "log316",
"iec61966-2-4",
"bt1361e",
"iec61966-2-1",
1922 "bt2020-10",
"bt2020-20",
1926 "gbr",
"bt709",
"unknown",
"reserved",
"fcc",
1927 "bt470bg",
"smpte170m",
"smpte240m",
"ycgco",
1928 "bt2020nc",
"bt2020c",
1932 "unspecified",
"left",
"center",
"topleft",
1933 "top",
"bottomleft",
"bottom",
1942 if (av_pix_fmt_descriptors[pix_fmt].name &&
1943 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1944 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1957 # define X_NE(be, le) be
1959 # define X_NE(be, le) le
1966 if (!strcmp(name,
"rgb32"))
1967 name =
X_NE(
"argb",
"bgra");
1968 else if (!strcmp(name,
"bgr32"))
1969 name =
X_NE(
"abgr",
"rgba");
1975 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1987 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1991 return bits >> log2_pixels;
2002 int s = c == 1 || c == 2 ? 0 : log2_pixels;
2005 for (c = 0; c < 4; c++)
2011 return bits >> log2_pixels;
2019 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
2022 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
2033 return &av_pix_fmt_descriptors[
pix_fmt];
2039 return &av_pix_fmt_descriptors[0];
2040 while (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2050 if (desc < av_pix_fmt_descriptors ||
2051 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2058 int *h_shift,
int *v_shift)
2072 int i, planes[4] = { 0 },
ret = 0;
2089 uint8_t fill[4][8+6+3] = {{0}};
2090 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2091 int linesize[4] = {0,0,0,0};
2115 if (!strncmp(d->
name,
"bayer_", 6))
2133 if (!desc || strlen(desc->
name) < 2)
2136 i = strlen(name) - 2;
2137 if (strcmp(name + i,
"be") && strcmp(name + i,
"le"))
2140 name[i] ^=
'b' ^
'l';
2145 #define FF_COLOR_NA -1
2146 #define FF_COLOR_RGB 0
2147 #define FF_COLOR_GRAY 1
2148 #define FF_COLOR_YUV 2
2149 #define FF_COLOR_YUV_JPEG 3
2151 #define pixdesc_has_alpha(pixdesc) \
2152 ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2162 if(desc->
name && !strncmp(desc->
name,
"yuvj", 4))
2184 *min = INT_MAX, *max = -INT_MAX;
2194 unsigned *lossp,
unsigned consider)
2198 int src_color, dst_color;
2199 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2200 int ret, loss, i, nb_components;
2201 int score = INT_MAX - 1;
2209 if (dst_pix_fmt == src_pix_fmt)
2224 for (i = 0; i < nb_components; i++) {
2228 score -= 65536 >> depth_minus1;
2271 if (src_color != dst_color)
2275 if(loss & FF_LOSS_COLORSPACE)
2309 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2312 int loss1, loss2, loss_mask;
2317 loss_mask= loss_ptr?~*loss_ptr:~0;
2324 if (score1 == score2) {
2331 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2378 if(!desc || !desc->
name) {