[FFmpeg-devel] [PATCH] libavcodec/imgconvert.c: fix BGR cases missing from depth test
Janusz Krzysztofik
jkrzyszt
Fri Mar 5 00:01:36 CET 2010
While reviewing libavcodec/imgconvert.c:avcodec_get_pix_fmt_loss(), it
appeared that BGR5{5,6}5 cases were missing from the test for depth loss.
Fix it.
Created and tested against ffmpeg svn revision 22211.
Reported-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Janusz Krzysztofik <jkrzyszt at tis.icnet.pl>
---
--- trunk/libavcodec/imgconvert.c.orig 2010-03-04 23:33:39.000000000 +0100
+++ trunk/libavcodec/imgconvert.c 2010-03-04 23:34:42.000000000 +0100
@@ -777,8 +777,10 @@ int avcodec_get_pix_fmt_loss(enum PixelF
loss = 0;
pf = &pix_fmt_info[dst_pix_fmt];
if (pf->depth < ps->depth ||
- ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE) &&
- (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
+ ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE ||
+ dst_pix_fmt == PIX_FMT_BGR555BE || dst_pix_fmt == PIX_FMT_BGR555LE) &&
+ (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE ||
+ src_pix_fmt == PIX_FMT_BGR565BE || src_pix_fmt == PIX_FMT_BGR565LE)))
loss |= FF_LOSS_DEPTH;
if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
More information about the ffmpeg-devel
mailing list