changeset 11365:eb03ee2f7781 libavcodec

Fix BGR cases missing from depth test in avcodec_get_pix_fmt_loss(). Patch by Janusz Krzysztofik: <${name initial}${surname less the final "ofik"}@tis.icnet.pl>.
author stefano
date Fri, 05 Mar 2010 00:50:13 +0000
parents 4b64693d115d
children 3f231ba93f80
files imgconvert.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/imgconvert.c	Thu Mar 04 19:12:20 2010 +0000
+++ b/imgconvert.c	Fri Mar 05 00:50:13 2010 +0000
@@ -777,8 +777,10 @@
     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)