aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-18 15:51:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-22 14:42:53 +0100
commite9a6152e17c7c9b4fc29e70bc6c25452df2177ec (patch)
tree3216119f88f20f8831514b19e63d5265124b941f
parentb4ec645f471faa5142ce492e39c7527eddda46de (diff)
downloadffmpeg-e9a6152e17c7c9b4fc29e70bc6c25452df2177ec.tar.gz
lavc: fix FF_LOSS_COLORQUANT detection for gray8a->pal8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/imgconvert.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index e600d1cc78..8b32230ff4 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -456,8 +456,9 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
if (!pf->is_alpha && (ps->is_alpha && has_alpha))
loss |= FF_LOSS_ALPHA;
if (dst_pix_fmt == PIX_FMT_PAL8 &&
- (src_pix_fmt != PIX_FMT_PAL8 && ps->color_type != FF_COLOR_GRAY))
+ (src_pix_fmt != PIX_FMT_PAL8 && (ps->color_type != FF_COLOR_GRAY || (ps->is_alpha && has_alpha))))
loss |= FF_LOSS_COLORQUANT;
+
return loss;
}