From fa65e2f63ac4ac7d2a2030191df0842a31bc5501 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 15 Apr 2007 01:27:34 +0000 Subject: [PATCH] improve horizontal chroma resolution with pal Originally committed as revision 22994 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale --- libswscale/swscale.c | 5 ++++- libswscale/swscale_template.c | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 1b21a2f..0dec5e5 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2036,7 +2036,10 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH c->chrSrcVSubSample+= c->vChrDrop; // drop every 2. pixel for chroma calculation unless user wants full chroma - if((isBGR(srcFormat) || isRGB(srcFormat)) && !(flags&SWS_FULL_CHR_H_INP)) + if((isBGR(srcFormat) || isRGB(srcFormat)) && !(flags&SWS_FULL_CHR_H_INP) + && srcFormat!=PIX_FMT_RGB8 && srcFormat!=PIX_FMT_BGR8 + && srcFormat!=PIX_FMT_RGB4 && srcFormat!=PIX_FMT_BGR4 + && srcFormat!=PIX_FMT_RGB4_BYTE && srcFormat!=PIX_FMT_BGR4_BYTE) c->chrSrcHSubSample=1; if(param){ diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index a8616ef..61f8705 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2296,12 +2296,10 @@ static inline void RENAME(palToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, assert(src1 == src2); for(i=0; i>9; - dstV[i]= p>>17; + dstU[i]= p>>8; + dstV[i]= p>>16; } } -- 2.7.4