[PATCH] Fill the r, g, b values used for computing the c->pal_yuv table in the case where the source format is PIX_FMT_GRAY8.

Stefano Sabatini stefano.sabatini-lala
Wed Mar 3 00:29:24 CET 2010


This is required if GRAY8 will be declared as a paletted format,
otherwise gray8 -> RGB conversion will result broken.
---
 swscale.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/swscale.c b/swscale.c
index 689233c..83607d2 100644
--- a/swscale.c
+++ b/swscale.c
@@ -1849,6 +1849,8 @@ int sws_scale(SwsContext *c, const uint8_t* const src[], const int srcStride[],
                 r= (i>>3    )*255;
                 g= ((i>>1)&3)*85;
                 b= (i&1     )*255;
+            } else if(c->srcFormat == PIX_FMT_GRAY8) {
+                r = g = b = i;
             } else {
                 assert(c->srcFormat == PIX_FMT_BGR4_BYTE);
                 b= (i>>3    )*255;
-- 
1.6.6.1


--ZPt4rx8FFjLCG7dd--



More information about the ffmpeg-devel mailing list