mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 21:20:41 +00:00
improve horizontal chroma resolution with pal
Originally committed as revision 22994 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
21c08a3f1c
commit
fa65e2f63a
@ -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){
|
||||
|
@ -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<width; i++)
|
||||
{
|
||||
int d0= src1[2*i ];
|
||||
int d1= src1[2*i+1];
|
||||
int p = (pal[d0]&0xFF00FF) + (pal[d1]&0xFF00FF);
|
||||
int p= pal[src1[i]];
|
||||
|
||||
dstU[i]= (pal[d0]+pal[d1]-p)>>9;
|
||||
dstV[i]= p>>17;
|
||||
dstU[i]= p>>8;
|
||||
dstV[i]= p>>16;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user