[PIX_FMT_RGB48LE] = {
.color_type = FF_COLOR_RGB,
},
+ [PIX_FMT_RGBA64BE] = {
+ .is_alpha = 1,
+ .color_type = FF_COLOR_RGB,
+ },
+ [PIX_FMT_RGBA64LE] = {
+ .is_alpha = 1,
+ .color_type = FF_COLOR_RGB,
+ },
[PIX_FMT_RGB565BE] = {
.color_type = FF_COLOR_RGB,
},
.is_alpha = 1,
.color_type = FF_COLOR_RGB,
},
+ [PIX_FMT_BGR48BE] = {
+ .color_type = FF_COLOR_RGB,
+ },
+ [PIX_FMT_BGR48LE] = {
+ .color_type = FF_COLOR_RGB,
+ },
+ [PIX_FMT_BGRA64BE] = {
+ .is_alpha = 1,
+ .color_type = FF_COLOR_RGB,
+ },
+ [PIX_FMT_BGRA64LE] = {
+ .is_alpha = 1,
+ .color_type = FF_COLOR_RGB,
+ },
[PIX_FMT_BGR565BE] = {
.color_type = FF_COLOR_RGB,
.padded_size = 16,
}
}
+ switch (pix_fmt) {
+ case PIX_FMT_RGB8:
+ case PIX_FMT_BGR8:
+ case PIX_FMT_RGB4_BYTE:
+ case PIX_FMT_BGR4_BYTE:
+ case PIX_FMT_GRAY8:
+ // do not include palette for these pseudo-paletted formats
+ return size;
+ }
+
if (desc->flags & PIX_FMT_PAL)
memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4);
int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
int has_alpha)
{
- if (dst_pix_fmt>=PIX_FMT_NB || dst_pix_fmt<=PIX_FMT_NONE)
- return ~0;
-
const PixFmtInfo *pf, *ps;
- const AVPixFmtDescriptor *src_desc = &av_pix_fmt_descriptors[src_pix_fmt];
- const AVPixFmtDescriptor *dst_desc = &av_pix_fmt_descriptors[dst_pix_fmt];
+ const AVPixFmtDescriptor *src_desc;
+ const AVPixFmtDescriptor *dst_desc;
int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
int ret, loss;
+ if (dst_pix_fmt >= PIX_FMT_NB || dst_pix_fmt <= PIX_FMT_NONE)
+ return ~0;
+
+ src_desc = &av_pix_fmt_descriptors[src_pix_fmt];
+ dst_desc = &av_pix_fmt_descriptors[dst_pix_fmt];
ps = &pix_fmt_info[src_pix_fmt];
/* compute loss */