changeset 23478:8fae00da2059

RGB8/BGR8 IMGFMTs are paletted in case of swscale input. Actually they are also for output, but swscale does not support PIX_FMT_PAL8 output.
author reimar
date Thu, 07 Jun 2007 19:11:25 +0000
parents 15710094cb15
children db82492b2f30
files libmpcodecs/vf_scale.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Thu Jun 07 18:06:53 2007 +0000
+++ b/libmpcodecs/vf_scale.c	Thu Jun 07 19:11:25 2007 +0000
@@ -124,6 +124,7 @@
 	return 0;
     }
     sfmt = imgfmt2pixfmt(outfmt);
+    if (outfmt == IMGFMT_RGB8 || outfmt == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
     dfmt = imgfmt2pixfmt(best);
     
     vo_flags=vf->next->query_format(vf->next,best);
@@ -605,6 +606,7 @@
 
 	dfmt = imgfmt2pixfmt(dstFormat);
 	sfmt = imgfmt2pixfmt(srcFormat);
+	if (outfmt == IMGFMT_RGB8 || outfmt == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
 	sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
 
 	return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags | get_sws_cpuflags(), srcFilterParam, dstFilterParam, NULL);